diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index edb05325..e2a3b26f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -76,6 +76,40 @@ git push -u origin Branch_Name - Go to your repository in browser and click on compare and pull requests. Then add a title and description to your pull request that explains your contribution. +### Alternatively, contribute using GitHub Desktop + +1. **Open GitHub Desktop:** + Launch GitHub Desktop and log in to your GitHub account if you haven't already. + +2. **Clone the Repository:** + - If you haven't cloned the APIVerse repository yet, you can do so by clicking on the "File" menu and selecting "Clone Repository." + - Choose the APIVerse repository from the list of repositories on GitHub and clone it to your local machine. + +3. **Switch to the Correct Branch:** + - Ensure you are on the branch that you want to submit a pull request for. + - If you need to switch branches, you can do so by clicking on the "Current Branch" dropdown menu and selecting the desired branch. + +4. **Make Changes:** + Make your changes to the code or files in the repository using your preferred code editor. + +5. **Commit Changes:** + - In GitHub Desktop, you'll see a list of the files you've changed. Check the box next to each file you want to include in the commit. + - Enter a summary and description for your changes in the "Summary" and "Description" fields, respectively. Click the "Commit to " button to commit your changes to the local branch. + +6. **Push Changes to GitHub:** + After committing your changes, click the "Push origin" button in the top right corner of GitHub Desktop to push your changes to your forked repository on GitHub. + +7. **Create a Pull Request:** + - Go to the GitHub website and navigate to your fork of the APIVerse repository. + - You should see a button to "Compare & pull request" between your fork and the original repository. Click on it. + +8. **Review and Submit:** + - On the pull request page, review your changes and add any additional information, such as a title and description, that you want to include with your pull request. + - Once you're satisfied, click the "Create pull request" button to submit your pull request. + +9. **Wait for Review:** + Your pull request will now be available for review by the project maintainers. They may provide feedback or ask for changes before merging your pull request into the main branch of the APIVerse repository. + ### Need more help?🤔 You can refer to the following articles on basics of Git and Github and also contact the Project Mentors, diff --git a/Existing_API_Collection/Anime Api/README.md b/Existing_API_Collection/Anime Api/README.md new file mode 100644 index 00000000..eff84643 --- /dev/null +++ b/Existing_API_Collection/Anime Api/README.md @@ -0,0 +1,3 @@ +## Anime Facts Rest API + +The Anime Facts Rest API is an API written in Node.js to get anime facts. diff --git a/Existing_API_Collection/Anime Api/Src/__init__.py b/Existing_API_Collection/Anime Api/Src/__init__.py new file mode 100644 index 00000000..bbb6edb3 --- /dev/null +++ b/Existing_API_Collection/Anime Api/Src/__init__.py @@ -0,0 +1,72 @@ +""" +Base module for the anime facts rest api. The API documentation can be found at +https://chandan-02.github.io/anime-facts-rest-api/ + +Mantainer of the API: Chandan Kumar (https://github.com/chandan-02) +""" +import typing, requests, random + +from anime_api import exceptions +from anime_api.apis.anime_facts_rest_api.objects import Anime, Fact + + +class AnimeFactsRestAPI: + """ + Docs: https://chandan-02.github.io/anime-facts-rest-api/ + """ + + endpoint = "https://anime-facts-rest-api.herokuapp.com/api/v1" + + def get_animes(self) -> typing.List[Anime]: + """ + Returns a list of all animes. + """ + response = requests.get(self.endpoint) + + if response.status_code != 200: + raise exceptions.ServerError( + status_code=response.status_code, + ) + + return [ + Anime( + id=anime["anime_id"], + name=anime["anime_name"], + image=anime["anime_img"], + ) + for anime in response.json()["data"] + ] + + def get_anime_facts(self, anime_name: str) -> typing.List[Fact]: + """ + Returns a list of facts about the given anime (by it's name). + """ + response = requests.get(f"{self.endpoint}/{anime_name}") + + if response.status_code != 200: + raise exceptions.ServerError( + status_code=response.status_code + ) + + return [ + Fact(id=fact["fact_id"], fact=fact["fact"]) for fact in response.json()["data"] + ] + + def get_anime_random_fact(self, anime_name: str) -> Fact: + """ + Return a random fact about the given anime (by it's name). + """ + return random.choice(self.get_anime_facts(anime_name)) + + def get_fact(self, anime_name: str, fact_id: int) -> Fact: + """ + Returns a specific Fact by it's ID and it's anime's name. + """ + response = requests.get(f"{self.endpoint}/{anime_name}/{fact_id}") + + if response.status_code != 200: + raise exceptions.ServerError( + status_code=response.status_code, + ) + + return Fact(id=response.json()["data"]["fact_id"], fact=response.json()["data"]["fact"]) diff --git a/Existing_API_Collection/Anime Api/Src/objects.py b/Existing_API_Collection/Anime Api/Src/objects.py new file mode 100644 index 00000000..3c668aa4 --- /dev/null +++ b/Existing_API_Collection/Anime Api/Src/objects.py @@ -0,0 +1,41 @@ +from dataclasses import dataclass + +import typing + + +@dataclass +class Anime: + """ + Object representation of an anime + """ + + id: int + name: str + image: str + + @property + def facts(self): + """ + Returns a list of facts about the anime. + """ + from anime_api.apis import AnimeFactsRestAPI + + api = AnimeFactsRestAPI() + + return api.get_anime_facts(self.name) + + def __str__(self): + return self.name.replace('_', ' ').title() + + +@dataclass +class Fact: + """ + Object representation of an anime fact + """ + + id: int + fact: str + + def __str__(self): + return self.fact diff --git a/Existing_API_Collection/Anime Api/Tests/test_anime_facts_rest_api.py b/Existing_API_Collection/Anime Api/Tests/test_anime_facts_rest_api.py new file mode 100644 index 00000000..9c6e4bf2 --- /dev/null +++ b/Existing_API_Collection/Anime Api/Tests/test_anime_facts_rest_api.py @@ -0,0 +1,52 @@ +""" +Run tests for the AnimeFactsRestAPI class. + +Usage: + cd tests + poetry run python -m pytest anime_facts_rest_api.py +""" + +import typing + +from anime_api.apis.anime_facts_rest_api import AnimeFactsRestAPI +from anime_api.apis.anime_facts_rest_api.objects import Anime, Fact + + +def test_get_animes(): + """ + Test the get_animes method. Should return a list of animes. + """ + animes: typing.List[Anime] = AnimeFactsRestAPI().get_animes() + + assert isinstance( + animes, list + ), "The return type of get_animes() is not a list." + assert len(animes) > 0, "The list of animes is empty." + assert isinstance( + animes[0], Anime + ), "The list of animes does not contain objects.Anime objects." + + +def test_get_anime_facts(): + """ + Test the get_anime_facts method. Should return a list of facts. + """ + facts: typing.List[Fact] = AnimeFactsRestAPI().get_anime_facts(anime_name="naruto") + + assert isinstance( + facts, list + ), "The return type of get_anime_facts() is not a list." + assert len(facts) > 0, "The list of facts is empty." + assert isinstance( + facts[0], Fact + ), "The list of facts does not contain objects.Fact objects." + +def test_get_fact(): + """ + Test the get_fact method. Should return a single fact. + """ + fact: Fact = AnimeFactsRestAPI().get_fact(anime_name="naruto", fact_id=1) + + assert isinstance( + fact, Fact + ), "The return type of get_fact() is not a objects.Fact object." diff --git a/Existing_API_Collection/Covid19Tracker API/README.md b/Existing_API_Collection/Covid19Tracker API/README.md new file mode 100644 index 00000000..dfeb639d --- /dev/null +++ b/Existing_API_Collection/Covid19Tracker API/README.md @@ -0,0 +1,105 @@ +Sure, here's a README.md template for your COVID-19 Tracker API project: + +````markdown +# COVID-19 Tracker API + +A RESTful API for fetching COVID-19 statistics by country and globally. + +## Getting Started + +To get started with this API, follow the instructions below. + +### Prerequisites + +- Node.js and npm installed on your machine +- API key (optional, depending on the data source used) + +### Installation + +1. Clone the repository: + + ```bash + git clone https://github.com/your-username/covid19-tracker-api.git + ``` +```` + +2. Navigate to the project directory: + + ```bash + cd covid19-tracker-api + ``` + +3. Install dependencies: + + ```bash + npm install + ``` + +4. Set up environment variables (optional): + + Create a `.env` file in the root directory and add your API key (if required) as follows: + + ```env + API_KEY=your-api-key + ``` + +### Usage + +1. Start the server: + + ```bash + npm start + ``` + +2. The API endpoints are available at: + + - `/countries`: Get a list of available countries and their codes. + - `/countries/:countryCode`: Get COVID-19 statistics for a specific country. + - `/global`: Get global COVID-19 statistics. + +### Example Requests + +- Get a list of available countries: + + ```http + GET http://localhost:3000/countries + ``` + +- Get COVID-19 statistics for a specific country (replace `:countryCode` with the country code, e.g., "US" for the United States): + + ```http + GET http://localhost:3000/countries/:countryCode + ``` + +- Get global COVID-19 statistics: + ```http + GET http://localhost:3000/global + ``` + +### Response Format + +The API responses are in JSON format and include fields such as total cases, active cases, deaths, and recoveries. + +Example response for `/countries/:countryCode`: + +```json +{ + "country": "United States", + "cases": 1000000, + "deaths": 50000, + "recovered": 800000 +} +``` + +## Contributing + +Contributions are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request. + +## License + +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. + +``` + +Feel free to customize this README template to include additional information or specific instructions relevant to your project setup and usage. +``` diff --git a/Existing_API_Collection/Covid19Tracker API/index.html b/Existing_API_Collection/Covid19Tracker API/index.html new file mode 100644 index 00000000..6810579a --- /dev/null +++ b/Existing_API_Collection/Covid19Tracker API/index.html @@ -0,0 +1,62 @@ + + + + + + + COVID-19 Tracker + + + + +
+

COVID-19 Tracker

+
+ + +
+
+
+

+
+ Total Cases: + +
+
+ Active Cases: + +
+
+ Deaths: + +
+
+ Recoveries: + +
+
+
+

Global Statistics

+
+ Total Cases: + +
+
+ Active Cases: + +
+
+ Deaths: + +
+
+ Recoveries: + +
+
+
+
+ + + + \ No newline at end of file diff --git a/Existing_API_Collection/Covid19Tracker API/script.js b/Existing_API_Collection/Covid19Tracker API/script.js new file mode 100644 index 00000000..03bbaa46 --- /dev/null +++ b/Existing_API_Collection/Covid19Tracker API/script.js @@ -0,0 +1,58 @@ +const countrySelect = document.getElementById('country'); +const selectedCountry = document.getElementById('selected-country'); +const totalCases = document.getElementById('total-cases'); +const activeCases = document.getElementById('active-cases'); +const deaths = document.getElementById('deaths'); +const recoveries = document.getElementById('recoveries'); +const globalTotalCases = document.getElementById('global-total-cases'); +const globalActiveCases = document.getElementById('global-active-cases'); +const globalDeaths = document.getElementById('global-deaths'); +const globalRecoveries = document.getElementById('global-recoveries'); + +// Fetch countries data and populate the dropdown +fetch('https://disease.sh/v3/covid-19/countries') + .then(response => response.json()) + .then(data => { + data.forEach(country => { + const option = document.createElement('option'); + option.value = country.country; + option.textContent = country.country; + countrySelect.appendChild(option); + }); + }); + +// Function to fetch and display statistics for a specific country +function fetchCountryStatistics(country) { + fetch(`https://disease.sh/v3/covid-19/countries/${country}`) + .then(response => response.json()) + .then(data => { + selectedCountry.textContent = data.country; + totalCases.textContent = data.cases; + activeCases.textContent = data.active; + deaths.textContent = data.deaths; + recoveries.textContent = data.recovered; + }); +} + +// Function to fetch and display global statistics +function fetchGlobalStatistics() { + fetch('https://disease.sh/v3/covid-19/all') + .then(response => response.json()) + .then(data => { + globalTotalCases.textContent = data.cases; + globalActiveCases.textContent = data.active; + globalDeaths.textContent = data.deaths; + globalRecoveries.textContent = data.recovered; + }); +} + +// Event listener for country selection +countrySelect.addEventListener('change', () => { + const selectedCountryValue = countrySelect.value; + if (selectedCountryValue) { + fetchCountryStatistics(selectedCountryValue); + } +}); + +// Initial fetch for global statistics +fetchGlobalStatistics(); diff --git a/Existing_API_Collection/Covid19Tracker API/style.css b/Existing_API_Collection/Covid19Tracker API/style.css new file mode 100644 index 00000000..3907bc83 --- /dev/null +++ b/Existing_API_Collection/Covid19Tracker API/style.css @@ -0,0 +1,72 @@ +body { + font-family: Arial, sans-serif; + margin: 0; + padding: 0; + background-color: #f0f0f0; +} + +.container { + max-width: 800px; + margin: 50px auto; + background-color: #fff; + padding: 20px; + border-radius: 10px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); +} + +h1 { + text-align: center; + text-decoration: underline; + margin-bottom: 20px; + color: #333; +} + +h2 { + text-decoration: underline; + margin-bottom: 2rem; + color: #333; +} + +.input-container { + margin-bottom: 20px; +} + +label { + font-weight: bold; + padding: 1.2rem; + margin-right: 0.2rem; + font-size: 1.5rem; +} + +select { + padding: 5px; + font-size: 16px; +} + +.statistics-container { + display: flex; + justify-content: space-between; +} + +.country-statistics, +.global-statistics { + flex: 1; + padding: 10px; + background-color: #f5f5f5; + border-radius: 5px; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); +} + +h2 { + margin-bottom: 10px; + color: #333; +} + +.statistic { + margin-bottom: 5px; +} + +.label { + font-weight: bold; + margin-right: 5px; +} \ No newline at end of file diff --git a/Existing_API_Collection/FreeMealsDB/index.html b/Existing_API_Collection/FreeMealsDB/index.html new file mode 100644 index 00000000..78a5adc5 --- /dev/null +++ b/Existing_API_Collection/FreeMealsDB/index.html @@ -0,0 +1,32 @@ + + + + + + FreeMealDB Search + + + +

FreeMealDB Search

+ +
+ + +
+ +

Examples

+
+ +

Chicken

+
+
+
+ 15-minute chicken & halloumi burgers +

15-minute chicken & halloumi burgers

+
+
+ + + + + diff --git a/Existing_API_Collection/FreeMealsDB/script.js b/Existing_API_Collection/FreeMealsDB/script.js new file mode 100644 index 00000000..de72ac51 --- /dev/null +++ b/Existing_API_Collection/FreeMealsDB/script.js @@ -0,0 +1,75 @@ +async function searchDishes() { + const searchInput = document.getElementById("searchInput").value.trim(); + const resultsDiv = document.getElementById("results"); + resultsDiv.innerHTML = ""; + + if (searchInput === "") { + return; + } + + try { + const response = await fetch( + `https://www.themealdb.com/api/json/v1/1/filter.php?c=${searchInput}` + ); + const data = await response.json(); + + if (!data.meals) { + console.log(data); + if (data.meals === null) { + resultsDiv.innerHTML = "

No results found.

"; + } else { + resultsDiv.innerHTML = "

Error: Unexpected response format.

"; + } + return; + } + + for (const meal of data.meals) { + const resultItem = document.createElement("div"); + resultItem.classList.add("result-item"); + + const mealImage = document.createElement("img"); + mealImage.src = meal.strMealThumb; + mealImage.alt = meal.strMeal; + resultItem.appendChild(mealImage); + + const mealName = document.createElement("p"); + mealName.textContent = meal.strMeal; + resultItem.appendChild(mealName); + + + + resultsDiv.appendChild(resultItem); + } + } catch (error) { + console.error("Error fetching data:", error); + resultsDiv.innerHTML = "

An error occurred while fetching data.

"; + } +} + +// Add event listener to search button +document.getElementById("searchButton").addEventListener("click", searchDishes); +document.getElementById('searchInput').addEventListener('keypress', (event)=> { + if (event.keyCode === 13) { + searchDishes(); + } +}); + +const categories = [ + "Beef", + "Chicken", + "Dessert", + "Lamb", + "Miscellaneous", + "Pasta", + "Pork", + "Seafood", + "Side", + "Starter", + "Vegan", + "Vegetarian", +]; +let examples = document.querySelector(".options"); +examples.innerHTML = ``; +categories.forEach((category) => { + examples.innerHTML += `

${category}

`; +}); diff --git a/Existing_API_Collection/FreeMealsDB/style.css b/Existing_API_Collection/FreeMealsDB/style.css new file mode 100644 index 00000000..ef8ef203 --- /dev/null +++ b/Existing_API_Collection/FreeMealsDB/style.css @@ -0,0 +1,76 @@ +body { + font-family: Arial, sans-serif; + margin: 20px; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + min-height: 99vh; + background: wheat; + + } + + h1 { + text-align: center; + } + + .search-container { + text-align: center; + margin-bottom: 20px; + } + + input[type="text"] { + padding: 10px; + width: 300px; + } + + button { + padding: 10px 20px; + background-color: #4CAF50; + color: white; + border: none; + cursor: pointer; + } + + button:hover { + background-color: #45a049; + } + + .results { + display: flex; + flex-wrap: wrap; + justify-content: center; + } + + .result-item { + margin: 10px; + height: 300px; + width: 200px; + background: rgb(248, 244, 244); + border-radius: 10px; + font-size: 20px; + + } + + .result-item img { + width: 200px; + height: 200px; + object-fit: cover; + border-radius: 10px 10px 0 0; + } + .options{ + display: flex; + flex-wrap: wrap; + min-width: 60vw; + justify-content: center; + gap: 10px; + } + + .options p{ + background: #000; + color: white; + padding: 10px 20px; + border-radius: 20px; + margin: 0; + + } \ No newline at end of file diff --git a/Existing_API_Collection/Genderize_API/README.md b/Existing_API_Collection/Genderize_API/README.md new file mode 100644 index 00000000..469d6e02 --- /dev/null +++ b/Existing_API_Collection/Genderize_API/README.md @@ -0,0 +1,39 @@ +# Predict Gender By Name (Genderize API) + +A simple web application that predicts the gender of a person based on their name using the Genderize API. + +## Tech Stack + +- HTML + +- CSS + +- JS + +## API used + +[Genderize Api](https://genderize.io/) + +## Usage + +1. Clone the repository: + +2. Open the `index.html` file in your web browser. + +3. Enter a name in the input field and click on the predict button + +4. The application sends a request to the Genderize API. + +5. The predicted gender and probability are displayed on the web page. + + + +## Use case + +- User Demographics Analysis: Segment email subscribers by gender for targeted marketing campaigns. +- Content Personalization: Recommend relevant content based on predicted gender. +- Customer Service Enhancement: Tailor chatbot responses to provide a personalized user experience. + +## Screenshot + +![alt text](image.png) \ No newline at end of file diff --git a/Existing_API_Collection/Genderize_API/female.svg b/Existing_API_Collection/Genderize_API/female.svg new file mode 100644 index 00000000..29007492 --- /dev/null +++ b/Existing_API_Collection/Genderize_API/female.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Existing_API_Collection/Genderize_API/image.png b/Existing_API_Collection/Genderize_API/image.png new file mode 100644 index 00000000..d417f174 Binary files /dev/null and b/Existing_API_Collection/Genderize_API/image.png differ diff --git a/Existing_API_Collection/Genderize_API/index.html b/Existing_API_Collection/Genderize_API/index.html new file mode 100644 index 00000000..5c476eae --- /dev/null +++ b/Existing_API_Collection/Genderize_API/index.html @@ -0,0 +1,34 @@ + + + + + Predict Gender By Name + + + + + + +
+

Predict Gender By Name

+
+ + +
+
+
+
+
+
+ + + + diff --git a/Existing_API_Collection/Genderize_API/male.svg b/Existing_API_Collection/Genderize_API/male.svg new file mode 100644 index 00000000..ad82b39e --- /dev/null +++ b/Existing_API_Collection/Genderize_API/male.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Existing_API_Collection/Genderize_API/script.js b/Existing_API_Collection/Genderize_API/script.js new file mode 100644 index 00000000..e7ae77e0 --- /dev/null +++ b/Existing_API_Collection/Genderize_API/script.js @@ -0,0 +1,40 @@ +let url = "https://api.genderize.io?name="; +let wrapper = document.getElementById("wrapper"); +let predictGender = () => { + let name = document.getElementById("name").value; + let error = document.getElementById("error"); + let finalURL = url + name; + console.log(name); + console.log(finalURL); + wrapper.innerHTML = ""; + error.innerHTML = ""; + //Check if input field is not empty and the entered name does not contain anything but alphabets. + if (name.length > 0 && /^[A-Za-z]+$/.test(name)) { + fetch(finalURL) + .then((resp) => resp.json()) + .then((data) => { + console.log(data); + let div = document.createElement("div"); + div.setAttribute("id", "info"); + div.innerHTML = `

${data.name}

${data.gender}

Probability: ${data.probability}

`; + wrapper.append(div); + if (data.gender == "female") { + div.classList.add("female"); + document + .getElementById("gender-icon") + .setAttribute("src", "female.svg"); + } else { + div.classList.add("male"); + document + .getElementById("gender-icon") + .setAttribute("src", "male.svg"); + } + }); + document.getElementById("name").value = ""; + } else { + error.innerHTML = "Enter a valid name with no spaces"; + } +}; + +document.getElementById("submit").addEventListener("click", predictGender); +window.addEventListener("load", predictGender); diff --git a/Existing_API_Collection/Genderize_API/style.css b/Existing_API_Collection/Genderize_API/style.css new file mode 100644 index 00000000..222ca195 --- /dev/null +++ b/Existing_API_Collection/Genderize_API/style.css @@ -0,0 +1,84 @@ +* { + padding: 0; + margin: 0; + box-sizing: border-box; + font-family: "Poppins", sans-serif; +} +body { + background-color: #041e70; +} +.container { + position: absolute; + background-color: #8de19b; + width: 90%; + max-width: 31.25em; + transform: translate(-50%, -50%); + top: 50%; + left: 50%; + padding: 3em 2em; + border-radius: 0.5em; +} +.app-title { + font-weight: 400; + text-transform: uppercase; + text-align: center; + width: 80%; + position: relative; + margin: auto; + color: #020332; + letter-spacing: 0.2em; +} +.input-wrapper { + display: grid; + grid-template-columns: 9fr 3fr; + gap: 1em; + margin: 2.5em 0; +} +#name, +#submit { + font-size: 1em; +} +#name { + padding: 0.8em 0.5em; + border: 1px solid #020332; + border-radius: 0.5em; +} +#submit { + background-color: #7e5eff; + color: #ffffff; + border: none; + border-radius: 0.5em; +} +.female { + background-color: #ff5f96; +} +.male { + background-color: #5a72e9; +} +#info { + padding: 2em 1em; + text-align: center; + border-radius: 0.9em; +} +#result-name { + text-transform: capitalize; + font-weight: 500; + color: #edecec; +} +#gender-icon { + display: block; + width: 5em; + position: relative; + margin: 2em auto 1em auto; +} +#gender { + color: #ffffff; + font-weight: 400; + text-transform: uppercase; + letter-spacing: 0.2em; +} +#prob { + letter-spacing: 0.2em; + font-weight: 500; + color: #edecec; +} diff --git a/Existing_API_Collection/IMDb_Movie_Searcher/README.md b/Existing_API_Collection/IMDb_Movie_Searcher/README.md new file mode 100644 index 00000000..1d3253b0 --- /dev/null +++ b/Existing_API_Collection/IMDb_Movie_Searcher/README.md @@ -0,0 +1,55 @@ +## Movie Search App + +### Overview + +This project is a simple web application that utilizes the OMDB API to allow users to search for movies and view detailed information about them. Users can search for movies by title, and the application dynamically fetches data from the OMDB API to display movie posters, titles, years, and other details in a user-friendly format. + +### Features + +- **Search Functionality:** Users can enter a movie title in the search input and click the "Search" button or press Enter to fetch relevant movies. +- **Movie Details Modal:** Clicking on "See details" in each movie card opens a modal displaying additional information such as plot summary, release date, genre, ratings, and more. +- **Responsive Design:** The application is designed using Bootstrap 4, ensuring it works well across different devices and screen sizes. +- **Error Handling:** Provides error messages if the API request fails or no movies match the search criteria. + +### Tech Stack + +- **HTML:** Provides the structure of the webpage. +- **CSS (Bootstrap):** Styles the webpage for a modern and responsive layout. +- **JavaScript (jQuery):** Handles API requests to OMDB, updates the DOM based on search results, and manages interactions like modal display. + +### Setup + +To run this project locally: + +1. Clone the repository. +2. Open `index.html` in your web browser. + +### Usage + +1. Enter a movie title in the search input field. +2. Click the "Search" button or press Enter. +3. Browse through the list of movies displayed. +4. Click on "See details" to view more information about a specific movie. + +### API Key + +You need to obtain an API key from OMDB (or use your own if you have one) and replace `'apikey': '166b57cd'` in `script.js` with your key. + +### File Structure + +- `index.html`: Main HTML file defining the structure and content of the webpage. +- `style.css`: Custom CSS styles for enhancing the appearance and layout. +- `script.js`: JavaScript file containing the logic for interacting with the OMDB API and handling user actions. + +### Credits + +- **Bootstrap:** Used for styling and responsive design. +- **OMDB API:** Provides movie data for search and details. + +### Demo + +![Output](image.png) + +### License + +This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. diff --git a/Existing_API_Collection/IMDb_Movie_Searcher/image.png b/Existing_API_Collection/IMDb_Movie_Searcher/image.png new file mode 100644 index 00000000..194f2246 Binary files /dev/null and b/Existing_API_Collection/IMDb_Movie_Searcher/image.png differ diff --git a/Existing_API_Collection/IMDb_Movie_Searcher/index.html b/Existing_API_Collection/IMDb_Movie_Searcher/index.html new file mode 100644 index 00000000..e382a4f6 --- /dev/null +++ b/Existing_API_Collection/IMDb_Movie_Searcher/index.html @@ -0,0 +1,148 @@ + + + + + + + + + + + + My Movie Search App + + + + +
+
+
+

Search for Your Favorite Movies

+
+ +
+ +
+
+
+
+ +
+ +
+ +
+
+ + + + + + + + + + + + + diff --git a/Existing_API_Collection/IMDb_Movie_Searcher/script.js b/Existing_API_Collection/IMDb_Movie_Searcher/script.js new file mode 100644 index 00000000..885d84d8 --- /dev/null +++ b/Existing_API_Collection/IMDb_Movie_Searcher/script.js @@ -0,0 +1,111 @@ +// Function to perform movie search +function searchMovie() { + $("#movie-list").html(""); // Clear previous search results + $.ajax({ + url: "https://omdbapi.com", + type: "get", + dataType: "json", + data: { + apikey: "166b57cd", // Replace with your own API key + s: $("#search-input").val(), // Get search input value + }, + success: function (result) { + if (result.Response == "True") { + let movies = result.Search; + + // Loop through each movie and display card + $.each(movies, function (i, movie) { + $("#movie-list").append(` +
+
+ Poster of ${movie.Title} +
+
${movie.Title} (${movie.Year})
+ See details +
+
+
+ `); + }); + + $("#search-input").val(""); // Clear search input after displaying results + } else { + $("#movie-list").html(` +
+

${result.Error}

+
+ `); + } + }, + error: function (xhr, status, error) { + console.error("API Error:", error); // Log error to console + $("#movie-list").html(` +
+

Failed to fetch movies. Please try again later.

+
+ `); + }, + }); +} + +// Trigger search on button click +$("#search-button").on("click", function () { + searchMovie(); +}); + +// Trigger search on pressing Enter key +$("#search-input").on("keyup", function (e) { + if (e.which === 13) { + searchMovie(); + } +}); + +// Handle click on 'See details' link in movie card +$("#movie-list").on("click", ".see-detail", function () { + $.ajax({ + url: "https://omdbapi.com", + dataType: "json", + type: "get", + data: { + apikey: "166b57cd", // Replace with your own API key + i: $(this).data("id"), // Get movie ID from data attribute + }, + success: function (movie) { + if (movie.Response === "True") { + $(".modal-title").html(movie.Title); // Set modal title + $(".modal-body").html(` +
+
+
+ +
+
+
    +
  • +

    ${movie.Plot}

    +
  • +
  • Released: ${movie.Released}
  • +
  • Genre: ${movie.Genre}
  • +
  • IMDB Rating: ${movie.Ratings[0].Value}
  • +
  • Duration: ${movie.Runtime}
  • +
  • Director: ${movie.Director}
  • +
  • Actors: ${movie.Actors}
  • +
  • Awards: ${movie.Awards}
  • +
  • Visit IMDB
  • +
+
+
+
+ `); + } + }, + error: function (xhr, status, error) { + console.error("API Error:", error); // Log error to console + }, + }); +}); + +// Additional functionality for 'About' link or other actions +$("#about").on("click", function () { + // Implement if needed +}); diff --git a/Existing_API_Collection/IMDb_Movie_Searcher/style.css b/Existing_API_Collection/IMDb_Movie_Searcher/style.css new file mode 100644 index 00000000..15e3a9f0 --- /dev/null +++ b/Existing_API_Collection/IMDb_Movie_Searcher/style.css @@ -0,0 +1,188 @@ +/* Global Styles */ +body { + font-family: "Roboto", sans-serif; + background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); + color: #343a40; + margin: 0; + padding: 0; + box-sizing: border-box; +} + +h1, +h3 { + font-family: "Playfair Display", serif; +} + +/* Navbar */ +.navbar { + background-color: #007bff; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +} + +.navbar-brand { + font-size: 1.75rem; + font-weight: bold; + color: #fff; +} + +.nav-item { + font-size: 1.2rem; + color: #fff; +} + +.nav-item:hover { + color: #dfe6e9; +} + +.navbar-toggler-icon { + filter: invert(1); +} + +/* Main Content */ +.container { + padding-top: 40px; +} + +h1 { + margin-bottom: 30px; + font-size: 3rem; + color: #007bff; + text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1); +} + +.input-group { + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +} + +#search-input { + height: 50px; + border: 2px solid #007bff; + border-radius: 0; +} + +.btn { + background-color: #007bff; + color: #fff; + border: none; + height: 50px; +} + +.btn:hover { + background-color: #0056b3; + color: #fff; +} + +/* Movie Cards */ +.card { + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); + border: none; + transition: transform 0.3s ease; +} + +.card:hover { + transform: translateY(-10px); + box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); +} + +.card-title { + font-size: 1.25rem; + font-weight: bold; +} + +.card-link { + font-size: 1rem; + color: #007bff; +} + +.card-link:hover { + color: #0056b3; +} + +/* Modal */ +.modal-title { + font-size: 2rem; + font-weight: bold; + color: #007bff; +} + +.modal-body { + font-size: 1.1rem; +} + +.list-group-item { + border: none; + padding: 15px 20px; +} + +.list-group-item:first-child { + font-size: 1.25rem; + font-weight: bold; + color: #495057; +} + +.btn-primary { + background-color: #007bff; + border: none; + transition: background-color 0.3s ease; +} + +.btn-primary:hover { + background-color: #0056b3; +} + +/* Footer */ +footer { + background-color: #007bff; + color: #fff; + padding: 10px 0; +} + +footer p { + margin: 0; +} + +footer a { + color: #fff; + text-decoration: none; +} + +footer a:hover { + color: #dfe6e9; + text-decoration: underline; +} + +/* Additional Styles */ +hr { + border-top: 2px solid #007bff; + width: 60%; +} + +.input-group-append .btn { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +#movie-list .col-md-4 { + margin-bottom: 20px; +} + +#movie-list img { + border-top-left-radius: 10px; + border-top-right-radius: 10px; +} + +/* Animation for Movie Cards */ +@keyframes fadeIn { + 0% { + opacity: 0; + transform: scale(0.95); + } + 100% { + opacity: 1; + transform: scale(1); + } +} + +.card { + animation: fadeIn 0.5s ease-in-out; +} diff --git a/Existing_API_Collection/Jokegenerator_API/README.md b/Existing_API_Collection/Jokegenerator_API/README.md new file mode 100644 index 00000000..0d297d57 --- /dev/null +++ b/Existing_API_Collection/Jokegenerator_API/README.md @@ -0,0 +1,24 @@ +# Random Jokes API +Welcome to the Joke Generator API! This API offers an innovative approach to accessing an this api is use for the generating random joke and which helps for bigger to learn the concept or how to use api + +## Features +- **Get Random Jokes:** By usinf this api you get random jokes. +## Technologies Used +- HTML +- CSS +- JavaScript +- API ( for fetching data ) + +# API Integration +This application uses `https://v2.jokeapi.dev/joke/Any?blacklistFlags=nsfw,religious,political,racist,sexist,explicit&type=single` to fetch the data. + +## Installation +To set up the Dictionary API locally, follow these steps: + +- Clone the repository +- Switch to Existing_API_Collection folder `cd Existing_API_Collection` +- Now switch to CountryAPI folder `cd Jokegenerator_API` +- Run command `.\/index.html` + +## Screenshots +![Screenshot (395)](![alt text](image.png)) diff --git a/Existing_API_Collection/Jokegenerator_API/image.png b/Existing_API_Collection/Jokegenerator_API/image.png new file mode 100644 index 00000000..81046b50 Binary files /dev/null and b/Existing_API_Collection/Jokegenerator_API/image.png differ diff --git a/Existing_API_Collection/Jokegenerator_API/index.html b/Existing_API_Collection/Jokegenerator_API/index.html new file mode 100644 index 00000000..e6a2c65e --- /dev/null +++ b/Existing_API_Collection/Jokegenerator_API/index.html @@ -0,0 +1,21 @@ + + + + + + + Document + + + +
+ 😂 +

+ hiiiiiiiiii +

+ +
+ + + + \ No newline at end of file diff --git a/Existing_API_Collection/Jokegenerator_API/script.js b/Existing_API_Collection/Jokegenerator_API/script.js new file mode 100644 index 00000000..2d92f571 --- /dev/null +++ b/Existing_API_Collection/Jokegenerator_API/script.js @@ -0,0 +1,15 @@ +const jokeContainer = document.getElementById("joke"); +const btn = document.getElementById("btn"); +const url = "https://v2.jokeapi.dev/joke/Any?blacklistFlags=nsfw,religious,political,racist,sexist,explicit&type=single"; + +let getJoke = () => { + jokeContainer.classList.remove("fade"); + fetch(url) + .then(data => data.json()) + .then(item =>{ + jokeContainer.textContent = `${item.joke}`; + jokeContainer.classList.add("fade"); + }); +} + +getJoke(); \ No newline at end of file diff --git a/Existing_API_Collection/Jokegenerator_API/style.css b/Existing_API_Collection/Jokegenerator_API/style.css new file mode 100644 index 00000000..d87f00ad --- /dev/null +++ b/Existing_API_Collection/Jokegenerator_API/style.css @@ -0,0 +1,54 @@ +*{ padding: 0; + margin: 0; + box-sizing: border-box; +} + +body{ + background-color: rgb(63, 182, 238); +} +.wrapper{ + width: 80vmin; + padding: 50px 40px; + background-color: rgb(22, 22, 22); + position: absolute; + transform: translate(-50%, -50%); + top:50%; + left: 50%; + border-radius:5px; + box-shadow: rgba(184, 185, 185, 0.385) 20px 20px 40px ; +} +span{ + display: block; + text-align: center; + font-size: 100px; +} + +p{ + font-size: 16px; + color: white; + font-weight: 400; + text-align: center; + word-break: break-word; + line-height: 35px; + margin: 30px; + +} +button{ + + display: block; + background-color:rgb(63, 182, 238) ; + border: none; + padding:15px ; + color: aliceblue; + border-radius: 4px; + font-size: 18px; + font-weight: 600; + padding: 12px 25px; + margin:0 auto; + cursor: pointer; + +} +button:hover{ + color: black; + background-color: rgb(255, 153, 0); +} \ No newline at end of file diff --git a/Existing_API_Collection/NASA_Mars_Rover_Photos_API/README.md b/Existing_API_Collection/NASA_Mars_Rover_Photos_API/README.md new file mode 100644 index 00000000..368b4765 --- /dev/null +++ b/Existing_API_Collection/NASA_Mars_Rover_Photos_API/README.md @@ -0,0 +1,30 @@ +# Mars Rover Photos + +## Description +This is a simple web application that fetches and displays photos taken by NASA's Mars rovers. Users can select a rover and a date to view photos taken on that date. + +## Features +- Select a Mars rover (Curiosity, Opportunity, Spirit). +- Pick a date to view photos taken by the selected rover. +- Display photos in a responsive grid layout. + +## How to Generate a NASA API Key + +1. **Visit the NASA API Portal:** + Go to the [NASA API portal](https://api.nasa.gov/). + +2. **Register for an API Key:** + - Click on "Get Started". + - Fill out the registration form with your details. + - Submit the form. + +3. **Receive Your API Key:** + - Check your email for a message from NASA. + - Your API key will be included in the email. + +4. **Use the API Key:** + - Open the `script.js` file. + - Replace `DEMO_KEY` with your actual NASA API key. + +## Screenshots +![Screenshot 2024-07-28 123553](https://github.com/user-attachments/assets/ee926729-2227-4647-8d71-085ec1360534) diff --git a/Existing_API_Collection/NASA_Mars_Rover_Photos_API/index.html b/Existing_API_Collection/NASA_Mars_Rover_Photos_API/index.html new file mode 100644 index 00000000..bcd52442 --- /dev/null +++ b/Existing_API_Collection/NASA_Mars_Rover_Photos_API/index.html @@ -0,0 +1,29 @@ + + + + + + Mars Rover Photos + + + +
+

Mars Rover Photos

+
+ + + + + + + +
+
+
+ + + diff --git a/Existing_API_Collection/NASA_Mars_Rover_Photos_API/script.js b/Existing_API_Collection/NASA_Mars_Rover_Photos_API/script.js new file mode 100644 index 00000000..f1237520 --- /dev/null +++ b/Existing_API_Collection/NASA_Mars_Rover_Photos_API/script.js @@ -0,0 +1,28 @@ +const API_KEY = 'DEMO_KEY'; // Replace with your NASA API key + +async function fetchPhotos() { + const rover = document.getElementById('rover').value; + const date = document.getElementById('date').value; + + const response = await fetch(`https://api.nasa.gov/mars-photos/api/v1/rovers/${rover}/photos?earth_date=${date}&api_key=${API_KEY}`); + const data = await response.json(); + + displayPhotos(data.photos); +} + +function displayPhotos(photos) { + const photosContainer = document.getElementById('photos'); + photosContainer.innerHTML = ''; + + if (photos.length === 0) { + photosContainer.innerHTML = '

No photos found for this date.

'; + return; + } + + photos.forEach(photo => { + const img = document.createElement('img'); + img.src = photo.img_src; + img.alt = `Photo by ${photo.rover.name} on ${photo.earth_date}`; + photosContainer.appendChild(img); + }); +} diff --git a/Existing_API_Collection/NASA_Mars_Rover_Photos_API/styles.css b/Existing_API_Collection/NASA_Mars_Rover_Photos_API/styles.css new file mode 100644 index 00000000..07810064 --- /dev/null +++ b/Existing_API_Collection/NASA_Mars_Rover_Photos_API/styles.css @@ -0,0 +1,49 @@ +body { + font-family: Arial, sans-serif; + background-color: #f0f0f0; + margin: 0; + padding: 0; + } + + .container { + max-width: 800px; + margin: 0 auto; + padding: 20px; + background-color: #fff; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + border-radius: 8px; + margin-top: 50px; + } + + h1 { + text-align: center; + } + + .controls { + display: flex; + justify-content: space-between; + margin-bottom: 20px; + } + + label { + margin-right: 10px; + } + + input, select, button { + padding: 10px; + margin-right: 10px; + } + + .photos { + display: flex; + flex-wrap: wrap; + gap: 10px; + } + + .photos img { + max-width: 100%; + height: auto; + border-radius: 8px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + } + \ No newline at end of file diff --git a/Existing_API_Collection/NasaAPI/index.html b/Existing_API_Collection/NasaAPI/index.html index d75a8b59..e78a4156 100644 --- a/Existing_API_Collection/NasaAPI/index.html +++ b/Existing_API_Collection/NasaAPI/index.html @@ -8,7 +8,7 @@
-

NASA Astronomy Picture of The Day

+

NASA Astronomy Picture of The Day

git@github.com:sivaprasath2004/APIVerse.git
diff --git a/Existing_API_Collection/README.md b/Existing_API_Collection/README.md index e93bd675..7af1c516 100644 --- a/Existing_API_Collection/README.md +++ b/Existing_API_Collection/README.md @@ -30,4 +30,5 @@ |[CoinGecko API](./CoinGecko_API/)| This API is use to fetch Top 100 Crypto Currencies and display comprehensive data about them with market capital, price etc.| |[Gemini API](./Gemini_API/)| The Google Gemini API is a powerful tool that leverages cutting-edge generative AI models to assist developers and businesses in various tasks. It provides functionalities such as text generation, content creation, and creative assistance.| |[Brewery_API](./Brewery_API/)| Brewery Finder API is designed to help you explore the world of breweries by providing detailed information about various breweries across different states.| +|[NASA Mars Rover Photos API](./NASA_Mars_Rover_Photos_API/)|NASA Mars Rover Photos API provides images captured by NASA's Mars rovers, including Opportunity, Curiosity, and Spirit.| |[Bhagavad_Gita_API](./Bhagavad_Gita_API/)| Bhagavad Gita API provides quotes from the Bhagavad Gita, offering wisdom and inspiration.| diff --git a/Existing_API_Collection/Task-Manager-API/README.md b/Existing_API_Collection/Task-Manager-API/README.md new file mode 100644 index 00000000..3e5460ca --- /dev/null +++ b/Existing_API_Collection/Task-Manager-API/README.md @@ -0,0 +1,35 @@ +# Task Manager API + +## Project Description + +The Task Manager API is a simple yet effective task management application built using Flask. This application allows users to create, read, update, and delete tasks. It features a clean user interface and supports basic task management operations. + +## Features + +- Add new tasks with title and description. +- View a list of tasks with options to edit or delete. +- Responsive design with a modern, dark-themed UI. +- Background image with blur effect for an enhanced visual experience. + +## Technologies Used + +- **Flask**: A lightweight WSGI web application framework for Python that provides the core functionality of the application. +- **Werkzeug**: A comprehensive WSGI web application library that Flask uses for utility functions. +- **JavaScript (Fetch API)**: Used for making asynchronous HTTP requests to the backend API. +- **CSS**: Provides styling and layout for the frontend, including responsiveness and visual effects. +- **HTML**: Structure of the user interface. + +## Installation +Ensure you have a virtual environment set up and activate it. Then, install the required dependencies: + +pip install -r requirements.txt + + +### Prerequisites + +- Python 3.9 or higher +- Flask +- Werkzeug + +## Screenshot +![alt text](image.png) \ No newline at end of file diff --git a/Existing_API_Collection/Task-Manager-API/image.png b/Existing_API_Collection/Task-Manager-API/image.png new file mode 100644 index 00000000..536f0ef2 Binary files /dev/null and b/Existing_API_Collection/Task-Manager-API/image.png differ diff --git a/Existing_API_Collection/Task-Manager-API/main.py b/Existing_API_Collection/Task-Manager-API/main.py new file mode 100644 index 00000000..d5112a63 --- /dev/null +++ b/Existing_API_Collection/Task-Manager-API/main.py @@ -0,0 +1,65 @@ +from flask import Flask, request, jsonify, send_from_directory +from flask_cors import CORS +import os + +app = Flask(__name__, static_folder='static') +CORS(app) + +# Sample data: list of tasks +tasks = [ + {"id": 1, "title": "Task 1", "description": "Description of Task 1", "done": False}, + {"id": 2, "title": "Task 2", "description": "Description of Task 2", "done": False} +] + +# Serve the index.html +@app.route('/') +def index(): + return send_from_directory(app.static_folder, 'index.html') + +# Get all tasks +@app.route('/tasks', methods=['GET']) +def get_tasks(): + return jsonify(tasks) + +# Get a specific task by ID +@app.route('/tasks/', methods=['GET']) +def get_task(task_id): + task = next((task for task in tasks if task["id"] == task_id), None) + if task is None: + return jsonify({"error": "Task not found"}), 404 + return jsonify(task) + +# Create a new task +@app.route('/tasks', methods=['POST']) +def create_task(): + if request.is_json: + new_task = request.get_json() + new_task["id"] = len(tasks) + 1 + tasks.append(new_task) + return jsonify(new_task), 201 + else: + return jsonify({"error": "Request must be JSON"}), 400 + +# Update an existing task by ID +@app.route('/tasks/', methods=['PUT']) +def update_task(task_id): + task = next((task for task in tasks if task["id"] == task_id), None) + if task is None: + return jsonify({"error": "Task not found"}), 404 + + if request.is_json: + updates = request.get_json() + task.update(updates) + return jsonify(task) + else: + return jsonify({"error": "Request must be JSON"}), 400 + +# Delete a task by ID +@app.route('/tasks/', methods=['DELETE']) +def delete_task(task_id): + global tasks + tasks = [task for task in tasks if task["id"] != task_id] + return '', 204 + +if __name__ == '__main__': + app.run(debug=True) diff --git a/Existing_API_Collection/Task-Manager-API/requirements.txt b/Existing_API_Collection/Task-Manager-API/requirements.txt new file mode 100644 index 00000000..18aee9d9 --- /dev/null +++ b/Existing_API_Collection/Task-Manager-API/requirements.txt @@ -0,0 +1,3 @@ +Flask==2.1.2 +Werkzeug==2.0.3 +flask-cors==3.0.10 diff --git a/Existing_API_Collection/Task-Manager-API/static/bg.jpg b/Existing_API_Collection/Task-Manager-API/static/bg.jpg new file mode 100644 index 00000000..b61823d0 Binary files /dev/null and b/Existing_API_Collection/Task-Manager-API/static/bg.jpg differ diff --git a/Existing_API_Collection/Task-Manager-API/static/index.html b/Existing_API_Collection/Task-Manager-API/static/index.html new file mode 100644 index 00000000..7101dd9c --- /dev/null +++ b/Existing_API_Collection/Task-Manager-API/static/index.html @@ -0,0 +1,28 @@ + + + + + + Task Manager + + + +

Task Manager

+
+
+

Add Task

+
+ + + +
+
+
+

Tasks

+
+
+
+
+ + + diff --git a/Existing_API_Collection/Task-Manager-API/static/script.js b/Existing_API_Collection/Task-Manager-API/static/script.js new file mode 100644 index 00000000..6ff77e5b --- /dev/null +++ b/Existing_API_Collection/Task-Manager-API/static/script.js @@ -0,0 +1,108 @@ +const apiBaseURL = 'http://127.0.0.1:5000'; + +document.addEventListener('DOMContentLoaded', () => { + loadTasks(); +}); + +function loadTasks() { + fetch(`${apiBaseURL}/tasks`) + .then(response => { + console.log('Load Tasks Response:', response); + return response.json(); + }) + .then(tasks => { + const tasksDiv = document.getElementById('tasks'); + tasksDiv.innerHTML = ''; + tasks.forEach(task => { + const taskElement = document.createElement('div'); + taskElement.className = 'task'; + taskElement.innerHTML = ` +
+ ${task.title} +

${task.description}

+
+
+ + +
+ `; + tasksDiv.appendChild(taskElement); + }); + }) + .catch(error => console.error('Error loading tasks:', error)); +} + +function addTask() { + const title = document.getElementById('title').value; + const description = document.getElementById('description').value; + + fetch(`${apiBaseURL}/tasks`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ title, description, done: false }) + }) + .then(response => { + console.log('Add Task Response:', response); + return response.json(); + }) + .then(newTask => { + document.getElementById('title').value = ''; + document.getElementById('description').value = ''; + + const newTaskDiv = document.getElementById('new-task'); + newTaskDiv.innerHTML = ` +
+
+ ${newTask.title} +

${newTask.description}

+
+
+ +
+
+ `; + + loadTasks(); + }) + .catch(error => console.error('Error adding task:', error)); +} + +function removeNewTask() { + document.getElementById('new-task').innerHTML = ''; +} + +function editTask(taskId) { + const newTitle = prompt('Enter new title:'); + const newDescription = prompt('Enter new description:'); + + if (newTitle && newDescription) { + fetch(`${apiBaseURL}/tasks/${taskId}`, { + method: 'PUT', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ title: newTitle, description: newDescription }) + }) + .then(response => { + console.log('Edit Task Response:', response); + return response.json(); + }) + .then(() => { + loadTasks(); + }) + .catch(error => console.error('Error editing task:', error)); + } +} + +function deleteTask(taskId) { + fetch(`${apiBaseURL}/tasks/${taskId}`, { + method: 'DELETE' + }) + .then(response => { + console.log('Delete Task Response:', response); + loadTasks(); + }) + .catch(error => console.error('Error deleting task:', error)); +} diff --git a/Existing_API_Collection/Task-Manager-API/static/styles.css b/Existing_API_Collection/Task-Manager-API/static/styles.css new file mode 100644 index 00000000..96815cf8 --- /dev/null +++ b/Existing_API_Collection/Task-Manager-API/static/styles.css @@ -0,0 +1,182 @@ +/* General Styles */ +body { + font-family: 'Arial', sans-serif; + background: url('bg.jpg') no-repeat center center fixed; + background-size: cover; + margin: 0; + padding: 20px; + color: #333; + display: flex; + flex-direction: column; + align-items: center; + height: 100vh; + position: relative; +} + +body::before { + content: ""; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: inherit; + filter: blur(8px); /* Add blur effect */ + z-index: -1; +} + +h1 { + text-align: center; + color: #FF4500; /* Change heading color to OrangeRed */ + margin-bottom: 20px; + font-size: 4em; /* Increase heading size */ + font-family: 'Verdana', sans-serif; /* Change font to Verdana */ + text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); /* Add shadow for better readability */ +} + +.container { + display: flex; + justify-content: space-between; + gap: 20px; + width: 100%; + max-width: 1200px; /* Adjust maximum width to your preference */ +} + +.left, .right { + flex: 1; + background-color: rgba(40, 40, 40, 0.8); /* Darker background with slight transparency */ + border-radius: 8px; + padding: 20px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); +} + +.left { + max-width: 400px; +} + +.right { + max-width: 600px; +} + +h2 { + color: #007BFF; + margin-bottom: 10px; +} + +.input-container { + margin-bottom: 20px; +} + +input[type="text"] { + width: calc(100% - 22px); + padding: 10px; + margin: 10px 0; + border: 1px solid #ddd; + border-radius: 5px; + font-size: 16px; + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); +} + +button { + padding: 10px 20px; + border: none; + border-radius: 5px; + font-size: 16px; + cursor: pointer; + background-color: #007BFF; + color: white; + margin-top: 10px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +} + +button:hover { + background-color: #0056b3; +} + +#tasks, #new-task { + margin-top: 20px; +} + +.task { + background-color: rgba(255, 255, 255, 0.9); /* Slightly transparent background */ + border: 1px solid #ddd; + padding: 15px; + margin: 10px 0; + border-radius: 8px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); + transition: background-color 0.3s; +} + +.task:hover { + background-color: #f9f9f9; +} + +.task strong { + font-size: 18px; + color: #333; +} + +.task p { + font-size: 14px; + color: #666; + margin: 5px 0; +} + +.task div { + display: flex; + justify-content: space-between; + align-items: center; +} + +.task button { + background-color: #28a745; + margin-left: 5px; +} + +.task button:hover { + background-color: #218838; +} + +.task button:nth-child(2) { + background-color: #dc3545; +} + +.task button:nth-child(2):hover { + background-color: #c82333; +} + +#new-task { + background-color: #e9f7f9; + border: 1px solid #b3e0e5; + padding: 15px; + border-radius: 8px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); +} + +#new-task .task { + border: none; + box-shadow: none; +} + +/* Responsive Styles */ +@media (max-width: 900px) { + .container { + flex-direction: column; + align-items: center; + } + + .left, .right { + max-width: 100%; + } +} + +@media (max-width: 600px) { + input[type="text"] { + width: calc(100% - 22px); + } + + button { + width: 100%; + padding: 15px; + } +} diff --git a/Existing_API_Collection/Youtube-Data-API/README.md b/Existing_API_Collection/Youtube-Data-API/README.md new file mode 100644 index 00000000..a1dcf646 --- /dev/null +++ b/Existing_API_Collection/Youtube-Data-API/README.md @@ -0,0 +1,29 @@ +# YouTube Video Search + +This project is a simple website that allows users to search for YouTube videos. It utilizes the YouTube Data API to fetch and display search results. + +## Features + +- Search for YouTube videos by entering keywords +- Display search results with video thumbnails, titles, and descriptions +- Click on a video to watch it directly on YouTube + +## Installation + +1. Clone the repository: `git clone https://github.com/your-username/your-repo.git` +2. Navigate to the project directory: `cd your-repo` +3. Install dependencies: `npm install` + +## Usage + +1. Obtain a YouTube Data API key from the [Google Developers Console](https://console.developers.google.com/) +2. Modify the `script.js` file and replace `YOUR_API_KEY` with your actual API key. +3. Run the html file. + +## Contributing + +Contributions are welcome! If you have any suggestions or improvements, please create a pull request. + +## License + +This project is licensed under the [MIT License](LICENSE). diff --git a/Existing_API_Collection/Youtube-Data-API/index.html b/Existing_API_Collection/Youtube-Data-API/index.html new file mode 100644 index 00000000..0c4484b0 --- /dev/null +++ b/Existing_API_Collection/Youtube-Data-API/index.html @@ -0,0 +1,18 @@ + + + + + + YouTube Video Search + + + +
+

YouTube Video Search

+ + +
+
+ + + diff --git a/Existing_API_Collection/Youtube-Data-API/script.js b/Existing_API_Collection/Youtube-Data-API/script.js new file mode 100644 index 00000000..d377c3e2 --- /dev/null +++ b/Existing_API_Collection/Youtube-Data-API/script.js @@ -0,0 +1,47 @@ +document.getElementById('search-button').addEventListener('click', function() { + const query = document.getElementById('search-input').value; + searchYouTube(query); +}); + +function searchYouTube(query) { + const apiKey = 'YOUR_API_KEY'; + const url = `https://www.googleapis.com/youtube/v3/search?part=snippet&q=${encodeURIComponent(query)}&key=${apiKey}&maxResults=10&type=video`; + + fetch(url) + .then(response => response.json()) + .then(data => { + const videoResults = document.getElementById('video-results'); + videoResults.innerHTML = ''; + + data.items.forEach(item => { + // Check if video is unavailable + if (item.snippet.title === 'Private video' || item.snippet.title === 'Deleted video') { + return; // Skip this video + } + + const videoId = item.id.videoId; + const videoTitle = item.snippet.title; + + const videoItem = document.createElement('div'); + videoItem.classList.add('video-item'); + + const videoTitleLink = document.createElement('a'); + videoTitleLink.href = `https://www.youtube.com/watch?v=${videoId}`; + videoTitleLink.target = '_blank'; + videoTitleLink.textContent = videoTitle; + videoTitleLink.classList.add('video-title'); + + const videoFrame = document.createElement('iframe'); + videoFrame.src = `https://www.youtube.com/embed/${videoId}`; + videoFrame.width = '100%'; + videoFrame.height = '360'; + videoFrame.allow = 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture'; + videoFrame.allowFullscreen = true; + + videoItem.appendChild(videoTitleLink); + videoItem.appendChild(videoFrame); + videoResults.appendChild(videoItem); + }); + }) + .catch(error => console.error('Error fetching YouTube API:', error)); +} diff --git a/Existing_API_Collection/Youtube-Data-API/style.css b/Existing_API_Collection/Youtube-Data-API/style.css new file mode 100644 index 00000000..ea45ae17 --- /dev/null +++ b/Existing_API_Collection/Youtube-Data-API/style.css @@ -0,0 +1,44 @@ +body { + font-family: Arial, sans-serif; + background-color: #f4f4f4; + margin: 0; + padding: 0; +} + +.container { + width: 80%; + margin: 50px auto; + text-align: center; +} + +#search-input { + width: 60%; + padding: 10px; + font-size: 16px; +} + +#search-button { + padding: 10px 20px; + font-size: 16px; +} + +#video-results { + margin-top: 20px; + display: grid; + grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); + grid-gap: 20px; +} + +.video-item { + background: #fff; + padding: 20px; + border-radius: 5px; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); + margin-bottom: 20px; +} + +.video-title { + font-size: 18px; + color: #333; + text-decoration: none; +} diff --git a/New_APIs/Amplify-fullstack-API/README.md b/New_APIs/Amplify-fullstack-API/README.md new file mode 100644 index 00000000..9e2efc6b --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/README.md @@ -0,0 +1,41 @@ +# Fullstack AWS React Application- + +This project is a robust fullstack web application developed with React for the frontend and integrated with AWS services for authentication, GraphQL API, and infrastructure management. The application leverages AWS capabilities to deliver a scalable, secure, and efficient solution. + +## Steps:- +1. Set up a React project and configure AWS Amplify for authentication, GraphQL API, and infrastructure management. +2. Integrate Amplify libraries into React for authentication and API interactions, implementing CRUD operations. +3. Manage state with React hooks or Redux and style components using SCSS. +4. Deploy the application using AWS Amplify Hosting and monitor performance with AWS CloudWatch. + + +## Frontend: React + +use :- npx create-react-app + +**User Interface**: The frontend is developed using React, providing a dynamic and responsive user experience. It leverages React's component-based architecture for modular and maintainable code. + +### Backend: AWS + +**Authentication:** AWS Amplify is used for implementing user authentication. It supports various sign-in methods, including email, social logins, and multi-factor authentication (MFA), ensuring secure user access. + +**GraphQL API:** AWS AppSync provides a fully managed GraphQL API, allowing for efficient data querying and real-time updates. It simplifies interactions with the database and supports offline data synchronization. + +### IAM Roles and Users: + +**IAM Integration:** AWS Identity and Access Management (IAM) is used to manage permissions and control access to AWS resources. IAM roles and users are configured to ensure secure and precise access controls for different parts of the application. + +**Access Management:** Granular access policies are set up for different AWS services, enhancing security and operational efficiency. + +### Deployment & Infrastructure: + +**Hosting:**The application is deployed on AWS Amplify, providing a streamlined deployment process with continuous integration and delivery (CI/CD) capabilities. + +**Serverless Functions:**AWS Lambda functions are employed to handle backend logic and integrate with the GraphQL API, supporting a serverless architecture that scales automatically. + +**Project Strucutre:** + +Screenshot 2024-07-27 at 1 36 20 PM + + + diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/amplify-meta.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/amplify-meta.json new file mode 100644 index 00000000..5b3a5532 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/amplify-meta.json @@ -0,0 +1,111 @@ +{ + "providers": { + "awscloudformation": { + "AuthRoleName": "amplify-mynotes-staging-b2b56-authRole", + "UnauthRoleArn": "arn:aws:iam::339712714202:role/amplify-mynotes-staging-b2b56-unauthRole", + "AuthRoleArn": "arn:aws:iam::339712714202:role/amplify-mynotes-staging-b2b56-authRole", + "Region": "ap-southeast-2", + "DeploymentBucketName": "amplify-mynotes-staging-b2b56-deployment", + "UnauthRoleName": "amplify-mynotes-staging-b2b56-unauthRole", + "StackName": "amplify-mynotes-staging-b2b56", + "StackId": "arn:aws:cloudformation:ap-southeast-2:339712714202:stack/amplify-mynotes-staging-b2b56/5d40cab0-4b32-11ef-8fd8-06f396c97ee1", + "AmplifyAppId": "d2nrrgvsn5u7rq" + } + }, + "api": { + "mynotes": { + "dependsOn": [], + "output": { + "authConfig": { + "additionalAuthenticationProviders": [], + "defaultAuthentication": { + "apiKeyConfig": { + "apiKeyExpirationDays": 7 + }, + "authenticationType": "API_KEY" + } + }, + "GraphQLAPIIdOutput": "cye6ubdc6bgxddnh7pcgwbmubi", + "GraphQLAPIEndpointOutput": "https://n5edpqals5aohotum3xa72osli.appsync-api.ap-southeast-2.amazonaws.com/graphql", + "GraphQLAPIKeyOutput": "da2-kehm2qcqofd3besloumulb5vlm" + }, + "providerPlugin": "awscloudformation", + "service": "AppSync", + "lastPushTimeStamp": "2024-07-26T15:57:37.537Z", + "providerMetadata": { + "s3TemplateURL": "https://s3.amazonaws.com/amplify-mynotes-staging-b2b56-deployment/amplify-cfn-templates/api/cloudformation-template.json", + "logicalId": "apimynotes" + } + } + }, + "auth": { + "mynotesccae4f3b": { + "customAuth": false, + "dependsOn": [], + "frontendAuthConfig": { + "mfaConfiguration": "OFF", + "mfaTypes": [ + "SMS" + ], + "passwordProtectionSettings": { + "passwordPolicyMinLength": 8, + "passwordPolicyCharacters": [] + }, + "signupAttributes": [ + "EMAIL" + ], + "socialProviders": [], + "usernameAttributes": [], + "verificationMechanisms": [ + "EMAIL" + ] + }, + "providerPlugin": "awscloudformation", + "service": "Cognito", + "output": { + "UserPoolId": "ap-southeast-2_i03FxeqOd", + "AppClientIDWeb": "6bm1hrehfqg90vta1ifbgjr00h", + "AppClientID": "1d896vivvec1d0hvqrk6lptel2", + "IdentityPoolId": "ap-southeast-2:9db4441d-2163-440e-adba-e23a3fe75fd4", + "UserPoolArn": "arn:aws:cognito-idp:ap-southeast-2:339712714202:userpool/ap-southeast-2_i03FxeqOd", + "IdentityPoolName": "mynotesccae4f3b_identitypool_ccae4f3b__staging", + "UserPoolName": "mynotesccae4f3b_userpool_ccae4f3b" + }, + "lastPushTimeStamp": "2024-07-26T15:57:44.008Z", + "providerMetadata": { + "s3TemplateURL": "https://s3.amazonaws.com/amplify-mynotes-staging-b2b56-deployment/amplify-cfn-templates/auth/mynotesccae4f3b-cloudformation-template.json", + "logicalId": "authmynotesccae4f3b" + }, + "lastPushDirHash": "Y2leA1T/brYAcNS4RPXQwBzzY/Q=" + } + }, + "function": { + "S3Triggerdc42a5d7": { + "service": "Lambda", + "providerPlugin": "awscloudformation", + "build": true, + "lastBuildTimeStamp": "2024-07-26T15:55:51.984Z", + "lastBuildType": "PROD", + "lastPackageTimeStamp": "2024-07-26T15:55:52.014Z", + "distZipFilename": "S3Triggerdc42a5d7-6a475541666d35456861-build.zip", + "s3Bucket": { + "deploymentBucketName": "amplify-mynotes-staging-b2b56-deployment", + "s3Key": "amplify-builds/S3Triggerdc42a5d7-6a475541666d35456861-build.zip" + }, + "providerMetadata": { + "s3TemplateURL": "https://s3.amazonaws.com/amplify-mynotes-staging-b2b56-deployment/amplify-cfn-templates/function/S3Triggerdc42a5d7-cloudformation-template.json", + "logicalId": "functionS3Triggerdc42a5d7" + }, + "lastPushTimeStamp": "2024-07-26T15:57:44.008Z", + "output": { + "LambdaExecutionRoleArn": "arn:aws:iam::339712714202:role/S3Triggerdc42a5d7LambdaRoledc42a5d7-staging", + "Region": "ap-southeast-2", + "Arn": "arn:aws:lambda:ap-southeast-2:339712714202:function:S3Triggerdc42a5d7-staging", + "Name": "S3Triggerdc42a5d7-staging", + "LambdaExecutionRole": "S3Triggerdc42a5d7LambdaRoledc42a5d7-staging" + }, + "lastPushDirHash": "1B2Qj8YebkkXB424dBxxW7J3vvM=" + } + }, + "storage": {} +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/cloudformation-template.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/cloudformation-template.json new file mode 100644 index 00000000..b01c0ea4 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/cloudformation-template.json @@ -0,0 +1,316 @@ +{ + "Parameters": { + "env": { + "Type": "String", + "Default": "NONE" + }, + "AppSyncApiName": { + "Type": "String", + "Default": "AppSyncSimpleTransform" + }, + "DynamoDBModelTableReadIOPS": { + "Type": "Number", + "Default": 5, + "Description": "The number of read IOPS the table should support." + }, + "DynamoDBModelTableWriteIOPS": { + "Type": "Number", + "Default": 5, + "Description": "The number of write IOPS the table should support." + }, + "DynamoDBBillingMode": { + "Type": "String", + "Default": "PAY_PER_REQUEST", + "AllowedValues": [ + "PAY_PER_REQUEST", + "PROVISIONED" + ], + "Description": "Configure @model types to create DynamoDB tables with PAY_PER_REQUEST or PROVISIONED billing modes." + }, + "DynamoDBEnablePointInTimeRecovery": { + "Type": "String", + "Default": "false", + "AllowedValues": [ + "true", + "false" + ], + "Description": "Whether to enable Point in Time Recovery on the table." + }, + "DynamoDBEnableServerSideEncryption": { + "Type": "String", + "Default": "true", + "AllowedValues": [ + "true", + "false" + ], + "Description": "Enable server side encryption powered by KMS." + }, + "S3DeploymentBucket": { + "Type": "String", + "Description": "An S3 Bucket name where assets are deployed" + }, + "S3DeploymentRootKey": { + "Type": "String", + "Description": "An S3 key relative to the S3DeploymentBucket that points to the root of the deployment directory." + } + }, + "Resources": { + "GraphQLAPI": { + "Type": "AWS::AppSync::GraphQLApi", + "Properties": { + "AuthenticationType": "API_KEY", + "Name": { + "Fn::Join": [ + "", + [ + { + "Ref": "AppSyncApiName" + }, + "-", + { + "Ref": "env" + } + ] + ] + } + } + }, + "GraphQLAPITransformerSchema3CB2AE18": { + "Type": "AWS::AppSync::GraphQLSchema", + "Properties": { + "ApiId": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "DefinitionS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "S3DeploymentBucket" + }, + "/", + { + "Ref": "S3DeploymentRootKey" + }, + "/schema.graphql" + ] + ] + } + } + }, + "GraphQLAPIDefaultApiKey215A6DD7": { + "Type": "AWS::AppSync::ApiKey", + "Properties": { + "ApiId": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "Expires": 1722608188 + } + }, + "GraphQLAPINONEDS95A13CF0": { + "Type": "AWS::AppSync::DataSource", + "Properties": { + "ApiId": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "Description": "None Data Source for Pipeline functions", + "Name": "NONE_DS", + "Type": "NONE" + } + }, + "Todo": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "Parameters": { + "DynamoDBModelTableReadIOPS": { + "Ref": "DynamoDBModelTableReadIOPS" + }, + "DynamoDBModelTableWriteIOPS": { + "Ref": "DynamoDBModelTableWriteIOPS" + }, + "DynamoDBBillingMode": { + "Ref": "DynamoDBBillingMode" + }, + "DynamoDBEnablePointInTimeRecovery": { + "Ref": "DynamoDBEnablePointInTimeRecovery" + }, + "DynamoDBEnableServerSideEncryption": { + "Ref": "DynamoDBEnableServerSideEncryption" + }, + "referencetotransformerrootstackenv10C5A902Ref": { + "Ref": "env" + }, + "referencetotransformerrootstackGraphQLAPI20497F53ApiId": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "referencetotransformerrootstackGraphQLAPINONEDS2BA9D1C8Name": { + "Fn::GetAtt": [ + "GraphQLAPINONEDS95A13CF0", + "Name" + ] + }, + "referencetotransformerrootstackS3DeploymentBucket7592718ARef": { + "Ref": "S3DeploymentBucket" + }, + "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref": { + "Ref": "S3DeploymentRootKey" + } + }, + "TemplateURL": { + "Fn::Join": [ + "", + [ + "https://s3.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "S3DeploymentBucket" + }, + "/", + { + "Ref": "S3DeploymentRootKey" + }, + "/stacks/Todo.json" + ] + ] + } + }, + "DependsOn": [ + "GraphQLAPITransformerSchema3CB2AE18" + ] + }, + "CustomResourcesjson": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "Parameters": { + "AppSyncApiId": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "AppSyncApiName": { + "Ref": "AppSyncApiName" + }, + "env": { + "Ref": "env" + }, + "S3DeploymentBucket": { + "Ref": "S3DeploymentBucket" + }, + "S3DeploymentRootKey": { + "Ref": "S3DeploymentRootKey" + } + }, + "TemplateURL": { + "Fn::Join": [ + "/", + [ + "https://s3.amazonaws.com", + { + "Ref": "S3DeploymentBucket" + }, + { + "Ref": "S3DeploymentRootKey" + }, + "stacks", + "CustomResources.json" + ] + ] + } + }, + "DependsOn": [ + "GraphQLAPI", + "GraphQLAPITransformerSchema3CB2AE18", + "Todo" + ] + } + }, + "Outputs": { + "GraphQLAPIKeyOutput": { + "Description": "Your GraphQL API ID.", + "Value": { + "Fn::GetAtt": [ + "GraphQLAPIDefaultApiKey215A6DD7", + "ApiKey" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "AWS::StackName" + }, + "GraphQLApiKey" + ] + ] + } + } + }, + "GraphQLAPIIdOutput": { + "Description": "Your GraphQL API ID.", + "Value": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "AWS::StackName" + }, + "GraphQLApiId" + ] + ] + } + } + }, + "GraphQLAPIEndpointOutput": { + "Description": "Your GraphQL API endpoint.", + "Value": { + "Fn::GetAtt": [ + "GraphQLAPI", + "GraphQLUrl" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "AWS::StackName" + }, + "GraphQLApiEndpoint" + ] + ] + } + } + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/parameters.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/parameters.json new file mode 100644 index 00000000..70c2ce98 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/parameters.json @@ -0,0 +1,7 @@ +{ + "AppSyncApiName": "mynotes", + "DynamoDBBillingMode": "PAY_PER_REQUEST", + "DynamoDBEnableServerSideEncryption": false, + "S3DeploymentBucket": "amplify-mynotes-staging-b2b56-deployment", + "S3DeploymentRootKey": "amplify-appsync-files/c0e971ea1ba703ba5054d45b1d4a7a475f98dd0a" +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.createTodo.init.1.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.createTodo.init.1.req.vtl new file mode 100644 index 00000000..df6b4cbb --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.createTodo.init.1.req.vtl @@ -0,0 +1,11 @@ +## [Start] Initialization default values. ** +$util.qr($ctx.stash.put("defaultValues", $util.defaultIfNull($ctx.stash.defaultValues, {}))) +$util.qr($ctx.stash.defaultValues.put("id", $util.autoId())) +#set( $createdAt = $util.time.nowISO8601() ) +$util.qr($ctx.stash.defaultValues.put("createdAt", $createdAt)) +$util.qr($ctx.stash.defaultValues.put("updatedAt", $createdAt)) +$util.toJson({ + "version": "2018-05-29", + "payload": {} +}) +## [End] Initialization default values. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.createTodo.postAuth.1.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.createTodo.postAuth.1.req.vtl new file mode 100644 index 00000000..2f6d422b --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.createTodo.postAuth.1.req.vtl @@ -0,0 +1,9 @@ +## [Start] Sandbox Mode Enabled, IAM Access Disabled. ** +#if( !$ctx.stash.get("hasAuth") ) + #if( $util.authType() == "API Key Authorization" ) + #return($util.toJson({})) + #end + $util.unauthorized() +#end +$util.toJson({}) +## [End] Sandbox Mode Enabled, IAM Access Disabled. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.createTodo.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.createTodo.req.vtl new file mode 100644 index 00000000..f03395e5 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.createTodo.req.vtl @@ -0,0 +1,66 @@ +## [Start] Create Request template. ** +#set( $args = $util.defaultIfNull($ctx.stash.transformedArgs, $ctx.args) ) +## Set the default values to put request ** +#set( $mergedValues = $util.defaultIfNull($ctx.stash.defaultValues, {}) ) +## copy the values from input ** +$util.qr($mergedValues.putAll($util.defaultIfNull($args.input, {}))) +## set the typename ** +$util.qr($mergedValues.put("__typename", "Todo")) +#set( $PutObject = { + "version": "2018-05-29", + "operation": "PutItem", + "attributeValues": $util.dynamodb.toMapValues($mergedValues), + "condition": $condition +} ) +#if( $args.condition ) + $util.qr($ctx.stash.conditions.add($args.condition)) +#end +## Begin - key condition ** +#if( $ctx.stash.metadata.modelObjectKey ) + #set( $keyConditionExpr = {} ) + #set( $keyConditionExprNames = {} ) + #foreach( $entry in $ctx.stash.metadata.modelObjectKey.entrySet() ) + $util.qr($keyConditionExpr.put("keyCondition$velocityCount", { + "attributeExists": false +})) + $util.qr($keyConditionExprNames.put("#keyCondition$velocityCount", "$entry.key")) + #end + $util.qr($ctx.stash.conditions.add($keyConditionExpr)) +#else + $util.qr($ctx.stash.conditions.add({ + "id": { + "attributeExists": false + } +})) +#end +## End - key condition ** +## Start condition block ** +#if( $ctx.stash.conditions && $ctx.stash.conditions.size() != 0 ) + #set( $mergedConditions = { + "and": $ctx.stash.conditions +} ) + #set( $Conditions = $util.parseJson($util.transform.toDynamoDBConditionExpression($mergedConditions)) ) + #if( $Conditions.expressionValues && $Conditions.expressionValues.size() == 0 ) + #set( $Conditions = { + "expression": $Conditions.expression, + "expressionNames": $Conditions.expressionNames +} ) + #end + ## End condition block ** +#end +#if( $Conditions ) + #if( $keyConditionExprNames ) + $util.qr($Conditions.expressionNames.putAll($keyConditionExprNames)) + #end + $util.qr($PutObject.put("condition", $Conditions)) +#end +#if( $ctx.stash.metadata.modelObjectKey ) + $util.qr($PutObject.put("key", $ctx.stash.metadata.modelObjectKey)) +#else + #set( $Key = { + "id": $util.dynamodb.toDynamoDB($mergedValues.id) +} ) + $util.qr($PutObject.put("key", $Key)) +#end +$util.toJson($PutObject) +## [End] Create Request template. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.createTodo.res.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.createTodo.res.vtl new file mode 100644 index 00000000..51199723 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.createTodo.res.vtl @@ -0,0 +1,8 @@ +## [Start] ResponseTemplate. ** +$util.qr($ctx.result.put("__operation", "Mutation")) +#if( $ctx.error ) + $util.error($ctx.error.message, $ctx.error.type) +#else + $util.toJson($ctx.result) +#end +## [End] ResponseTemplate. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.deleteTodo.postAuth.1.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.deleteTodo.postAuth.1.req.vtl new file mode 100644 index 00000000..2f6d422b --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.deleteTodo.postAuth.1.req.vtl @@ -0,0 +1,9 @@ +## [Start] Sandbox Mode Enabled, IAM Access Disabled. ** +#if( !$ctx.stash.get("hasAuth") ) + #if( $util.authType() == "API Key Authorization" ) + #return($util.toJson({})) + #end + $util.unauthorized() +#end +$util.toJson({}) +## [End] Sandbox Mode Enabled, IAM Access Disabled. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.deleteTodo.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.deleteTodo.req.vtl new file mode 100644 index 00000000..ace459bd --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.deleteTodo.req.vtl @@ -0,0 +1,58 @@ +## [Start] Delete Request template. ** +#set( $args = $util.defaultIfNull($ctx.stash.transformedArgs, $ctx.args) ) +#set( $DeleteRequest = { + "version": "2018-05-29", + "operation": "DeleteItem" +} ) +#if( $ctx.stash.metadata.modelObjectKey ) + #set( $Key = $ctx.stash.metadata.modelObjectKey ) +#else + #set( $Key = { + "id": $util.dynamodb.toDynamoDB($args.input.id) +} ) +#end +$util.qr($DeleteRequest.put("key", $Key)) +## Begin - key condition ** +#if( $ctx.stash.metadata.modelObjectKey ) + #set( $keyConditionExpr = {} ) + #set( $keyConditionExprNames = {} ) + #foreach( $entry in $ctx.stash.metadata.modelObjectKey.entrySet() ) + $util.qr($keyConditionExpr.put("keyCondition$velocityCount", { + "attributeExists": true +})) + $util.qr($keyConditionExprNames.put("#keyCondition$velocityCount", "$entry.key")) + #end + $util.qr($ctx.stash.conditions.add($keyConditionExpr)) +#else + $util.qr($ctx.stash.conditions.add({ + "id": { + "attributeExists": true + } +})) +#end +## End - key condition ** +#if( $args.condition ) + $util.qr($ctx.stash.conditions.add($args.condition)) +#end +## Start condition block ** +#if( $ctx.stash.conditions && $ctx.stash.conditions.size() != 0 ) + #set( $mergedConditions = { + "and": $ctx.stash.conditions +} ) + #set( $Conditions = $util.parseJson($util.transform.toDynamoDBConditionExpression($mergedConditions)) ) + #if( $Conditions.expressionValues && $Conditions.expressionValues.size() == 0 ) + #set( $Conditions = { + "expression": $Conditions.expression, + "expressionNames": $Conditions.expressionNames +} ) + #end + ## End condition block ** +#end +#if( $Conditions ) + #if( $keyConditionExprNames ) + $util.qr($Conditions.expressionNames.putAll($keyConditionExprNames)) + #end + $util.qr($DeleteRequest.put("condition", $Conditions)) +#end +$util.toJson($DeleteRequest) +## [End] Delete Request template. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.deleteTodo.res.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.deleteTodo.res.vtl new file mode 100644 index 00000000..51199723 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.deleteTodo.res.vtl @@ -0,0 +1,8 @@ +## [Start] ResponseTemplate. ** +$util.qr($ctx.result.put("__operation", "Mutation")) +#if( $ctx.error ) + $util.error($ctx.error.message, $ctx.error.type) +#else + $util.toJson($ctx.result) +#end +## [End] ResponseTemplate. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.updateTodo.init.1.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.updateTodo.init.1.req.vtl new file mode 100644 index 00000000..ab5766fb --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.updateTodo.init.1.req.vtl @@ -0,0 +1,9 @@ +## [Start] Initialization default values. ** +$util.qr($ctx.stash.put("defaultValues", $util.defaultIfNull($ctx.stash.defaultValues, {}))) +#set( $updatedAt = $util.time.nowISO8601() ) +$util.qr($ctx.stash.defaultValues.put("updatedAt", $updatedAt)) +$util.toJson({ + "version": "2018-05-29", + "payload": {} +}) +## [End] Initialization default values. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.updateTodo.postAuth.1.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.updateTodo.postAuth.1.req.vtl new file mode 100644 index 00000000..2f6d422b --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.updateTodo.postAuth.1.req.vtl @@ -0,0 +1,9 @@ +## [Start] Sandbox Mode Enabled, IAM Access Disabled. ** +#if( !$ctx.stash.get("hasAuth") ) + #if( $util.authType() == "API Key Authorization" ) + #return($util.toJson({})) + #end + $util.unauthorized() +#end +$util.toJson({}) +## [End] Sandbox Mode Enabled, IAM Access Disabled. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.updateTodo.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.updateTodo.req.vtl new file mode 100644 index 00000000..a1bd67d2 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.updateTodo.req.vtl @@ -0,0 +1,130 @@ +## [Start] Mutation Update resolver. ** +#set( $args = $util.defaultIfNull($ctx.stash.transformedArgs, $ctx.args) ) +## Set the default values to put request ** +#set( $mergedValues = $util.defaultIfNull($ctx.stash.defaultValues, {}) ) +## copy the values from input ** +$util.qr($mergedValues.putAll($util.defaultIfNull($args.input, {}))) +## set the typename ** +## Initialize the vars for creating ddb expression ** +#set( $expNames = {} ) +#set( $expValues = {} ) +#set( $expSet = {} ) +#set( $expAdd = {} ) +#set( $expRemove = [] ) +#if( $ctx.stash.metadata.modelObjectKey ) + #set( $Key = $ctx.stash.metadata.modelObjectKey ) +#else + #set( $Key = { + "id": $util.dynamodb.toDynamoDB($args.input.id) +} ) +#end +## Model key ** +#if( $ctx.stash.metadata.modelObjectKey ) + #set( $keyFields = [] ) + #foreach( $entry in $ctx.stash.metadata.modelObjectKey.entrySet() ) + $util.qr($keyFields.add("$entry.key")) + #end +#else + #set( $keyFields = ["id"] ) +#end +#foreach( $entry in $util.map.copyAndRemoveAllKeys($mergedValues, $keyFields).entrySet() ) + #if( !$util.isNull($ctx.stash.metadata.dynamodbNameOverrideMap) && $ctx.stash.metadata.dynamodbNameOverrideMap.containsKey("$entry.key") ) + #set( $entryKeyAttributeName = $ctx.stash.metadata.dynamodbNameOverrideMap.get("$entry.key") ) + #else + #set( $entryKeyAttributeName = $entry.key ) + #end + #if( $util.isNull($entry.value) ) + #set( $discard = $expRemove.add("#$entryKeyAttributeName") ) + $util.qr($expNames.put("#$entryKeyAttributeName", "$entry.key")) + #else + $util.qr($expSet.put("#$entryKeyAttributeName", ":$entryKeyAttributeName")) + $util.qr($expNames.put("#$entryKeyAttributeName", "$entry.key")) + $util.qr($expValues.put(":$entryKeyAttributeName", $util.dynamodb.toDynamoDB($entry.value))) + #end +#end +#set( $expression = "" ) +#if( !$expSet.isEmpty() ) + #set( $expression = "SET" ) + #foreach( $entry in $expSet.entrySet() ) + #set( $expression = "$expression $entry.key = $entry.value" ) + #if( $foreach.hasNext() ) + #set( $expression = "$expression," ) + #end + #end +#end +#if( !$expAdd.isEmpty() ) + #set( $expression = "$expression ADD" ) + #foreach( $entry in $expAdd.entrySet() ) + #set( $expression = "$expression $entry.key $entry.value" ) + #if( $foreach.hasNext() ) + #set( $expression = "$expression," ) + #end + #end +#end +#if( !$expRemove.isEmpty() ) + #set( $expression = "$expression REMOVE" ) + #foreach( $entry in $expRemove ) + #set( $expression = "$expression $entry" ) + #if( $foreach.hasNext() ) + #set( $expression = "$expression," ) + #end + #end +#end +#set( $update = {} ) +$util.qr($update.put("expression", "$expression")) +#if( !$expNames.isEmpty() ) + $util.qr($update.put("expressionNames", $expNames)) +#end +#if( !$expValues.isEmpty() ) + $util.qr($update.put("expressionValues", $expValues)) +#end +## Begin - key condition ** +#if( $ctx.stash.metadata.modelObjectKey ) + #set( $keyConditionExpr = {} ) + #set( $keyConditionExprNames = {} ) + #foreach( $entry in $ctx.stash.metadata.modelObjectKey.entrySet() ) + $util.qr($keyConditionExpr.put("keyCondition$velocityCount", { + "attributeExists": true +})) + $util.qr($keyConditionExprNames.put("#keyCondition$velocityCount", "$entry.key")) + #end + $util.qr($ctx.stash.conditions.add($keyConditionExpr)) +#else + $util.qr($ctx.stash.conditions.add({ + "id": { + "attributeExists": true + } +})) +#end +## End - key condition ** +#if( $args.condition ) + $util.qr($ctx.stash.conditions.add($args.condition)) +#end +## Start condition block ** +#if( $ctx.stash.conditions && $ctx.stash.conditions.size() != 0 ) + #set( $mergedConditions = { + "and": $ctx.stash.conditions +} ) + #set( $Conditions = $util.parseJson($util.transform.toDynamoDBConditionExpression($mergedConditions)) ) + #if( $Conditions.expressionValues && $Conditions.expressionValues.size() == 0 ) + #set( $Conditions = { + "expression": $Conditions.expression, + "expressionNames": $Conditions.expressionNames +} ) + #end + ## End condition block ** +#end +#set( $UpdateItem = { + "version": "2018-05-29", + "operation": "UpdateItem", + "key": $Key, + "update": $update +} ) +#if( $Conditions ) + #if( $keyConditionExprNames ) + $util.qr($Conditions.expressionNames.putAll($keyConditionExprNames)) + #end + $util.qr($UpdateItem.put("condition", $Conditions)) +#end +$util.toJson($UpdateItem) +## [End] Mutation Update resolver. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.updateTodo.res.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.updateTodo.res.vtl new file mode 100644 index 00000000..51199723 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Mutation.updateTodo.res.vtl @@ -0,0 +1,8 @@ +## [Start] ResponseTemplate. ** +$util.qr($ctx.result.put("__operation", "Mutation")) +#if( $ctx.error ) + $util.error($ctx.error.message, $ctx.error.type) +#else + $util.toJson($ctx.result) +#end +## [End] ResponseTemplate. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Query.getTodo.postAuth.1.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Query.getTodo.postAuth.1.req.vtl new file mode 100644 index 00000000..2f6d422b --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Query.getTodo.postAuth.1.req.vtl @@ -0,0 +1,9 @@ +## [Start] Sandbox Mode Enabled, IAM Access Disabled. ** +#if( !$ctx.stash.get("hasAuth") ) + #if( $util.authType() == "API Key Authorization" ) + #return($util.toJson({})) + #end + $util.unauthorized() +#end +$util.toJson({}) +## [End] Sandbox Mode Enabled, IAM Access Disabled. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Query.getTodo.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Query.getTodo.req.vtl new file mode 100644 index 00000000..a8d7811a --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Query.getTodo.req.vtl @@ -0,0 +1,34 @@ +## [Start] Get Request template. ** +#set( $GetRequest = { + "version": "2018-05-29", + "operation": "Query" +} ) +#if( $ctx.stash.metadata.modelObjectKey ) + #set( $expression = "" ) + #set( $expressionNames = {} ) + #set( $expressionValues = {} ) + #foreach( $item in $ctx.stash.metadata.modelObjectKey.entrySet() ) + #set( $expression = "$expression#keyCount$velocityCount = :valueCount$velocityCount AND " ) + $util.qr($expressionNames.put("#keyCount$velocityCount", $item.key)) + $util.qr($expressionValues.put(":valueCount$velocityCount", $item.value)) + #end + #set( $expression = $expression.replaceAll("AND $", "") ) + #set( $query = { + "expression": $expression, + "expressionNames": $expressionNames, + "expressionValues": $expressionValues +} ) +#else + #set( $query = { + "expression": "id = :id", + "expressionValues": { + ":id": $util.parseJson($util.dynamodb.toDynamoDBJson($ctx.args.id)) + } +} ) +#end +$util.qr($GetRequest.put("query", $query)) +#if( !$util.isNullOrEmpty($ctx.stash.authFilter) ) + $util.qr($GetRequest.put("filter", $util.parseJson($util.transform.toDynamoDBFilterExpression($ctx.stash.authFilter)))) +#end +$util.toJson($GetRequest) +## [End] Get Request template. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Query.getTodo.res.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Query.getTodo.res.vtl new file mode 100644 index 00000000..e9ef1436 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Query.getTodo.res.vtl @@ -0,0 +1,13 @@ +## [Start] Get Response template. ** +#if( $ctx.error ) + $util.error($ctx.error.message, $ctx.error.type) +#end +#if( !$ctx.result.items.isEmpty() && $ctx.result.scannedCount == 1 ) + $util.toJson($ctx.result.items[0]) +#else + #if( $ctx.result.items.isEmpty() && $ctx.result.scannedCount == 1 ) +$util.unauthorized() + #end + $util.toJson(null) +#end +## [End] Get Response template. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Query.listTodos.postAuth.1.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Query.listTodos.postAuth.1.req.vtl new file mode 100644 index 00000000..2f6d422b --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Query.listTodos.postAuth.1.req.vtl @@ -0,0 +1,9 @@ +## [Start] Sandbox Mode Enabled, IAM Access Disabled. ** +#if( !$ctx.stash.get("hasAuth") ) + #if( $util.authType() == "API Key Authorization" ) + #return($util.toJson({})) + #end + $util.unauthorized() +#end +$util.toJson({}) +## [End] Sandbox Mode Enabled, IAM Access Disabled. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Query.listTodos.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Query.listTodos.req.vtl new file mode 100644 index 00000000..01421371 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Query.listTodos.req.vtl @@ -0,0 +1,50 @@ +## [Start] List Request. ** +#set( $args = $util.defaultIfNull($ctx.stash.transformedArgs, $ctx.args) ) +#set( $limit = $util.defaultIfNull($args.limit, 100) ) +#set( $ListRequest = { + "version": "2018-05-29", + "limit": $limit +} ) +#if( $args.nextToken ) + #set( $ListRequest.nextToken = $args.nextToken ) +#end +#if( !$util.isNullOrEmpty($ctx.stash.authFilter) ) + #set( $filter = $ctx.stash.authFilter ) + #if( !$util.isNullOrEmpty($args.filter) ) + #set( $filter = { + "and": [$filter, $args.filter] +} ) + #end +#else + #if( !$util.isNullOrEmpty($args.filter) ) + #set( $filter = $args.filter ) + #end +#end +#if( !$util.isNullOrEmpty($filter) ) + #set( $filterExpression = $util.parseJson($util.transform.toDynamoDBFilterExpression($filter)) ) + #if( $util.isNullOrEmpty($filterExpression) ) + $util.error("Unable to process the filter expression", "Unrecognized Filter") + #end + #if( !$util.isNullOrBlank($filterExpression.expression) ) + #if( $filterExpression.expressionValues.size() == 0 ) + $util.qr($filterExpression.remove("expressionValues")) + #end + #set( $ListRequest.filter = $filterExpression ) + #end +#end +#if( !$util.isNull($ctx.stash.modelQueryExpression) && !$util.isNullOrEmpty($ctx.stash.modelQueryExpression.expression) ) + $util.qr($ListRequest.put("operation", "Query")) + $util.qr($ListRequest.put("query", $ctx.stash.modelQueryExpression)) + #if( !$util.isNull($args.sortDirection) && $args.sortDirection == "DESC" ) + #set( $ListRequest.scanIndexForward = false ) + #else + #set( $ListRequest.scanIndexForward = true ) + #end +#else + $util.qr($ListRequest.put("operation", "Scan")) +#end +#if( !$util.isNull($ctx.stash.metadata.index) ) + #set( $ListRequest.IndexName = $ctx.stash.metadata.index ) +#end +$util.toJson($ListRequest) +## [End] List Request. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Query.listTodos.res.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Query.listTodos.res.vtl new file mode 100644 index 00000000..ee8b6670 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Query.listTodos.res.vtl @@ -0,0 +1,7 @@ +## [Start] ResponseTemplate. ** +#if( $ctx.error ) + $util.error($ctx.error.message, $ctx.error.type) +#else + $util.toJson($ctx.result) +#end +## [End] ResponseTemplate. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onCreateTodo.postAuth.1.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onCreateTodo.postAuth.1.req.vtl new file mode 100644 index 00000000..2f6d422b --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onCreateTodo.postAuth.1.req.vtl @@ -0,0 +1,9 @@ +## [Start] Sandbox Mode Enabled, IAM Access Disabled. ** +#if( !$ctx.stash.get("hasAuth") ) + #if( $util.authType() == "API Key Authorization" ) + #return($util.toJson({})) + #end + $util.unauthorized() +#end +$util.toJson({}) +## [End] Sandbox Mode Enabled, IAM Access Disabled. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onCreateTodo.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onCreateTodo.req.vtl new file mode 100644 index 00000000..f64092d4 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onCreateTodo.req.vtl @@ -0,0 +1,6 @@ +## [Start] Subscription Request template. ** +$util.toJson({ + "version": "2018-05-29", + "payload": {} +}) +## [End] Subscription Request template. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onCreateTodo.res.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onCreateTodo.res.vtl new file mode 100644 index 00000000..62769cc6 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onCreateTodo.res.vtl @@ -0,0 +1,6 @@ +## [Start] Subscription Response template. ** +#if( !$util.isNullOrEmpty($ctx.args.filter) ) +$extensions.setSubscriptionFilter($util.transform.toSubscriptionFilter($ctx.args.filter)) +#end +$util.toJson(null) +## [End] Subscription Response template. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onDeleteTodo.postAuth.1.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onDeleteTodo.postAuth.1.req.vtl new file mode 100644 index 00000000..2f6d422b --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onDeleteTodo.postAuth.1.req.vtl @@ -0,0 +1,9 @@ +## [Start] Sandbox Mode Enabled, IAM Access Disabled. ** +#if( !$ctx.stash.get("hasAuth") ) + #if( $util.authType() == "API Key Authorization" ) + #return($util.toJson({})) + #end + $util.unauthorized() +#end +$util.toJson({}) +## [End] Sandbox Mode Enabled, IAM Access Disabled. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onDeleteTodo.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onDeleteTodo.req.vtl new file mode 100644 index 00000000..f64092d4 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onDeleteTodo.req.vtl @@ -0,0 +1,6 @@ +## [Start] Subscription Request template. ** +$util.toJson({ + "version": "2018-05-29", + "payload": {} +}) +## [End] Subscription Request template. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onDeleteTodo.res.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onDeleteTodo.res.vtl new file mode 100644 index 00000000..62769cc6 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onDeleteTodo.res.vtl @@ -0,0 +1,6 @@ +## [Start] Subscription Response template. ** +#if( !$util.isNullOrEmpty($ctx.args.filter) ) +$extensions.setSubscriptionFilter($util.transform.toSubscriptionFilter($ctx.args.filter)) +#end +$util.toJson(null) +## [End] Subscription Response template. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onUpdateTodo.postAuth.1.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onUpdateTodo.postAuth.1.req.vtl new file mode 100644 index 00000000..2f6d422b --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onUpdateTodo.postAuth.1.req.vtl @@ -0,0 +1,9 @@ +## [Start] Sandbox Mode Enabled, IAM Access Disabled. ** +#if( !$ctx.stash.get("hasAuth") ) + #if( $util.authType() == "API Key Authorization" ) + #return($util.toJson({})) + #end + $util.unauthorized() +#end +$util.toJson({}) +## [End] Sandbox Mode Enabled, IAM Access Disabled. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onUpdateTodo.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onUpdateTodo.req.vtl new file mode 100644 index 00000000..f64092d4 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onUpdateTodo.req.vtl @@ -0,0 +1,6 @@ +## [Start] Subscription Request template. ** +$util.toJson({ + "version": "2018-05-29", + "payload": {} +}) +## [End] Subscription Request template. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onUpdateTodo.res.vtl b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onUpdateTodo.res.vtl new file mode 100644 index 00000000..62769cc6 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/resolvers/Subscription.onUpdateTodo.res.vtl @@ -0,0 +1,6 @@ +## [Start] Subscription Response template. ** +#if( !$util.isNullOrEmpty($ctx.args.filter) ) +$extensions.setSubscriptionFilter($util.transform.toSubscriptionFilter($ctx.args.filter)) +#end +$util.toJson(null) +## [End] Subscription Response template. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/schema.graphql b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/schema.graphql new file mode 100644 index 00000000..987aa6a6 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/schema.graphql @@ -0,0 +1,226 @@ +type Todo { + id: ID! + name: String! + description: String + createdAt: AWSDateTime! + updatedAt: AWSDateTime! +} + +input ModelStringInput { + ne: String + eq: String + le: String + lt: String + ge: String + gt: String + contains: String + notContains: String + between: [String] + beginsWith: String + attributeExists: Boolean + attributeType: ModelAttributeTypes + size: ModelSizeInput +} + +input ModelIntInput { + ne: Int + eq: Int + le: Int + lt: Int + ge: Int + gt: Int + between: [Int] + attributeExists: Boolean + attributeType: ModelAttributeTypes +} + +input ModelFloatInput { + ne: Float + eq: Float + le: Float + lt: Float + ge: Float + gt: Float + between: [Float] + attributeExists: Boolean + attributeType: ModelAttributeTypes +} + +input ModelBooleanInput { + ne: Boolean + eq: Boolean + attributeExists: Boolean + attributeType: ModelAttributeTypes +} + +input ModelIDInput { + ne: ID + eq: ID + le: ID + lt: ID + ge: ID + gt: ID + contains: ID + notContains: ID + between: [ID] + beginsWith: ID + attributeExists: Boolean + attributeType: ModelAttributeTypes + size: ModelSizeInput +} + +input ModelSubscriptionStringInput { + ne: String + eq: String + le: String + lt: String + ge: String + gt: String + contains: String + notContains: String + between: [String] + beginsWith: String + in: [String] + notIn: [String] +} + +input ModelSubscriptionIntInput { + ne: Int + eq: Int + le: Int + lt: Int + ge: Int + gt: Int + between: [Int] + in: [Int] + notIn: [Int] +} + +input ModelSubscriptionFloatInput { + ne: Float + eq: Float + le: Float + lt: Float + ge: Float + gt: Float + between: [Float] + in: [Float] + notIn: [Float] +} + +input ModelSubscriptionBooleanInput { + ne: Boolean + eq: Boolean +} + +input ModelSubscriptionIDInput { + ne: ID + eq: ID + le: ID + lt: ID + ge: ID + gt: ID + contains: ID + notContains: ID + between: [ID] + beginsWith: ID + in: [ID] + notIn: [ID] +} + +enum ModelAttributeTypes { + binary + binarySet + bool + list + map + number + numberSet + string + stringSet + _null +} + +input ModelSizeInput { + ne: Int + eq: Int + le: Int + lt: Int + ge: Int + gt: Int + between: [Int] +} + +enum ModelSortDirection { + ASC + DESC +} + +type ModelTodoConnection { + items: [Todo]! + nextToken: String +} + +input ModelTodoFilterInput { + id: ModelIDInput + name: ModelStringInput + description: ModelStringInput + createdAt: ModelStringInput + updatedAt: ModelStringInput + and: [ModelTodoFilterInput] + or: [ModelTodoFilterInput] + not: ModelTodoFilterInput +} + +type Query { + getTodo(id: ID!): Todo + listTodos(filter: ModelTodoFilterInput, limit: Int, nextToken: String): ModelTodoConnection +} + +input ModelTodoConditionInput { + name: ModelStringInput + description: ModelStringInput + and: [ModelTodoConditionInput] + or: [ModelTodoConditionInput] + not: ModelTodoConditionInput + createdAt: ModelStringInput + updatedAt: ModelStringInput +} + +input CreateTodoInput { + id: ID + name: String! + description: String +} + +input UpdateTodoInput { + id: ID! + name: String + description: String +} + +input DeleteTodoInput { + id: ID! +} + +type Mutation { + createTodo(input: CreateTodoInput!, condition: ModelTodoConditionInput): Todo + updateTodo(input: UpdateTodoInput!, condition: ModelTodoConditionInput): Todo + deleteTodo(input: DeleteTodoInput!, condition: ModelTodoConditionInput): Todo +} + +input ModelSubscriptionTodoFilterInput { + id: ModelSubscriptionIDInput + name: ModelSubscriptionStringInput + description: ModelSubscriptionStringInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput + and: [ModelSubscriptionTodoFilterInput] + or: [ModelSubscriptionTodoFilterInput] +} + +type Subscription { + onCreateTodo(filter: ModelSubscriptionTodoFilterInput): Todo @aws_subscribe(mutations: ["createTodo"]) + onUpdateTodo(filter: ModelSubscriptionTodoFilterInput): Todo @aws_subscribe(mutations: ["updateTodo"]) + onDeleteTodo(filter: ModelSubscriptionTodoFilterInput): Todo @aws_subscribe(mutations: ["deleteTodo"]) +} diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/stacks/CustomResources.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/stacks/CustomResources.json new file mode 100644 index 00000000..01699127 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/stacks/CustomResources.json @@ -0,0 +1,61 @@ +{ + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "An auto-generated nested stack.", + "Metadata": {}, + "Parameters": { + "AppSyncApiId": { + "Type": "String", + "Description": "The id of the AppSync API associated with this project." + }, + "AppSyncApiName": { + "Type": "String", + "Description": "The name of the AppSync API", + "Default": "AppSyncSimpleTransform" + }, + "env": { + "Type": "String", + "Description": "The environment name. e.g. Dev, Test, or Production", + "Default": "NONE" + }, + "S3DeploymentBucket": { + "Type": "String", + "Description": "The S3 bucket containing all deployment assets for the project." + }, + "S3DeploymentRootKey": { + "Type": "String", + "Description": "An S3 key relative to the S3DeploymentBucket that points to the root\nof the deployment directory." + } + }, + "Resources": { + "EmptyResource": { + "Type": "Custom::EmptyResource", + "Condition": "AlwaysFalse" + } + }, + "Conditions": { + "HasEnvironmentParameter": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + ] + }, + "AlwaysFalse": { + "Fn::Equals": [ + "true", + "false" + ] + } + }, + "Outputs": { + "EmptyOutput": { + "Description": "An empty output. You may delete this if you have at least one resource above.", + "Value": "" + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/stacks/Todo.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/stacks/Todo.json new file mode 100644 index 00000000..14d8d57d --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/build/stacks/Todo.json @@ -0,0 +1,1117 @@ +{ + "Parameters": { + "DynamoDBModelTableReadIOPS": { + "Type": "Number", + "Default": 5, + "Description": "The number of read IOPS the table should support." + }, + "DynamoDBModelTableWriteIOPS": { + "Type": "Number", + "Default": 5, + "Description": "The number of write IOPS the table should support." + }, + "DynamoDBBillingMode": { + "Type": "String", + "Default": "PAY_PER_REQUEST", + "AllowedValues": [ + "PAY_PER_REQUEST", + "PROVISIONED" + ], + "Description": "Configure @model types to create DynamoDB tables with PAY_PER_REQUEST or PROVISIONED billing modes." + }, + "DynamoDBEnablePointInTimeRecovery": { + "Type": "String", + "Default": "false", + "AllowedValues": [ + "true", + "false" + ], + "Description": "Whether to enable Point in Time Recovery on the table." + }, + "DynamoDBEnableServerSideEncryption": { + "Type": "String", + "Default": "true", + "AllowedValues": [ + "true", + "false" + ], + "Description": "Enable server side encryption powered by KMS." + }, + "referencetotransformerrootstackenv10C5A902Ref": { + "Type": "String" + }, + "referencetotransformerrootstackGraphQLAPI20497F53ApiId": { + "Type": "String" + }, + "referencetotransformerrootstackGraphQLAPINONEDS2BA9D1C8Name": { + "Type": "String" + }, + "referencetotransformerrootstackS3DeploymentBucket7592718ARef": { + "Type": "String" + }, + "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref": { + "Type": "String" + } + }, + "Conditions": { + "HasEnvironmentParameter": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "referencetotransformerrootstackenv10C5A902Ref" + }, + "NONE" + ] + } + ] + }, + "ShouldUseServerSideEncryption": { + "Fn::Equals": [ + { + "Ref": "DynamoDBEnableServerSideEncryption" + }, + "true" + ] + }, + "ShouldUsePayPerRequestBilling": { + "Fn::Equals": [ + { + "Ref": "DynamoDBBillingMode" + }, + "PAY_PER_REQUEST" + ] + }, + "ShouldUsePointInTimeRecovery": { + "Fn::Equals": [ + { + "Ref": "DynamoDBEnablePointInTimeRecovery" + }, + "true" + ] + } + }, + "Resources": { + "TodoTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "AttributeDefinitions": [ + { + "AttributeName": "id", + "AttributeType": "S" + } + ], + "BillingMode": { + "Fn::If": [ + "ShouldUsePayPerRequestBilling", + "PAY_PER_REQUEST", + { + "Ref": "AWS::NoValue" + } + ] + }, + "KeySchema": [ + { + "AttributeName": "id", + "KeyType": "HASH" + } + ], + "PointInTimeRecoverySpecification": { + "Fn::If": [ + "ShouldUsePointInTimeRecovery", + { + "PointInTimeRecoveryEnabled": true + }, + { + "Ref": "AWS::NoValue" + } + ] + }, + "ProvisionedThroughput": { + "Fn::If": [ + "ShouldUsePayPerRequestBilling", + { + "Ref": "AWS::NoValue" + }, + { + "ReadCapacityUnits": { + "Ref": "DynamoDBModelTableReadIOPS" + }, + "WriteCapacityUnits": { + "Ref": "DynamoDBModelTableWriteIOPS" + } + } + ] + }, + "SSESpecification": { + "SSEEnabled": { + "Fn::If": [ + "ShouldUseServerSideEncryption", + true, + false + ] + } + }, + "StreamSpecification": { + "StreamViewType": "NEW_AND_OLD_IMAGES" + }, + "TableName": { + "Fn::Join": [ + "", + [ + "Todo-", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "-", + { + "Ref": "referencetotransformerrootstackenv10C5A902Ref" + } + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "TodoIAMRole2DA8E66E": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "appsync.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "dynamodb:BatchGetItem", + "dynamodb:BatchWriteItem", + "dynamodb:PutItem", + "dynamodb:DeleteItem", + "dynamodb:GetItem", + "dynamodb:Scan", + "dynamodb:Query", + "dynamodb:UpdateItem", + "dynamodb:ConditionCheckItem", + "dynamodb:DescribeTable", + "dynamodb:GetRecords", + "dynamodb:GetShardIterator" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Sub": [ + "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tablename}", + { + "tablename": { + "Fn::Join": [ + "", + [ + "Todo-", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "-", + { + "Ref": "referencetotransformerrootstackenv10C5A902Ref" + } + ] + ] + } + } + ] + }, + { + "Fn::Sub": [ + "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tablename}/*", + { + "tablename": { + "Fn::Join": [ + "", + [ + "Todo-", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "-", + { + "Ref": "referencetotransformerrootstackenv10C5A902Ref" + } + ] + ] + } + } + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "DynamoDBAccess" + } + ], + "RoleName": { + "Fn::Join": [ + "", + [ + "TodoIAMRolecfd440-", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "-", + { + "Ref": "referencetotransformerrootstackenv10C5A902Ref" + } + ] + ] + } + } + }, + "TodoDataSource": { + "Type": "AWS::AppSync::DataSource", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "DynamoDBConfig": { + "AwsRegion": { + "Ref": "AWS::Region" + }, + "TableName": { + "Ref": "TodoTable" + } + }, + "Name": "TodoTable", + "ServiceRoleArn": { + "Fn::GetAtt": [ + "TodoIAMRole2DA8E66E", + "Arn" + ] + }, + "Type": "AMAZON_DYNAMODB" + }, + "DependsOn": [ + "TodoIAMRole2DA8E66E" + ] + }, + "QuerygetTodopostAuth0FunctionQuerygetTodopostAuth0FunctionAppSyncFunction6BE14593": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "DataSourceName": { + "Ref": "referencetotransformerrootstackGraphQLAPINONEDS2BA9D1C8Name" + }, + "FunctionVersion": "2018-05-29", + "Name": "QuerygetTodopostAuth0Function", + "RequestMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Query.getTodo.postAuth.1.req.vtl" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson({})" + } + }, + "QueryGetTodoDataResolverFnQueryGetTodoDataResolverFnAppSyncFunctionE2B57DAD": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "DataSourceName": { + "Fn::GetAtt": [ + "TodoDataSource", + "Name" + ] + }, + "FunctionVersion": "2018-05-29", + "Name": "QueryGetTodoDataResolverFn", + "RequestMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Query.getTodo.req.vtl" + ] + ] + }, + "ResponseMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Query.getTodo.res.vtl" + ] + ] + } + }, + "DependsOn": [ + "TodoDataSource" + ] + }, + "GetTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "FieldName": "getTodo", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "QuerygetTodopostAuth0FunctionQuerygetTodopostAuth0FunctionAppSyncFunction6BE14593", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "QueryGetTodoDataResolverFnQueryGetTodoDataResolverFnAppSyncFunctionE2B57DAD", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Query\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"getTodo\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"AMAZON_DYNAMODB\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", + { + "Ref": "TodoTable" + }, + "\"))\n$util.qr($ctx.stash.put(\"identityPoolId\", \"ap-southeast-2:9db4441d-2163-440e-adba-e23a3fe75fd4\"))\n$util.qr($ctx.stash.put(\"adminRoles\", [\"ap-southeast-2_azDpi6nee_Full-access/CognitoIdentityCredentials\",\"ap-southeast-2_azDpi6nee_Manage-only/CognitoIdentityCredentials\"]))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Query" + } + }, + "QueryListTodosDataResolverFnQueryListTodosDataResolverFnAppSyncFunctionF825FE47": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "DataSourceName": { + "Fn::GetAtt": [ + "TodoDataSource", + "Name" + ] + }, + "FunctionVersion": "2018-05-29", + "Name": "QueryListTodosDataResolverFn", + "RequestMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Query.listTodos.req.vtl" + ] + ] + }, + "ResponseMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Query.listTodos.res.vtl" + ] + ] + } + }, + "DependsOn": [ + "TodoDataSource" + ] + }, + "ListTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "FieldName": "listTodos", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "QuerygetTodopostAuth0FunctionQuerygetTodopostAuth0FunctionAppSyncFunction6BE14593", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "QueryListTodosDataResolverFnQueryListTodosDataResolverFnAppSyncFunctionF825FE47", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Query\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"listTodos\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"AMAZON_DYNAMODB\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", + { + "Ref": "TodoTable" + }, + "\"))\n$util.qr($ctx.stash.put(\"identityPoolId\", \"ap-southeast-2:9db4441d-2163-440e-adba-e23a3fe75fd4\"))\n$util.qr($ctx.stash.put(\"adminRoles\", [\"ap-southeast-2_azDpi6nee_Full-access/CognitoIdentityCredentials\",\"ap-southeast-2_azDpi6nee_Manage-only/CognitoIdentityCredentials\"]))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Query" + } + }, + "MutationcreateTodoinit0FunctionMutationcreateTodoinit0FunctionAppSyncFunction54DE5B8B": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "DataSourceName": { + "Ref": "referencetotransformerrootstackGraphQLAPINONEDS2BA9D1C8Name" + }, + "FunctionVersion": "2018-05-29", + "Name": "MutationcreateTodoinit0Function", + "RequestMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Mutation.createTodo.init.1.req.vtl" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson({})" + } + }, + "MutationCreateTodoDataResolverFnMutationCreateTodoDataResolverFnAppSyncFunction900EC5CF": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "DataSourceName": { + "Fn::GetAtt": [ + "TodoDataSource", + "Name" + ] + }, + "FunctionVersion": "2018-05-29", + "Name": "MutationCreateTodoDataResolverFn", + "RequestMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Mutation.createTodo.req.vtl" + ] + ] + }, + "ResponseMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Mutation.createTodo.res.vtl" + ] + ] + } + }, + "DependsOn": [ + "TodoDataSource" + ] + }, + "CreateTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "FieldName": "createTodo", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "MutationcreateTodoinit0FunctionMutationcreateTodoinit0FunctionAppSyncFunction54DE5B8B", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "QuerygetTodopostAuth0FunctionQuerygetTodopostAuth0FunctionAppSyncFunction6BE14593", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "MutationCreateTodoDataResolverFnMutationCreateTodoDataResolverFnAppSyncFunction900EC5CF", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Mutation\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"createTodo\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"AMAZON_DYNAMODB\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", + { + "Ref": "TodoTable" + }, + "\"))\n$util.qr($ctx.stash.put(\"identityPoolId\", \"ap-southeast-2:9db4441d-2163-440e-adba-e23a3fe75fd4\"))\n$util.qr($ctx.stash.put(\"adminRoles\", [\"ap-southeast-2_azDpi6nee_Full-access/CognitoIdentityCredentials\",\"ap-southeast-2_azDpi6nee_Manage-only/CognitoIdentityCredentials\"]))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Mutation" + } + }, + "MutationupdateTodoinit0FunctionMutationupdateTodoinit0FunctionAppSyncFunction1B95BB19": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "DataSourceName": { + "Ref": "referencetotransformerrootstackGraphQLAPINONEDS2BA9D1C8Name" + }, + "FunctionVersion": "2018-05-29", + "Name": "MutationupdateTodoinit0Function", + "RequestMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Mutation.updateTodo.init.1.req.vtl" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson({})" + } + }, + "MutationUpdateTodoDataResolverFnMutationUpdateTodoDataResolverFnAppSyncFunctionBC238C49": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "DataSourceName": { + "Fn::GetAtt": [ + "TodoDataSource", + "Name" + ] + }, + "FunctionVersion": "2018-05-29", + "Name": "MutationUpdateTodoDataResolverFn", + "RequestMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Mutation.updateTodo.req.vtl" + ] + ] + }, + "ResponseMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Mutation.updateTodo.res.vtl" + ] + ] + } + }, + "DependsOn": [ + "TodoDataSource" + ] + }, + "UpdateTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "FieldName": "updateTodo", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "MutationupdateTodoinit0FunctionMutationupdateTodoinit0FunctionAppSyncFunction1B95BB19", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "QuerygetTodopostAuth0FunctionQuerygetTodopostAuth0FunctionAppSyncFunction6BE14593", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "MutationUpdateTodoDataResolverFnMutationUpdateTodoDataResolverFnAppSyncFunctionBC238C49", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Mutation\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"updateTodo\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"AMAZON_DYNAMODB\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", + { + "Ref": "TodoTable" + }, + "\"))\n$util.qr($ctx.stash.put(\"identityPoolId\", \"ap-southeast-2:9db4441d-2163-440e-adba-e23a3fe75fd4\"))\n$util.qr($ctx.stash.put(\"adminRoles\", [\"ap-southeast-2_azDpi6nee_Full-access/CognitoIdentityCredentials\",\"ap-southeast-2_azDpi6nee_Manage-only/CognitoIdentityCredentials\"]))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Mutation" + } + }, + "MutationDeleteTodoDataResolverFnMutationDeleteTodoDataResolverFnAppSyncFunction3879153F": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "DataSourceName": { + "Fn::GetAtt": [ + "TodoDataSource", + "Name" + ] + }, + "FunctionVersion": "2018-05-29", + "Name": "MutationDeleteTodoDataResolverFn", + "RequestMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Mutation.deleteTodo.req.vtl" + ] + ] + }, + "ResponseMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Mutation.deleteTodo.res.vtl" + ] + ] + } + }, + "DependsOn": [ + "TodoDataSource" + ] + }, + "DeleteTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "FieldName": "deleteTodo", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "QuerygetTodopostAuth0FunctionQuerygetTodopostAuth0FunctionAppSyncFunction6BE14593", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "MutationDeleteTodoDataResolverFnMutationDeleteTodoDataResolverFnAppSyncFunction3879153F", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Mutation\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"deleteTodo\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"AMAZON_DYNAMODB\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", + { + "Ref": "TodoTable" + }, + "\"))\n$util.qr($ctx.stash.put(\"identityPoolId\", \"ap-southeast-2:9db4441d-2163-440e-adba-e23a3fe75fd4\"))\n$util.qr($ctx.stash.put(\"adminRoles\", [\"ap-southeast-2_azDpi6nee_Full-access/CognitoIdentityCredentials\",\"ap-southeast-2_azDpi6nee_Manage-only/CognitoIdentityCredentials\"]))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Mutation" + } + }, + "SubscriptionOnCreateTodoDataResolverFnSubscriptionOnCreateTodoDataResolverFnAppSyncFunction462A70C9": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "DataSourceName": { + "Ref": "referencetotransformerrootstackGraphQLAPINONEDS2BA9D1C8Name" + }, + "FunctionVersion": "2018-05-29", + "Name": "SubscriptionOnCreateTodoDataResolverFn", + "RequestMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Subscription.onCreateTodo.req.vtl" + ] + ] + }, + "ResponseMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Subscription.onCreateTodo.res.vtl" + ] + ] + } + } + }, + "SubscriptiononCreateTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "FieldName": "onCreateTodo", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "QuerygetTodopostAuth0FunctionQuerygetTodopostAuth0FunctionAppSyncFunction6BE14593", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "SubscriptionOnCreateTodoDataResolverFnSubscriptionOnCreateTodoDataResolverFnAppSyncFunction462A70C9", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Subscription\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"onCreateTodo\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"NONE\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n\n$util.qr($ctx.stash.put(\"identityPoolId\", \"ap-southeast-2:9db4441d-2163-440e-adba-e23a3fe75fd4\"))\n$util.qr($ctx.stash.put(\"adminRoles\", [\"ap-southeast-2_azDpi6nee_Full-access/CognitoIdentityCredentials\",\"ap-southeast-2_azDpi6nee_Manage-only/CognitoIdentityCredentials\"]))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Subscription" + } + }, + "SubscriptiononUpdateTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "FieldName": "onUpdateTodo", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "QuerygetTodopostAuth0FunctionQuerygetTodopostAuth0FunctionAppSyncFunction6BE14593", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "SubscriptionOnCreateTodoDataResolverFnSubscriptionOnCreateTodoDataResolverFnAppSyncFunction462A70C9", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Subscription\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"onUpdateTodo\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"NONE\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n\n$util.qr($ctx.stash.put(\"identityPoolId\", \"ap-southeast-2:9db4441d-2163-440e-adba-e23a3fe75fd4\"))\n$util.qr($ctx.stash.put(\"adminRoles\", [\"ap-southeast-2_azDpi6nee_Full-access/CognitoIdentityCredentials\",\"ap-southeast-2_azDpi6nee_Manage-only/CognitoIdentityCredentials\"]))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Subscription" + } + }, + "SubscriptiononDeleteTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "FieldName": "onDeleteTodo", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "QuerygetTodopostAuth0FunctionQuerygetTodopostAuth0FunctionAppSyncFunction6BE14593", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "SubscriptionOnCreateTodoDataResolverFnSubscriptionOnCreateTodoDataResolverFnAppSyncFunction462A70C9", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Subscription\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"onDeleteTodo\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"NONE\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n\n$util.qr($ctx.stash.put(\"identityPoolId\", \"ap-southeast-2:9db4441d-2163-440e-adba-e23a3fe75fd4\"))\n$util.qr($ctx.stash.put(\"adminRoles\", [\"ap-southeast-2_azDpi6nee_Full-access/CognitoIdentityCredentials\",\"ap-southeast-2_azDpi6nee_Manage-only/CognitoIdentityCredentials\"]))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Subscription" + } + } + }, + "Outputs": { + "GetAttTodoTableStreamArn": { + "Description": "Your DynamoDB table StreamArn.", + "Value": { + "Fn::GetAtt": [ + "TodoTable", + "StreamArn" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "GetAtt:TodoTable:StreamArn" + ] + ] + } + } + }, + "GetAttTodoTableName": { + "Description": "Your DynamoDB table name.", + "Value": { + "Ref": "TodoTable" + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "GetAtt:TodoTable:Name" + ] + ] + } + } + }, + "GetAttTodoDataSourceName": { + "Description": "Your model DataSource name.", + "Value": { + "Fn::GetAtt": [ + "TodoDataSource", + "Name" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "GetAtt:TodoDataSource:Name" + ] + ] + } + } + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/cli-inputs.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/cli-inputs.json new file mode 100644 index 00000000..9c3f8a32 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/cli-inputs.json @@ -0,0 +1,11 @@ +{ + "version": 1, + "serviceConfiguration": { + "apiName": "mynotes", + "serviceName": "AppSync", + "defaultAuthType": { + "mode": "API_KEY", + "expirationTime": 7 + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/parameters.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/parameters.json new file mode 100644 index 00000000..41a9678f --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/parameters.json @@ -0,0 +1,5 @@ +{ + "AppSyncApiName": "mynotes", + "DynamoDBBillingMode": "PAY_PER_REQUEST", + "DynamoDBEnableServerSideEncryption": false +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/resolvers/README.md b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/resolvers/README.md new file mode 100644 index 00000000..89e564c5 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/resolvers/README.md @@ -0,0 +1,2 @@ +Any resolvers that you add in this directory will override the ones automatically generated by Amplify CLI and will be directly copied to the cloud. +For more information, visit [https://docs.amplify.aws/cli/graphql-transformer/resolvers](https://docs.amplify.aws/cli/graphql-transformer/resolvers) \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/schema.graphql b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/schema.graphql new file mode 100644 index 00000000..930fe64e --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/schema.graphql @@ -0,0 +1,11 @@ +# This "input" configures a global authorization rule to enable public access to +# all models in this schema. Learn more about authorization rules here: https://docs.amplify.aws/react/build-a-backend/graphqlapi/customize-authorization-rules/ + +input AMPLIFY { + globalAuthRule: AuthRule = { allow: public } +} # FOR TESTING ONLY! +type Todo @model { + id: ID! + name: String! + description: String +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/stacks/CustomResources.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/stacks/CustomResources.json new file mode 100644 index 00000000..f95feea3 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/stacks/CustomResources.json @@ -0,0 +1,58 @@ +{ + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "An auto-generated nested stack.", + "Metadata": {}, + "Parameters": { + "AppSyncApiId": { + "Type": "String", + "Description": "The id of the AppSync API associated with this project." + }, + "AppSyncApiName": { + "Type": "String", + "Description": "The name of the AppSync API", + "Default": "AppSyncSimpleTransform" + }, + "env": { + "Type": "String", + "Description": "The environment name. e.g. Dev, Test, or Production", + "Default": "NONE" + }, + "S3DeploymentBucket": { + "Type": "String", + "Description": "The S3 bucket containing all deployment assets for the project." + }, + "S3DeploymentRootKey": { + "Type": "String", + "Description": "An S3 key relative to the S3DeploymentBucket that points to the root\nof the deployment directory." + } + }, + "Resources": { + "EmptyResource": { + "Type": "Custom::EmptyResource", + "Condition": "AlwaysFalse" + } + }, + "Conditions": { + "HasEnvironmentParameter": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + ] + }, + "AlwaysFalse": { + "Fn::Equals": ["true", "false"] + } + }, + "Outputs": { + "EmptyOutput": { + "Description": "An empty output. You may delete this if you have at least one resource above.", + "Value": "" + } + } +} diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/transform.conf.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/transform.conf.json new file mode 100644 index 00000000..98e1e19f --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/api/mynotes/transform.conf.json @@ -0,0 +1,4 @@ +{ + "Version": 5, + "ElasticsearchWarning": true +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/auth/mynotesccae4f3b/build/mynotesccae4f3b-cloudformation-template.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/auth/mynotesccae4f3b/build/mynotesccae4f3b-cloudformation-template.json new file mode 100644 index 00000000..f062515f --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/auth/mynotesccae4f3b/build/mynotesccae4f3b-cloudformation-template.json @@ -0,0 +1,407 @@ +{ + "Description": "Amplify Cognito Stack for AWS Amplify CLI", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "env": { + "Type": "String" + }, + "identityPoolName": { + "Type": "String" + }, + "allowUnauthenticatedIdentities": { + "Type": "String" + }, + "resourceNameTruncated": { + "Type": "String" + }, + "userPoolName": { + "Type": "String" + }, + "autoVerifiedAttributes": { + "Type": "CommaDelimitedList" + }, + "mfaConfiguration": { + "Type": "String" + }, + "mfaTypes": { + "Type": "CommaDelimitedList" + }, + "smsAuthenticationMessage": { + "Type": "String" + }, + "smsVerificationMessage": { + "Type": "String" + }, + "emailVerificationSubject": { + "Type": "String" + }, + "emailVerificationMessage": { + "Type": "String" + }, + "defaultPasswordPolicy": { + "Type": "String" + }, + "passwordPolicyMinLength": { + "Type": "String" + }, + "passwordPolicyCharacters": { + "Type": "CommaDelimitedList" + }, + "requiredAttributes": { + "Type": "CommaDelimitedList" + }, + "aliasAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientGenerateSecret": { + "Type": "String" + }, + "userpoolClientRefreshTokenValidity": { + "Type": "String" + }, + "userpoolClientWriteAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientReadAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientLambdaRole": { + "Type": "String" + }, + "userpoolClientSetAttributes": { + "Type": "String" + }, + "sharedId": { + "Type": "String" + }, + "resourceName": { + "Type": "String" + }, + "authSelections": { + "Type": "String" + }, + "useDefault": { + "Type": "String" + }, + "userPoolGroupList": { + "Type": "CommaDelimitedList" + }, + "serviceName": { + "Type": "String" + }, + "usernameCaseSensitive": { + "Type": "String" + }, + "useEnabledMfas": { + "Type": "String" + }, + "authRoleArn": { + "Type": "String" + }, + "unauthRoleArn": { + "Type": "String" + }, + "breakCircularDependency": { + "Type": "String" + }, + "dependsOn": { + "Type": "CommaDelimitedList" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "UserPool": { + "Type": "AWS::Cognito::UserPool", + "Properties": { + "AutoVerifiedAttributes": [ + "email" + ], + "EmailVerificationMessage": { + "Ref": "emailVerificationMessage" + }, + "EmailVerificationSubject": { + "Ref": "emailVerificationSubject" + }, + "MfaConfiguration": { + "Ref": "mfaConfiguration" + }, + "Policies": { + "PasswordPolicy": { + "MinimumLength": { + "Ref": "passwordPolicyMinLength" + }, + "RequireLowercase": false, + "RequireNumbers": false, + "RequireSymbols": false, + "RequireUppercase": false + } + }, + "Schema": [ + { + "Mutable": true, + "Name": "email", + "Required": true + } + ], + "UserAttributeUpdateSettings": { + "AttributesRequireVerificationBeforeUpdate": [ + "email" + ] + }, + "UserPoolName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + { + "Ref": "userPoolName" + }, + { + "Fn::Join": [ + "", + [ + { + "Ref": "userPoolName" + }, + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "UsernameConfiguration": { + "CaseSensitive": false + } + } + }, + "UserPoolClientWeb": { + "Type": "AWS::Cognito::UserPoolClient", + "Properties": { + "ClientName": "mynoteccae4f3b_app_clientWeb", + "RefreshTokenValidity": { + "Ref": "userpoolClientRefreshTokenValidity" + }, + "TokenValidityUnits": { + "RefreshToken": "days" + }, + "UserPoolId": { + "Ref": "UserPool" + } + }, + "DependsOn": [ + "UserPool" + ] + }, + "UserPoolClient": { + "Type": "AWS::Cognito::UserPoolClient", + "Properties": { + "ClientName": "mynoteccae4f3b_app_client", + "GenerateSecret": { + "Ref": "userpoolClientGenerateSecret" + }, + "RefreshTokenValidity": { + "Ref": "userpoolClientRefreshTokenValidity" + }, + "TokenValidityUnits": { + "RefreshToken": "days" + }, + "UserPoolId": { + "Ref": "UserPool" + } + }, + "DependsOn": [ + "UserPool" + ] + }, + "UserPoolClientRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Action": "sts:AssumeRole" + } + ] + }, + "RoleName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + { + "Ref": "userpoolClientLambdaRole" + }, + { + "Fn::Join": [ + "", + [ + "upClientLambdaRoleccae4f3b", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + "-", + { + "Ref": "AWS::StackName" + } + ] + } + ] + }, + "-", + { + "Ref": "env" + } + ] + ] + } + ] + } + } + }, + "IdentityPool": { + "Type": "AWS::Cognito::IdentityPool", + "Properties": { + "AllowUnauthenticatedIdentities": { + "Ref": "allowUnauthenticatedIdentities" + }, + "CognitoIdentityProviders": [ + { + "ClientId": { + "Ref": "UserPoolClient" + }, + "ProviderName": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "client": { + "Ref": "UserPool" + } + } + ] + } + }, + { + "ClientId": { + "Ref": "UserPoolClientWeb" + }, + "ProviderName": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "client": { + "Ref": "UserPool" + } + } + ] + } + } + ], + "IdentityPoolName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "mynotesccae4f3b_identitypool_ccae4f3b", + { + "Fn::Join": [ + "", + [ + "mynotesccae4f3b_identitypool_ccae4f3b__", + { + "Ref": "env" + } + ] + ] + } + ] + } + } + }, + "IdentityPoolRoleMap": { + "Type": "AWS::Cognito::IdentityPoolRoleAttachment", + "Properties": { + "IdentityPoolId": { + "Ref": "IdentityPool" + }, + "Roles": { + "unauthenticated": { + "Ref": "unauthRoleArn" + }, + "authenticated": { + "Ref": "authRoleArn" + } + } + }, + "DependsOn": [ + "IdentityPool" + ] + } + }, + "Outputs": { + "IdentityPoolId": { + "Description": "Id for the identity pool", + "Value": { + "Ref": "IdentityPool" + } + }, + "IdentityPoolName": { + "Value": { + "Fn::GetAtt": [ + "IdentityPool", + "Name" + ] + } + }, + "UserPoolId": { + "Description": "Id for the user pool", + "Value": { + "Ref": "UserPool" + } + }, + "UserPoolArn": { + "Description": "Arn for the user pool", + "Value": { + "Fn::GetAtt": [ + "UserPool", + "Arn" + ] + } + }, + "UserPoolName": { + "Value": { + "Ref": "userPoolName" + } + }, + "AppClientIDWeb": { + "Description": "The user pool app client id for web", + "Value": { + "Ref": "UserPoolClientWeb" + } + }, + "AppClientID": { + "Description": "The user pool app client id", + "Value": { + "Ref": "UserPoolClient" + } + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/auth/mynotesccae4f3b/build/parameters.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/auth/mynotesccae4f3b/build/parameters.json new file mode 100644 index 00000000..2c8bdef8 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/auth/mynotesccae4f3b/build/parameters.json @@ -0,0 +1,56 @@ +{ + "identityPoolName": "mynotesccae4f3b_identitypool_ccae4f3b", + "allowUnauthenticatedIdentities": true, + "resourceNameTruncated": "mynoteccae4f3b", + "userPoolName": "mynotesccae4f3b_userpool_ccae4f3b", + "autoVerifiedAttributes": [ + "email" + ], + "mfaConfiguration": "OFF", + "mfaTypes": [ + "SMS Text Message" + ], + "smsAuthenticationMessage": "Your authentication code is {####}", + "smsVerificationMessage": "Your verification code is {####}", + "emailVerificationSubject": "Your verification code", + "emailVerificationMessage": "Your verification code is {####}", + "defaultPasswordPolicy": false, + "passwordPolicyMinLength": 8, + "passwordPolicyCharacters": [], + "requiredAttributes": [ + "email" + ], + "aliasAttributes": [], + "userpoolClientGenerateSecret": false, + "userpoolClientRefreshTokenValidity": 30, + "userpoolClientWriteAttributes": [ + "email" + ], + "userpoolClientReadAttributes": [ + "email" + ], + "userpoolClientLambdaRole": "mynoteccae4f3b_userpoolclient_lambda_role", + "userpoolClientSetAttributes": false, + "sharedId": "ccae4f3b", + "resourceName": "mynotesccae4f3b", + "authSelections": "identityPoolAndUserPool", + "useDefault": "default", + "userPoolGroupList": [], + "serviceName": "Cognito", + "usernameCaseSensitive": false, + "useEnabledMfas": true, + "authRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "unauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + }, + "breakCircularDependency": true, + "dependsOn": [] +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/auth/mynotesccae4f3b/cli-inputs.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/auth/mynotesccae4f3b/cli-inputs.json new file mode 100644 index 00000000..8d149af9 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/auth/mynotesccae4f3b/cli-inputs.json @@ -0,0 +1,59 @@ +{ + "version": "1", + "cognitoConfig": { + "identityPoolName": "mynotesccae4f3b_identitypool_ccae4f3b", + "allowUnauthenticatedIdentities": true, + "resourceNameTruncated": "mynoteccae4f3b", + "userPoolName": "mynotesccae4f3b_userpool_ccae4f3b", + "autoVerifiedAttributes": [ + "email" + ], + "mfaConfiguration": "OFF", + "mfaTypes": [ + "SMS Text Message" + ], + "smsAuthenticationMessage": "Your authentication code is {####}", + "smsVerificationMessage": "Your verification code is {####}", + "emailVerificationSubject": "Your verification code", + "emailVerificationMessage": "Your verification code is {####}", + "defaultPasswordPolicy": false, + "passwordPolicyMinLength": 8, + "passwordPolicyCharacters": [], + "requiredAttributes": [ + "email" + ], + "aliasAttributes": [], + "userpoolClientGenerateSecret": false, + "userpoolClientRefreshTokenValidity": 30, + "userpoolClientWriteAttributes": [ + "email" + ], + "userpoolClientReadAttributes": [ + "email" + ], + "userpoolClientLambdaRole": "mynoteccae4f3b_userpoolclient_lambda_role", + "userpoolClientSetAttributes": false, + "sharedId": "ccae4f3b", + "resourceName": "mynotesccae4f3b", + "authSelections": "identityPoolAndUserPool", + "useDefault": "default", + "userPoolGroupList": [], + "serviceName": "Cognito", + "usernameCaseSensitive": false, + "useEnabledMfas": true, + "authRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "unauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + }, + "breakCircularDependency": true, + "dependsOn": [] + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/awscloudformation/build/api/mynotes/build/cloudformation-template.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/awscloudformation/build/api/mynotes/build/cloudformation-template.json new file mode 100644 index 00000000..044e9db4 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/awscloudformation/build/api/mynotes/build/cloudformation-template.json @@ -0,0 +1,316 @@ +{ + "Parameters": { + "env": { + "Type": "String", + "Default": "NONE" + }, + "AppSyncApiName": { + "Type": "String", + "Default": "AppSyncSimpleTransform" + }, + "DynamoDBModelTableReadIOPS": { + "Type": "Number", + "Default": 5, + "Description": "The number of read IOPS the table should support." + }, + "DynamoDBModelTableWriteIOPS": { + "Type": "Number", + "Default": 5, + "Description": "The number of write IOPS the table should support." + }, + "DynamoDBBillingMode": { + "Type": "String", + "Default": "PAY_PER_REQUEST", + "AllowedValues": [ + "PAY_PER_REQUEST", + "PROVISIONED" + ], + "Description": "Configure @model types to create DynamoDB tables with PAY_PER_REQUEST or PROVISIONED billing modes." + }, + "DynamoDBEnablePointInTimeRecovery": { + "Type": "String", + "Default": "false", + "AllowedValues": [ + "true", + "false" + ], + "Description": "Whether to enable Point in Time Recovery on the table." + }, + "DynamoDBEnableServerSideEncryption": { + "Type": "String", + "Default": "true", + "AllowedValues": [ + "true", + "false" + ], + "Description": "Enable server side encryption powered by KMS." + }, + "S3DeploymentBucket": { + "Type": "String", + "Description": "An S3 Bucket name where assets are deployed" + }, + "S3DeploymentRootKey": { + "Type": "String", + "Description": "An S3 key relative to the S3DeploymentBucket that points to the root of the deployment directory." + } + }, + "Resources": { + "GraphQLAPI": { + "Type": "AWS::AppSync::GraphQLApi", + "Properties": { + "AuthenticationType": "API_KEY", + "Name": { + "Fn::Join": [ + "", + [ + { + "Ref": "AppSyncApiName" + }, + "-", + { + "Ref": "env" + } + ] + ] + } + } + }, + "GraphQLAPITransformerSchema3CB2AE18": { + "Type": "AWS::AppSync::GraphQLSchema", + "Properties": { + "ApiId": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "DefinitionS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "S3DeploymentBucket" + }, + "/", + { + "Ref": "S3DeploymentRootKey" + }, + "/schema.graphql" + ] + ] + } + } + }, + "GraphQLAPIDefaultApiKey215A6DD7": { + "Type": "AWS::AppSync::ApiKey", + "Properties": { + "ApiId": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "Expires": 1722598000 + } + }, + "GraphQLAPINONEDS95A13CF0": { + "Type": "AWS::AppSync::DataSource", + "Properties": { + "ApiId": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "Description": "None Data Source for Pipeline functions", + "Name": "NONE_DS", + "Type": "NONE" + } + }, + "Todo": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "Parameters": { + "DynamoDBModelTableReadIOPS": { + "Ref": "DynamoDBModelTableReadIOPS" + }, + "DynamoDBModelTableWriteIOPS": { + "Ref": "DynamoDBModelTableWriteIOPS" + }, + "DynamoDBBillingMode": { + "Ref": "DynamoDBBillingMode" + }, + "DynamoDBEnablePointInTimeRecovery": { + "Ref": "DynamoDBEnablePointInTimeRecovery" + }, + "DynamoDBEnableServerSideEncryption": { + "Ref": "DynamoDBEnableServerSideEncryption" + }, + "referencetotransformerrootstackenv10C5A902Ref": { + "Ref": "env" + }, + "referencetotransformerrootstackGraphQLAPI20497F53ApiId": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "referencetotransformerrootstackGraphQLAPINONEDS2BA9D1C8Name": { + "Fn::GetAtt": [ + "GraphQLAPINONEDS95A13CF0", + "Name" + ] + }, + "referencetotransformerrootstackS3DeploymentBucket7592718ARef": { + "Ref": "S3DeploymentBucket" + }, + "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref": { + "Ref": "S3DeploymentRootKey" + } + }, + "TemplateURL": { + "Fn::Join": [ + "", + [ + "https://s3.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "S3DeploymentBucket" + }, + "/", + { + "Ref": "S3DeploymentRootKey" + }, + "/stacks/Todo.json" + ] + ] + } + }, + "DependsOn": [ + "GraphQLAPITransformerSchema3CB2AE18" + ] + }, + "CustomResourcesjson": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "Parameters": { + "AppSyncApiId": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "AppSyncApiName": { + "Ref": "AppSyncApiName" + }, + "env": { + "Ref": "env" + }, + "S3DeploymentBucket": { + "Ref": "S3DeploymentBucket" + }, + "S3DeploymentRootKey": { + "Ref": "S3DeploymentRootKey" + } + }, + "TemplateURL": { + "Fn::Join": [ + "/", + [ + "https://s3.amazonaws.com", + { + "Ref": "S3DeploymentBucket" + }, + { + "Ref": "S3DeploymentRootKey" + }, + "stacks", + "CustomResources.json" + ] + ] + } + }, + "DependsOn": [ + "GraphQLAPI", + "GraphQLAPITransformerSchema3CB2AE18", + "Todo" + ] + } + }, + "Outputs": { + "GraphQLAPIKeyOutput": { + "Description": "Your GraphQL API ID.", + "Value": { + "Fn::GetAtt": [ + "GraphQLAPIDefaultApiKey215A6DD7", + "ApiKey" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "AWS::StackName" + }, + "GraphQLApiKey" + ] + ] + } + } + }, + "GraphQLAPIIdOutput": { + "Description": "Your GraphQL API ID.", + "Value": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "AWS::StackName" + }, + "GraphQLApiId" + ] + ] + } + } + }, + "GraphQLAPIEndpointOutput": { + "Description": "Your GraphQL API endpoint.", + "Value": { + "Fn::GetAtt": [ + "GraphQLAPI", + "GraphQLUrl" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "AWS::StackName" + }, + "GraphQLApiEndpoint" + ] + ] + } + } + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/awscloudformation/build/auth/mynotesccae4f3b/build/mynotesccae4f3b-cloudformation-template.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/awscloudformation/build/auth/mynotesccae4f3b/build/mynotesccae4f3b-cloudformation-template.json new file mode 100644 index 00000000..f062515f --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/awscloudformation/build/auth/mynotesccae4f3b/build/mynotesccae4f3b-cloudformation-template.json @@ -0,0 +1,407 @@ +{ + "Description": "Amplify Cognito Stack for AWS Amplify CLI", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "env": { + "Type": "String" + }, + "identityPoolName": { + "Type": "String" + }, + "allowUnauthenticatedIdentities": { + "Type": "String" + }, + "resourceNameTruncated": { + "Type": "String" + }, + "userPoolName": { + "Type": "String" + }, + "autoVerifiedAttributes": { + "Type": "CommaDelimitedList" + }, + "mfaConfiguration": { + "Type": "String" + }, + "mfaTypes": { + "Type": "CommaDelimitedList" + }, + "smsAuthenticationMessage": { + "Type": "String" + }, + "smsVerificationMessage": { + "Type": "String" + }, + "emailVerificationSubject": { + "Type": "String" + }, + "emailVerificationMessage": { + "Type": "String" + }, + "defaultPasswordPolicy": { + "Type": "String" + }, + "passwordPolicyMinLength": { + "Type": "String" + }, + "passwordPolicyCharacters": { + "Type": "CommaDelimitedList" + }, + "requiredAttributes": { + "Type": "CommaDelimitedList" + }, + "aliasAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientGenerateSecret": { + "Type": "String" + }, + "userpoolClientRefreshTokenValidity": { + "Type": "String" + }, + "userpoolClientWriteAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientReadAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientLambdaRole": { + "Type": "String" + }, + "userpoolClientSetAttributes": { + "Type": "String" + }, + "sharedId": { + "Type": "String" + }, + "resourceName": { + "Type": "String" + }, + "authSelections": { + "Type": "String" + }, + "useDefault": { + "Type": "String" + }, + "userPoolGroupList": { + "Type": "CommaDelimitedList" + }, + "serviceName": { + "Type": "String" + }, + "usernameCaseSensitive": { + "Type": "String" + }, + "useEnabledMfas": { + "Type": "String" + }, + "authRoleArn": { + "Type": "String" + }, + "unauthRoleArn": { + "Type": "String" + }, + "breakCircularDependency": { + "Type": "String" + }, + "dependsOn": { + "Type": "CommaDelimitedList" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "UserPool": { + "Type": "AWS::Cognito::UserPool", + "Properties": { + "AutoVerifiedAttributes": [ + "email" + ], + "EmailVerificationMessage": { + "Ref": "emailVerificationMessage" + }, + "EmailVerificationSubject": { + "Ref": "emailVerificationSubject" + }, + "MfaConfiguration": { + "Ref": "mfaConfiguration" + }, + "Policies": { + "PasswordPolicy": { + "MinimumLength": { + "Ref": "passwordPolicyMinLength" + }, + "RequireLowercase": false, + "RequireNumbers": false, + "RequireSymbols": false, + "RequireUppercase": false + } + }, + "Schema": [ + { + "Mutable": true, + "Name": "email", + "Required": true + } + ], + "UserAttributeUpdateSettings": { + "AttributesRequireVerificationBeforeUpdate": [ + "email" + ] + }, + "UserPoolName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + { + "Ref": "userPoolName" + }, + { + "Fn::Join": [ + "", + [ + { + "Ref": "userPoolName" + }, + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "UsernameConfiguration": { + "CaseSensitive": false + } + } + }, + "UserPoolClientWeb": { + "Type": "AWS::Cognito::UserPoolClient", + "Properties": { + "ClientName": "mynoteccae4f3b_app_clientWeb", + "RefreshTokenValidity": { + "Ref": "userpoolClientRefreshTokenValidity" + }, + "TokenValidityUnits": { + "RefreshToken": "days" + }, + "UserPoolId": { + "Ref": "UserPool" + } + }, + "DependsOn": [ + "UserPool" + ] + }, + "UserPoolClient": { + "Type": "AWS::Cognito::UserPoolClient", + "Properties": { + "ClientName": "mynoteccae4f3b_app_client", + "GenerateSecret": { + "Ref": "userpoolClientGenerateSecret" + }, + "RefreshTokenValidity": { + "Ref": "userpoolClientRefreshTokenValidity" + }, + "TokenValidityUnits": { + "RefreshToken": "days" + }, + "UserPoolId": { + "Ref": "UserPool" + } + }, + "DependsOn": [ + "UserPool" + ] + }, + "UserPoolClientRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Action": "sts:AssumeRole" + } + ] + }, + "RoleName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + { + "Ref": "userpoolClientLambdaRole" + }, + { + "Fn::Join": [ + "", + [ + "upClientLambdaRoleccae4f3b", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + "-", + { + "Ref": "AWS::StackName" + } + ] + } + ] + }, + "-", + { + "Ref": "env" + } + ] + ] + } + ] + } + } + }, + "IdentityPool": { + "Type": "AWS::Cognito::IdentityPool", + "Properties": { + "AllowUnauthenticatedIdentities": { + "Ref": "allowUnauthenticatedIdentities" + }, + "CognitoIdentityProviders": [ + { + "ClientId": { + "Ref": "UserPoolClient" + }, + "ProviderName": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "client": { + "Ref": "UserPool" + } + } + ] + } + }, + { + "ClientId": { + "Ref": "UserPoolClientWeb" + }, + "ProviderName": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "client": { + "Ref": "UserPool" + } + } + ] + } + } + ], + "IdentityPoolName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "mynotesccae4f3b_identitypool_ccae4f3b", + { + "Fn::Join": [ + "", + [ + "mynotesccae4f3b_identitypool_ccae4f3b__", + { + "Ref": "env" + } + ] + ] + } + ] + } + } + }, + "IdentityPoolRoleMap": { + "Type": "AWS::Cognito::IdentityPoolRoleAttachment", + "Properties": { + "IdentityPoolId": { + "Ref": "IdentityPool" + }, + "Roles": { + "unauthenticated": { + "Ref": "unauthRoleArn" + }, + "authenticated": { + "Ref": "authRoleArn" + } + } + }, + "DependsOn": [ + "IdentityPool" + ] + } + }, + "Outputs": { + "IdentityPoolId": { + "Description": "Id for the identity pool", + "Value": { + "Ref": "IdentityPool" + } + }, + "IdentityPoolName": { + "Value": { + "Fn::GetAtt": [ + "IdentityPool", + "Name" + ] + } + }, + "UserPoolId": { + "Description": "Id for the user pool", + "Value": { + "Ref": "UserPool" + } + }, + "UserPoolArn": { + "Description": "Arn for the user pool", + "Value": { + "Fn::GetAtt": [ + "UserPool", + "Arn" + ] + } + }, + "UserPoolName": { + "Value": { + "Ref": "userPoolName" + } + }, + "AppClientIDWeb": { + "Description": "The user pool app client id for web", + "Value": { + "Ref": "UserPoolClientWeb" + } + }, + "AppClientID": { + "Description": "The user pool app client id", + "Value": { + "Ref": "UserPoolClient" + } + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/awscloudformation/build/awscloudformation/build/root-cloudformation-stack.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/awscloudformation/build/awscloudformation/build/root-cloudformation-stack.json new file mode 100644 index 00000000..1e3972c2 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/awscloudformation/build/awscloudformation/build/root-cloudformation-stack.json @@ -0,0 +1,437 @@ +{ + "Description": "Root Stack for AWS Amplify Console", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "DeploymentBucketName": { + "Type": "String", + "Default": "DeploymentBucket", + "Description": "Name of the common deployment bucket provided by the parent stack" + }, + "AuthRoleName": { + "Type": "String", + "Default": "AuthRoleName", + "Description": "Name of the common deployment bucket provided by the parent stack" + }, + "UnauthRoleName": { + "Type": "String", + "Default": "UnAuthRoleName", + "Description": "Name of the common deployment bucket provided by the parent stack" + } + }, + "Outputs": { + "Region": { + "Description": "CloudFormation provider root stack Region", + "Value": { + "Ref": "AWS::Region" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-Region" + } + } + }, + "StackName": { + "Description": "CloudFormation provider root stack ID", + "Value": { + "Ref": "AWS::StackName" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-StackName" + } + } + }, + "StackId": { + "Description": "CloudFormation provider root stack name", + "Value": { + "Ref": "AWS::StackId" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-StackId" + } + } + }, + "AuthRoleArn": { + "Value": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + } + }, + "UnauthRoleArn": { + "Value": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + } + }, + "DeploymentBucketName": { + "Description": "CloudFormation provider root stack deployment bucket name", + "Value": { + "Ref": "DeploymentBucketName" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-DeploymentBucketName" + } + } + }, + "AuthRoleName": { + "Value": { + "Ref": "AuthRole" + } + }, + "UnauthRoleName": { + "Value": { + "Ref": "UnauthRole" + } + } + }, + "Resources": { + "DeploymentBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": { + "Ref": "DeploymentBucketName" + }, + "BucketEncryption": { + "ServerSideEncryptionConfiguration": [ + { + "ServerSideEncryptionByDefault": { + "SSEAlgorithm": "AES256" + } + } + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "AuthRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Deny", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity" + } + ] + }, + "RoleName": { + "Ref": "AuthRoleName" + } + } + }, + "UnauthRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Deny", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity" + } + ] + }, + "RoleName": { + "Ref": "UnauthRoleName" + } + } + }, + "apimynotes": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-mynotes-staging-b2b56-deployment/amplify-cfn-templates/api/cloudformation-template.json", + "Parameters": { + "AppSyncApiName": "mynotes", + "DynamoDBBillingMode": "PAY_PER_REQUEST", + "DynamoDBEnableServerSideEncryption": false, + "S3DeploymentBucket": "amplify-mynotes-staging-b2b56-deployment", + "S3DeploymentRootKey": "amplify-appsync-files/c0e971ea1ba703ba5054d45b1d4a7a475f98dd0a", + "env": "staging" + } + } + }, + "authmynotesccae4f3b": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-mynotes-staging-b2b56-deployment/amplify-cfn-templates/auth/mynotesccae4f3b-cloudformation-template.json", + "Parameters": { + "identityPoolName": "mynotesccae4f3b_identitypool_ccae4f3b", + "allowUnauthenticatedIdentities": true, + "resourceNameTruncated": "mynoteccae4f3b", + "userPoolName": "mynotesccae4f3b_userpool_ccae4f3b", + "autoVerifiedAttributes": "email", + "mfaConfiguration": "OFF", + "mfaTypes": "SMS Text Message", + "smsAuthenticationMessage": "Your authentication code is {####}", + "smsVerificationMessage": "Your verification code is {####}", + "emailVerificationSubject": "Your verification code", + "emailVerificationMessage": "Your verification code is {####}", + "defaultPasswordPolicy": false, + "passwordPolicyMinLength": 8, + "passwordPolicyCharacters": "", + "requiredAttributes": "email", + "aliasAttributes": "", + "userpoolClientGenerateSecret": false, + "userpoolClientRefreshTokenValidity": 30, + "userpoolClientWriteAttributes": "email", + "userpoolClientReadAttributes": "email", + "userpoolClientLambdaRole": "mynoteccae4f3b_userpoolclient_lambda_role", + "userpoolClientSetAttributes": false, + "sharedId": "ccae4f3b", + "resourceName": "mynotesccae4f3b", + "authSelections": "identityPoolAndUserPool", + "useDefault": "default", + "userPoolGroupList": "", + "serviceName": "Cognito", + "usernameCaseSensitive": false, + "useEnabledMfas": true, + "authRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "unauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + }, + "breakCircularDependency": true, + "dependsOn": "", + "env": "staging" + } + } + }, + "functionS3Triggerdc42a5d7": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-mynotes-staging-b2b56-deployment/amplify-cfn-templates/function/S3Triggerdc42a5d7-cloudformation-template.json", + "Parameters": { + "deploymentBucketName": "amplify-mynotes-staging-b2b56-deployment", + "s3Key": "amplify-builds/S3Triggerdc42a5d7-6a475541666d35456861-build.zip", + "env": "staging" + } + } + }, + "UpdateRolesWithIDPFunction": { + "DependsOn": [ + "AuthRole", + "UnauthRole", + "authmynotesccae4f3b" + ], + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": { + "Fn::Join": [ + "\n", + [ + "const response = require('cfn-response');", + "const { IAMClient, GetRoleCommand, UpdateAssumeRolePolicyCommand } = require('@aws-sdk/client-iam');", + "exports.handler = function(event, context) {", + " // Don't return promise, response.send() marks context as done internally", + " const ignoredPromise = handleEvent(event, context)", + "};", + "async function handleEvent(event, context) {", + " try {", + " let authRoleName = event.ResourceProperties.authRoleName;", + " let unauthRoleName = event.ResourceProperties.unauthRoleName;", + " let idpId = event.ResourceProperties.idpId;", + " let authParamsJson = {", + " 'Version': '2012-10-17',", + " 'Statement': [{", + " 'Effect': 'Allow',", + " 'Principal': {'Federated': 'cognito-identity.amazonaws.com'},", + " 'Action': 'sts:AssumeRoleWithWebIdentity',", + " 'Condition': {", + " 'StringEquals': {'cognito-identity.amazonaws.com:aud': idpId},", + " 'ForAnyValue:StringLike': {'cognito-identity.amazonaws.com:amr': 'authenticated'}", + " }", + " }]", + " };", + " let unauthParamsJson = {", + " 'Version': '2012-10-17',", + " 'Statement': [{", + " 'Effect': 'Allow',", + " 'Principal': {'Federated': 'cognito-identity.amazonaws.com'},", + " 'Action': 'sts:AssumeRoleWithWebIdentity',", + " 'Condition': {", + " 'StringEquals': {'cognito-identity.amazonaws.com:aud': idpId},", + " 'ForAnyValue:StringLike': {'cognito-identity.amazonaws.com:amr': 'unauthenticated'}", + " }", + " }]", + " };", + " if (event.RequestType === 'Delete') {", + " try {", + " delete authParamsJson.Statement[0].Condition;", + " delete unauthParamsJson.Statement[0].Condition;", + " authParamsJson.Statement[0].Effect = 'Deny'", + " unauthParamsJson.Statement[0].Effect = 'Deny'", + " let authParams = {PolicyDocument: JSON.stringify(authParamsJson), RoleName: authRoleName};", + " let unauthParams = {PolicyDocument: JSON.stringify(unauthParamsJson), RoleName: unauthRoleName};", + " const iam = new IAMClient({region: event.ResourceProperties.region});", + " let res = await Promise.all([", + " iam.send(new GetRoleCommand({RoleName: authParams.RoleName})),", + " iam.send(new GetRoleCommand({RoleName: unauthParams.RoleName}))", + " ]);", + " res = await Promise.all([", + " iam.send(new UpdateAssumeRolePolicyCommand(authParams)),", + " iam.send(new UpdateAssumeRolePolicyCommand(unauthParams))", + " ]);", + " response.send(event, context, response.SUCCESS, {});", + " } catch (err) {", + " console.log(err.stack);", + " response.send(event, context, response.SUCCESS, {Error: err});", + " }", + " } else if (event.RequestType === 'Update' || event.RequestType === 'Create') {", + " const iam = new IAMClient({region: event.ResourceProperties.region});", + " let authParams = {PolicyDocument: JSON.stringify(authParamsJson), RoleName: authRoleName};", + " let unauthParams = {PolicyDocument: JSON.stringify(unauthParamsJson), RoleName: unauthRoleName};", + " const res = await Promise.all([", + " iam.send(new UpdateAssumeRolePolicyCommand(authParams)),", + " iam.send(new UpdateAssumeRolePolicyCommand(unauthParams))", + " ]);", + " response.send(event, context, response.SUCCESS, {});", + " }", + " } catch (err) {", + " console.log(err.stack);", + " response.send(event, context, response.FAILED, {Error: err});", + " }", + "};" + ] + ] + } + }, + "Handler": "index.handler", + "Runtime": "nodejs18.x", + "Timeout": 300, + "Role": { + "Fn::GetAtt": [ + "UpdateRolesWithIDPFunctionRole", + "Arn" + ] + } + } + }, + "UpdateRolesWithIDPFunctionOutputs": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "UpdateRolesWithIDPFunction", + "Arn" + ] + }, + "region": { + "Ref": "AWS::Region" + }, + "idpId": { + "Fn::GetAtt": [ + "authmynotesccae4f3b", + "Outputs.IdentityPoolId" + ] + }, + "authRoleName": { + "Ref": "AuthRole" + }, + "unauthRoleName": { + "Ref": "UnauthRole" + } + } + }, + "UpdateRolesWithIDPFunctionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "RoleName": { + "Fn::Join": [ + "", + [ + { + "Ref": "AuthRole" + }, + "-idp" + ] + ] + }, + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + }, + "Policies": [ + { + "PolicyName": "UpdateRolesWithIDPFunctionPolicy", + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Resource": "arn:aws:logs:*:*:*" + }, + { + "Effect": "Allow", + "Action": [ + "iam:UpdateAssumeRolePolicy", + "iam:GetRole" + ], + "Resource": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + } + }, + { + "Effect": "Allow", + "Action": [ + "iam:UpdateAssumeRolePolicy", + "iam:GetRole" + ], + "Resource": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + } + } + ] + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/awscloudformation/build/function/S3Trigger168e5d52/S3Trigger168e5d52-cloudformation-template.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/awscloudformation/build/function/S3Trigger168e5d52/S3Trigger168e5d52-cloudformation-template.json new file mode 100644 index 00000000..bada55fe --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/awscloudformation/build/function/S3Trigger168e5d52/S3Trigger168e5d52-cloudformation-template.json @@ -0,0 +1,193 @@ +{ + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"12.12.4\",\"stackType\":\"function-Lambda\",\"metadata\":{}}", + "Parameters": { + "env": { + "Type": "String" + }, + "deploymentBucketName": { + "Type": "String" + }, + "s3Key": { + "Type": "String" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "LambdaFunction": { + "Type": "AWS::Lambda::Function", + "Metadata": { + "aws:asset:path": "./src", + "aws:asset:property": "Code" + }, + "Properties": { + "Handler": "index.handler", + "FunctionName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "S3Trigger168e5d52", + { + "Fn::Join": [ + "", + [ + "S3Trigger168e5d52", + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "Environment": { + "Variables": { + "ENV": { + "Ref": "env" + } + } + }, + "Role": { + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 25, + "Code": { + "S3Bucket": { + "Ref": "deploymentBucketName" + }, + "S3Key": { + "Ref": "s3Key" + } + } + } + }, + "LambdaExecutionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "RoleName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "S3Trigger168e5d52LambdaRole168e5d52", + { + "Fn::Join": [ + "", + [ + "S3Trigger168e5d52LambdaRole168e5d52", + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + } + } + }, + "lambdaexecutionpolicy": { + "DependsOn": [ + "LambdaExecutionRole" + ], + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyName": "lambda-execution-policy", + "Roles": [ + { + "Ref": "LambdaExecutionRole" + } + ], + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Resource": { + "Fn::Sub": [ + "arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*", + { + "region": { + "Ref": "AWS::Region" + }, + "account": { + "Ref": "AWS::AccountId" + }, + "lambda": { + "Ref": "LambdaFunction" + } + } + ] + } + } + ] + } + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Ref": "LambdaFunction" + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "LambdaFunction", + "Arn" + ] + } + }, + "Region": { + "Value": { + "Ref": "AWS::Region" + } + }, + "LambdaExecutionRole": { + "Value": { + "Ref": "LambdaExecutionRole" + } + }, + "LambdaExecutionRoleArn": { + "Value": { + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] + } + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/awscloudformation/build/function/S3Triggerdc42a5d7/S3Triggerdc42a5d7-cloudformation-template.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/awscloudformation/build/function/S3Triggerdc42a5d7/S3Triggerdc42a5d7-cloudformation-template.json new file mode 100644 index 00000000..99722625 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/awscloudformation/build/function/S3Triggerdc42a5d7/S3Triggerdc42a5d7-cloudformation-template.json @@ -0,0 +1,193 @@ +{ + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"12.12.4\",\"stackType\":\"function-Lambda\",\"metadata\":{}}", + "Parameters": { + "env": { + "Type": "String" + }, + "deploymentBucketName": { + "Type": "String" + }, + "s3Key": { + "Type": "String" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "LambdaFunction": { + "Type": "AWS::Lambda::Function", + "Metadata": { + "aws:asset:path": "./src", + "aws:asset:property": "Code" + }, + "Properties": { + "Handler": "index.handler", + "FunctionName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "S3Triggerdc42a5d7", + { + "Fn::Join": [ + "", + [ + "S3Triggerdc42a5d7", + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "Environment": { + "Variables": { + "ENV": { + "Ref": "env" + } + } + }, + "Role": { + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 25, + "Code": { + "S3Bucket": { + "Ref": "deploymentBucketName" + }, + "S3Key": { + "Ref": "s3Key" + } + } + } + }, + "LambdaExecutionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "RoleName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "S3Triggerdc42a5d7LambdaRoledc42a5d7", + { + "Fn::Join": [ + "", + [ + "S3Triggerdc42a5d7LambdaRoledc42a5d7", + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + } + } + }, + "lambdaexecutionpolicy": { + "DependsOn": [ + "LambdaExecutionRole" + ], + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyName": "lambda-execution-policy", + "Roles": [ + { + "Ref": "LambdaExecutionRole" + } + ], + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Resource": { + "Fn::Sub": [ + "arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*", + { + "region": { + "Ref": "AWS::Region" + }, + "account": { + "Ref": "AWS::AccountId" + }, + "lambda": { + "Ref": "LambdaFunction" + } + } + ] + } + } + ] + } + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Ref": "LambdaFunction" + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "LambdaFunction", + "Arn" + ] + } + }, + "Region": { + "Value": { + "Ref": "AWS::Region" + } + }, + "LambdaExecutionRole": { + "Value": { + "Ref": "LambdaExecutionRole" + } + }, + "LambdaExecutionRoleArn": { + "Value": { + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] + } + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/awscloudformation/build/root-cloudformation-stack.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/awscloudformation/build/root-cloudformation-stack.json new file mode 100644 index 00000000..1e3972c2 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/awscloudformation/build/root-cloudformation-stack.json @@ -0,0 +1,437 @@ +{ + "Description": "Root Stack for AWS Amplify Console", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "DeploymentBucketName": { + "Type": "String", + "Default": "DeploymentBucket", + "Description": "Name of the common deployment bucket provided by the parent stack" + }, + "AuthRoleName": { + "Type": "String", + "Default": "AuthRoleName", + "Description": "Name of the common deployment bucket provided by the parent stack" + }, + "UnauthRoleName": { + "Type": "String", + "Default": "UnAuthRoleName", + "Description": "Name of the common deployment bucket provided by the parent stack" + } + }, + "Outputs": { + "Region": { + "Description": "CloudFormation provider root stack Region", + "Value": { + "Ref": "AWS::Region" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-Region" + } + } + }, + "StackName": { + "Description": "CloudFormation provider root stack ID", + "Value": { + "Ref": "AWS::StackName" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-StackName" + } + } + }, + "StackId": { + "Description": "CloudFormation provider root stack name", + "Value": { + "Ref": "AWS::StackId" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-StackId" + } + } + }, + "AuthRoleArn": { + "Value": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + } + }, + "UnauthRoleArn": { + "Value": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + } + }, + "DeploymentBucketName": { + "Description": "CloudFormation provider root stack deployment bucket name", + "Value": { + "Ref": "DeploymentBucketName" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-DeploymentBucketName" + } + } + }, + "AuthRoleName": { + "Value": { + "Ref": "AuthRole" + } + }, + "UnauthRoleName": { + "Value": { + "Ref": "UnauthRole" + } + } + }, + "Resources": { + "DeploymentBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": { + "Ref": "DeploymentBucketName" + }, + "BucketEncryption": { + "ServerSideEncryptionConfiguration": [ + { + "ServerSideEncryptionByDefault": { + "SSEAlgorithm": "AES256" + } + } + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "AuthRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Deny", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity" + } + ] + }, + "RoleName": { + "Ref": "AuthRoleName" + } + } + }, + "UnauthRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Deny", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity" + } + ] + }, + "RoleName": { + "Ref": "UnauthRoleName" + } + } + }, + "apimynotes": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-mynotes-staging-b2b56-deployment/amplify-cfn-templates/api/cloudformation-template.json", + "Parameters": { + "AppSyncApiName": "mynotes", + "DynamoDBBillingMode": "PAY_PER_REQUEST", + "DynamoDBEnableServerSideEncryption": false, + "S3DeploymentBucket": "amplify-mynotes-staging-b2b56-deployment", + "S3DeploymentRootKey": "amplify-appsync-files/c0e971ea1ba703ba5054d45b1d4a7a475f98dd0a", + "env": "staging" + } + } + }, + "authmynotesccae4f3b": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-mynotes-staging-b2b56-deployment/amplify-cfn-templates/auth/mynotesccae4f3b-cloudformation-template.json", + "Parameters": { + "identityPoolName": "mynotesccae4f3b_identitypool_ccae4f3b", + "allowUnauthenticatedIdentities": true, + "resourceNameTruncated": "mynoteccae4f3b", + "userPoolName": "mynotesccae4f3b_userpool_ccae4f3b", + "autoVerifiedAttributes": "email", + "mfaConfiguration": "OFF", + "mfaTypes": "SMS Text Message", + "smsAuthenticationMessage": "Your authentication code is {####}", + "smsVerificationMessage": "Your verification code is {####}", + "emailVerificationSubject": "Your verification code", + "emailVerificationMessage": "Your verification code is {####}", + "defaultPasswordPolicy": false, + "passwordPolicyMinLength": 8, + "passwordPolicyCharacters": "", + "requiredAttributes": "email", + "aliasAttributes": "", + "userpoolClientGenerateSecret": false, + "userpoolClientRefreshTokenValidity": 30, + "userpoolClientWriteAttributes": "email", + "userpoolClientReadAttributes": "email", + "userpoolClientLambdaRole": "mynoteccae4f3b_userpoolclient_lambda_role", + "userpoolClientSetAttributes": false, + "sharedId": "ccae4f3b", + "resourceName": "mynotesccae4f3b", + "authSelections": "identityPoolAndUserPool", + "useDefault": "default", + "userPoolGroupList": "", + "serviceName": "Cognito", + "usernameCaseSensitive": false, + "useEnabledMfas": true, + "authRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "unauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + }, + "breakCircularDependency": true, + "dependsOn": "", + "env": "staging" + } + } + }, + "functionS3Triggerdc42a5d7": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-mynotes-staging-b2b56-deployment/amplify-cfn-templates/function/S3Triggerdc42a5d7-cloudformation-template.json", + "Parameters": { + "deploymentBucketName": "amplify-mynotes-staging-b2b56-deployment", + "s3Key": "amplify-builds/S3Triggerdc42a5d7-6a475541666d35456861-build.zip", + "env": "staging" + } + } + }, + "UpdateRolesWithIDPFunction": { + "DependsOn": [ + "AuthRole", + "UnauthRole", + "authmynotesccae4f3b" + ], + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": { + "Fn::Join": [ + "\n", + [ + "const response = require('cfn-response');", + "const { IAMClient, GetRoleCommand, UpdateAssumeRolePolicyCommand } = require('@aws-sdk/client-iam');", + "exports.handler = function(event, context) {", + " // Don't return promise, response.send() marks context as done internally", + " const ignoredPromise = handleEvent(event, context)", + "};", + "async function handleEvent(event, context) {", + " try {", + " let authRoleName = event.ResourceProperties.authRoleName;", + " let unauthRoleName = event.ResourceProperties.unauthRoleName;", + " let idpId = event.ResourceProperties.idpId;", + " let authParamsJson = {", + " 'Version': '2012-10-17',", + " 'Statement': [{", + " 'Effect': 'Allow',", + " 'Principal': {'Federated': 'cognito-identity.amazonaws.com'},", + " 'Action': 'sts:AssumeRoleWithWebIdentity',", + " 'Condition': {", + " 'StringEquals': {'cognito-identity.amazonaws.com:aud': idpId},", + " 'ForAnyValue:StringLike': {'cognito-identity.amazonaws.com:amr': 'authenticated'}", + " }", + " }]", + " };", + " let unauthParamsJson = {", + " 'Version': '2012-10-17',", + " 'Statement': [{", + " 'Effect': 'Allow',", + " 'Principal': {'Federated': 'cognito-identity.amazonaws.com'},", + " 'Action': 'sts:AssumeRoleWithWebIdentity',", + " 'Condition': {", + " 'StringEquals': {'cognito-identity.amazonaws.com:aud': idpId},", + " 'ForAnyValue:StringLike': {'cognito-identity.amazonaws.com:amr': 'unauthenticated'}", + " }", + " }]", + " };", + " if (event.RequestType === 'Delete') {", + " try {", + " delete authParamsJson.Statement[0].Condition;", + " delete unauthParamsJson.Statement[0].Condition;", + " authParamsJson.Statement[0].Effect = 'Deny'", + " unauthParamsJson.Statement[0].Effect = 'Deny'", + " let authParams = {PolicyDocument: JSON.stringify(authParamsJson), RoleName: authRoleName};", + " let unauthParams = {PolicyDocument: JSON.stringify(unauthParamsJson), RoleName: unauthRoleName};", + " const iam = new IAMClient({region: event.ResourceProperties.region});", + " let res = await Promise.all([", + " iam.send(new GetRoleCommand({RoleName: authParams.RoleName})),", + " iam.send(new GetRoleCommand({RoleName: unauthParams.RoleName}))", + " ]);", + " res = await Promise.all([", + " iam.send(new UpdateAssumeRolePolicyCommand(authParams)),", + " iam.send(new UpdateAssumeRolePolicyCommand(unauthParams))", + " ]);", + " response.send(event, context, response.SUCCESS, {});", + " } catch (err) {", + " console.log(err.stack);", + " response.send(event, context, response.SUCCESS, {Error: err});", + " }", + " } else if (event.RequestType === 'Update' || event.RequestType === 'Create') {", + " const iam = new IAMClient({region: event.ResourceProperties.region});", + " let authParams = {PolicyDocument: JSON.stringify(authParamsJson), RoleName: authRoleName};", + " let unauthParams = {PolicyDocument: JSON.stringify(unauthParamsJson), RoleName: unauthRoleName};", + " const res = await Promise.all([", + " iam.send(new UpdateAssumeRolePolicyCommand(authParams)),", + " iam.send(new UpdateAssumeRolePolicyCommand(unauthParams))", + " ]);", + " response.send(event, context, response.SUCCESS, {});", + " }", + " } catch (err) {", + " console.log(err.stack);", + " response.send(event, context, response.FAILED, {Error: err});", + " }", + "};" + ] + ] + } + }, + "Handler": "index.handler", + "Runtime": "nodejs18.x", + "Timeout": 300, + "Role": { + "Fn::GetAtt": [ + "UpdateRolesWithIDPFunctionRole", + "Arn" + ] + } + } + }, + "UpdateRolesWithIDPFunctionOutputs": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "UpdateRolesWithIDPFunction", + "Arn" + ] + }, + "region": { + "Ref": "AWS::Region" + }, + "idpId": { + "Fn::GetAtt": [ + "authmynotesccae4f3b", + "Outputs.IdentityPoolId" + ] + }, + "authRoleName": { + "Ref": "AuthRole" + }, + "unauthRoleName": { + "Ref": "UnauthRole" + } + } + }, + "UpdateRolesWithIDPFunctionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "RoleName": { + "Fn::Join": [ + "", + [ + { + "Ref": "AuthRole" + }, + "-idp" + ] + ] + }, + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + }, + "Policies": [ + { + "PolicyName": "UpdateRolesWithIDPFunctionPolicy", + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Resource": "arn:aws:logs:*:*:*" + }, + { + "Effect": "Allow", + "Action": [ + "iam:UpdateAssumeRolePolicy", + "iam:GetRole" + ], + "Resource": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + } + }, + { + "Effect": "Allow", + "Action": [ + "iam:UpdateAssumeRolePolicy", + "iam:GetRole" + ], + "Resource": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + } + } + ] + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/awscloudformation/build/storage/notesimage/build/cloudformation-template.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/awscloudformation/build/storage/notesimage/build/cloudformation-template.json new file mode 100644 index 00000000..e2beb9c1 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/awscloudformation/build/storage/notesimage/build/cloudformation-template.json @@ -0,0 +1,750 @@ +{ + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"12.12.4\",\"stackType\":\"storage-S3\",\"metadata\":{}}", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "env": { + "Type": "String" + }, + "bucketName": { + "Type": "String" + }, + "authRoleName": { + "Type": "String" + }, + "unauthRoleName": { + "Type": "String" + }, + "authPolicyName": { + "Type": "String" + }, + "unauthPolicyName": { + "Type": "String" + }, + "s3PublicPolicy": { + "Type": "String", + "Default": "NONE" + }, + "s3PrivatePolicy": { + "Type": "String", + "Default": "NONE" + }, + "s3ProtectedPolicy": { + "Type": "String", + "Default": "NONE" + }, + "s3UploadsPolicy": { + "Type": "String", + "Default": "NONE" + }, + "s3ReadPolicy": { + "Type": "String", + "Default": "NONE" + }, + "s3PermissionsAuthenticatedPublic": { + "Type": "String", + "Default": "DISALLOW" + }, + "s3PermissionsAuthenticatedProtected": { + "Type": "String", + "Default": "DISALLOW" + }, + "s3PermissionsAuthenticatedPrivate": { + "Type": "String", + "Default": "DISALLOW" + }, + "s3PermissionsAuthenticatedUploads": { + "Type": "String", + "Default": "DISALLOW" + }, + "s3PermissionsGuestPublic": { + "Type": "String", + "Default": "DISALLOW" + }, + "s3PermissionsGuestUploads": { + "Type": "String", + "Default": "DISALLOW" + }, + "AuthenticatedAllowList": { + "Type": "String", + "Default": "DISALLOW" + }, + "GuestAllowList": { + "Type": "String", + "Default": "DISALLOW" + }, + "selectedGuestPermissions": { + "Type": "CommaDelimitedList", + "Default": "NONE" + }, + "selectedAuthenticatedPermissions": { + "Type": "CommaDelimitedList", + "Default": "NONE" + }, + "functionS3Trigger168e5d52Arn": { + "Type": "String", + "Default": "functionS3Trigger168e5d52Arn" + }, + "functionS3Trigger168e5d52Name": { + "Type": "String", + "Default": "functionS3Trigger168e5d52Name" + }, + "functionS3Trigger168e5d52LambdaExecutionRole": { + "Type": "String", + "Default": "functionS3Trigger168e5d52LambdaExecutionRole" + }, + "triggerFunction": { + "Type": "String" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + }, + "CreateAuthPublic": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "s3PermissionsAuthenticatedPublic" + }, + "DISALLOW" + ] + } + ] + }, + "CreateAuthProtected": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "s3PermissionsAuthenticatedProtected" + }, + "DISALLOW" + ] + } + ] + }, + "CreateAuthPrivate": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "s3PermissionsAuthenticatedPrivate" + }, + "DISALLOW" + ] + } + ] + }, + "CreateAuthUploads": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "s3PermissionsAuthenticatedUploads" + }, + "DISALLOW" + ] + } + ] + }, + "CreateGuestPublic": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "s3PermissionsGuestPublic" + }, + "DISALLOW" + ] + } + ] + }, + "CreateGuestUploads": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "s3PermissionsGuestUploads" + }, + "DISALLOW" + ] + } + ] + }, + "AuthReadAndList": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "AuthenticatedAllowList" + }, + "DISALLOW" + ] + } + ] + }, + "GuestReadAndList": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "GuestAllowList" + }, + "DISALLOW" + ] + } + ] + } + }, + "Outputs": { + "BucketName": { + "Description": "Bucket name for the S3 bucket", + "Value": { + "Ref": "S3Bucket" + } + }, + "Region": { + "Value": { + "Ref": "AWS::Region" + } + } + }, + "Resources": { + "S3Bucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + { + "Ref": "bucketName" + }, + { + "Fn::Join": [ + "", + [ + { + "Ref": "bucketName" + }, + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + "-", + { + "Ref": "AWS::StackName" + } + ] + } + ] + }, + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "CorsConfiguration": { + "CorsRules": [ + { + "AllowedHeaders": [ + "*" + ], + "AllowedMethods": [ + "GET", + "HEAD", + "PUT", + "POST", + "DELETE" + ], + "AllowedOrigins": [ + "*" + ], + "ExposedHeaders": [ + "x-amz-server-side-encryption", + "x-amz-request-id", + "x-amz-id-2", + "ETag" + ], + "Id": "S3CORSRuleId1", + "MaxAge": 3000 + } + ] + }, + "NotificationConfiguration": { + "LambdaConfigurations": [ + { + "Event": "s3:ObjectCreated:*", + "Function": { + "Ref": "functionS3Trigger168e5d52Arn" + } + }, + { + "Event": "s3:ObjectRemoved:*", + "Function": { + "Ref": "functionS3Trigger168e5d52Arn" + } + } + ] + }, + "BucketEncryption": { + "ServerSideEncryptionConfiguration": [ + { + "ServerSideEncryptionByDefault": { + "SSEAlgorithm": "AES256" + } + } + ] + } + }, + "DependsOn": [ + "TriggerPermissions" + ], + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "TriggerPermissions": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Ref": "functionS3Trigger168e5d52Name" + }, + "Principal": "s3.amazonaws.com", + "SourceAccount": { + "Ref": "AWS::AccountId" + }, + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Fn::If": [ + "ShouldNotCreateEnvResources", + { + "Ref": "bucketName" + }, + { + "Fn::Join": [ + "", + [ + { + "Ref": "bucketName" + }, + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + "-", + { + "Ref": "AWS::StackName" + } + ] + } + ] + }, + "-", + { + "Ref": "env" + } + ] + ] + } + ] + } + ] + ] + } + } + }, + "S3AuthPublicPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": { + "Fn::Split": [ + ",", + { + "Ref": "s3PermissionsAuthenticatedPublic" + } + ] + }, + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "S3Bucket" + }, + "/public/*" + ] + ] + } + ] + } + ] + }, + "PolicyName": { + "Ref": "s3PublicPolicy" + }, + "Roles": [ + { + "Ref": "authRoleName" + } + ] + }, + "DependsOn": [ + "S3Bucket" + ], + "Condition": "CreateAuthPublic" + }, + "S3AuthProtectedPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": { + "Fn::Split": [ + ",", + { + "Ref": "s3PermissionsAuthenticatedProtected" + } + ] + }, + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "S3Bucket" + }, + "/protected/${cognito-identity.amazonaws.com:sub}/*" + ] + ] + } + ] + } + ] + }, + "PolicyName": { + "Ref": "s3ProtectedPolicy" + }, + "Roles": [ + { + "Ref": "authRoleName" + } + ] + }, + "DependsOn": [ + "S3Bucket" + ], + "Condition": "CreateAuthProtected" + }, + "S3AuthPrivatePolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": { + "Fn::Split": [ + ",", + { + "Ref": "s3PermissionsAuthenticatedPrivate" + } + ] + }, + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "S3Bucket" + }, + "/private/${cognito-identity.amazonaws.com:sub}/*" + ] + ] + } + ] + } + ] + }, + "PolicyName": { + "Ref": "s3PrivatePolicy" + }, + "Roles": [ + { + "Ref": "authRoleName" + } + ] + }, + "DependsOn": [ + "S3Bucket" + ], + "Condition": "CreateAuthPrivate" + }, + "S3AuthUploadPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": { + "Fn::Split": [ + ",", + { + "Ref": "s3PermissionsAuthenticatedUploads" + } + ] + }, + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "S3Bucket" + }, + "/uploads/*" + ] + ] + } + ] + } + ] + }, + "PolicyName": { + "Ref": "s3UploadsPolicy" + }, + "Roles": [ + { + "Ref": "authRoleName" + } + ] + }, + "DependsOn": [ + "S3Bucket" + ], + "Condition": "CreateAuthUploads" + }, + "S3AuthReadPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:GetObject", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "S3Bucket" + }, + "/protected/*" + ] + ] + } + }, + { + "Action": "s3:ListBucket", + "Condition": { + "StringLike": { + "s3:prefix": [ + "public/", + "public/*", + "protected/", + "protected/*", + "private/${cognito-identity.amazonaws.com:sub}/", + "private/${cognito-identity.amazonaws.com:sub}/*" + ] + } + }, + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "S3Bucket" + } + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": { + "Ref": "s3ReadPolicy" + }, + "Roles": [ + { + "Ref": "authRoleName" + } + ] + }, + "DependsOn": [ + "S3Bucket" + ], + "Condition": "AuthReadAndList" + }, + "S3GuestReadPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:GetObject", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "S3Bucket" + }, + "/protected/*" + ] + ] + } + }, + { + "Action": "s3:ListBucket", + "Condition": { + "StringLike": { + "s3:prefix": [ + "public/", + "public/*", + "protected/", + "protected/*" + ] + } + }, + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "S3Bucket" + } + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": { + "Ref": "s3ReadPolicy" + }, + "Roles": [ + { + "Ref": "unauthRoleName" + } + ] + }, + "DependsOn": [ + "S3Bucket" + ], + "Condition": "GuestReadAndList" + }, + "S3TriggerBucketPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "s3:ListBucket" + ], + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "S3Bucket" + } + ] + ] + } + ] + }, + { + "Effect": "Allow", + "Action": [ + "s3:PutObject", + "s3:GetObject", + "s3:ListBucket", + "s3:DeleteObject" + ], + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "S3Bucket" + }, + "/*" + ] + ] + } + ] + } + ] + }, + "PolicyName": "amplify-lambda-execution-policy-storage", + "Roles": [ + { + "Ref": "functionS3Trigger168e5d52LambdaExecutionRole" + } + ] + }, + "DependsOn": [ + "S3Bucket" + ] + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/backend-config.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/backend-config.json new file mode 100644 index 00000000..af6ea255 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/backend-config.json @@ -0,0 +1,72 @@ +{ + "api": { + "mynotes": { + "dependsOn": [], + "output": { + "authConfig": { + "additionalAuthenticationProviders": [], + "defaultAuthentication": { + "apiKeyConfig": { + "apiKeyExpirationDays": 7 + }, + "authenticationType": "API_KEY" + } + } + }, + "providerPlugin": "awscloudformation", + "service": "AppSync" + } + }, + "auth": { + "mynotesccae4f3b": { + "customAuth": false, + "dependsOn": [], + "frontendAuthConfig": { + "mfaConfiguration": "OFF", + "mfaTypes": [ + "SMS" + ], + "passwordProtectionSettings": { + "passwordPolicyCharacters": [], + "passwordPolicyMinLength": 8 + }, + "signupAttributes": [ + "EMAIL" + ], + "socialProviders": [], + "usernameAttributes": [], + "verificationMechanisms": [ + "EMAIL" + ] + }, + "providerPlugin": "awscloudformation", + "service": "Cognito" + } + }, + "function": { + "S3Triggerdc42a5d7": { + "build": true, + "providerPlugin": "awscloudformation", + "service": "Lambda" + } + }, + "parameters": { + "AMPLIFY_function_S3Triggerdc42a5d7_deploymentBucketName": { + "usedBy": [ + { + "category": "function", + "resourceName": "S3Triggerdc42a5d7" + } + ] + }, + "AMPLIFY_function_S3Triggerdc42a5d7_s3Key": { + "usedBy": [ + { + "category": "function", + "resourceName": "S3Triggerdc42a5d7" + } + ] + } + }, + "storage": {} +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/function/S3Triggerdc42a5d7/S3Triggerdc42a5d7-cloudformation-template.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/function/S3Triggerdc42a5d7/S3Triggerdc42a5d7-cloudformation-template.json new file mode 100644 index 00000000..99722625 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/function/S3Triggerdc42a5d7/S3Triggerdc42a5d7-cloudformation-template.json @@ -0,0 +1,193 @@ +{ + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"12.12.4\",\"stackType\":\"function-Lambda\",\"metadata\":{}}", + "Parameters": { + "env": { + "Type": "String" + }, + "deploymentBucketName": { + "Type": "String" + }, + "s3Key": { + "Type": "String" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "LambdaFunction": { + "Type": "AWS::Lambda::Function", + "Metadata": { + "aws:asset:path": "./src", + "aws:asset:property": "Code" + }, + "Properties": { + "Handler": "index.handler", + "FunctionName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "S3Triggerdc42a5d7", + { + "Fn::Join": [ + "", + [ + "S3Triggerdc42a5d7", + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "Environment": { + "Variables": { + "ENV": { + "Ref": "env" + } + } + }, + "Role": { + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 25, + "Code": { + "S3Bucket": { + "Ref": "deploymentBucketName" + }, + "S3Key": { + "Ref": "s3Key" + } + } + } + }, + "LambdaExecutionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "RoleName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "S3Triggerdc42a5d7LambdaRoledc42a5d7", + { + "Fn::Join": [ + "", + [ + "S3Triggerdc42a5d7LambdaRoledc42a5d7", + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + } + } + }, + "lambdaexecutionpolicy": { + "DependsOn": [ + "LambdaExecutionRole" + ], + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyName": "lambda-execution-policy", + "Roles": [ + { + "Ref": "LambdaExecutionRole" + } + ], + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Resource": { + "Fn::Sub": [ + "arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*", + { + "region": { + "Ref": "AWS::Region" + }, + "account": { + "Ref": "AWS::AccountId" + }, + "lambda": { + "Ref": "LambdaFunction" + } + } + ] + } + } + ] + } + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Ref": "LambdaFunction" + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "LambdaFunction", + "Arn" + ] + } + }, + "Region": { + "Value": { + "Ref": "AWS::Region" + } + }, + "LambdaExecutionRole": { + "Value": { + "Ref": "LambdaExecutionRole" + } + }, + "LambdaExecutionRoleArn": { + "Value": { + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] + } + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/function/S3Triggerdc42a5d7/amplify.state b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/function/S3Triggerdc42a5d7/amplify.state new file mode 100644 index 00000000..2ba0f4c7 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/function/S3Triggerdc42a5d7/amplify.state @@ -0,0 +1,6 @@ +{ + "pluginId": "amplify-nodejs-function-runtime-provider", + "functionRuntime": "nodejs", + "defaultEditorFile": "src/index.js", + "useLegacyBuild": true +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/function/S3Triggerdc42a5d7/src/event.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/function/S3Triggerdc42a5d7/src/event.json new file mode 100644 index 00000000..fd2722e8 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/function/S3Triggerdc42a5d7/src/event.json @@ -0,0 +1,5 @@ +{ + "key1": "value1", + "key2": "value2", + "key3": "value3" +} diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/function/S3Triggerdc42a5d7/src/index.js b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/function/S3Triggerdc42a5d7/src/index.js new file mode 100644 index 00000000..12e2a4e7 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/function/S3Triggerdc42a5d7/src/index.js @@ -0,0 +1,6 @@ +exports.handler = async function (event) { + console.log('Received S3 event:', JSON.stringify(event, null, 2)); + const bucket = event.Records[0].s3.bucket.name; + const key = event.Records[0].s3.object.key; + console.log(`Bucket: ${bucket}`, `Key: ${key}`); +}; \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/function/S3Triggerdc42a5d7/src/package.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/function/S3Triggerdc42a5d7/src/package.json new file mode 100644 index 00000000..0fbf74b6 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/function/S3Triggerdc42a5d7/src/package.json @@ -0,0 +1,7 @@ +{ + "name": "S3Triggerdc42a5d7", + "version": "2.0.0", + "description": "Lambda function generated by Amplify", + "main": "index.js", + "license": "Apache-2.0" +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/function/S3Triggerdc42a5d7/src/yarn.lock b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/function/S3Triggerdc42a5d7/src/yarn.lock new file mode 100644 index 00000000..fb57ccd1 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/function/S3Triggerdc42a5d7/src/yarn.lock @@ -0,0 +1,4 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + diff --git a/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/tags.json b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/tags.json new file mode 100644 index 00000000..b9321d71 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/#current-cloud-backend/tags.json @@ -0,0 +1,10 @@ +[ + { + "Key": "user:Stack", + "Value": "{project-env}" + }, + { + "Key": "user:Application", + "Value": "{project-name}" + } +] \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/.config/local-aws-info.json b/New_APIs/Amplify-fullstack-API/amplify/.config/local-aws-info.json new file mode 100644 index 00000000..5c40f605 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/.config/local-aws-info.json @@ -0,0 +1,5 @@ +{ + "staging": { + "configLevel": "amplifyAdmin" + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/.config/local-env-info.json b/New_APIs/Amplify-fullstack-API/amplify/.config/local-env-info.json new file mode 100644 index 00000000..fc2fd447 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/.config/local-env-info.json @@ -0,0 +1,5 @@ +{ + "projectPath": "/Users/anushkajoshi/Desktop/my-notes", + "defaultEditor": "sublime", + "envName": "staging" +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/.config/project-config.json b/New_APIs/Amplify-fullstack-API/amplify/.config/project-config.json new file mode 100644 index 00000000..0ead27f0 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/.config/project-config.json @@ -0,0 +1,17 @@ +{ + "providers": [ + "awscloudformation" + ], + "projectName": "mynotes", + "version": "3.1", + "frontend": "javascript", + "javascript": { + "framework": "react", + "config": { + "SourceDir": "src", + "DistributionDir": "build", + "BuildCommand": "npm run-script build", + "StartCommand": "npm run-script start" + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/README.md b/New_APIs/Amplify-fullstack-API/amplify/README.md new file mode 100644 index 00000000..46165a9c --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/README.md @@ -0,0 +1,8 @@ +# Getting Started with Amplify CLI +This directory was generated by [Amplify CLI](https://docs.amplify.aws/cli). + +Helpful resources: +- Amplify documentation: https://docs.amplify.aws. +- Amplify CLI documentation: https://docs.amplify.aws/cli. +- More details on this folder & generated files: https://docs.amplify.aws/cli/reference/files. +- Join Amplify's community: https://amplify.aws/community/. diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/amplify-meta.json b/New_APIs/Amplify-fullstack-API/amplify/backend/amplify-meta.json new file mode 100644 index 00000000..5b3a5532 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/amplify-meta.json @@ -0,0 +1,111 @@ +{ + "providers": { + "awscloudformation": { + "AuthRoleName": "amplify-mynotes-staging-b2b56-authRole", + "UnauthRoleArn": "arn:aws:iam::339712714202:role/amplify-mynotes-staging-b2b56-unauthRole", + "AuthRoleArn": "arn:aws:iam::339712714202:role/amplify-mynotes-staging-b2b56-authRole", + "Region": "ap-southeast-2", + "DeploymentBucketName": "amplify-mynotes-staging-b2b56-deployment", + "UnauthRoleName": "amplify-mynotes-staging-b2b56-unauthRole", + "StackName": "amplify-mynotes-staging-b2b56", + "StackId": "arn:aws:cloudformation:ap-southeast-2:339712714202:stack/amplify-mynotes-staging-b2b56/5d40cab0-4b32-11ef-8fd8-06f396c97ee1", + "AmplifyAppId": "d2nrrgvsn5u7rq" + } + }, + "api": { + "mynotes": { + "dependsOn": [], + "output": { + "authConfig": { + "additionalAuthenticationProviders": [], + "defaultAuthentication": { + "apiKeyConfig": { + "apiKeyExpirationDays": 7 + }, + "authenticationType": "API_KEY" + } + }, + "GraphQLAPIIdOutput": "cye6ubdc6bgxddnh7pcgwbmubi", + "GraphQLAPIEndpointOutput": "https://n5edpqals5aohotum3xa72osli.appsync-api.ap-southeast-2.amazonaws.com/graphql", + "GraphQLAPIKeyOutput": "da2-kehm2qcqofd3besloumulb5vlm" + }, + "providerPlugin": "awscloudformation", + "service": "AppSync", + "lastPushTimeStamp": "2024-07-26T15:57:37.537Z", + "providerMetadata": { + "s3TemplateURL": "https://s3.amazonaws.com/amplify-mynotes-staging-b2b56-deployment/amplify-cfn-templates/api/cloudformation-template.json", + "logicalId": "apimynotes" + } + } + }, + "auth": { + "mynotesccae4f3b": { + "customAuth": false, + "dependsOn": [], + "frontendAuthConfig": { + "mfaConfiguration": "OFF", + "mfaTypes": [ + "SMS" + ], + "passwordProtectionSettings": { + "passwordPolicyMinLength": 8, + "passwordPolicyCharacters": [] + }, + "signupAttributes": [ + "EMAIL" + ], + "socialProviders": [], + "usernameAttributes": [], + "verificationMechanisms": [ + "EMAIL" + ] + }, + "providerPlugin": "awscloudformation", + "service": "Cognito", + "output": { + "UserPoolId": "ap-southeast-2_i03FxeqOd", + "AppClientIDWeb": "6bm1hrehfqg90vta1ifbgjr00h", + "AppClientID": "1d896vivvec1d0hvqrk6lptel2", + "IdentityPoolId": "ap-southeast-2:9db4441d-2163-440e-adba-e23a3fe75fd4", + "UserPoolArn": "arn:aws:cognito-idp:ap-southeast-2:339712714202:userpool/ap-southeast-2_i03FxeqOd", + "IdentityPoolName": "mynotesccae4f3b_identitypool_ccae4f3b__staging", + "UserPoolName": "mynotesccae4f3b_userpool_ccae4f3b" + }, + "lastPushTimeStamp": "2024-07-26T15:57:44.008Z", + "providerMetadata": { + "s3TemplateURL": "https://s3.amazonaws.com/amplify-mynotes-staging-b2b56-deployment/amplify-cfn-templates/auth/mynotesccae4f3b-cloudformation-template.json", + "logicalId": "authmynotesccae4f3b" + }, + "lastPushDirHash": "Y2leA1T/brYAcNS4RPXQwBzzY/Q=" + } + }, + "function": { + "S3Triggerdc42a5d7": { + "service": "Lambda", + "providerPlugin": "awscloudformation", + "build": true, + "lastBuildTimeStamp": "2024-07-26T15:55:51.984Z", + "lastBuildType": "PROD", + "lastPackageTimeStamp": "2024-07-26T15:55:52.014Z", + "distZipFilename": "S3Triggerdc42a5d7-6a475541666d35456861-build.zip", + "s3Bucket": { + "deploymentBucketName": "amplify-mynotes-staging-b2b56-deployment", + "s3Key": "amplify-builds/S3Triggerdc42a5d7-6a475541666d35456861-build.zip" + }, + "providerMetadata": { + "s3TemplateURL": "https://s3.amazonaws.com/amplify-mynotes-staging-b2b56-deployment/amplify-cfn-templates/function/S3Triggerdc42a5d7-cloudformation-template.json", + "logicalId": "functionS3Triggerdc42a5d7" + }, + "lastPushTimeStamp": "2024-07-26T15:57:44.008Z", + "output": { + "LambdaExecutionRoleArn": "arn:aws:iam::339712714202:role/S3Triggerdc42a5d7LambdaRoledc42a5d7-staging", + "Region": "ap-southeast-2", + "Arn": "arn:aws:lambda:ap-southeast-2:339712714202:function:S3Triggerdc42a5d7-staging", + "Name": "S3Triggerdc42a5d7-staging", + "LambdaExecutionRole": "S3Triggerdc42a5d7LambdaRoledc42a5d7-staging" + }, + "lastPushDirHash": "1B2Qj8YebkkXB424dBxxW7J3vvM=" + } + }, + "storage": {} +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/cloudformation-template.json b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/cloudformation-template.json new file mode 100644 index 00000000..3bd9fb74 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/cloudformation-template.json @@ -0,0 +1,316 @@ +{ + "Parameters": { + "env": { + "Type": "String", + "Default": "NONE" + }, + "AppSyncApiName": { + "Type": "String", + "Default": "AppSyncSimpleTransform" + }, + "DynamoDBModelTableReadIOPS": { + "Type": "Number", + "Default": 5, + "Description": "The number of read IOPS the table should support." + }, + "DynamoDBModelTableWriteIOPS": { + "Type": "Number", + "Default": 5, + "Description": "The number of write IOPS the table should support." + }, + "DynamoDBBillingMode": { + "Type": "String", + "Default": "PAY_PER_REQUEST", + "AllowedValues": [ + "PAY_PER_REQUEST", + "PROVISIONED" + ], + "Description": "Configure @model types to create DynamoDB tables with PAY_PER_REQUEST or PROVISIONED billing modes." + }, + "DynamoDBEnablePointInTimeRecovery": { + "Type": "String", + "Default": "false", + "AllowedValues": [ + "true", + "false" + ], + "Description": "Whether to enable Point in Time Recovery on the table." + }, + "DynamoDBEnableServerSideEncryption": { + "Type": "String", + "Default": "true", + "AllowedValues": [ + "true", + "false" + ], + "Description": "Enable server side encryption powered by KMS." + }, + "S3DeploymentBucket": { + "Type": "String", + "Description": "An S3 Bucket name where assets are deployed" + }, + "S3DeploymentRootKey": { + "Type": "String", + "Description": "An S3 key relative to the S3DeploymentBucket that points to the root of the deployment directory." + } + }, + "Resources": { + "GraphQLAPI": { + "Type": "AWS::AppSync::GraphQLApi", + "Properties": { + "AuthenticationType": "API_KEY", + "Name": { + "Fn::Join": [ + "", + [ + { + "Ref": "AppSyncApiName" + }, + "-", + { + "Ref": "env" + } + ] + ] + } + } + }, + "GraphQLAPITransformerSchema3CB2AE18": { + "Type": "AWS::AppSync::GraphQLSchema", + "Properties": { + "ApiId": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "DefinitionS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "S3DeploymentBucket" + }, + "/", + { + "Ref": "S3DeploymentRootKey" + }, + "/schema.graphql" + ] + ] + } + } + }, + "GraphQLAPIDefaultApiKey215A6DD7": { + "Type": "AWS::AppSync::ApiKey", + "Properties": { + "ApiId": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "Expires": 1722614137 + } + }, + "GraphQLAPINONEDS95A13CF0": { + "Type": "AWS::AppSync::DataSource", + "Properties": { + "ApiId": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "Description": "None Data Source for Pipeline functions", + "Name": "NONE_DS", + "Type": "NONE" + } + }, + "Todo": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "Parameters": { + "DynamoDBModelTableReadIOPS": { + "Ref": "DynamoDBModelTableReadIOPS" + }, + "DynamoDBModelTableWriteIOPS": { + "Ref": "DynamoDBModelTableWriteIOPS" + }, + "DynamoDBBillingMode": { + "Ref": "DynamoDBBillingMode" + }, + "DynamoDBEnablePointInTimeRecovery": { + "Ref": "DynamoDBEnablePointInTimeRecovery" + }, + "DynamoDBEnableServerSideEncryption": { + "Ref": "DynamoDBEnableServerSideEncryption" + }, + "referencetotransformerrootstackenv10C5A902Ref": { + "Ref": "env" + }, + "referencetotransformerrootstackGraphQLAPI20497F53ApiId": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "referencetotransformerrootstackGraphQLAPINONEDS2BA9D1C8Name": { + "Fn::GetAtt": [ + "GraphQLAPINONEDS95A13CF0", + "Name" + ] + }, + "referencetotransformerrootstackS3DeploymentBucket7592718ARef": { + "Ref": "S3DeploymentBucket" + }, + "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref": { + "Ref": "S3DeploymentRootKey" + } + }, + "TemplateURL": { + "Fn::Join": [ + "", + [ + "https://s3.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "S3DeploymentBucket" + }, + "/", + { + "Ref": "S3DeploymentRootKey" + }, + "/stacks/Todo.json" + ] + ] + } + }, + "DependsOn": [ + "GraphQLAPITransformerSchema3CB2AE18" + ] + }, + "CustomResourcesjson": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "Parameters": { + "AppSyncApiId": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "AppSyncApiName": { + "Ref": "AppSyncApiName" + }, + "env": { + "Ref": "env" + }, + "S3DeploymentBucket": { + "Ref": "S3DeploymentBucket" + }, + "S3DeploymentRootKey": { + "Ref": "S3DeploymentRootKey" + } + }, + "TemplateURL": { + "Fn::Join": [ + "/", + [ + "https://s3.amazonaws.com", + { + "Ref": "S3DeploymentBucket" + }, + { + "Ref": "S3DeploymentRootKey" + }, + "stacks", + "CustomResources.json" + ] + ] + } + }, + "DependsOn": [ + "GraphQLAPI", + "GraphQLAPITransformerSchema3CB2AE18", + "Todo" + ] + } + }, + "Outputs": { + "GraphQLAPIKeyOutput": { + "Description": "Your GraphQL API ID.", + "Value": { + "Fn::GetAtt": [ + "GraphQLAPIDefaultApiKey215A6DD7", + "ApiKey" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "AWS::StackName" + }, + "GraphQLApiKey" + ] + ] + } + } + }, + "GraphQLAPIIdOutput": { + "Description": "Your GraphQL API ID.", + "Value": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "AWS::StackName" + }, + "GraphQLApiId" + ] + ] + } + } + }, + "GraphQLAPIEndpointOutput": { + "Description": "Your GraphQL API endpoint.", + "Value": { + "Fn::GetAtt": [ + "GraphQLAPI", + "GraphQLUrl" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "AWS::StackName" + }, + "GraphQLApiEndpoint" + ] + ] + } + } + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/parameters.json b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/parameters.json new file mode 100644 index 00000000..70c2ce98 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/parameters.json @@ -0,0 +1,7 @@ +{ + "AppSyncApiName": "mynotes", + "DynamoDBBillingMode": "PAY_PER_REQUEST", + "DynamoDBEnableServerSideEncryption": false, + "S3DeploymentBucket": "amplify-mynotes-staging-b2b56-deployment", + "S3DeploymentRootKey": "amplify-appsync-files/c0e971ea1ba703ba5054d45b1d4a7a475f98dd0a" +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.createTodo.init.1.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.createTodo.init.1.req.vtl new file mode 100644 index 00000000..df6b4cbb --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.createTodo.init.1.req.vtl @@ -0,0 +1,11 @@ +## [Start] Initialization default values. ** +$util.qr($ctx.stash.put("defaultValues", $util.defaultIfNull($ctx.stash.defaultValues, {}))) +$util.qr($ctx.stash.defaultValues.put("id", $util.autoId())) +#set( $createdAt = $util.time.nowISO8601() ) +$util.qr($ctx.stash.defaultValues.put("createdAt", $createdAt)) +$util.qr($ctx.stash.defaultValues.put("updatedAt", $createdAt)) +$util.toJson({ + "version": "2018-05-29", + "payload": {} +}) +## [End] Initialization default values. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.createTodo.postAuth.1.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.createTodo.postAuth.1.req.vtl new file mode 100644 index 00000000..2f6d422b --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.createTodo.postAuth.1.req.vtl @@ -0,0 +1,9 @@ +## [Start] Sandbox Mode Enabled, IAM Access Disabled. ** +#if( !$ctx.stash.get("hasAuth") ) + #if( $util.authType() == "API Key Authorization" ) + #return($util.toJson({})) + #end + $util.unauthorized() +#end +$util.toJson({}) +## [End] Sandbox Mode Enabled, IAM Access Disabled. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.createTodo.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.createTodo.req.vtl new file mode 100644 index 00000000..f03395e5 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.createTodo.req.vtl @@ -0,0 +1,66 @@ +## [Start] Create Request template. ** +#set( $args = $util.defaultIfNull($ctx.stash.transformedArgs, $ctx.args) ) +## Set the default values to put request ** +#set( $mergedValues = $util.defaultIfNull($ctx.stash.defaultValues, {}) ) +## copy the values from input ** +$util.qr($mergedValues.putAll($util.defaultIfNull($args.input, {}))) +## set the typename ** +$util.qr($mergedValues.put("__typename", "Todo")) +#set( $PutObject = { + "version": "2018-05-29", + "operation": "PutItem", + "attributeValues": $util.dynamodb.toMapValues($mergedValues), + "condition": $condition +} ) +#if( $args.condition ) + $util.qr($ctx.stash.conditions.add($args.condition)) +#end +## Begin - key condition ** +#if( $ctx.stash.metadata.modelObjectKey ) + #set( $keyConditionExpr = {} ) + #set( $keyConditionExprNames = {} ) + #foreach( $entry in $ctx.stash.metadata.modelObjectKey.entrySet() ) + $util.qr($keyConditionExpr.put("keyCondition$velocityCount", { + "attributeExists": false +})) + $util.qr($keyConditionExprNames.put("#keyCondition$velocityCount", "$entry.key")) + #end + $util.qr($ctx.stash.conditions.add($keyConditionExpr)) +#else + $util.qr($ctx.stash.conditions.add({ + "id": { + "attributeExists": false + } +})) +#end +## End - key condition ** +## Start condition block ** +#if( $ctx.stash.conditions && $ctx.stash.conditions.size() != 0 ) + #set( $mergedConditions = { + "and": $ctx.stash.conditions +} ) + #set( $Conditions = $util.parseJson($util.transform.toDynamoDBConditionExpression($mergedConditions)) ) + #if( $Conditions.expressionValues && $Conditions.expressionValues.size() == 0 ) + #set( $Conditions = { + "expression": $Conditions.expression, + "expressionNames": $Conditions.expressionNames +} ) + #end + ## End condition block ** +#end +#if( $Conditions ) + #if( $keyConditionExprNames ) + $util.qr($Conditions.expressionNames.putAll($keyConditionExprNames)) + #end + $util.qr($PutObject.put("condition", $Conditions)) +#end +#if( $ctx.stash.metadata.modelObjectKey ) + $util.qr($PutObject.put("key", $ctx.stash.metadata.modelObjectKey)) +#else + #set( $Key = { + "id": $util.dynamodb.toDynamoDB($mergedValues.id) +} ) + $util.qr($PutObject.put("key", $Key)) +#end +$util.toJson($PutObject) +## [End] Create Request template. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.createTodo.res.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.createTodo.res.vtl new file mode 100644 index 00000000..51199723 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.createTodo.res.vtl @@ -0,0 +1,8 @@ +## [Start] ResponseTemplate. ** +$util.qr($ctx.result.put("__operation", "Mutation")) +#if( $ctx.error ) + $util.error($ctx.error.message, $ctx.error.type) +#else + $util.toJson($ctx.result) +#end +## [End] ResponseTemplate. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.deleteTodo.postAuth.1.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.deleteTodo.postAuth.1.req.vtl new file mode 100644 index 00000000..2f6d422b --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.deleteTodo.postAuth.1.req.vtl @@ -0,0 +1,9 @@ +## [Start] Sandbox Mode Enabled, IAM Access Disabled. ** +#if( !$ctx.stash.get("hasAuth") ) + #if( $util.authType() == "API Key Authorization" ) + #return($util.toJson({})) + #end + $util.unauthorized() +#end +$util.toJson({}) +## [End] Sandbox Mode Enabled, IAM Access Disabled. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.deleteTodo.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.deleteTodo.req.vtl new file mode 100644 index 00000000..ace459bd --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.deleteTodo.req.vtl @@ -0,0 +1,58 @@ +## [Start] Delete Request template. ** +#set( $args = $util.defaultIfNull($ctx.stash.transformedArgs, $ctx.args) ) +#set( $DeleteRequest = { + "version": "2018-05-29", + "operation": "DeleteItem" +} ) +#if( $ctx.stash.metadata.modelObjectKey ) + #set( $Key = $ctx.stash.metadata.modelObjectKey ) +#else + #set( $Key = { + "id": $util.dynamodb.toDynamoDB($args.input.id) +} ) +#end +$util.qr($DeleteRequest.put("key", $Key)) +## Begin - key condition ** +#if( $ctx.stash.metadata.modelObjectKey ) + #set( $keyConditionExpr = {} ) + #set( $keyConditionExprNames = {} ) + #foreach( $entry in $ctx.stash.metadata.modelObjectKey.entrySet() ) + $util.qr($keyConditionExpr.put("keyCondition$velocityCount", { + "attributeExists": true +})) + $util.qr($keyConditionExprNames.put("#keyCondition$velocityCount", "$entry.key")) + #end + $util.qr($ctx.stash.conditions.add($keyConditionExpr)) +#else + $util.qr($ctx.stash.conditions.add({ + "id": { + "attributeExists": true + } +})) +#end +## End - key condition ** +#if( $args.condition ) + $util.qr($ctx.stash.conditions.add($args.condition)) +#end +## Start condition block ** +#if( $ctx.stash.conditions && $ctx.stash.conditions.size() != 0 ) + #set( $mergedConditions = { + "and": $ctx.stash.conditions +} ) + #set( $Conditions = $util.parseJson($util.transform.toDynamoDBConditionExpression($mergedConditions)) ) + #if( $Conditions.expressionValues && $Conditions.expressionValues.size() == 0 ) + #set( $Conditions = { + "expression": $Conditions.expression, + "expressionNames": $Conditions.expressionNames +} ) + #end + ## End condition block ** +#end +#if( $Conditions ) + #if( $keyConditionExprNames ) + $util.qr($Conditions.expressionNames.putAll($keyConditionExprNames)) + #end + $util.qr($DeleteRequest.put("condition", $Conditions)) +#end +$util.toJson($DeleteRequest) +## [End] Delete Request template. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.deleteTodo.res.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.deleteTodo.res.vtl new file mode 100644 index 00000000..51199723 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.deleteTodo.res.vtl @@ -0,0 +1,8 @@ +## [Start] ResponseTemplate. ** +$util.qr($ctx.result.put("__operation", "Mutation")) +#if( $ctx.error ) + $util.error($ctx.error.message, $ctx.error.type) +#else + $util.toJson($ctx.result) +#end +## [End] ResponseTemplate. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.updateTodo.init.1.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.updateTodo.init.1.req.vtl new file mode 100644 index 00000000..ab5766fb --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.updateTodo.init.1.req.vtl @@ -0,0 +1,9 @@ +## [Start] Initialization default values. ** +$util.qr($ctx.stash.put("defaultValues", $util.defaultIfNull($ctx.stash.defaultValues, {}))) +#set( $updatedAt = $util.time.nowISO8601() ) +$util.qr($ctx.stash.defaultValues.put("updatedAt", $updatedAt)) +$util.toJson({ + "version": "2018-05-29", + "payload": {} +}) +## [End] Initialization default values. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.updateTodo.postAuth.1.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.updateTodo.postAuth.1.req.vtl new file mode 100644 index 00000000..2f6d422b --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.updateTodo.postAuth.1.req.vtl @@ -0,0 +1,9 @@ +## [Start] Sandbox Mode Enabled, IAM Access Disabled. ** +#if( !$ctx.stash.get("hasAuth") ) + #if( $util.authType() == "API Key Authorization" ) + #return($util.toJson({})) + #end + $util.unauthorized() +#end +$util.toJson({}) +## [End] Sandbox Mode Enabled, IAM Access Disabled. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.updateTodo.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.updateTodo.req.vtl new file mode 100644 index 00000000..a1bd67d2 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.updateTodo.req.vtl @@ -0,0 +1,130 @@ +## [Start] Mutation Update resolver. ** +#set( $args = $util.defaultIfNull($ctx.stash.transformedArgs, $ctx.args) ) +## Set the default values to put request ** +#set( $mergedValues = $util.defaultIfNull($ctx.stash.defaultValues, {}) ) +## copy the values from input ** +$util.qr($mergedValues.putAll($util.defaultIfNull($args.input, {}))) +## set the typename ** +## Initialize the vars for creating ddb expression ** +#set( $expNames = {} ) +#set( $expValues = {} ) +#set( $expSet = {} ) +#set( $expAdd = {} ) +#set( $expRemove = [] ) +#if( $ctx.stash.metadata.modelObjectKey ) + #set( $Key = $ctx.stash.metadata.modelObjectKey ) +#else + #set( $Key = { + "id": $util.dynamodb.toDynamoDB($args.input.id) +} ) +#end +## Model key ** +#if( $ctx.stash.metadata.modelObjectKey ) + #set( $keyFields = [] ) + #foreach( $entry in $ctx.stash.metadata.modelObjectKey.entrySet() ) + $util.qr($keyFields.add("$entry.key")) + #end +#else + #set( $keyFields = ["id"] ) +#end +#foreach( $entry in $util.map.copyAndRemoveAllKeys($mergedValues, $keyFields).entrySet() ) + #if( !$util.isNull($ctx.stash.metadata.dynamodbNameOverrideMap) && $ctx.stash.metadata.dynamodbNameOverrideMap.containsKey("$entry.key") ) + #set( $entryKeyAttributeName = $ctx.stash.metadata.dynamodbNameOverrideMap.get("$entry.key") ) + #else + #set( $entryKeyAttributeName = $entry.key ) + #end + #if( $util.isNull($entry.value) ) + #set( $discard = $expRemove.add("#$entryKeyAttributeName") ) + $util.qr($expNames.put("#$entryKeyAttributeName", "$entry.key")) + #else + $util.qr($expSet.put("#$entryKeyAttributeName", ":$entryKeyAttributeName")) + $util.qr($expNames.put("#$entryKeyAttributeName", "$entry.key")) + $util.qr($expValues.put(":$entryKeyAttributeName", $util.dynamodb.toDynamoDB($entry.value))) + #end +#end +#set( $expression = "" ) +#if( !$expSet.isEmpty() ) + #set( $expression = "SET" ) + #foreach( $entry in $expSet.entrySet() ) + #set( $expression = "$expression $entry.key = $entry.value" ) + #if( $foreach.hasNext() ) + #set( $expression = "$expression," ) + #end + #end +#end +#if( !$expAdd.isEmpty() ) + #set( $expression = "$expression ADD" ) + #foreach( $entry in $expAdd.entrySet() ) + #set( $expression = "$expression $entry.key $entry.value" ) + #if( $foreach.hasNext() ) + #set( $expression = "$expression," ) + #end + #end +#end +#if( !$expRemove.isEmpty() ) + #set( $expression = "$expression REMOVE" ) + #foreach( $entry in $expRemove ) + #set( $expression = "$expression $entry" ) + #if( $foreach.hasNext() ) + #set( $expression = "$expression," ) + #end + #end +#end +#set( $update = {} ) +$util.qr($update.put("expression", "$expression")) +#if( !$expNames.isEmpty() ) + $util.qr($update.put("expressionNames", $expNames)) +#end +#if( !$expValues.isEmpty() ) + $util.qr($update.put("expressionValues", $expValues)) +#end +## Begin - key condition ** +#if( $ctx.stash.metadata.modelObjectKey ) + #set( $keyConditionExpr = {} ) + #set( $keyConditionExprNames = {} ) + #foreach( $entry in $ctx.stash.metadata.modelObjectKey.entrySet() ) + $util.qr($keyConditionExpr.put("keyCondition$velocityCount", { + "attributeExists": true +})) + $util.qr($keyConditionExprNames.put("#keyCondition$velocityCount", "$entry.key")) + #end + $util.qr($ctx.stash.conditions.add($keyConditionExpr)) +#else + $util.qr($ctx.stash.conditions.add({ + "id": { + "attributeExists": true + } +})) +#end +## End - key condition ** +#if( $args.condition ) + $util.qr($ctx.stash.conditions.add($args.condition)) +#end +## Start condition block ** +#if( $ctx.stash.conditions && $ctx.stash.conditions.size() != 0 ) + #set( $mergedConditions = { + "and": $ctx.stash.conditions +} ) + #set( $Conditions = $util.parseJson($util.transform.toDynamoDBConditionExpression($mergedConditions)) ) + #if( $Conditions.expressionValues && $Conditions.expressionValues.size() == 0 ) + #set( $Conditions = { + "expression": $Conditions.expression, + "expressionNames": $Conditions.expressionNames +} ) + #end + ## End condition block ** +#end +#set( $UpdateItem = { + "version": "2018-05-29", + "operation": "UpdateItem", + "key": $Key, + "update": $update +} ) +#if( $Conditions ) + #if( $keyConditionExprNames ) + $util.qr($Conditions.expressionNames.putAll($keyConditionExprNames)) + #end + $util.qr($UpdateItem.put("condition", $Conditions)) +#end +$util.toJson($UpdateItem) +## [End] Mutation Update resolver. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.updateTodo.res.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.updateTodo.res.vtl new file mode 100644 index 00000000..51199723 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Mutation.updateTodo.res.vtl @@ -0,0 +1,8 @@ +## [Start] ResponseTemplate. ** +$util.qr($ctx.result.put("__operation", "Mutation")) +#if( $ctx.error ) + $util.error($ctx.error.message, $ctx.error.type) +#else + $util.toJson($ctx.result) +#end +## [End] ResponseTemplate. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Query.getTodo.postAuth.1.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Query.getTodo.postAuth.1.req.vtl new file mode 100644 index 00000000..2f6d422b --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Query.getTodo.postAuth.1.req.vtl @@ -0,0 +1,9 @@ +## [Start] Sandbox Mode Enabled, IAM Access Disabled. ** +#if( !$ctx.stash.get("hasAuth") ) + #if( $util.authType() == "API Key Authorization" ) + #return($util.toJson({})) + #end + $util.unauthorized() +#end +$util.toJson({}) +## [End] Sandbox Mode Enabled, IAM Access Disabled. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Query.getTodo.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Query.getTodo.req.vtl new file mode 100644 index 00000000..a8d7811a --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Query.getTodo.req.vtl @@ -0,0 +1,34 @@ +## [Start] Get Request template. ** +#set( $GetRequest = { + "version": "2018-05-29", + "operation": "Query" +} ) +#if( $ctx.stash.metadata.modelObjectKey ) + #set( $expression = "" ) + #set( $expressionNames = {} ) + #set( $expressionValues = {} ) + #foreach( $item in $ctx.stash.metadata.modelObjectKey.entrySet() ) + #set( $expression = "$expression#keyCount$velocityCount = :valueCount$velocityCount AND " ) + $util.qr($expressionNames.put("#keyCount$velocityCount", $item.key)) + $util.qr($expressionValues.put(":valueCount$velocityCount", $item.value)) + #end + #set( $expression = $expression.replaceAll("AND $", "") ) + #set( $query = { + "expression": $expression, + "expressionNames": $expressionNames, + "expressionValues": $expressionValues +} ) +#else + #set( $query = { + "expression": "id = :id", + "expressionValues": { + ":id": $util.parseJson($util.dynamodb.toDynamoDBJson($ctx.args.id)) + } +} ) +#end +$util.qr($GetRequest.put("query", $query)) +#if( !$util.isNullOrEmpty($ctx.stash.authFilter) ) + $util.qr($GetRequest.put("filter", $util.parseJson($util.transform.toDynamoDBFilterExpression($ctx.stash.authFilter)))) +#end +$util.toJson($GetRequest) +## [End] Get Request template. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Query.getTodo.res.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Query.getTodo.res.vtl new file mode 100644 index 00000000..e9ef1436 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Query.getTodo.res.vtl @@ -0,0 +1,13 @@ +## [Start] Get Response template. ** +#if( $ctx.error ) + $util.error($ctx.error.message, $ctx.error.type) +#end +#if( !$ctx.result.items.isEmpty() && $ctx.result.scannedCount == 1 ) + $util.toJson($ctx.result.items[0]) +#else + #if( $ctx.result.items.isEmpty() && $ctx.result.scannedCount == 1 ) +$util.unauthorized() + #end + $util.toJson(null) +#end +## [End] Get Response template. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Query.listTodos.postAuth.1.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Query.listTodos.postAuth.1.req.vtl new file mode 100644 index 00000000..2f6d422b --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Query.listTodos.postAuth.1.req.vtl @@ -0,0 +1,9 @@ +## [Start] Sandbox Mode Enabled, IAM Access Disabled. ** +#if( !$ctx.stash.get("hasAuth") ) + #if( $util.authType() == "API Key Authorization" ) + #return($util.toJson({})) + #end + $util.unauthorized() +#end +$util.toJson({}) +## [End] Sandbox Mode Enabled, IAM Access Disabled. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Query.listTodos.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Query.listTodos.req.vtl new file mode 100644 index 00000000..01421371 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Query.listTodos.req.vtl @@ -0,0 +1,50 @@ +## [Start] List Request. ** +#set( $args = $util.defaultIfNull($ctx.stash.transformedArgs, $ctx.args) ) +#set( $limit = $util.defaultIfNull($args.limit, 100) ) +#set( $ListRequest = { + "version": "2018-05-29", + "limit": $limit +} ) +#if( $args.nextToken ) + #set( $ListRequest.nextToken = $args.nextToken ) +#end +#if( !$util.isNullOrEmpty($ctx.stash.authFilter) ) + #set( $filter = $ctx.stash.authFilter ) + #if( !$util.isNullOrEmpty($args.filter) ) + #set( $filter = { + "and": [$filter, $args.filter] +} ) + #end +#else + #if( !$util.isNullOrEmpty($args.filter) ) + #set( $filter = $args.filter ) + #end +#end +#if( !$util.isNullOrEmpty($filter) ) + #set( $filterExpression = $util.parseJson($util.transform.toDynamoDBFilterExpression($filter)) ) + #if( $util.isNullOrEmpty($filterExpression) ) + $util.error("Unable to process the filter expression", "Unrecognized Filter") + #end + #if( !$util.isNullOrBlank($filterExpression.expression) ) + #if( $filterExpression.expressionValues.size() == 0 ) + $util.qr($filterExpression.remove("expressionValues")) + #end + #set( $ListRequest.filter = $filterExpression ) + #end +#end +#if( !$util.isNull($ctx.stash.modelQueryExpression) && !$util.isNullOrEmpty($ctx.stash.modelQueryExpression.expression) ) + $util.qr($ListRequest.put("operation", "Query")) + $util.qr($ListRequest.put("query", $ctx.stash.modelQueryExpression)) + #if( !$util.isNull($args.sortDirection) && $args.sortDirection == "DESC" ) + #set( $ListRequest.scanIndexForward = false ) + #else + #set( $ListRequest.scanIndexForward = true ) + #end +#else + $util.qr($ListRequest.put("operation", "Scan")) +#end +#if( !$util.isNull($ctx.stash.metadata.index) ) + #set( $ListRequest.IndexName = $ctx.stash.metadata.index ) +#end +$util.toJson($ListRequest) +## [End] List Request. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Query.listTodos.res.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Query.listTodos.res.vtl new file mode 100644 index 00000000..ee8b6670 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Query.listTodos.res.vtl @@ -0,0 +1,7 @@ +## [Start] ResponseTemplate. ** +#if( $ctx.error ) + $util.error($ctx.error.message, $ctx.error.type) +#else + $util.toJson($ctx.result) +#end +## [End] ResponseTemplate. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onCreateTodo.postAuth.1.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onCreateTodo.postAuth.1.req.vtl new file mode 100644 index 00000000..2f6d422b --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onCreateTodo.postAuth.1.req.vtl @@ -0,0 +1,9 @@ +## [Start] Sandbox Mode Enabled, IAM Access Disabled. ** +#if( !$ctx.stash.get("hasAuth") ) + #if( $util.authType() == "API Key Authorization" ) + #return($util.toJson({})) + #end + $util.unauthorized() +#end +$util.toJson({}) +## [End] Sandbox Mode Enabled, IAM Access Disabled. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onCreateTodo.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onCreateTodo.req.vtl new file mode 100644 index 00000000..f64092d4 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onCreateTodo.req.vtl @@ -0,0 +1,6 @@ +## [Start] Subscription Request template. ** +$util.toJson({ + "version": "2018-05-29", + "payload": {} +}) +## [End] Subscription Request template. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onCreateTodo.res.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onCreateTodo.res.vtl new file mode 100644 index 00000000..62769cc6 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onCreateTodo.res.vtl @@ -0,0 +1,6 @@ +## [Start] Subscription Response template. ** +#if( !$util.isNullOrEmpty($ctx.args.filter) ) +$extensions.setSubscriptionFilter($util.transform.toSubscriptionFilter($ctx.args.filter)) +#end +$util.toJson(null) +## [End] Subscription Response template. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onDeleteTodo.postAuth.1.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onDeleteTodo.postAuth.1.req.vtl new file mode 100644 index 00000000..2f6d422b --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onDeleteTodo.postAuth.1.req.vtl @@ -0,0 +1,9 @@ +## [Start] Sandbox Mode Enabled, IAM Access Disabled. ** +#if( !$ctx.stash.get("hasAuth") ) + #if( $util.authType() == "API Key Authorization" ) + #return($util.toJson({})) + #end + $util.unauthorized() +#end +$util.toJson({}) +## [End] Sandbox Mode Enabled, IAM Access Disabled. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onDeleteTodo.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onDeleteTodo.req.vtl new file mode 100644 index 00000000..f64092d4 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onDeleteTodo.req.vtl @@ -0,0 +1,6 @@ +## [Start] Subscription Request template. ** +$util.toJson({ + "version": "2018-05-29", + "payload": {} +}) +## [End] Subscription Request template. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onDeleteTodo.res.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onDeleteTodo.res.vtl new file mode 100644 index 00000000..62769cc6 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onDeleteTodo.res.vtl @@ -0,0 +1,6 @@ +## [Start] Subscription Response template. ** +#if( !$util.isNullOrEmpty($ctx.args.filter) ) +$extensions.setSubscriptionFilter($util.transform.toSubscriptionFilter($ctx.args.filter)) +#end +$util.toJson(null) +## [End] Subscription Response template. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onUpdateTodo.postAuth.1.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onUpdateTodo.postAuth.1.req.vtl new file mode 100644 index 00000000..2f6d422b --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onUpdateTodo.postAuth.1.req.vtl @@ -0,0 +1,9 @@ +## [Start] Sandbox Mode Enabled, IAM Access Disabled. ** +#if( !$ctx.stash.get("hasAuth") ) + #if( $util.authType() == "API Key Authorization" ) + #return($util.toJson({})) + #end + $util.unauthorized() +#end +$util.toJson({}) +## [End] Sandbox Mode Enabled, IAM Access Disabled. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onUpdateTodo.req.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onUpdateTodo.req.vtl new file mode 100644 index 00000000..f64092d4 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onUpdateTodo.req.vtl @@ -0,0 +1,6 @@ +## [Start] Subscription Request template. ** +$util.toJson({ + "version": "2018-05-29", + "payload": {} +}) +## [End] Subscription Request template. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onUpdateTodo.res.vtl b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onUpdateTodo.res.vtl new file mode 100644 index 00000000..62769cc6 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/resolvers/Subscription.onUpdateTodo.res.vtl @@ -0,0 +1,6 @@ +## [Start] Subscription Response template. ** +#if( !$util.isNullOrEmpty($ctx.args.filter) ) +$extensions.setSubscriptionFilter($util.transform.toSubscriptionFilter($ctx.args.filter)) +#end +$util.toJson(null) +## [End] Subscription Response template. ** \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/schema.graphql b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/schema.graphql new file mode 100644 index 00000000..987aa6a6 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/schema.graphql @@ -0,0 +1,226 @@ +type Todo { + id: ID! + name: String! + description: String + createdAt: AWSDateTime! + updatedAt: AWSDateTime! +} + +input ModelStringInput { + ne: String + eq: String + le: String + lt: String + ge: String + gt: String + contains: String + notContains: String + between: [String] + beginsWith: String + attributeExists: Boolean + attributeType: ModelAttributeTypes + size: ModelSizeInput +} + +input ModelIntInput { + ne: Int + eq: Int + le: Int + lt: Int + ge: Int + gt: Int + between: [Int] + attributeExists: Boolean + attributeType: ModelAttributeTypes +} + +input ModelFloatInput { + ne: Float + eq: Float + le: Float + lt: Float + ge: Float + gt: Float + between: [Float] + attributeExists: Boolean + attributeType: ModelAttributeTypes +} + +input ModelBooleanInput { + ne: Boolean + eq: Boolean + attributeExists: Boolean + attributeType: ModelAttributeTypes +} + +input ModelIDInput { + ne: ID + eq: ID + le: ID + lt: ID + ge: ID + gt: ID + contains: ID + notContains: ID + between: [ID] + beginsWith: ID + attributeExists: Boolean + attributeType: ModelAttributeTypes + size: ModelSizeInput +} + +input ModelSubscriptionStringInput { + ne: String + eq: String + le: String + lt: String + ge: String + gt: String + contains: String + notContains: String + between: [String] + beginsWith: String + in: [String] + notIn: [String] +} + +input ModelSubscriptionIntInput { + ne: Int + eq: Int + le: Int + lt: Int + ge: Int + gt: Int + between: [Int] + in: [Int] + notIn: [Int] +} + +input ModelSubscriptionFloatInput { + ne: Float + eq: Float + le: Float + lt: Float + ge: Float + gt: Float + between: [Float] + in: [Float] + notIn: [Float] +} + +input ModelSubscriptionBooleanInput { + ne: Boolean + eq: Boolean +} + +input ModelSubscriptionIDInput { + ne: ID + eq: ID + le: ID + lt: ID + ge: ID + gt: ID + contains: ID + notContains: ID + between: [ID] + beginsWith: ID + in: [ID] + notIn: [ID] +} + +enum ModelAttributeTypes { + binary + binarySet + bool + list + map + number + numberSet + string + stringSet + _null +} + +input ModelSizeInput { + ne: Int + eq: Int + le: Int + lt: Int + ge: Int + gt: Int + between: [Int] +} + +enum ModelSortDirection { + ASC + DESC +} + +type ModelTodoConnection { + items: [Todo]! + nextToken: String +} + +input ModelTodoFilterInput { + id: ModelIDInput + name: ModelStringInput + description: ModelStringInput + createdAt: ModelStringInput + updatedAt: ModelStringInput + and: [ModelTodoFilterInput] + or: [ModelTodoFilterInput] + not: ModelTodoFilterInput +} + +type Query { + getTodo(id: ID!): Todo + listTodos(filter: ModelTodoFilterInput, limit: Int, nextToken: String): ModelTodoConnection +} + +input ModelTodoConditionInput { + name: ModelStringInput + description: ModelStringInput + and: [ModelTodoConditionInput] + or: [ModelTodoConditionInput] + not: ModelTodoConditionInput + createdAt: ModelStringInput + updatedAt: ModelStringInput +} + +input CreateTodoInput { + id: ID + name: String! + description: String +} + +input UpdateTodoInput { + id: ID! + name: String + description: String +} + +input DeleteTodoInput { + id: ID! +} + +type Mutation { + createTodo(input: CreateTodoInput!, condition: ModelTodoConditionInput): Todo + updateTodo(input: UpdateTodoInput!, condition: ModelTodoConditionInput): Todo + deleteTodo(input: DeleteTodoInput!, condition: ModelTodoConditionInput): Todo +} + +input ModelSubscriptionTodoFilterInput { + id: ModelSubscriptionIDInput + name: ModelSubscriptionStringInput + description: ModelSubscriptionStringInput + createdAt: ModelSubscriptionStringInput + updatedAt: ModelSubscriptionStringInput + and: [ModelSubscriptionTodoFilterInput] + or: [ModelSubscriptionTodoFilterInput] +} + +type Subscription { + onCreateTodo(filter: ModelSubscriptionTodoFilterInput): Todo @aws_subscribe(mutations: ["createTodo"]) + onUpdateTodo(filter: ModelSubscriptionTodoFilterInput): Todo @aws_subscribe(mutations: ["updateTodo"]) + onDeleteTodo(filter: ModelSubscriptionTodoFilterInput): Todo @aws_subscribe(mutations: ["deleteTodo"]) +} diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/stacks/CustomResources.json b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/stacks/CustomResources.json new file mode 100644 index 00000000..01699127 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/stacks/CustomResources.json @@ -0,0 +1,61 @@ +{ + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "An auto-generated nested stack.", + "Metadata": {}, + "Parameters": { + "AppSyncApiId": { + "Type": "String", + "Description": "The id of the AppSync API associated with this project." + }, + "AppSyncApiName": { + "Type": "String", + "Description": "The name of the AppSync API", + "Default": "AppSyncSimpleTransform" + }, + "env": { + "Type": "String", + "Description": "The environment name. e.g. Dev, Test, or Production", + "Default": "NONE" + }, + "S3DeploymentBucket": { + "Type": "String", + "Description": "The S3 bucket containing all deployment assets for the project." + }, + "S3DeploymentRootKey": { + "Type": "String", + "Description": "An S3 key relative to the S3DeploymentBucket that points to the root\nof the deployment directory." + } + }, + "Resources": { + "EmptyResource": { + "Type": "Custom::EmptyResource", + "Condition": "AlwaysFalse" + } + }, + "Conditions": { + "HasEnvironmentParameter": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + ] + }, + "AlwaysFalse": { + "Fn::Equals": [ + "true", + "false" + ] + } + }, + "Outputs": { + "EmptyOutput": { + "Description": "An empty output. You may delete this if you have at least one resource above.", + "Value": "" + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/stacks/Todo.json b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/stacks/Todo.json new file mode 100644 index 00000000..14d8d57d --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/build/stacks/Todo.json @@ -0,0 +1,1117 @@ +{ + "Parameters": { + "DynamoDBModelTableReadIOPS": { + "Type": "Number", + "Default": 5, + "Description": "The number of read IOPS the table should support." + }, + "DynamoDBModelTableWriteIOPS": { + "Type": "Number", + "Default": 5, + "Description": "The number of write IOPS the table should support." + }, + "DynamoDBBillingMode": { + "Type": "String", + "Default": "PAY_PER_REQUEST", + "AllowedValues": [ + "PAY_PER_REQUEST", + "PROVISIONED" + ], + "Description": "Configure @model types to create DynamoDB tables with PAY_PER_REQUEST or PROVISIONED billing modes." + }, + "DynamoDBEnablePointInTimeRecovery": { + "Type": "String", + "Default": "false", + "AllowedValues": [ + "true", + "false" + ], + "Description": "Whether to enable Point in Time Recovery on the table." + }, + "DynamoDBEnableServerSideEncryption": { + "Type": "String", + "Default": "true", + "AllowedValues": [ + "true", + "false" + ], + "Description": "Enable server side encryption powered by KMS." + }, + "referencetotransformerrootstackenv10C5A902Ref": { + "Type": "String" + }, + "referencetotransformerrootstackGraphQLAPI20497F53ApiId": { + "Type": "String" + }, + "referencetotransformerrootstackGraphQLAPINONEDS2BA9D1C8Name": { + "Type": "String" + }, + "referencetotransformerrootstackS3DeploymentBucket7592718ARef": { + "Type": "String" + }, + "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref": { + "Type": "String" + } + }, + "Conditions": { + "HasEnvironmentParameter": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "referencetotransformerrootstackenv10C5A902Ref" + }, + "NONE" + ] + } + ] + }, + "ShouldUseServerSideEncryption": { + "Fn::Equals": [ + { + "Ref": "DynamoDBEnableServerSideEncryption" + }, + "true" + ] + }, + "ShouldUsePayPerRequestBilling": { + "Fn::Equals": [ + { + "Ref": "DynamoDBBillingMode" + }, + "PAY_PER_REQUEST" + ] + }, + "ShouldUsePointInTimeRecovery": { + "Fn::Equals": [ + { + "Ref": "DynamoDBEnablePointInTimeRecovery" + }, + "true" + ] + } + }, + "Resources": { + "TodoTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "AttributeDefinitions": [ + { + "AttributeName": "id", + "AttributeType": "S" + } + ], + "BillingMode": { + "Fn::If": [ + "ShouldUsePayPerRequestBilling", + "PAY_PER_REQUEST", + { + "Ref": "AWS::NoValue" + } + ] + }, + "KeySchema": [ + { + "AttributeName": "id", + "KeyType": "HASH" + } + ], + "PointInTimeRecoverySpecification": { + "Fn::If": [ + "ShouldUsePointInTimeRecovery", + { + "PointInTimeRecoveryEnabled": true + }, + { + "Ref": "AWS::NoValue" + } + ] + }, + "ProvisionedThroughput": { + "Fn::If": [ + "ShouldUsePayPerRequestBilling", + { + "Ref": "AWS::NoValue" + }, + { + "ReadCapacityUnits": { + "Ref": "DynamoDBModelTableReadIOPS" + }, + "WriteCapacityUnits": { + "Ref": "DynamoDBModelTableWriteIOPS" + } + } + ] + }, + "SSESpecification": { + "SSEEnabled": { + "Fn::If": [ + "ShouldUseServerSideEncryption", + true, + false + ] + } + }, + "StreamSpecification": { + "StreamViewType": "NEW_AND_OLD_IMAGES" + }, + "TableName": { + "Fn::Join": [ + "", + [ + "Todo-", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "-", + { + "Ref": "referencetotransformerrootstackenv10C5A902Ref" + } + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "TodoIAMRole2DA8E66E": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "appsync.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "dynamodb:BatchGetItem", + "dynamodb:BatchWriteItem", + "dynamodb:PutItem", + "dynamodb:DeleteItem", + "dynamodb:GetItem", + "dynamodb:Scan", + "dynamodb:Query", + "dynamodb:UpdateItem", + "dynamodb:ConditionCheckItem", + "dynamodb:DescribeTable", + "dynamodb:GetRecords", + "dynamodb:GetShardIterator" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Sub": [ + "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tablename}", + { + "tablename": { + "Fn::Join": [ + "", + [ + "Todo-", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "-", + { + "Ref": "referencetotransformerrootstackenv10C5A902Ref" + } + ] + ] + } + } + ] + }, + { + "Fn::Sub": [ + "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tablename}/*", + { + "tablename": { + "Fn::Join": [ + "", + [ + "Todo-", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "-", + { + "Ref": "referencetotransformerrootstackenv10C5A902Ref" + } + ] + ] + } + } + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "DynamoDBAccess" + } + ], + "RoleName": { + "Fn::Join": [ + "", + [ + "TodoIAMRolecfd440-", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "-", + { + "Ref": "referencetotransformerrootstackenv10C5A902Ref" + } + ] + ] + } + } + }, + "TodoDataSource": { + "Type": "AWS::AppSync::DataSource", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "DynamoDBConfig": { + "AwsRegion": { + "Ref": "AWS::Region" + }, + "TableName": { + "Ref": "TodoTable" + } + }, + "Name": "TodoTable", + "ServiceRoleArn": { + "Fn::GetAtt": [ + "TodoIAMRole2DA8E66E", + "Arn" + ] + }, + "Type": "AMAZON_DYNAMODB" + }, + "DependsOn": [ + "TodoIAMRole2DA8E66E" + ] + }, + "QuerygetTodopostAuth0FunctionQuerygetTodopostAuth0FunctionAppSyncFunction6BE14593": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "DataSourceName": { + "Ref": "referencetotransformerrootstackGraphQLAPINONEDS2BA9D1C8Name" + }, + "FunctionVersion": "2018-05-29", + "Name": "QuerygetTodopostAuth0Function", + "RequestMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Query.getTodo.postAuth.1.req.vtl" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson({})" + } + }, + "QueryGetTodoDataResolverFnQueryGetTodoDataResolverFnAppSyncFunctionE2B57DAD": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "DataSourceName": { + "Fn::GetAtt": [ + "TodoDataSource", + "Name" + ] + }, + "FunctionVersion": "2018-05-29", + "Name": "QueryGetTodoDataResolverFn", + "RequestMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Query.getTodo.req.vtl" + ] + ] + }, + "ResponseMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Query.getTodo.res.vtl" + ] + ] + } + }, + "DependsOn": [ + "TodoDataSource" + ] + }, + "GetTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "FieldName": "getTodo", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "QuerygetTodopostAuth0FunctionQuerygetTodopostAuth0FunctionAppSyncFunction6BE14593", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "QueryGetTodoDataResolverFnQueryGetTodoDataResolverFnAppSyncFunctionE2B57DAD", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Query\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"getTodo\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"AMAZON_DYNAMODB\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", + { + "Ref": "TodoTable" + }, + "\"))\n$util.qr($ctx.stash.put(\"identityPoolId\", \"ap-southeast-2:9db4441d-2163-440e-adba-e23a3fe75fd4\"))\n$util.qr($ctx.stash.put(\"adminRoles\", [\"ap-southeast-2_azDpi6nee_Full-access/CognitoIdentityCredentials\",\"ap-southeast-2_azDpi6nee_Manage-only/CognitoIdentityCredentials\"]))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Query" + } + }, + "QueryListTodosDataResolverFnQueryListTodosDataResolverFnAppSyncFunctionF825FE47": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "DataSourceName": { + "Fn::GetAtt": [ + "TodoDataSource", + "Name" + ] + }, + "FunctionVersion": "2018-05-29", + "Name": "QueryListTodosDataResolverFn", + "RequestMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Query.listTodos.req.vtl" + ] + ] + }, + "ResponseMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Query.listTodos.res.vtl" + ] + ] + } + }, + "DependsOn": [ + "TodoDataSource" + ] + }, + "ListTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "FieldName": "listTodos", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "QuerygetTodopostAuth0FunctionQuerygetTodopostAuth0FunctionAppSyncFunction6BE14593", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "QueryListTodosDataResolverFnQueryListTodosDataResolverFnAppSyncFunctionF825FE47", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Query\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"listTodos\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"AMAZON_DYNAMODB\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", + { + "Ref": "TodoTable" + }, + "\"))\n$util.qr($ctx.stash.put(\"identityPoolId\", \"ap-southeast-2:9db4441d-2163-440e-adba-e23a3fe75fd4\"))\n$util.qr($ctx.stash.put(\"adminRoles\", [\"ap-southeast-2_azDpi6nee_Full-access/CognitoIdentityCredentials\",\"ap-southeast-2_azDpi6nee_Manage-only/CognitoIdentityCredentials\"]))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Query" + } + }, + "MutationcreateTodoinit0FunctionMutationcreateTodoinit0FunctionAppSyncFunction54DE5B8B": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "DataSourceName": { + "Ref": "referencetotransformerrootstackGraphQLAPINONEDS2BA9D1C8Name" + }, + "FunctionVersion": "2018-05-29", + "Name": "MutationcreateTodoinit0Function", + "RequestMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Mutation.createTodo.init.1.req.vtl" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson({})" + } + }, + "MutationCreateTodoDataResolverFnMutationCreateTodoDataResolverFnAppSyncFunction900EC5CF": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "DataSourceName": { + "Fn::GetAtt": [ + "TodoDataSource", + "Name" + ] + }, + "FunctionVersion": "2018-05-29", + "Name": "MutationCreateTodoDataResolverFn", + "RequestMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Mutation.createTodo.req.vtl" + ] + ] + }, + "ResponseMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Mutation.createTodo.res.vtl" + ] + ] + } + }, + "DependsOn": [ + "TodoDataSource" + ] + }, + "CreateTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "FieldName": "createTodo", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "MutationcreateTodoinit0FunctionMutationcreateTodoinit0FunctionAppSyncFunction54DE5B8B", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "QuerygetTodopostAuth0FunctionQuerygetTodopostAuth0FunctionAppSyncFunction6BE14593", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "MutationCreateTodoDataResolverFnMutationCreateTodoDataResolverFnAppSyncFunction900EC5CF", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Mutation\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"createTodo\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"AMAZON_DYNAMODB\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", + { + "Ref": "TodoTable" + }, + "\"))\n$util.qr($ctx.stash.put(\"identityPoolId\", \"ap-southeast-2:9db4441d-2163-440e-adba-e23a3fe75fd4\"))\n$util.qr($ctx.stash.put(\"adminRoles\", [\"ap-southeast-2_azDpi6nee_Full-access/CognitoIdentityCredentials\",\"ap-southeast-2_azDpi6nee_Manage-only/CognitoIdentityCredentials\"]))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Mutation" + } + }, + "MutationupdateTodoinit0FunctionMutationupdateTodoinit0FunctionAppSyncFunction1B95BB19": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "DataSourceName": { + "Ref": "referencetotransformerrootstackGraphQLAPINONEDS2BA9D1C8Name" + }, + "FunctionVersion": "2018-05-29", + "Name": "MutationupdateTodoinit0Function", + "RequestMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Mutation.updateTodo.init.1.req.vtl" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson({})" + } + }, + "MutationUpdateTodoDataResolverFnMutationUpdateTodoDataResolverFnAppSyncFunctionBC238C49": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "DataSourceName": { + "Fn::GetAtt": [ + "TodoDataSource", + "Name" + ] + }, + "FunctionVersion": "2018-05-29", + "Name": "MutationUpdateTodoDataResolverFn", + "RequestMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Mutation.updateTodo.req.vtl" + ] + ] + }, + "ResponseMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Mutation.updateTodo.res.vtl" + ] + ] + } + }, + "DependsOn": [ + "TodoDataSource" + ] + }, + "UpdateTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "FieldName": "updateTodo", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "MutationupdateTodoinit0FunctionMutationupdateTodoinit0FunctionAppSyncFunction1B95BB19", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "QuerygetTodopostAuth0FunctionQuerygetTodopostAuth0FunctionAppSyncFunction6BE14593", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "MutationUpdateTodoDataResolverFnMutationUpdateTodoDataResolverFnAppSyncFunctionBC238C49", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Mutation\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"updateTodo\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"AMAZON_DYNAMODB\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", + { + "Ref": "TodoTable" + }, + "\"))\n$util.qr($ctx.stash.put(\"identityPoolId\", \"ap-southeast-2:9db4441d-2163-440e-adba-e23a3fe75fd4\"))\n$util.qr($ctx.stash.put(\"adminRoles\", [\"ap-southeast-2_azDpi6nee_Full-access/CognitoIdentityCredentials\",\"ap-southeast-2_azDpi6nee_Manage-only/CognitoIdentityCredentials\"]))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Mutation" + } + }, + "MutationDeleteTodoDataResolverFnMutationDeleteTodoDataResolverFnAppSyncFunction3879153F": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "DataSourceName": { + "Fn::GetAtt": [ + "TodoDataSource", + "Name" + ] + }, + "FunctionVersion": "2018-05-29", + "Name": "MutationDeleteTodoDataResolverFn", + "RequestMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Mutation.deleteTodo.req.vtl" + ] + ] + }, + "ResponseMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Mutation.deleteTodo.res.vtl" + ] + ] + } + }, + "DependsOn": [ + "TodoDataSource" + ] + }, + "DeleteTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "FieldName": "deleteTodo", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "QuerygetTodopostAuth0FunctionQuerygetTodopostAuth0FunctionAppSyncFunction6BE14593", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "MutationDeleteTodoDataResolverFnMutationDeleteTodoDataResolverFnAppSyncFunction3879153F", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Mutation\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"deleteTodo\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"AMAZON_DYNAMODB\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", + { + "Ref": "TodoTable" + }, + "\"))\n$util.qr($ctx.stash.put(\"identityPoolId\", \"ap-southeast-2:9db4441d-2163-440e-adba-e23a3fe75fd4\"))\n$util.qr($ctx.stash.put(\"adminRoles\", [\"ap-southeast-2_azDpi6nee_Full-access/CognitoIdentityCredentials\",\"ap-southeast-2_azDpi6nee_Manage-only/CognitoIdentityCredentials\"]))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Mutation" + } + }, + "SubscriptionOnCreateTodoDataResolverFnSubscriptionOnCreateTodoDataResolverFnAppSyncFunction462A70C9": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "DataSourceName": { + "Ref": "referencetotransformerrootstackGraphQLAPINONEDS2BA9D1C8Name" + }, + "FunctionVersion": "2018-05-29", + "Name": "SubscriptionOnCreateTodoDataResolverFn", + "RequestMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Subscription.onCreateTodo.req.vtl" + ] + ] + }, + "ResponseMappingTemplateS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef" + }, + "/", + { + "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref" + }, + "/resolvers/Subscription.onCreateTodo.res.vtl" + ] + ] + } + } + }, + "SubscriptiononCreateTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "FieldName": "onCreateTodo", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "QuerygetTodopostAuth0FunctionQuerygetTodopostAuth0FunctionAppSyncFunction6BE14593", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "SubscriptionOnCreateTodoDataResolverFnSubscriptionOnCreateTodoDataResolverFnAppSyncFunction462A70C9", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Subscription\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"onCreateTodo\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"NONE\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n\n$util.qr($ctx.stash.put(\"identityPoolId\", \"ap-southeast-2:9db4441d-2163-440e-adba-e23a3fe75fd4\"))\n$util.qr($ctx.stash.put(\"adminRoles\", [\"ap-southeast-2_azDpi6nee_Full-access/CognitoIdentityCredentials\",\"ap-southeast-2_azDpi6nee_Manage-only/CognitoIdentityCredentials\"]))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Subscription" + } + }, + "SubscriptiononUpdateTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "FieldName": "onUpdateTodo", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "QuerygetTodopostAuth0FunctionQuerygetTodopostAuth0FunctionAppSyncFunction6BE14593", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "SubscriptionOnCreateTodoDataResolverFnSubscriptionOnCreateTodoDataResolverFnAppSyncFunction462A70C9", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Subscription\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"onUpdateTodo\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"NONE\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n\n$util.qr($ctx.stash.put(\"identityPoolId\", \"ap-southeast-2:9db4441d-2163-440e-adba-e23a3fe75fd4\"))\n$util.qr($ctx.stash.put(\"adminRoles\", [\"ap-southeast-2_azDpi6nee_Full-access/CognitoIdentityCredentials\",\"ap-southeast-2_azDpi6nee_Manage-only/CognitoIdentityCredentials\"]))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Subscription" + } + }, + "SubscriptiononDeleteTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "FieldName": "onDeleteTodo", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "QuerygetTodopostAuth0FunctionQuerygetTodopostAuth0FunctionAppSyncFunction6BE14593", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "SubscriptionOnCreateTodoDataResolverFnSubscriptionOnCreateTodoDataResolverFnAppSyncFunction462A70C9", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Subscription\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"onDeleteTodo\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"NONE\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n\n$util.qr($ctx.stash.put(\"identityPoolId\", \"ap-southeast-2:9db4441d-2163-440e-adba-e23a3fe75fd4\"))\n$util.qr($ctx.stash.put(\"adminRoles\", [\"ap-southeast-2_azDpi6nee_Full-access/CognitoIdentityCredentials\",\"ap-southeast-2_azDpi6nee_Manage-only/CognitoIdentityCredentials\"]))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Subscription" + } + } + }, + "Outputs": { + "GetAttTodoTableStreamArn": { + "Description": "Your DynamoDB table StreamArn.", + "Value": { + "Fn::GetAtt": [ + "TodoTable", + "StreamArn" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "GetAtt:TodoTable:StreamArn" + ] + ] + } + } + }, + "GetAttTodoTableName": { + "Description": "Your DynamoDB table name.", + "Value": { + "Ref": "TodoTable" + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "GetAtt:TodoTable:Name" + ] + ] + } + } + }, + "GetAttTodoDataSourceName": { + "Description": "Your model DataSource name.", + "Value": { + "Fn::GetAtt": [ + "TodoDataSource", + "Name" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId" + }, + "GetAtt:TodoDataSource:Name" + ] + ] + } + } + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/cli-inputs.json b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/cli-inputs.json new file mode 100644 index 00000000..9c3f8a32 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/cli-inputs.json @@ -0,0 +1,11 @@ +{ + "version": 1, + "serviceConfiguration": { + "apiName": "mynotes", + "serviceName": "AppSync", + "defaultAuthType": { + "mode": "API_KEY", + "expirationTime": 7 + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/parameters.json b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/parameters.json new file mode 100644 index 00000000..41a9678f --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/parameters.json @@ -0,0 +1,5 @@ +{ + "AppSyncApiName": "mynotes", + "DynamoDBBillingMode": "PAY_PER_REQUEST", + "DynamoDBEnableServerSideEncryption": false +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/resolvers/README.md b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/resolvers/README.md new file mode 100644 index 00000000..89e564c5 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/resolvers/README.md @@ -0,0 +1,2 @@ +Any resolvers that you add in this directory will override the ones automatically generated by Amplify CLI and will be directly copied to the cloud. +For more information, visit [https://docs.amplify.aws/cli/graphql-transformer/resolvers](https://docs.amplify.aws/cli/graphql-transformer/resolvers) \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/schema.graphql b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/schema.graphql new file mode 100644 index 00000000..930fe64e --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/schema.graphql @@ -0,0 +1,11 @@ +# This "input" configures a global authorization rule to enable public access to +# all models in this schema. Learn more about authorization rules here: https://docs.amplify.aws/react/build-a-backend/graphqlapi/customize-authorization-rules/ + +input AMPLIFY { + globalAuthRule: AuthRule = { allow: public } +} # FOR TESTING ONLY! +type Todo @model { + id: ID! + name: String! + description: String +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/stacks/CustomResources.json b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/stacks/CustomResources.json new file mode 100644 index 00000000..f95feea3 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/stacks/CustomResources.json @@ -0,0 +1,58 @@ +{ + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "An auto-generated nested stack.", + "Metadata": {}, + "Parameters": { + "AppSyncApiId": { + "Type": "String", + "Description": "The id of the AppSync API associated with this project." + }, + "AppSyncApiName": { + "Type": "String", + "Description": "The name of the AppSync API", + "Default": "AppSyncSimpleTransform" + }, + "env": { + "Type": "String", + "Description": "The environment name. e.g. Dev, Test, or Production", + "Default": "NONE" + }, + "S3DeploymentBucket": { + "Type": "String", + "Description": "The S3 bucket containing all deployment assets for the project." + }, + "S3DeploymentRootKey": { + "Type": "String", + "Description": "An S3 key relative to the S3DeploymentBucket that points to the root\nof the deployment directory." + } + }, + "Resources": { + "EmptyResource": { + "Type": "Custom::EmptyResource", + "Condition": "AlwaysFalse" + } + }, + "Conditions": { + "HasEnvironmentParameter": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + ] + }, + "AlwaysFalse": { + "Fn::Equals": ["true", "false"] + } + }, + "Outputs": { + "EmptyOutput": { + "Description": "An empty output. You may delete this if you have at least one resource above.", + "Value": "" + } + } +} diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/transform.conf.json b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/transform.conf.json new file mode 100644 index 00000000..98e1e19f --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/api/mynotes/transform.conf.json @@ -0,0 +1,4 @@ +{ + "Version": 5, + "ElasticsearchWarning": true +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/auth/mynotesccae4f3b/build/mynotesccae4f3b-cloudformation-template.json b/New_APIs/Amplify-fullstack-API/amplify/backend/auth/mynotesccae4f3b/build/mynotesccae4f3b-cloudformation-template.json new file mode 100644 index 00000000..f062515f --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/auth/mynotesccae4f3b/build/mynotesccae4f3b-cloudformation-template.json @@ -0,0 +1,407 @@ +{ + "Description": "Amplify Cognito Stack for AWS Amplify CLI", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "env": { + "Type": "String" + }, + "identityPoolName": { + "Type": "String" + }, + "allowUnauthenticatedIdentities": { + "Type": "String" + }, + "resourceNameTruncated": { + "Type": "String" + }, + "userPoolName": { + "Type": "String" + }, + "autoVerifiedAttributes": { + "Type": "CommaDelimitedList" + }, + "mfaConfiguration": { + "Type": "String" + }, + "mfaTypes": { + "Type": "CommaDelimitedList" + }, + "smsAuthenticationMessage": { + "Type": "String" + }, + "smsVerificationMessage": { + "Type": "String" + }, + "emailVerificationSubject": { + "Type": "String" + }, + "emailVerificationMessage": { + "Type": "String" + }, + "defaultPasswordPolicy": { + "Type": "String" + }, + "passwordPolicyMinLength": { + "Type": "String" + }, + "passwordPolicyCharacters": { + "Type": "CommaDelimitedList" + }, + "requiredAttributes": { + "Type": "CommaDelimitedList" + }, + "aliasAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientGenerateSecret": { + "Type": "String" + }, + "userpoolClientRefreshTokenValidity": { + "Type": "String" + }, + "userpoolClientWriteAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientReadAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientLambdaRole": { + "Type": "String" + }, + "userpoolClientSetAttributes": { + "Type": "String" + }, + "sharedId": { + "Type": "String" + }, + "resourceName": { + "Type": "String" + }, + "authSelections": { + "Type": "String" + }, + "useDefault": { + "Type": "String" + }, + "userPoolGroupList": { + "Type": "CommaDelimitedList" + }, + "serviceName": { + "Type": "String" + }, + "usernameCaseSensitive": { + "Type": "String" + }, + "useEnabledMfas": { + "Type": "String" + }, + "authRoleArn": { + "Type": "String" + }, + "unauthRoleArn": { + "Type": "String" + }, + "breakCircularDependency": { + "Type": "String" + }, + "dependsOn": { + "Type": "CommaDelimitedList" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "UserPool": { + "Type": "AWS::Cognito::UserPool", + "Properties": { + "AutoVerifiedAttributes": [ + "email" + ], + "EmailVerificationMessage": { + "Ref": "emailVerificationMessage" + }, + "EmailVerificationSubject": { + "Ref": "emailVerificationSubject" + }, + "MfaConfiguration": { + "Ref": "mfaConfiguration" + }, + "Policies": { + "PasswordPolicy": { + "MinimumLength": { + "Ref": "passwordPolicyMinLength" + }, + "RequireLowercase": false, + "RequireNumbers": false, + "RequireSymbols": false, + "RequireUppercase": false + } + }, + "Schema": [ + { + "Mutable": true, + "Name": "email", + "Required": true + } + ], + "UserAttributeUpdateSettings": { + "AttributesRequireVerificationBeforeUpdate": [ + "email" + ] + }, + "UserPoolName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + { + "Ref": "userPoolName" + }, + { + "Fn::Join": [ + "", + [ + { + "Ref": "userPoolName" + }, + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "UsernameConfiguration": { + "CaseSensitive": false + } + } + }, + "UserPoolClientWeb": { + "Type": "AWS::Cognito::UserPoolClient", + "Properties": { + "ClientName": "mynoteccae4f3b_app_clientWeb", + "RefreshTokenValidity": { + "Ref": "userpoolClientRefreshTokenValidity" + }, + "TokenValidityUnits": { + "RefreshToken": "days" + }, + "UserPoolId": { + "Ref": "UserPool" + } + }, + "DependsOn": [ + "UserPool" + ] + }, + "UserPoolClient": { + "Type": "AWS::Cognito::UserPoolClient", + "Properties": { + "ClientName": "mynoteccae4f3b_app_client", + "GenerateSecret": { + "Ref": "userpoolClientGenerateSecret" + }, + "RefreshTokenValidity": { + "Ref": "userpoolClientRefreshTokenValidity" + }, + "TokenValidityUnits": { + "RefreshToken": "days" + }, + "UserPoolId": { + "Ref": "UserPool" + } + }, + "DependsOn": [ + "UserPool" + ] + }, + "UserPoolClientRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Action": "sts:AssumeRole" + } + ] + }, + "RoleName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + { + "Ref": "userpoolClientLambdaRole" + }, + { + "Fn::Join": [ + "", + [ + "upClientLambdaRoleccae4f3b", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + "-", + { + "Ref": "AWS::StackName" + } + ] + } + ] + }, + "-", + { + "Ref": "env" + } + ] + ] + } + ] + } + } + }, + "IdentityPool": { + "Type": "AWS::Cognito::IdentityPool", + "Properties": { + "AllowUnauthenticatedIdentities": { + "Ref": "allowUnauthenticatedIdentities" + }, + "CognitoIdentityProviders": [ + { + "ClientId": { + "Ref": "UserPoolClient" + }, + "ProviderName": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "client": { + "Ref": "UserPool" + } + } + ] + } + }, + { + "ClientId": { + "Ref": "UserPoolClientWeb" + }, + "ProviderName": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "client": { + "Ref": "UserPool" + } + } + ] + } + } + ], + "IdentityPoolName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "mynotesccae4f3b_identitypool_ccae4f3b", + { + "Fn::Join": [ + "", + [ + "mynotesccae4f3b_identitypool_ccae4f3b__", + { + "Ref": "env" + } + ] + ] + } + ] + } + } + }, + "IdentityPoolRoleMap": { + "Type": "AWS::Cognito::IdentityPoolRoleAttachment", + "Properties": { + "IdentityPoolId": { + "Ref": "IdentityPool" + }, + "Roles": { + "unauthenticated": { + "Ref": "unauthRoleArn" + }, + "authenticated": { + "Ref": "authRoleArn" + } + } + }, + "DependsOn": [ + "IdentityPool" + ] + } + }, + "Outputs": { + "IdentityPoolId": { + "Description": "Id for the identity pool", + "Value": { + "Ref": "IdentityPool" + } + }, + "IdentityPoolName": { + "Value": { + "Fn::GetAtt": [ + "IdentityPool", + "Name" + ] + } + }, + "UserPoolId": { + "Description": "Id for the user pool", + "Value": { + "Ref": "UserPool" + } + }, + "UserPoolArn": { + "Description": "Arn for the user pool", + "Value": { + "Fn::GetAtt": [ + "UserPool", + "Arn" + ] + } + }, + "UserPoolName": { + "Value": { + "Ref": "userPoolName" + } + }, + "AppClientIDWeb": { + "Description": "The user pool app client id for web", + "Value": { + "Ref": "UserPoolClientWeb" + } + }, + "AppClientID": { + "Description": "The user pool app client id", + "Value": { + "Ref": "UserPoolClient" + } + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/auth/mynotesccae4f3b/build/parameters.json b/New_APIs/Amplify-fullstack-API/amplify/backend/auth/mynotesccae4f3b/build/parameters.json new file mode 100644 index 00000000..2c8bdef8 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/auth/mynotesccae4f3b/build/parameters.json @@ -0,0 +1,56 @@ +{ + "identityPoolName": "mynotesccae4f3b_identitypool_ccae4f3b", + "allowUnauthenticatedIdentities": true, + "resourceNameTruncated": "mynoteccae4f3b", + "userPoolName": "mynotesccae4f3b_userpool_ccae4f3b", + "autoVerifiedAttributes": [ + "email" + ], + "mfaConfiguration": "OFF", + "mfaTypes": [ + "SMS Text Message" + ], + "smsAuthenticationMessage": "Your authentication code is {####}", + "smsVerificationMessage": "Your verification code is {####}", + "emailVerificationSubject": "Your verification code", + "emailVerificationMessage": "Your verification code is {####}", + "defaultPasswordPolicy": false, + "passwordPolicyMinLength": 8, + "passwordPolicyCharacters": [], + "requiredAttributes": [ + "email" + ], + "aliasAttributes": [], + "userpoolClientGenerateSecret": false, + "userpoolClientRefreshTokenValidity": 30, + "userpoolClientWriteAttributes": [ + "email" + ], + "userpoolClientReadAttributes": [ + "email" + ], + "userpoolClientLambdaRole": "mynoteccae4f3b_userpoolclient_lambda_role", + "userpoolClientSetAttributes": false, + "sharedId": "ccae4f3b", + "resourceName": "mynotesccae4f3b", + "authSelections": "identityPoolAndUserPool", + "useDefault": "default", + "userPoolGroupList": [], + "serviceName": "Cognito", + "usernameCaseSensitive": false, + "useEnabledMfas": true, + "authRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "unauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + }, + "breakCircularDependency": true, + "dependsOn": [] +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/auth/mynotesccae4f3b/cli-inputs.json b/New_APIs/Amplify-fullstack-API/amplify/backend/auth/mynotesccae4f3b/cli-inputs.json new file mode 100644 index 00000000..8d149af9 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/auth/mynotesccae4f3b/cli-inputs.json @@ -0,0 +1,59 @@ +{ + "version": "1", + "cognitoConfig": { + "identityPoolName": "mynotesccae4f3b_identitypool_ccae4f3b", + "allowUnauthenticatedIdentities": true, + "resourceNameTruncated": "mynoteccae4f3b", + "userPoolName": "mynotesccae4f3b_userpool_ccae4f3b", + "autoVerifiedAttributes": [ + "email" + ], + "mfaConfiguration": "OFF", + "mfaTypes": [ + "SMS Text Message" + ], + "smsAuthenticationMessage": "Your authentication code is {####}", + "smsVerificationMessage": "Your verification code is {####}", + "emailVerificationSubject": "Your verification code", + "emailVerificationMessage": "Your verification code is {####}", + "defaultPasswordPolicy": false, + "passwordPolicyMinLength": 8, + "passwordPolicyCharacters": [], + "requiredAttributes": [ + "email" + ], + "aliasAttributes": [], + "userpoolClientGenerateSecret": false, + "userpoolClientRefreshTokenValidity": 30, + "userpoolClientWriteAttributes": [ + "email" + ], + "userpoolClientReadAttributes": [ + "email" + ], + "userpoolClientLambdaRole": "mynoteccae4f3b_userpoolclient_lambda_role", + "userpoolClientSetAttributes": false, + "sharedId": "ccae4f3b", + "resourceName": "mynotesccae4f3b", + "authSelections": "identityPoolAndUserPool", + "useDefault": "default", + "userPoolGroupList": [], + "serviceName": "Cognito", + "usernameCaseSensitive": false, + "useEnabledMfas": true, + "authRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "unauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + }, + "breakCircularDependency": true, + "dependsOn": [] + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/awscloudformation/build/api/mynotes/build/cloudformation-template.json b/New_APIs/Amplify-fullstack-API/amplify/backend/awscloudformation/build/api/mynotes/build/cloudformation-template.json new file mode 100644 index 00000000..044e9db4 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/awscloudformation/build/api/mynotes/build/cloudformation-template.json @@ -0,0 +1,316 @@ +{ + "Parameters": { + "env": { + "Type": "String", + "Default": "NONE" + }, + "AppSyncApiName": { + "Type": "String", + "Default": "AppSyncSimpleTransform" + }, + "DynamoDBModelTableReadIOPS": { + "Type": "Number", + "Default": 5, + "Description": "The number of read IOPS the table should support." + }, + "DynamoDBModelTableWriteIOPS": { + "Type": "Number", + "Default": 5, + "Description": "The number of write IOPS the table should support." + }, + "DynamoDBBillingMode": { + "Type": "String", + "Default": "PAY_PER_REQUEST", + "AllowedValues": [ + "PAY_PER_REQUEST", + "PROVISIONED" + ], + "Description": "Configure @model types to create DynamoDB tables with PAY_PER_REQUEST or PROVISIONED billing modes." + }, + "DynamoDBEnablePointInTimeRecovery": { + "Type": "String", + "Default": "false", + "AllowedValues": [ + "true", + "false" + ], + "Description": "Whether to enable Point in Time Recovery on the table." + }, + "DynamoDBEnableServerSideEncryption": { + "Type": "String", + "Default": "true", + "AllowedValues": [ + "true", + "false" + ], + "Description": "Enable server side encryption powered by KMS." + }, + "S3DeploymentBucket": { + "Type": "String", + "Description": "An S3 Bucket name where assets are deployed" + }, + "S3DeploymentRootKey": { + "Type": "String", + "Description": "An S3 key relative to the S3DeploymentBucket that points to the root of the deployment directory." + } + }, + "Resources": { + "GraphQLAPI": { + "Type": "AWS::AppSync::GraphQLApi", + "Properties": { + "AuthenticationType": "API_KEY", + "Name": { + "Fn::Join": [ + "", + [ + { + "Ref": "AppSyncApiName" + }, + "-", + { + "Ref": "env" + } + ] + ] + } + } + }, + "GraphQLAPITransformerSchema3CB2AE18": { + "Type": "AWS::AppSync::GraphQLSchema", + "Properties": { + "ApiId": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "DefinitionS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "S3DeploymentBucket" + }, + "/", + { + "Ref": "S3DeploymentRootKey" + }, + "/schema.graphql" + ] + ] + } + } + }, + "GraphQLAPIDefaultApiKey215A6DD7": { + "Type": "AWS::AppSync::ApiKey", + "Properties": { + "ApiId": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "Expires": 1722598000 + } + }, + "GraphQLAPINONEDS95A13CF0": { + "Type": "AWS::AppSync::DataSource", + "Properties": { + "ApiId": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "Description": "None Data Source for Pipeline functions", + "Name": "NONE_DS", + "Type": "NONE" + } + }, + "Todo": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "Parameters": { + "DynamoDBModelTableReadIOPS": { + "Ref": "DynamoDBModelTableReadIOPS" + }, + "DynamoDBModelTableWriteIOPS": { + "Ref": "DynamoDBModelTableWriteIOPS" + }, + "DynamoDBBillingMode": { + "Ref": "DynamoDBBillingMode" + }, + "DynamoDBEnablePointInTimeRecovery": { + "Ref": "DynamoDBEnablePointInTimeRecovery" + }, + "DynamoDBEnableServerSideEncryption": { + "Ref": "DynamoDBEnableServerSideEncryption" + }, + "referencetotransformerrootstackenv10C5A902Ref": { + "Ref": "env" + }, + "referencetotransformerrootstackGraphQLAPI20497F53ApiId": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "referencetotransformerrootstackGraphQLAPINONEDS2BA9D1C8Name": { + "Fn::GetAtt": [ + "GraphQLAPINONEDS95A13CF0", + "Name" + ] + }, + "referencetotransformerrootstackS3DeploymentBucket7592718ARef": { + "Ref": "S3DeploymentBucket" + }, + "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref": { + "Ref": "S3DeploymentRootKey" + } + }, + "TemplateURL": { + "Fn::Join": [ + "", + [ + "https://s3.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "S3DeploymentBucket" + }, + "/", + { + "Ref": "S3DeploymentRootKey" + }, + "/stacks/Todo.json" + ] + ] + } + }, + "DependsOn": [ + "GraphQLAPITransformerSchema3CB2AE18" + ] + }, + "CustomResourcesjson": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "Parameters": { + "AppSyncApiId": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "AppSyncApiName": { + "Ref": "AppSyncApiName" + }, + "env": { + "Ref": "env" + }, + "S3DeploymentBucket": { + "Ref": "S3DeploymentBucket" + }, + "S3DeploymentRootKey": { + "Ref": "S3DeploymentRootKey" + } + }, + "TemplateURL": { + "Fn::Join": [ + "/", + [ + "https://s3.amazonaws.com", + { + "Ref": "S3DeploymentBucket" + }, + { + "Ref": "S3DeploymentRootKey" + }, + "stacks", + "CustomResources.json" + ] + ] + } + }, + "DependsOn": [ + "GraphQLAPI", + "GraphQLAPITransformerSchema3CB2AE18", + "Todo" + ] + } + }, + "Outputs": { + "GraphQLAPIKeyOutput": { + "Description": "Your GraphQL API ID.", + "Value": { + "Fn::GetAtt": [ + "GraphQLAPIDefaultApiKey215A6DD7", + "ApiKey" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "AWS::StackName" + }, + "GraphQLApiKey" + ] + ] + } + } + }, + "GraphQLAPIIdOutput": { + "Description": "Your GraphQL API ID.", + "Value": { + "Fn::GetAtt": [ + "GraphQLAPI", + "ApiId" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "AWS::StackName" + }, + "GraphQLApiId" + ] + ] + } + } + }, + "GraphQLAPIEndpointOutput": { + "Description": "Your GraphQL API endpoint.", + "Value": { + "Fn::GetAtt": [ + "GraphQLAPI", + "GraphQLUrl" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "AWS::StackName" + }, + "GraphQLApiEndpoint" + ] + ] + } + } + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/awscloudformation/build/auth/mynotesccae4f3b/build/mynotesccae4f3b-cloudformation-template.json b/New_APIs/Amplify-fullstack-API/amplify/backend/awscloudformation/build/auth/mynotesccae4f3b/build/mynotesccae4f3b-cloudformation-template.json new file mode 100644 index 00000000..f062515f --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/awscloudformation/build/auth/mynotesccae4f3b/build/mynotesccae4f3b-cloudformation-template.json @@ -0,0 +1,407 @@ +{ + "Description": "Amplify Cognito Stack for AWS Amplify CLI", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "env": { + "Type": "String" + }, + "identityPoolName": { + "Type": "String" + }, + "allowUnauthenticatedIdentities": { + "Type": "String" + }, + "resourceNameTruncated": { + "Type": "String" + }, + "userPoolName": { + "Type": "String" + }, + "autoVerifiedAttributes": { + "Type": "CommaDelimitedList" + }, + "mfaConfiguration": { + "Type": "String" + }, + "mfaTypes": { + "Type": "CommaDelimitedList" + }, + "smsAuthenticationMessage": { + "Type": "String" + }, + "smsVerificationMessage": { + "Type": "String" + }, + "emailVerificationSubject": { + "Type": "String" + }, + "emailVerificationMessage": { + "Type": "String" + }, + "defaultPasswordPolicy": { + "Type": "String" + }, + "passwordPolicyMinLength": { + "Type": "String" + }, + "passwordPolicyCharacters": { + "Type": "CommaDelimitedList" + }, + "requiredAttributes": { + "Type": "CommaDelimitedList" + }, + "aliasAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientGenerateSecret": { + "Type": "String" + }, + "userpoolClientRefreshTokenValidity": { + "Type": "String" + }, + "userpoolClientWriteAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientReadAttributes": { + "Type": "CommaDelimitedList" + }, + "userpoolClientLambdaRole": { + "Type": "String" + }, + "userpoolClientSetAttributes": { + "Type": "String" + }, + "sharedId": { + "Type": "String" + }, + "resourceName": { + "Type": "String" + }, + "authSelections": { + "Type": "String" + }, + "useDefault": { + "Type": "String" + }, + "userPoolGroupList": { + "Type": "CommaDelimitedList" + }, + "serviceName": { + "Type": "String" + }, + "usernameCaseSensitive": { + "Type": "String" + }, + "useEnabledMfas": { + "Type": "String" + }, + "authRoleArn": { + "Type": "String" + }, + "unauthRoleArn": { + "Type": "String" + }, + "breakCircularDependency": { + "Type": "String" + }, + "dependsOn": { + "Type": "CommaDelimitedList" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "UserPool": { + "Type": "AWS::Cognito::UserPool", + "Properties": { + "AutoVerifiedAttributes": [ + "email" + ], + "EmailVerificationMessage": { + "Ref": "emailVerificationMessage" + }, + "EmailVerificationSubject": { + "Ref": "emailVerificationSubject" + }, + "MfaConfiguration": { + "Ref": "mfaConfiguration" + }, + "Policies": { + "PasswordPolicy": { + "MinimumLength": { + "Ref": "passwordPolicyMinLength" + }, + "RequireLowercase": false, + "RequireNumbers": false, + "RequireSymbols": false, + "RequireUppercase": false + } + }, + "Schema": [ + { + "Mutable": true, + "Name": "email", + "Required": true + } + ], + "UserAttributeUpdateSettings": { + "AttributesRequireVerificationBeforeUpdate": [ + "email" + ] + }, + "UserPoolName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + { + "Ref": "userPoolName" + }, + { + "Fn::Join": [ + "", + [ + { + "Ref": "userPoolName" + }, + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "UsernameConfiguration": { + "CaseSensitive": false + } + } + }, + "UserPoolClientWeb": { + "Type": "AWS::Cognito::UserPoolClient", + "Properties": { + "ClientName": "mynoteccae4f3b_app_clientWeb", + "RefreshTokenValidity": { + "Ref": "userpoolClientRefreshTokenValidity" + }, + "TokenValidityUnits": { + "RefreshToken": "days" + }, + "UserPoolId": { + "Ref": "UserPool" + } + }, + "DependsOn": [ + "UserPool" + ] + }, + "UserPoolClient": { + "Type": "AWS::Cognito::UserPoolClient", + "Properties": { + "ClientName": "mynoteccae4f3b_app_client", + "GenerateSecret": { + "Ref": "userpoolClientGenerateSecret" + }, + "RefreshTokenValidity": { + "Ref": "userpoolClientRefreshTokenValidity" + }, + "TokenValidityUnits": { + "RefreshToken": "days" + }, + "UserPoolId": { + "Ref": "UserPool" + } + }, + "DependsOn": [ + "UserPool" + ] + }, + "UserPoolClientRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Action": "sts:AssumeRole" + } + ] + }, + "RoleName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + { + "Ref": "userpoolClientLambdaRole" + }, + { + "Fn::Join": [ + "", + [ + "upClientLambdaRoleccae4f3b", + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + "-", + { + "Ref": "AWS::StackName" + } + ] + } + ] + }, + "-", + { + "Ref": "env" + } + ] + ] + } + ] + } + } + }, + "IdentityPool": { + "Type": "AWS::Cognito::IdentityPool", + "Properties": { + "AllowUnauthenticatedIdentities": { + "Ref": "allowUnauthenticatedIdentities" + }, + "CognitoIdentityProviders": [ + { + "ClientId": { + "Ref": "UserPoolClient" + }, + "ProviderName": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "client": { + "Ref": "UserPool" + } + } + ] + } + }, + { + "ClientId": { + "Ref": "UserPoolClientWeb" + }, + "ProviderName": { + "Fn::Sub": [ + "cognito-idp.${region}.amazonaws.com/${client}", + { + "region": { + "Ref": "AWS::Region" + }, + "client": { + "Ref": "UserPool" + } + } + ] + } + } + ], + "IdentityPoolName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "mynotesccae4f3b_identitypool_ccae4f3b", + { + "Fn::Join": [ + "", + [ + "mynotesccae4f3b_identitypool_ccae4f3b__", + { + "Ref": "env" + } + ] + ] + } + ] + } + } + }, + "IdentityPoolRoleMap": { + "Type": "AWS::Cognito::IdentityPoolRoleAttachment", + "Properties": { + "IdentityPoolId": { + "Ref": "IdentityPool" + }, + "Roles": { + "unauthenticated": { + "Ref": "unauthRoleArn" + }, + "authenticated": { + "Ref": "authRoleArn" + } + } + }, + "DependsOn": [ + "IdentityPool" + ] + } + }, + "Outputs": { + "IdentityPoolId": { + "Description": "Id for the identity pool", + "Value": { + "Ref": "IdentityPool" + } + }, + "IdentityPoolName": { + "Value": { + "Fn::GetAtt": [ + "IdentityPool", + "Name" + ] + } + }, + "UserPoolId": { + "Description": "Id for the user pool", + "Value": { + "Ref": "UserPool" + } + }, + "UserPoolArn": { + "Description": "Arn for the user pool", + "Value": { + "Fn::GetAtt": [ + "UserPool", + "Arn" + ] + } + }, + "UserPoolName": { + "Value": { + "Ref": "userPoolName" + } + }, + "AppClientIDWeb": { + "Description": "The user pool app client id for web", + "Value": { + "Ref": "UserPoolClientWeb" + } + }, + "AppClientID": { + "Description": "The user pool app client id", + "Value": { + "Ref": "UserPoolClient" + } + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/awscloudformation/build/awscloudformation/build/root-cloudformation-stack.json b/New_APIs/Amplify-fullstack-API/amplify/backend/awscloudformation/build/awscloudformation/build/root-cloudformation-stack.json new file mode 100644 index 00000000..1e3972c2 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/awscloudformation/build/awscloudformation/build/root-cloudformation-stack.json @@ -0,0 +1,437 @@ +{ + "Description": "Root Stack for AWS Amplify Console", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "DeploymentBucketName": { + "Type": "String", + "Default": "DeploymentBucket", + "Description": "Name of the common deployment bucket provided by the parent stack" + }, + "AuthRoleName": { + "Type": "String", + "Default": "AuthRoleName", + "Description": "Name of the common deployment bucket provided by the parent stack" + }, + "UnauthRoleName": { + "Type": "String", + "Default": "UnAuthRoleName", + "Description": "Name of the common deployment bucket provided by the parent stack" + } + }, + "Outputs": { + "Region": { + "Description": "CloudFormation provider root stack Region", + "Value": { + "Ref": "AWS::Region" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-Region" + } + } + }, + "StackName": { + "Description": "CloudFormation provider root stack ID", + "Value": { + "Ref": "AWS::StackName" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-StackName" + } + } + }, + "StackId": { + "Description": "CloudFormation provider root stack name", + "Value": { + "Ref": "AWS::StackId" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-StackId" + } + } + }, + "AuthRoleArn": { + "Value": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + } + }, + "UnauthRoleArn": { + "Value": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + } + }, + "DeploymentBucketName": { + "Description": "CloudFormation provider root stack deployment bucket name", + "Value": { + "Ref": "DeploymentBucketName" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-DeploymentBucketName" + } + } + }, + "AuthRoleName": { + "Value": { + "Ref": "AuthRole" + } + }, + "UnauthRoleName": { + "Value": { + "Ref": "UnauthRole" + } + } + }, + "Resources": { + "DeploymentBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": { + "Ref": "DeploymentBucketName" + }, + "BucketEncryption": { + "ServerSideEncryptionConfiguration": [ + { + "ServerSideEncryptionByDefault": { + "SSEAlgorithm": "AES256" + } + } + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "AuthRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Deny", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity" + } + ] + }, + "RoleName": { + "Ref": "AuthRoleName" + } + } + }, + "UnauthRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Deny", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity" + } + ] + }, + "RoleName": { + "Ref": "UnauthRoleName" + } + } + }, + "apimynotes": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-mynotes-staging-b2b56-deployment/amplify-cfn-templates/api/cloudformation-template.json", + "Parameters": { + "AppSyncApiName": "mynotes", + "DynamoDBBillingMode": "PAY_PER_REQUEST", + "DynamoDBEnableServerSideEncryption": false, + "S3DeploymentBucket": "amplify-mynotes-staging-b2b56-deployment", + "S3DeploymentRootKey": "amplify-appsync-files/c0e971ea1ba703ba5054d45b1d4a7a475f98dd0a", + "env": "staging" + } + } + }, + "authmynotesccae4f3b": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-mynotes-staging-b2b56-deployment/amplify-cfn-templates/auth/mynotesccae4f3b-cloudformation-template.json", + "Parameters": { + "identityPoolName": "mynotesccae4f3b_identitypool_ccae4f3b", + "allowUnauthenticatedIdentities": true, + "resourceNameTruncated": "mynoteccae4f3b", + "userPoolName": "mynotesccae4f3b_userpool_ccae4f3b", + "autoVerifiedAttributes": "email", + "mfaConfiguration": "OFF", + "mfaTypes": "SMS Text Message", + "smsAuthenticationMessage": "Your authentication code is {####}", + "smsVerificationMessage": "Your verification code is {####}", + "emailVerificationSubject": "Your verification code", + "emailVerificationMessage": "Your verification code is {####}", + "defaultPasswordPolicy": false, + "passwordPolicyMinLength": 8, + "passwordPolicyCharacters": "", + "requiredAttributes": "email", + "aliasAttributes": "", + "userpoolClientGenerateSecret": false, + "userpoolClientRefreshTokenValidity": 30, + "userpoolClientWriteAttributes": "email", + "userpoolClientReadAttributes": "email", + "userpoolClientLambdaRole": "mynoteccae4f3b_userpoolclient_lambda_role", + "userpoolClientSetAttributes": false, + "sharedId": "ccae4f3b", + "resourceName": "mynotesccae4f3b", + "authSelections": "identityPoolAndUserPool", + "useDefault": "default", + "userPoolGroupList": "", + "serviceName": "Cognito", + "usernameCaseSensitive": false, + "useEnabledMfas": true, + "authRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "unauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + }, + "breakCircularDependency": true, + "dependsOn": "", + "env": "staging" + } + } + }, + "functionS3Triggerdc42a5d7": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-mynotes-staging-b2b56-deployment/amplify-cfn-templates/function/S3Triggerdc42a5d7-cloudformation-template.json", + "Parameters": { + "deploymentBucketName": "amplify-mynotes-staging-b2b56-deployment", + "s3Key": "amplify-builds/S3Triggerdc42a5d7-6a475541666d35456861-build.zip", + "env": "staging" + } + } + }, + "UpdateRolesWithIDPFunction": { + "DependsOn": [ + "AuthRole", + "UnauthRole", + "authmynotesccae4f3b" + ], + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": { + "Fn::Join": [ + "\n", + [ + "const response = require('cfn-response');", + "const { IAMClient, GetRoleCommand, UpdateAssumeRolePolicyCommand } = require('@aws-sdk/client-iam');", + "exports.handler = function(event, context) {", + " // Don't return promise, response.send() marks context as done internally", + " const ignoredPromise = handleEvent(event, context)", + "};", + "async function handleEvent(event, context) {", + " try {", + " let authRoleName = event.ResourceProperties.authRoleName;", + " let unauthRoleName = event.ResourceProperties.unauthRoleName;", + " let idpId = event.ResourceProperties.idpId;", + " let authParamsJson = {", + " 'Version': '2012-10-17',", + " 'Statement': [{", + " 'Effect': 'Allow',", + " 'Principal': {'Federated': 'cognito-identity.amazonaws.com'},", + " 'Action': 'sts:AssumeRoleWithWebIdentity',", + " 'Condition': {", + " 'StringEquals': {'cognito-identity.amazonaws.com:aud': idpId},", + " 'ForAnyValue:StringLike': {'cognito-identity.amazonaws.com:amr': 'authenticated'}", + " }", + " }]", + " };", + " let unauthParamsJson = {", + " 'Version': '2012-10-17',", + " 'Statement': [{", + " 'Effect': 'Allow',", + " 'Principal': {'Federated': 'cognito-identity.amazonaws.com'},", + " 'Action': 'sts:AssumeRoleWithWebIdentity',", + " 'Condition': {", + " 'StringEquals': {'cognito-identity.amazonaws.com:aud': idpId},", + " 'ForAnyValue:StringLike': {'cognito-identity.amazonaws.com:amr': 'unauthenticated'}", + " }", + " }]", + " };", + " if (event.RequestType === 'Delete') {", + " try {", + " delete authParamsJson.Statement[0].Condition;", + " delete unauthParamsJson.Statement[0].Condition;", + " authParamsJson.Statement[0].Effect = 'Deny'", + " unauthParamsJson.Statement[0].Effect = 'Deny'", + " let authParams = {PolicyDocument: JSON.stringify(authParamsJson), RoleName: authRoleName};", + " let unauthParams = {PolicyDocument: JSON.stringify(unauthParamsJson), RoleName: unauthRoleName};", + " const iam = new IAMClient({region: event.ResourceProperties.region});", + " let res = await Promise.all([", + " iam.send(new GetRoleCommand({RoleName: authParams.RoleName})),", + " iam.send(new GetRoleCommand({RoleName: unauthParams.RoleName}))", + " ]);", + " res = await Promise.all([", + " iam.send(new UpdateAssumeRolePolicyCommand(authParams)),", + " iam.send(new UpdateAssumeRolePolicyCommand(unauthParams))", + " ]);", + " response.send(event, context, response.SUCCESS, {});", + " } catch (err) {", + " console.log(err.stack);", + " response.send(event, context, response.SUCCESS, {Error: err});", + " }", + " } else if (event.RequestType === 'Update' || event.RequestType === 'Create') {", + " const iam = new IAMClient({region: event.ResourceProperties.region});", + " let authParams = {PolicyDocument: JSON.stringify(authParamsJson), RoleName: authRoleName};", + " let unauthParams = {PolicyDocument: JSON.stringify(unauthParamsJson), RoleName: unauthRoleName};", + " const res = await Promise.all([", + " iam.send(new UpdateAssumeRolePolicyCommand(authParams)),", + " iam.send(new UpdateAssumeRolePolicyCommand(unauthParams))", + " ]);", + " response.send(event, context, response.SUCCESS, {});", + " }", + " } catch (err) {", + " console.log(err.stack);", + " response.send(event, context, response.FAILED, {Error: err});", + " }", + "};" + ] + ] + } + }, + "Handler": "index.handler", + "Runtime": "nodejs18.x", + "Timeout": 300, + "Role": { + "Fn::GetAtt": [ + "UpdateRolesWithIDPFunctionRole", + "Arn" + ] + } + } + }, + "UpdateRolesWithIDPFunctionOutputs": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "UpdateRolesWithIDPFunction", + "Arn" + ] + }, + "region": { + "Ref": "AWS::Region" + }, + "idpId": { + "Fn::GetAtt": [ + "authmynotesccae4f3b", + "Outputs.IdentityPoolId" + ] + }, + "authRoleName": { + "Ref": "AuthRole" + }, + "unauthRoleName": { + "Ref": "UnauthRole" + } + } + }, + "UpdateRolesWithIDPFunctionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "RoleName": { + "Fn::Join": [ + "", + [ + { + "Ref": "AuthRole" + }, + "-idp" + ] + ] + }, + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + }, + "Policies": [ + { + "PolicyName": "UpdateRolesWithIDPFunctionPolicy", + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Resource": "arn:aws:logs:*:*:*" + }, + { + "Effect": "Allow", + "Action": [ + "iam:UpdateAssumeRolePolicy", + "iam:GetRole" + ], + "Resource": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + } + }, + { + "Effect": "Allow", + "Action": [ + "iam:UpdateAssumeRolePolicy", + "iam:GetRole" + ], + "Resource": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + } + } + ] + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/awscloudformation/build/function/S3Trigger168e5d52/S3Trigger168e5d52-cloudformation-template.json b/New_APIs/Amplify-fullstack-API/amplify/backend/awscloudformation/build/function/S3Trigger168e5d52/S3Trigger168e5d52-cloudformation-template.json new file mode 100644 index 00000000..bada55fe --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/awscloudformation/build/function/S3Trigger168e5d52/S3Trigger168e5d52-cloudformation-template.json @@ -0,0 +1,193 @@ +{ + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"12.12.4\",\"stackType\":\"function-Lambda\",\"metadata\":{}}", + "Parameters": { + "env": { + "Type": "String" + }, + "deploymentBucketName": { + "Type": "String" + }, + "s3Key": { + "Type": "String" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "LambdaFunction": { + "Type": "AWS::Lambda::Function", + "Metadata": { + "aws:asset:path": "./src", + "aws:asset:property": "Code" + }, + "Properties": { + "Handler": "index.handler", + "FunctionName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "S3Trigger168e5d52", + { + "Fn::Join": [ + "", + [ + "S3Trigger168e5d52", + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "Environment": { + "Variables": { + "ENV": { + "Ref": "env" + } + } + }, + "Role": { + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 25, + "Code": { + "S3Bucket": { + "Ref": "deploymentBucketName" + }, + "S3Key": { + "Ref": "s3Key" + } + } + } + }, + "LambdaExecutionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "RoleName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "S3Trigger168e5d52LambdaRole168e5d52", + { + "Fn::Join": [ + "", + [ + "S3Trigger168e5d52LambdaRole168e5d52", + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + } + } + }, + "lambdaexecutionpolicy": { + "DependsOn": [ + "LambdaExecutionRole" + ], + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyName": "lambda-execution-policy", + "Roles": [ + { + "Ref": "LambdaExecutionRole" + } + ], + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Resource": { + "Fn::Sub": [ + "arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*", + { + "region": { + "Ref": "AWS::Region" + }, + "account": { + "Ref": "AWS::AccountId" + }, + "lambda": { + "Ref": "LambdaFunction" + } + } + ] + } + } + ] + } + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Ref": "LambdaFunction" + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "LambdaFunction", + "Arn" + ] + } + }, + "Region": { + "Value": { + "Ref": "AWS::Region" + } + }, + "LambdaExecutionRole": { + "Value": { + "Ref": "LambdaExecutionRole" + } + }, + "LambdaExecutionRoleArn": { + "Value": { + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] + } + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/awscloudformation/build/function/S3Triggerdc42a5d7/S3Triggerdc42a5d7-cloudformation-template.json b/New_APIs/Amplify-fullstack-API/amplify/backend/awscloudformation/build/function/S3Triggerdc42a5d7/S3Triggerdc42a5d7-cloudformation-template.json new file mode 100644 index 00000000..99722625 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/awscloudformation/build/function/S3Triggerdc42a5d7/S3Triggerdc42a5d7-cloudformation-template.json @@ -0,0 +1,193 @@ +{ + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"12.12.4\",\"stackType\":\"function-Lambda\",\"metadata\":{}}", + "Parameters": { + "env": { + "Type": "String" + }, + "deploymentBucketName": { + "Type": "String" + }, + "s3Key": { + "Type": "String" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "LambdaFunction": { + "Type": "AWS::Lambda::Function", + "Metadata": { + "aws:asset:path": "./src", + "aws:asset:property": "Code" + }, + "Properties": { + "Handler": "index.handler", + "FunctionName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "S3Triggerdc42a5d7", + { + "Fn::Join": [ + "", + [ + "S3Triggerdc42a5d7", + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "Environment": { + "Variables": { + "ENV": { + "Ref": "env" + } + } + }, + "Role": { + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 25, + "Code": { + "S3Bucket": { + "Ref": "deploymentBucketName" + }, + "S3Key": { + "Ref": "s3Key" + } + } + } + }, + "LambdaExecutionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "RoleName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "S3Triggerdc42a5d7LambdaRoledc42a5d7", + { + "Fn::Join": [ + "", + [ + "S3Triggerdc42a5d7LambdaRoledc42a5d7", + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + } + } + }, + "lambdaexecutionpolicy": { + "DependsOn": [ + "LambdaExecutionRole" + ], + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyName": "lambda-execution-policy", + "Roles": [ + { + "Ref": "LambdaExecutionRole" + } + ], + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Resource": { + "Fn::Sub": [ + "arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*", + { + "region": { + "Ref": "AWS::Region" + }, + "account": { + "Ref": "AWS::AccountId" + }, + "lambda": { + "Ref": "LambdaFunction" + } + } + ] + } + } + ] + } + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Ref": "LambdaFunction" + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "LambdaFunction", + "Arn" + ] + } + }, + "Region": { + "Value": { + "Ref": "AWS::Region" + } + }, + "LambdaExecutionRole": { + "Value": { + "Ref": "LambdaExecutionRole" + } + }, + "LambdaExecutionRoleArn": { + "Value": { + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] + } + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/awscloudformation/build/root-cloudformation-stack.json b/New_APIs/Amplify-fullstack-API/amplify/backend/awscloudformation/build/root-cloudformation-stack.json new file mode 100644 index 00000000..1e3972c2 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/awscloudformation/build/root-cloudformation-stack.json @@ -0,0 +1,437 @@ +{ + "Description": "Root Stack for AWS Amplify Console", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "DeploymentBucketName": { + "Type": "String", + "Default": "DeploymentBucket", + "Description": "Name of the common deployment bucket provided by the parent stack" + }, + "AuthRoleName": { + "Type": "String", + "Default": "AuthRoleName", + "Description": "Name of the common deployment bucket provided by the parent stack" + }, + "UnauthRoleName": { + "Type": "String", + "Default": "UnAuthRoleName", + "Description": "Name of the common deployment bucket provided by the parent stack" + } + }, + "Outputs": { + "Region": { + "Description": "CloudFormation provider root stack Region", + "Value": { + "Ref": "AWS::Region" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-Region" + } + } + }, + "StackName": { + "Description": "CloudFormation provider root stack ID", + "Value": { + "Ref": "AWS::StackName" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-StackName" + } + } + }, + "StackId": { + "Description": "CloudFormation provider root stack name", + "Value": { + "Ref": "AWS::StackId" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-StackId" + } + } + }, + "AuthRoleArn": { + "Value": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + } + }, + "UnauthRoleArn": { + "Value": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + } + }, + "DeploymentBucketName": { + "Description": "CloudFormation provider root stack deployment bucket name", + "Value": { + "Ref": "DeploymentBucketName" + }, + "Export": { + "Name": { + "Fn::Sub": "${AWS::StackName}-DeploymentBucketName" + } + } + }, + "AuthRoleName": { + "Value": { + "Ref": "AuthRole" + } + }, + "UnauthRoleName": { + "Value": { + "Ref": "UnauthRole" + } + } + }, + "Resources": { + "DeploymentBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": { + "Ref": "DeploymentBucketName" + }, + "BucketEncryption": { + "ServerSideEncryptionConfiguration": [ + { + "ServerSideEncryptionByDefault": { + "SSEAlgorithm": "AES256" + } + } + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "AuthRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Deny", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity" + } + ] + }, + "RoleName": { + "Ref": "AuthRoleName" + } + } + }, + "UnauthRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Deny", + "Principal": { + "Federated": "cognito-identity.amazonaws.com" + }, + "Action": "sts:AssumeRoleWithWebIdentity" + } + ] + }, + "RoleName": { + "Ref": "UnauthRoleName" + } + } + }, + "apimynotes": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-mynotes-staging-b2b56-deployment/amplify-cfn-templates/api/cloudformation-template.json", + "Parameters": { + "AppSyncApiName": "mynotes", + "DynamoDBBillingMode": "PAY_PER_REQUEST", + "DynamoDBEnableServerSideEncryption": false, + "S3DeploymentBucket": "amplify-mynotes-staging-b2b56-deployment", + "S3DeploymentRootKey": "amplify-appsync-files/c0e971ea1ba703ba5054d45b1d4a7a475f98dd0a", + "env": "staging" + } + } + }, + "authmynotesccae4f3b": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-mynotes-staging-b2b56-deployment/amplify-cfn-templates/auth/mynotesccae4f3b-cloudformation-template.json", + "Parameters": { + "identityPoolName": "mynotesccae4f3b_identitypool_ccae4f3b", + "allowUnauthenticatedIdentities": true, + "resourceNameTruncated": "mynoteccae4f3b", + "userPoolName": "mynotesccae4f3b_userpool_ccae4f3b", + "autoVerifiedAttributes": "email", + "mfaConfiguration": "OFF", + "mfaTypes": "SMS Text Message", + "smsAuthenticationMessage": "Your authentication code is {####}", + "smsVerificationMessage": "Your verification code is {####}", + "emailVerificationSubject": "Your verification code", + "emailVerificationMessage": "Your verification code is {####}", + "defaultPasswordPolicy": false, + "passwordPolicyMinLength": 8, + "passwordPolicyCharacters": "", + "requiredAttributes": "email", + "aliasAttributes": "", + "userpoolClientGenerateSecret": false, + "userpoolClientRefreshTokenValidity": 30, + "userpoolClientWriteAttributes": "email", + "userpoolClientReadAttributes": "email", + "userpoolClientLambdaRole": "mynoteccae4f3b_userpoolclient_lambda_role", + "userpoolClientSetAttributes": false, + "sharedId": "ccae4f3b", + "resourceName": "mynotesccae4f3b", + "authSelections": "identityPoolAndUserPool", + "useDefault": "default", + "userPoolGroupList": "", + "serviceName": "Cognito", + "usernameCaseSensitive": false, + "useEnabledMfas": true, + "authRoleArn": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + }, + "unauthRoleArn": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + }, + "breakCircularDependency": true, + "dependsOn": "", + "env": "staging" + } + } + }, + "functionS3Triggerdc42a5d7": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": "https://s3.amazonaws.com/amplify-mynotes-staging-b2b56-deployment/amplify-cfn-templates/function/S3Triggerdc42a5d7-cloudformation-template.json", + "Parameters": { + "deploymentBucketName": "amplify-mynotes-staging-b2b56-deployment", + "s3Key": "amplify-builds/S3Triggerdc42a5d7-6a475541666d35456861-build.zip", + "env": "staging" + } + } + }, + "UpdateRolesWithIDPFunction": { + "DependsOn": [ + "AuthRole", + "UnauthRole", + "authmynotesccae4f3b" + ], + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": { + "Fn::Join": [ + "\n", + [ + "const response = require('cfn-response');", + "const { IAMClient, GetRoleCommand, UpdateAssumeRolePolicyCommand } = require('@aws-sdk/client-iam');", + "exports.handler = function(event, context) {", + " // Don't return promise, response.send() marks context as done internally", + " const ignoredPromise = handleEvent(event, context)", + "};", + "async function handleEvent(event, context) {", + " try {", + " let authRoleName = event.ResourceProperties.authRoleName;", + " let unauthRoleName = event.ResourceProperties.unauthRoleName;", + " let idpId = event.ResourceProperties.idpId;", + " let authParamsJson = {", + " 'Version': '2012-10-17',", + " 'Statement': [{", + " 'Effect': 'Allow',", + " 'Principal': {'Federated': 'cognito-identity.amazonaws.com'},", + " 'Action': 'sts:AssumeRoleWithWebIdentity',", + " 'Condition': {", + " 'StringEquals': {'cognito-identity.amazonaws.com:aud': idpId},", + " 'ForAnyValue:StringLike': {'cognito-identity.amazonaws.com:amr': 'authenticated'}", + " }", + " }]", + " };", + " let unauthParamsJson = {", + " 'Version': '2012-10-17',", + " 'Statement': [{", + " 'Effect': 'Allow',", + " 'Principal': {'Federated': 'cognito-identity.amazonaws.com'},", + " 'Action': 'sts:AssumeRoleWithWebIdentity',", + " 'Condition': {", + " 'StringEquals': {'cognito-identity.amazonaws.com:aud': idpId},", + " 'ForAnyValue:StringLike': {'cognito-identity.amazonaws.com:amr': 'unauthenticated'}", + " }", + " }]", + " };", + " if (event.RequestType === 'Delete') {", + " try {", + " delete authParamsJson.Statement[0].Condition;", + " delete unauthParamsJson.Statement[0].Condition;", + " authParamsJson.Statement[0].Effect = 'Deny'", + " unauthParamsJson.Statement[0].Effect = 'Deny'", + " let authParams = {PolicyDocument: JSON.stringify(authParamsJson), RoleName: authRoleName};", + " let unauthParams = {PolicyDocument: JSON.stringify(unauthParamsJson), RoleName: unauthRoleName};", + " const iam = new IAMClient({region: event.ResourceProperties.region});", + " let res = await Promise.all([", + " iam.send(new GetRoleCommand({RoleName: authParams.RoleName})),", + " iam.send(new GetRoleCommand({RoleName: unauthParams.RoleName}))", + " ]);", + " res = await Promise.all([", + " iam.send(new UpdateAssumeRolePolicyCommand(authParams)),", + " iam.send(new UpdateAssumeRolePolicyCommand(unauthParams))", + " ]);", + " response.send(event, context, response.SUCCESS, {});", + " } catch (err) {", + " console.log(err.stack);", + " response.send(event, context, response.SUCCESS, {Error: err});", + " }", + " } else if (event.RequestType === 'Update' || event.RequestType === 'Create') {", + " const iam = new IAMClient({region: event.ResourceProperties.region});", + " let authParams = {PolicyDocument: JSON.stringify(authParamsJson), RoleName: authRoleName};", + " let unauthParams = {PolicyDocument: JSON.stringify(unauthParamsJson), RoleName: unauthRoleName};", + " const res = await Promise.all([", + " iam.send(new UpdateAssumeRolePolicyCommand(authParams)),", + " iam.send(new UpdateAssumeRolePolicyCommand(unauthParams))", + " ]);", + " response.send(event, context, response.SUCCESS, {});", + " }", + " } catch (err) {", + " console.log(err.stack);", + " response.send(event, context, response.FAILED, {Error: err});", + " }", + "};" + ] + ] + } + }, + "Handler": "index.handler", + "Runtime": "nodejs18.x", + "Timeout": 300, + "Role": { + "Fn::GetAtt": [ + "UpdateRolesWithIDPFunctionRole", + "Arn" + ] + } + } + }, + "UpdateRolesWithIDPFunctionOutputs": { + "Type": "Custom::LambdaCallout", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "UpdateRolesWithIDPFunction", + "Arn" + ] + }, + "region": { + "Ref": "AWS::Region" + }, + "idpId": { + "Fn::GetAtt": [ + "authmynotesccae4f3b", + "Outputs.IdentityPoolId" + ] + }, + "authRoleName": { + "Ref": "AuthRole" + }, + "unauthRoleName": { + "Ref": "UnauthRole" + } + } + }, + "UpdateRolesWithIDPFunctionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "RoleName": { + "Fn::Join": [ + "", + [ + { + "Ref": "AuthRole" + }, + "-idp" + ] + ] + }, + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + }, + "Policies": [ + { + "PolicyName": "UpdateRolesWithIDPFunctionPolicy", + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Resource": "arn:aws:logs:*:*:*" + }, + { + "Effect": "Allow", + "Action": [ + "iam:UpdateAssumeRolePolicy", + "iam:GetRole" + ], + "Resource": { + "Fn::GetAtt": [ + "AuthRole", + "Arn" + ] + } + }, + { + "Effect": "Allow", + "Action": [ + "iam:UpdateAssumeRolePolicy", + "iam:GetRole" + ], + "Resource": { + "Fn::GetAtt": [ + "UnauthRole", + "Arn" + ] + } + } + ] + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/awscloudformation/build/storage/notesimage/build/cloudformation-template.json b/New_APIs/Amplify-fullstack-API/amplify/backend/awscloudformation/build/storage/notesimage/build/cloudformation-template.json new file mode 100644 index 00000000..e2beb9c1 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/awscloudformation/build/storage/notesimage/build/cloudformation-template.json @@ -0,0 +1,750 @@ +{ + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"12.12.4\",\"stackType\":\"storage-S3\",\"metadata\":{}}", + "AWSTemplateFormatVersion": "2010-09-09", + "Parameters": { + "env": { + "Type": "String" + }, + "bucketName": { + "Type": "String" + }, + "authRoleName": { + "Type": "String" + }, + "unauthRoleName": { + "Type": "String" + }, + "authPolicyName": { + "Type": "String" + }, + "unauthPolicyName": { + "Type": "String" + }, + "s3PublicPolicy": { + "Type": "String", + "Default": "NONE" + }, + "s3PrivatePolicy": { + "Type": "String", + "Default": "NONE" + }, + "s3ProtectedPolicy": { + "Type": "String", + "Default": "NONE" + }, + "s3UploadsPolicy": { + "Type": "String", + "Default": "NONE" + }, + "s3ReadPolicy": { + "Type": "String", + "Default": "NONE" + }, + "s3PermissionsAuthenticatedPublic": { + "Type": "String", + "Default": "DISALLOW" + }, + "s3PermissionsAuthenticatedProtected": { + "Type": "String", + "Default": "DISALLOW" + }, + "s3PermissionsAuthenticatedPrivate": { + "Type": "String", + "Default": "DISALLOW" + }, + "s3PermissionsAuthenticatedUploads": { + "Type": "String", + "Default": "DISALLOW" + }, + "s3PermissionsGuestPublic": { + "Type": "String", + "Default": "DISALLOW" + }, + "s3PermissionsGuestUploads": { + "Type": "String", + "Default": "DISALLOW" + }, + "AuthenticatedAllowList": { + "Type": "String", + "Default": "DISALLOW" + }, + "GuestAllowList": { + "Type": "String", + "Default": "DISALLOW" + }, + "selectedGuestPermissions": { + "Type": "CommaDelimitedList", + "Default": "NONE" + }, + "selectedAuthenticatedPermissions": { + "Type": "CommaDelimitedList", + "Default": "NONE" + }, + "functionS3Trigger168e5d52Arn": { + "Type": "String", + "Default": "functionS3Trigger168e5d52Arn" + }, + "functionS3Trigger168e5d52Name": { + "Type": "String", + "Default": "functionS3Trigger168e5d52Name" + }, + "functionS3Trigger168e5d52LambdaExecutionRole": { + "Type": "String", + "Default": "functionS3Trigger168e5d52LambdaExecutionRole" + }, + "triggerFunction": { + "Type": "String" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + }, + "CreateAuthPublic": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "s3PermissionsAuthenticatedPublic" + }, + "DISALLOW" + ] + } + ] + }, + "CreateAuthProtected": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "s3PermissionsAuthenticatedProtected" + }, + "DISALLOW" + ] + } + ] + }, + "CreateAuthPrivate": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "s3PermissionsAuthenticatedPrivate" + }, + "DISALLOW" + ] + } + ] + }, + "CreateAuthUploads": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "s3PermissionsAuthenticatedUploads" + }, + "DISALLOW" + ] + } + ] + }, + "CreateGuestPublic": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "s3PermissionsGuestPublic" + }, + "DISALLOW" + ] + } + ] + }, + "CreateGuestUploads": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "s3PermissionsGuestUploads" + }, + "DISALLOW" + ] + } + ] + }, + "AuthReadAndList": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "AuthenticatedAllowList" + }, + "DISALLOW" + ] + } + ] + }, + "GuestReadAndList": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "GuestAllowList" + }, + "DISALLOW" + ] + } + ] + } + }, + "Outputs": { + "BucketName": { + "Description": "Bucket name for the S3 bucket", + "Value": { + "Ref": "S3Bucket" + } + }, + "Region": { + "Value": { + "Ref": "AWS::Region" + } + } + }, + "Resources": { + "S3Bucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + { + "Ref": "bucketName" + }, + { + "Fn::Join": [ + "", + [ + { + "Ref": "bucketName" + }, + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + "-", + { + "Ref": "AWS::StackName" + } + ] + } + ] + }, + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "CorsConfiguration": { + "CorsRules": [ + { + "AllowedHeaders": [ + "*" + ], + "AllowedMethods": [ + "GET", + "HEAD", + "PUT", + "POST", + "DELETE" + ], + "AllowedOrigins": [ + "*" + ], + "ExposedHeaders": [ + "x-amz-server-side-encryption", + "x-amz-request-id", + "x-amz-id-2", + "ETag" + ], + "Id": "S3CORSRuleId1", + "MaxAge": 3000 + } + ] + }, + "NotificationConfiguration": { + "LambdaConfigurations": [ + { + "Event": "s3:ObjectCreated:*", + "Function": { + "Ref": "functionS3Trigger168e5d52Arn" + } + }, + { + "Event": "s3:ObjectRemoved:*", + "Function": { + "Ref": "functionS3Trigger168e5d52Arn" + } + } + ] + }, + "BucketEncryption": { + "ServerSideEncryptionConfiguration": [ + { + "ServerSideEncryptionByDefault": { + "SSEAlgorithm": "AES256" + } + } + ] + } + }, + "DependsOn": [ + "TriggerPermissions" + ], + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "TriggerPermissions": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Ref": "functionS3Trigger168e5d52Name" + }, + "Principal": "s3.amazonaws.com", + "SourceAccount": { + "Ref": "AWS::AccountId" + }, + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Fn::If": [ + "ShouldNotCreateEnvResources", + { + "Ref": "bucketName" + }, + { + "Fn::Join": [ + "", + [ + { + "Ref": "bucketName" + }, + { + "Fn::Select": [ + 3, + { + "Fn::Split": [ + "-", + { + "Ref": "AWS::StackName" + } + ] + } + ] + }, + "-", + { + "Ref": "env" + } + ] + ] + } + ] + } + ] + ] + } + } + }, + "S3AuthPublicPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": { + "Fn::Split": [ + ",", + { + "Ref": "s3PermissionsAuthenticatedPublic" + } + ] + }, + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "S3Bucket" + }, + "/public/*" + ] + ] + } + ] + } + ] + }, + "PolicyName": { + "Ref": "s3PublicPolicy" + }, + "Roles": [ + { + "Ref": "authRoleName" + } + ] + }, + "DependsOn": [ + "S3Bucket" + ], + "Condition": "CreateAuthPublic" + }, + "S3AuthProtectedPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": { + "Fn::Split": [ + ",", + { + "Ref": "s3PermissionsAuthenticatedProtected" + } + ] + }, + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "S3Bucket" + }, + "/protected/${cognito-identity.amazonaws.com:sub}/*" + ] + ] + } + ] + } + ] + }, + "PolicyName": { + "Ref": "s3ProtectedPolicy" + }, + "Roles": [ + { + "Ref": "authRoleName" + } + ] + }, + "DependsOn": [ + "S3Bucket" + ], + "Condition": "CreateAuthProtected" + }, + "S3AuthPrivatePolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": { + "Fn::Split": [ + ",", + { + "Ref": "s3PermissionsAuthenticatedPrivate" + } + ] + }, + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "S3Bucket" + }, + "/private/${cognito-identity.amazonaws.com:sub}/*" + ] + ] + } + ] + } + ] + }, + "PolicyName": { + "Ref": "s3PrivatePolicy" + }, + "Roles": [ + { + "Ref": "authRoleName" + } + ] + }, + "DependsOn": [ + "S3Bucket" + ], + "Condition": "CreateAuthPrivate" + }, + "S3AuthUploadPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": { + "Fn::Split": [ + ",", + { + "Ref": "s3PermissionsAuthenticatedUploads" + } + ] + }, + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "S3Bucket" + }, + "/uploads/*" + ] + ] + } + ] + } + ] + }, + "PolicyName": { + "Ref": "s3UploadsPolicy" + }, + "Roles": [ + { + "Ref": "authRoleName" + } + ] + }, + "DependsOn": [ + "S3Bucket" + ], + "Condition": "CreateAuthUploads" + }, + "S3AuthReadPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:GetObject", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "S3Bucket" + }, + "/protected/*" + ] + ] + } + }, + { + "Action": "s3:ListBucket", + "Condition": { + "StringLike": { + "s3:prefix": [ + "public/", + "public/*", + "protected/", + "protected/*", + "private/${cognito-identity.amazonaws.com:sub}/", + "private/${cognito-identity.amazonaws.com:sub}/*" + ] + } + }, + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "S3Bucket" + } + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": { + "Ref": "s3ReadPolicy" + }, + "Roles": [ + { + "Ref": "authRoleName" + } + ] + }, + "DependsOn": [ + "S3Bucket" + ], + "Condition": "AuthReadAndList" + }, + "S3GuestReadPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:GetObject", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "S3Bucket" + }, + "/protected/*" + ] + ] + } + }, + { + "Action": "s3:ListBucket", + "Condition": { + "StringLike": { + "s3:prefix": [ + "public/", + "public/*", + "protected/", + "protected/*" + ] + } + }, + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "S3Bucket" + } + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": { + "Ref": "s3ReadPolicy" + }, + "Roles": [ + { + "Ref": "unauthRoleName" + } + ] + }, + "DependsOn": [ + "S3Bucket" + ], + "Condition": "GuestReadAndList" + }, + "S3TriggerBucketPolicy": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "s3:ListBucket" + ], + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "S3Bucket" + } + ] + ] + } + ] + }, + { + "Effect": "Allow", + "Action": [ + "s3:PutObject", + "s3:GetObject", + "s3:ListBucket", + "s3:DeleteObject" + ], + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:aws:s3:::", + { + "Ref": "S3Bucket" + }, + "/*" + ] + ] + } + ] + } + ] + }, + "PolicyName": "amplify-lambda-execution-policy-storage", + "Roles": [ + { + "Ref": "functionS3Trigger168e5d52LambdaExecutionRole" + } + ] + }, + "DependsOn": [ + "S3Bucket" + ] + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/backend-config.json b/New_APIs/Amplify-fullstack-API/amplify/backend/backend-config.json new file mode 100644 index 00000000..af6ea255 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/backend-config.json @@ -0,0 +1,72 @@ +{ + "api": { + "mynotes": { + "dependsOn": [], + "output": { + "authConfig": { + "additionalAuthenticationProviders": [], + "defaultAuthentication": { + "apiKeyConfig": { + "apiKeyExpirationDays": 7 + }, + "authenticationType": "API_KEY" + } + } + }, + "providerPlugin": "awscloudformation", + "service": "AppSync" + } + }, + "auth": { + "mynotesccae4f3b": { + "customAuth": false, + "dependsOn": [], + "frontendAuthConfig": { + "mfaConfiguration": "OFF", + "mfaTypes": [ + "SMS" + ], + "passwordProtectionSettings": { + "passwordPolicyCharacters": [], + "passwordPolicyMinLength": 8 + }, + "signupAttributes": [ + "EMAIL" + ], + "socialProviders": [], + "usernameAttributes": [], + "verificationMechanisms": [ + "EMAIL" + ] + }, + "providerPlugin": "awscloudformation", + "service": "Cognito" + } + }, + "function": { + "S3Triggerdc42a5d7": { + "build": true, + "providerPlugin": "awscloudformation", + "service": "Lambda" + } + }, + "parameters": { + "AMPLIFY_function_S3Triggerdc42a5d7_deploymentBucketName": { + "usedBy": [ + { + "category": "function", + "resourceName": "S3Triggerdc42a5d7" + } + ] + }, + "AMPLIFY_function_S3Triggerdc42a5d7_s3Key": { + "usedBy": [ + { + "category": "function", + "resourceName": "S3Triggerdc42a5d7" + } + ] + } + }, + "storage": {} +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/function/S3Triggerdc42a5d7/S3Triggerdc42a5d7-cloudformation-template.json b/New_APIs/Amplify-fullstack-API/amplify/backend/function/S3Triggerdc42a5d7/S3Triggerdc42a5d7-cloudformation-template.json new file mode 100644 index 00000000..99722625 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/function/S3Triggerdc42a5d7/S3Triggerdc42a5d7-cloudformation-template.json @@ -0,0 +1,193 @@ +{ + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"12.12.4\",\"stackType\":\"function-Lambda\",\"metadata\":{}}", + "Parameters": { + "env": { + "Type": "String" + }, + "deploymentBucketName": { + "Type": "String" + }, + "s3Key": { + "Type": "String" + } + }, + "Conditions": { + "ShouldNotCreateEnvResources": { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + }, + "Resources": { + "LambdaFunction": { + "Type": "AWS::Lambda::Function", + "Metadata": { + "aws:asset:path": "./src", + "aws:asset:property": "Code" + }, + "Properties": { + "Handler": "index.handler", + "FunctionName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "S3Triggerdc42a5d7", + { + "Fn::Join": [ + "", + [ + "S3Triggerdc42a5d7", + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "Environment": { + "Variables": { + "ENV": { + "Ref": "env" + } + } + }, + "Role": { + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 25, + "Code": { + "S3Bucket": { + "Ref": "deploymentBucketName" + }, + "S3Key": { + "Ref": "s3Key" + } + } + } + }, + "LambdaExecutionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "RoleName": { + "Fn::If": [ + "ShouldNotCreateEnvResources", + "S3Triggerdc42a5d7LambdaRoledc42a5d7", + { + "Fn::Join": [ + "", + [ + "S3Triggerdc42a5d7LambdaRoledc42a5d7", + "-", + { + "Ref": "env" + } + ] + ] + } + ] + }, + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + } + } + }, + "lambdaexecutionpolicy": { + "DependsOn": [ + "LambdaExecutionRole" + ], + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyName": "lambda-execution-policy", + "Roles": [ + { + "Ref": "LambdaExecutionRole" + } + ], + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Resource": { + "Fn::Sub": [ + "arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*", + { + "region": { + "Ref": "AWS::Region" + }, + "account": { + "Ref": "AWS::AccountId" + }, + "lambda": { + "Ref": "LambdaFunction" + } + } + ] + } + } + ] + } + } + } + }, + "Outputs": { + "Name": { + "Value": { + "Ref": "LambdaFunction" + } + }, + "Arn": { + "Value": { + "Fn::GetAtt": [ + "LambdaFunction", + "Arn" + ] + } + }, + "Region": { + "Value": { + "Ref": "AWS::Region" + } + }, + "LambdaExecutionRole": { + "Value": { + "Ref": "LambdaExecutionRole" + } + }, + "LambdaExecutionRoleArn": { + "Value": { + "Fn::GetAtt": [ + "LambdaExecutionRole", + "Arn" + ] + } + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/function/S3Triggerdc42a5d7/amplify.state b/New_APIs/Amplify-fullstack-API/amplify/backend/function/S3Triggerdc42a5d7/amplify.state new file mode 100644 index 00000000..2ba0f4c7 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/function/S3Triggerdc42a5d7/amplify.state @@ -0,0 +1,6 @@ +{ + "pluginId": "amplify-nodejs-function-runtime-provider", + "functionRuntime": "nodejs", + "defaultEditorFile": "src/index.js", + "useLegacyBuild": true +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/function/S3Triggerdc42a5d7/src/event.json b/New_APIs/Amplify-fullstack-API/amplify/backend/function/S3Triggerdc42a5d7/src/event.json new file mode 100644 index 00000000..fd2722e8 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/function/S3Triggerdc42a5d7/src/event.json @@ -0,0 +1,5 @@ +{ + "key1": "value1", + "key2": "value2", + "key3": "value3" +} diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/function/S3Triggerdc42a5d7/src/index.js b/New_APIs/Amplify-fullstack-API/amplify/backend/function/S3Triggerdc42a5d7/src/index.js new file mode 100644 index 00000000..12e2a4e7 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/function/S3Triggerdc42a5d7/src/index.js @@ -0,0 +1,6 @@ +exports.handler = async function (event) { + console.log('Received S3 event:', JSON.stringify(event, null, 2)); + const bucket = event.Records[0].s3.bucket.name; + const key = event.Records[0].s3.object.key; + console.log(`Bucket: ${bucket}`, `Key: ${key}`); +}; \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/function/S3Triggerdc42a5d7/src/package.json b/New_APIs/Amplify-fullstack-API/amplify/backend/function/S3Triggerdc42a5d7/src/package.json new file mode 100644 index 00000000..0fbf74b6 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/function/S3Triggerdc42a5d7/src/package.json @@ -0,0 +1,7 @@ +{ + "name": "S3Triggerdc42a5d7", + "version": "2.0.0", + "description": "Lambda function generated by Amplify", + "main": "index.js", + "license": "Apache-2.0" +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/function/S3Triggerdc42a5d7/src/yarn.lock b/New_APIs/Amplify-fullstack-API/amplify/backend/function/S3Triggerdc42a5d7/src/yarn.lock new file mode 100644 index 00000000..fb57ccd1 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/function/S3Triggerdc42a5d7/src/yarn.lock @@ -0,0 +1,4 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/tags.json b/New_APIs/Amplify-fullstack-API/amplify/backend/tags.json new file mode 100644 index 00000000..b9321d71 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/tags.json @@ -0,0 +1,10 @@ +[ + { + "Key": "user:Stack", + "Value": "{project-env}" + }, + { + "Key": "user:Application", + "Value": "{project-name}" + } +] \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/backend/types/amplify-dependent-resources-ref.d.ts b/New_APIs/Amplify-fullstack-API/amplify/backend/types/amplify-dependent-resources-ref.d.ts new file mode 100644 index 00000000..1e999e91 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/backend/types/amplify-dependent-resources-ref.d.ts @@ -0,0 +1,29 @@ +export type AmplifyDependentResourcesAttributes = { + "api": { + "mynotes": { + "GraphQLAPIEndpointOutput": "string", + "GraphQLAPIIdOutput": "string", + "GraphQLAPIKeyOutput": "string" + } + }, + "auth": { + "mynotesccae4f3b": { + "AppClientID": "string", + "AppClientIDWeb": "string", + "IdentityPoolId": "string", + "IdentityPoolName": "string", + "UserPoolArn": "string", + "UserPoolId": "string", + "UserPoolName": "string" + } + }, + "function": { + "S3Triggerdc42a5d7": { + "Arn": "string", + "LambdaExecutionRole": "string", + "LambdaExecutionRoleArn": "string", + "Name": "string", + "Region": "string" + } + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/cli.json b/New_APIs/Amplify-fullstack-API/amplify/cli.json new file mode 100644 index 00000000..bd63c719 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/cli.json @@ -0,0 +1,64 @@ +{ + "features": { + "graphqltransformer": { + "addmissingownerfields": true, + "improvepluralization": false, + "validatetypenamereservedwords": true, + "useexperimentalpipelinedtransformer": true, + "enableiterativegsiupdates": true, + "secondarykeyasgsi": true, + "skipoverridemutationinputtypes": true, + "transformerversion": 2, + "suppressschemamigrationprompt": true, + "securityenhancementnotification": false, + "showfieldauthnotification": false, + "usesubusernamefordefaultidentityclaim": true, + "usefieldnameforprimarykeyconnectionfield": false, + "enableautoindexquerynames": true, + "respectprimarykeyattributesonconnectionfield": true, + "shoulddeepmergedirectiveconfigdefaults": false, + "populateownerfieldforstaticgroupauth": true, + "subscriptionsinheritprimaryauth": false + }, + "frontend-ios": { + "enablexcodeintegration": true + }, + "auth": { + "enablecaseinsensitivity": true, + "useinclusiveterminology": true, + "breakcirculardependency": true, + "forcealiasattributes": false, + "useenabledmfas": true + }, + "codegen": { + "useappsyncmodelgenplugin": true, + "usedocsgeneratorplugin": true, + "usetypesgeneratorplugin": true, + "cleangeneratedmodelsdirectory": true, + "retaincasestyle": true, + "addtimestampfields": true, + "handlelistnullabilitytransparently": true, + "emitauthprovider": true, + "generateindexrules": true, + "enabledartnullsafety": true, + "generatemodelsforlazyloadandcustomselectionset": false + }, + "appsync": { + "generategraphqlpermissions": true + }, + "latestregionsupport": { + "pinpoint": 1, + "translate": 1, + "transcribe": 1, + "rekognition": 1, + "textract": 1, + "comprehend": 1 + }, + "project": { + "overrides": true + } + }, + "debug": { + "shareProjectConfig": true + } +} \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/hooks/README.md b/New_APIs/Amplify-fullstack-API/amplify/hooks/README.md new file mode 100644 index 00000000..8fb601ea --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/hooks/README.md @@ -0,0 +1,7 @@ +# Command Hooks + +Command hooks can be used to run custom scripts upon Amplify CLI lifecycle events like pre-push, post-add-function, etc. + +To get started, add your script files based on the expected naming convention in this directory. + +Learn more about the script file naming convention, hook parameters, third party dependencies, and advanced configurations at https://docs.amplify.aws/cli/usage/command-hooks diff --git a/New_APIs/Amplify-fullstack-API/amplify/hooks/post-push.sh.sample b/New_APIs/Amplify-fullstack-API/amplify/hooks/post-push.sh.sample new file mode 100644 index 00000000..20df3f3c --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/hooks/post-push.sh.sample @@ -0,0 +1,24 @@ +# This is a sample hook script created by Amplify CLI. +# To start using this post-push hook please change the filename: +# post-push.sh.sample -> post-push.sh +# +# learn more: https://docs.amplify.aws/cli/usage/command-hooks + +if [ -z "$(which jq)" ]; then + echo "Please install jq to run the sample script." + exit 0 +fi + +parameters=`cat` +error=$(jq -r '.error // empty' <<< "$parameters") +data=$(jq -r '.data' <<< "$parameters") + +# +# Write code here: +# +if [ ! -z "$error" ]; then + echo "Amplify CLI emitted an error:" $(jq -r '.message' <<< "$error") + exit 0 +fi +echo "project root path:" $(pwd); +echo "Amplify CLI command:" $(jq -r '.amplify | .command' <<< "$data") \ No newline at end of file diff --git a/New_APIs/Amplify-fullstack-API/amplify/hooks/pre-push.js.sample b/New_APIs/Amplify-fullstack-API/amplify/hooks/pre-push.js.sample new file mode 100644 index 00000000..3ea7323a --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/hooks/pre-push.js.sample @@ -0,0 +1,27 @@ +/** + * This is a sample hook script created by Amplify CLI. + * To start using this pre-push hook please change the filename: + * pre-push.js.sample -> pre-push.js + * + * learn more: https://docs.amplify.aws/cli/usage/command-hooks + */ + +/** + * @param data { { amplify: { environment: { envName: string, projectPath: string, defaultEditor: string }, command: string, subCommand: string, argv: string[] } } } + * @param error { { message: string, stack: string } } + */ +const hookHandler = async (data, error) => { + // TODO write your hook handler here +}; + +const getParameters = async () => { + const fs = require("fs"); + return JSON.parse(fs.readFileSync(0, { encoding: "utf8" })); +}; + +getParameters() + .then((event) => hookHandler(event.data, event.error)) + .catch((err) => { + console.error(err); + process.exitCode = 1; + }); diff --git a/New_APIs/Amplify-fullstack-API/amplify/team-provider-info.json b/New_APIs/Amplify-fullstack-API/amplify/team-provider-info.json new file mode 100644 index 00000000..b82455c5 --- /dev/null +++ b/New_APIs/Amplify-fullstack-API/amplify/team-provider-info.json @@ -0,0 +1,29 @@ +{ + "staging": { + "awscloudformation": { + "AuthRoleName": "amplify-mynotes-staging-b2b56-authRole", + "UnauthRoleArn": "arn:aws:iam::339712714202:role/amplify-mynotes-staging-b2b56-unauthRole", + "AuthRoleArn": "arn:aws:iam::339712714202:role/amplify-mynotes-staging-b2b56-authRole", + "Region": "ap-southeast-2", + "DeploymentBucketName": "amplify-mynotes-staging-b2b56-deployment", + "UnauthRoleName": "amplify-mynotes-staging-b2b56-unauthRole", + "StackName": "amplify-mynotes-staging-b2b56", + "StackId": "arn:aws:cloudformation:ap-southeast-2:339712714202:stack/amplify-mynotes-staging-b2b56/5d40cab0-4b32-11ef-8fd8-06f396c97ee1", + "AmplifyAppId": "d2nrrgvsn5u7rq" + }, + "categories": { + "auth": { + "mynotesccae4f3b": {} + }, + "api": { + "mynotes": {} + }, + "function": { + "S3Triggerdc42a5d7": { + "deploymentBucketName": "amplify-mynotes-staging-b2b56-deployment", + "s3Key": "amplify-builds/S3Triggerdc42a5d7-6a475541666d35456861-build.zip" + } + } + } + } +} \ No newline at end of file diff --git a/New_APIs/Barcode-Generator/Barcode Generator/READme.md b/New_APIs/Barcode-Generator/Barcode Generator/READme.md new file mode 100644 index 00000000..20ae49eb --- /dev/null +++ b/New_APIs/Barcode-Generator/Barcode Generator/READme.md @@ -0,0 +1,42 @@ +# Barcode Generator +This is a simple barcode generator application built using HTML, CSS, and JavaScript. The application allows users to input a string and generate a corresponding barcode. + +## Features +* Generate barcodes from user input. +* Simple and easy-to-use interface. +* Responsive design for different screen sizes. + +## Technologies Used +* HTML +* CSS +* JavaScript +* JsBarcode library + +## Getting Started +* Prerequisites +To run this project locally, you need a web browser. + +* Installation +Clone the repository: + +```bash +git clone https://github.com/your-username/barcode-generator.git +``` + +* Navigate to the project directory: + +```bash +cd barcode-generator +``` + +* Open index.html in your web browser to see the barcode generator in action. + +## Usage +* Open the application in your web browser. +* Enter the text you want to convert into a barcode in the input field. +* Click the "Generate Barcode" button to generate the barcode. +* The generated barcode will be displayed below the input field. + +## Screenshots + +![alt text](image.png) \ No newline at end of file diff --git a/New_APIs/Barcode-Generator/Barcode Generator/image.png b/New_APIs/Barcode-Generator/Barcode Generator/image.png new file mode 100644 index 00000000..638be7e5 Binary files /dev/null and b/New_APIs/Barcode-Generator/Barcode Generator/image.png differ diff --git a/New_APIs/Barcode-Generator/Barcode Generator/index.html b/New_APIs/Barcode-Generator/Barcode Generator/index.html new file mode 100644 index 00000000..89ebb816 --- /dev/null +++ b/New_APIs/Barcode-Generator/Barcode Generator/index.html @@ -0,0 +1,25 @@ + + + + + Barcode Generator + + + + + + + + +
+

Barcode Generator

+ + + +
+ + + diff --git a/New_APIs/Barcode-Generator/Barcode Generator/script.js b/New_APIs/Barcode-Generator/Barcode Generator/script.js new file mode 100644 index 00000000..d179db67 --- /dev/null +++ b/New_APIs/Barcode-Generator/Barcode Generator/script.js @@ -0,0 +1,13 @@ +let input = document.getElementById("input"); +let btn = document.getElementById("btn-barcode-generator"); +btn.addEventListener("click", () => { + JsBarcode("#barcode", input.value, { + format: "code128", + displayValue: true, + fontSize: 24, + lineColor: "#000", + }); +}); +window.onload = (event) => { + input.value = ""; +}; diff --git a/New_APIs/Barcode-Generator/Barcode Generator/style.css b/New_APIs/Barcode-Generator/Barcode Generator/style.css new file mode 100644 index 00000000..ff3c1ad6 --- /dev/null +++ b/New_APIs/Barcode-Generator/Barcode Generator/style.css @@ -0,0 +1,38 @@ +* { + padding: 0; + margin: 0; + box-sizing: border-box; + font-family: "Poppins", sans-serif; +} +body { + background-color: #0092fd; +} +.container { + width: min(500px, 90vw); + background-color: #ffffff; + position: absolute; + transform: translate(-50%, -50%); + top: 50%; + left: 50%; + padding: 3rem; + border-radius: 0.8em; +} +h1 { + font-size: 2em; + margin-bottom: 1em; +} +input { + width: 60%; + border: 1px solid #000000; + padding: 1em; + border-radius: 0.7em; +} +button { + background-color: #0092fd; + color: #ffffff; + border: none; + width: 38%; + border-radius: 0.7em; + padding: 1em; + font-size: 0.8em; +} diff --git a/New_APIs/Blog_Platform/README.md b/New_APIs/Blog_Platform/README.md new file mode 100644 index 00000000..c2abf75b --- /dev/null +++ b/New_APIs/Blog_Platform/README.md @@ -0,0 +1,163 @@ +## Description + +- Backend infrastructure for a blogging platform, using Node.js, Express.js, and MongoDB, facilitating seamless management of user and admin roles with role-based authentication. +- Robust user authentication functionalities, including sign-in and sign-up features, ensuring secure access for both users and administrators. +- Users can create, edit, delete and view their own blogs. +- Users can like/unlike, comment, search by tags and view blogs. +- Administrators can manage user, blogs and tags. + +## How to run it? 🕹️ + +1. Fork the repository. + +2. Clone the project. + +``` +git clone repository-url +``` + +3. Install dependencies. + +``` +npm install +``` + +4. Create and update `.env` file. + +``` +PORT = port-no +MONGODB_URL = your mongodb database url +JWT_SECRET_KEY = your jwt secret key +``` + +5. Run the server. + +``` +node app.js +``` + +6. Check the endpoints via postman/frontend. + + +## EndPoints + +1. Sign in + +```http +POST /auth/signin +``` + + +2. Sign up + +```http +POST /users/ +``` + +3. Get user by id + +```http +GET /users/:id +``` + +4. Get all user (Admin) + +```http +GET /users/ +``` + +5. Update User (User) + +```http +PUT /users/:id +``` + +7. Delete user (User) + +```http +DELETE /users/:id +``` + +8. Create blog (User) + +```http +POST /blogs/ +``` + +9. Update blog (User) + +```http +PUT /blogs/:id +``` + +10. Delete blog (User) + +```http +DELETE /blogs/:id +``` + +11. Get all blogs + +```http +GET /blogs/ +``` + +12. Create comment (User) + +```http +POST /comments/ +``` + +13. Update comment (User) + +```http +PUT /comments/:id +``` + +14. Delete comment (User) + +```http +DELETE /comments/:id +``` + +15. Get comments by blog + +```http +GET /comments/ +``` + +15. Like/unlike blog (User) + +```http +PUT /likes/ +``` + +15. Get likes by blog + +```http +GET /likes/:blogId +``` + +16. Create tag (Admin) + +```http +POST /tags/ +``` + +17. Update tag (Admin) + +```http +PUT /tags/:id +``` + +18. Delete tag (Admin) + +```http +DELETE /tags/:id +``` + +19. Get all tags + +```http +GET /tags/ +``` diff --git a/New_APIs/Blog_Platform/app.js b/New_APIs/Blog_Platform/app.js new file mode 100644 index 00000000..a2eb35a5 --- /dev/null +++ b/New_APIs/Blog_Platform/app.js @@ -0,0 +1,27 @@ +require('dotenv').config(); +const express = require('express'); +const bodyParser = require('body-parser'); +const authRoutes = require('./routes/authRouter') +const userRoutes = require('./routes/userRoutes') +const tagRoutes = require('./routes/tagRoutes') +const blogRoutes = require('./routes/blogRoutes') +const likeRoutes = require('./routes/likeRoutes') +const commentRoutes = require('./routes/commentRouter') +const connectToDB = require('./config/dbConnection') + +const port = process.env.PORT || 8080; +const app = express(); +app.use(bodyParser.json()) + +connectToDB() + +app.use('/auth', authRoutes) +app.use('/users', userRoutes) +app.use('/tags', tagRoutes) +app.use('/blogs', blogRoutes) +app.use('/likes', likeRoutes) +app.use('/comments', commentRoutes) + +app.listen(port, () => { + console.log('Application is running on port ' + port) +}) diff --git a/New_APIs/Blog_Platform/config/dbConnection.js b/New_APIs/Blog_Platform/config/dbConnection.js new file mode 100644 index 00000000..c8b5964c --- /dev/null +++ b/New_APIs/Blog_Platform/config/dbConnection.js @@ -0,0 +1,16 @@ +require('dotenv').config(); +const mongoose = require('mongoose'); + +const connectToDB = async () => { + await mongoose.connect(process.env.MONGODB_URL) + .then(() => { + console.log("Connected to MongoDB"); + }) + .catch( + (error) => { + console.error("Error connecting to MongoDB:", error); + } + ); +} + +module.exports = connectToDB \ No newline at end of file diff --git a/New_APIs/Blog_Platform/controllers/authController.js b/New_APIs/Blog_Platform/controllers/authController.js new file mode 100644 index 00000000..96d8dd2e --- /dev/null +++ b/New_APIs/Blog_Platform/controllers/authController.js @@ -0,0 +1,46 @@ +const User = require('../models/User') +const bcrypt = require('bcrypt') +const { generateToken } = require('../utils/generateToken') +const { STATUS } = require('../utils/status') + +exports.signIn = async (req, res) => { + const { email, password } = req.body + + if (!email || !password) { + return res.status(404).json({ message: "Please send all the required fields: email, password"}) + } + + try { + const user = await User.findOne({email: email}) + + if(!user) { + return res.status(404).json({ message: "User not found with email " + email}) + } + + if (user.status === STATUS.DISABLE) { + return res.status(401).json({ message: "User account is disbled by the admin!"}) + } + + const isValid = await bcrypt.compare(password, user.password) + if (!isValid) { + return res.status(404).json({ message: "Invalid credentials!"}) + } + + const token = generateToken(user._id, user.roles) + + const response = { + token: token, + user: { + userId: user._id, + name: user.name, + email: user.email, + about: user.about, + } + } + + res.status(200).json(response) + }catch (error) { + console.log("Failed to Sign in: " + error) + return res.status(500).json({ message: "Internal server error" }) + } +} \ No newline at end of file diff --git a/New_APIs/Blog_Platform/controllers/blogController.js b/New_APIs/Blog_Platform/controllers/blogController.js new file mode 100644 index 00000000..a5b0aade --- /dev/null +++ b/New_APIs/Blog_Platform/controllers/blogController.js @@ -0,0 +1,148 @@ +const Blog = require('../models/Blog') +const User = require('../models/User') +const Tag = require('../models/Tag') +const Comment = require('../models/Comment') + +exports.createBlog = async (req, res) => { + + const { title, content, tagIds } = req.body + const userId = req.user + + try { + if (!title || !content || !tagIds || tagIds.length === 0) { + return res.status(400).json({ message: "Please send all the required fields: title, content, TagIds" }) + } + + const user = await User.findOne({ _id: userId }) + if (!user) { + return res.status(400).json({ message: "User not found with id " + userId }) + } + + if (tagIds.length > 5) { + return res.status(400).json({ message: "One post connot have more than 5 tags." }) + } + + const tags = await Tag.find({ _id: { $in: tagIds } }) + const validTagIds = tags.map(tag => tag._id.toString()) + const invalidTagIds = tagIds.filter(id => !validTagIds.includes(id)) + if (invalidTagIds.length !== 0) { + return res.status(400).json({ message: "Tags not found with id " + invalidTagIds }) + } + + const data = { + title: title, + content: content, + user: userId, + tags: tagIds, + likes: [], comments: [] + } + + + await Blog.create(data) + + res.status(201).json({ message: "Blog has been successfully published!" }) + + } catch (error) { + console.log("Failed to add blog: " + error) + return res.status(500).json({ message: "Internal server error" }) + } +} + +exports.updateBlog = async (req, res) => { + const { title, content, tagIds } = req.body + const { id } = req.params + const userId = req.user + + try { + if (!id || !title || !content || !tagIds || tagIds.length === 0) { + return res.status(400).json({ message: "Please send all the required fields: title, content, TagIds" }) + } + + const blog = await Blog.findOne({ _id: id }) + if (!blog) { + return res.status(400).json({ message: "Blog not found with id " + id }) + } + + if(userId != blog.user) { + return res.status(401).json({ message: "Unauthorized: Access denied!" }) + } + + if (tagIds.length > 5) { + return res.status(400).json({ message: "One post connot have more than 5 tags." }) + } + + const tags = await Tag.find({ _id: { $in: tagIds } }) + const validTagIds = tags.map(tag => tag._id.toString()) + const invalidTagIds = tagIds.filter(id => !validTagIds.includes(id)) + if (invalidTagIds.length !== 0) { + return res.status(400).json({ message: "Tags not found with id " + invalidTagIds }) + } + + const data = { + title: title, + content: content, + user: blog.userId, + tags: tagIds, + likes: blog.likes, + comments: blog.comments + } + + + await Blog.updateOne({ _id: id }, { $set: data }) + res.status(201).json({ message: "Blog has been successfully Updated!" }) + + } catch (error) { + console.log("Failed to add blog: " + error) + return res.status(500).json({ message: "Internal server error" }) + } +} + +exports.getBlogs = async (req, res) => { + const {blogId, userId, tagId} = req.query + + try { + let data = [] + + if (blogId) { + data = await Blog.findOne( { _id: blogId } ).populate('tags') + } + else if (userId) { + data = await Blog.find( { user: userId } ).populate('tags') + } + else if (tagId) { + data = await Blog.find( { tags: tagId } ).populate('tags') + } + else { + data = await Blog.find().populate('tags') + } + res.status(200).json(data) + } catch (error) { + console.log("Failed to find blogs: " + error) + return res.status(500).json({ message: "Internal server error" }) + } + +} + +exports.deleteBlog = async (req, res) => { + const { id } = req.params + + try { + const blog = await Blog.findOne({ _id: id }) + + if (!blog) { + return res.status(404).json({ message: "Blog not found with id " + id }) + } + + if (req.user != blog.user) { + return res.status(401).json({ message: "Unauthorized: Access denied!" }) + } + + await Blog.deleteOne({_id: id}) + await Comment.deleteMany({blog: id}) + + res.status(200).json({ message: "Blog has been successfully deleted!" }) + + }catch (error) { + console.log("Failed to delete blog: " + error) + } +} \ No newline at end of file diff --git a/New_APIs/Blog_Platform/controllers/commentController.js b/New_APIs/Blog_Platform/controllers/commentController.js new file mode 100644 index 00000000..d2a65b00 --- /dev/null +++ b/New_APIs/Blog_Platform/controllers/commentController.js @@ -0,0 +1,126 @@ +const Comment = require('../models/Comment') +const Blog = require('../models/Blog') +const User = require('../models/User') + +exports.addComment = async (req, res) => { + + const { blogId, content } = req.body + const userId = req.user + + if (!blogId || !content) { + return res.status(400).json({ message: "Please send all the required fields: blogId, content" }) + } + + try { + const blog = await Blog.findOne({ _id: blogId }) + if (!blog) { + return res.status(400).json({ message: "Blog not found with id " + blogId }) + } + + const user = await User.findOne({ _id: userId }) + if (!user) { + return res.status(400).json({ message: "User not found with id " + userId }) + } + const data = { + content: content, + user: userId, + blog: blogId + } + const comment = await Comment.create(data) + blog.comments.push(comment._id) + await Blog.updateOne({ _id: blogId }, { $set: blog }) + res.status(201).json({ message: "Comment has been successfully added!" }) + + } catch (error) { + console.log("Failed to add comment: " + error) + return res.status(500).json({ message: "Internal server error" }) + } + +} + +exports.deleteComment = async (req, res) => { + + const { id } = req.params + const userId = req.user + + try { + const comment = await Comment.findOne({ _id: id }) + + if (!comment) { + return res.status(400).json({ message: "comment not found with id " + id }) + } + console.log(comment.user, userId) + if(userId != comment.user) { + return res.status(401).json({ message: "Unauthorized: Access denied!" }) + } + + const blog = await Blog.findOne({ _id: comment.blog }) + blog.comments.splice(blog.comments.indexOf(comment._id), 1) + await Blog.updateOne({ _id: blog.id }, { $set: blog }) + + await Comment.deleteOne({ _id: comment.id }) + res.status(201).json({ message: "Comment has been successfully deleted!" }) + + } catch (error) { + console.log("Failed to delete comment: " + error) + return res.status(500).json({ message: "Internal server error" }) + } + +} + +exports.updateComment = async (req, res) => { + const { id } = req.params + const userId = req.user + + const {content} = req.body; + + if(!content) { + return res.status(400).json({ message: "content is required!"}) + } + + try { + const comment = await Comment.findOne({ _id: id }) + + if (!comment) { + return res.status(400).json({ message: "comment not found with id " + id }) + } + + + if (comment.user != userId) { + return res.status(400).json({ message: "Unauthorized: Access denied!"}) + } + + await Comment.updateOne({ _id: id }, { $set: req.body }) + res.status(200).json({ message: "Comment has been successfully updated!" }) + + } catch (error) { + console.log("Failed to update comment: " + error) + return res.status(500).json({ message: "Internal server error" }) + } +} + +exports.getCommentsByBlog = async (req, res) => { + const { commentId, blogId } = req.query + + try { + let data = [] + + if (commentId) { + data = await Comment.findOne({ _id: commentId }).populate({ + path: 'user', + select: 'fname lname email' + }) + } else if (blogId) { + data = await Comment.find({ blog: blogId }).populate({ + path: 'user', + select: 'fname lname email' + }) + } + res.status(200).json(data) + + } catch (error) { + console.log("Failed to find comments: " + error) + return res.status(500).json({ message: "Internal server error" }) + } +} + diff --git a/New_APIs/Blog_Platform/controllers/likeController.js b/New_APIs/Blog_Platform/controllers/likeController.js new file mode 100644 index 00000000..47ce4521 --- /dev/null +++ b/New_APIs/Blog_Platform/controllers/likeController.js @@ -0,0 +1,57 @@ +const Blog = require('../models/Blog') +const User = require('../models/User') + + +exports.likeOrUnLike = async (req, res) => { + const { blogId } = req.body + const userId = req.user + + if (!blogId) { + return res.status(400).json({ message: "Please send all the required fields: blogId" }) + } + + try { + const blog = await Blog.findOne({ _id: blogId }) + if (!blog) { + return res.status(400).json({ message: "Blog not found with id " + blogId }) + } + + const user = await User.findOne({ _id: userId }) + if (!user) { + return res.status(400).json({ message: "User not found with id " + userId }) + } + + if (blog.likes.includes(userId)) { + blog.likes.splice(blog.likes.indexOf(userId), 1) + await Blog.updateOne({ _id: blogId }, { $set: blog }) + res.status(200).json({ message: "Like has been removed from the blog!" }) + } else { + blog.likes.push(userId) + await Blog.updateOne({ _id: blogId }, { $set: blog }) + res.status(200).json({ message: "Like has been added to the blog!" }) + } + } catch (error) { + console.log("Failed to like/unlike blog: " + error) + return res.status(500).json({ message: "Internal server error" }) + } + +} + +exports.getLikesByBlog = async (req, res) => { + const { blogId } = req.params + + try { + const blog = await Blog.findOne({ _id: blogId }).populate({ + path: 'likes', + select: 'fname lname email' + }) + if (!blog) { + return res.status(400).json({ message: "Blog not found with id " + blogId }) + } + + res.status(200).json(blog.likes) + }catch (error) { + console.log("Failed to find likes of the blog: " + error) + return res.status(500).json({ message: "Internal server error" }) + } +} \ No newline at end of file diff --git a/New_APIs/Blog_Platform/controllers/tagController.js b/New_APIs/Blog_Platform/controllers/tagController.js new file mode 100644 index 00000000..88b18446 --- /dev/null +++ b/New_APIs/Blog_Platform/controllers/tagController.js @@ -0,0 +1,100 @@ +const Tag = require('../models/Tag') + +exports.getTags = async (req, res) => { + const id = req.query.id + const key = req.query.key + let tagData = []; + try { + if (id) { + tagData = await Tag.findOne({_id: id}) + }else if (key) { + const regex = new RegExp('^' + key, 'i') + tagData = await Tag.find( { tagName: regex } ) + }else { + tagData = await Tag.find() + } + + if (tagData.length === 0) { + return res.status(404).json({ message: "No tags found!" }) + } + + + res.status(200).json(tagData) + } catch (error) { + console.log("Failed to tags: " + error) + return res.status(500).json({ message: "Internal server error" }) + } + +} + +exports.createTag = async (req, res) => { + const { name } = req.body + + { + try { + if (!name) { + return res.status(400).json({message: 'Tag name is required!'}) + } + + await Tag.create({tagName: name}) + + res.status(201).json({message: 'Tag has been successfully created!'}) + + } catch (error) { + console.log("Failed to create tag: " + error) + return res.status(500).json({ message: "Internal server error" }) + } + } + +} + +exports.updateTag = async (req, res) => { + const id = req.params + const { name } = req.body + + { + try { + if (!name) { + return res.status(400).json({message: 'Tag name is required!'}) + } + + const tag = Tag.findOne({_id: id}) + + if (!tag) { + return res.status(400).json({message: 'Tag is found with id ' + id}) + } + + await Tag.updateOne({ _id: id }, { $set: {tagName: name} }) + + res.status(200).json({message: 'Tag has been successfully updated!'}) + + } catch (error) { + console.log("Failed to update tag: " + error) + return res.status(500).json({ message: "Internal server error" }) + } + } + +} + +exports.deleteTag = async (req, res) => { + const id = req.params + + { + try { + const tag = Tag.findOne({_id: id}) + + if (!tag) { + return res.status(400).json({message: 'Tag is found with id ' + id}) + } + + await Tag.deleteOne({ _id: id }) + + res.status(201).json({message: 'Tag has been successfully deleted!'}) + + } catch (error) { + console.log("Failed to delete tag: " + error) + return res.status(500).json({ message: "Internal server error" }) + } + } + +} \ No newline at end of file diff --git a/New_APIs/Blog_Platform/controllers/userController.js b/New_APIs/Blog_Platform/controllers/userController.js new file mode 100644 index 00000000..66ce8e4c --- /dev/null +++ b/New_APIs/Blog_Platform/controllers/userController.js @@ -0,0 +1,145 @@ +require('dotenv').config(); +const { validationResult } = require('express-validator') +const User = require('../models/User') +const bcrypt = require('bcrypt') +const { STATUS } = require('../utils/status'); +const Blog = require('../models/Blog'); +const Comment = require('../models/Comment'); + + +exports.getAllUsers = async (req, res) => { + try { + const users = await User.find() + res.status(200).json(users) + } catch (error) { + console.log("Failed to find all users: " + error) + return res.status(500).json({ message: "Internal server error" }) + } + +} + +exports.getUserById = async (req, res) => { + const { id } = req.params + + try { + const existingUser = await User.findOne({ _id: id }) + + if (!existingUser || existingUser.status === STATUS.DISABLE) { + return res.status(404).json({ message: "User not found with id " + id }) + } + res.send(existingUser) + } catch (error) { + console.log("Failed to find user: " + error) + return res.status(500).json({ message: "Internal server error" }) + } +} + +exports.signUp = async (req, res) => { + + const errors = validationResult(req) + const ROLES = ["user", "admin"]; + + if (!errors.isEmpty()) { + return res.status(400).json({ error: errors.array() }) + } + + let { name, email, password, role } = req.body; + + try { + + const existingUser = await User.findOne({ email: email }) + + if (existingUser) { + return res.status(400).json({ message: "User already exists with email " + email }) + } + if (!role) { + role = ["user"] + } else if (Array.isArray(role)) { + if (!role.every(r => ROLES.indexOf(r) !== -1)) { + return res.status(400).json({ message: "Roles are invalid!" }) + } + } else { + return res.status(400).json({ message: "Send roles as an array!" }) + } + + const hashedPassword = await bcrypt.hash(password, 10) + const data = { + name: name, email: email, password: hashedPassword, roles: role, about: "", status: STATUS.ENABLE + } + + await User.create(data) + + res.status(201).json({ message: "User has been successfully added!" }) + + } catch (error) { + console.log("Failed to sign up: " + error) + return res.status(500).json({ message: "Internal server error" }) + } +} + +exports.updateUser = async (req, res) => { + const { id } = req.params + const { name, about } = req.body; + + if (req.user !== id) { + return res.status(401).json({ message: "Unauthorized: Access denied!" }) + } + + if (!name) { + return res.status(404).json({ message: "Name is required!" }) + } + + if (name.length > 20 || name.length < 4) { + return res.status(404).json({ message: "Name must be between 5 and 20 characters long!" }) + } + if (about && about.length > 160) { + return res.status(404).json({ message: "About must be less than 160 characters long!" }) + } + + try { + const user = await User.findOne({ _id: id }) + + if (!user) { + return res.status(404).json({ message: "User not found with id " + id }) + } + + const data = { + name: name, email: user.email, password: user.password, roles: user.roles, about: about, status: user.status + } + + await User.updateOne({ _id: id }, { $set: data }) + res.status(200).json({ message: "User has been successfully updated!" }) + + } catch (error) { + console.log("Failed to update user: " + error) + return res.status(500).json({ message: "Internal server error" }) + } + +} + +exports.deleteUser = async (req, res) => { + const { id } = req.params + + if (req.user != id) { + return res.status(401).json({ message: "Unauthorized: Access denied!" }) + } + + try { + const existingUser = await User.findOne({ _id: id }) + + if (!existingUser) { + return res.status(404).json({ message: "User not found with id " + id }) + } + + await User.updateOne({ _id: id }, { $set: { status: STATUS.DISABLE } }) + await Blog.deleteMany({ user: id }) + await Blog.updateMany({}, { $pull: { likes: id } }) + await Comment.deleteMany({ user: id }) + + res.status(200).json({ message: "User has been successfully deleted!" }) + + } catch (error) { + console.log("Failed to delete user: " + error) + return res.status(500).json({ message: "Internal server error" }) + } +} \ No newline at end of file diff --git a/New_APIs/Blog_Platform/middlewares/authentication.js b/New_APIs/Blog_Platform/middlewares/authentication.js new file mode 100644 index 00000000..05010825 --- /dev/null +++ b/New_APIs/Blog_Platform/middlewares/authentication.js @@ -0,0 +1,29 @@ +require('dotenv').config(); +const jwt = require('jsonwebtoken') + +exports.Authenticate = (permissions = []) => { + return (req, res, next) => { + const token = req.headers['authorization'] + + if (!token) { + return res.status(401).json({message: 'Unauthorized access: Token is required!'}) + } + + jwt.verify(token, process.env.JWT_SECRET_KEY, (err, user) => { + if (err) { + if (err.name === 'TokenExpiredError') { + return res.status(401).json({message: 'Unauthorized access: Token has expired!'}) + } + else { + return res.status(401).json({message: 'Unauthorized access: Invalid token!'}) + } + } + console.log(user) + if (!permissions.every(role => user.roles.indexOf(role) !== -1)) { + return res.status(401).json({message: 'Unauthorized access: Insufficient permissions!'}) + } + req.user = user.userId + next() + }) + } +} \ No newline at end of file diff --git a/New_APIs/Blog_Platform/middlewares/validators.js b/New_APIs/Blog_Platform/middlewares/validators.js new file mode 100644 index 00000000..1387120c --- /dev/null +++ b/New_APIs/Blog_Platform/middlewares/validators.js @@ -0,0 +1,22 @@ +const { body } = require('express-validator') + +validateUserName = body('name') + .isLength({min: 4, max: 20}).withMessage('Name must be between 4 and 20 characters long!') + +validateEmail = body('email') + .isEmail().withMessage('Invalid email address!') + +validatePassword = body('password') + .isLength({min: 8, max: 20}).withMessage('Password must be between 8 and 20 characters long!') + +validateRoles = body('roles') + .optional() + .isArray().withMessage("Please send an array of roles!") + +validateAbout = body('about') + .optional() + .isLength({min: 0, max: 160}).withMessage('About must be less than 160 characters long!') + +exports.validateUserRequestBody = [validateUserName, validateEmail, validatePassword, validateAbout] + + diff --git a/New_APIs/Blog_Platform/models/Blog.js b/New_APIs/Blog_Platform/models/Blog.js new file mode 100644 index 00000000..8b632a82 --- /dev/null +++ b/New_APIs/Blog_Platform/models/Blog.js @@ -0,0 +1,22 @@ +const mongoose = require('mongoose'); + +const blogSchema = mongoose.Schema({ + title: { + type: String, + required: true + }, + content: { + type: String, + required: true + }, + user: { + type: mongoose.Schema.Types.ObjectId, + ref: 'User' + }, + tags: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Tag' }], + likes: [{ type: mongoose.Schema.Types.ObjectId, ref: 'User' }], + comments: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Comment' }] +}, { timestamps: true }) + +const Blog = mongoose.model('Blog', blogSchema) +module.exports = Blog \ No newline at end of file diff --git a/New_APIs/Blog_Platform/models/Comment.js b/New_APIs/Blog_Platform/models/Comment.js new file mode 100644 index 00000000..36e0645e --- /dev/null +++ b/New_APIs/Blog_Platform/models/Comment.js @@ -0,0 +1,19 @@ +const mongoose = require('mongoose') + +const commentSchema = mongoose.Schema({ + content: { + type: String, + required: true + }, + user: { + type: mongoose.Schema.Types.ObjectId, + ref: 'User' + }, + blog: { + type: mongoose.Schema.Types.ObjectId, + ref: 'Blog' + } +}, { timestamps: true }) + +const Comment = mongoose.model('Comment', commentSchema) +module.exports = Comment; \ No newline at end of file diff --git a/New_APIs/Blog_Platform/models/Tag.js b/New_APIs/Blog_Platform/models/Tag.js new file mode 100644 index 00000000..75f8367b --- /dev/null +++ b/New_APIs/Blog_Platform/models/Tag.js @@ -0,0 +1,11 @@ +const mongoose = require('mongoose'); + +const tagSchema = mongoose.Schema({ + tagName: { + type: String, + required: true + } +}) + +const Tag = mongoose.model('Tag', tagSchema) +module.exports = Tag \ No newline at end of file diff --git a/New_APIs/Blog_Platform/models/User.js b/New_APIs/Blog_Platform/models/User.js new file mode 100644 index 00000000..0cada03b --- /dev/null +++ b/New_APIs/Blog_Platform/models/User.js @@ -0,0 +1,31 @@ +const mongoose = require('mongoose'); + +const userSchema = mongoose.Schema({ + name: { + require: true, + type: String + }, + email: { + require: true, + type: String + }, + password: { + require: true, + type: String + }, + roles: { + type: Array + }, + about: { + require: true, + type: String + }, + status: { + require: true, + type: String + } +}, { timestamps: true }); + +const User = mongoose.model('User', userSchema) + +module.exports = User; \ No newline at end of file diff --git a/New_APIs/Blog_Platform/package.json b/New_APIs/Blog_Platform/package.json new file mode 100644 index 00000000..2263d8f3 --- /dev/null +++ b/New_APIs/Blog_Platform/package.json @@ -0,0 +1,11 @@ +{ + "dependencies": { + "bcrypt": "^5.1.1", + "body-parser": "^1.20.2", + "dotenv": "^16.4.5", + "express": "^4.18.3", + "express-validator": "^7.0.1", + "jsonwebtoken": "^9.0.2", + "mongoose": "^8.2.2" + } +} diff --git a/New_APIs/Blog_Platform/routes/authRouter.js b/New_APIs/Blog_Platform/routes/authRouter.js new file mode 100644 index 00000000..cfa6adf8 --- /dev/null +++ b/New_APIs/Blog_Platform/routes/authRouter.js @@ -0,0 +1,7 @@ +const express = require('express') +const authRouter = express.Router() +const authController = require('../controllers/authController') + +authRouter.use('/signin', authController.signIn) + +module.exports = authRouter; \ No newline at end of file diff --git a/New_APIs/Blog_Platform/routes/blogRoutes.js b/New_APIs/Blog_Platform/routes/blogRoutes.js new file mode 100644 index 00000000..0b74808f --- /dev/null +++ b/New_APIs/Blog_Platform/routes/blogRoutes.js @@ -0,0 +1,11 @@ +const express = require('express') +const blogRouter = express.Router() +const blogController = require('../controllers/blogController'); +const { Authenticate } = require('../middlewares/authentication'); + +blogRouter.post('/', Authenticate(["user"]), blogController.createBlog); +blogRouter.put('/:id', Authenticate(["user"]), blogController.updateBlog); +blogRouter.delete('/:id', Authenticate(["user"]), blogController.deleteBlog); +blogRouter.get('/', blogController.getBlogs); + +module.exports = blogRouter; \ No newline at end of file diff --git a/New_APIs/Blog_Platform/routes/commentRouter.js b/New_APIs/Blog_Platform/routes/commentRouter.js new file mode 100644 index 00000000..5b1266e0 --- /dev/null +++ b/New_APIs/Blog_Platform/routes/commentRouter.js @@ -0,0 +1,11 @@ +const express = require('express') +const commentRouter = express.Router() +const commentController = require('../controllers/commentController'); +const { Authenticate } = require('../middlewares/authentication'); + +commentRouter.post('/', Authenticate(['user']), commentController.addComment); +commentRouter.delete('/:id', Authenticate(['user']), commentController.deleteComment) +commentRouter.put('/:id', Authenticate(['user']), commentController.updateComment) +commentRouter.get('/', commentController.getCommentsByBlog) + +module.exports = commentRouter; diff --git a/New_APIs/Blog_Platform/routes/likeRoutes.js b/New_APIs/Blog_Platform/routes/likeRoutes.js new file mode 100644 index 00000000..5c89959f --- /dev/null +++ b/New_APIs/Blog_Platform/routes/likeRoutes.js @@ -0,0 +1,10 @@ +const express = require('express') +const likeRouter = express.Router() +const likeController = require('../controllers/likeController'); +const { Authenticate } = require('../middlewares/authentication'); + + +likeRouter.put('/', Authenticate(['user']), likeController.likeOrUnLike); +likeRouter.get('/:blogId', likeController.getLikesByBlog); + +module.exports = likeRouter; \ No newline at end of file diff --git a/New_APIs/Blog_Platform/routes/tagRoutes.js b/New_APIs/Blog_Platform/routes/tagRoutes.js new file mode 100644 index 00000000..49712101 --- /dev/null +++ b/New_APIs/Blog_Platform/routes/tagRoutes.js @@ -0,0 +1,11 @@ +const express = require('express') +const tagRouter = express.Router() +const tagController = require('../controllers/tagController'); +const { Authenticate } = require('../middlewares/authentication'); + +tagRouter.get('/', tagController.getTags); +tagRouter.post('/', Authenticate(['admin'], tagController.createTag)) +tagRouter.put('/:id', Authenticate(['admin'], tagController.updateTag)) +tagRouter.delete('/:id', Authenticate(['admin'], tagController.deleteTag)) + +module.exports = tagRouter; diff --git a/New_APIs/Blog_Platform/routes/userRoutes.js b/New_APIs/Blog_Platform/routes/userRoutes.js new file mode 100644 index 00000000..687ba8f7 --- /dev/null +++ b/New_APIs/Blog_Platform/routes/userRoutes.js @@ -0,0 +1,15 @@ +const express = require('express') +const userRouter = express.Router() +const userController = require('../controllers/userController') +const { validateUserRequestBody } = require('../middlewares/validators') +const { Authenticate } = require('../middlewares/authentication') + + +userRouter.post('/', validateUserRequestBody, userController.signUp) +userRouter.get('/:id', userController.getUserById); +userRouter.get('/', Authenticate(['admin']), userController.getAllUsers); +userRouter.put('/:id', Authenticate(['user']), userController.updateUser) +userRouter.delete('/:id', Authenticate(['user']), userController.deleteUser) + + +module.exports = userRouter; diff --git a/New_APIs/Blog_Platform/utils/generateToken.js b/New_APIs/Blog_Platform/utils/generateToken.js new file mode 100644 index 00000000..20114aef --- /dev/null +++ b/New_APIs/Blog_Platform/utils/generateToken.js @@ -0,0 +1,7 @@ +require('dotenv').config(); +const jwt = require('jsonwebtoken') + +exports.generateToken = (_userId, _roles) => { + const token = jwt.sign({ userId: _userId, roles: _roles }, process.env.JWT_SECRET_KEY, { expiresIn: '1d' }) + return token +} \ No newline at end of file diff --git a/New_APIs/Blog_Platform/utils/status.js b/New_APIs/Blog_Platform/utils/status.js new file mode 100644 index 00000000..704dea12 --- /dev/null +++ b/New_APIs/Blog_Platform/utils/status.js @@ -0,0 +1,4 @@ +exports.STATUS = { + ENABLE: "enabled", + DISABLE: "disbled" +} \ No newline at end of file diff --git a/New_APIs/Captcha Generator/Captcha Generator/READme.md b/New_APIs/Captcha Generator/Captcha Generator/READme.md new file mode 100644 index 00000000..d71743af --- /dev/null +++ b/New_APIs/Captcha Generator/Captcha Generator/READme.md @@ -0,0 +1,43 @@ +# Captcha Generator + +## Overview +The Captcha Generator is a security tool designed to create unique and unpredictable tests to differentiate between human users and automated bots. This project is developed using HTML, CSS, and JavaScript, ensuring a seamless integration into web applications with a focus on user-friendly design and robust functionality. + +## Features +* HTML Structure: Clear and semantic structure for Captcha elements. +* CSS Styling: Visually appealing and accessible design, with responsive layouts. +* JavaScript Functionality: Handles random challenge generation, user response validation, and feedback. + +## Installation +* Clone the repository: + +```bash +git clone https://github.com/yourusername/captcha-generator.git +``` + +* Navigate to the project directory: + +```bash +cd captcha-generator +``` + +* Open index.html in your preferred web browser. + +## Usage +* Generate Captcha: When the page loads, a new Captcha challenge is automatically generated. +* Solve Captcha: Enter your response in the input field provided. +* Submit: Click the submit button to validate your response. +* Feedback: You will receive immediate feedback indicating whether your response was correct or incorrect. + +## Project Structure + +```bash +captcha-generator/ +│ +├── index.html # Main HTML file +├── style.css # CSS file for styling +├── script.js # JavaScript file for functionality +``` +## Screenshots + +![alt text](image.png) \ No newline at end of file diff --git a/New_APIs/Captcha Generator/Captcha Generator/image.png b/New_APIs/Captcha Generator/Captcha Generator/image.png new file mode 100644 index 00000000..48daee21 Binary files /dev/null and b/New_APIs/Captcha Generator/Captcha Generator/image.png differ diff --git a/New_APIs/Captcha Generator/Captcha Generator/index.html b/New_APIs/Captcha Generator/Captcha Generator/index.html new file mode 100644 index 00000000..a65b3e22 --- /dev/null +++ b/New_APIs/Captcha Generator/Captcha Generator/index.html @@ -0,0 +1,33 @@ + + + + + + + + Captcha Generator + + + + + +
+
Captcha Generator
+
+ + +
+
+ +
+
Entered captcha is correct
+
+ +
+
+ + + + diff --git a/New_APIs/Captcha Generator/Captcha Generator/script.js b/New_APIs/Captcha Generator/Captcha Generator/script.js new file mode 100644 index 00000000..6c84c6cc --- /dev/null +++ b/New_APIs/Captcha Generator/Captcha Generator/script.js @@ -0,0 +1,57 @@ +// Selecting necessary DOM elements +const captchaTextBox = document.querySelector(".captch_box input"); +const refreshButton = document.querySelector(".refresh_button"); +const captchaInputBox = document.querySelector(".captch_input input"); +const message = document.querySelector(".message"); +const submitButton = document.querySelector(".button"); + +// Variable to store generated captcha +let captchaText = null; + +// Function to generate captcha +const generateCaptcha = () => { + const randomString = Math.random().toString(36).substring(2, 7); + const randomStringArray = randomString.split(""); + const changeString = randomStringArray.map((char) => (Math.random() > 0.5 ? char.toUpperCase() : char)); + captchaText = changeString.join(" "); + captchaTextBox.value = captchaText; + console.log(captchaText); +}; + +const refreshBtnClick = () => { + generateCaptcha(); + captchaInputBox.value = ""; + captchaKeyUpValidate(); +}; + +const captchaKeyUpValidate = () => { + //Toggle submit button disable class based on captcha input field. + submitButton.classList.toggle("disabled", !captchaInputBox.value); + + if (!captchaInputBox.value) message.classList.remove("active"); +}; + +// Function to validate the entered captcha +const submitBtnClick = () => { + captchaText = captchaText + .split("") + .filter((char) => char !== " ") + .join(""); + message.classList.add("active"); + // Check if the entered captcha text is correct or not + if (captchaInputBox.value === captchaText) { + message.innerText = "Entered captcha is correct"; + message.style.color = "#826afb"; + } else { + message.innerText = "Entered captcha is not correct"; + message.style.color = "#FF2525"; + } +}; + +// Add event listeners for the refresh button, captchaInputBox, submit button +refreshButton.addEventListener("click", refreshBtnClick); +captchaInputBox.addEventListener("keyup", captchaKeyUpValidate); +submitButton.addEventListener("click", submitBtnClick); + +// Generate a captcha when the page loads +generateCaptcha(); diff --git a/New_APIs/Captcha Generator/Captcha Generator/style.css b/New_APIs/Captcha Generator/Captcha Generator/style.css new file mode 100644 index 00000000..4f29d19c --- /dev/null +++ b/New_APIs/Captcha Generator/Captcha Generator/style.css @@ -0,0 +1,95 @@ +/* Import Google font - Poppins */ +@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap"); +* { + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: "Poppins", sans-serif; +} +body { + height: 100vh; + display: flex; + align-items: center; + justify-content: center; + background: #826afb; +} +.container { + position: relative; + max-width: 300px; + width: 100%; + border-radius: 12px; + padding: 15px 25px 25px; + background: #fff; + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1); +} +header { + color: #333; + margin-bottom: 20px; + font-size: 18px; + font-weight: 600; + text-align: center; +} +.input_field { + position: relative; + height: 45px; + margin-top: 15px; + width: 100%; +} +.refresh_button { + position: absolute; + top: 50%; + right: 10px; + transform: translateY(-50%); + background: #826afb; + height: 30px; + width: 30px; + border: none; + border-radius: 4px; + color: #fff; + cursor: pointer; +} +.refresh_button:active { + transform: translateY(-50%) scale(0.98); +} +.input_field input, +.button button { + height: 100%; + width: 100%; + outline: none; + border: none; + border-radius: 8px; +} +.input_field input { + padding: 0 15px; + border: 1px solid rgba(0, 0, 0, 0.1); +} +.captch_box input { + color: #6b6b6b; + font-size: 22px; + pointer-events: none; +} +.captch_input input:focus { + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08); +} +.message { + font-size: 14px; + margin: 14px 0; + color: #826afb; + display: none; +} +.message.active { + display: block; +} +.button button { + background: #826afb; + color: #fff; + cursor: pointer; + user-select: none; +} +.button button:active { + transform: scale(0.99); +} +.button.disabled { + opacity: 0.6; + pointer-events: none; +} diff --git a/New_APIs/Countries_API/README.md b/New_APIs/Countries_API/README.md new file mode 100644 index 00000000..d37dcf7f --- /dev/null +++ b/New_APIs/Countries_API/README.md @@ -0,0 +1,81 @@ +# Countries & Cities API + +## Description +This API provides detailed information about countries and their cities. You can retrieve data such as capital, language, currency, latitude, longitude, continent, and neighboring countries. Additionally, you can filter countries by language or currency, find neighboring countries of a specific country, and list all countries in a specific continent. + +## Features +1. Retrieve information about countries, including language, currency, latitude, longitude, continent, and neighboring countries. +2. Filter countries by language or currency. +3. Find neighboring countries of a specific country. +4. List all countries in a specific continent. + +## Requirements +- Node.js +- MongoDB +- Postman + +## Installation +1. Clone the Repository: + +```bash +git clone +cd +``` + +2.Install Dependencies: + +```bash +npm install +``` + +3. Setup MongoDB: + - Ensure MongoDB is installed and running on your local machine or a remote server. + - Create a new database and collection for storing country data. + +4. Start the Server: + +```bash +node server.js +``` + +## API Endpoints: + +1. Get All Countries: + +```http +GET /api/countries +``` + +2. Get Country by Name: + +```http +GET /api/countries/:name +``` + +3. Get Countries by Language: + +```http +GET /api/countries/language/:language +``` + +4. Get Countries by Currency: + +```http +GET /api/countries/currency/:currency +``` + +5. Get Neighboring Countries: + +```http +GET /api/countries/:name/neighbors +``` + +6. Get Countries by Continent: + +```http +GET /api/countries/continent/:continent +``` + +## Notes +- Ensure server is running at 5000. +- Use Postman or similar tools to test and interact with the API endpoints. \ No newline at end of file diff --git a/New_APIs/Countries_API/countries.js b/New_APIs/Countries_API/countries.js new file mode 100644 index 00000000..cb4811c2 --- /dev/null +++ b/New_APIs/Countries_API/countries.js @@ -0,0 +1,3316 @@ +module.exports = [ + { + "country": "Wallis and Futuna", + "capital": "Mata-Utu", + "language": "French", + "latitude": -13.3, + "longitude": -176.2, + "currency": "CFP franc", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Iceland", + "capital": "Reykjavik", + "language": "Icelandic", + "latitude": 65, + "longitude": -18, + "currency": "Icelandic króna", + "continent": "Europe", + "neighbors": [] + }, + { + "country": "Luxembourg", + "capital": "Luxembourg", + "language": "German", + "latitude": 49.75, + "longitude": 6.16666666, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "BEL", + "FRA", + "DEU" + ] + }, + { + "country": "Mali", + "capital": "Bamako", + "language": "French", + "latitude": 17, + "longitude": -4, + "currency": "West African CFA franc", + "continent": "Africa", + "neighbors": [ + "DZA", + "BFA", + "GIN", + "CIV", + "MRT", + "NER", + "SEN" + ] + }, + { + "country": "Comoros", + "capital": "Moroni", + "language": "Arabic", + "latitude": -12.16666666, + "longitude": 44.25, + "currency": "Comorian franc", + "continent": "Africa", + "neighbors": [] + }, + { + "country": "Australia", + "capital": "Canberra", + "language": "English", + "latitude": -27, + "longitude": 133, + "currency": "Australian dollar", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Estonia", + "capital": "Tallinn", + "language": "Estonian", + "latitude": 59, + "longitude": 26, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "LVA", + "RUS" + ] + }, + { + "country": "Canada", + "capital": "Ottawa", + "language": "English", + "latitude": 60, + "longitude": -95, + "currency": "Canadian dollar", + "continent": "North America", + "neighbors": [ + "USA" + ] + }, + { + "country": "Belarus", + "capital": "Minsk", + "language": "Belarusian", + "latitude": 53, + "longitude": 28, + "currency": "Belarusian ruble", + "continent": "Europe", + "neighbors": [ + "LVA", + "LTU", + "POL", + "RUS", + "UKR" + ] + }, + { + "country": "Guyana", + "capital": "Georgetown", + "language": "English", + "latitude": 5, + "longitude": -59, + "currency": "Guyanese dollar", + "continent": "South America", + "neighbors": [ + "BRA", + "SUR", + "VEN" + ] + }, + { + "country": "Gambia", + "capital": "Banjul", + "language": "English", + "latitude": 13.46666666, + "longitude": -16.56666666, + "currency": "dalasi", + "continent": "Africa", + "neighbors": [ + "SEN" + ] + }, + { + "country": "Tunisia", + "capital": "Tunis", + "language": "Arabic", + "latitude": 34, + "longitude": 9, + "currency": "Tunisian dinar", + "continent": "Africa", + "neighbors": [ + "DZA", + "LBY" + ] + }, + { + "country": "Cameroon", + "capital": "Yaoundé", + "language": "English", + "latitude": 6, + "longitude": 12, + "currency": "Central African CFA franc", + "continent": "Africa", + "neighbors": [ + "CAF", + "TCD", + "COG", + "GNQ", + "GAB", + "NGA" + ] + }, + { + "country": "Rwanda", + "capital": "Kigali", + "language": "English", + "latitude": -2, + "longitude": 30, + "currency": "Rwandan franc", + "continent": "Africa", + "neighbors": [ + "BDI", + "COD", + "TZA", + "UGA" + ] + }, + { + "country": "Cambodia", + "capital": "Phnom Penh", + "language": "Khmer", + "latitude": 13, + "longitude": 105, + "currency": "Cambodian riel", + "continent": "Asia", + "neighbors": [ + "LAO", + "THA", + "VNM" + ] + }, + { + "country": "Benin", + "capital": "Porto-Novo", + "language": "French", + "latitude": 9.5, + "longitude": 2.25, + "currency": "West African CFA franc", + "continent": "Africa", + "neighbors": [ + "BFA", + "NER", + "NGA", + "TGO" + ] + }, + { + "country": "Greece", + "capital": "Athens", + "language": "Greek", + "latitude": 39, + "longitude": 22, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "ALB", + "BGR", + "TUR", + "MKD" + ] + }, + { + "country": "South Korea", + "capital": "Seoul", + "language": "Korean", + "latitude": 37, + "longitude": 127.5, + "currency": "South Korean won", + "continent": "Asia", + "neighbors": [ + "PRK" + ] + }, + { + "country": "Mauritius", + "capital": "Port Louis", + "language": "English", + "latitude": -20.28333333, + "longitude": 57.55, + "currency": "Mauritian rupee", + "continent": "Africa", + "neighbors": [] + }, + { + "country": "United States Virgin Islands", + "capital": "Charlotte Amalie", + "language": "English", + "latitude": 18.35, + "longitude": -64.933333, + "currency": "United States dollar", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Åland Islands", + "capital": "Mariehamn", + "language": "Swedish", + "latitude": 60.116667, + "longitude": 19.9, + "currency": "Euro", + "continent": "Europe", + "neighbors": [] + }, + { + "country": "San Marino", + "capital": "City of San Marino", + "language": "Italian", + "latitude": 43.76666666, + "longitude": 12.41666666, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "ITA" + ] + }, + { + "country": "Maldives", + "capital": "Malé", + "language": "Maldivian", + "latitude": 3.25, + "longitude": 73, + "currency": "Maldivian rufiyaa", + "continent": "Asia", + "neighbors": [] + }, + { + "country": "Vanuatu", + "capital": "Port Vila", + "language": "Bislama", + "latitude": -16, + "longitude": 167, + "currency": "Vanuatu vatu", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Malawi", + "capital": "Lilongwe", + "language": "English", + "latitude": -13.5, + "longitude": 34, + "currency": "Malawian kwacha", + "continent": "Africa", + "neighbors": [ + "MOZ", + "TZA", + "ZMB" + ] + }, + { + "country": "Egypt", + "capital": "Cairo", + "language": "Arabic", + "latitude": 27, + "longitude": 30, + "currency": "Egyptian pound", + "continent": "Africa", + "neighbors": [ + "ISR", + "LBY", + "PSE", + "SDN" + ] + }, + { + "country": "Senegal", + "capital": "Dakar", + "language": "French", + "latitude": 14, + "longitude": -14, + "currency": "West African CFA franc", + "continent": "Africa", + "neighbors": [ + "GMB", + "GIN", + "GNB", + "MLI", + "MRT" + ] + }, + { + "country": "Georgia", + "capital": "Tbilisi", + "language": "Georgian", + "latitude": 42, + "longitude": 43.5, + "currency": "lari", + "continent": "Asia", + "neighbors": [ + "ARM", + "AZE", + "RUS", + "TUR" + ] + }, + { + "country": "New Zealand", + "capital": "Wellington", + "language": "English", + "latitude": -41, + "longitude": 174, + "currency": "New Zealand dollar", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Cape Verde", + "capital": "Praia", + "language": "Portuguese", + "latitude": 16.5388, + "longitude": -23.0418, + "currency": "Cape Verdean escudo", + "continent": "Africa", + "neighbors": [] + }, + { + "country": "Italy", + "capital": "Rome", + "language": "Italian", + "latitude": 42.83333333, + "longitude": 12.83333333, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "AUT", + "FRA", + "SMR", + "SVN", + "CHE", + "VAT" + ] + }, + { + "country": "Monaco", + "capital": "Monaco", + "language": "French", + "latitude": 43.73333333, + "longitude": 7.4, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "FRA" + ] + }, + { + "country": "Slovakia", + "capital": "Bratislava", + "language": "Slovak", + "latitude": 48.66666666, + "longitude": 19.5, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "AUT", + "CZE", + "HUN", + "POL", + "UKR" + ] + }, + { + "country": "Uruguay", + "capital": "Montevideo", + "language": "Spanish", + "latitude": -33, + "longitude": -56, + "currency": "Uruguayan peso", + "continent": "South America", + "neighbors": [ + "ARG", + "BRA" + ] + }, + { + "country": "Laos", + "capital": "Vientiane", + "language": "Lao", + "latitude": 18, + "longitude": 105, + "currency": "Lao kip", + "continent": "Asia", + "neighbors": [ + "MMR", + "KHM", + "CHN", + "THA", + "VNM" + ] + }, + { + "country": "Faroe Islands", + "capital": "Tórshavn", + "language": "Danish", + "latitude": 62, + "longitude": -7, + "currency": "Danish krone", + "continent": "Europe", + "neighbors": [] + }, + { + "country": "Niue", + "capital": "Alofi", + "language": "English", + "latitude": -19.03333333, + "longitude": -169.86666666, + "currency": "New Zealand dollar", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "North Macedonia", + "capital": "Skopje", + "language": "Macedonian", + "latitude": 41.83333333, + "longitude": 22, + "currency": "denar", + "continent": "Europe", + "neighbors": [ + "ALB", + "BGR", + "GRC", + "UNK", + "SRB" + ] + }, + { + "country": "Chile", + "capital": "Santiago", + "language": "Spanish", + "latitude": -30, + "longitude": -71, + "currency": "Chilean peso", + "continent": "South America", + "neighbors": [ + "ARG", + "BOL", + "PER" + ] + }, + { + "country": "Cyprus", + "capital": "Nicosia", + "language": "Greek", + "latitude": 35, + "longitude": 33, + "currency": "Euro", + "continent": "Europe", + "neighbors": [] + }, + { + "country": "Macau", + "capital": "N/A", + "language": "Portuguese", + "latitude": 22.16666666, + "longitude": 113.55, + "currency": "Macanese pataca", + "continent": "Asia", + "neighbors": [ + "CHN" + ] + }, + { + "country": "El Salvador", + "capital": "San Salvador", + "language": "Spanish", + "latitude": 13.83333333, + "longitude": -88.91666666, + "currency": "United States dollar", + "continent": "North America", + "neighbors": [ + "GTM", + "HND" + ] + }, + { + "country": "Jordan", + "capital": "Amman", + "language": "Arabic", + "latitude": 31, + "longitude": 36, + "currency": "Jordanian dinar", + "continent": "Asia", + "neighbors": [ + "IRQ", + "ISR", + "PSE", + "SAU", + "SYR" + ] + }, + { + "country": "Jamaica", + "capital": "Kingston", + "language": "English", + "latitude": 18.25, + "longitude": -77.5, + "currency": "Jamaican dollar", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Barbados", + "capital": "Bridgetown", + "language": "English", + "latitude": 13.16666666, + "longitude": -59.53333333, + "currency": "Barbadian dollar", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Western Sahara", + "capital": "El Aaiún", + "language": "Berber", + "latitude": 24.5, + "longitude": -13, + "currency": "Algerian dinar", + "continent": "Africa", + "neighbors": [ + "DZA", + "MRT", + "MAR" + ] + }, + { + "country": "Qatar", + "capital": "Doha", + "language": "Arabic", + "latitude": 25.5, + "longitude": 51.25, + "currency": "Qatari riyal", + "continent": "Asia", + "neighbors": [ + "SAU" + ] + }, + { + "country": "Guatemala", + "capital": "Guatemala City", + "language": "Spanish", + "latitude": 15.5, + "longitude": -90.25, + "currency": "Guatemalan quetzal", + "continent": "North America", + "neighbors": [ + "BLZ", + "SLV", + "HND", + "MEX" + ] + }, + { + "country": "Micronesia", + "capital": "Palikir", + "language": "English", + "latitude": 6.91666666, + "longitude": 158.25, + "currency": "United States dollar", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Montserrat", + "capital": "Plymouth", + "language": "English", + "latitude": 16.75, + "longitude": -62.2, + "currency": "Eastern Caribbean dollar", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Papua New Guinea", + "capital": "Port Moresby", + "language": "English", + "latitude": -6, + "longitude": 147, + "currency": "Papua New Guinean kina", + "continent": "Oceania", + "neighbors": [ + "IDN" + ] + }, + { + "country": "Brazil", + "capital": "Brasília", + "language": "Portuguese", + "latitude": -10, + "longitude": -55, + "currency": "Brazilian real", + "continent": "South America", + "neighbors": [ + "ARG", + "BOL", + "COL", + "GUF", + "GUY", + "PRY", + "PER", + "SUR", + "URY", + "VEN" + ] + }, + { + "country": "Lithuania", + "capital": "Vilnius", + "language": "Lithuanian", + "latitude": 56, + "longitude": 24, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "BLR", + "LVA", + "POL", + "RUS" + ] + }, + { + "country": "French Guiana", + "capital": "Cayenne", + "language": "French", + "latitude": 4, + "longitude": -53, + "currency": "Euro", + "continent": "South America", + "neighbors": [ + "BRA", + "SUR" + ] + }, + { + "country": "Moldova", + "capital": "Chișinău", + "language": "Romanian", + "latitude": 47, + "longitude": 29, + "currency": "Moldovan leu", + "continent": "Europe", + "neighbors": [ + "ROU", + "UKR" + ] + }, + { + "country": "Kyrgyzstan", + "capital": "Bishkek", + "language": "Kyrgyz", + "latitude": 41, + "longitude": 75, + "currency": "Kyrgyzstani som", + "continent": "Asia", + "neighbors": [ + "CHN", + "KAZ", + "TJK", + "UZB" + ] + }, + { + "country": "Curaçao", + "capital": "Willemstad", + "language": "English", + "latitude": 12.116667, + "longitude": -68.933333, + "currency": "Netherlands Antillean guilder", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Vietnam", + "capital": "Hanoi", + "language": "Vietnamese", + "latitude": 16.16666666, + "longitude": 107.83333333, + "currency": "Vietnamese đồng", + "continent": "Asia", + "neighbors": [ + "KHM", + "CHN", + "LAO" + ] + }, + { + "country": "Angola", + "capital": "Luanda", + "language": "Portuguese", + "latitude": -12.5, + "longitude": 18.5, + "currency": "Angolan kwanza", + "continent": "Africa", + "neighbors": [ + "COG", + "COD", + "ZMB", + "NAM" + ] + }, + { + "country": "Malaysia", + "capital": "Kuala Lumpur", + "language": "English", + "latitude": 2.5, + "longitude": 112.5, + "currency": "Malaysian ringgit", + "continent": "Asia", + "neighbors": [ + "BRN", + "IDN", + "THA" + ] + }, + { + "country": "Switzerland", + "capital": "Bern", + "language": "French", + "latitude": 47, + "longitude": 8, + "currency": "Swiss franc", + "continent": "Europe", + "neighbors": [ + "AUT", + "FRA", + "ITA", + "LIE", + "DEU" + ] + }, + { + "country": "Thailand", + "capital": "Bangkok", + "language": "Thai", + "latitude": 15, + "longitude": 100, + "currency": "Thai baht", + "continent": "Asia", + "neighbors": [ + "MMR", + "KHM", + "LAO", + "MYS" + ] + }, + { + "country": "Dominican Republic", + "capital": "Santo Domingo", + "language": "Spanish", + "latitude": 19, + "longitude": -70.66666666, + "currency": "Dominican peso", + "continent": "North America", + "neighbors": [ + "HTI" + ] + }, + { + "country": "Uzbekistan", + "capital": "Tashkent", + "language": "Russian", + "latitude": 41, + "longitude": 64, + "currency": "Uzbekistani soʻm", + "continent": "Asia", + "neighbors": [ + "AFG", + "KAZ", + "KGZ", + "TJK", + "TKM" + ] + }, + { + "country": "Chad", + "capital": "N'Djamena", + "language": "Arabic", + "latitude": 15, + "longitude": 19, + "currency": "Central African CFA franc", + "continent": "Africa", + "neighbors": [ + "CMR", + "CAF", + "LBY", + "NER", + "NGA", + "SDN" + ] + }, + { + "country": "Cocos (Keeling) Islands", + "capital": "West Island", + "language": "English", + "latitude": 12.1642, + "longitude": 96.871, + "currency": "Australian dollar", + "continent": "Asia", + "neighbors": [] + }, + { + "country": "Guinea", + "capital": "Conakry", + "language": "French", + "latitude": 11, + "longitude": -10, + "currency": "Guinean franc", + "continent": "Africa", + "neighbors": [ + "CIV", + "GNB", + "LBR", + "MLI", + "SEN", + "SLE" + ] + }, + { + "country": "Turks and Caicos Islands", + "capital": "Cockburn Town", + "language": "English", + "latitude": 21.75, + "longitude": -71.58333333, + "currency": "United States dollar", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Puerto Rico", + "capital": "San Juan", + "language": "English", + "latitude": 18.25, + "longitude": -66.5, + "currency": "United States dollar", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Bhutan", + "capital": "Thimphu", + "language": "Dzongkha", + "latitude": 27.5, + "longitude": 90.5, + "currency": "Bhutanese ngultrum", + "continent": "Asia", + "neighbors": [ + "CHN", + "IND" + ] + }, + { + "country": "Cayman Islands", + "capital": "George Town", + "language": "English", + "latitude": 19.3133, + "longitude": -81.2546, + "currency": "Cayman Islands dollar", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Marshall Islands", + "capital": "Majuro", + "language": "English", + "latitude": 9, + "longitude": 168, + "currency": "United States dollar", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Anguilla", + "capital": "The Valley", + "language": "English", + "latitude": 18.25, + "longitude": -63.16666666, + "currency": "Eastern Caribbean dollar", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Mauritania", + "capital": "Nouakchott", + "language": "Arabic", + "latitude": 20, + "longitude": -12, + "currency": "Mauritanian ouguiya", + "continent": "Africa", + "neighbors": [ + "DZA", + "MLI", + "SEN", + "ESH" + ] + }, + { + "country": "Norway", + "capital": "Oslo", + "language": "Norwegian Nynorsk", + "latitude": 62, + "longitude": 10, + "currency": "Norwegian krone", + "continent": "Europe", + "neighbors": [ + "FIN", + "SWE", + "RUS" + ] + }, + { + "country": "Martinique", + "capital": "Fort-de-France", + "language": "French", + "latitude": 14.666667, + "longitude": -61, + "currency": "Euro", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Israel", + "capital": "Jerusalem", + "language": "Arabic", + "latitude": 31.47, + "longitude": 35.13, + "currency": "Israeli new shekel", + "continent": "Asia", + "neighbors": [ + "EGY", + "JOR", + "LBN", + "PSE", + "SYR" + ] + }, + { + "country": "Saint Barthélemy", + "capital": "Gustavia", + "language": "French", + "latitude": 18.5, + "longitude": -63.41666666, + "currency": "Euro", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Ecuador", + "capital": "Quito", + "language": "Spanish", + "latitude": -2, + "longitude": -77.5, + "currency": "United States dollar", + "continent": "South America", + "neighbors": [ + "COL", + "PER" + ] + }, + { + "country": "Grenada", + "capital": "St. George's", + "language": "English", + "latitude": 12.11666666, + "longitude": -61.66666666, + "currency": "Eastern Caribbean dollar", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Croatia", + "capital": "Zagreb", + "language": "Croatian", + "latitude": 45.16666666, + "longitude": 15.5, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "BIH", + "HUN", + "MNE", + "SRB", + "SVN" + ] + }, + { + "country": "Brunei", + "capital": "Bandar Seri Begawan", + "language": "Malay", + "latitude": 4.5, + "longitude": 114.66666666, + "currency": "Brunei dollar", + "continent": "Asia", + "neighbors": [ + "MYS" + ] + }, + { + "country": "Iraq", + "capital": "Baghdad", + "language": "Arabic", + "latitude": 33, + "longitude": 44, + "currency": "Iraqi dinar", + "continent": "Asia", + "neighbors": [ + "IRN", + "JOR", + "KWT", + "SAU", + "SYR", + "TUR" + ] + }, + { + "country": "Japan", + "capital": "Tokyo", + "language": "Japanese", + "latitude": 36, + "longitude": 138, + "currency": "Japanese yen", + "continent": "Asia", + "neighbors": [] + }, + { + "country": "Lesotho", + "capital": "Maseru", + "language": "English", + "latitude": -29.5, + "longitude": 28.5, + "currency": "Lesotho loti", + "continent": "Africa", + "neighbors": [ + "ZAF" + ] + }, + { + "country": "Tuvalu", + "capital": "Funafuti", + "language": "English", + "latitude": -8, + "longitude": 178, + "currency": "Australian dollar", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Heard Island and McDonald Islands", + "capital": "N/A", + "language": "English", + "latitude": 53.0818, + "longitude": 73.5042, + "currency": "N/A", + "continent": "Antarctica", + "neighbors": [] + }, + { + "country": "Finland", + "capital": "Helsinki", + "language": "Finnish", + "latitude": 64, + "longitude": 26, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "NOR", + "SWE", + "RUS" + ] + }, + { + "country": "South Sudan", + "capital": "Juba", + "language": "English", + "latitude": 7, + "longitude": 30, + "currency": "South Sudanese pound", + "continent": "Africa", + "neighbors": [ + "CAF", + "COD", + "ETH", + "KEN", + "SDN", + "UGA" + ] + }, + { + "country": "United States Minor Outlying Islands", + "capital": "Washington DC", + "language": "English", + "latitude": 19.3, + "longitude": 166.633333, + "currency": "United States dollar", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Saint Helena, Ascension and Tristan da Cunha", + "capital": "Jamestown", + "language": "English", + "latitude": -15.95, + "longitude": -5.72, + "currency": "Pound sterling", + "continent": "Africa", + "neighbors": [] + }, + { + "country": "Afghanistan", + "capital": "Kabul", + "language": "Dari", + "latitude": 33, + "longitude": 65, + "currency": "Afghan afghani", + "continent": "Asia", + "neighbors": [ + "IRN", + "PAK", + "TKM", + "UZB", + "TJK", + "CHN" + ] + }, + { + "country": "Solomon Islands", + "capital": "Honiara", + "language": "English", + "latitude": -8, + "longitude": 159, + "currency": "Solomon Islands dollar", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "China", + "capital": "Beijing", + "language": "Chinese", + "latitude": 35, + "longitude": 105, + "currency": "Chinese yuan", + "continent": "Asia", + "neighbors": [ + "AFG", + "BTN", + "MMR", + "HKG", + "IND", + "KAZ", + "NPL", + "PRK", + "KGZ", + "LAO", + "MAC", + "MNG", + "PAK", + "RUS", + "TJK", + "VNM" + ] + }, + { + "country": "Eritrea", + "capital": "Asmara", + "language": "Arabic", + "latitude": 15, + "longitude": 39, + "currency": "Eritrean nakfa", + "continent": "Africa", + "neighbors": [ + "DJI", + "ETH", + "SDN" + ] + }, + { + "country": "Russia", + "capital": "Moscow", + "language": "Russian", + "latitude": 60, + "longitude": 100, + "currency": "Russian ruble", + "continent": "Europe", + "neighbors": [ + "AZE", + "BLR", + "CHN", + "EST", + "FIN", + "GEO", + "KAZ", + "PRK", + "LVA", + "LTU", + "MNG", + "NOR", + "POL", + "UKR" + ] + }, + { + "country": "Andorra", + "capital": "Andorra la Vella", + "language": "Catalan", + "latitude": 42.5, + "longitude": 1.5, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "FRA", + "ESP" + ] + }, + { + "country": "Armenia", + "capital": "Yerevan", + "language": "Armenian", + "latitude": 40, + "longitude": 45, + "currency": "Armenian dram", + "continent": "Asia", + "neighbors": [ + "AZE", + "GEO", + "IRN", + "TUR" + ] + }, + { + "country": "Austria", + "capital": "Vienna", + "language": "German", + "latitude": 47.33333333, + "longitude": 13.33333333, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "CZE", + "DEU", + "HUN", + "ITA", + "LIE", + "SVK", + "SVN", + "CHE" + ] + }, + { + "country": "Suriname", + "capital": "Paramaribo", + "language": "Dutch", + "latitude": 4, + "longitude": -56, + "currency": "Surinamese dollar", + "continent": "South America", + "neighbors": [ + "BRA", + "GUF", + "GUY" + ] + }, + { + "country": "Spain", + "capital": "Madrid", + "language": "Spanish", + "latitude": 40, + "longitude": -4, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "AND", + "FRA", + "GIB", + "PRT", + "MAR" + ] + }, + { + "country": "Tokelau", + "capital": "Fakaofo", + "language": "English", + "latitude": -9, + "longitude": -172, + "currency": "New Zealand dollar", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Bahamas", + "capital": "Nassau", + "language": "English", + "latitude": 25.0343, + "longitude": -77.3963, + "currency": "Bahamian dollar", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Sint Maarten", + "capital": "Philipsburg", + "language": "English", + "latitude": 18.033333, + "longitude": -63.05, + "currency": "Netherlands Antillean guilder", + "continent": "North America", + "neighbors": [ + "MAF" + ] + }, + { + "country": "Belize", + "capital": "Belmopan", + "language": "Belizean Creole", + "latitude": 17.25, + "longitude": -88.75, + "currency": "Belize dollar", + "continent": "North America", + "neighbors": [ + "GTM", + "MEX" + ] + }, + { + "country": "Jersey", + "capital": "Saint Helier", + "language": "English", + "latitude": 49.25, + "longitude": -2.16666666, + "currency": "British pound", + "continent": "Europe", + "neighbors": [] + }, + { + "country": "Sweden", + "capital": "Stockholm", + "language": "Swedish", + "latitude": 62, + "longitude": 15, + "currency": "Swedish krona", + "continent": "Europe", + "neighbors": [ + "FIN", + "NOR" + ] + }, + { + "country": "Botswana", + "capital": "Gaborone", + "language": "English", + "latitude": -22, + "longitude": 24, + "currency": "Botswana pula", + "continent": "Africa", + "neighbors": [ + "NAM", + "ZAF", + "ZMB", + "ZWE" + ] + }, + { + "country": "Isle of Man", + "capital": "Douglas", + "language": "English", + "latitude": 54.25, + "longitude": -4.5, + "currency": "British pound", + "continent": "Europe", + "neighbors": [] + }, + { + "country": "United Arab Emirates", + "capital": "Abu Dhabi", + "language": "Arabic", + "latitude": 24, + "longitude": 54, + "currency": "United Arab Emirates dirham", + "continent": "Asia", + "neighbors": [ + "OMN", + "SAU" + ] + }, + { + "country": "Iran", + "capital": "Tehran", + "language": "Persian (Farsi)", + "latitude": 32, + "longitude": 53, + "currency": "Iranian rial", + "continent": "Asia", + "neighbors": [ + "AFG", + "ARM", + "AZE", + "IRQ", + "PAK", + "TUR", + "TKM" + ] + }, + { + "country": "Gabon", + "capital": "Libreville", + "language": "French", + "latitude": -1, + "longitude": 11.75, + "currency": "Central African CFA franc", + "continent": "Africa", + "neighbors": [ + "CMR", + "COG", + "GNQ" + ] + }, + { + "country": "Saint Kitts and Nevis", + "capital": "Basseterre", + "language": "English", + "latitude": 17.33333333, + "longitude": -62.75, + "currency": "Eastern Caribbean dollar", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Equatorial Guinea", + "capital": "Malabo", + "language": "French", + "latitude": 2, + "longitude": 10, + "currency": "Central African CFA franc", + "continent": "Africa", + "neighbors": [ + "CMR", + "GAB" + ] + }, + { + "country": "São Tomé and Príncipe", + "capital": "São Tomé", + "language": "Portuguese", + "latitude": 1, + "longitude": 7, + "currency": "São Tomé and Príncipe dobra", + "continent": "Africa", + "neighbors": [] + }, + { + "country": "Greenland", + "capital": "Nuuk", + "language": "Greenlandic", + "latitude": 72, + "longitude": -40, + "currency": "krone", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Bangladesh", + "capital": "Dhaka", + "language": "Bengali", + "latitude": 24, + "longitude": 90, + "currency": "Bangladeshi taka", + "continent": "Asia", + "neighbors": [ + "MMR", + "IND" + ] + }, + { + "country": "Romania", + "capital": "Bucharest", + "language": "Romanian", + "latitude": 46, + "longitude": 25, + "currency": "Romanian leu", + "continent": "Europe", + "neighbors": [ + "BGR", + "HUN", + "MDA", + "SRB", + "UKR" + ] + }, + { + "country": "British Indian Ocean Territory", + "capital": "Diego Garcia", + "language": "English", + "latitude": -6, + "longitude": 71.5, + "currency": "United States dollar", + "continent": "Asia", + "neighbors": [] + }, + { + "country": "Sudan", + "capital": "Khartoum", + "language": "Arabic", + "latitude": 15, + "longitude": 30, + "currency": "Sudanese pound", + "continent": "Africa", + "neighbors": [ + "CAF", + "TCD", + "EGY", + "ERI", + "ETH", + "LBY", + "SSD" + ] + }, + { + "country": "Bosnia and Herzegovina", + "capital": "Sarajevo", + "language": "Bosnian", + "latitude": 44, + "longitude": 18, + "currency": "Bosnia and Herzegovina convertible mark", + "continent": "Europe", + "neighbors": [ + "HRV", + "MNE", + "SRB" + ] + }, + { + "country": "Malta", + "capital": "Valletta", + "language": "English", + "latitude": 35.9375, + "longitude": 14.3754, + "currency": "Euro", + "continent": "Europe", + "neighbors": [] + }, + { + "country": "Seychelles", + "capital": "Victoria", + "language": "Seychellois Creole", + "latitude": -4.58333333, + "longitude": 55.66666666, + "currency": "Seychellois rupee", + "continent": "Africa", + "neighbors": [] + }, + { + "country": "Sri Lanka", + "capital": "Sri Jayawardenepura Kotte", + "language": "Sinhala", + "latitude": 7, + "longitude": 81, + "currency": "Sri Lankan rupee", + "continent": "Asia", + "neighbors": [ + "IND" + ] + }, + { + "country": "Mexico", + "capital": "Mexico City", + "language": "Spanish", + "latitude": 23, + "longitude": -102, + "currency": "Mexican peso", + "continent": "North America", + "neighbors": [ + "BLZ", + "GTM", + "USA" + ] + }, + { + "country": "Yemen", + "capital": "Sana'a", + "language": "Arabic", + "latitude": 15, + "longitude": 48, + "currency": "Yemeni rial", + "continent": "Asia", + "neighbors": [ + "OMN", + "SAU" + ] + }, + { + "country": "British Virgin Islands", + "capital": "Road Town", + "language": "English", + "latitude": 18.431383, + "longitude": -64.62305, + "currency": "United States dollar", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Netherlands", + "capital": "Amsterdam", + "language": "Dutch", + "latitude": 52.5, + "longitude": 5.75, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "BEL", + "DEU" + ] + }, + { + "country": "Paraguay", + "capital": "Asunción", + "language": "Guaraní", + "latitude": -23, + "longitude": -58, + "currency": "Paraguayan guaraní", + "continent": "South America", + "neighbors": [ + "ARG", + "BOL", + "BRA" + ] + }, + { + "country": "United Kingdom", + "capital": "London", + "language": "English", + "latitude": 54, + "longitude": -2, + "currency": "British pound", + "continent": "Europe", + "neighbors": [ + "IRL" + ] + }, + { + "country": "Venezuela", + "capital": "Caracas", + "language": "Spanish", + "latitude": 8, + "longitude": -66, + "currency": "Venezuelan bolívar soberano", + "continent": "South America", + "neighbors": [ + "BRA", + "COL", + "GUY" + ] + }, + { + "country": "Bouvet Island", + "capital": "N/A", + "language": "Norwegian", + "latitude": 54.4208, + "longitude": 3.3464, + "currency": "N/A", + "continent": "Antarctica", + "neighbors": [] + }, + { + "country": "Ukraine", + "capital": "Kyiv", + "language": "Ukrainian", + "latitude": 49, + "longitude": 32, + "currency": "Ukrainian hryvnia", + "continent": "Europe", + "neighbors": [ + "BLR", + "HUN", + "MDA", + "POL", + "ROU", + "RUS", + "SVK" + ] + }, + { + "country": "Morocco", + "capital": "Rabat", + "language": "Arabic", + "latitude": 32, + "longitude": -5, + "currency": "Moroccan dirham", + "continent": "Africa", + "neighbors": [ + "DZA", + "ESH", + "ESP" + ] + }, + { + "country": "Portugal", + "capital": "Lisbon", + "language": "Portuguese", + "latitude": 39.5, + "longitude": -8, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "ESP" + ] + }, + { + "country": "Pakistan", + "capital": "Islamabad", + "language": "English", + "latitude": 30, + "longitude": 70, + "currency": "Pakistani rupee", + "continent": "Asia", + "neighbors": [ + "AFG", + "CHN", + "IND", + "IRN" + ] + }, + { + "country": "Saint Vincent and the Grenadines", + "capital": "Kingstown", + "language": "English", + "latitude": 13.25, + "longitude": -61.2, + "currency": "Eastern Caribbean dollar", + "continent": "North America", + "neighbors": [] + }, + { + "country": "North Korea", + "capital": "Pyongyang", + "language": "Korean", + "latitude": 40, + "longitude": 127, + "currency": "North Korean won", + "continent": "Asia", + "neighbors": [ + "CHN", + "KOR", + "RUS" + ] + }, + { + "country": "Slovenia", + "capital": "Ljubljana", + "language": "Slovene", + "latitude": 46.11666666, + "longitude": 14.81666666, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "AUT", + "HRV", + "ITA", + "HUN" + ] + }, + { + "country": "Ivory Coast", + "capital": "Yamoussoukro", + "language": "French", + "latitude": 8, + "longitude": -5, + "currency": "West African CFA franc", + "continent": "Africa", + "neighbors": [ + "BFA", + "GHA", + "GIN", + "LBR", + "MLI" + ] + }, + { + "country": "Palestine", + "capital": "Ramallah", + "language": "Arabic", + "latitude": 31.9, + "longitude": 35.2, + "currency": "Egyptian pound", + "continent": "Asia", + "neighbors": [ + "ISR", + "EGY", + "JOR" + ] + }, + { + "country": "Caribbean Netherlands", + "capital": "Kralendijk", + "language": "English", + "latitude": 12.18, + "longitude": -68.25, + "currency": "United States dollar", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Belgium", + "capital": "Brussels", + "language": "German", + "latitude": 50.83333333, + "longitude": 4, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "FRA", + "DEU", + "LUX", + "NLD" + ] + }, + { + "country": "Zimbabwe", + "capital": "Harare", + "language": "Chibarwe", + "latitude": -20, + "longitude": 30, + "currency": "Zimbabwean dollar", + "continent": "Africa", + "neighbors": [ + "BWA", + "MOZ", + "ZAF", + "ZMB" + ] + }, + { + "country": "Tanzania", + "capital": "Dodoma", + "language": "English", + "latitude": -6, + "longitude": 35, + "currency": "Tanzanian shilling", + "continent": "Africa", + "neighbors": [ + "BDI", + "COD", + "KEN", + "MWI", + "MOZ", + "RWA", + "UGA", + "ZMB" + ] + }, + { + "country": "Togo", + "capital": "Lomé", + "language": "French", + "latitude": 8, + "longitude": 1.16666666, + "currency": "West African CFA franc", + "continent": "Africa", + "neighbors": [ + "BEN", + "BFA", + "GHA" + ] + }, + { + "country": "Cook Islands", + "capital": "Avarua", + "language": "English", + "latitude": -21.23333333, + "longitude": -159.76666666, + "currency": "Cook Islands dollar", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Guadeloupe", + "capital": "Basse-Terre", + "language": "French", + "latitude": 16.25, + "longitude": -61.583333, + "currency": "Euro", + "continent": "North America", + "neighbors": [] + }, + { + "country": "New Caledonia", + "capital": "Nouméa", + "language": "French", + "latitude": -21.5, + "longitude": 165.5, + "currency": "CFP franc", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Saint Lucia", + "capital": "Castries", + "language": "English", + "latitude": 13.88333333, + "longitude": -60.96666666, + "currency": "Eastern Caribbean dollar", + "continent": "North America", + "neighbors": [] + }, + { + "country": "South Georgia", + "capital": "King Edward Point", + "language": "English", + "latitude": -54.5, + "longitude": -37, + "currency": "Saint Helena pound", + "continent": "Antarctica", + "neighbors": [] + }, + { + "country": "Poland", + "capital": "Warsaw", + "language": "Polish", + "latitude": 52, + "longitude": 20, + "currency": "Polish złoty", + "continent": "Europe", + "neighbors": [ + "BLR", + "CZE", + "DEU", + "LTU", + "RUS", + "SVK", + "UKR" + ] + }, + { + "country": "Samoa", + "capital": "Apia", + "language": "English", + "latitude": -13.58333333, + "longitude": -172.33333333, + "currency": "Samoan tālā", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Czechia", + "capital": "Prague", + "language": "Czech", + "latitude": 49.75, + "longitude": 15.5, + "currency": "Czech koruna", + "continent": "Europe", + "neighbors": [ + "AUT", + "DEU", + "POL", + "SVK" + ] + }, + { + "country": "Indonesia", + "capital": "Jakarta", + "language": "Indonesian", + "latitude": -5, + "longitude": 120, + "currency": "Indonesian rupiah", + "continent": "Asia", + "neighbors": [ + "TLS", + "MYS", + "PNG" + ] + }, + { + "country": "Bolivia", + "capital": "Sucre", + "language": "Aymara", + "latitude": -17, + "longitude": -65, + "currency": "Bolivian boliviano", + "continent": "South America", + "neighbors": [ + "ARG", + "BRA", + "CHL", + "PRY", + "PER" + ] + }, + { + "country": "Colombia", + "capital": "Bogotá", + "language": "Spanish", + "latitude": 4, + "longitude": -72, + "currency": "Colombian peso", + "continent": "South America", + "neighbors": [ + "BRA", + "ECU", + "PAN", + "PER", + "VEN" + ] + }, + { + "country": "Honduras", + "capital": "Tegucigalpa", + "language": "Spanish", + "latitude": 15, + "longitude": -86.5, + "currency": "Honduran lempira", + "continent": "North America", + "neighbors": [ + "GTM", + "SLV", + "NIC" + ] + }, + { + "country": "Denmark", + "capital": "Copenhagen", + "language": "Danish", + "latitude": 56, + "longitude": 10, + "currency": "Danish krone", + "continent": "Europe", + "neighbors": [ + "DEU" + ] + }, + { + "country": "Central African Republic", + "capital": "Bangui", + "language": "French", + "latitude": 7, + "longitude": 21, + "currency": "Central African CFA franc", + "continent": "Africa", + "neighbors": [ + "CMR", + "TCD", + "COD", + "COG", + "SSD", + "SDN" + ] + }, + { + "country": "Libya", + "capital": "Tripoli", + "language": "Arabic", + "latitude": 25, + "longitude": 17, + "currency": "Libyan dinar", + "continent": "Africa", + "neighbors": [ + "DZA", + "TCD", + "EGY", + "NER", + "SDN", + "TUN" + ] + }, + { + "country": "Guinea-Bissau", + "capital": "Bissau", + "language": "Portuguese", + "latitude": 12, + "longitude": -15, + "currency": "West African CFA franc", + "continent": "Africa", + "neighbors": [ + "GIN", + "SEN" + ] + }, + { + "country": "Mongolia", + "capital": "Ulan Bator", + "language": "Mongolian", + "latitude": 46, + "longitude": 105, + "currency": "Mongolian tögrög", + "continent": "Asia", + "neighbors": [ + "CHN", + "RUS" + ] + }, + { + "country": "DR Congo", + "capital": "Kinshasa", + "language": "French", + "latitude": 0, + "longitude": 25, + "currency": "Congolese franc", + "continent": "Africa", + "neighbors": [ + "AGO", + "BDI", + "CAF", + "COG", + "RWA", + "SSD", + "TZA", + "UGA", + "ZMB" + ] + }, + { + "country": "Falkland Islands", + "capital": "Stanley", + "language": "English", + "latitude": -51.75, + "longitude": -59, + "currency": "Falkland Islands pound", + "continent": "South America", + "neighbors": [] + }, + { + "country": "Nauru", + "capital": "Yaren", + "language": "English", + "latitude": -0.53333333, + "longitude": 166.91666666, + "currency": "Australian dollar", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Syria", + "capital": "Damascus", + "language": "Arabic", + "latitude": 35, + "longitude": 38, + "currency": "Syrian pound", + "continent": "Asia", + "neighbors": [ + "IRQ", + "ISR", + "JOR", + "LBN", + "TUR" + ] + }, + { + "country": "Montenegro", + "capital": "Podgorica", + "language": "Montenegrin", + "latitude": 42.5, + "longitude": 19.3, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "ALB", + "BIH", + "HRV", + "UNK", + "SRB" + ] + }, + { + "country": "France", + "capital": "Paris", + "language": "French", + "latitude": 46, + "longitude": 2, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "AND", + "BEL", + "DEU", + "ITA", + "LUX", + "MCO", + "ESP", + "CHE" + ] + }, + { + "country": "Zambia", + "capital": "Lusaka", + "language": "English", + "latitude": -15, + "longitude": 30, + "currency": "Zambian kwacha", + "continent": "Africa", + "neighbors": [ + "AGO", + "BWA", + "COD", + "MWI", + "MOZ", + "NAM", + "TZA", + "ZWE" + ] + }, + { + "country": "Myanmar", + "capital": "Naypyidaw", + "language": "Burmese", + "latitude": 22, + "longitude": 98, + "currency": "Burmese kyat", + "continent": "Asia", + "neighbors": [ + "BGD", + "CHN", + "IND", + "LAO", + "THA" + ] + }, + { + "country": "Saint Pierre and Miquelon", + "capital": "Saint-Pierre", + "language": "French", + "latitude": 46.83333333, + "longitude": -56.33333333, + "currency": "Euro", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Costa Rica", + "capital": "San José", + "language": "Spanish", + "latitude": 10, + "longitude": -84, + "currency": "Costa Rican colón", + "continent": "North America", + "neighbors": [ + "NIC", + "PAN" + ] + }, + { + "country": "Somalia", + "capital": "Mogadishu", + "language": "Arabic", + "latitude": 10, + "longitude": 49, + "currency": "Somali shilling", + "continent": "Africa", + "neighbors": [ + "DJI", + "ETH", + "KEN" + ] + }, + { + "country": "Ireland", + "capital": "Dublin", + "language": "English", + "latitude": 53, + "longitude": -8, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "GBR" + ] + }, + { + "country": "French Polynesia", + "capital": "Papeetē", + "language": "French", + "latitude": 17.6797, + "longitude": 149.4068, + "currency": "CFP franc", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Pitcairn Islands", + "capital": "Adamstown", + "language": "English", + "latitude": -25.06666666, + "longitude": -130.1, + "currency": "New Zealand dollar", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Hungary", + "capital": "Budapest", + "language": "Hungarian", + "latitude": 47, + "longitude": 20, + "currency": "Hungarian forint", + "continent": "Europe", + "neighbors": [ + "AUT", + "HRV", + "ROU", + "SRB", + "SVK", + "SVN", + "UKR" + ] + }, + { + "country": "Turkey", + "capital": "Ankara", + "language": "Turkish", + "latitude": 39, + "longitude": 35, + "currency": "Turkish lira", + "continent": "Europe", + "neighbors": [ + "ARM", + "AZE", + "BGR", + "GEO", + "GRC", + "IRN", + "IRQ", + "SYR" + ] + }, + { + "country": "Oman", + "capital": "Muscat", + "language": "Arabic", + "latitude": 21, + "longitude": 57, + "currency": "Omani rial", + "continent": "Asia", + "neighbors": [ + "SAU", + "ARE", + "YEM" + ] + }, + { + "country": "Guam", + "capital": "Hagåtña", + "language": "Chamorro", + "latitude": 13.46666666, + "longitude": 144.78333333, + "currency": "United States dollar", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Nepal", + "capital": "Kathmandu", + "language": "Nepali", + "latitude": 28, + "longitude": 84, + "currency": "Nepalese rupee", + "continent": "Asia", + "neighbors": [ + "CHN", + "IND" + ] + }, + { + "country": "Liechtenstein", + "capital": "Vaduz", + "language": "German", + "latitude": 47.26666666, + "longitude": 9.53333333, + "currency": "Swiss franc", + "continent": "Europe", + "neighbors": [ + "AUT", + "CHE" + ] + }, + { + "country": "Madagascar", + "capital": "Antananarivo", + "language": "French", + "latitude": -20, + "longitude": 47, + "currency": "Malagasy ariary", + "continent": "Africa", + "neighbors": [] + }, + { + "country": "Kazakhstan", + "capital": "Nur-Sultan", + "language": "Kazakh", + "latitude": 48.0196, + "longitude": 66.9237, + "currency": "Kazakhstani tenge", + "continent": "Asia", + "neighbors": [ + "CHN", + "KGZ", + "RUS", + "TKM", + "UZB" + ] + }, + { + "country": "Djibouti", + "capital": "Djibouti", + "language": "Arabic", + "latitude": 11.5, + "longitude": 43, + "currency": "Djiboutian franc", + "continent": "Africa", + "neighbors": [ + "ERI", + "ETH", + "SOM" + ] + }, + { + "country": "Gibraltar", + "capital": "Gibraltar", + "language": "English", + "latitude": 36.13333333, + "longitude": -5.35, + "currency": "Gibraltar pound", + "continent": "Europe", + "neighbors": [ + "ESP" + ] + }, + { + "country": "Guernsey", + "capital": "St. Peter Port", + "language": "English", + "latitude": 49.46666666, + "longitude": -2.58333333, + "currency": "British pound", + "continent": "Europe", + "neighbors": [] + }, + { + "country": "Namibia", + "capital": "Windhoek", + "language": "Afrikaans", + "latitude": -22, + "longitude": 17, + "currency": "Namibian dollar", + "continent": "Africa", + "neighbors": [ + "AGO", + "BWA", + "ZAF", + "ZMB" + ] + }, + { + "country": "Republic of the Congo", + "capital": "Brazzaville", + "language": "French", + "latitude": -1, + "longitude": 15, + "currency": "Central African CFA franc", + "continent": "Africa", + "neighbors": [ + "AGO", + "CMR", + "CAF", + "COD", + "GAB" + ] + }, + { + "country": "Germany", + "capital": "Berlin", + "language": "German", + "latitude": 51, + "longitude": 9, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "AUT", + "BEL", + "CZE", + "DNK", + "FRA", + "LUX", + "NLD", + "POL", + "CHE" + ] + }, + { + "country": "Vatican City", + "capital": "Vatican City", + "language": "Italian", + "latitude": 41.9, + "longitude": 12.45, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "ITA" + ] + }, + { + "country": "French Southern and Antarctic Lands", + "capital": "Port-aux-Français", + "language": "French", + "latitude": -49.25, + "longitude": 69.167, + "currency": "Euro", + "continent": "Antarctica", + "neighbors": [] + }, + { + "country": "Albania", + "capital": "Tirana", + "language": "Albanian", + "latitude": 41, + "longitude": 20, + "currency": "Albanian lek", + "continent": "Europe", + "neighbors": [ + "MNE", + "GRC", + "MKD", + "UNK" + ] + }, + { + "country": "Algeria", + "capital": "Algiers", + "language": "Arabic", + "latitude": 28, + "longitude": 3, + "currency": "Algerian dinar", + "continent": "Africa", + "neighbors": [ + "TUN", + "LBY", + "NER", + "ESH", + "MRT", + "MLI", + "MAR" + ] + }, + { + "country": "Mayotte", + "capital": "Mamoudzou", + "language": "French", + "latitude": -12.83333333, + "longitude": 45.16666666, + "currency": "Euro", + "continent": "Africa", + "neighbors": [] + }, + { + "country": "Haiti", + "capital": "Port-au-Prince", + "language": "French", + "latitude": 19, + "longitude": -72.41666666, + "currency": "Haitian gourde", + "continent": "North America", + "neighbors": [ + "DOM" + ] + }, + { + "country": "Svalbard and Jan Mayen", + "capital": "Longyearbyen", + "language": "Norwegian", + "latitude": 78, + "longitude": 20, + "currency": "krone", + "continent": "Europe", + "neighbors": [] + }, + { + "country": "Tonga", + "capital": "Nuku'alofa", + "language": "English", + "latitude": -20, + "longitude": -175, + "currency": "Tongan paʻanga", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Hong Kong", + "capital": "City of Victoria", + "language": "English", + "latitude": 22.267, + "longitude": 114.188, + "currency": "Hong Kong dollar", + "continent": "Asia", + "neighbors": [ + "CHN" + ] + }, + { + "country": "Singapore", + "capital": "Singapore", + "language": "English", + "latitude": 1.36666666, + "longitude": 103.8, + "currency": "Singapore dollar", + "continent": "Asia", + "neighbors": [] + }, + { + "country": "Antigua and Barbuda", + "capital": "Saint John's", + "language": "English", + "latitude": 17.05, + "longitude": -61.8, + "currency": "Eastern Caribbean dollar", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Saudi Arabia", + "capital": "Riyadh", + "language": "Arabic", + "latitude": 25, + "longitude": 45, + "currency": "Saudi riyal", + "continent": "Asia", + "neighbors": [ + "IRQ", + "JOR", + "KWT", + "OMN", + "QAT", + "ARE", + "YEM" + ] + }, + { + "country": "Cuba", + "capital": "Havana", + "language": "Spanish", + "latitude": 21.5, + "longitude": -80, + "currency": "Cuban convertible peso", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Panama", + "capital": "Panama City", + "language": "Spanish", + "latitude": 9, + "longitude": -80, + "currency": "Panamanian balboa", + "continent": "North America", + "neighbors": [ + "COL", + "CRI" + ] + }, + { + "country": "Liberia", + "capital": "Monrovia", + "language": "English", + "latitude": 6.5, + "longitude": -9.5, + "currency": "Liberian dollar", + "continent": "Africa", + "neighbors": [ + "GIN", + "CIV", + "SLE" + ] + }, + { + "country": "Azerbaijan", + "capital": "Baku", + "language": "Azerbaijani", + "latitude": 40.5, + "longitude": 47.5, + "currency": "Azerbaijani manat", + "continent": "Europe", + "neighbors": [ + "ARM", + "GEO", + "IRN", + "RUS", + "TUR" + ] + }, + { + "country": "Latvia", + "capital": "Riga", + "language": "Latvian", + "latitude": 57, + "longitude": 25, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "BLR", + "EST", + "LTU", + "RUS" + ] + }, + { + "country": "Antarctica", + "capital": "N/A", + "language": "N/A", + "latitude": -90, + "longitude": 0, + "currency": "N/A", + "continent": "Antarctica", + "neighbors": [] + }, + { + "country": "Kiribati", + "capital": "South Tarawa", + "language": "English", + "latitude": 1.41666666, + "longitude": 173, + "currency": "Australian dollar", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Ethiopia", + "capital": "Addis Ababa", + "language": "Amharic", + "latitude": 8, + "longitude": 38, + "currency": "Ethiopian birr", + "continent": "Africa", + "neighbors": [ + "DJI", + "ERI", + "KEN", + "SOM", + "SSD", + "SDN" + ] + }, + { + "country": "Niger", + "capital": "Niamey", + "language": "French", + "latitude": 16, + "longitude": 8, + "currency": "West African CFA franc", + "continent": "Africa", + "neighbors": [ + "DZA", + "BEN", + "BFA", + "TCD", + "LBY", + "MLI", + "NGA" + ] + }, + { + "country": "Trinidad and Tobago", + "capital": "Port of Spain", + "language": "English", + "latitude": 10.6918, + "longitude": -61.2225, + "currency": "Trinidad and Tobago dollar", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Sierra Leone", + "capital": "Freetown", + "language": "English", + "latitude": 8.5, + "longitude": -11.5, + "currency": "Sierra Leonean leone", + "continent": "Africa", + "neighbors": [ + "GIN", + "LBR" + ] + }, + { + "country": "Mozambique", + "capital": "Maputo", + "language": "Portuguese", + "latitude": -18.25, + "longitude": 35, + "currency": "Mozambican metical", + "continent": "Africa", + "neighbors": [ + "MWI", + "ZAF", + "SWZ", + "TZA", + "ZMB", + "ZWE" + ] + }, + { + "country": "Palau", + "capital": "Ngerulmud", + "language": "English", + "latitude": 7.5, + "longitude": 134.5, + "currency": "United States dollar", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Fiji", + "capital": "Suva", + "language": "English", + "latitude": 17.7134, + "longitude": 178.065, + "currency": "Fijian dollar", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Réunion", + "capital": "Saint-Denis", + "language": "French", + "latitude": -21.15, + "longitude": 55.5, + "currency": "Euro", + "continent": "Africa", + "neighbors": [] + }, + { + "country": "Norfolk Island", + "capital": "Kingston", + "language": "English", + "latitude": -29.03333333, + "longitude": 167.95, + "currency": "Australian dollar", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Turkmenistan", + "capital": "Ashgabat", + "language": "Russian", + "latitude": 40, + "longitude": 60, + "currency": "Turkmenistan manat", + "continent": "Asia", + "neighbors": [ + "AFG", + "IRN", + "KAZ", + "UZB" + ] + }, + { + "country": "Tajikistan", + "capital": "Dushanbe", + "language": "Russian", + "latitude": 39, + "longitude": 71, + "currency": "Tajikistani somoni", + "continent": "Asia", + "neighbors": [ + "AFG", + "CHN", + "KGZ", + "UZB" + ] + }, + { + "country": "Lebanon", + "capital": "Beirut", + "language": "Arabic", + "latitude": 33.83333333, + "longitude": 35.83333333, + "currency": "Lebanese pound", + "continent": "Asia", + "neighbors": [ + "ISR", + "SYR" + ] + }, + { + "country": "Nigeria", + "capital": "Abuja", + "language": "English", + "latitude": 10, + "longitude": 8, + "currency": "Nigerian naira", + "continent": "Africa", + "neighbors": [ + "BEN", + "CMR", + "TCD", + "NER" + ] + }, + { + "country": "United States of America", + "capital": "Washington, D.C.", + "language": "English", + "latitude": 38, + "longitude": -97, + "currency": "United States dollar", + "continent": "North America", + "neighbors": [ + "CAN", + "MEX" + ] + }, + { + "country": "Argentina", + "capital": "Buenos Aires", + "language": "Guaraní", + "latitude": -34, + "longitude": -64, + "currency": "Argentine peso", + "continent": "South America", + "neighbors": [ + "BOL", + "BRA", + "CHL", + "PRY", + "URY" + ] + }, + { + "country": "Burkina Faso", + "capital": "Ouagadougou", + "language": "French", + "latitude": 13, + "longitude": -2, + "currency": "West African CFA franc", + "continent": "Africa", + "neighbors": [ + "BEN", + "CIV", + "GHA", + "MLI", + "NER", + "TGO" + ] + }, + { + "country": "Christmas Island", + "capital": "Flying Fish Cove", + "language": "English", + "latitude": -10.5, + "longitude": 105.66666666, + "currency": "Australian dollar", + "continent": "Asia", + "neighbors": [] + }, + { + "country": "Bermuda", + "capital": "Hamilton", + "language": "English", + "latitude": 32.33333333, + "longitude": -64.75, + "currency": "Bermudian dollar", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Nicaragua", + "capital": "Managua", + "language": "Spanish", + "latitude": 13, + "longitude": -85, + "currency": "Nicaraguan córdoba", + "continent": "North America", + "neighbors": [ + "CRI", + "HND" + ] + }, + { + "country": "Eswatini", + "capital": "Mbabane", + "language": "English", + "latitude": -26.5, + "longitude": 31.5, + "currency": "Swazi lilangeni", + "continent": "Africa", + "neighbors": [ + "MOZ", + "ZAF" + ] + }, + { + "country": "Bahrain", + "capital": "Manama", + "language": "Arabic", + "latitude": 26, + "longitude": 50.55, + "currency": "Bahraini dinar", + "continent": "Asia", + "neighbors": [] + }, + { + "country": "Kenya", + "capital": "Nairobi", + "language": "English", + "latitude": 1, + "longitude": 38, + "currency": "Kenyan shilling", + "continent": "Africa", + "neighbors": [ + "ETH", + "SOM", + "SSD", + "TZA", + "UGA" + ] + }, + { + "country": "Serbia", + "capital": "Belgrade", + "language": "Serbian", + "latitude": 44, + "longitude": 21, + "currency": "Serbian dinar", + "continent": "Europe", + "neighbors": [ + "BIH", + "BGR", + "HRV", + "HUN", + "UNK", + "MKD", + "MNE", + "ROU" + ] + }, + { + "country": "Timor-Leste", + "capital": "Dili", + "language": "Portuguese", + "latitude": -8.83333333, + "longitude": 125.91666666, + "currency": "United States dollar", + "continent": "Oceania", + "neighbors": [ + "IDN" + ] + }, + { + "country": "Dominica", + "capital": "Roseau", + "language": "English", + "latitude": 15.41666666, + "longitude": -61.33333333, + "currency": "Eastern Caribbean dollar", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Northern Mariana Islands", + "capital": "Saipan", + "language": "Carolinian", + "latitude": 15.2, + "longitude": 145.75, + "currency": "United States dollar", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Philippines", + "capital": "Manila", + "language": "English", + "latitude": 13, + "longitude": 122, + "currency": "Philippine peso", + "continent": "Asia", + "neighbors": [] + }, + { + "country": "Kosovo", + "capital": "Pristina", + "language": "Albanian", + "latitude": 42.666667, + "longitude": 21.166667, + "currency": "Euro", + "continent": "Europe", + "neighbors": [ + "ALB", + "MKD", + "MNE", + "SRB" + ] + }, + { + "country": "Kuwait", + "capital": "Kuwait City", + "language": "Arabic", + "latitude": 29.5, + "longitude": 45.75, + "currency": "Kuwaiti dinar", + "continent": "Asia", + "neighbors": [ + "IRQ", + "SAU" + ] + }, + { + "country": "Taiwan", + "capital": "Taipei", + "language": "Chinese", + "latitude": 23.5, + "longitude": 121, + "currency": "New Taiwan dollar", + "continent": "Asia", + "neighbors": [] + }, + { + "country": "Burundi", + "capital": "Gitega", + "language": "French", + "latitude": -3.5, + "longitude": 30, + "currency": "Burundian franc", + "continent": "Africa", + "neighbors": [ + "COD", + "RWA", + "TZA" + ] + }, + { + "country": "American Samoa", + "capital": "Pago Pago", + "language": "English", + "latitude": -14.33333333, + "longitude": -170, + "currency": "United States dollar", + "continent": "Oceania", + "neighbors": [] + }, + { + "country": "Bulgaria", + "capital": "Sofia", + "language": "Bulgarian", + "latitude": 43, + "longitude": 25, + "currency": "Bulgarian lev", + "continent": "Europe", + "neighbors": [ + "GRC", + "MKD", + "ROU", + "SRB", + "TUR" + ] + }, + { + "country": "South Africa", + "capital": "Pretoria", + "language": "Afrikaans", + "latitude": -29, + "longitude": 24, + "currency": "South African rand", + "continent": "Africa", + "neighbors": [ + "BWA", + "LSO", + "MOZ", + "NAM", + "SWZ", + "ZWE" + ] + }, + { + "country": "Peru", + "capital": "Lima", + "language": "Aymara", + "latitude": -10, + "longitude": -76, + "currency": "Peruvian sol", + "continent": "South America", + "neighbors": [ + "BOL", + "BRA", + "CHL", + "COL", + "ECU" + ] + }, + { + "country": "Aruba", + "capital": "Oranjestad", + "language": "Dutch", + "latitude": 12.5, + "longitude": -69.96666666, + "currency": "Aruban florin", + "continent": "North America", + "neighbors": [] + }, + { + "country": "Ghana", + "capital": "Accra", + "language": "English", + "latitude": 8, + "longitude": -2, + "currency": "Ghanaian cedi", + "continent": "Africa", + "neighbors": [ + "BFA", + "CIV", + "TGO" + ] + }, + { + "country": "Saint Martin", + "capital": "Marigot", + "language": "French", + "latitude": 18.0708, + "longitude": 63.0501, + "currency": "Euro", + "continent": "North America", + "neighbors": [ + "SXM" + ] + }, + { + "country": "India", + "capital": "New Delhi", + "language": "English", + "latitude": 20, + "longitude": 77, + "currency": "Indian rupee", + "continent": "Asia", + "neighbors": [ + "BGD", + "BTN", + "MMR", + "CHN", + "NPL", + "PAK" + ] + }, + { + "country": "Uganda", + "capital": "Kampala", + "language": "English", + "latitude": 1, + "longitude": 32, + "currency": "Ugandan shilling", + "continent": "Africa", + "neighbors": [ + "COD", + "KEN", + "RWA", + "SSD", + "TZA" + ] + } +]; \ No newline at end of file diff --git a/New_APIs/Countries_API/package-lock.json b/New_APIs/Countries_API/package-lock.json new file mode 100644 index 00000000..f5ad0523 --- /dev/null +++ b/New_APIs/Countries_API/package-lock.json @@ -0,0 +1,1818 @@ +{ + "name": "country-api", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "country-api", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "bcrypt": "^5.1.1", + "express": "^4.19.2", + "jsonwebtoken": "^9.0.2", + "mongoose": "^8.4.3", + "node-fetch": "^3.3.2" + } + }, + "node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", + "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", + "license": "BSD-3-Clause", + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/@mongodb-js/saslprep": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.7.tgz", + "integrity": "sha512-dCHW/oEX0KJ4NjDULBo3JiOaK5+6axtpBbS+ao2ZInoAL9/YRQLhXzSNAFz7hP4nzLkIqsfYAK/PDE3+XHny0Q==", + "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/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "license": "ISC" + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/agent-base/node_modules/debug": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/agent-base/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "license": "ISC" + }, + "node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "license": "MIT" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "license": "MIT" + }, + "node_modules/bcrypt": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-5.1.1.tgz", + "integrity": "sha512-AGBHOG5hPYZ5Xl9KXzU5iKq9516yEmvCKDg3ecP5kX2aB6UqTeXZxk2ELnDgDm6BQSMlLt9rDB4LoSMx0rYwww==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.11", + "node-addon-api": "^5.0.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/bson": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/bson/-/bson-6.7.0.tgz", + "integrity": "sha512-w2IquM5mYzYZv6rs3uN2DZTOBe2a0zXLj53TGDqwF4l6Sz/XsISrisXOJihArF9+BZ6Cq/GjVht7Sjfmri7ytQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=16.20.1" + } + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", + "license": "BSD-3-Clause" + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "license": "ISC", + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "license": "MIT" + }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "license": "ISC" + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", + "license": "MIT" + }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "license": "MIT" + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/detect-libc": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.2", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.6.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "license": "MIT", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "license": "ISC" + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "license": "ISC" + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/https-proxy-agent/node_modules/debug": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/https-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jsonwebtoken": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "license": "MIT", + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jsonwebtoken/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "license": "MIT", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "license": "MIT", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/kareem": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.6.3.tgz", + "integrity": "sha512-C3iHfuGUXK2u8/ipq9LfjFfXFxAZMQJJq7vLS45r3D9Y2xQ/m4S8zaR4zMLFWh9AsNPXmcFfUDhTEO8UIC/V6Q==", + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", + "license": "MIT" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", + "license": "MIT" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", + "license": "MIT" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", + "license": "MIT" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "license": "MIT" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + "license": "MIT" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + "license": "MIT" + }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "license": "MIT", + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "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/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==", + "license": "MIT" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "license": "MIT", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mongodb": { + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.6.2.tgz", + "integrity": "sha512-ZF9Ugo2JCG/GfR7DEb4ypfyJJyiKbg5qBYKRintebj8+DNS33CyGMkWbrS9lara+u+h+yEOGSRiLhFO/g1s1aw==", + "license": "Apache-2.0", + "dependencies": { + "@mongodb-js/saslprep": "^1.1.5", + "bson": "^6.7.0", + "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", + "gcp-metadata": "^5.2.0", + "kerberos": "^2.0.1", + "mongodb-client-encryption": ">=6.0.0 <7", + "snappy": "^7.2.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.1", + "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.1.tgz", + "integrity": "sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg==", + "license": "Apache-2.0", + "dependencies": { + "@types/whatwg-url": "^11.0.2", + "whatwg-url": "^13.0.0" + } + }, + "node_modules/mongoose": { + "version": "8.4.3", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.4.3.tgz", + "integrity": "sha512-GxPVLD+I/dxVkgcts2r2QmJJvS62/++btVj3RFt8YnHt+DSOp1Qjj62YEvgZaElwIOTcc4KGJM95X5LlrU1qQg==", + "license": "MIT", + "dependencies": { + "bson": "^6.7.0", + "kareem": "2.6.3", + "mongodb": "6.6.2", + "mpath": "0.9.0", + "mquery": "5.0.0", + "ms": "2.1.3", + "sift": "17.1.3" + }, + "engines": { + "node": ">=16.20.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mongoose" + } + }, + "node_modules/mongoose/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/mpath": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz", + "integrity": "sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mquery": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/mquery/-/mquery-5.0.0.tgz", + "integrity": "sha512-iQMncpmEK8R8ncT8HJGsGc9Dsp8xcgYMVSbs5jgnm1lFHTZqMJTUWTDx1LBO8+mK3tPNZWFLBghQEIOULSTHZg==", + "license": "MIT", + "dependencies": { + "debug": "4.x" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/mquery/node_modules/debug": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/mquery/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-addon-api": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", + "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==", + "license": "MIT" + }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "license": "MIT", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "license": "ISC", + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", + "license": "MIT" + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "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/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "license": "MIT", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "license": "ISC" + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/sift": { + "version": "17.1.3", + "resolved": "https://registry.npmjs.org/sift/-/sift-17.1.3.tgz", + "integrity": "sha512-Rtlj66/b0ICeFzYTuNvX/EF1igRbbnGSvEyT79McoZa/DeGhMyC5pWKOEsZKnpkqtSeovd5FL/bjHWC3CIIvCQ==", + "license": "MIT" + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC" + }, + "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/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "license": "ISC", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tr46": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", + "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", + "license": "MIT", + "dependencies": { + "punycode": "^2.3.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/web-streams-polyfill": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", + "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "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": "13.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-13.0.0.tgz", + "integrity": "sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==", + "license": "MIT", + "dependencies": { + "tr46": "^4.1.1", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "license": "ISC", + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" + } + } +} diff --git a/New_APIs/Countries_API/package.json b/New_APIs/Countries_API/package.json new file mode 100644 index 00000000..f62a3559 --- /dev/null +++ b/New_APIs/Countries_API/package.json @@ -0,0 +1,19 @@ +{ + "name": "country-api", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "description": "", + "dependencies": { + "bcrypt": "^5.1.1", + "express": "^4.19.2", + "jsonwebtoken": "^9.0.2", + "mongoose": "^8.4.3", + "node-fetch": "^3.3.2" + } +} diff --git a/New_APIs/Countries_API/server.js b/New_APIs/Countries_API/server.js new file mode 100644 index 00000000..3d992c7a --- /dev/null +++ b/New_APIs/Countries_API/server.js @@ -0,0 +1,153 @@ +const express = require('express'); +const fs = require('fs'); +const app = express(); +const port = 5000; +const countries = require('./countries'); + +// Middleware +app.use(express.json()); + +// Helper function to convert string to lowercase +const toLowerCase = str => str.toLowerCase(); + +// Get all countries +app.get('/api/countries', (req, res) => { + res.json(countries); +}); + +// Get a country by name +app.get('/api/countries/:name', (req, res) => { + const countryName = toLowerCase(req.params.name); + const country = countries.find(c => toLowerCase(c.country) === countryName); + if (country) { + res.json(country); + } else { + res.status(404).json({ message: 'Country not found' }); + } +}); + +// Get countries by continent +app.get('/api/countries/continent/:continent', (req, res) => { + const continent = toLowerCase(req.params.continent); + const filteredCountries = countries.filter(c => toLowerCase(c.continent) === continent); + res.json(filteredCountries); +}); + +// Get neighbors of a country +app.get('/api/countries/:name/neighbors', (req, res) => { + const countryName = toLowerCase(req.params.name); + const country = countries.find(c => toLowerCase(c.country) === countryName); + if (country) { + res.json(country.neighbors); + } else { + res.status(404).json({ message: 'Country not found' }); + } +}); + +// Get country by capital +app.get('/api/countries/capital/:capital', (req, res) => { + const capital = toLowerCase(req.params.capital); + const country = countries.find(c => toLowerCase(c.capital) === capital); + if (country) { + res.json(country); + } else { + res.status(404).json({ message: 'Country not found' }); + } +}); + +// Get countries by language +app.get('/api/countries/language/:language', (req, res) => { + const language = toLowerCase(req.params.language); + const filteredCountries = countries.filter(c => toLowerCase(c.language) === language); + res.json(filteredCountries); +}); + +// Get countries by currency +app.get('/api/countries/currency/:currency', (req, res) => { + const currency = toLowerCase(req.params.currency); + const filteredCountries = countries.filter(c => toLowerCase(c.currency) === currency); + res.json(filteredCountries); +}); + +// Get countries by latitude +app.get('/api/countries/latitude/:latitude', (req, res) => { + const latitude = parseFloat(req.params.latitude); + const filteredCountries = countries.filter(c => c.latitude === latitude); + res.json(filteredCountries); +}); + +// Get countries by longitude +app.get('/api/countries/longitude/:longitude', (req, res) => { + const longitude = parseFloat(req.params.longitude); + const filteredCountries = countries.filter(c => c.longitude === longitude); + res.json(filteredCountries); +}); + +// Get countries by continent and language +app.get('/api/countries/continent/:continent/language/:language', (req, res) => { + const continent = toLowerCase(req.params.continent); + const language = toLowerCase(req.params.language); + const filteredCountries = countries.filter(c => toLowerCase(c.continent) === continent && toLowerCase(c.language) === language); + res.json(filteredCountries); +}); + +// Add a new country +app.post('/api/countries', (req, res) => { + const newCountry = req.body; + + if (!newCountry.country || !newCountry.capital || !newCountry.continent) { + return res.status(400).json({ message: 'Country, capital, and continent are required fields.' }); + } + countries.push(newCountry); + fs.writeFile('./countries.js', `module.exports = ${JSON.stringify(countries, null, 2)};`, (err) => { + if (err) { + console.error(err); + return res.status(500).json({ message: 'Failed to update countries file.' }); + } + + res.status(201).json(newCountry); + }); +}); + +// Update a country +app.put('/api/countries/:name', (req, res) => { + const countryName = toLowerCase(req.params.name); + const countryIndex = countries.findIndex(c => toLowerCase(c.country) === countryName); + + if (countryIndex === -1) { + return res.status(404).json({ message: 'Country not found' }); + } + countries[countryIndex] = { ...countries[countryIndex], ...req.body }; + fs.writeFile('./countries.js', `module.exports = ${JSON.stringify(countries, null, 2)};`, (err) => { + if (err) { + console.error(err); + return res.status(500).json({ message: 'Failed to update countries file.' }); + } + + res.json(countries[countryIndex]); + }); +}); + +// Delete a country +app.delete('/api/countries/:name', (req, res) => { + const countryName = toLowerCase(req.params.name); + const countryIndex = countries.findIndex(c => toLowerCase(c.country) === countryName); + + if (countryIndex === -1) { + return res.status(404).json({ message: 'Country not found' }); + } + const deletedCountry = countries.splice(countryIndex, 1); + fs.writeFile('./countries.js', `module.exports = ${JSON.stringify(countries, null, 2)};`, (err) => { + if (err) { + console.error(err); + return res.status(500).json({ message: 'Failed to update countries file.' }); + } + + res.json(deletedCountry); + }); +}); + +// Start the server +app.listen(port, () => { + console.log(`Server running at http://localhost:${port}`); +}); diff --git a/New_APIs/F1_API/README.md b/New_APIs/F1_API/README.md new file mode 100644 index 00000000..2be57474 --- /dev/null +++ b/New_APIs/F1_API/README.md @@ -0,0 +1,68 @@ +# F1 API + +This project is a RESTful API for accessing information about Formula 1 (F1) drivers, teams, and races. The API is built using Flask and Flask-RESTful. + +## Features + +- Retrieve information about F1 drivers +- Retrieve information about F1 teams +- Retrieve information about F1 races + +## Prerequisites + +- Python 3.6+ +- Flask +- Flask-RESTful + +## Installation + +1. Clone the repository: + ```bash + git clone https://github.com/dishamodi0910/APIVerse.git + cd APIVerse + ``` + +2. Create and activate a virtual environment (optional but recommended): + ```bash + python -m venv venv + source venv/bin/activate # On Windows use `venv\Scripts\activate` + ``` + +3. Install the required packages: + ```bash + pip install -r requirements.txt + ``` + +## Usage + +1. Run the application: + ```bash + python app.py + ``` + +2. Access the API endpoints in your browser or using a tool like Postman: + - Get all drivers: `GET /drivers` + - Get a specific driver: `GET /drivers/` + - Get all teams: `GET /teams` + - Get a specific team: `GET /teams/` + - Get all races: `GET /races` + - Get a specific race: `GET /races/` + +## Project Structure + +- **app.py**: The main application file where the Flask app and API are initialized. +- **resources/**: Contains the resource classes for handling API requests. + - **driver.py**: Resource class for driver-related endpoints. + - **team.py**: Resource class for team-related endpoints. + - **race.py**: Resource class for race-related endpoints. +- **models/**: Contains the model classes for accessing data. + - **driver.py**: Model class for driver data. + - **team.py**: Model class for team data. + - **race.py**: Model class for race data. +- **data.py**: Contains sample data for drivers, teams, and races. + +## Example Data + +Sample data is included in the `data.py` file. This can be replaced with a database or any other data source. + + diff --git a/New_APIs/F1_API/app.py b/New_APIs/F1_API/app.py new file mode 100644 index 00000000..e1ea70ab --- /dev/null +++ b/New_APIs/F1_API/app.py @@ -0,0 +1,16 @@ +# app.py +from flask import Flask +from flask_restful import Api +from resources.driver import DriverResource +from resources.team import TeamResource +from resources.race import RaceResource + +app = Flask(__name__) +api = Api(app) + +api.add_resource(DriverResource, '/drivers', '/drivers/') +api.add_resource(TeamResource, '/teams', '/teams/') +api.add_resource(RaceResource, '/races', '/races/') + +if __name__ == '__main__': + app.run(debug=True) diff --git a/New_APIs/F1_API/data.py b/New_APIs/F1_API/data.py new file mode 100644 index 00000000..f903edc7 --- /dev/null +++ b/New_APIs/F1_API/data.py @@ -0,0 +1,62 @@ +#According to the 2024 seaso +DRIVERS = [ + {'id': 1, 'name': 'Lewis Hamilton', 'team': 'Mercedes'}, + {'id': 2, 'name': 'George Russell', 'team': 'Mercedes'}, + {'id': 3, 'name': 'Max Verstappen', 'team': 'Red Bull Racing'}, + {'id': 4, 'name': 'Sergio Perez', 'team': 'Red Bull Racing'}, + {'id': 5, 'name': 'Charles Leclerc', 'team': 'Ferrari'}, + {'id': 6, 'name': 'Carlos Sainz', 'team': 'Ferrari'}, + {'id': 7, 'name': 'Lando Norris', 'team': 'McLaren'}, + {'id': 8, 'name': 'Oscar Piastri', 'team': 'McLaren'}, + {'id': 9, 'name': 'Fernando Alonso', 'team': 'Aston Martin'}, + {'id': 10, 'name': 'Lance Stroll', 'team': 'Aston Martin'}, + {'id': 11, 'name': 'Esteban Ocon', 'team': 'Alpine'}, + {'id': 12, 'name': 'Pierre Gasly', 'team': 'Alpine'}, + {'id': 13, 'name': 'Valtteri Bottas', 'team': 'Alfa Romeo'}, + {'id': 14, 'name': 'Guanyu Zhou', 'team': 'Alfa Romeo'}, + {'id': 15, 'name': 'Kevin Magnussen', 'team': 'Haas'}, + {'id': 16, 'name': 'Nico Hulkenberg', 'team': 'Haas'}, + {'id': 17, 'name': 'Yuki Tsunoda', 'team': 'AlphaTauri'}, + {'id': 18, 'name': 'Nyck de Vries', 'team': 'AlphaTauri'}, + {'id': 19, 'name': 'Alexander Albon', 'team': 'Williams'}, + {'id': 20, 'name': 'Logan Sargeant', 'team': 'Williams'}, +] + +TEAMS = [ + {'id': 1, 'name': 'Mercedes', 'principal': 'Toto Wolff'}, + {'id': 2, 'name': 'Red Bull Racing', 'principal': 'Christian Horner'}, + {'id': 3, 'name': 'Ferrari', 'principal': 'Fred Vasseur'}, + {'id': 4, 'name': 'McLaren', 'principal': 'Andrea Stella'}, + {'id': 5, 'name': 'Aston Martin', 'principal': 'Mike Krack'}, + {'id': 6, 'name': 'Alpine', 'principal': 'Laurent Rossi'}, + {'id': 7, 'name': 'Alfa Romeo', 'principal': 'Alessandro Alunni Bravi'}, + {'id': 8, 'name': 'Haas', 'principal': 'Guenther Steiner'}, + {'id': 9, 'name': 'AlphaTauri', 'principal': 'Franz Tost'}, + {'id': 10, 'name': 'Williams', 'principal': 'James Vowles'}, +] + +RACES = [ + {'id': 1, 'name': 'Bahrain Grand Prix', 'location': 'Sakhir'}, + {'id': 2, 'name': 'Saudi Arabian Grand Prix', 'location': 'Jeddah'}, + {'id': 3, 'name': 'Australian Grand Prix', 'location': 'Melbourne'}, + {'id': 4, 'name': 'Azerbaijan Grand Prix', 'location': 'Baku'}, + {'id': 5, 'name': 'Miami Grand Prix', 'location': 'Miami'}, + {'id': 6, 'name': 'Emilia Romagna Grand Prix', 'location': 'Imola'}, + {'id': 7, 'name': 'Monaco Grand Prix', 'location': 'Monte Carlo'}, + {'id': 8, 'name': 'Spanish Grand Prix', 'location': 'Barcelona'}, + {'id': 9, 'name': 'Canadian Grand Prix', 'location': 'Montreal'}, + {'id': 10, 'name': 'Austrian Grand Prix', 'location': 'Spielberg'}, + {'id': 11, 'name': 'British Grand Prix', 'location': 'Silverstone'}, + {'id': 12, 'name': 'Hungarian Grand Prix', 'location': 'Budapest'}, + {'id': 13, 'name': 'Belgian Grand Prix', 'location': 'Spa-Francorchamps'}, + {'id': 14, 'name': 'Dutch Grand Prix', 'location': 'Zandvoort'}, + {'id': 15, 'name': 'Italian Grand Prix', 'location': 'Monza'}, + {'id': 16, 'name': 'Singapore Grand Prix', 'location': 'Singapore'}, + {'id': 17, 'name': 'Japanese Grand Prix', 'location': 'Suzuka'}, + {'id': 18, 'name': 'Qatar Grand Prix', 'location': 'Lusail'}, + {'id': 19, 'name': 'United States Grand Prix', 'location': 'Austin'}, + {'id': 20, 'name': 'Mexican Grand Prix', 'location': 'Mexico City'}, + {'id': 21, 'name': 'Brazilian Grand Prix', 'location': 'Sao Paulo'}, + {'id': 22, 'name': 'Las Vegas Grand Prix', 'location': 'Las Vegas'}, + {'id': 23, 'name': 'Abu Dhabi Grand Prix', 'location': 'Yas Marina'}, +] diff --git a/New_APIs/F1_API/models/driver.py b/New_APIs/F1_API/models/driver.py new file mode 100644 index 00000000..fe542038 --- /dev/null +++ b/New_APIs/F1_API/models/driver.py @@ -0,0 +1,10 @@ +from data import DRIVERS + +class DriverModel: + @staticmethod + def get_all(): + return DRIVERS + + @staticmethod + def get_by_id(driver_id): + return next((driver for driver in DRIVERS if driver['id'] == driver_id), None) diff --git a/New_APIs/F1_API/models/race.py b/New_APIs/F1_API/models/race.py new file mode 100644 index 00000000..bfd41bb7 --- /dev/null +++ b/New_APIs/F1_API/models/race.py @@ -0,0 +1,10 @@ +from data import RACES + +class RaceModel: + @staticmethod + def get_all(): + return RACES + + @staticmethod + def get_by_id(race_id): + return next((race for race in RACES if race['id'] == race_id), None) diff --git a/New_APIs/F1_API/models/team.py b/New_APIs/F1_API/models/team.py new file mode 100644 index 00000000..e801561d --- /dev/null +++ b/New_APIs/F1_API/models/team.py @@ -0,0 +1,11 @@ +# models/team.py +from data import TEAMS + +class TeamModel: + @staticmethod + def get_all(): + return TEAMS + + @staticmethod + def get_by_id(team_id): + return next((team for team in TEAMS if team['id'] == team_id), None) diff --git a/New_APIs/F1_API/resources/driver.py b/New_APIs/F1_API/resources/driver.py new file mode 100644 index 00000000..cfdcd9f8 --- /dev/null +++ b/New_APIs/F1_API/resources/driver.py @@ -0,0 +1,11 @@ +from flask_restful import Resource +from models.driver.py import DriverModel + +class DriverResource(Resource): + def get(self, driver_id=None): + if driver_id: + driver = DriverModel.get_by_id(driver_id) + if driver: + return driver, 200 + return {'message': 'Driver not found'}, 404 + return DriverModel.get_all(), 200 diff --git a/New_APIs/F1_API/resources/race.py b/New_APIs/F1_API/resources/race.py new file mode 100644 index 00000000..e86e98ef --- /dev/null +++ b/New_APIs/F1_API/resources/race.py @@ -0,0 +1,11 @@ +from flask_restful import Resource +from models.race.py import RaceModel + +class RaceResource(Resource): + def get(self, race_id=None): + if race_id: + race = RaceModel.get_by_id(race_id) + if race: + return race, 200 + return {'message': 'Race not found'}, 404 + return RaceModel.get_all(), 200 diff --git a/New_APIs/F1_API/resources/team.py b/New_APIs/F1_API/resources/team.py new file mode 100644 index 00000000..29b18ba7 --- /dev/null +++ b/New_APIs/F1_API/resources/team.py @@ -0,0 +1,11 @@ +from flask_restful import Resource +from models.team.py import TeamModel + +class TeamResource(Resource): + def get(self, team_id=None): + if team_id: + team = TeamModel.get_by_id(team_id) + if team: + return team, 200 + return {'message': 'Team not found'}, 404 + return TeamModel.get_all(), 200 diff --git a/New_APIs/Firebase API/Readme.md b/New_APIs/Firebase API/Readme.md new file mode 100644 index 00000000..d26bf2a2 --- /dev/null +++ b/New_APIs/Firebase API/Readme.md @@ -0,0 +1,24 @@ +# Firebase API Viewer App + +A simple web application to view and interact with Firebase data. + +## Features +- Fetch and display data from Firebase +- Deploy new Firebase apps +- Scale Firebase app resources +- Retrieve logs from Firebase apps + +## Installation +1. Clone the repository: + ```bash + git clone https://github.com/username/FirebaseAPIApp.git + +2. Navigate to the project directory: +``` +cd FirebaseAPIApp +``` + +3. Install Dependencies +``` +npm install +``` diff --git a/New_APIs/Firebase API/index.html b/New_APIs/Firebase API/index.html new file mode 100644 index 00000000..ad38fc91 --- /dev/null +++ b/New_APIs/Firebase API/index.html @@ -0,0 +1,31 @@ + + + + + + + Firebase API Viewer + + +

Firebase API Viewer

+
+

Data

+
+

Deploy

+ + + +

Scale

+ + + + +

Logs

+ + +
    +
    + + + + diff --git a/New_APIs/Firebase API/index.js b/New_APIs/Firebase API/index.js new file mode 100644 index 00000000..98a0abfe --- /dev/null +++ b/New_APIs/Firebase API/index.js @@ -0,0 +1,48 @@ +document.addEventListener('DOMContentLoaded', function () { + fetchData(); + + document.getElementById('deployButton').addEventListener('click', async () => { + const appName = document.getElementById('deployAppName').value; + const sourceUrl = document.getElementById('deploySourceUrl').value; + const response = await fetch('/deploy', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ app_name: appName, source_url: sourceUrl }) + }); + const result = await response.json(); + console.log(result); + }); + + document.getElementById('scaleButton').addEventListener('click', async () => { + const appName = document.getElementById('scaleAppName').value; + const dynoType = document.getElementById('scaleDynoType').value; + const quantity = document.getElementById('scaleQuantity').value; + const response = await fetch('/scale', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ app_name: appName, dyno_type: dynoType, quantity: parseInt(quantity) }) + }); + const result = await response.json(); + console.log(result); + }); + + document.getElementById('logsButton').addEventListener('click', async () => { + const appName = document.getElementById('logsAppName').value; + const response = await fetch(`/logs?app_name=${appName}`); + const result = await response.json(); + const results = document.getElementById('results'); + results.innerHTML = JSON.stringify(result, null, 2); + }); +}); + +async function fetchData() { + const response = await fetch('https://your-firebase-project.firebaseio.com/data.json'); + const data = await response.json(); + const dataList = document.getElementById('dataList'); + for (const key in data) { + const dataItem = document.createElement('div'); + dataItem.className = 'dataItem'; + dataItem.innerHTML = `

    ${data[key]}

    `; + dataList.appendChild(dataItem); + } +} diff --git a/New_APIs/Firebase API/manifest.json b/New_APIs/Firebase API/manifest.json new file mode 100644 index 00000000..e2a7bc4e --- /dev/null +++ b/New_APIs/Firebase API/manifest.json @@ -0,0 +1,15 @@ +{ + "short_name": "FirebaseApp", + "name": "Firebase API Viewer App", + "icons": [ + { + "src": "icon.png", + "type": "image/png", + "sizes": "192x192" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/New_APIs/Firebase API/package-lock.json b/New_APIs/Firebase API/package-lock.json new file mode 100644 index 00000000..c0f07131 --- /dev/null +++ b/New_APIs/Firebase API/package-lock.json @@ -0,0 +1,50 @@ +{ + "name": "firebase-api-app", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-G7fYv8zS0D7ftu3gnLsOniwhgLU4k9v+1NEtFPP07/Oa8XJ51FtdUKLqIvsTcZo5ua23NO4s9Hr77BM19DOf1g==", + "requires": { + "accepts": "1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "cookie": "0.4.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "1.1.2", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "finalhandler": "1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "1.1.2", + "on-finished": "2.3.0", + "parseurl": "1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "2.0.6", + "qs": "6.7.0", + "range-parser": "1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "1.5.0", + "type-is": "1.6.18", + "utils-merge": "1.0.1", + "vary": "1.1.2" + } + }, + "firebase": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/firebase/-/firebase-9.0.0.tgz", + "integrity": "sha512-3I5CVSy+mb/V9Fxh2RH1Hc+T4x+HbCu4Vj3H0nnJpItcLLt1s2M2n4c3lgY2yHsRHKvILwB3RZ/VZ1V6Dya0rA==" + } + } + } + \ No newline at end of file diff --git a/New_APIs/Firebase API/package.json b/New_APIs/Firebase API/package.json new file mode 100644 index 00000000..586db34d --- /dev/null +++ b/New_APIs/Firebase API/package.json @@ -0,0 +1,16 @@ +{ + "name": "firebase-api-app", + "version": "1.0.0", + "description": "A simple app to view Firebase data", + "main": "index.js", + "scripts": { + "start": "node server.js" + }, + "author": "Your Name", + "license": "ISC", + "dependencies": { + "express": "^4.17.1", + "firebase": "^9.0.0" + } + } + \ No newline at end of file diff --git a/New_APIs/Firebase API/style.css b/New_APIs/Firebase API/style.css new file mode 100644 index 00000000..b34436b4 --- /dev/null +++ b/New_APIs/Firebase API/style.css @@ -0,0 +1,52 @@ +body { + font-family: Arial, sans-serif; + background: linear-gradient(135deg, #20fcdb, #d02098); + color: #fff; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + margin: 0; +} + +h1 { + font-size: 2.5em; + margin-bottom: 20px; +} + +#app { + text-align: center; + padding: 20px; + background: rgba(0, 0, 0, 0.5); + border-radius: 10px; +} + +h2 { + margin-top: 20px; + font-size: 1.5em; +} + +input, button { + margin: 10px 0; + padding: 10px; + border-radius: 5px; + border: none; +} + +button { + background: #ef32d9; + color: #fff; + cursor: pointer; +} + +button:hover { + background: #a726c1; +} + +#dataList .dataItem { + margin-bottom: 15px; +} + +#results { + margin-top: 20px; +} diff --git a/New_APIs/Gradient Color Generator JavaScript/Gradient Color Generator JavaScript/README.md b/New_APIs/Gradient Color Generator JavaScript/Gradient Color Generator JavaScript/README.md new file mode 100644 index 00000000..b5659932 --- /dev/null +++ b/New_APIs/Gradient Color Generator JavaScript/Gradient Color Generator JavaScript/README.md @@ -0,0 +1,54 @@ +# Gradient Color Generator +This project is a simple Gradient Color Generator built using HTML, CSS, and JavaScript. The application allows users to generate linear gradients by selecting two colors and displays the corresponding CSS code for the gradient. + +## Features +* User-friendly interface for selecting two colors +* Real-time display of the generated gradient +* Copy-to-clipboard functionality for the CSS code +* Responsive design suitable for all screen sizes + +## Getting Started +To get a local copy up and running, follow these simple steps. + +* Prerequisites +You will need a modern web browser to view the project. + +* Installation +1. Clone the repository: + +```bash +git clone https://github.com/your-username/gradient-color-generator.git +``` + +2. Open the project directory: + +```bash +cd gradient-color-generator +``` + +3. Open index.html in your web browser: + +```bash +open index.html +``` + +## Usage +* Open the Gradient Color Generator in your browser. +* Use the color pickers to select two colors. +* The gradient will be updated in real-time. +* Copy the generated CSS code by clicking the "Copy" button. + +## Code Overview +* HTML +The HTML file contains the structure of the application, including color pickers and a display area for the gradient and CSS code. + +* CSS +The CSS file includes styles for the layout and design of the application. + +* JavaScript +The JavaScript file handles the functionality of the color pickers, generates the gradient, and updates the CSS code. + +## Screenshot + +![alt text](image.png) + \ No newline at end of file diff --git a/New_APIs/Gradient Color Generator JavaScript/Gradient Color Generator JavaScript/image.png b/New_APIs/Gradient Color Generator JavaScript/Gradient Color Generator JavaScript/image.png new file mode 100644 index 00000000..fa009ef8 Binary files /dev/null and b/New_APIs/Gradient Color Generator JavaScript/Gradient Color Generator JavaScript/image.png differ diff --git a/New_APIs/Gradient Color Generator JavaScript/Gradient Color Generator JavaScript/index.html b/New_APIs/Gradient Color Generator JavaScript/Gradient Color Generator JavaScript/index.html new file mode 100644 index 00000000..555c182d --- /dev/null +++ b/New_APIs/Gradient Color Generator JavaScript/Gradient Color Generator JavaScript/index.html @@ -0,0 +1,46 @@ + + + + + + Gradient Generator in JavaScript | CodingNepal + + + + + +
    +
    +
    +
    +

    Direction

    +
    + +
    +
    +
    +

    Colors

    +
    + + +
    +
    +
    + +
    + + +
    +
    + + + \ No newline at end of file diff --git a/New_APIs/Gradient Color Generator JavaScript/Gradient Color Generator JavaScript/script.js b/New_APIs/Gradient Color Generator JavaScript/Gradient Color Generator JavaScript/script.js new file mode 100644 index 00000000..28ad254a --- /dev/null +++ b/New_APIs/Gradient Color Generator JavaScript/Gradient Color Generator JavaScript/script.js @@ -0,0 +1,39 @@ +const gradientBox = document.querySelector(".gradient-box"); +const selectMenu = document.querySelector(".select-box select"); +const colorInputs = document.querySelectorAll(".colors input"); +const textarea = document.querySelector("textarea"); +const refreshBtn = document.querySelector(".refresh"); +const copyBtn = document.querySelector(".copy"); + +const getRandomColor = () => { + // Generating a random color in hexadecimal format. Example: #5665E9 + const randomHex = Math.floor(Math.random() * 0xffffff).toString(16); + return `#${randomHex}`; +} + +const generateGradient = (isRandom) => { + if(isRandom) { // If isRandom is true, update the colors inputs value with random color + colorInputs[0].value = getRandomColor(); + colorInputs[1].value = getRandomColor(); + } + // Creating a gradient string using the select menu value with color input values + const gradient = `linear-gradient(${selectMenu.value}, ${colorInputs[0].value}, ${colorInputs[1].value})`; + gradientBox.style.background = gradient; + textarea.value = `background: ${gradient};`; +} + +const copyCode = () => { + // Copying textarea value and updating the copy button text + navigator.clipboard.writeText(textarea.value); + copyBtn.innerText = "Code Copied"; + setTimeout(() => copyBtn.innerText = "Copy Code", 1600); +} + +colorInputs.forEach(input => { + // Calling generateGradient function on each color input clicks + input.addEventListener("input", () => generateGradient(false)); +}); + +selectMenu.addEventListener("change", () => generateGradient(false)); +refreshBtn.addEventListener("click", () => generateGradient(true)); +copyBtn.addEventListener("click", copyCode); \ No newline at end of file diff --git a/New_APIs/Gradient Color Generator JavaScript/Gradient Color Generator JavaScript/style.css b/New_APIs/Gradient Color Generator JavaScript/Gradient Color Generator JavaScript/style.css new file mode 100644 index 00000000..569a3008 --- /dev/null +++ b/New_APIs/Gradient Color Generator JavaScript/Gradient Color Generator JavaScript/style.css @@ -0,0 +1,120 @@ +/* Import Google font - Poppins */ +@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap'); +* { + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: 'Poppins', sans-serif; +} +body { + padding: 0 10px; + display: flex; + align-items: center; + justify-content: center; + min-height: 100vh; + background: #8A6CFF; +} +.wrapper { + width: 450px; + padding: 25px; + background: #fff; + border-radius: 7px; + box-shadow: 0 15px 30px rgba(0,0,0,0.06); +} +.wrapper .gradient-box { + height: 220px; + width: 100%; + border-radius: 7px; + background: linear-gradient(to left top, #5665E9, #A271F8); +} +.wrapper .row { + display: flex; + margin: 20px 0; + justify-content: space-between; +} +.options p { + font-size: 1.1rem; + margin-bottom: 8px; +} +.row :where(.column, button) { + width: calc(100% / 2 - 12px); +} +.options .select-box { + border-radius: 5px; + padding: 10px 15px; + border: 1px solid #aaa; +} +.select-box select { + width: 100%; + border: none; + outline: none; + font-size: 1.12rem; + background: none; +} +.options .palette { + margin-left: 60px; +} +.palette input { + height: 41px; + width: calc(100% / 2 - 20px); +} +.palette input:last-child { + margin-left: 6px; +} +.wrapper textarea { + width: 100%; + color: #333; + font-size: 1.05rem; + resize: none; + padding: 10px 15px; + border-radius: 5px; + border: 1px solid #ccc; +} +.buttons button { + padding: 15px 0; + border: none; + outline: none; + color: #fff; + margin: 0 0 -15px; + font-size: 1.09rem; + border-radius: 5px; + cursor: pointer; + transition: 0.3s ease; +} +.buttons .refresh { + background: #6C757D; +} +.buttons .refresh:hover { + background: #5f666d; +} +.buttons .copy { + background: #8A6CFF; +} +.buttons .copy:hover { + background: #704dff; +} + +@media screen and (max-width: 432px) { + .wrapper { + padding: 25px 20px; + } + .row :where(.column, button) { + width: calc(100% / 2 - 8px); + } + .options .select-box { + padding: 8px 15px; + } + .options .palette { + margin-left: 40px; + } + .options .colors { + display: flex; + justify-content: space-between; + } + .palette input { + width: calc(100% / 2 - 5px); + } + .palette input:last-child { + margin-left: 0; + } +} \ No newline at end of file diff --git a/New_APIs/Heroku API/README.md b/New_APIs/Heroku API/README.md new file mode 100644 index 00000000..d9d36007 --- /dev/null +++ b/New_APIs/Heroku API/README.md @@ -0,0 +1,15 @@ +# Heroku API + +## Description + +A basic API built using Node.js and Express to interact with the Heroku platform. It allows users to deploy applications, scale dynos, and retrieve logs programmatically. + +## Installation + +To install the required packages, run: + +```bash +npm install express +npm install axios +npm install nodemon +npm install diff --git a/New_APIs/Heroku API/manifest.json b/New_APIs/Heroku API/manifest.json new file mode 100644 index 00000000..4d3b3ad6 --- /dev/null +++ b/New_APIs/Heroku API/manifest.json @@ -0,0 +1,15 @@ +{ + "short_name": "HerokuAPI", + "name": "Heroku API", + "icons": [ + { + "src": "icon.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": "/index.html", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/New_APIs/Heroku API/package.json b/New_APIs/Heroku API/package.json new file mode 100644 index 00000000..99eed8c8 --- /dev/null +++ b/New_APIs/Heroku API/package.json @@ -0,0 +1,20 @@ +{ + "name": "heroku-api", + "version": "1.0.0", + "description": "A simple API to interact with Heroku platform for deployments, scaling, and logs.", + "main": "src/index.js", + "scripts": { + "start": "node src/index.js", + "dev": "nodemon src/index.js" + }, + "author": "", + "license": "ISC", + "dependencies": { + "axios": "^0.27.2", + "express": "^4.18.2" + }, + "devDependencies": { + "nodemon": "^2.0.22" + } + } + \ No newline at end of file diff --git a/New_APIs/Heroku API/packet-lock.json b/New_APIs/Heroku API/packet-lock.json new file mode 100644 index 00000000..82dcfb6e --- /dev/null +++ b/New_APIs/Heroku API/packet-lock.json @@ -0,0 +1,20 @@ +{ + "name": "heroku-api", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "heroku-api", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "axios": "^0.27.2", + "express": "^4.18.2", + "nodemon": "^2.0.22" + } + }, + // Other dependencies + } + } + \ No newline at end of file diff --git a/New_APIs/Heroku API/public/index.html b/New_APIs/Heroku API/public/index.html new file mode 100644 index 00000000..e704c499 --- /dev/null +++ b/New_APIs/Heroku API/public/index.html @@ -0,0 +1,62 @@ + + + + + + + Heroku API + + +

    Heroku API

    +
    +

    Deploy

    + + + +

    Scale

    + + + + +

    Logs

    + + +
      +
      + + + + diff --git a/New_APIs/Heroku API/public/styles.css b/New_APIs/Heroku API/public/styles.css new file mode 100644 index 00000000..748b3b1f --- /dev/null +++ b/New_APIs/Heroku API/public/styles.css @@ -0,0 +1,76 @@ +body { + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + margin: 0; + padding: 0; + display: flex; + flex-direction: column; + align-items: center; + background: linear-gradient(135deg, #f06, #00f); + color: #fff; +} + +h1 { + margin-top: 30px; + font-size: 2.5em; +} + +h2 { + margin-top: 20px; + font-size: 1.8em; +} + +#app { + margin-top: 20px; + width: 90%; + max-width: 600px; + background-color: rgba(255, 255, 255, 0.8); + color: #333; + padding: 20px; + border-radius: 10px; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.1); +} + +input, button, select { + margin: 10px 0; + padding: 12px; + width: 100%; + box-sizing: border-box; + border-radius: 5px; + border: 1px solid #ddd; + font-size: 1em; +} + +button { + background-color: #007BFF; + color: #fff; + border: none; + cursor: pointer; + transition: background-color 0.3s ease; +} + +button:hover { + background-color: #0056b3; +} + +ul { + list-style-type: none; + padding: 0; + margin-top: 20px; + background: rgba(255, 255, 255, 0.9); + color: #333; + padding: 20px; + border-radius: 8px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); +} + +li { + margin: 10px 0; + padding: 10px; + background-color: rgba(233, 233, 233, 0.9); + border-radius: 5px; + border: 1px solid #ccc; +} + +input::placeholder, select::placeholder { + color: #aaa; +} diff --git a/New_APIs/Heroku API/src/index.js b/New_APIs/Heroku API/src/index.js new file mode 100644 index 00000000..fe615812 --- /dev/null +++ b/New_APIs/Heroku API/src/index.js @@ -0,0 +1,59 @@ +const express = require('express'); +const axios = require('axios'); +const path = require('path'); +const app = express(); +const PORT = process.env.PORT || 3000; + +app.use(express.json()); +app.use(express.static(path.join(__dirname, '../public'))); + +const HEROKU_API_KEY = 'your_heroku_api_key'; + +const headers = { + 'Authorization': `Bearer ${HEROKU_API_KEY}`, + 'Accept': 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' +}; + +app.post('/deploy', async (req, res) => { + const { app_name, source_url } = req.body; + const url = `https://api.heroku.com/apps/${app_name}/builds`; + const payload = { source_blob: { url: source_url } }; + + try { + const response = await axios.post(url, payload, { headers }); + res.json(response.data); + } catch (error) { + res.status(error.response.status).json(error.response.data); + } +}); + +app.post('/scale', async (req, res) => { + const { app_name, dyno_type, quantity } = req.body; + const url = `https://api.heroku.com/apps/${app_name}/formation`; + const payload = { updates: [{ type: dyno_type, quantity }] }; + + try { + const response = await axios.patch(url, payload, { headers }); + res.json(response.data); + } catch (error) { + res.status(error.response.status).json(error.response.data); + } +}); + +app.get('/logs', async (req, res) => { + const { app_name } = req.query; + const url = `https://api.heroku.com/apps/${app_name}/log-sessions`; + const payload = { dyno: 'web', lines: 100, source: 'app', tail: true }; + + try { + const response = await axios.post(url, payload, { headers }); + res.json(response.data); + } catch (error) { + res.status(error.response.status).json(error.response.data); + } +}); + +app.listen(PORT, () => { + console.log(`Server is running on port ${PORT}`); +}); diff --git a/New_APIs/Language_Translate_API/README.md b/New_APIs/Language_Translate_API/README.md new file mode 100644 index 00000000..aa786100 --- /dev/null +++ b/New_APIs/Language_Translate_API/README.md @@ -0,0 +1,62 @@ +# Description +This is the API for Translate the English words and paragraph to the Hindi Language without any third party API. From help of this API we can Translate very large number of words to the hindi there is no limit of size of the content. + +# API Endpoints +## POST : /api/translate +in POST method we have to give the data at this way +post request Example: + +{ + "text": "You may Enter any Text to Translate", + "source_language": "en", + "target_language": "hi" +} + +# Getting Started +## Pre-Requisites +- NodeJs +- python + +# Steps to Run +1. Clone the Repository and Nevigate to the directory **Language_Translate** + + cd New_APIs + + cd Language_Translate + +2. Install the dependency + + - npm i + + for python library: + + - pip install transformers torch + +3. Start the server using node + + - cd src + - node app.js + +4. go to the postman or any API tester like Thunder Client ( Of Vs code) + + - type this URL in the request type of POST method + + http://localhost:3000/api/translate + + - Add the JSON data like This + + { + "text": "You may Enter any Text to Translate", + "source_language": "en", + "target_language": "hi" + } + + - You will get Response like This in the JSON Format + + { + "translated_text": "अनुवाद करने के लिए आप कोई पाठ दाखिल कर सकते हैं" + } + +5. For Convert Text to Hindi you have to wait some time after sending the request. It will take some time for convert the data. + + diff --git a/New_APIs/Language_Translate_API/package-lock.json b/New_APIs/Language_Translate_API/package-lock.json new file mode 100644 index 00000000..1191302b --- /dev/null +++ b/New_APIs/Language_Translate_API/package-lock.json @@ -0,0 +1,1837 @@ +{ + "name": "language-translator", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "language-translator", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "axios": "^1.7.2", + "body-parser": "^1.20.2", + "express": "^4.19.2", + "nodemon": "^3.1.4" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/axios": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", + "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.2", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.6.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==" + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nodemon": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.4.tgz", + "integrity": "sha512-wjPBbFhtpJwmIeY2yP7QF+UKzPfltVGtfce1g/bB15/8vCGZj8uxD62b/b9M9/WVgme0NZudpownKN+c0plXlQ==", + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^4", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nodemon/node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/nodemon/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==" + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/touch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", + "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==" + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + } + }, + "dependencies": { + "accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "requires": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + } + }, + "anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "axios": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", + "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", + "requires": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==" + }, + "body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "requires": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "requires": { + "fill-range": "^7.1.1" + } + }, + "bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" + }, + "call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + } + }, + "chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "requires": { + "safe-buffer": "5.2.1" + } + }, + "content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==" + }, + "cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==" + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" + }, + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" + }, + "destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + }, + "es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "requires": { + "get-intrinsic": "^1.2.4" + } + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" + }, + "express": { + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "requires": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.2", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.6.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + } + }, + "fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + } + }, + "follow-redirects": { + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==" + }, + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" + }, + "fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "optional": true + }, + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" + }, + "get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "requires": { + "is-glob": "^4.0.1" + } + }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "requires": { + "get-intrinsic": "^1.1.3" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" + }, + "has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "requires": { + "es-define-property": "^1.0.0" + } + }, + "has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==" + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "requires": { + "function-bind": "^1.1.2" + } + }, + "http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "requires": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==" + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==" + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "requires": { + "mime-db": "1.52.0" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" + }, + "nodemon": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.4.tgz", + "integrity": "sha512-wjPBbFhtpJwmIeY2yP7QF+UKzPfltVGtfce1g/bB15/8vCGZj8uxD62b/b9M9/WVgme0NZudpownKN+c0plXlQ==", + "requires": { + "chokidar": "^3.5.2", + "debug": "^4", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "dependencies": { + "debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + }, + "object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==" + }, + "on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "requires": { + "ee-first": "1.1.1" + } + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + }, + "proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "requires": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + } + }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, + "pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==" + }, + "qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "requires": { + "side-channel": "^1.0.4" + } + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" + }, + "raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "requires": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "requires": { + "picomatch": "^2.2.1" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==" + }, + "send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "requires": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "dependencies": { + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + } + } + }, + "serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + } + }, + "set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + } + }, + "setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + } + }, + "simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "requires": { + "semver": "^7.5.3" + } + }, + "statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + }, + "toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" + }, + "touch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", + "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==" + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, + "undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==" + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==" + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" + } + } +} diff --git a/New_APIs/Language_Translate_API/package.json b/New_APIs/Language_Translate_API/package.json new file mode 100644 index 00000000..650bd528 --- /dev/null +++ b/New_APIs/Language_Translate_API/package.json @@ -0,0 +1,18 @@ +{ + "name": "language-translator", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "Helpin Lakkad", + "license": "ISC", + "dependencies": { + "axios": "^1.7.2", + "body-parser": "^1.20.2", + "express": "^4.19.2", + "nodemon": "^3.1.4" + } +} diff --git a/New_APIs/Language_Translate_API/src/app.js b/New_APIs/Language_Translate_API/src/app.js new file mode 100644 index 00000000..78f08840 --- /dev/null +++ b/New_APIs/Language_Translate_API/src/app.js @@ -0,0 +1,14 @@ +const express = require('express'); +const bodyParser = require('body-parser'); +const routes = require('./routes'); + +const app = express(); +const PORT = process.env.PORT || 3000; + +app.use(bodyParser.json()); +app.use('/api', routes); + +app.listen(PORT, () => { + console.log(`Server is running on http://localhost:${PORT}`); + console.log(`Endpoint API :-> http://localhost:${PORT}/api/translate`); +}); diff --git a/New_APIs/Language_Translate_API/src/controllers.js b/New_APIs/Language_Translate_API/src/controllers.js new file mode 100644 index 00000000..cd7cedcd --- /dev/null +++ b/New_APIs/Language_Translate_API/src/controllers.js @@ -0,0 +1,30 @@ +const { exec } = require('child_process'); +const path = require('path'); + +const controllers = { + translate: (req, res) => { + const { text, source_language, target_language } = req.body; + const scriptPath = path.resolve(__dirname, '../translate.py'); + const command = `python ${scriptPath} "${text}" "${source_language}" "${target_language}"`; + + console.log('Received request:', req.body); + // console.log('Executing command:', command); + + exec(command, (error, stdout, stderr) => { + if (error) { + console.error('Error executing command:', error.message); + res.status(500).json({ error: error.message }); + return; + } + if (stderr) { + console.error('Standard error output:', stderr); + res.status(500).json({ error: stderr }); + return; + } + console.log('Command output:', JSON.parse(stdout)); + res.json(JSON.parse(stdout)); + }); + }, +}; + +module.exports = controllers; diff --git a/New_APIs/Language_Translate_API/src/routes.js b/New_APIs/Language_Translate_API/src/routes.js new file mode 100644 index 00000000..d9d65526 --- /dev/null +++ b/New_APIs/Language_Translate_API/src/routes.js @@ -0,0 +1,8 @@ +const express = require('express'); +const controllers = require('./controllers'); + +const router = express.Router(); + +router.post('/translate', controllers.translate); + +module.exports = router; diff --git a/New_APIs/Language_Translate_API/translate.py b/New_APIs/Language_Translate_API/translate.py new file mode 100644 index 00000000..7f7b0b1d --- /dev/null +++ b/New_APIs/Language_Translate_API/translate.py @@ -0,0 +1,20 @@ +from transformers import MarianMTModel, MarianTokenizer +import sys +import json + +def translate(text, src_lang, tgt_lang): + model_name = f'Helsinki-NLP/opus-mt-{src_lang}-{tgt_lang}' + model = MarianMTModel.from_pretrained(model_name) + tokenizer = MarianTokenizer.from_pretrained(model_name) + + translated = model.generate(**tokenizer(text, return_tensors="pt", padding=True)) + translated_text = [tokenizer.decode(t, skip_special_tokens=True) for t in translated] + + return translated_text[0] + +if __name__ == "__main__": + input_text = sys.argv[1] + src_lang = sys.argv[2] + tgt_lang = sys.argv[3] + result = translate(input_text, src_lang, tgt_lang) + print(json.dumps({"translated_text": result})) diff --git a/New_APIs/Quizlet API/Readme.md b/New_APIs/Quizlet API/Readme.md new file mode 100644 index 00000000..7816c2b5 --- /dev/null +++ b/New_APIs/Quizlet API/Readme.md @@ -0,0 +1,18 @@ +# Quizlet API Viewer App + +A simple web application to interact with the Quizlet API and view study sets. + +## Features +- Fetch and display Quizlet study sets +- Deploy new Quizlet apps +- Scale Quizlet app resources +- Retrieve logs from Quizlet apps + +## Installation +1. Clone the repository: + ```bash + git clone https://github.com/sreevidya-16/QuizletAPIApp.git + + +## Contributor +### Sree Vidya diff --git a/New_APIs/Quizlet API/index.html b/New_APIs/Quizlet API/index.html new file mode 100644 index 00000000..aef82603 --- /dev/null +++ b/New_APIs/Quizlet API/index.html @@ -0,0 +1,31 @@ + + + + + + + Quizlet API Viewer + + +

      Quizlet API Viewer

      +
      +

      Study Sets

      +
      +

      Deploy

      + + + +

      Scale

      + + + + +

      Logs

      + + +
        +
        + + + + diff --git a/New_APIs/Quizlet API/index.js b/New_APIs/Quizlet API/index.js new file mode 100644 index 00000000..d77c2e03 --- /dev/null +++ b/New_APIs/Quizlet API/index.js @@ -0,0 +1,62 @@ +document.addEventListener('DOMContentLoaded', function () { + fetchQuizletStudySets(); + + document.getElementById('deployButton').addEventListener('click', async () => { + const appName = document.getElementById('deployAppName').value; + const sourceUrl = document.getElementById('deploySourceUrl').value; + const response = await fetch('/deploy', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ app_name: appName, source_url: sourceUrl }) + }); + const result = await response.json(); + console.log(result); + }); + + document.getElementById('scaleButton').addEventListener('click', async () => { + const appName = document.getElementById('scaleAppName').value; + const dynoType = document.getElementById('scaleDynoType').value; + const quantity = document.getElementById('scaleQuantity').value; + const response = await fetch('/scale', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ app_name: appName, dyno_type: dynoType, quantity: parseInt(quantity) }) + }); + const result = await response.json(); + console.log(result); + }); + + document.getElementById('logsButton').addEventListener('click', async () => { + const appName = document.getElementById('logsAppName').value; + const response = await fetch(`/logs?app_name=${appName}`); + const result = await response.json(); + const results = document.getElementById('results'); + results.innerHTML = JSON.stringify(result, null, 2); + }); +}); + +async function fetchQuizletStudySets() { + const accessToken = 'YOUR_QUIZLET_ACCESS_TOKEN'; + const endpoint = 'https://api.quizlet.com/2.0/sets'; + + fetch(endpoint, { + headers: { + 'Authorization': `Bearer ${accessToken}` + } + }) + .then(response => response.json()) + .then(data => { + const studySets = document.getElementById('studySets'); + data sets.forEach(set => { + const setItem = document.createElement('div'); + setItem.className = 'setItem'; + setItem.innerHTML = ` +

        ${set.title}

        +

        ${set.term_count} terms

        +

        ${set.description || 'No description available'}

        + `; + studySets.appendChild(setItem); + }); + }) + .catch(error => console.error('Error fetching study sets:', error)); +} diff --git a/New_APIs/Quizlet API/manifest.json b/New_APIs/Quizlet API/manifest.json new file mode 100644 index 00000000..73112213 --- /dev/null +++ b/New_APIs/Quizlet API/manifest.json @@ -0,0 +1,15 @@ +{ + "short_name": "QuizletApp", + "name": "Quizlet API Viewer App", + "icons": [ + { + "src": "icon.png", + "type": "image/png", + "sizes": "192x192" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/New_APIs/Quizlet API/package-lock.json b/New_APIs/Quizlet API/package-lock.json new file mode 100644 index 00000000..26de0d12 --- /dev/null +++ b/New_APIs/Quizlet API/package-lock.json @@ -0,0 +1,50 @@ +{ + "name": "quizlet-api-app", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-G7fYv8zS0D7ftu3gnLsOniwhgLU4k9v+1NEtFPP07/Oa8XJ51FtdUKLqIvsTcZo5ua23NO4s9Hr77BM19DOf1g==", + "requires": { + "accepts": "1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "cookie": "0.4.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "1.1.2", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "finalhandler": "1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "1.1.2", + "on-finished": "2.3.0", + "parseurl": "1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "2.0.6", + "qs": "6.7.0", + "range-parser": "1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "1.5.0", + "type-is": "1.6.18", + "utils-merge": "1.0.1", + "vary": "1.1.2" + } + }, + "quizlet-api": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/quizlet-api/-/quizlet-api-1.0.0.tgz", + "integrity": "sha512-3I5CVSy+mb/V9Fxh2RH1Hc+T4x+HbCu4Vj3H0nnJpItcLLt1s2M2n4c3lgY2yHsRHKvILwB3RZ/VZ1V6Dya0rA==" + } + } + } + \ No newline at end of file diff --git a/New_APIs/Quizlet API/package.json b/New_APIs/Quizlet API/package.json new file mode 100644 index 00000000..b5b06cb0 --- /dev/null +++ b/New_APIs/Quizlet API/package.json @@ -0,0 +1,16 @@ +{ + "name": "quizlet-api-app", + "version": "1.0.0", + "description": "A simple app to view Quizlet study sets", + "main": "index.js", + "scripts": { + "start": "node server.js" + }, + "author": "Your Name", + "license": "ISC", + "dependencies": { + "express": "^4.17.1", + "quizlet-api": "^1.0.0" + } + } + \ No newline at end of file diff --git a/New_APIs/Quizlet API/style.css b/New_APIs/Quizlet API/style.css new file mode 100644 index 00000000..c586d28c --- /dev/null +++ b/New_APIs/Quizlet API/style.css @@ -0,0 +1,52 @@ +body { + font-family: Arial, sans-serif; + background: linear-gradient(135deg, #89fffd, #ef32d9); + color: #fff; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + margin: 0; +} + +h1 { + font-size: 2.5em; + margin-bottom: 20px; +} + +#app { + text-align: center; + padding: 20px; + background: rgba(0, 0, 0, 0.5); + border-radius: 10px; +} + +h2 { + margin-top: 20px; + font-size: 1.5em; +} + +input, button { + margin: 10px 0; + padding: 10px; + border-radius: 5px; + border: none; +} + +button { + background: #ef32d9; + color: #fff; + cursor: pointer; +} + +button:hover { + background: #a726c1; +} + +#studySets .setItem { + margin-bottom: 15px; +} + +#results { + margin-top: 20px; +} diff --git a/New_APIs/README.md b/New_APIs/README.md index d2c3f33c..756848bc 100644 --- a/New_APIs/README.md +++ b/New_APIs/README.md @@ -18,4 +18,5 @@ [Result-marks Data api ](./Result-marks_API/)|this is for those who want to make college management project they can simple take this api and connect to project easily| |[Payment API](./Payment_API/)|This demonstrates how to integrate PayPal API for online payments. It handles payment success and cancellation scenarios.| |[Social Media Analytics API](./Social_Media_Analytics_AP/)|This demonstrates how to create a Social Media Analytics API to retrieve user engagement data like posts, likes, comments, and shares.| -|[Voice_Recognition_API](./Voice_Recognition_API/)|This demonstrates how a meachine retrieve user engagement only Voice| \ No newline at end of file +|[Voice_Recognition_API](./Voice_Recognition_API/)|This demonstrates how a meachine retrieve user engagement only Voice| + diff --git a/New_APIs/Scool-College-api/Readme.md b/New_APIs/Scool-College-api/Readme.md new file mode 100644 index 00000000..3b0079f7 --- /dev/null +++ b/New_APIs/Scool-College-api/Readme.md @@ -0,0 +1,40 @@ +# School & College Rating API + +## Author +sivaprasath2004 + +## Description +This API provides a comprehensive system for retrieving and managing ratings for schools and colleges. It allows users to search and filter educational institutions based on various criteria such as ID, name, city, location, and rating. This API is ideal for developers who need to integrate school and college rating data into their applications, ensuring they have access to up-to-date and accurate information. The API supports multiple endpoints to facilitate detailed and flexible queries, making it a powerful tool for education-related projects. + +## Routes + +### School +- Get all schools: `GET /school` +- Get a specific school by ID: `GET /school/id/:id` +- Get a specific school by name: `GET /school/name/:name` +- Get a specific school by city: `GET /school/city/:city` +- Get a specific school by location: `GET /school/location/:location` +- Get a specific school by rating: `GET /school/rating/:rating` + +### College +- Get all colleges: `GET /college` +- Get a specific college by ID: `GET /college/id/:id` +- Get a specific college by name: `GET /college/name/:name` +- Get a specific college by city: `GET /college/city/:city` +- Get a specific college by location: `GET /college/location/:location` +- Get a specific college by rating: `GET /college/rating/:rating` + +## Statistics +- Number of schools: 140+ +- Number of colleges: 200+ + +## Output + +![Screenshot from 2024-07-22 08-15-14](https://github.com/user-attachments/assets/ac21b1d6-8104-4508-b155-8f7bedec65bb) + +![Screenshot from 2024-07-22 08-14-51](https://github.com/user-attachments/assets/821b2872-1a80-40a0-b7d1-00cb63a9caa4) + +![Screenshot from 2024-07-22 08-15-04](https://github.com/user-attachments/assets/4162d3c9-c9cb-40db-88fb-f7f5e1207f38) + +![Screenshot from 2024-07-22 08-14-21](https://github.com/user-attachments/assets/d03666f5-2893-43b6-938c-0abfb8e0e700) + diff --git a/New_APIs/Scool-College-api/asset/Screenshot from 2024-07-22 08-14-21.png b/New_APIs/Scool-College-api/asset/Screenshot from 2024-07-22 08-14-21.png new file mode 100644 index 00000000..35897cac Binary files /dev/null and b/New_APIs/Scool-College-api/asset/Screenshot from 2024-07-22 08-14-21.png differ diff --git a/New_APIs/Scool-College-api/asset/Screenshot from 2024-07-22 08-14-51.png b/New_APIs/Scool-College-api/asset/Screenshot from 2024-07-22 08-14-51.png new file mode 100644 index 00000000..c625d26f Binary files /dev/null and b/New_APIs/Scool-College-api/asset/Screenshot from 2024-07-22 08-14-51.png differ diff --git a/New_APIs/Scool-College-api/asset/Screenshot from 2024-07-22 08-15-04.png b/New_APIs/Scool-College-api/asset/Screenshot from 2024-07-22 08-15-04.png new file mode 100644 index 00000000..087b10a1 Binary files /dev/null and b/New_APIs/Scool-College-api/asset/Screenshot from 2024-07-22 08-15-04.png differ diff --git a/New_APIs/Scool-College-api/asset/Screenshot from 2024-07-22 08-15-14.png b/New_APIs/Scool-College-api/asset/Screenshot from 2024-07-22 08-15-14.png new file mode 100644 index 00000000..25c6e708 Binary files /dev/null and b/New_APIs/Scool-College-api/asset/Screenshot from 2024-07-22 08-15-14.png differ diff --git a/New_APIs/Scool-College-api/asset/data.js b/New_APIs/Scool-College-api/asset/data.js new file mode 100644 index 00000000..3fa1947a --- /dev/null +++ b/New_APIs/Scool-College-api/asset/data.js @@ -0,0 +1,374 @@ + const School=[ + {"id": 1, "name": "Phillips Exeter Academy", "city": "Exeter", "location": "New Hampshire", "rating": "4.8"}, + {"id": 2, "name": "Phillips Academy Andover", "city": "Andover", "location": "Massachusetts", "rating": "4.7"}, + {"id": 3, "name": "St. Mark's School of Texas", "city": "Dallas", "location": "Texas", "rating": "4.6"}, + {"id": 4, "name": "The Lawrenceville School", "city": "Lawrenceville", "location": "New Jersey", "rating": "4.5"}, + {"id": 5, "name": "Choate Rosemary Hall", "city": "Wallingford", "location": "Connecticut", "rating": "4.5"}, + {"id": 6, "name": "The Hotchkiss School", "city": "Lakeville", "location": "Connecticut", "rating": "4.4"}, + {"id": 7, "name": "Groton School", "city": "Groton", "location": "Massachusetts", "rating": "4.3"}, + {"id": 8, "name": "The Thacher School", "city": "Ojai", "location": "California", "rating": "4.3"}, + {"id": 9, "name": "Horace Mann School", "city": "New York City", "location": "New York", "rating": "4.2"}, + {"id": 10, "name": "Deerfield Academy", "city": "Deerfield", "location": "Massachusetts", "rating": "4.2"}, + {"id": 11, "name": "The Loomis Chaffee School", "city": "Windsor", "location": "Connecticut", "rating": "4.1"}, + {"id": 12, "name": "Middlesex School", "city": "Concord", "location": "Massachusetts", "rating": "4.1"}, + {"id": 13, "name": "The Harker School", "city": "San Jose", "location": "California", "rating": "4.1"}, + {"id": 14, "name": "Milton Academy", "city": "Milton", "location": "Massachusetts", "rating": "4.0"}, + {"id": 15, "name": "Trinity School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 16, "name": "The Roxbury Latin School", "city": "West Roxbury", "location": "Massachusetts", "rating": "4.0"}, + {"id": 17, "name": "Harvard-Westlake School", "city": "Los Angeles", "location": "California", "rating": "4.0"}, + {"id": 18, "name": "The Brearley School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 19, "name": "St. Paul's School", "city": "Concord", "location": "New Hampshire", "rating": "4.0"}, + {"id": 20, "name": "The Webb Schools", "city": "Claremont", "location": "California", "rating": "4.0"}, + {"id": 21, "name": "Sidwell Friends School", "city": "Washington", "location": "District of Columbia", "rating": "4.0"}, + {"id": 22, "name": "Buckingham Browne & Nichols", "city": "Cambridge", "location": "Massachusetts", "rating": "4.0"}, + {"id": 23, "name": "The Latin School of Chicago", "city": "Chicago", "location": "Illinois", "rating": "4.0"}, + {"id": 24, "name": "The Spence School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 25, "name": "Collegiate School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 26, "name": "The Chapin School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 27, "name": "Crystal Springs Uplands School", "city": "Hillsborough", "location": "California", "rating": "4.0"}, + {"id": 28, "name": "National Cathedral School", "city": "Washington", "location": "District of Columbia", "rating": "4.0"}, + {"id": 29, "name": "Polytechnic School", "city": "Pasadena", "location": "California", "rating": "4.0"}, + {"id": 30, "name": "The Westminster Schools", "city": "Atlanta", "location": "Georgia", "rating": "4.0"}, + {"id": 31, "name": "Germantown Friends School", "city": "Philadelphia", "location": "Pennsylvania", "rating": "4.0"}, + {"id": 32, "name": "The Pingry School", "city": "Basking Ridge", "location": "New Jersey", "rating": "4.0"}, + {"id": 33, "name": "Ethical Culture Fieldston School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 34, "name": "The Potomac School", "city": "McLean", "location": "Virginia", "rating": "4.0"}, + {"id": 35, "name": "Head-Royce School", "city": "Oakland", "location": "California", "rating": "4.0"}, + {"id": 36, "name": "The Masters School", "city": "Dobbs Ferry", "location": "New York", "rating": "4.0"}, + {"id": 37, "name": "Ransom Everglades School", "city": "Miami", "location": "Florida", "rating": "4.0"}, + {"id": 38, "name": "Riverdale Country School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 39, "name": "Greens Farms Academy", "city": "Westport", "location": "Connecticut", "rating": "4.0"}, + {"id": 40, "name": "The Blake School", "city": "Minneapolis", "location": "Minnesota", "rating": "4.0"}, + {"id": 41, "name": "The Lovett School", "city": "Atlanta", "location": "Georgia", "rating": "4.0"}, + {"id": 42, "name": "The Bishop's School", "city": "La Jolla", "location": "California", "rating": "4.0"}, + {"id": 43, "name": "Hackley School", "city": "Tarrytown", "location": "New York", "rating": "4.0"}, + {"id": 44, "name": "The Dalton School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 45, "name": "Lakeside School", "city": "Seattle", "location": "Washington", "rating": "4.0"}, + {"id": 46, "name": "The Athenian School", "city": "Danville", "location": "California", "rating": "4.0"}, + {"id": 47, "name": "Kent School", "city": "Kent", "location": "Connecticut", "rating": "4.0"}, + {"id": 48, "name": "Marlborough School", "city": "Los Angeles", "location": "California", "rating": "4.0"}, + {"id": 49, "name": "Emma Willard School", "city": "Troy", "location": "New York", "rating": "4.0"}, + {"id": 50, "name": "St. John's School", "city": "Houston", "location": "Texas", "rating": "4.0"}, + {"id": 51, "name": "Hathaway Brown School", "city": "Shaker Heights", "location": "Ohio", "rating": "4.0"}, + {"id": 52, "name": "The Hewitt School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 53, "name": "The Wheeler School", "city": "Providence", "location": "Rhode Island", "rating": "4.0"}, + {"id": 54, "name": "The Green Vale School", "city": "Old Brookville", "location": "New York", "rating": "4.0"}, + {"id": 55, "name": "Riverdale Country School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 56, "name": "Martha's Vineyard Regional High School", "city": "Oak Bluffs", "location": "Massachusetts", "rating": "4.0"}, + {"id": 57, "name": "The Putney School", "city": "Putney", "location": "Vermont", "rating": "4.0"}, + {"id": 58, "name": "The Brearley School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 59, "name": "Montclair Kimberley Academy", "city": "Montclair", "location": "New Jersey", "rating": "4.0"}, + {"id": 60, "name": "Spence School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 61, "name": "Saint Ann's School", "city": "Brooklyn", "location": "New York", "rating": "4.0"}, + {"id": 62, "name": "The Dalton School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 63, "name": "The Madeira School", "city": "McLean", "location": "Virginia", "rating": "4.0"}, + {"id": 64, "name": "Northfield Mount Hermon", "city": "Mount Hermon", "location": "Massachusetts", "rating": "4.0"}, + {"id": 65, "name": "Salisbury School", "city": "Salisbury", "location": "Connecticut", "rating": "4.0"}, + {"id": 66, "name": "Westminster School", "city": "Simsbury", "location": "Connecticut", "rating": "4.0"}, + {"id": 67, "name": "Episcopal High School", "city": "Alexandria", "location": "Virginia", "rating": "4.0"}, + {"id": 68, "name": "Asheville School", "city": "Asheville", "location": "North Carolina", "rating": "4.0"}, + {"id": 69, "name": "St. Andrew's School", "city": "Middletown", "location": "Delaware", "rating": "4.0"}, + {"id": 70, "name": "The Ethel Walker School", "city": "Simsbury", "location": "Connecticut", "rating": "4.0"}, + {"id": 71, "name": "Kimball Union Academy", "city": "Meriden", "location": "New Hampshire", "rating": "4.0"}, + {"id": 72, "name": "Concord Academy", "city": "Concord", "location": "Massachusetts", "rating": "4.0"}, + {"id": 73, "name": "Suffield Academy", "city": "Suffield", "location": "Connecticut", "rating": "4.0"}, + {"id": 74, "name": "Holderness School", "city": "Holderness", "location": "New Hampshire", "rating": "4.0"}, + {"id": 75, "name": "Berkshire School", "city": "Sheffield", "location": "Massachusetts", "rating": "4.0"}, + {"id": 76, "name": "Miss Porter's School", "city": "Farmington", "location": "Connecticut", "rating": "4.0"}, + {"id": 77, "name": "St. George's School", "city": "Middletown", "location": "Rhode Island", "rating": "4.0"}, + {"id": 78, "name": "Webb School of Knoxville", "city": "Knoxville", "location": "Tennessee", "rating": "4.0"}, + {"id": 79, "name": "The Gunnery", "city": "Washington", "location": "Connecticut", "rating": "4.0"}, + {"id": 80, "name": "Peddie School", "city": "Hightstown", "location": "New Jersey", "rating": "4.0"}, + {"id": 81, "name": "Pomfret School", "city": "Pomfret", "location": "Connecticut", "rating": "4.0"}, + {"id": 82, "name": "The Pennington School", "city": "Pennington", "location": "New Jersey", "rating": "4.0"}, + {"id": 83, "name": "Portsmouth Abbey School", "city": "Portsmouth", "location": "Rhode Island", "rating": "4.0"}, + {"id": 84, "name": "Foxcroft School", "city": "Middleburg", "location": "Virginia", "rating": "4.0"}, + {"id": 85, "name": "The Wardlaw-Hartridge School", "city": "Edison", "location": "New Jersey", "rating": "4.0"}, + {"id": 86, "name": "Milton Hershey School", "city": "Hershey", "location": "Pennsylvania", "rating": "4.0"}, + {"id": 87, "name": "The Tatnall School", "city": "Wilmington", "location": "Delaware", "rating": "4.0"}, + {"id": 88, "name": "The Hun School of Princeton", "city": "Princeton", "location": "New Jersey", "rating": "4.0"}, + {"id": 89, "name": "The Harvey School", "city": "Katonah", "location": "New York", "rating": "4.0"}, + {"id": 90, "name": "Storm King School", "city": "Cornwall-on-Hudson", "location": "New York", "rating": "4.0"}, + {"id": 91, "name": "Oakwood Friends School", "city": "Poughkeepsie", "location": "New York", "rating": "4.0"}, + {"id": 92, "name": "Emmaus Christian Academy", "city": "Richmond", "location": "Virginia", "rating": "4.0"}, + {"id": 93, "name": "Newton Country Day School", "city": "Newton", "location": "Massachusetts", "rating": "4.0"}, + {"id": 94, "name": "Dana Hall School", "city": "Wellesley", "location": "Massachusetts", "rating": "4.0"}, + {"id": 95, "name": "The Cambridge School of Weston", "city": "Weston", "location": "Massachusetts", "rating": "4.0"}, + {"id": 96, "name": "Belmont Hill School", "city": "Belmont", "location": "Massachusetts", "rating": "4.0"}, + {"id": 97, "name": "St. Sebastian's School", "city": "Needham", "location": "Massachusetts", "rating": "4.0"}, + {"id": 98, "name": "Winsor School", "city": "Boston", "location": "Massachusetts", "rating": "4.0"}, + {"id": 99, "name": "Concord-Carlisle High School", "city": "Concord", "location": "Massachusetts", "rating": "4.0"}, + {"id": 100, "name": "St. Stephen's Episcopal School", "city": "Austin", "location": "Texas", "rating": "4.0"}, + {"id": 101, "name": "Cranbrook Schools", "city": "Bloomfield Hills", "location": "Michigan", "rating": "4.0"}, + {"id": 102, "name": "University of Chicago Laboratory Schools", "city": "Chicago", "location": "Illinois", "rating": "4.0"}, + {"id": 103, "name": "The Miami Valley School", "city": "Dayton", "location": "Ohio", "rating": "4.0"}, + {"id": 104, "name": "Carolina Day School", "city": "Asheville", "location": "North Carolina", "rating": "4.0"}, + {"id": 105, "name": "The Packer Collegiate Institute", "city": "Brooklyn", "location": "New York", "rating": "4.0"}, + {"id": 106, "name": "Friends Seminary", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 107, "name": "The Brearley School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 108, "name": "Ethical Culture Fieldston School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 109, "name": "The Brearley School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 110, "name": "Riverdale Country School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 111, "name": "The Chapin School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 112, "name": "Trinity School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 113, "name": "Horace Mann School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 114, "name": "The Spence School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 115, "name": "The Dalton School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 116, "name": "The Chapin School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 117, "name": "Collegiate School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 118, "name": "Friends Seminary", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 119, "name": "Poly Prep Country Day School", "city": "Brooklyn", "location": "New York", "rating": "4.0"}, + {"id": 120, "name": "The Brearley School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 121, "name": "The Spence School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 122, "name": "Trinity School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 123, "name": "Horace Mann School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 124, "name": "Collegiate School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 125, "name": "The Dalton School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 126, "name": "Ethical Culture Fieldston School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 127, "name": "Riverdale Country School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 128, "name": "The Chapin School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 129, "name": "Friends Seminary", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 130, "name": "The Spence School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 131, "name": "Poly Prep Country Day School", "city": "Brooklyn", "location": "New York", "rating": "4.0"}, + {"id": 132, "name": "Ethical Culture Fieldston School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 133, "name": "Riverdale Country School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 134, "name": "Friends Seminary", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 135, "name": "The Brearley School", "city": "New York City", "location": "New York", "rating": "4.0"}, + {"id": 136, "name": "Canterbury School", "city": "New Milford", "location": "Connecticut", "rating": "3.8"}, + {"id": 137, "name": "The Gunnery School", "city": "Washington", "location": "Connecticut", "rating": "3.8"}, + {"id": 138, "name": "The Madeira School", "city": "McLean", "location": "Virginia", "rating": "3.7"}, + {"id": 139, "name": "Proctor Academy", "city": "Andover", "location": "New Hampshire", "rating": "3.7"}, + {"id": 140, "name": "St. Timothy's School", "city": "Stevenson", "location": "Maryland", "rating": "3.6"}, + {"id": 141, "name": "Hebron Academy", "city": "Hebron", "location": "Maine", "rating": "3.6"}, + {"id": 142, "name": "Sandy Spring Friends School", "city": "Sandy Spring", "location": "Maryland", "rating": "3.5"}, + {"id": 143, "name": "Worcester Academy", "city": "Worcester", "location": "Massachusetts", "rating": "3.5"}, + {"id": 144, "name": "Gould Academy", "city": "Bethel", "location": "Maine", "rating": "3.4"}, + {"id": 145, "name": "Vermont Academy", "city": "Saxtons River", "location": "Vermont", "rating": "3.4"} +] + +const College=[ + {"id": 1, "name": "Harvard University", "city": "Cambridge", "location": "Massachusetts", "rating": "4.8"}, + {"id": 2, "name": "Stanford University", "city": "Stanford", "location": "California", "rating": "4.8"}, + {"id": 3, "name": "Massachusetts Institute of Technology", "city": "Cambridge", "location": "Massachusetts", "rating": "4.9"}, + {"id": 4, "name": "California Institute of Technology", "city": "Pasadena", "location": "California", "rating": "4.8"}, + {"id": 5, "name": "University of Chicago", "city": "Chicago", "location": "Illinois", "rating": "4.7"}, + {"id": 6, "name": "Princeton University", "city": "Princeton", "location": "New Jersey", "rating": "4.8"}, + {"id": 7, "name": "Columbia University", "city": "New York City", "location": "New York", "rating": "4.7"}, + {"id": 8, "name": "Yale University", "city": "New Haven", "location": "Connecticut", "rating": "4.7"}, + {"id": 9, "name": "University of Pennsylvania", "city": "Philadelphia", "location": "Pennsylvania", "rating": "4.6"}, + {"id": 10, "name": "Duke University", "city": "Durham", "location": "North Carolina", "rating": "4.6"}, + {"id": 11, "name": "University of California, Berkeley", "city": "Berkeley", "location": "California", "rating": "4.5"}, + {"id": 12, "name": "University of California, Los Angeles", "city": "Los Angeles", "location": "California", "rating": "4.5"}, + {"id": 13, "name": "University of Michigan", "city": "Ann Arbor", "location": "Michigan", "rating": "4.5"}, + {"id": 14, "name": "University of Virginia", "city": "Charlottesville", "location": "Virginia", "rating": "4.5"}, + {"id": 15, "name": "University of California, San Diego", "city": "La Jolla", "location": "California", "rating": "4.4"}, + {"id": 16, "name": "University of California, Santa Barbara", "city": "Santa Barbara", "location": "California", "rating": "4.4"}, + {"id": 17, "name": "University of California, Irvine", "city": "Irvine", "location": "California", "rating": "4.4"}, + {"id": 18, "name": "University of Southern California", "city": "Los Angeles", "location": "California", "rating": "4.4"}, + {"id": 19, "name": "Northwestern University", "city": "Evanston", "location": "Illinois", "rating": "4.5"}, + {"id": 20, "name": "University of Notre Dame", "city": "Notre Dame", "location": "Indiana", "rating": "4.4"}, + {"id": 21, "name": "Johns Hopkins University", "city": "Baltimore", "location": "Maryland", "rating": "4.5"}, + {"id": 22, "name": "University of Washington", "city": "Seattle", "location": "Washington", "rating": "4.3"}, + {"id": 23, "name": "University of California, Davis", "city": "Davis", "location": "California", "rating": "4.3"}, + {"id": 24, "name": "University of Wisconsin-Madison", "city": "Madison", "location": "Wisconsin", "rating": "4.3"}, + {"id": 25, "name": "University of Texas at Austin", "city": "Austin", "location": "Texas", "rating": "4.3"}, + {"id": 26, "name": "University of Illinois at Urbana-Champaign", "city": "Champaign", "location": "Illinois", "rating": "4.3"}, + {"id": 27, "name": "University of Florida", "city": "Gainesville", "location": "Florida", "rating": "4.2"}, + {"id": 28, "name": "University of Maryland, College Park", "city": "College Park", "location": "Maryland", "rating": "4.2"}, + {"id": 29, "name": "University of Pittsburgh", "city": "Pittsburgh", "location": "Pennsylvania", "rating": "4.2"}, + {"id": 30, "name": "University of North Carolina at Chapel Hill", "city": "Chapel Hill", "location": "North Carolina", "rating": "4.2"}, + {"id": 31, "name": "University of Minnesota", "city": "Minneapolis", "location": "Minnesota", "rating": "4.2"}, + {"id": 32, "name": "University of California, Riverside", "city": "Riverside", "location": "California", "rating": "4.1"}, + {"id": 33, "name": "University of Arizona", "city": "Tucson", "location": "Arizona", "rating": "4.1"}, + {"id": 34, "name": "University of Colorado Boulder", "city": "Boulder", "location": "Colorado", "rating": "4.1"}, + {"id": 35, "name": "University of Miami", "city": "Coral Gables", "location": "Florida", "rating": "4.1"}, + {"id": 36, "name": "University of Georgia", "city": "Athens", "location": "Georgia", "rating": "4.0"}, + {"id": 37, "name": "University of Iowa", "city": "Iowa City", "location": "Iowa", "rating": "4.0"}, + {"id": 38, "name": "University of Oregon", "city": "Eugene", "location": "Oregon", "rating": "4.0"}, + {"id": 39, "name": "University of Kansas", "city": "Lawrence", "location": "Kansas", "rating": "4.0"}, + {"id": 40, "name": "University of Nebraska-Lincoln", "city": "Lincoln", "location": "Nebraska", "rating": "4.0"}, + {"id": 41, "name": "University of Utah", "city": "Salt Lake City", "location": "Utah", "rating": "4.0"}, + {"id": 42, "name": "University of Alabama", "city": "Tuscaloosa", "location": "Alabama", "rating": "4.0"}, + {"id": 43, "name": "University of Tennessee", "city": "Knoxville", "location": "Tennessee", "rating": "4.0"}, + {"id": 44, "name": "University of Oklahoma", "city": "Norman", "location": "Oklahoma", "rating": "4.0"}, + {"id": 45, "name": "University of South Carolina", "city": "Columbia", "location": "South Carolina", "rating": "4.0"}, + {"id": 46, "name": "University of Mississippi", "city": "University", "location": "Mississippi", "rating": "4.0"}, + {"id": 47, "name": "University of Arkansas", "city": "Fayetteville", "location": "Arkansas", "rating": "4.0"}, + {"id": 48, "name": "University of Nevada, Reno", "city": "Reno", "location": "Nevada", "rating": "4.0"}, + {"id": 49, "name": "University of Washington, Seattle", "city": "Seattle", "location": "Washington", "rating": "4.0"}, + {"id": 50, "name": "University of Hawaii at Manoa", "city": "Honolulu", "location": "Hawaii", "rating": "4.0"}, + {"id": 51, "name": "University of New Mexico", "city": "Albuquerque", "location": "New Mexico", "rating": "4.0"}, + {"id": 52, "name": "University of Rhode Island", "city": "Kingston", "location": "Rhode Island", "rating": "4.0"}, + {"id": 53, "name": "University of Vermont", "city": "Burlington", "location": "Vermont", "rating": "4.0"}, + {"id": 54, "name": "University of Connecticut", "city": "Storrs", "location": "Connecticut", "rating": "4.0"}, + {"id": 55, "name": "University of Maine", "city": "Orono", "location": "Maine", "rating": "4.0"}, + {"id": 56, "name": "University of North Dakota", "city": "Grand Forks", "location": "North Dakota", "rating": "4.0"}, + {"id": 57, "name": "University of South Dakota", "city": "Vermillion", "location": "South Dakota", "rating": "4.0"}, + {"id": 58, "name": "University of West Virginia", "city": "Morgantown", "location": "West Virginia", "rating": "4.0"}, + {"id": 59, "name": "University of Wyoming", "city": "Laramie", "location": "Wyoming", "rating": "4.0"}, + {"id": 60, "name": "American University", "city": "Washington", "location": "District of Columbia", "rating": "4.0"}, + {"id": 61, "name": "Boston College", "city": "Chestnut Hill", "location": "Massachusetts", "rating": "4.1"}, + {"id": 62, "name": "University of Denver", "city": "Denver", "location": "Colorado", "rating": "4.0"}, + {"id": 63, "name": "Tulane University", "city": "New Orleans", "location": "Louisiana", "rating": "4.1"}, + {"id": 64, "name": "Wake Forest University", "city": "Winston-Salem", "location": "North Carolina", "rating": "4.1"}, + {"id": 65, "name": "Emory University", "city": "Atlanta", "location": "Georgia", "rating": "4.2"}, + {"id": 66, "name": "University of Richmond", "city": "Richmond", "location": "Virginia", "rating": "4.2"}, + {"id": 67, "name": "Vanderbilt University", "city": "Nashville", "location": "Tennessee", "rating": "4.3"}, + {"id": 68, "name": "George Washington University", "city": "Washington", "location": "District of Columbia", "rating": "4.2"}, + {"id": 69, "name": "Claremont McKenna College", "city": "Claremont", "location": "California", "rating": "4.3"}, + {"id": 70, "name": "Pomona College", "city": "Claremont", "location": "California", "rating": "4.4"}, + {"id": 71, "name": "Harvey Mudd College", "city": "Claremont", "location": "California", "rating": "4.5"}, + {"id": 72, "name": "Scripps College", "city": "Claremont", "location": "California", "rating": "4.3"}, + {"id": 73, "name": "Pitzer College", "city": "Claremont", "location": "California", "rating": "4.2"}, + {"id": 74, "name": "Swarthmore College", "city": "Swarthmore", "location": "Pennsylvania", "rating": "4.4"}, + {"id": 75, "name": "Wellesley College", "city": "Wellesley", "location": "Massachusetts", "rating": "4.4"}, + {"id": 76, "name": "Smith College", "city": "Northampton", "location": "Massachusetts", "rating": "4.4"}, + {"id": 77, "name": "Bryn Mawr College", "city": "Bryn Mawr", "location": "Pennsylvania", "rating": "4.3"}, + {"id": 78, "name": "Mount Holyoke College", "city": "South Hadley", "location": "Massachusetts", "rating": "4.2"}, + {"id": 79, "name": "The College of William & Mary", "city": "Williamsburg", "location": "Virginia", "rating": "4.3"}, + {"id": 80, "name": "Skidmore College", "city": "Saratoga Springs", "location": "New York", "rating": "4.2"}, + {"id": 81, "name": "Hamilton College", "city": "Clinton", "location": "New York", "rating": "4.3"}, + {"id": 82, "name": "Colgate University", "city": "Hamilton", "location": "New York", "rating": "4.4"}, + {"id": 83, "name": "Vassar College", "city": "Poughkeepsie", "location": "New York", "rating": "4.3"}, + {"id": 84, "name": "Wesleyan University", "city": "Middletown", "location": "Connecticut", "rating": "4.4"}, + {"id": 85, "name": "Oberlin College", "city": "Oberlin", "location": "Ohio", "rating": "4.2"}, + {"id": 86, "name": "Kenyon College", "city": "Gambier", "location": "Ohio", "rating": "4.3"}, + {"id": 87, "name": "Carleton College", "city": "Northfield", "location": "Minnesota", "rating": "4.4"}, + {"id": 88, "name": "Macalester College", "city": "St. Paul", "location": "Minnesota", "rating": "4.3"}, + {"id": 89, "name": "Grinnell College", "city": "Grinnell", "location": "Iowa", "rating": "4.2"}, + {"id": 90, "name": "Bates College", "city": "Lewiston", "location": "Maine", "rating": "4.1"}, + {"id": 91, "name": "Bowdoin College", "city": "Brunswick", "location": "Maine", "rating": "4.3"}, + {"id": 92, "name": "Middlebury College", "city": "Middlebury", "location": "Vermont", "rating": "4.4"}, + {"id": 93, "name": "Haverford College", "city": "Haverford", "location": "Pennsylvania", "rating": "4.3"}, + {"id": 94, "name": "Swarthmore College", "city": "Swarthmore", "location": "Pennsylvania", "rating": "4.4"}, + {"id": 95, "name": "University of Chicago", "city": "Chicago", "location": "Illinois", "rating": "4.7"}, + {"id": 96, "name": "Dartmouth College", "city": "Hanover", "location": "New Hampshire", "rating": "4.5"}, + {"id": 97, "name": "University of California, Los Angeles", "city": "Los Angeles", "location": "California", "rating": "4.5"}, + {"id": 98, "name": "University of Southern California", "city": "Los Angeles", "location": "California", "rating": "4.4"}, + {"id": 99, "name": "University of Virginia", "city": "Charlottesville", "location": "Virginia", "rating": "4.5"}, + {"id": 100, "name": "University of Pennsylvania", "city": "Philadelphia", "location": "Pennsylvania", "rating": "4.6"}, + {"id": 101, "name": "Georgetown University", "city": "Washington", "location": "District of Columbia", "rating": "4.4"}, + {"id": 102, "name": "University of North Carolina at Chapel Hill", "city": "Chapel Hill", "location": "North Carolina", "rating": "4.3"}, + {"id": 103, "name": "University of Michigan", "city": "Ann Arbor", "location": "Michigan", "rating": "4.5"}, + {"id": 104, "name": "University of California, Berkeley", "city": "Berkeley", "location": "California", "rating": "4.5"}, + {"id": 105, "name": "University of Texas at Austin", "city": "Austin", "location": "Texas", "rating": "4.3"}, + {"id": 106, "name": "University of California, Davis", "city": "Davis", "location": "California", "rating": "4.2"}, + {"id": 107, "name": "University of Wisconsin-Madison", "city": "Madison", "location": "Wisconsin", "rating": "4.2"}, + {"id": 108, "name": "University of Florida", "city": "Gainesville", "location": "Florida", "rating": "4.1"}, + {"id": 109, "name": "University of Illinois at Urbana-Champaign", "city": "Champaign", "location": "Illinois", "rating": "4.2"}, + {"id": 110, "name": "University of Washington", "city": "Seattle", "location": "Washington", "rating": "4.3"}, + {"id": 111, "name": "University of Maryland, College Park", "city": "College Park", "location": "Maryland", "rating": "4.2"}, + {"id": 112, "name": "University of Iowa", "city": "Iowa City", "location": "Iowa", "rating": "4.0"}, + {"id": 113, "name": "University of Colorado Boulder", "city": "Boulder", "location": "Colorado", "rating": "4.1"}, + {"id": 114, "name": "University of Arizona", "city": "Tucson", "location": "Arizona", "rating": "4.1"}, + {"id": 115, "name": "University of Miami", "city": "Coral Gables", "location": "Florida", "rating": "4.1"}, + {"id": 116, "name": "University of Oregon", "city": "Eugene", "location": "Oregon", "rating": "4.0"}, + {"id": 117, "name": "University of Georgia", "city": "Athens", "location": "Georgia", "rating": "4.1"}, + {"id": 118, "name": "University of Alabama", "city": "Tuscaloosa", "location": "Alabama", "rating": "4.0"}, + {"id": 119, "name": "University of South Carolina", "city": "Columbia", "location": "South Carolina", "rating": "4.1"}, + {"id": 120, "name": "University of Tennessee", "city": "Knoxville", "location": "Tennessee", "rating": "4.0"}, + {"id": 121, "name": "University of Oklahoma", "city": "Norman", "location": "Oklahoma", "rating": "4.0"}, + {"id": 122, "name": "University of Arkansas", "city": "Fayetteville", "location": "Arkansas", "rating": "4.0"}, + {"id": 123, "name": "University of Nevada, Reno", "city": "Reno", "location": "Nevada", "rating": "4.0"}, + {"id": 124, "name": "University of West Virginia", "city": "Morgantown", "location": "West Virginia", "rating": "4.0"}, + {"id": 125, "name": "American University", "city": "Washington", "location": "District of Columbia", "rating": "4.0"}, + {"id": 126, "name": "Boston College", "city": "Chestnut Hill", "location": "Massachusetts", "rating": "4.1"}, + {"id": 127, "name": "Tulane University", "city": "New Orleans", "location": "Louisiana", "rating": "4.1"}, + {"id": 128, "name": "Wake Forest University", "city": "Winston-Salem", "location": "North Carolina", "rating": "4.1"}, + {"id": 129, "name": "Emory University", "city": "Atlanta", "location": "Georgia", "rating": "4.2"}, + {"id": 130, "name": "University of Richmond", "city": "Richmond", "location": "Virginia", "rating": "4.2"}, + {"id": 131, "name": "Vanderbilt University", "city": "Nashville", "location": "Tennessee", "rating": "4.3"}, + {"id": 132, "name": "George Washington University", "city": "Washington", "location": "District of Columbia", "rating": "4.2"}, + {"id": 133, "name": "Claremont McKenna College", "city": "Claremont", "location": "California", "rating": "4.3"}, + {"id": 134, "name": "Pomona College", "city": "Claremont", "location": "California", "rating": "4.4"}, + {"id": 135, "name": "Harvey Mudd College", "city": "Claremont", "location": "California", "rating": "4.5"}, + {"id": 136, "name": "Scripps College", "city": "Claremont", "location": "California", "rating": "4.3"}, + {"id": 137, "name": "Pitzer College", "city": "Claremont", "location": "California", "rating": "4.2"}, + {"id": 138, "name": "Swarthmore College", "city": "Swarthmore", "location": "Pennsylvania", "rating": "4.4"}, + {"id": 139, "name": "Wellesley College", "city": "Wellesley", "location": "Massachusetts", "rating": "4.4"}, + {"id": 140, "name": "Smith College", "city": "Northampton", "location": "Massachusetts", "rating": "4.4"}, + {"id": 141, "name": "Bryn Mawr College", "city": "Bryn Mawr", "location": "Pennsylvania", "rating": "4.3"}, + {"id": 142, "name": "Mount Holyoke College", "city": "South Hadley", "location": "Massachusetts", "rating": "4.2"}, + {"id": 143, "name": "The College of William & Mary", "city": "Williamsburg", "location": "Virginia", "rating": "4.3"}, + {"id": 144, "name": "Skidmore College", "city": "Saratoga Springs", "location": "New York", "rating": "4.2"}, + {"id": 145, "name": "Hamilton College", "city": "Clinton", "location": "New York", "rating": "4.3"}, + {"id": 146, "name": "Colgate University", "city": "Hamilton", "location": "New York", "rating": "4.4"}, + {"id": 147, "name": "Vassar College", "city": "Poughkeepsie", "location": "New York", "rating": "4.3"}, + {"id": 148, "name": "Wesleyan University", "city": "Middletown", "location": "Connecticut", "rating": "4.4"}, + {"id": 149, "name": "Oberlin College", "city": "Oberlin", "location": "Ohio", "rating": "4.2"}, + {"id": 150, "name": "Kenyon College", "city": "Gambier", "location": "Ohio", "rating": "4.3"}, + {"id": 151, "name": "Carleton College", "city": "Northfield", "location": "Minnesota", "rating": "4.4"}, + {"id": 152, "name": "Macalester College", "city": "St. Paul", "location": "Minnesota", "rating": "4.3"}, + {"id": 153, "name": "Grinnell College", "city": "Grinnell", "location": "Iowa", "rating": "4.2"}, + {"id": 154, "name": "Bates College", "city": "Lewiston", "location": "Maine", "rating": "4.1"}, + {"id": 155, "name": "Bowdoin College", "city": "Brunswick", "location": "Maine", "rating": "4.3"}, + {"id": 156, "name": "Middlebury College", "city": "Middlebury", "location": "Vermont", "rating": "4.4"}, + {"id": 157, "name": "Haverford College", "city": "Haverford", "location": "Pennsylvania", "rating": "4.3"}, + {"id": 158, "name": "Swarthmore College", "city": "Swarthmore", "location": "Pennsylvania", "rating": "4.4"}, + {"id": 159, "name": "University of Chicago", "city": "Chicago", "location": "Illinois", "rating": "4.7"}, + {"id": 160, "name": "Dartmouth College", "city": "Hanover", "location": "New Hampshire", "rating": "4.5"}, + {"id": 161, "name": "University of California, Los Angeles", "city": "Los Angeles", "location": "California", "rating": "4.5"}, + {"id": 162, "name": "University of Southern California", "city": "Los Angeles", "location": "California", "rating": "4.4"}, + {"id": 163, "name": "University of Virginia", "city": "Charlottesville", "location": "Virginia", "rating": "4.5"}, + {"id": 164, "name": "University of Pennsylvania", "city": "Philadelphia", "location": "Pennsylvania", "rating": "4.6"}, + {"id": 165, "name": "Georgetown University", "city": "Washington", "location": "District of Columbia", "rating": "4.4"}, + {"id": 166, "name": "University of North Carolina at Chapel Hill", "city": "Chapel Hill", "location": "North Carolina", "rating": "4.3"}, + {"id": 167, "name": "University of Michigan", "city": "Ann Arbor", "location": "Michigan", "rating": "4.5"}, + {"id": 168, "name": "University of California, Berkeley", "city": "Berkeley", "location": "California", "rating": "4.5"}, + {"id": 169, "name": "University of Texas at Austin", "city": "Austin", "location": "Texas", "rating": "4.3"}, + {"id": 170, "name": "University of California, Davis", "city": "Davis", "location": "California", "rating": "4.2"}, + {"id": 171, "name": "University of Wisconsin-Madison", "city": "Madison", "location": "Wisconsin", "rating": "4.2"}, + {"id": 172, "name": "University of Florida", "city": "Gainesville", "location": "Florida", "rating": "4.1"}, + {"id": 173, "name": "University of Illinois at Urbana-Champaign", "city": "Champaign", "location": "Illinois", "rating": "4.2"}, + {"id": 174, "name": "University of Washington", "city": "Seattle", "location": "Washington", "rating": "4.3"}, + {"id": 175, "name": "University of Maryland, College Park", "city": "College Park", "location": "Maryland", "rating": "4.2"}, + {"id": 176, "name": "University of Iowa", "city": "Iowa City", "location": "Iowa", "rating": "4.0"}, + {"id": 177, "name": "University of Colorado Boulder", "city": "Boulder", "location": "Colorado", "rating": "4.1"}, + {"id": 178, "name": "University of Arizona", "city": "Tucson", "location": "Arizona", "rating": "4.1"}, + {"id": 179, "name": "University of Miami", "city": "Coral Gables", "location": "Florida", "rating": "4.1"}, + {"id": 180, "name": "University of Oregon", "city": "Eugene", "location": "Oregon", "rating": "4.0"}, + {"id": 181, "name": "University of Georgia", "city": "Athens", "location": "Georgia", "rating": "4.1"}, + {"id": 182, "name": "University of Alabama", "city": "Tuscaloosa", "location": "Alabama", "rating": "4.0"}, + {"id": 183, "name": "University of South Carolina", "city": "Columbia", "location": "South Carolina", "rating": "4.1"}, + {"id": 184, "name": "University of Tennessee", "city": "Knoxville", "location": "Tennessee", "rating": "4.0"}, + {"id": 185, "name": "University of Oklahoma", "city": "Norman", "location": "Oklahoma", "rating": "4.0"}, + {"id": 186, "name": "University of Arkansas", "city": "Fayetteville", "location": "Arkansas", "rating": "4.0"}, + {"id": 187, "name": "University of Nevada, Reno", "city": "Reno", "location": "Nevada", "rating": "4.0"}, + {"id": 188, "name": "University of West Virginia", "city": "Morgantown", "location": "West Virginia", "rating": "4.0"}, + {"id": 189, "name": "American University", "city": "Washington", "location": "District of Columbia", "rating": "4.0"}, + {"id": 190, "name": "Boston College", "city": "Chestnut Hill", "location": "Massachusetts", "rating": "4.1"}, + {"id": 191, "name": "Tulane University", "city": "New Orleans", "location": "Louisiana", "rating": "4.1"}, + {"id": 192, "name": "Wake Forest University", "city": "Winston-Salem", "location": "North Carolina", "rating": "4.1"}, + {"id": 193, "name": "Emory University", "city": "Atlanta", "location": "Georgia", "rating": "4.2"}, + {"id": 194, "name": "University of Richmond", "city": "Richmond", "location": "Virginia", "rating": "4.2"}, + {"id": 195, "name": "Vanderbilt University", "city": "Nashville", "location": "Tennessee", "rating": "4.3"}, + {"id": 196, "name": "George Washington University", "city": "Washington", "location": "District of Columbia", "rating": "4.2"}, + {"id": 197, "name": "Claremont McKenna College", "city": "Claremont", "location": "California", "rating": "4.3"}, + {"id": 198, "name": "Pomona College", "city": "Claremont", "location": "California", "rating": "4.4"}, + {"id": 199, "name": "Harvey Mudd College", "city": "Claremont", "location": "California", "rating": "4.5"}, + {"id": 200, "name": "Scripps College", "city": "Claremont", "location": "California", "rating": "4.3"}, + {"id": 201, "name": "Pitzer College", "city": "Claremont", "location": "California", "rating": "4.2"}, + {"id": 202, "name": "Swarthmore College", "city": "Swarthmore", "location": "Pennsylvania", "rating": "4.4"}, + {"id": 203, "name": "Wellesley College", "city": "Wellesley", "location": "Massachusetts", "rating": "4.4"}, + {"id": 204, "name": "Smith College", "city": "Northampton", "location": "Massachusetts", "rating": "4.4"}, + {"id": 205, "name": "Bryn Mawr College", "city": "Bryn Mawr", "location": "Pennsylvania", "rating": "4.3"}, + {"id": 206, "name": "Mount Holyoke College", "city": "South Hadley", "location": "Massachusetts", "rating": "4.2"}, + {"id": 207, "name": "The College of William & Mary", "city": "Williamsburg", "location": "Virginia", "rating": "4.3"}, + {"id": 208, "name": "Skidmore College", "city": "Saratoga Springs", "location": "New York", "rating": "4.2"}, + {"id": 209, "name": "Hamilton College", "city": "Clinton", "location": "New York", "rating": "4.3"}, + {"id": 210, "name": "Colgate University", "city": "Hamilton", "location": "New York", "rating": "4.4"}, + {"id": 211, "name": "Vassar College", "city": "Poughkeepsie", "location": "New York", "rating": "4.3"}, + {"id": 212, "name": "Wesleyan University", "city": "Middletown", "location": "Connecticut", "rating": "4.4"}, + {"id": 213, "name": "Oberlin College", "city": "Oberlin", "location": "Ohio", "rating": "4.2"}, + {"id": 214, "name": "Kenyon College", "city": "Gambier", "location": "Ohio", "rating": "4.3"}, + {"id": 215, "name": "Carleton College", "city": "Northfield", "location": "Minnesota", "rating": "4.4"}, + {"id": 216, "name": "Macalester College", "city": "St. Paul", "location": "Minnesota", "rating": "4.3"}, + {"id": 217, "name": "Grinnell College", "city": "Grinnell", "location": "Iowa", "rating": "4.2"}, + {"id": 218, "name": "Bates College", "city": "Lewiston", "location": "Maine", "rating": "4.1"}, + {"id": 219, "name": "Bowdoin College", "city": "Brunswick", "location": "Maine", "rating": "4.3"}, + {"id": 220, "name": "Middlebury College", "city": "Middlebury", "location": "Vermont", "rating": "4.4"}, + {"id": 221, "name": "Haverford College", "city": "Haverford", "location": "Pennsylvania", "rating": "4.3"}, + {"id": 222, "name": "Swarthmore College", "city": "Swarthmore", "location": "Pennsylvania", "rating": "4.4"} +] + +module.exports={School,College} \ No newline at end of file diff --git a/New_APIs/Scool-College-api/index.js b/New_APIs/Scool-College-api/index.js new file mode 100644 index 00000000..ffcadfb5 --- /dev/null +++ b/New_APIs/Scool-College-api/index.js @@ -0,0 +1,71 @@ +const express=require("express") +const app=express() +const cors=require('cors') +const {School,College}=require('./asset/data') +app.use(cors()) +app.get("/",(req,res)=>{ + res.send({ + title:"school & college rating api", + author:"sivaprasath2004", + Routes:{ + school:{ + all:"/school", + Specific_school_id:"/school/id/:id", + Specific_school_name:"/school/name/:name", + Specific_school_city:"/school/city/:city", + Specific_school_location:"/school/location/:location", + Specific_school_rating:"/school/rating/:rating", + }, + college:{ + all:"/college", + specific_college_id:"/college/id/:id", + specific_college_name:"/college/name/:name", + specific_college_city:"/college/city/:city", + specific_college_location:"/college/location/:location", + specific_college_rating:"/college/rating/:rating" + }, + }, + school_count:"140+", + college_count:"200+" + }) +}) +app.get("/school",(req,res)=>{ + res.send(School) +}) +app.get("/college",(req,res)=>{ + res.send(College) +}) +app.get("/:category/:type",(req,res)=>{ + if(req.params.category==="school"){ + res.send(School) + } + else if(req.params.category==="college"){ + res.send(College) + } + else{ + res.send(`no results found on the ${req.params.category}`) + } +}) +app.get("/:category/:type/:data",(req,res)=>{ + if(req.params.category==="school"){ + let finder=School.filter((item)=> req.params.type=="id"?item[req.params.type]==req.params.data:item[req.params.type].toLowerCase()==req.params.data.toLowerCase()) + if(finder.length>0){ + res.send(finder) + } + else{ + res.send("no more match results") + } + } + else if(req.params.category==="college"){ + let finder=College.filter((item)=> req.params.type=="id"?item[req.params.type]==req.params.data:item[req.params.type].toLowerCase()==req.params.data.toLowerCase()) + if(finder.length>0){ + res.send(finder) + } + else{ + res.send("no more match results") + } + }else{ + res.send(`no results found on the ${req.params.category}`) + } +}) +app.listen(5000,()=>{console.log('app listen in 5000')}) \ No newline at end of file diff --git a/New_APIs/Scool-College-api/package-lock.json b/New_APIs/Scool-College-api/package-lock.json new file mode 100644 index 00000000..55efa8ac --- /dev/null +++ b/New_APIs/Scool-College-api/package-lock.json @@ -0,0 +1,730 @@ +{ + "name": "scool-college-api", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "scool-college-api", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "cors": "^2.8.5", + "dotenv": "^16.4.5", + "express": "^4.19.2" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.2", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.6.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + } + } +} diff --git a/New_APIs/Scool-College-api/package.json b/New_APIs/Scool-College-api/package.json new file mode 100644 index 00000000..1902dd89 --- /dev/null +++ b/New_APIs/Scool-College-api/package.json @@ -0,0 +1,17 @@ +{ + "name": "scool-college-api", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "description": "", + "dependencies": { + "cors": "^2.8.5", + "dotenv": "^16.4.5", + "express": "^4.19.2" + } +} diff --git a/New_APIs/Streamlabs API/Readme.md b/New_APIs/Streamlabs API/Readme.md new file mode 100644 index 00000000..f727c89a --- /dev/null +++ b/New_APIs/Streamlabs API/Readme.md @@ -0,0 +1,70 @@ +# Streamlabs API Integration + +This project demonstrates how to interact with the Streamlabs API using Node.js. It allows you to authenticate with Streamlabs, fetch user data, and manage donations. + +## Prerequisites + +- Node.js +- npm or yarn +- Streamlabs account +- Streamlabs API client ID and client secret + +## Getting Started + +### Installation + +1. Clone the repository: + + ```sh + git clone https://github.com/yourusername/streamlabs-api-integration.git + cd streamlabs-api-integration + ``` + +2. Install the dependencies: + + ```sh + npm install + ``` + + or + + ```sh + yarn install + ``` + +### Configuration + +1. Create a `.env` file in the root directory and add your Streamlabs client ID, client secret, and redirect URI: + + ```env + CLIENT_ID=your_client_id + CLIENT_SECRET=your_client_secret + REDIRECT_URI=http://localhost:3000/callback + ``` + +### Running the Application + +1. Start the application: + + ```sh + npm start + ``` + + or + + ```sh + yarn start + ``` + +2. Open your browser and navigate to `http://localhost:3000`. You will be redirected to the Streamlabs authentication page. + +3. After successful authentication, you will be redirected back to the application with your access token. + +## Usage + +### Fetching User Data + +To fetch user data, make a GET request to the `/user` endpoint: + +```sh +curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" http://localhost:3000/user diff --git a/New_APIs/Streamlabs API/index.html b/New_APIs/Streamlabs API/index.html new file mode 100644 index 00000000..c0b5b210 --- /dev/null +++ b/New_APIs/Streamlabs API/index.html @@ -0,0 +1,31 @@ + + + + + + + Streamlabs API Viewer + + +

        Streamlabs API Viewer

        +
        +

        Donation List

        +
        +

        Deploy

        + + + +

        Scale

        + + + + +

        Logs

        + + +
          +
          + + + + diff --git a/New_APIs/Streamlabs API/index.js b/New_APIs/Streamlabs API/index.js new file mode 100644 index 00000000..d487cbba --- /dev/null +++ b/New_APIs/Streamlabs API/index.js @@ -0,0 +1,62 @@ +document.addEventListener('DOMContentLoaded', function () { + fetchStreamlabsDonations(); + + document.getElementById('deployButton').addEventListener('click', async () => { + const appName = document.getElementById('deployAppName').value; + const sourceUrl = document.getElementById('deploySourceUrl').value; + const response = await fetch('/deploy', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ app_name: appName, source_url: sourceUrl }) + }); + const result = await response.json(); + console.log(result); + }); + + document.getElementById('scaleButton').addEventListener('click', async () => { + const appName = document.getElementById('scaleAppName').value; + const dynoType = document.getElementById('scaleDynoType').value; + const quantity = document.getElementById('scaleQuantity').value; + const response = await fetch('/scale', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ app_name: appName, dyno_type: dynoType, quantity: parseInt(quantity) }) + }); + const result = await response.json(); + console.log(result); + }); + + document.getElementById('logsButton').addEventListener('click', async () => { + const appName = document.getElementById('logsAppName').value; + const response = await fetch(`/logs?app_name=${appName}`); + const result = await response.json(); + const results = document.getElementById('results'); + results.innerHTML = JSON.stringify(result, null, 2); + }); +}); + +async function fetchStreamlabsDonations() { + const accessToken = 'YOUR_STREAMLABS_ACCESS_TOKEN'; + const endpoint = 'https://streamlabs.com/api/v1.0/donations'; + + fetch(endpoint, { + headers: { + 'Authorization': `Bearer ${accessToken}` + } + }) + .then(response => response.json()) + .then(data => { + const donationList = document.getElementById('donationList'); + data.data.forEach(donation => { + const donationElement = document.createElement('div'); + donationElement.className = 'donation'; + donationElement.innerHTML = ` +

          ${donation.name}

          +

          Amount: ${donation.amount}

          +

          Message: ${donation.message}

          + `; + donationList.appendChild(donationElement); + }); + }) + .catch(error => console.error('Error fetching donations:', error)); +} diff --git a/New_APIs/Streamlabs API/manifest.json b/New_APIs/Streamlabs API/manifest.json new file mode 100644 index 00000000..ec14af01 --- /dev/null +++ b/New_APIs/Streamlabs API/manifest.json @@ -0,0 +1,15 @@ +{ + "short_name": "StreamlabsApp", + "name": "Streamlabs API Viewer App", + "icons": [ + { + "src": "icon.png", + "type": "image/png", + "sizes": "192x192" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/New_APIs/Streamlabs API/package.json b/New_APIs/Streamlabs API/package.json new file mode 100644 index 00000000..33d6ea63 --- /dev/null +++ b/New_APIs/Streamlabs API/package.json @@ -0,0 +1,15 @@ +{ + "name": "streamlabs-api-app", + "version": "1.0.0", + "description": "A simple app to view Streamlabs donations", + "main": "index.js", + "scripts": { + "start": "node server.js" + }, + "author": "Revanth", + "license": "ISC", + "dependencies": { + "express": "^4.17.1" + } + } + \ No newline at end of file diff --git a/New_APIs/Streamlabs API/style.css b/New_APIs/Streamlabs API/style.css new file mode 100644 index 00000000..f4c6a2a5 --- /dev/null +++ b/New_APIs/Streamlabs API/style.css @@ -0,0 +1,74 @@ +body { + font-family: Arial, sans-serif; + background: linear-gradient(135deg, #ffaa89, #6132ef); + color: #fff; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + margin: 0; +} + +.container { + text-align: center; + padding: 20px; + background: rgba(0, 0, 0, 0.5); + border-radius: 10px; +} + +h1 { + font-size: 2.5em; + margin-bottom: 20px; +} + +#app { + margin-bottom: 20px; +} + +.deployment { + text-align: left; +} + +.deployment h2 { + margin-top: 20px; + font-size: 1.5em; +} + +.deployment p { + margin: 5px 0; +} + +.deployment button { + background: #ef32d9; + border: none; + padding: 10px; + color: #fff; + cursor: pointer; + border-radius: 5px; +} + +.deployment button:hover { + background: #a726c1; +} + +.deployment input[type="number"] { + width: 50px; + padding: 5px; + border-radius: 5px; + border: none; +} + +#donationList .donation { + margin-bottom: 15px; + padding: 10px; + background: rgba(255, 255, 255, 0.1); + border-radius: 10px; +} + +#donationList .donation h3 { + margin: 0; +} + +#donationList .donation p { + margin: 5px 0; +} diff --git a/New_APIs/Twitch API/Readme.md b/New_APIs/Twitch API/Readme.md new file mode 100644 index 00000000..6baa9605 --- /dev/null +++ b/New_APIs/Twitch API/Readme.md @@ -0,0 +1,16 @@ +# Twitch API App + +This is a simple web application that displays live streams from Twitch using the Twitch API. + +## Setup + +1. Clone the repository. +2. Navigate to the project directory. +3. Install the dependencies: + + ```bash + npm install + + +## Contributor +### Revanth \ No newline at end of file diff --git a/New_APIs/Twitch API/index.html b/New_APIs/Twitch API/index.html new file mode 100644 index 00000000..52c27eb6 --- /dev/null +++ b/New_APIs/Twitch API/index.html @@ -0,0 +1,31 @@ + + + + + + + Twitch API Viewer + + +

          Twitch API Viewer

          +
          +

          Stream List

          +
          +

          Deploy

          + + + +

          Scale

          + + + + +

          Logs

          + + +
            +
            + + + + diff --git a/New_APIs/Twitch API/index.js b/New_APIs/Twitch API/index.js new file mode 100644 index 00000000..039e425d --- /dev/null +++ b/New_APIs/Twitch API/index.js @@ -0,0 +1,63 @@ +document.addEventListener('DOMContentLoaded', function () { + fetchTwitchStreams(); + + document.getElementById('deployButton').addEventListener('click', async () => { + const appName = document.getElementById('deployAppName').value; + const sourceUrl = document.getElementById('deploySourceUrl').value; + const response = await fetch('/deploy', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ app_name: appName, source_url: sourceUrl }) + }); + const result = await response.json(); + console.log(result); + }); + + document.getElementById('scaleButton').addEventListener('click', async () => { + const appName = document.getElementById('scaleAppName').value; + const dynoType = document.getElementById('scaleDynoType').value; + const quantity = document.getElementById('scaleQuantity').value; + const response = await fetch('/scale', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ app_name: appName, dyno_type: dynoType, quantity: parseInt(quantity) }) + }); + const result = await response.json(); + console.log(result); + }); + + document.getElementById('logsButton').addEventListener('click', async () => { + const appName = document.getElementById('logsAppName').value; + const response = await fetch(`/logs?app_name=${appName}`); + const result = await response.json(); + const results = document.getElementById('results'); + results.innerHTML = JSON.stringify(result, null, 2); + }); +}); + +async function fetchTitchStreams() { + const clientId = 'YOUR_TWITCH_CLIENT_ID'; + const endpoint = 'https://api.twitch.tv/helix/streams'; + + fetch(endpoint, { + headers: { + 'Client-ID': clientId, + 'Authorization': 'Bearer YOUR_TWITCH_ACCESS_TOKEN' + } + }) + .then(response => response.json()) + .then(data => { + const streamList = document.getElementById('streamList'); + data.data.forEach(stream => { + const streamElement = document.createElement('div'); + streamElement.className = 'stream'; + streamElement.innerHTML = ` +

            ${stream.user_name}

            +

            ${stream.title}

            + ${stream.user_name} + `; + streamList.appendChild(streamElement); + }); + }) + .catch(error => console.error('Error fetching streams:', error)); +} diff --git a/New_APIs/Twitch API/manifest.json b/New_APIs/Twitch API/manifest.json new file mode 100644 index 00000000..edb07904 --- /dev/null +++ b/New_APIs/Twitch API/manifest.json @@ -0,0 +1,16 @@ +{ + "name": "Twitch API App", + "short_name": "TwitchApp", + "start_url": ".", + "display": "standalone", + "background_color": "#000000", + "theme_color": "#000000", + "description": "An app to display Twitch streams.", + "icons": [ + { + "src": "icon.png", + "sizes": "192x192", + "type": "image/png" + } + ] +} diff --git a/New_APIs/Twitch API/package.json b/New_APIs/Twitch API/package.json new file mode 100644 index 00000000..68c639ca --- /dev/null +++ b/New_APIs/Twitch API/package.json @@ -0,0 +1,14 @@ +{ + "name": "twitch-api-app", + "version": "1.0.0", + "description": "An app to display Twitch streams.", + "main": "index.js", + "scripts": { + "start": "http-server ." + }, + "dependencies": { + "http-server": "^0.12.3" + }, + "author": "Your Name", + "license": "MIT" +} diff --git a/New_APIs/Twitch API/style.css b/New_APIs/Twitch API/style.css new file mode 100644 index 00000000..defad34c --- /dev/null +++ b/New_APIs/Twitch API/style.css @@ -0,0 +1,68 @@ +body { + font-family: Arial, sans-serif; + background: linear-gradient(135deg, #89fffd, #ef32d9); + color: #fff; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + margin: 0; +} + +.container { + text-align: center; + padding: 20px; + background: rgba(0, 0, 0, 0.5); + border-radius: 10px; +} + +h1 { + font-size: 2.5em; + margin-bottom: 20px; +} + +#app { + margin-bottom: 20px; +} + +.deployment { + text-align: left; +} + +.deployment h2 { + margin-top: 20px; + font-size: 1.5em; +} + +.deployment p { + margin: 5px 0; +} + +.deployment button { + background: #ef32d9; + border: none; + padding: 10px; + color: #fff; + cursor: pointer; + border-radius: 5px; +} + +.deployment button:hover { + background: #a726c1; +} + +.deployment input[type="number"] { + width: 50px; + padding: 5px; + border-radius: 5px; + border: none; +} + +#streamList .stream { + margin-bottom: 15px; +} + +#streamList img { + max-width: 100%; + border-radius: 10px; +} diff --git a/New_APIs/URL_shorten/Readme.md b/New_APIs/URL_shorten/Readme.md new file mode 100644 index 00000000..69ebb5bd --- /dev/null +++ b/New_APIs/URL_shorten/Readme.md @@ -0,0 +1,65 @@ +# URL Shortener API + +This API allows you to shorten URLs and redirect users from shortened URLs to their original long URLs. + +## Prerequisites + +- Node.js and npm installed on your machine +- MongoDB installed and running locally or accessible remotely + +## Installation + +1. Clone the repository: + ```bash + git clone https://github.com/dishamodi0910/APIVerse.git + cd APIVerse/New_APIs/URL_shorten + ``` + +2. Install dependencies: + ```bash + npm install + ``` + +3. Set up environment variables: + - Create a `.env` file in the root directory + - Add the following variables: + ``` + DB= + ``` + +4. Start the server: + ```bash + npm start + ``` + +## API Endpoints + +### POST /api/shorten + +Shortens a long URL. + +**Request Body** +```json +{ + "originalUrl": "https://example.com/very-long-url-to-shorten" +} +``` + +**Response** +```json +{ + "shortUrl": "http://your-domain.com/abc123" +} +``` + +### GET /:shortUrl + +Redirects to the original long URL associated with the provided short URL. + +## Usage + +1. Send a POST request to `/api/shorten` with a JSON body containing `originalUrl`. +2. The API responds with a `shortUrl`. +3. Use the `shortUrl` to redirect users to the original `originalUrl`. + + \ No newline at end of file diff --git a/New_APIs/URL_shorten/controller/db.js b/New_APIs/URL_shorten/controller/db.js new file mode 100644 index 00000000..d078a9dd --- /dev/null +++ b/New_APIs/URL_shorten/controller/db.js @@ -0,0 +1,16 @@ +let data=[] +const saveData=(originalUrl,shortUrlWithBase)=>{ + let datas={originalUrl:originalUrl,time:new Date().toISOString(),shortUrl: shortUrlWithBase} + data.push(datas) + console.log(data) + return datas +} +const filterData=(url)=>{ + let datas=data.find(item=>item. shortUrl===url) + return datas +} +const filterOriginalURL=(url)=>{ + let datas=data.find(item=>item.originalUrl===url) + return datas +} +module.exports={saveData,filterData,filterOriginalURL} \ No newline at end of file diff --git a/New_APIs/URL_shorten/index.js b/New_APIs/URL_shorten/index.js new file mode 100644 index 00000000..025ef5fb --- /dev/null +++ b/New_APIs/URL_shorten/index.js @@ -0,0 +1,68 @@ +const express = require('express'); +const mongoose = require('mongoose'); +const shortid = require('shortid'); +const validUrl = require('valid-url'); +const {saveData,filterData,filterOriginalURL}=require('./controller/db') +const app = express(); + +// Body parser middleware +app.use(express.json()); + +const db = mongoose.connection; +db.on('error', console.error.bind(console, 'MongoDB connection error:')); + + + +// Routes +// API route to shorten URL +app.post('/api/shorten', async (req, res) => { + const { originalUrl } = req.body; + + // Check if URL is valid + if (!validUrl.isUri(originalUrl)) { + return res.status(400).json('Invalid URL'); + } + + try { + let url = filterOriginalURL(originalUrl); + + if (url) { + res.json(url); + } else { + const shortUrl = shortid.generate(); + const datas=saveData(originalUrl,shortUrl) + res.json(datas); + } + } catch (err) { + console.error(err); + res.status(500).json('Server error'); + } +}); + +// Route to redirect to original URL +app.get('/:shortUrl', async (req, res) => { + const { shortUrl } = req.params; + + try { + const url = filterData(shortUrl) + + if (url) { + return res.redirect(url.originalUrl); + } else { + console.log(`Short URL ${shortUrl} not found in database.`); + return res.status(404).json('URL not found'); + } + } catch (err) { + console.error(`Error finding URL for short URL ${shortUrl}:`, err); + res.status(500).json('Server error'); + } +}); + +// Serve static files if needed +// app.use(express.static('public')); + +// Start server +const PORT = process.env.PORT || 5000; +app.listen(PORT, () => { + console.log(`Server running on port ${PORT}`); +}); diff --git a/New_APIs/URL_shorten/package-lock.json b/New_APIs/URL_shorten/package-lock.json new file mode 100644 index 00000000..caa393cb --- /dev/null +++ b/New_APIs/URL_shorten/package-lock.json @@ -0,0 +1,963 @@ +{ + "name": "url_shorten", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "url_shorten", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "cors": "^2.8.5", + "dotenv": "^16.4.5", + "express": "^4.19.2", + "mongoose": "^8.4.1", + "shortid": "^2.2.16", + "valid-url": "^1.0.9" + } + }, + "node_modules/@mongodb-js/saslprep": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.7.tgz", + "integrity": "sha512-dCHW/oEX0KJ4NjDULBo3JiOaK5+6axtpBbS+ao2ZInoAL9/YRQLhXzSNAFz7hP4nzLkIqsfYAK/PDE3+XHny0Q==", + "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==" + }, + "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==", + "dependencies": { + "@types/webidl-conversions": "*" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/bson": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/bson/-/bson-6.7.0.tgz", + "integrity": "sha512-w2IquM5mYzYZv6rs3uN2DZTOBe2a0zXLj53TGDqwF4l6Sz/XsISrisXOJihArF9+BZ6Cq/GjVht7Sjfmri7ytQ==", + "engines": { + "node": ">=16.20.1" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.2", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.6.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/kareem": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.6.3.tgz", + "integrity": "sha512-C3iHfuGUXK2u8/ipq9LfjFfXFxAZMQJJq7vLS45r3D9Y2xQ/m4S8zaR4zMLFWh9AsNPXmcFfUDhTEO8UIC/V6Q==", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "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==" + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mongodb": { + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.6.2.tgz", + "integrity": "sha512-ZF9Ugo2JCG/GfR7DEb4ypfyJJyiKbg5qBYKRintebj8+DNS33CyGMkWbrS9lara+u+h+yEOGSRiLhFO/g1s1aw==", + "dependencies": { + "@mongodb-js/saslprep": "^1.1.5", + "bson": "^6.7.0", + "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", + "gcp-metadata": "^5.2.0", + "kerberos": "^2.0.1", + "mongodb-client-encryption": ">=6.0.0 <7", + "snappy": "^7.2.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.1", + "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.1.tgz", + "integrity": "sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg==", + "dependencies": { + "@types/whatwg-url": "^11.0.2", + "whatwg-url": "^13.0.0" + } + }, + "node_modules/mongoose": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.4.1.tgz", + "integrity": "sha512-odQ2WEWGL3hb0Qex+QMN4eH6D34WdMEw7F1If2MGABApSDmG9cMmqv/G1H6WsXmuaH9mkuuadW/WbLE5+tHJwA==", + "dependencies": { + "bson": "^6.7.0", + "kareem": "2.6.3", + "mongodb": "6.6.2", + "mpath": "0.9.0", + "mquery": "5.0.0", + "ms": "2.1.3", + "sift": "17.1.3" + }, + "engines": { + "node": ">=16.20.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mongoose" + } + }, + "node_modules/mongoose/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/mpath": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz", + "integrity": "sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mquery": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/mquery/-/mquery-5.0.0.tgz", + "integrity": "sha512-iQMncpmEK8R8ncT8HJGsGc9Dsp8xcgYMVSbs5jgnm1lFHTZqMJTUWTDx1LBO8+mK3tPNZWFLBghQEIOULSTHZg==", + "dependencies": { + "debug": "4.x" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/mquery/node_modules/debug": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/mquery/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/nanoid": { + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-2.1.11.tgz", + "integrity": "sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA==" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/shortid": { + "version": "2.2.16", + "resolved": "https://registry.npmjs.org/shortid/-/shortid-2.2.16.tgz", + "integrity": "sha512-Ugt+GIZqvGXCIItnsL+lvFJOiN7RYqlGy7QE41O3YC1xbNSeDGIRO7xg2JJXIAj1cAGnOeC1r7/T9pgrtQbv4g==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dependencies": { + "nanoid": "^2.1.0" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/sift": { + "version": "17.1.3", + "resolved": "https://registry.npmjs.org/sift/-/sift-17.1.3.tgz", + "integrity": "sha512-Rtlj66/b0ICeFzYTuNvX/EF1igRbbnGSvEyT79McoZa/DeGhMyC5pWKOEsZKnpkqtSeovd5FL/bjHWC3CIIvCQ==" + }, + "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==", + "dependencies": { + "memory-pager": "^1.0.2" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tr46": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", + "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", + "dependencies": { + "punycode": "^2.3.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/valid-url": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/valid-url/-/valid-url-1.0.9.tgz", + "integrity": "sha512-QQDsV8OnSf5Uc30CKSwG9lnhMPe6exHtTXLRYX8uMwKENy640pU+2BgBL0LRbDh/eYRahNCS7aewCx0wf3NYVA==" + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + }, + "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==", + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-url": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-13.0.0.tgz", + "integrity": "sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==", + "dependencies": { + "tr46": "^4.1.1", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=16" + } + } + } +} diff --git a/New_APIs/URL_shorten/package.json b/New_APIs/URL_shorten/package.json new file mode 100644 index 00000000..143198f7 --- /dev/null +++ b/New_APIs/URL_shorten/package.json @@ -0,0 +1,20 @@ +{ + "name": "url_shorten", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "description": "", + "dependencies": { + "cors": "^2.8.5", + "dotenv": "^16.4.5", + "express": "^4.19.2", + "mongoose": "^8.4.1", + "shortid": "^2.2.16", + "valid-url": "^1.0.9" + } +} diff --git a/New_APIs/URL_shorten/server.js b/New_APIs/URL_shorten/server.js new file mode 100644 index 00000000..54815b7e --- /dev/null +++ b/New_APIs/URL_shorten/server.js @@ -0,0 +1,28 @@ +const url = 'http://localhost:5000/api/shorten'; + +const data = { + name: 'John Doe', + age: 30, + originalUrl:"https://github.com/dishamodi0910/APIVerse/issues/" +}; +const options = { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(data) +}; + +fetch(url, options) + .then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); + }) + .then(data => { + console.log('Success:', data) + }) + .catch(error => { + console.error('Error:', error); + }); diff --git a/New_APIs/e-commerse-Api/Readme.md b/New_APIs/e-commerse-Api/Readme.md new file mode 100644 index 00000000..78b3bfcf --- /dev/null +++ b/New_APIs/e-commerse-Api/Readme.md @@ -0,0 +1,71 @@ + + +# E-Commerce Product Provider API + +This API provides functionalities for managing products in an e-commerce platform. It supports creating, reading, updating, and deleting product information. + +## Features + +- Get and Build Our Projects. +- Search for products by name, category, or other attributes +- Pagination support for product listings +- Authentication and authorization + +## Setup + + 1. Navigate to the project directory: + ```bash +cd e-commerce-product-provider-api +``` + 2. Install dependencies: + + ```bash + npm install + ``` + + 3. Set up environment variables: + - Create a .env file in the root of the project and add the following variables: + + ```env + DB=Your_MONGODB_URL + ``` + + 4. Run the Project + + ```bash + node index.js + ``` + +## Routes +```js +Routes:{ + all_product:"/products", + category:"/products/category/:category", + specidic_product:"/products/product/:id" + } +``` + +## Methods + + ```bash + GET / + GET /products/category/:category + GET /products/product/:id + ``` + +## Output + +- **All Products** +![Screenshot from 2024-07-21 21-49-42](https://github.com/user-attachments/assets/3f955ed3-1dd8-46ae-97d7-cd1ce3e0207c) + +- **Category** +![Screenshot from 2024-07-21 21-50-39](https://github.com/user-attachments/assets/23ccbe33-355e-4279-bb30-6c46c2db8343) + +- **Specific Product** +![Screenshot from 2024-07-21 21-51-49](https://github.com/user-attachments/assets/5a0feb6b-30b9-455b-874b-5a053b259882) + + +## Contributing + + [Sivaprasath2004](https://github.com/sivaprasath2004) + \ No newline at end of file diff --git a/New_APIs/e-commerse-Api/asset/Screenshot from 2024-07-21 21-49-42.png b/New_APIs/e-commerse-Api/asset/Screenshot from 2024-07-21 21-49-42.png new file mode 100644 index 00000000..d81b5dc1 Binary files /dev/null and b/New_APIs/e-commerse-Api/asset/Screenshot from 2024-07-21 21-49-42.png differ diff --git a/New_APIs/e-commerse-Api/asset/Screenshot from 2024-07-21 21-50-39.png b/New_APIs/e-commerse-Api/asset/Screenshot from 2024-07-21 21-50-39.png new file mode 100644 index 00000000..086db60c Binary files /dev/null and b/New_APIs/e-commerse-Api/asset/Screenshot from 2024-07-21 21-50-39.png differ diff --git a/New_APIs/e-commerse-Api/asset/Screenshot from 2024-07-21 21-51-49.png b/New_APIs/e-commerse-Api/asset/Screenshot from 2024-07-21 21-51-49.png new file mode 100644 index 00000000..9171794a Binary files /dev/null and b/New_APIs/e-commerse-Api/asset/Screenshot from 2024-07-21 21-51-49.png differ diff --git a/New_APIs/e-commerse-Api/index.js b/New_APIs/e-commerse-Api/index.js new file mode 100644 index 00000000..1e8023cc --- /dev/null +++ b/New_APIs/e-commerse-Api/index.js @@ -0,0 +1,51 @@ +const express=require('express') +const app=express() +require('dotenv').config() +const mongoose=require('mongoose') +const products=require('./mongodb/shopping') +const cors=require('cors') +app.use(cors()) +app.use(express.json()) +app.use(express.urlencoded({extended:true})) +app.get("/",(req,res)=>{res.send({ + author:"sivaprasath2004", + category:["mobile","laptop","toys","fashion","furniture"], + Routes:{ + all_product:"/products", + category:"/products/category/:category", + specidic_product:"/products/product/:id" + } +})}) +app.get("/products",async(req,res)=>{ + await mongoose.connect(process.env.DB) + try{ + let product=await products.find() + res.send(product) + throw new Error('Something went wrong!'); +}catch(err){ + res.send(err) +} +}) +app.get("/products/category/:category",async(req,res)=>{ + await mongoose.connect(process.env.DB) + try{ + let product=await products.find({category:req.params.category}) + res.send(product) + throw new Error('Something went wrong!'); +}catch(err){ + res.send(err) +} +}) +app.get("/products/product/:id",async(req,res,next)=>{ + await mongoose.connect(process.env.DB) + try{ + let product=await products.findById(req.params.id) + if(product){ + res.send(product) + }else{res.send("Sorry no more products available")} + throw new Error('Something went wrong!'); +}catch(err){ + res.send(err) +} +}) +app.listen(5000,()=>{console.log("app listen in 5000")}) \ No newline at end of file diff --git a/New_APIs/e-commerse-Api/mongodb/shopping.js b/New_APIs/e-commerse-Api/mongodb/shopping.js new file mode 100644 index 00000000..fc858549 --- /dev/null +++ b/New_APIs/e-commerse-Api/mongodb/shopping.js @@ -0,0 +1,44 @@ +const mongoose=require('mongoose') +const user_schema=new mongoose.Schema({ + category:String, + productName:String, + brand:String, + details:[{ + 'color':String, + "material":String, + "length": String, + "display": String, + }], + camera:[{ + front:String, + back:String + }], + size:[String], + battery:String, + warrenty:String, + img:[ + { + url:String, + caption:String + }, + { + url:String, + caption:String + } + ], + cards:[ + { + url:String, + caption:String + }, + { + url:String, + caption:String + } + ], + MRPprize:Number, + SELLprize:Number, + stock:String, +}) +module.exports=mongoose.model('users',user_schema) + \ No newline at end of file diff --git a/New_APIs/e-commerse-Api/package-lock.json b/New_APIs/e-commerse-Api/package-lock.json new file mode 100644 index 00000000..53356298 --- /dev/null +++ b/New_APIs/e-commerse-Api/package-lock.json @@ -0,0 +1,945 @@ +{ + "name": "e-commerse-api", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "e-commerse-api", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "cors": "^2.8.5", + "dotenv": "^16.4.5", + "express": "^4.19.2", + "mongoose": "^8.5.1" + } + }, + "node_modules/@mongodb-js/saslprep": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.8.tgz", + "integrity": "sha512-qKwC/M/nNNaKUBMQ0nuzm47b7ZYWQHN3pcXq4IIcoSBc2hOIrflAxJduIvvqmhoz3gR2TacTAs8vlsCVPkiEdQ==", + "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==" + }, + "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==", + "dependencies": { + "@types/webidl-conversions": "*" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/bson": { + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/bson/-/bson-6.8.0.tgz", + "integrity": "sha512-iOJg8pr7wq2tg/zSlCCHMi3hMm5JTOxLTagf3zxhcenHsFp+c6uOs6K7W5UE7A4QIJGtqh/ZovFNMP4mOPJynQ==", + "engines": { + "node": ">=16.20.1" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.2", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.6.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/kareem": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.6.3.tgz", + "integrity": "sha512-C3iHfuGUXK2u8/ipq9LfjFfXFxAZMQJJq7vLS45r3D9Y2xQ/m4S8zaR4zMLFWh9AsNPXmcFfUDhTEO8UIC/V6Q==", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "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==" + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mongodb": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.7.0.tgz", + "integrity": "sha512-TMKyHdtMcO0fYBNORiYdmM25ijsHs+Njs963r4Tro4OQZzqYigAzYQouwWRg4OIaiLRUEGUh/1UAcH5lxdSLIA==", + "dependencies": { + "@mongodb-js/saslprep": "^1.1.5", + "bson": "^6.7.0", + "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", + "gcp-metadata": "^5.2.0", + "kerberos": "^2.0.1", + "mongodb-client-encryption": ">=6.0.0 <7", + "snappy": "^7.2.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.1", + "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.1.tgz", + "integrity": "sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg==", + "dependencies": { + "@types/whatwg-url": "^11.0.2", + "whatwg-url": "^13.0.0" + } + }, + "node_modules/mongoose": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.5.1.tgz", + "integrity": "sha512-OhVcwVl91A1G6+XpjDcpkGP7l7ikZkxa0DylX7NT/lcEqAjggzSdqDxb48A+xsDxqNAr0ntSJ1yiE3+KJTOd5Q==", + "dependencies": { + "bson": "^6.7.0", + "kareem": "2.6.3", + "mongodb": "6.7.0", + "mpath": "0.9.0", + "mquery": "5.0.0", + "ms": "2.1.3", + "sift": "17.1.3" + }, + "engines": { + "node": ">=16.20.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mongoose" + } + }, + "node_modules/mongoose/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/mpath": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz", + "integrity": "sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mquery": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/mquery/-/mquery-5.0.0.tgz", + "integrity": "sha512-iQMncpmEK8R8ncT8HJGsGc9Dsp8xcgYMVSbs5jgnm1lFHTZqMJTUWTDx1LBO8+mK3tPNZWFLBghQEIOULSTHZg==", + "dependencies": { + "debug": "4.x" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/mquery/node_modules/debug": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/mquery/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/sift": { + "version": "17.1.3", + "resolved": "https://registry.npmjs.org/sift/-/sift-17.1.3.tgz", + "integrity": "sha512-Rtlj66/b0ICeFzYTuNvX/EF1igRbbnGSvEyT79McoZa/DeGhMyC5pWKOEsZKnpkqtSeovd5FL/bjHWC3CIIvCQ==" + }, + "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==", + "dependencies": { + "memory-pager": "^1.0.2" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tr46": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", + "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", + "dependencies": { + "punycode": "^2.3.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + }, + "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==", + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-url": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-13.0.0.tgz", + "integrity": "sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==", + "dependencies": { + "tr46": "^4.1.1", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=16" + } + } + } +} diff --git a/New_APIs/e-commerse-Api/package.json b/New_APIs/e-commerse-Api/package.json new file mode 100644 index 00000000..4352857d --- /dev/null +++ b/New_APIs/e-commerse-Api/package.json @@ -0,0 +1,18 @@ +{ + "name": "e-commerse-api", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "description": "", + "dependencies": { + "cors": "^2.8.5", + "dotenv": "^16.4.5", + "express": "^4.19.2", + "mongoose": "^8.5.1" + } +}