From ab54f28faa9c11955ecdef9f43cfbc940004e07a Mon Sep 17 00:00:00 2001 From: ADEL <adel.youssouf_ali@student.reutlingen-university.de> Date: Tue, 9 Jan 2024 21:10:20 +0100 Subject: [PATCH] commit --- .vs/VSWorkspaceState.json | 16 +- Dockerfile | 22 +- Task.js | 32 +- app.js | 52 +-- appdeploy.yaml | 19 ++ appservice.yaml | 12 + docker-compose.yml | 58 ++-- helmapp/Chart.yaml | 24 ++ helmapp/helmapp-0.1.0.tgz | Bin 0 -> 1245 bytes helmapp/templates/_helpers.tpl | 62 ++++ helmapp/templates/deployment.yaml | 41 +++ helmapp/templates/service.yaml | 26 ++ helmapp/values.yaml | 11 + mdbdeploy.yaml | 19 ++ mdbservice.yaml | 11 + node_modules/.bin/ejs.cmd | 34 +- node_modules/.bin/jake.cmd | 34 +- node_modules/.bin/mime.cmd | 34 +- node_modules/@types/node/README.md | 30 +- .../@types/webidl-conversions/README.md | 30 +- node_modules/@types/whatwg-url/README.md | 32 +- node_modules/color-name/LICENSE | 14 +- node_modules/color-name/README.md | 22 +- node_modules/color-name/index.js | 304 +++++++++--------- node_modules/color-name/package.json | 56 ++-- node_modules/sift/es5m/index.js | 58 ++-- node_modules/sift/lib/index.js | 58 ++-- node_modules/sift/sift.csp.min.js | 58 ++-- routes/index.js | 18 +- routes/taskRoutes.js | 76 ++--- views/index.ejs | 202 ++++++------ 31 files changed, 845 insertions(+), 620 deletions(-) create mode 100644 appdeploy.yaml create mode 100644 appservice.yaml create mode 100644 helmapp/Chart.yaml create mode 100644 helmapp/helmapp-0.1.0.tgz create mode 100644 helmapp/templates/_helpers.tpl create mode 100644 helmapp/templates/deployment.yaml create mode 100644 helmapp/templates/service.yaml create mode 100644 helmapp/values.yaml create mode 100644 mdbdeploy.yaml create mode 100644 mdbservice.yaml diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json index b0ca697..6d6ed4e 100644 --- a/.vs/VSWorkspaceState.json +++ b/.vs/VSWorkspaceState.json @@ -1,9 +1,9 @@ -{ - "ExpandedNodes": [ - "", - "\\public", - "\\routes", - "\\views" - ], - "PreviewInSolutionExplorer": false +{ + "ExpandedNodes": [ + "", + "\\public", + "\\routes", + "\\views" + ], + "PreviewInSolutionExplorer": false } \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 4ab4f9f..382fa9e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ -#BASE IMAGE -FROM node:20.9.0-alpine -#SETTING THE WORKING DIRECTORY -WORKDIR /todoapp -#COPYING ALL THE FILES -COPY . . -#INSTALLING EVERY DEPEDENCIES -RUN npm install -#EXPOSING THE LISTENING PORT -EXPOSE 3000 -#RUNNING THE APP +#BASE IMAGE +FROM node:20.9.0-alpine +#SETTING THE WORKING DIRECTORY +WORKDIR /todoapp +#COPYING ALL THE FILES +COPY . . +#INSTALLING EVERY DEPEDENCIES +RUN npm install +#EXPOSING THE LISTENING PORT +EXPOSE 3000 +#RUNNING THE APP CMD [ "node", "app.js" ] \ No newline at end of file diff --git a/Task.js b/Task.js index dfc015e..b5f7278 100644 --- a/Task.js +++ b/Task.js @@ -1,16 +1,16 @@ -const mongoose = require("mongoose"); - -const taskSchema = new mongoose.Schema({ - task: { - type:String, - required:true - }, - isCompleted: { - type:String, - required:true, - default:"0" - } - -}); - -module.exports = new mongoose.model("Task", taskSchema); +const mongoose = require("mongoose"); + +const taskSchema = new mongoose.Schema({ + task: { + type:String, + required:true + }, + isCompleted: { + type:String, + required:true, + default:"0" + } + +}); + +module.exports = new mongoose.model("Task", taskSchema); diff --git a/app.js b/app.js index d6dd5d0..af1086b 100644 --- a/app.js +++ b/app.js @@ -1,26 +1,26 @@ -//importing modules -const express = require("express"); -const mongoose = require("mongoose"); -const app = express(); - -//connecting to the database -mongoose.connect("mongodb://mongodb:27017/taskdb"); - -//gather data from forms -app.use(express.urlencoded({ extended: true })); - -//use public folder for static files (an image here) -app.use(express.static("public")); - -// Logs details with morgan module -const morgan = require("morgan"); -app.use(morgan("dev")); - -//the views is set by an ejs file -app.set("view engine", "ejs"); - -//routes are defining the differents features of the app -app.use(require("./routes/index")) -app.use(require("./routes/taskRoutes")) - -app.listen(3000, () => console.log("Server started listening on port: 3000")); +//importing modules +const express = require("express"); +const mongoose = require("mongoose"); +const app = express(); + +//connecting to the database +mongoose.connect("mongodb://mongodb-service:27017/taskdb"); + +//gather data from forms +app.use(express.urlencoded({ extended: true })); + +//use public folder for static files (an image here) +app.use(express.static("public")); + +// Logs details with morgan module +const morgan = require("morgan"); +app.use(morgan("dev")); + +//the views is set by an ejs file +app.set("view engine", "ejs"); + +//routes are defining the differents features of the app +app.use(require("./routes/index")) +app.use(require("./routes/taskRoutes")) + +app.listen(3000, () => console.log("Server started listening on port: 3000")); diff --git a/appdeploy.yaml b/appdeploy.yaml new file mode 100644 index 0000000..631677b --- /dev/null +++ b/appdeploy.yaml @@ -0,0 +1,19 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: app-deployment +spec: + replicas: 1 + selector: + matchLabels: + app: app + template: + metadata: + labels: + app: app + spec: + containers: + - name: app + image: adelysf/myimage + ports: + - containerPort: 3000 diff --git a/appservice.yaml b/appservice.yaml new file mode 100644 index 0000000..c1a74e3 --- /dev/null +++ b/appservice.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: app-service +spec: + type: NodePort + selector: + app: app + ports: + - protocol: TCP + port: 3000 + targetPort: 3000 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 37ef829..ae4ca61 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,30 +1,30 @@ -#VERSION OF DOCKER COMPOSE -version: '3' -#DEFINING THE SERVICES -services: - #APP SERVICE - myapp: - #CREATED IMAGE - image: myimage - #WAITING FOR THE DB SERVICE - depends_on: - - mydb - #MAPPING PORTS - ports: - - 3000:3000 - container_name: app - #LINKING WITH A NETWORK - networks: - - appnetwork - #DATABASE SERVICE - mydb: - image: mongo - #DEFAULT MONGODB PORTS - ports: - - 27017:27017 - container_name: mongodb - networks: - - appnetwork - -networks: +#VERSION OF DOCKER COMPOSE +version: '3' +#DEFINING THE SERVICES +services: + #APP SERVICE + myapp: + #CREATED IMAGE + image: myimage + #WAITING FOR THE DB SERVICE + depends_on: + - mydb + #MAPPING PORTS + ports: + - 3000:3000 + container_name: app + #LINKING WITH A NETWORK + networks: + - appnetwork + #DATABASE SERVICE + mydb: + image: mongo + #DEFAULT MONGODB PORTS + ports: + - 27017:27017 + container_name: mongodb + networks: + - appnetwork + +networks: appnetwork: \ No newline at end of file diff --git a/helmapp/Chart.yaml b/helmapp/Chart.yaml new file mode 100644 index 0000000..399832a --- /dev/null +++ b/helmapp/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: helmapp +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/helmapp/helmapp-0.1.0.tgz b/helmapp/helmapp-0.1.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..3d80ae5c32fff6bfe2f36c73b4d4f6330e179d25 GIT binary patch literal 1245 zcmV<31S0z%iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PI*@Z`(E(&NY9<f$$b+`$Dq(6$1ixQKSPlY{-gb=q?LdI*N%> zqDoR(4Y&V&;D=;cvSYVRlMe8?u}mJ4=Y!9~L#~h)w5mo|D=KxgrUk!vaEaqMzMReM zZyd+{-*~*3T#RS)*<w1G%;$@Xcs#kB&MzQ-cvFT_D^2A^{LO3io%@dnt=L<Xiit9T zy9uFH)&3nv<I5-}8LCvWO53(q@C)(+QnOni7ZQG}mncirs7Of*Ou%m_qSqBBK&y(g zl$ychu9-NF#!*b3+Vis*Y4CqXd5!A(5WsQ#$36T{<Hh)l|HlxC7NA$6E_DK9LRdj> zF(CjFE1{Sca-9IpkgrufD%Q4}5QXxNrB=@Y{aR%BMo3KnDj{_O(>RU^$(9{W*D+bd z<HZ^MKZrE=*H~1XYE+|lE94bQ73u1MsNe|xr_;;J9{%T(S$xL-W5{MRdP#o%SkW>A zy+SaDIEdVS+fzOwFGrt0lg%cC40Bc@1b)v%MmK<P+e>S%A#$bUwV5b->y8zp`Nthf z$ufjbpk-aAa5=S~thlN3oPC5K48YHYWoAB!weCtH)d;j*A+I@K!-tx3mNU#ukzwtQ z$lvJZw))zvV0=)p#FW+wL5Tu8C5!VmXUH=JR3dOzFpU{#0eZz0JYTMDBwk<N7+qH0 zf~qim5s_bWkjRlLAF@=GnzB;)(#W<k4gWCCVTn*HW2XXYjrZ0b46M=F4KB;uST>z) zJiW@n{!`-3RXflBtnJB9rzdo4V;coGN%W@+ksI6CxzqTC##NG)I)~ty3ZJQ<H<w%V z^zF6(b7#|avS|?FOIVXhn^C_#oEE1`<o9INYHd^6ccmL;_w6fj_+-vvPE&;7{{aN= zf-i@VC<;+J3)Nu@UB5HYv_)z)vQ{Us*#Ik3US~sxBDdtQUm?d-3;DaBHtOsY@8YZW zzG3>zp!Y30BPK@eonf=tGvpI|sD;L!%fnd;TGCt0!sXgc)a;rYSDWk&*^M{;Xwdpz zhI>tLm!o}AazKyvTh2<QX_?}#-Ca2C+qHcn_ca*MG&Oaep|@J$eJ)x3S5E!<5EJdH zMX6i7cN{z)IJ{-I=*6MA%C3hU{5P`({v$YPf&s>#`qce#WLW=YSaGo~uzaxRpd<C) zcs3i<e~bCzT>m|Wbl-nyRjJY4n7n6YmcZ+FACLky&8Vj45_g!$I=D6%Gli1BN17X^ zaunv#+P!ufWq^i8%@BZs>U8B8)ir>z&YEbhoPM)<-Hvre_|CAMfdGwFMtrq`vZEYs z9qgXS*2G5K6}jt<ZHcxw=3RYr@9ivM7HOA$BmC*w<FUvLvcw*SAt7Ixrb3jrB3p)A zOn;xW_;tQ6HQT|br>8q+Cn>fgu}r4FHU;gYMVo}DM(OvHA^$hNKipH`vG>2ltpEN$ zpPb+SA4hiH{~J#6b@8|HzIzwk!)&I*kxK`ap?@8`hY1~UHI=uhkJ6@xy%bucf+z6T z)tdpEwFkqHV^0W0!>xYh*6;hB8gk3MZXHrT!Lf!SpL&O#<t%6UQRUwN00960fgLJw H03ZMWZ#i)d literal 0 HcmV?d00001 diff --git a/helmapp/templates/_helpers.tpl b/helmapp/templates/_helpers.tpl new file mode 100644 index 0000000..deeae0d --- /dev/null +++ b/helmapp/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "helmapp.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "helmapp.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "helmapp.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "helmapp.labels" -}} +helm.sh/chart: {{ include "helmapp.chart" . }} +{{ include "helmapp.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "helmapp.selectorLabels" -}} +app.kubernetes.io/name: {{ include "helmapp.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "helmapp.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "helmapp.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/helmapp/templates/deployment.yaml b/helmapp/templates/deployment.yaml new file mode 100644 index 0000000..3e5ec1f --- /dev/null +++ b/helmapp/templates/deployment.yaml @@ -0,0 +1,41 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "helmapp.fullname" . }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: app + template: + metadata: + labels: + app: app + spec: + containers: + - name: {{ .Chart.Name }} + image: {{ .Values.image.repository }} + ports: + - containerPort: {{ .Values.service.port }} + +--- + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mongodb-deployment +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: mongodb + template: + metadata: + labels: + app: mongodb + spec: + containers: + - name: mongodb + image: mongo:latest + ports: + - containerPort: {{ .Values.dbservice.port }} diff --git a/helmapp/templates/service.yaml b/helmapp/templates/service.yaml new file mode 100644 index 0000000..8c3fe16 --- /dev/null +++ b/helmapp/templates/service.yaml @@ -0,0 +1,26 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "helmapp.fullname" . }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: {{ .Values.service.port }} + protocol: TCP + selector: + app: app + +--- + +apiVersion: v1 +kind: Service +metadata: + name: mongodb-service +spec: + ports: + - port: {{ .Values.dbservice.port }} + targetPort: {{ .Values.dbservice.port }} + protocol: TCP + selector: + app: mongodb diff --git a/helmapp/values.yaml b/helmapp/values.yaml new file mode 100644 index 0000000..26bb1ff --- /dev/null +++ b/helmapp/values.yaml @@ -0,0 +1,11 @@ +replicaCount: 1 + +image: + repository: adelysf/myimage + +service: + type: NodePort + port: 3000 + +dbservice: + port: 27017 diff --git a/mdbdeploy.yaml b/mdbdeploy.yaml new file mode 100644 index 0000000..472ecf2 --- /dev/null +++ b/mdbdeploy.yaml @@ -0,0 +1,19 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mongodb-deployment +spec: + replicas: 1 + selector: + matchLabels: + app: mongodb + template: + metadata: + labels: + app: mongodb + spec: + containers: + - name: mongodb + image: mongo:latest + ports: + - containerPort: 27017 \ No newline at end of file diff --git a/mdbservice.yaml b/mdbservice.yaml new file mode 100644 index 0000000..00608f1 --- /dev/null +++ b/mdbservice.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: mongodb-service +spec: + selector: + app: mongodb + ports: + - protocol: TCP + port: 27017 + targetPort: 27017 \ No newline at end of file diff --git a/node_modules/.bin/ejs.cmd b/node_modules/.bin/ejs.cmd index 7cc2b56..32cac31 100644 --- a/node_modules/.bin/ejs.cmd +++ b/node_modules/.bin/ejs.cmd @@ -1,17 +1,17 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\ejs\bin\cli.js" %* +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\ejs\bin\cli.js" %* diff --git a/node_modules/.bin/jake.cmd b/node_modules/.bin/jake.cmd index 1ccccef..45b0465 100644 --- a/node_modules/.bin/jake.cmd +++ b/node_modules/.bin/jake.cmd @@ -1,17 +1,17 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\jake\bin\cli.js" %* +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\jake\bin\cli.js" %* diff --git a/node_modules/.bin/mime.cmd b/node_modules/.bin/mime.cmd index 54491f1..a9e48f1 100644 --- a/node_modules/.bin/mime.cmd +++ b/node_modules/.bin/mime.cmd @@ -1,17 +1,17 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\mime\cli.js" %* +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\mime\cli.js" %* diff --git a/node_modules/@types/node/README.md b/node_modules/@types/node/README.md index af20ce9..bb4c2b3 100644 --- a/node_modules/@types/node/README.md +++ b/node_modules/@types/node/README.md @@ -1,15 +1,15 @@ -# Installation -> `npm install --save @types/node` - -# Summary -This package contains type definitions for node (https://nodejs.org/). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. - -### Additional Details - * Last updated: Tue, 31 Oct 2023 08:42:08 GMT - * Dependencies: [undici-types](https://npmjs.com/package/undici-types) - -# Credits -These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky). +# Installation +> `npm install --save @types/node` + +# Summary +This package contains type definitions for node (https://nodejs.org/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. + +### Additional Details + * Last updated: Tue, 31 Oct 2023 08:42:08 GMT + * Dependencies: [undici-types](https://npmjs.com/package/undici-types) + +# Credits +These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky). diff --git a/node_modules/@types/webidl-conversions/README.md b/node_modules/@types/webidl-conversions/README.md index 652110a..8d4e6fc 100644 --- a/node_modules/@types/webidl-conversions/README.md +++ b/node_modules/@types/webidl-conversions/README.md @@ -1,15 +1,15 @@ -# Installation -> `npm install --save @types/webidl-conversions` - -# Summary -This package contains type definitions for webidl-conversions (https://github.com/jsdom/webidl-conversions#readme). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webidl-conversions. - -### Additional Details - * Last updated: Wed, 18 Oct 2023 11:45:07 GMT - * Dependencies: none - -# Credits -These definitions were written by [ExE Boss](https://github.com/ExE-Boss), and [BendingBender](https://github.com/BendingBender). +# Installation +> `npm install --save @types/webidl-conversions` + +# Summary +This package contains type definitions for webidl-conversions (https://github.com/jsdom/webidl-conversions#readme). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webidl-conversions. + +### Additional Details + * Last updated: Wed, 18 Oct 2023 11:45:07 GMT + * Dependencies: none + +# Credits +These definitions were written by [ExE Boss](https://github.com/ExE-Boss), and [BendingBender](https://github.com/BendingBender). diff --git a/node_modules/@types/whatwg-url/README.md b/node_modules/@types/whatwg-url/README.md index 41143c4..3ba1b14 100644 --- a/node_modules/@types/whatwg-url/README.md +++ b/node_modules/@types/whatwg-url/README.md @@ -1,16 +1,16 @@ -# Installation -> `npm install --save @types/whatwg-url` - -# Summary -This package contains type definitions for whatwg-url (https://github.com/jsdom/whatwg-url#readme). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/whatwg-url. - -### Additional Details - * Last updated: Tue, 21 Jun 2022 16:31:40 GMT - * Dependencies: [@types/webidl-conversions](https://npmjs.com/package/@types/webidl-conversions), [@types/node](https://npmjs.com/package/@types/node) - * Global values: none - -# Credits -These definitions were written by [Alexander Marks](https://github.com/aomarks), and [ExE Boss](https://github.com/ExE-Boss). +# Installation +> `npm install --save @types/whatwg-url` + +# Summary +This package contains type definitions for whatwg-url (https://github.com/jsdom/whatwg-url#readme). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/whatwg-url. + +### Additional Details + * Last updated: Tue, 21 Jun 2022 16:31:40 GMT + * Dependencies: [@types/webidl-conversions](https://npmjs.com/package/@types/webidl-conversions), [@types/node](https://npmjs.com/package/@types/node) + * Global values: none + +# Credits +These definitions were written by [Alexander Marks](https://github.com/aomarks), and [ExE Boss](https://github.com/ExE-Boss). diff --git a/node_modules/color-name/LICENSE b/node_modules/color-name/LICENSE index 4d9802a..c6b1001 100644 --- a/node_modules/color-name/LICENSE +++ b/node_modules/color-name/LICENSE @@ -1,8 +1,8 @@ -The MIT License (MIT) -Copyright (c) 2015 Dmitry Ivanov - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - +The MIT License (MIT) +Copyright (c) 2015 Dmitry Ivanov + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/color-name/README.md b/node_modules/color-name/README.md index 3611a6b..932b979 100644 --- a/node_modules/color-name/README.md +++ b/node_modules/color-name/README.md @@ -1,11 +1,11 @@ -A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors. - -[](https://nodei.co/npm/color-name/) - - -```js -var colors = require('color-name'); -colors.red //[255,0,0] -``` - -<a href="LICENSE"><img src="https://upload.wikimedia.org/wikipedia/commons/0/0c/MIT_logo.svg" width="120"/></a> +A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors. + +[](https://nodei.co/npm/color-name/) + + +```js +var colors = require('color-name'); +colors.red //[255,0,0] +``` + +<a href="LICENSE"><img src="https://upload.wikimedia.org/wikipedia/commons/0/0c/MIT_logo.svg" width="120"/></a> diff --git a/node_modules/color-name/index.js b/node_modules/color-name/index.js index e42aa68..b7c198a 100644 --- a/node_modules/color-name/index.js +++ b/node_modules/color-name/index.js @@ -1,152 +1,152 @@ -'use strict' - -module.exports = { - "aliceblue": [240, 248, 255], - "antiquewhite": [250, 235, 215], - "aqua": [0, 255, 255], - "aquamarine": [127, 255, 212], - "azure": [240, 255, 255], - "beige": [245, 245, 220], - "bisque": [255, 228, 196], - "black": [0, 0, 0], - "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], - "burlywood": [222, 184, 135], - "cadetblue": [95, 158, 160], - "chartreuse": [127, 255, 0], - "chocolate": [210, 105, 30], - "coral": [255, 127, 80], - "cornflowerblue": [100, 149, 237], - "cornsilk": [255, 248, 220], - "crimson": [220, 20, 60], - "cyan": [0, 255, 255], - "darkblue": [0, 0, 139], - "darkcyan": [0, 139, 139], - "darkgoldenrod": [184, 134, 11], - "darkgray": [169, 169, 169], - "darkgreen": [0, 100, 0], - "darkgrey": [169, 169, 169], - "darkkhaki": [189, 183, 107], - "darkmagenta": [139, 0, 139], - "darkolivegreen": [85, 107, 47], - "darkorange": [255, 140, 0], - "darkorchid": [153, 50, 204], - "darkred": [139, 0, 0], - "darksalmon": [233, 150, 122], - "darkseagreen": [143, 188, 143], - "darkslateblue": [72, 61, 139], - "darkslategray": [47, 79, 79], - "darkslategrey": [47, 79, 79], - "darkturquoise": [0, 206, 209], - "darkviolet": [148, 0, 211], - "deeppink": [255, 20, 147], - "deepskyblue": [0, 191, 255], - "dimgray": [105, 105, 105], - "dimgrey": [105, 105, 105], - "dodgerblue": [30, 144, 255], - "firebrick": [178, 34, 34], - "floralwhite": [255, 250, 240], - "forestgreen": [34, 139, 34], - "fuchsia": [255, 0, 255], - "gainsboro": [220, 220, 220], - "ghostwhite": [248, 248, 255], - "gold": [255, 215, 0], - "goldenrod": [218, 165, 32], - "gray": [128, 128, 128], - "green": [0, 128, 0], - "greenyellow": [173, 255, 47], - "grey": [128, 128, 128], - "honeydew": [240, 255, 240], - "hotpink": [255, 105, 180], - "indianred": [205, 92, 92], - "indigo": [75, 0, 130], - "ivory": [255, 255, 240], - "khaki": [240, 230, 140], - "lavender": [230, 230, 250], - "lavenderblush": [255, 240, 245], - "lawngreen": [124, 252, 0], - "lemonchiffon": [255, 250, 205], - "lightblue": [173, 216, 230], - "lightcoral": [240, 128, 128], - "lightcyan": [224, 255, 255], - "lightgoldenrodyellow": [250, 250, 210], - "lightgray": [211, 211, 211], - "lightgreen": [144, 238, 144], - "lightgrey": [211, 211, 211], - "lightpink": [255, 182, 193], - "lightsalmon": [255, 160, 122], - "lightseagreen": [32, 178, 170], - "lightskyblue": [135, 206, 250], - "lightslategray": [119, 136, 153], - "lightslategrey": [119, 136, 153], - "lightsteelblue": [176, 196, 222], - "lightyellow": [255, 255, 224], - "lime": [0, 255, 0], - "limegreen": [50, 205, 50], - "linen": [250, 240, 230], - "magenta": [255, 0, 255], - "maroon": [128, 0, 0], - "mediumaquamarine": [102, 205, 170], - "mediumblue": [0, 0, 205], - "mediumorchid": [186, 85, 211], - "mediumpurple": [147, 112, 219], - "mediumseagreen": [60, 179, 113], - "mediumslateblue": [123, 104, 238], - "mediumspringgreen": [0, 250, 154], - "mediumturquoise": [72, 209, 204], - "mediumvioletred": [199, 21, 133], - "midnightblue": [25, 25, 112], - "mintcream": [245, 255, 250], - "mistyrose": [255, 228, 225], - "moccasin": [255, 228, 181], - "navajowhite": [255, 222, 173], - "navy": [0, 0, 128], - "oldlace": [253, 245, 230], - "olive": [128, 128, 0], - "olivedrab": [107, 142, 35], - "orange": [255, 165, 0], - "orangered": [255, 69, 0], - "orchid": [218, 112, 214], - "palegoldenrod": [238, 232, 170], - "palegreen": [152, 251, 152], - "paleturquoise": [175, 238, 238], - "palevioletred": [219, 112, 147], - "papayawhip": [255, 239, 213], - "peachpuff": [255, 218, 185], - "peru": [205, 133, 63], - "pink": [255, 192, 203], - "plum": [221, 160, 221], - "powderblue": [176, 224, 230], - "purple": [128, 0, 128], - "rebeccapurple": [102, 51, 153], - "red": [255, 0, 0], - "rosybrown": [188, 143, 143], - "royalblue": [65, 105, 225], - "saddlebrown": [139, 69, 19], - "salmon": [250, 128, 114], - "sandybrown": [244, 164, 96], - "seagreen": [46, 139, 87], - "seashell": [255, 245, 238], - "sienna": [160, 82, 45], - "silver": [192, 192, 192], - "skyblue": [135, 206, 235], - "slateblue": [106, 90, 205], - "slategray": [112, 128, 144], - "slategrey": [112, 128, 144], - "snow": [255, 250, 250], - "springgreen": [0, 255, 127], - "steelblue": [70, 130, 180], - "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], - "turquoise": [64, 224, 208], - "violet": [238, 130, 238], - "wheat": [245, 222, 179], - "white": [255, 255, 255], - "whitesmoke": [245, 245, 245], - "yellow": [255, 255, 0], - "yellowgreen": [154, 205, 50] -}; +'use strict' + +module.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] +}; diff --git a/node_modules/color-name/package.json b/node_modules/color-name/package.json index 7acc902..782dd82 100644 --- a/node_modules/color-name/package.json +++ b/node_modules/color-name/package.json @@ -1,28 +1,28 @@ -{ - "name": "color-name", - "version": "1.1.4", - "description": "A list of color names and its values", - "main": "index.js", - "files": [ - "index.js" - ], - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "git@github.com:colorjs/color-name.git" - }, - "keywords": [ - "color-name", - "color", - "color-keyword", - "keyword" - ], - "author": "DY <dfcreative@gmail.com>", - "license": "MIT", - "bugs": { - "url": "https://github.com/colorjs/color-name/issues" - }, - "homepage": "https://github.com/colorjs/color-name" -} +{ + "name": "color-name", + "version": "1.1.4", + "description": "A list of color names and its values", + "main": "index.js", + "files": [ + "index.js" + ], + "scripts": { + "test": "node test.js" + }, + "repository": { + "type": "git", + "url": "git@github.com:colorjs/color-name.git" + }, + "keywords": [ + "color-name", + "color", + "color-keyword", + "keyword" + ], + "author": "DY <dfcreative@gmail.com>", + "license": "MIT", + "bugs": { + "url": "https://github.com/colorjs/color-name/issues" + }, + "homepage": "https://github.com/colorjs/color-name" +} diff --git a/node_modules/sift/es5m/index.js b/node_modules/sift/es5m/index.js index 79c77a2..bedb93b 100644 --- a/node_modules/sift/es5m/index.js +++ b/node_modules/sift/es5m/index.js @@ -1,32 +1,32 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise */ - -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var typeChecker = function (type) { diff --git a/node_modules/sift/lib/index.js b/node_modules/sift/lib/index.js index 3e6e078..52cc23b 100644 --- a/node_modules/sift/lib/index.js +++ b/node_modules/sift/lib/index.js @@ -4,35 +4,35 @@ (global = global || self, factory(global.sift = {})); }(this, (function (exports) { 'use strict'; - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** */ - /* global Reflect, Promise */ - - var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - - function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + /* global Reflect, Promise */ + + var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + + function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var typeChecker = function (type) { diff --git a/node_modules/sift/sift.csp.min.js b/node_modules/sift/sift.csp.min.js index ac6865c..0e28d1e 100644 --- a/node_modules/sift/sift.csp.min.js +++ b/node_modules/sift/sift.csp.min.js @@ -4,35 +4,35 @@ (global = global || self, factory(global.sift = {})); }(this, (function (exports) { 'use strict'; - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** */ - /* global Reflect, Promise */ - - var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - - function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + /* global Reflect, Promise */ + + var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + + function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var typeChecker = function (type) { diff --git a/routes/index.js b/routes/index.js index 0430ed0..afc2160 100644 --- a/routes/index.js +++ b/routes/index.js @@ -1,10 +1,10 @@ -const router = require("express").Router() -const Task = require("../Task"); - -router.get("/", async(req, res) => { - const allTasks = await Task.find(); - res.render("index", {task: allTasks}) -}) - - +const router = require("express").Router() +const Task = require("../Task"); + +router.get("/", async(req, res) => { + const allTasks = await Task.find(); + res.render("index", {task: allTasks}) +}) + + module.exports = router; \ No newline at end of file diff --git a/routes/taskRoutes.js b/routes/taskRoutes.js index fe62447..e096be1 100644 --- a/routes/taskRoutes.js +++ b/routes/taskRoutes.js @@ -1,38 +1,38 @@ -// defining a router to organise routes -const router = require("express").Router(); -const Task = require("../Task"); - -// route to add a task -router.post("/add/task", (req, res) => { - const { task } = req.body; - const newTask = new Task({ task }); - - newTask.save().then(() => { - console.log("The task has been added to the list."); - res.redirect("/"); - }) - .catch((err) => console.log(err)); -}) - - -// route to delete a task -router.get("/delete/task/:_id", (req, res) => { - const { _id } = req.params; - Task.deleteOne({ _id }).then(() => { - console.log("The task has been deleted."); - res.redirect("/"); - }) - .catch((err) => console.log(err)); -}) - -//route to update a task -router.get("/update/task/:_id",(req,res)=>{ - const {_id}=req.params; - Task.updateOne({_id}, { isCompleted:"1"}).then(()=>{ - console.log("The task has been completed") - res.redirect('/') - }) - .catch((err)=>console.log(err)); -}); - -module.exports = router; +// defining a router to organise routes +const router = require("express").Router(); +const Task = require("../Task"); + +// route to add a task +router.post("/add/task", (req, res) => { + const { task } = req.body; + const newTask = new Task({ task }); + + newTask.save().then(() => { + console.log("The task has been added to the list."); + res.redirect("/"); + }) + .catch((err) => console.log(err)); +}) + + +// route to delete a task +router.get("/delete/task/:_id", (req, res) => { + const { _id } = req.params; + Task.deleteOne({ _id }).then(() => { + console.log("The task has been deleted."); + res.redirect("/"); + }) + .catch((err) => console.log(err)); +}) + +//route to update a task +router.get("/update/task/:_id",(req,res)=>{ + const {_id}=req.params; + Task.updateOne({_id}, { isCompleted:"1"}).then(()=>{ + console.log("The task has been completed") + res.redirect('/') + }) + .catch((err)=>console.log(err)); +}); + +module.exports = router; diff --git a/views/index.ejs b/views/index.ejs index 071a0ac..9172436 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -1,101 +1,101 @@ -<!DOCTYPE html> - -<html lang="en"> - - <head> - <meta charset="UTF-8"> - <title>ToDo App</title> - <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous"> - <style> - .hov:hover { - background-color: rgb(245, 245, 245); - } - .hov-completed:hover{ - background-color: #90EE90; - } - .task-item { - display: flex; - justify-content: space-between; - align-items: center; - } - .completed-task { - background-color: #c0f7c0; - } - .hide-completed { - display: none; - } - </style> - </head> - - <body> - <div class="container" style="margin-top: 50px;"> - <h3 style="text-align: center;"><img src="logo.png" width="100" height="100" style="margin-bottom: 10px;"/><br>ToDo App</h3> - <div class="section"> - <p class="lead" style="text-align: center;">Organize your life with our ToDo App and stop forgetting things!</p> - </div> - </div> - <div class="container mt-5"> - <form action="/add/task" class="d-flex" method="POST"> - <input type="text" name="task" class="form-control" placeholder="Type a task to do"> - <button type="submit" class="btn btn-outline-dark sm-">Add</button> - </form> - <ul class="list-group mt-3"> - <% task.forEach(tasks => { %> - <% if (tasks.isCompleted === '0') { %> - <li class="list-group-item hov task-item"> - <%= tasks.task %> - <span> - <a href="/update/task/<%= tasks._id %>" class="btn btn-success btn-sm-">Task completed</a> - <a href="/delete/task/<%= tasks._id %>" class="btn btn-dark btn-sm-">Delete the task</a> - </span> - </li> - <% } %> - <% }) %> - - <% task.forEach(tasks => { %> - <% if (tasks.isCompleted === '1') { %> - <li class="list-group-item hov-completed task-item completed-task"> - <%= tasks.task %> - <span> - <a href="/delete/task/<%= tasks._id %>" class="btn btn-dark btn-sm-">Delete the task</a> - </span> - </li> - <% } %> - <% }) %> - </ul> - - <button id="showCompletedTasks" class="btn btn-outline-success sm- mt-3">Completed tasks</button> - - <script> - document.addEventListener("DOMContentLoaded", function () { - const showCompletedButton = document.getElementById("showCompletedTasks"); - const completedTasks = document.querySelectorAll(".completed-task"); - const hideCompletedClass = "hide-completed"; - - // Initially hide completed tasks - completedTasks.forEach(function (task) { - task.classList.add(hideCompletedClass); - }); - - // Verify if there are completed tasks to show (or not) the button - const hasCompletedTasks = document.querySelector(".completed-task"); - if (!hasCompletedTasks) { - showCompletedButton.style.display = "none"; - } - - showCompletedButton.addEventListener("click", function () { - // Switch the visibility of hidden tasks - completedTasks.forEach(function (task) { - if (task.classList.contains(hideCompletedClass)) { - task.classList.remove(hideCompletedClass); - } else { - task.classList.add(hideCompletedClass); - } - }); - }); - }); - </script> - <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script> - - </body> -</html> +<!DOCTYPE html> + +<html lang="en"> + + <head> + <meta charset="UTF-8"> + <title>ToDo App</title> + <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous"> + <style> + .hov:hover { + background-color: rgb(245, 245, 245); + } + .hov-completed:hover{ + background-color: #90EE90; + } + .task-item { + display: flex; + justify-content: space-between; + align-items: center; + } + .completed-task { + background-color: #c0f7c0; + } + .hide-completed { + display: none; + } + </style> + </head> + + <body> + <div class="container" style="margin-top: 50px;"> + <h3 style="text-align: center;"><img src="logo.png" width="100" height="100" style="margin-bottom: 10px;"/><br>ToDo App</h3> + <div class="section"> + <p class="lead" style="text-align: center;">Organize your life with our ToDo App and stop forgetting things!</p> + </div> + </div> + <div class="container mt-5"> + <form action="/add/task" class="d-flex" method="POST"> + <input type="text" name="task" class="form-control" placeholder="Type a task to do"> + <button type="submit" class="btn btn-outline-dark sm-">Add</button> + </form> + <ul class="list-group mt-3"> + <% task.forEach(tasks => { %> + <% if (tasks.isCompleted === '0') { %> + <li class="list-group-item hov task-item"> + <%= tasks.task %> + <span> + <a href="/update/task/<%= tasks._id %>" class="btn btn-success btn-sm-">Task completed</a> + <a href="/delete/task/<%= tasks._id %>" class="btn btn-dark btn-sm-">Delete the task</a> + </span> + </li> + <% } %> + <% }) %> + + <% task.forEach(tasks => { %> + <% if (tasks.isCompleted === '1') { %> + <li class="list-group-item hov-completed task-item completed-task"> + <%= tasks.task %> + <span> + <a href="/delete/task/<%= tasks._id %>" class="btn btn-dark btn-sm-">Delete the task</a> + </span> + </li> + <% } %> + <% }) %> + </ul> + + <button id="showCompletedTasks" class="btn btn-outline-success sm- mt-3">Completed tasks</button> + + <script> + document.addEventListener("DOMContentLoaded", function () { + const showCompletedButton = document.getElementById("showCompletedTasks"); + const completedTasks = document.querySelectorAll(".completed-task"); + const hideCompletedClass = "hide-completed"; + + // Initially hide completed tasks + completedTasks.forEach(function (task) { + task.classList.add(hideCompletedClass); + }); + + // Verify if there are completed tasks to show (or not) the button + const hasCompletedTasks = document.querySelector(".completed-task"); + if (!hasCompletedTasks) { + showCompletedButton.style.display = "none"; + } + + showCompletedButton.addEventListener("click", function () { + // Switch the visibility of hidden tasks + completedTasks.forEach(function (task) { + if (task.classList.contains(hideCompletedClass)) { + task.classList.remove(hideCompletedClass); + } else { + task.classList.add(hideCompletedClass); + } + }); + }); + }); + </script> + <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script> + + </body> +</html> -- GitLab