From 43b1f166d7974556cf89c69919afb21870030b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?LAINEY=20Gr=C3=A9gory?= Date: Fri, 25 Sep 2026 11:02:14 +0200 Subject: [PATCH] =?UTF-8?q?D=C3=A9but=20du=20projet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 6 + .gitignore | 11 + .vscode/settings.json | 47 ++ Dockerfile | 14 + README.md | 95 +++ cahierDesCharges.md | 191 +++++ data/animaux.json | 13 + data/periodesCouvage.json | 9 + data/periodesPonte.json | 9 + data/utilisateurs.json | 14 + docker-compose.yml | 11 + lib/donnees.js | 50 ++ package-lock.json | 1668 +++++++++++++++++++++++++++++++++++++ package.json | 16 + public/animal.html | 119 +++ public/archives.html | 32 + public/comptes.html | 68 ++ public/connexion.html | 30 + public/css/style.css | 476 +++++++++++ public/index.html | 87 ++ public/js/accueil.js | 114 +++ public/js/archives.js | 41 + public/js/commun.js | 133 +++ public/js/comptes.js | 86 ++ public/js/connexion.js | 42 + public/js/fiche.js | 319 +++++++ server.js | 583 +++++++++++++ uploads/.gitkeep | 0 28 files changed, 4284 insertions(+) create mode 100644 .dockerignore create mode 100644 .gitignore create mode 100644 .vscode/settings.json create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 cahierDesCharges.md create mode 100644 data/animaux.json create mode 100644 data/periodesCouvage.json create mode 100644 data/periodesPonte.json create mode 100644 data/utilisateurs.json create mode 100644 docker-compose.yml create mode 100644 lib/donnees.js create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 public/animal.html create mode 100644 public/archives.html create mode 100644 public/comptes.html create mode 100644 public/connexion.html create mode 100644 public/css/style.css create mode 100644 public/index.html create mode 100644 public/js/accueil.js create mode 100644 public/js/archives.js create mode 100644 public/js/commun.js create mode 100644 public/js/comptes.js create mode 100644 public/js/connexion.js create mode 100644 public/js/fiche.js create mode 100644 server.js create mode 100644 uploads/.gitkeep diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f509615 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +node_modules +npm-debug.log +.git +.vscode +*.md +!README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..49edce1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +# Dépendances +node_modules/ + +# Photos uploadées (conservées via volume Docker) +uploads/* +!uploads/.gitkeep + +# Fichiers système +.DS_Store +Thumbs.db +*.log diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6970a79 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,47 @@ +{ + "projectColors.mainColor": "#2db81e", + "window.title": "d:\\Users\\glainey\\developpement\\perso\\poupoule", + "workbench.colorCustomizations": { + "editor.background": "#F0F0F0", + "minimap.background": "#21212180", + "statusBar.background": "#2db81e", + "tab.unfocusedActiveBorder": "#fff0", + "statusBarItem.warningBackground": "#2db81e", + "statusBarItem.warningForeground": "#ffffff", + "statusBarItem.warningHoverBackground": "#2db81e", + "statusBarItem.warningHoverForeground": "#ffffff90", + "statusBarItem.remoteBackground": "#3ac52b", + "statusBarItem.remoteForeground": "#ffffff", + "statusBarItem.remoteHoverBackground": "#47d238", + "statusBarItem.remoteHoverForeground": "#ffffff90", + "statusBar.foreground": "#ffffff", + "statusBar.border": "#2db81e", + "statusBar.debuggingBackground": "#2db81e", + "statusBar.debuggingForeground": "#ffffff", + "statusBar.debuggingBorder": "#2db81e", + "statusBar.noFolderBackground": "#2db81e", + "statusBar.noFolderForeground": "#ffffff", + "statusBar.noFolderBorder": "#2db81e", + "statusBar.prominentBackground": "#2db81e", + "statusBar.prominentForeground": "#ffffff", + "statusBar.prominentHoverBackground": "#2db81e", + "statusBar.prominentHoverForeground": "#ffffff90", + "focusBorder": "#2db81e99", + "progressBar.background": "#2db81e", + "textLink.foreground": "#6df85e", + "textLink.activeForeground": "#7aff6b", + "selection.background": "#20ab11", + "list.highlightForeground": "#2db81e", + "list.focusAndSelectionOutline": "#2db81e99", + "button.background": "#2db81e", + "button.foreground": "#ffffff", + "button.hoverBackground": "#3ac52b", + "tab.activeBorderTop": "#3ac52b", + "pickerGroup.foreground": "#3ac52b", + "list.activeSelectionBackground": "#2db81e4d", + "panelTitle.activeBorder": "#3ac52b", + "activityBar.activeBorder": "#2db81e", + "activityBarBadge.foreground": "#ffffff", + "activityBarBadge.background": "#2db81e" + } +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0120c5d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM node:20-alpine + +WORKDIR /app + +COPY package.json package-lock.json ./ +RUN npm install --omit=dev + +COPY . . + +RUN mkdir -p uploads data + +EXPOSE 3000 + +CMD ["node", "server.js"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..062fb31 --- /dev/null +++ b/README.md @@ -0,0 +1,95 @@ +# Mon Poulailler + +Application web simple pour gérer un poulailler : animaux, ponte, couvage, archives. + +Conçue pour être **lisible par un débutant** : peu de fichiers, JavaScript classique, données en JSON. + +## Prérequis + +- [Node.js](https://nodejs.org/) (version 18 ou plus), **ou** +- [Docker](https://www.docker.com/) + Docker Compose + +## Démarrage rapide (sans Docker) + +```bash +npm install +npm start +``` + +Ouvre ensuite : [http://localhost:3000](http://localhost:3000) + +## Démarrage avec Docker + +```bash +docker compose up --build +``` + +Puis : [http://localhost:3000](http://localhost:3000) + +Pour arrêter : + +```bash +docker compose down +``` + +## Compte par défaut + +| Login | Mot de passe | Profil | +| --- | --- | --- | +| `admin` | `admin123` | administrateur | + +Change ce mot de passe en créant un nouveau compte admin, puis en n'utilisant plus celui-ci (ou en modifiant le fichier JSON). + +## Utilisation + +1. Se connecter avec le compte admin +2. Créer des comptes utilisateurs (menu **Comptes**, réservé à l'admin) +3. Ajouter des poules / coqs depuis la page d'accueil +4. Ouvrir une fiche animal pour modifier, enregistrer ponte / couvage, ou archiver +5. Consulter les **Archives** pour les animaux décédés + +## Structure du projet + +``` +poupoule/ +├── server.js # Serveur Node.js (routes API) +├── lib/donnees.js # Lecture / écriture des fichiers JSON +├── data/ # Données persistantes (JSON) +│ ├── utilisateurs.json +│ ├── animaux.json +│ ├── periodesPonte.json +│ └── periodesCouvage.json +├── uploads/ # Photos des animaux +├── public/ # Interface (HTML, CSS, JS) +│ ├── index.html # Liste + statistiques +│ ├── animal.html # Fiche détaillée +│ ├── archives.html +│ ├── comptes.html +│ ├── connexion.html +│ ├── css/style.css +│ └── js/ # Scripts par page +├── Dockerfile +├── docker-compose.yml +└── cahierDesCharges.md +``` + +## Sauvegarde des données + +Les informations sont stockées dans le dossier `data/` (fichiers JSON) et les photos dans `uploads/`. + +Pour sauvegarder : **copie ces deux dossiers**. + +Avec Docker, ils sont montés en volumes : ils restent sur ta machine même si le conteneur est reconstruit. + +## Technologies + +| Couche | Choix | +| --- | --- | +| Front | HTML, CSS, JavaScript (sans framework) | +| Back | Node.js + Express | +| Données | Fichiers JSON | +| Auth | Sessions + mots de passe hachés (bcrypt) | + +## Documentation métier + +Voir [cahierDesCharges.md](cahierDesCharges.md). diff --git a/cahierDesCharges.md b/cahierDesCharges.md new file mode 100644 index 0000000..c59e2e3 --- /dev/null +++ b/cahierDesCharges.md @@ -0,0 +1,191 @@ +# Cahier des charges — Mon Poulailler + +## 1. Contexte + +Le projet **Mon Poulailler** vise à créer une application web de gestion d’un poulailler. + +Dans la gestion quotidienne d’un poulailler, il est important de connaître : + +* le nombre de poules et de coqs ; +* l’identité et les caractéristiques de chaque animal ; +* l’état de santé ; +* les périodes de ponte (début, durée, fin) ; +* les périodes de couvage ; +* l’historique des animaux décédés. + +L’application doit permettre de suivre ces informations de façon centralisée et à jour. + +## 2. Objectif + +Disposer d’une vue claire et à jour de l’état du poulailler : effectifs, animaux actifs, périodes de ponte et de couvage, et archives. + +## 3. Périmètre + +### 3.1 Inclus + +* Authentification (création de comptes, connexion) ; +* gestion des poules et des coqs ; +* suivi des périodes de ponte et de couvage ; +* statistiques d’effectifs en temps réel ; +* archivage des animaux décédés ; +* déploiement local via Docker. + +### 3.2 Hors périmètre (version initiale) + +* Application mobile native ; +* notifications push / alertes automatiques ; +* suivi vétérinaire détaillé (ordonnances, traitements) ; +* gestion multi-poulaillers ; +* synchronisation cloud / multi-appareils hors réseau local ; +* inventaire des œufs au quotidien (sauf si lié explicitement à une période de ponte). + +## 4. Utilisateurs + +| Profil | Description | Droits principaux | +| --- | --- | --- | +| Administrateur | Responsable du poulailler / de l’application | Créer des comptes, gérer tous les animaux | +| Utilisateur | Personne qui s’occupe des poules | Gérer les poules et les coqs (sans création de comptes) | + +## 5. Fonctionnalités + +### 5.1 Authentification et comptes + +* Création de comptes (réservée à l’administrateur) ; +* connexion par identifiant et mot de passe ; +* déconnexion ; +* deux profils : **Admin** et **Utilisateur**. + +| Action | Admin | Utilisateur | +| --- | --- | --- | +| Se connecter / se déconnecter | Oui | Oui | +| Créer un compte | Oui | Non | +| Gérer poules et coqs | Oui | Oui | +| Consulter les statistiques | Oui | Oui | +| Consulter les archives | Oui | Oui | + +### 5.2 Gestion des animaux (poules et coqs) + +Pour chaque animal, l’application permet de renseigner et consulter : + +| Donnée | Description | +| --- | --- | +| Identifiant unique | Identifiant technique unique dans l’application | +| Photo | Image de l’animal | +| Couleur de bague | Couleur de la bague d’identification | +| Numéro de bague | Numéro associé à la bague | +| Date de naissance | Date de naissance (ou date d’arrivée si inconnue) | +| Type | Poule ou coq | +| État de santé | Indication simple de l’état de santé | +| Date de fin de vie | Renseignée lorsque l’animal décède | + +Actions attendues : + +* créer un animal ; +* modifier ses informations ; +* consulter sa fiche détaillée ; +* marquer un animal comme décédé (passe en archive) ; +* lister les animaux actifs ; +* lister les animaux archivés (décédés). + +### 5.3 Périodes de ponte (poules uniquement) + +* Enregistrer une ou plusieurs périodes de ponte ; +* pour chaque période : date de début, date de fin (optionnelle si en cours), éventuellement une remarque ; +* indiquer si la poule pond actuellement. + +### 5.4 Périodes de couvage (poules uniquement) + +* Enregistrer une ou plusieurs périodes de couvage ; +* pour chaque période : date de début, date de fin (optionnelle si en cours), éventuellement une remarque ; +* indiquer si la poule est actuellement en couvage. + +### 5.5 Statistiques + +Affichage en temps réel (après chaque action ou au chargement) : + +* nombre de poules actives ; +* nombre de coqs actifs ; +* nombre total d’animaux actifs ; +* nombre de poules actuellement en couvage ; +* nombre de poules actuellement en ponte (souhaitable). + +### 5.6 Archives + +* Vue dédiée aux animaux décédés ; +* conservation des informations (identité, bagues, dates, historique de ponte / couvage) ; +* pas de suppression définitive obligatoire en v1 (possibilité de la prévoir plus tard). + +## 6. Exigences non fonctionnelles + +| Exigence | Attendu | +| --- | --- | +| Accessibilité | Interface utilisable sur ordinateur et tablette (responsive de base) | +| Performance | Réponses rapides sur un usage local (peu d’utilisateurs simultanés) | +| Sécurité | Mots de passe stockés de façon sécurisée (hachage) ; accès réservé aux utilisateurs authentifiés | +| Disponibilité | Application disponible en local via Docker | +| Ergonomie | Navigation simple : liste, fiche animal, statistiques, archives | +| Données | Persistance via fichiers JSON ; sauvegarde manuelle possible en copiant les fichiers | + +## 7. Spécifications techniques + +| Élément | Choix | +| --- | --- | +| Type d’application | Application web | +| Hébergement | Local, via Docker | +| Front-end | HTML, CSS, JavaScript | +| Back-end | JavaScript (Node.js recommandé) | +| Base de données | Fichiers JSON (stockage documentaire) | + +### 7.1 Architecture cible (indicatif) + +* Interface web servie par le back-end ; +* API métier pour authentification et CRUD animaux / périodes ; +* persistance dans un ou plusieurs fichiers JSON montés en volume Docker. + +### 7.2 Contraintes techniques + +* Fonctionnement hors cloud, en environnement local ; +* pas de dépendance à une base relationnelle en v1 ; +* les données doivent survivre à un redémarrage du conteneur (volume Docker). + +## 8. Modèle de données (indicatif) + +### Utilisateur + +* `id`, `login`, `motDePasseHash`, `profil` (`admin` | `utilisateur`) + +### Animal + +* `id`, `type` (`poule` | `coq`), `photo`, `couleurBague`, `numeroBague`, `dateNaissance`, `etatSante`, `dateFinDeVie` (nullable), `actif` (booléen) + +### PeriodePonte + +* `id`, `idAnimal`, `dateDebut`, `dateFin` (nullable), `remarque` + +### PeriodeCouvage + +* `id`, `idAnimal`, `dateDebut`, `dateFin` (nullable), `remarque` + +## 9. Critères d’acceptation (v1) + +* Un administrateur peut créer un compte utilisateur et se connecter. +* Un utilisateur connecté peut ajouter une poule avec photo, bague, date de naissance. +* Un utilisateur peut enregistrer une période de ponte et une période de couvage. +* Les statistiques affichent correctement le nombre de poules, de coqs et de poules en couvage. +* Marquer une poule comme décédée la retire de la liste active et l’ajoute aux archives. +* L’application démarre via Docker et conserve les données après redémarrage. + +## 10. Livrables + +* Code source de l’application ; +* `Dockerfile` / `docker-compose` pour le lancement local ; +* documentation courte de démarrage (installation, comptes, sauvegarde des JSON) ; +* le présent cahier des charges à jour. + +## 11. Evolutions possibles (hors v1) + +* Suivi quotidien des œufs collectés ; +* alertes (fin de ponte, couvage prolongé) ; +* export CSV / PDF ; +* multi-poulaillers ; +* application mobile. diff --git a/data/animaux.json b/data/animaux.json new file mode 100644 index 0000000..fb3fe28 --- /dev/null +++ b/data/animaux.json @@ -0,0 +1,13 @@ +[ + { + "id": "mugpv73kclf5lu", + "type": "poule", + "photo": "/uploads/mugpvgsib4adaw.jpg", + "couleurBague": "Rouge", + "numeroBague": "38", + "dateNaissance": "2026-04-05", + "etatSante": "bon", + "dateFinDeVie": null, + "actif": true + } +] \ No newline at end of file diff --git a/data/periodesCouvage.json b/data/periodesCouvage.json new file mode 100644 index 0000000..f2236b9 --- /dev/null +++ b/data/periodesCouvage.json @@ -0,0 +1,9 @@ +[ + { + "id": "mugpvzh6249gwn", + "idAnimal": "mugpv73kclf5lu", + "dateDebut": "2026-03-03", + "dateFin": null, + "remarque": "" + } +] \ No newline at end of file diff --git a/data/periodesPonte.json b/data/periodesPonte.json new file mode 100644 index 0000000..1aa3431 --- /dev/null +++ b/data/periodesPonte.json @@ -0,0 +1,9 @@ +[ + { + "id": "mugpvr65eki768", + "idAnimal": "mugpv73kclf5lu", + "dateDebut": "2026-02-02", + "dateFin": null, + "remarque": "" + } +] \ No newline at end of file diff --git a/data/utilisateurs.json b/data/utilisateurs.json new file mode 100644 index 0000000..cf2d959 --- /dev/null +++ b/data/utilisateurs.json @@ -0,0 +1,14 @@ +[ + { + "id": "admin001", + "login": "admin", + "motDePasseHash": "$2a$10$PFIJmZ9LxGO5pAqR3d8Ld.zaMQdg0F..BLzPPWz8a.P0JsJkcGp4q", + "profil": "admin" + }, + { + "id": "mugpwhdhkoe7ar", + "login": "Greg", + "motDePasseHash": "$2a$10$5H5xgUTeJvptVTNH5szKG.7.kfXDb8llbT2JNzaCiblAVivQE8HZq", + "profil": "utilisateur" + } +] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..3d465e1 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +services: + poulailler: + build: . + ports: + - "3000:3000" + volumes: + # Les données JSON survivent au redémarrage du conteneur + - ./data:/app/data + # Les photos uploadées aussi + - ./uploads:/app/uploads + restart: unless-stopped diff --git a/lib/donnees.js b/lib/donnees.js new file mode 100644 index 0000000..bc70f00 --- /dev/null +++ b/lib/donnees.js @@ -0,0 +1,50 @@ +const fs = require("fs"); +const path = require("path"); + +const dossierData = path.join(__dirname, "..", "data"); + +/** + * Lit un fichier JSON et retourne son contenu. + * Si le fichier n'existe pas, retourne la valeur par défaut. + */ +function lireJson(nomFichier, valeurParDefaut) +{ + const chemin = path.join(dossierData, nomFichier); + + if (!fs.existsSync(chemin)) + { + return valeurParDefaut; + } + + const contenu = fs.readFileSync(chemin, "utf8"); + return JSON.parse(contenu); +} + +/** + * Écrit un objet JavaScript dans un fichier JSON. + */ +function ecrireJson(nomFichier, donnees) +{ + if (!fs.existsSync(dossierData)) + { + fs.mkdirSync(dossierData, { recursive: true }); + } + + const chemin = path.join(dossierData, nomFichier); + fs.writeFileSync(chemin, JSON.stringify(donnees, null, 2), "utf8"); +} + +/** + * Génère un identifiant simple à partir de la date et d'un nombre aléatoire. + */ +function genererId() +{ + return Date.now().toString(36) + Math.random().toString(36).slice(2, 8); +} + +module.exports = { + lireJson, + ecrireJson, + genererId, + dossierData +}; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..aa34bf8 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1668 @@ +{ + "name": "mon-poulailler", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "mon-poulailler", + "version": "1.0.0", + "dependencies": { + "bcryptjs": "^2.4.3", + "express": "^4.21.2", + "express-session": "^1.18.1", + "multer": "^1.4.5-lts.1" + } + }, + "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/append-field": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", + "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==" + }, + "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/bcryptjs": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", + "integrity": "sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==" + }, + "node_modules/body-parser": { + "version": "1.20.8", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.8.tgz", + "integrity": "sha512-JNcyFQ64OiijEkPzUBTCe+hyPXUD/3LEldGQ6iF5LR1w00mx9o7xtDWHXBY2iItjdCFGoilOLNQbH943ut7pHA==", + "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.1", + "iconv-lite": "~0.4.24", + "on-finished": "~2.4.1", + "qs": "~6.16.0", + "raw-body": "~2.5.3", + "type-is": "~1.6.18", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, + "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-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "engines": [ + "node >= 0.8" + ], + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "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.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz", + "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==" + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "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/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/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "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": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "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/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "dependencies": { + "es-errors": "^1.3.0" + }, + "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.22.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.22.3.tgz", + "integrity": "sha512-Bdcs4+3qlpVlx2NRn6fgX2Ue2/gGRaPeawebgclM0ERSCqDpA+owF1fdPwjJUTAJWMTuAaxjDf+hzb0/4eKvvw==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "~1.20.5", + "content-disposition": "~0.5.4", + "content-type": "~1.0.4", + "cookie": "~0.7.1", + "cookie-signature": "~1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.3.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "~0.1.13", + "proxy-addr": "~2.0.7", + "qs": "~6.16.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "~0.19.0", + "serve-static": "~1.16.2", + "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" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/express-session": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.19.0.tgz", + "integrity": "sha512-0csaMkGq+vaiZTmSMMGkfdCOabYv192VbytFypcvI0MANrp+4i/7yEkJ0sbAEhycQjntaKGzYfjfXQyVb7BHMA==", + "dependencies": { + "cookie": "~0.7.2", + "cookie-signature": "~1.0.7", + "debug": "~2.6.9", + "depd": "~2.0.0", + "on-headers": "~1.1.0", + "parseurl": "~1.3.3", + "safe-buffer": "~5.2.1", + "uid-safe": "~2.1.5" + }, + "engines": { + "node": ">= 0.8.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/finalhandler": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz", + "integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "statuses": "~2.0.2", + "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.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "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/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "engines": { + "node": ">= 0.4" + } + }, + "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.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/multer": { + "version": "1.4.5-lts.2", + "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.2.tgz", + "integrity": "sha512-VzGiVigcG9zUAoCNU+xShztrlr1auZOlurXynNvO9GiWD1/mTBbUljOKY+qMeazBqXgRnjzeEgJI/wyjJUHg9A==", + "deprecated": "Multer 1.x is impacted by a number of vulnerabilities, which have been patched in 2.x. You should upgrade to the latest 2.x version.", + "dependencies": { + "append-field": "^1.0.0", + "busboy": "^1.0.0", + "concat-stream": "^1.5.2", + "mkdirp": "^0.5.4", + "object-assign": "^4.1.1", + "type-is": "^1.6.4", + "xtend": "^4.0.0" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "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.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "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/on-headers": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.1.0.tgz", + "integrity": "sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==", + "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.13", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz", + "integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA==" + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "node_modules/proxy-addr": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.8.tgz", + "integrity": "sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/qs": { + "version": "6.16.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.16.0.tgz", + "integrity": "sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA==", + "dependencies": { + "es-define-property": "^1.0.1", + "side-channel": "^1.1.1" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/random-bytes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", + "integrity": "sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ==", + "engines": { + "node": ">= 0.8" + } + }, + "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.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz", + "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "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.19.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.2.tgz", + "integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.1", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "~2.4.1", + "range-parser": "~1.2.1", + "statuses": "~2.0.2" + }, + "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.16.3", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz", + "integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "~0.19.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "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.1.1", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", + "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4", + "side-channel-list": "^1.0.1", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", + "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "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/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" + }, + "node_modules/uid-safe": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", + "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", + "dependencies": { + "random-bytes": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "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/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "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/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "engines": { + "node": ">=0.4" + } + } + }, + "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" + } + }, + "append-field": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", + "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==" + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "bcryptjs": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", + "integrity": "sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==" + }, + "body-parser": { + "version": "1.20.8", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.8.tgz", + "integrity": "sha512-JNcyFQ64OiijEkPzUBTCe+hyPXUD/3LEldGQ6iF5LR1w00mx9o7xtDWHXBY2iItjdCFGoilOLNQbH943ut7pHA==", + "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.1", + "iconv-lite": "~0.4.24", + "on-finished": "~2.4.1", + "qs": "~6.16.0", + "raw-body": "~2.5.3", + "type-is": "~1.6.18", + "unpipe": "~1.0.0" + } + }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + }, + "busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "requires": { + "streamsearch": "^1.1.0" + } + }, + "bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" + }, + "call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + } + }, + "call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "requires": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + } + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "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.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==" + }, + "cookie-signature": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz", + "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==" + }, + "core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "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" + } + }, + "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==" + }, + "dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + } + }, + "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": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==" + }, + "es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==" + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" + }, + "es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "requires": { + "es-errors": "^1.3.0" + } + }, + "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.22.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.22.3.tgz", + "integrity": "sha512-Bdcs4+3qlpVlx2NRn6fgX2Ue2/gGRaPeawebgclM0ERSCqDpA+owF1fdPwjJUTAJWMTuAaxjDf+hzb0/4eKvvw==", + "requires": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "~1.20.5", + "content-disposition": "~0.5.4", + "content-type": "~1.0.4", + "cookie": "~0.7.1", + "cookie-signature": "~1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.3.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "~0.1.13", + "proxy-addr": "~2.0.7", + "qs": "~6.16.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "~0.19.0", + "serve-static": "~1.16.2", + "setprototypeof": "1.2.0", + "statuses": "~2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + } + }, + "express-session": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.19.0.tgz", + "integrity": "sha512-0csaMkGq+vaiZTmSMMGkfdCOabYv192VbytFypcvI0MANrp+4i/7yEkJ0sbAEhycQjntaKGzYfjfXQyVb7BHMA==", + "requires": { + "cookie": "~0.7.2", + "cookie-signature": "~1.0.7", + "debug": "~2.6.9", + "depd": "~2.0.0", + "on-headers": "~1.1.0", + "parseurl": "~1.3.3", + "safe-buffer": "~5.2.1", + "uid-safe": "~2.1.5" + } + }, + "finalhandler": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz", + "integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==", + "requires": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "statuses": "~2.0.2", + "unpipe": "~1.0.0" + } + }, + "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==" + }, + "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.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "requires": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + } + }, + "get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "requires": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + } + }, + "gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==" + }, + "has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==" + }, + "hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "requires": { + "function-bind": "^1.1.2" + } + }, + "http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "requires": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "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" + } + }, + "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==" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==" + }, + "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.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==" + }, + "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" + } + }, + "minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==" + }, + "mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "requires": { + "minimist": "^1.2.6" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "multer": { + "version": "1.4.5-lts.2", + "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.2.tgz", + "integrity": "sha512-VzGiVigcG9zUAoCNU+xShztrlr1auZOlurXynNvO9GiWD1/mTBbUljOKY+qMeazBqXgRnjzeEgJI/wyjJUHg9A==", + "requires": { + "append-field": "^1.0.0", + "busboy": "^1.0.0", + "concat-stream": "^1.5.2", + "mkdirp": "^0.5.4", + "object-assign": "^4.1.1", + "type-is": "^1.6.4", + "xtend": "^4.0.0" + } + }, + "negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" + }, + "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==" + }, + "object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==" + }, + "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" + } + }, + "on-headers": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.1.0.tgz", + "integrity": "sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==" + }, + "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.13", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz", + "integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA==" + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "proxy-addr": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.8.tgz", + "integrity": "sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ==", + "requires": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + } + }, + "qs": { + "version": "6.16.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.16.0.tgz", + "integrity": "sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA==", + "requires": { + "es-define-property": "^1.0.1", + "side-channel": "^1.1.1" + } + }, + "random-bytes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", + "integrity": "sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ==" + }, + "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.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz", + "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==", + "requires": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "unpipe": "~1.0.0" + } + }, + "readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "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==" + }, + "send": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.2.tgz", + "integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==", + "requires": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.1", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "~2.4.1", + "range-parser": "~1.2.1", + "statuses": "~2.0.2" + }, + "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.16.3", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz", + "integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==", + "requires": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "~0.19.1" + } + }, + "setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "side-channel": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", + "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4", + "side-channel-list": "^1.0.1", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + } + }, + "side-channel-list": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", + "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4" + } + }, + "side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + } + }, + "side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + } + }, + "statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==" + }, + "streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" + }, + "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" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" + }, + "uid-safe": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", + "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", + "requires": { + "random-bytes": "~1.0.0" + } + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "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==" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..7d5efdc --- /dev/null +++ b/package.json @@ -0,0 +1,16 @@ +{ + "name": "mon-poulailler", + "version": "1.0.0", + "description": "Application web simple de gestion d'un poulailler", + "main": "server.js", + "scripts": { + "start": "node server.js", + "dev": "node server.js" + }, + "dependencies": { + "bcryptjs": "^2.4.3", + "express": "^4.21.2", + "express-session": "^1.18.1", + "multer": "^1.4.5-lts.1" + } +} diff --git a/public/animal.html b/public/animal.html new file mode 100644 index 0000000..895f80c --- /dev/null +++ b/public/animal.html @@ -0,0 +1,119 @@ + + + + + + Fiche animal — Mon Poulailler + + + +
+

Mon Poulailler

+ +

Connecté :

+
+ +
+

← Retour à la liste

+ +
+

Chargement…

+
+ + +
+ + +
+

Nouvelle période

+ + + + + + + + + + + + + +
+ + +
+
+
+ + +
+

Marquer comme décédé

+

L'animal passera dans les archives. Les périodes en cours seront clôturées.

+ + + + +
+ + +
+
+
+ + +
+

Modifier l'animal

+ + + + + + + + + + + + + + + + + + + + + + +
+ + +
+
+
+ + + + + diff --git a/public/archives.html b/public/archives.html new file mode 100644 index 0000000..0c7c07d --- /dev/null +++ b/public/archives.html @@ -0,0 +1,32 @@ + + + + + + Archives — Mon Poulailler + + + +
+

Mon Poulailler

+ +

Connecté :

+
+ +
+
+

Animaux décédés

+
+ +
+
+ + + + + diff --git a/public/comptes.html b/public/comptes.html new file mode 100644 index 0000000..770bb96 --- /dev/null +++ b/public/comptes.html @@ -0,0 +1,68 @@ + + + + + + Comptes — Mon Poulailler + + + +
+

Mon Poulailler

+ +

Connecté :

+
+ +
+
+
+

Comptes utilisateurs

+ +
+ + + + + + + + + +
LoginProfil
+
+
+ + +
+

Créer un compte

+ + + + + + + + + + + + +
+ + +
+
+
+ + + + + diff --git a/public/connexion.html b/public/connexion.html new file mode 100644 index 0000000..5f62811 --- /dev/null +++ b/public/connexion.html @@ -0,0 +1,30 @@ + + + + + + Connexion — Mon Poulailler + + + +
+

Mon Poulailler

+

Connexion

+ +
+ + + + + + + + + +
+
+ + + + + diff --git a/public/css/style.css b/public/css/style.css new file mode 100644 index 0000000..650bffc --- /dev/null +++ b/public/css/style.css @@ -0,0 +1,476 @@ +:root +{ + --vert: #3d6b4f; + --vert-fonce: #2a4a37; + --beige: #f7f3eb; + --creme: #fffdf8; + --texte: #2c2c2c; + --bordure: #d4cbb8; + --erreur: #a33; + --danger: #8b3a3a; +} + +* +{ + box-sizing: border-box; +} + +body +{ + margin: 0; + font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; + background: var(--beige); + color: var(--texte); + line-height: 1.5; +} + +a +{ + color: var(--vert); +} + +/* ----- Connexion ----- */ + +.page-connexion +{ + min-height: 100vh; + display: flex; + align-items: center; + justify-content: center; + background: + linear-gradient(160deg, #e8f0e4 0%, var(--beige) 50%, #efe6d4 100%); +} + +.boite-connexion +{ + background: var(--creme); + padding: 2rem; + border: 1px solid var(--bordure); + width: 100%; + max-width: 360px; +} + +.boite-connexion h1 +{ + margin: 0 0 0.25rem; + color: var(--vert-fonce); + text-align: center; +} + +.sous-titre +{ + text-align: center; + margin-top: 0; + color: #666; +} + +/* ----- En-tête ----- */ + +.entete +{ + background: var(--vert); + color: white; + padding: 1rem 1.5rem; + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 1rem; +} + +.entete h1 +{ + margin: 0; + font-size: 1.4rem; +} + +.entete h1 a +{ + color: white; + text-decoration: none; +} + +.entete nav +{ + display: flex; + flex-wrap: wrap; + gap: 0.75rem; + align-items: center; + flex: 1; +} + +.entete nav a +{ + color: #e8f0e4; + text-decoration: none; + padding: 0.25rem 0.5rem; +} + +.entete nav a.actif, +.entete nav a:hover +{ + text-decoration: underline; +} + +.info-session +{ + margin: 0; + font-size: 0.9rem; + opacity: 0.9; +} + +main +{ + max-width: 960px; + margin: 0 auto; + padding: 1.5rem; +} + +/* ----- Formulaires ----- */ + +label +{ + display: block; + margin-top: 0.75rem; + margin-bottom: 0.25rem; + font-weight: 600; +} + +input, +select, +textarea, +button +{ + font: inherit; +} + +input[type="text"], +input[type="password"], +input[type="date"], +input[type="file"], +select, +textarea +{ + width: 100%; + padding: 0.5rem; + border: 1px solid var(--bordure); + background: white; +} + +button +{ + margin-top: 1rem; + padding: 0.55rem 1rem; + background: var(--vert); + color: white; + border: none; + cursor: pointer; +} + +button:hover +{ + background: var(--vert-fonce); +} + +button.secondaire +{ + background: #888; +} + +button.secondaire:hover +{ + background: #666; +} + +button.danger +{ + background: var(--danger); +} + +.erreur +{ + color: var(--erreur); + margin-top: 0.75rem; +} + +/* ----- Stats ----- */ + +.statistiques +{ + background: var(--creme); + border: 1px solid var(--bordure); + padding: 1rem 1.25rem; + margin-bottom: 1.5rem; +} + +.statistiques h2 +{ + margin-top: 0; + font-size: 1.1rem; +} + +.liste-stats +{ + list-style: none; + padding: 0; + margin: 0; + display: flex; + flex-wrap: wrap; + gap: 1rem; +} + +.liste-stats li +{ + background: #eef5ee; + padding: 0.5rem 0.85rem; +} + +.liste-stats span +{ + font-weight: 700; + color: var(--vert-fonce); +} + +/* ----- Liste animaux ----- */ + +.titre-avec-action +{ + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + gap: 0.75rem; +} + +.titre-avec-action h2 +{ + margin: 0; +} + +.titre-avec-action button +{ + margin-top: 0; +} + +.grille-animaux +{ + display: grid; + grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); + gap: 1rem; + margin-top: 1rem; +} + +.carte-animal +{ + background: var(--creme); + border: 1px solid var(--bordure); + padding: 0.75rem; + text-decoration: none; + color: inherit; + display: block; +} + +.carte-animal:hover +{ + border-color: var(--vert); +} + +.carte-animal img +{ + width: 100%; + height: 140px; + object-fit: cover; + background: #ddd; + display: block; +} + +.carte-animal .sans-photo +{ + width: 100%; + height: 140px; + background: #ddd; + display: flex; + align-items: center; + justify-content: center; + color: #666; + font-size: 0.9rem; +} + +.carte-animal h3 +{ + margin: 0.5rem 0 0.25rem; + font-size: 1rem; + text-transform: capitalize; +} + +.carte-animal p +{ + margin: 0.15rem 0; + font-size: 0.9rem; +} + +.badge +{ + display: inline-block; + font-size: 0.75rem; + padding: 0.1rem 0.4rem; + background: #eef5ee; + margin-right: 0.25rem; +} + +.message-vide +{ + color: #666; + font-style: italic; +} + +/* ----- Fiche ----- */ + +.fiche +{ + background: var(--creme); + border: 1px solid var(--bordure); + padding: 1.25rem; + display: grid; + grid-template-columns: 200px 1fr; + gap: 1.25rem; +} + +.fiche img, +.fiche .sans-photo +{ + width: 200px; + height: 200px; + object-fit: cover; + background: #ddd; +} + +.fiche .sans-photo +{ + display: flex; + align-items: center; + justify-content: center; + color: #666; +} + +.fiche dl +{ + margin: 0; +} + +.fiche dt +{ + font-weight: 600; + margin-top: 0.5rem; +} + +.fiche dd +{ + margin: 0.15rem 0 0; +} + +.actions-fiche +{ + margin-top: 1rem; + display: flex; + flex-wrap: wrap; + gap: 0.5rem; +} + +.actions-fiche button +{ + margin-top: 0; +} + +.lien-retour +{ + text-decoration: none; +} + +#sectionPeriodes h2 +{ + margin-top: 2rem; +} + +.tableau-periodes +{ + width: 100%; + border-collapse: collapse; + margin: 0.75rem 0; + background: var(--creme); +} + +.tableau-periodes th, +.tableau-periodes td +{ + border: 1px solid var(--bordure); + padding: 0.5rem; + text-align: left; +} + +.tableau +{ + width: 100%; + border-collapse: collapse; + margin-top: 1rem; + background: var(--creme); +} + +.tableau th, +.tableau td +{ + border: 1px solid var(--bordure); + padding: 0.6rem; + text-align: left; +} + +/* ----- Dialogues ----- */ + +dialog +{ + border: 1px solid var(--bordure); + padding: 1.25rem; + max-width: 420px; + width: 90%; + background: var(--creme); +} + +dialog::backdrop +{ + background: rgba(0, 0, 0, 0.4); +} + +.actions-dialogue +{ + display: flex; + justify-content: flex-end; + gap: 0.5rem; + margin-top: 0.5rem; +} + +.actions-dialogue button +{ + margin-top: 0.5rem; +} + +/* ----- Responsive ----- */ + +@media (max-width: 640px) +{ + .fiche + { + grid-template-columns: 1fr; + } + + .fiche img, + .fiche .sans-photo + { + width: 100%; + height: 200px; + } + + .entete + { + flex-direction: column; + align-items: flex-start; + } +} diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..8a90ec2 --- /dev/null +++ b/public/index.html @@ -0,0 +1,87 @@ + + + + + + Mon Poulailler + + + +
+

Mon Poulailler

+ +

Connecté :

+
+ +
+
+

Statistiques

+
    +
  • 0 poules
  • +
  • 0 coqs
  • +
  • 0 actifs
  • +
  • 0 en ponte
  • +
  • 0 en couvage
  • +
+
+ +
+
+

Animaux actifs

+ +
+ +
+ +
+
+ + + +
+

Ajouter un animal

+ + + + + + + + + + + + + + + + + + + + + + +
+ + +
+
+
+ + + + + diff --git a/public/js/accueil.js b/public/js/accueil.js new file mode 100644 index 0000000..898eaf3 --- /dev/null +++ b/public/js/accueil.js @@ -0,0 +1,114 @@ +/** + * Page d'accueil : statistiques + liste des animaux actifs. + */ + +let utilisateurCourant = null; + +async function chargerStatistiques() +{ + const stats = await appelerApi("/api/statistiques"); + + if (!stats) + { + return; + } + + document.getElementById("statPoules").textContent = stats.nombrePoulesActives; + document.getElementById("statCoqs").textContent = stats.nombreCoqsActifs; + document.getElementById("statTotal").textContent = stats.nombreTotalActifs; + document.getElementById("statPonte").textContent = stats.nombreEnPonte; + document.getElementById("statCouvage").textContent = stats.nombreEnCouvage; +} + +async function chargerAnimaux() +{ + const animaux = await appelerApi("/api/animaux?actifs=oui"); + + if (!animaux) + { + return; + } + + const liste = document.getElementById("listeAnimaux"); + const messageVide = document.getElementById("messageVide"); + + if (animaux.length === 0) + { + liste.innerHTML = ""; + messageVide.hidden = false; + return; + } + + messageVide.hidden = true; + liste.innerHTML = animaux.map(htmlCarteAnimal).join(""); +} + +function ouvrirDialogueAjout() +{ + document.getElementById("titreDialogueAnimal").textContent = "Ajouter un animal"; + document.getElementById("animalId").value = ""; + document.getElementById("formAnimal").reset(); + document.getElementById("erreurAnimal").hidden = true; + document.getElementById("dialogueAnimal").showModal(); +} + +document.getElementById("boutonNouvelAnimal").addEventListener("click", ouvrirDialogueAjout); + +document.getElementById("annulerAnimal").addEventListener("click", function () +{ + document.getElementById("dialogueAnimal").close(); +}); + +document.getElementById("formAnimal").addEventListener("submit", async function (event) +{ + event.preventDefault(); + + const erreurAnimal = document.getElementById("erreurAnimal"); + erreurAnimal.hidden = true; + + const formData = new FormData(); + formData.append("type", document.getElementById("type").value); + formData.append("couleurBague", document.getElementById("couleurBague").value); + formData.append("numeroBague", document.getElementById("numeroBague").value); + formData.append("dateNaissance", document.getElementById("dateNaissance").value); + formData.append("etatSante", document.getElementById("etatSante").value); + + const photo = document.getElementById("photo").files[0]; + if (photo) + { + formData.append("photo", photo); + } + + try + { + await appelerApi("/api/animaux", { + method: "POST", + body: formData + }); + + document.getElementById("dialogueAnimal").close(); + await chargerAnimaux(); + await chargerStatistiques(); + } + catch (erreur) + { + erreurAnimal.textContent = erreur.message; + erreurAnimal.hidden = false; + } +}); + +async function demarrer() +{ + utilisateurCourant = await verifierSession(); + + if (!utilisateurCourant) + { + return; + } + + brancherDeconnexion(); + await chargerStatistiques(); + await chargerAnimaux(); +} + +demarrer(); diff --git a/public/js/archives.js b/public/js/archives.js new file mode 100644 index 0000000..bd450cd --- /dev/null +++ b/public/js/archives.js @@ -0,0 +1,41 @@ +/** + * Page archives : animaux décédés. + */ + +async function chargerArchives() +{ + const animaux = await appelerApi("/api/animaux?archives=oui"); + + if (!animaux) + { + return; + } + + const liste = document.getElementById("listeArchives"); + const messageVide = document.getElementById("messageVide"); + + if (animaux.length === 0) + { + liste.innerHTML = ""; + messageVide.hidden = false; + return; + } + + messageVide.hidden = true; + liste.innerHTML = animaux.map(htmlCarteAnimal).join(""); +} + +async function demarrer() +{ + const utilisateur = await verifierSession(); + + if (!utilisateur) + { + return; + } + + brancherDeconnexion(); + await chargerArchives(); +} + +demarrer(); diff --git a/public/js/commun.js b/public/js/commun.js new file mode 100644 index 0000000..206865b --- /dev/null +++ b/public/js/commun.js @@ -0,0 +1,133 @@ +/** + * Fonctions partagées entre les pages. + */ + +/** + * Appelle l'API et retourne la réponse JSON. + * Redirige vers la page de connexion si non authentifié (401). + */ +async function appelerApi(url, options) +{ + const reponse = await fetch(url, options); + const donnees = await reponse.json().catch(function () + { + return {}; + }); + + if (reponse.status === 401 && !url.includes("/api/connexion")) + { + window.location.href = "/connexion.html"; + return null; + } + + if (!reponse.ok) + { + throw new Error(donnees.erreur || "Erreur serveur"); + } + + return donnees; +} + +/** + * Vérifie la session. Redirige vers connexion si besoin. + * Affiche le nom et le lien Comptes pour l'admin. + */ +async function verifierSession() +{ + const session = await appelerApi("/api/session"); + + if (!session || !session.connecte) + { + window.location.href = "/connexion.html"; + return null; + } + + const nomUtilisateur = document.getElementById("nomUtilisateur"); + if (nomUtilisateur) + { + nomUtilisateur.textContent = session.utilisateur.login + " (" + session.utilisateur.profil + ")"; + } + + const lienComptes = document.getElementById("lienComptes"); + if (lienComptes && session.utilisateur.profil === "admin") + { + lienComptes.hidden = false; + } + + return session.utilisateur; +} + +/** + * Branche le bouton de déconnexion s'il est présent sur la page. + */ +function brancherDeconnexion() +{ + const bouton = document.getElementById("boutonDeconnexion"); + + if (!bouton) + { + return; + } + + bouton.addEventListener("click", async function () + { + await appelerApi("/api/deconnexion", { method: "POST" }); + window.location.href = "/connexion.html"; + }); +} + +/** + * Affiche une étiquette lisible pour le type d'animal. + */ +function libelleType(type) +{ + return type === "coq" ? "Coq" : "Poule"; +} + +/** + * Affiche une étiquette pour l'état de santé. + */ +function libelleSante(etat) +{ + if (etat === "moyen") + { + return "Moyen"; + } + + if (etat === "mauvais") + { + return "Mauvais"; + } + + return "Bon"; +} + +/** + * Construit le HTML d'une carte animal (liste). + */ +function htmlCarteAnimal(animal) +{ + let photoHtml = "
Pas de photo
"; + + if (animal.photo) + { + photoHtml = "\"Photo"; + } + + let badges = ""; + + if (animal.actif === false && animal.dateFinDeVie) + { + badges += "Décédé le " + animal.dateFinDeVie + ""; + } + + return ( + "" + + photoHtml + + "

" + libelleType(animal.type) + "

" + + "

Bague : " + (animal.couleurBague || "—") + " " + (animal.numeroBague || "") + "

" + + "

Santé : " + libelleSante(animal.etatSante) + "

" + + badges + + "
" + ); +} diff --git a/public/js/comptes.js b/public/js/comptes.js new file mode 100644 index 0000000..6137915 --- /dev/null +++ b/public/js/comptes.js @@ -0,0 +1,86 @@ +/** + * Page comptes (admin uniquement) : liste et création. + */ + +async function chargerComptes() +{ + const comptes = await appelerApi("/api/utilisateurs"); + + if (!comptes) + { + return; + } + + const tbody = document.getElementById("listeComptes"); + tbody.innerHTML = comptes.map(function (compte) + { + return ( + "" + + "" + compte.login + "" + + "" + compte.profil + "" + + "" + ); + }).join(""); +} + +document.getElementById("boutonNouveauCompte").addEventListener("click", function () +{ + document.getElementById("formCompte").reset(); + document.getElementById("erreurCompte").hidden = true; + document.getElementById("dialogueCompte").showModal(); +}); + +document.getElementById("annulerCompte").addEventListener("click", function () +{ + document.getElementById("dialogueCompte").close(); +}); + +document.getElementById("formCompte").addEventListener("submit", async function (event) +{ + event.preventDefault(); + + const erreurCompte = document.getElementById("erreurCompte"); + erreurCompte.hidden = true; + + try + { + await appelerApi("/api/utilisateurs", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ + login: document.getElementById("login").value.trim(), + motDePasse: document.getElementById("motDePasse").value, + profil: document.getElementById("profil").value + }) + }); + + document.getElementById("dialogueCompte").close(); + await chargerComptes(); + } + catch (erreur) + { + erreurCompte.textContent = erreur.message; + erreurCompte.hidden = false; + } +}); + +async function demarrer() +{ + const utilisateur = await verifierSession(); + + if (!utilisateur) + { + return; + } + + if (utilisateur.profil !== "admin") + { + window.location.href = "/"; + return; + } + + brancherDeconnexion(); + await chargerComptes(); +} + +demarrer(); diff --git a/public/js/connexion.js b/public/js/connexion.js new file mode 100644 index 0000000..add8c3c --- /dev/null +++ b/public/js/connexion.js @@ -0,0 +1,42 @@ +/** + * Page de connexion. + */ + +document.getElementById("formConnexion").addEventListener("submit", async function (event) +{ + event.preventDefault(); + + const messageErreur = document.getElementById("messageErreur"); + messageErreur.hidden = true; + + const login = document.getElementById("login").value.trim(); + const motDePasse = document.getElementById("motDePasse").value; + + try + { + await appelerApi("/api/connexion", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ + login: login, + motDePasse: motDePasse + }) + }); + + window.location.href = "/"; + } + catch (erreur) + { + messageErreur.textContent = erreur.message; + messageErreur.hidden = false; + } +}); + +/* Si déjà connecté, aller directement à l'accueil */ +appelerApi("/api/session").then(function (session) +{ + if (session && session.connecte) + { + window.location.href = "/"; + } +}); diff --git a/public/js/fiche.js b/public/js/fiche.js new file mode 100644 index 0000000..e802067 --- /dev/null +++ b/public/js/fiche.js @@ -0,0 +1,319 @@ +/** + * Page fiche animal : détail, modification, périodes, décès. + */ + +let animalCourant = null; +let periodesPonte = []; +let periodesCouvage = []; + +function recupererIdDepuisUrl() +{ + const parametres = new URLSearchParams(window.location.search); + return parametres.get("id"); +} + +function afficherFiche() +{ + const animal = animalCourant; + let photoHtml = "
Pas de photo
"; + + if (animal.photo) + { + photoHtml = "\"Photo\""; + } + + let actions = ""; + + if (animal.actif) + { + actions = + "
" + + "" + + "" + + "
"; + } + + const dateFin = animal.dateFinDeVie + ? "
Date de fin de vie
" + animal.dateFinDeVie + "
" + : ""; + + document.getElementById("ficheAnimal").innerHTML = + photoHtml + + "
" + + "

" + libelleType(animal.type) + "

" + + "
" + + "
Couleur de bague
" + (animal.couleurBague || "—") + "
" + + "
Numéro de bague
" + (animal.numeroBague || "—") + "
" + + "
Date de naissance
" + (animal.dateNaissance || "—") + "
" + + "
État de santé
" + libelleSante(animal.etatSante) + "
" + + "
Statut
" + (animal.actif ? "Actif" : "Archivé") + "
" + + dateFin + + "
" + + actions + + "
"; + + if (animal.actif) + { + document.getElementById("boutonModifier").addEventListener("click", ouvrirModification); + document.getElementById("boutonDeces").addEventListener("click", ouvrirDeces); + } + + /* Ponte et couvage : poules uniquement */ + const sectionPeriodes = document.getElementById("sectionPeriodes"); + + if (animal.type === "poule") + { + sectionPeriodes.hidden = false; + afficherPeriodes(); + } + else + { + sectionPeriodes.hidden = true; + } +} + +function htmlTableauPeriodes(periodes, typePeriode) +{ + if (periodes.length === 0) + { + return "

Aucune période enregistrée.

"; + } + + let lignes = periodes.map(function (periode) + { + const enCours = !periode.dateFin; + const statut = enCours ? "En cours" : ""; + let boutonCloture = ""; + + if (enCours && animalCourant.actif) + { + boutonCloture = + ""; + } + + return ( + "" + + "" + periode.dateDebut + "" + + "" + (periode.dateFin || "—") + " " + statut + "" + + "" + (periode.remarque || "—") + "" + + "" + boutonCloture + "" + + "" + ); + }).join(""); + + return ( + "" + + "" + + "" + lignes + "" + + "
DébutFinRemarque
" + ); +} + +function afficherPeriodes() +{ + document.getElementById("listePonte").innerHTML = htmlTableauPeriodes(periodesPonte, "ponte"); + document.getElementById("listeCouvage").innerHTML = htmlTableauPeriodes(periodesCouvage, "couvage"); + + document.querySelectorAll("[data-cloturer]").forEach(function (bouton) + { + bouton.addEventListener("click", async function () + { + const type = bouton.getAttribute("data-cloturer"); + const id = bouton.getAttribute("data-id"); + const aujourdHui = new Date().toISOString().slice(0, 10); + const url = type === "ponte" + ? "/api/periodes-ponte/" + id + : "/api/periodes-couvage/" + id; + + await appelerApi(url, { + method: "PUT", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ dateFin: aujourdHui }) + }); + + await chargerFiche(); + }); + }); +} + +function ouvrirModification() +{ + document.getElementById("animalId").value = animalCourant.id; + document.getElementById("type").value = animalCourant.type; + document.getElementById("couleurBague").value = animalCourant.couleurBague || ""; + document.getElementById("numeroBague").value = animalCourant.numeroBague || ""; + document.getElementById("dateNaissance").value = animalCourant.dateNaissance || ""; + document.getElementById("etatSante").value = animalCourant.etatSante || "bon"; + document.getElementById("photo").value = ""; + document.getElementById("erreurAnimal").hidden = true; + document.getElementById("dialogueAnimal").showModal(); +} + +function ouvrirDeces() +{ + document.getElementById("dateFinDeVie").value = new Date().toISOString().slice(0, 10); + document.getElementById("dialogueDeces").showModal(); +} + +function ouvrirPeriode(type) +{ + document.getElementById("typePeriode").value = type; + document.getElementById("titrePeriode").textContent = + type === "ponte" ? "Nouvelle période de ponte" : "Nouvelle période de couvage"; + document.getElementById("formPeriode").reset(); + document.getElementById("typePeriode").value = type; + document.getElementById("dateDebut").value = new Date().toISOString().slice(0, 10); + document.getElementById("erreurPeriode").hidden = true; + document.getElementById("dialoguePeriode").showModal(); +} + +async function chargerFiche() +{ + const id = recupererIdDepuisUrl(); + + if (!id) + { + window.location.href = "/"; + return; + } + + const donnees = await appelerApi("/api/animaux/" + id); + + if (!donnees) + { + return; + } + + animalCourant = donnees.animal; + periodesPonte = donnees.periodesPonte; + periodesCouvage = donnees.periodesCouvage; + afficherFiche(); +} + +document.getElementById("annulerAnimal").addEventListener("click", function () +{ + document.getElementById("dialogueAnimal").close(); +}); + +document.getElementById("annulerDeces").addEventListener("click", function () +{ + document.getElementById("dialogueDeces").close(); +}); + +document.getElementById("annulerPeriode").addEventListener("click", function () +{ + document.getElementById("dialoguePeriode").close(); +}); + +document.getElementById("boutonAjouterPonte").addEventListener("click", function () +{ + ouvrirPeriode("ponte"); +}); + +document.getElementById("boutonAjouterCouvage").addEventListener("click", function () +{ + ouvrirPeriode("couvage"); +}); + +document.getElementById("formAnimal").addEventListener("submit", async function (event) +{ + event.preventDefault(); + + const erreurAnimal = document.getElementById("erreurAnimal"); + erreurAnimal.hidden = true; + + const formData = new FormData(); + formData.append("type", document.getElementById("type").value); + formData.append("couleurBague", document.getElementById("couleurBague").value); + formData.append("numeroBague", document.getElementById("numeroBague").value); + formData.append("dateNaissance", document.getElementById("dateNaissance").value); + formData.append("etatSante", document.getElementById("etatSante").value); + + const photo = document.getElementById("photo").files[0]; + if (photo) + { + formData.append("photo", photo); + } + + try + { + await appelerApi("/api/animaux/" + animalCourant.id, { + method: "PUT", + body: formData + }); + + document.getElementById("dialogueAnimal").close(); + await chargerFiche(); + } + catch (erreur) + { + erreurAnimal.textContent = erreur.message; + erreurAnimal.hidden = false; + } +}); + +document.getElementById("formDeces").addEventListener("submit", async function (event) +{ + event.preventDefault(); + + await appelerApi("/api/animaux/" + animalCourant.id + "/deces", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ + dateFinDeVie: document.getElementById("dateFinDeVie").value + }) + }); + + document.getElementById("dialogueDeces").close(); + window.location.href = "/archives.html"; +}); + +document.getElementById("formPeriode").addEventListener("submit", async function (event) +{ + event.preventDefault(); + + const erreurPeriode = document.getElementById("erreurPeriode"); + erreurPeriode.hidden = true; + + const type = document.getElementById("typePeriode").value; + const url = type === "ponte" ? "/api/periodes-ponte" : "/api/periodes-couvage"; + const dateFin = document.getElementById("dateFin").value || null; + + try + { + await appelerApi(url, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ + idAnimal: animalCourant.id, + dateDebut: document.getElementById("dateDebut").value, + dateFin: dateFin, + remarque: document.getElementById("remarque").value + }) + }); + + document.getElementById("dialoguePeriode").close(); + await chargerFiche(); + } + catch (erreur) + { + erreurPeriode.textContent = erreur.message; + erreurPeriode.hidden = false; + } +}); + +async function demarrer() +{ + const utilisateur = await verifierSession(); + + if (!utilisateur) + { + return; + } + + brancherDeconnexion(); + await chargerFiche(); +} + +demarrer(); diff --git a/server.js b/server.js new file mode 100644 index 0000000..67c4b31 --- /dev/null +++ b/server.js @@ -0,0 +1,583 @@ +const path = require("path"); +const express = require("express"); +const session = require("express-session"); +const bcrypt = require("bcryptjs"); +const multer = require("multer"); +const { lireJson, ecrireJson, genererId } = require("./lib/donnees"); + +const app = express(); +const port = process.env.PORT || 3000; + +/* ---------- Configuration ---------- */ + +app.use(express.json()); +app.use(express.urlencoded({ extended: true })); +app.use(express.static(path.join(__dirname, "public"))); +app.use("/uploads", express.static(path.join(__dirname, "uploads"))); + +app.use(session({ + secret: "mon-poulailler-secret-local", + resave: false, + saveUninitialized: false, + cookie: { maxAge: 24 * 60 * 60 * 1000 } +})); + +/* Stockage des photos uploadées */ +const stockage = multer.diskStorage({ + destination: function (req, file, callback) + { + callback(null, path.join(__dirname, "uploads")); + }, + filename: function (req, file, callback) + { + const extension = path.extname(file.originalname); + callback(null, genererId() + extension); + } +}); + +const upload = multer({ + storage: stockage, + limits: { fileSize: 5 * 1024 * 1024 }, + fileFilter: function (req, file, callback) + { + if (file.mimetype.startsWith("image/")) + { + callback(null, true); + } + else + { + callback(new Error("Seules les images sont acceptées")); + } + } +}); + +/* ---------- Middlewares d'accès ---------- */ + +function exigerConnexion(req, res, next) +{ + if (!req.session.utilisateur) + { + return res.status(401).json({ erreur: "Vous devez être connecté" }); + } + + next(); +} + +function exigerAdmin(req, res, next) +{ + if (!req.session.utilisateur || req.session.utilisateur.profil !== "admin") + { + return res.status(403).json({ erreur: "Réservé à l'administrateur" }); + } + + next(); +} + +/* ---------- Authentification ---------- */ + +app.get("/api/session", function (req, res) +{ + if (req.session.utilisateur) + { + return res.json({ connecte: true, utilisateur: req.session.utilisateur }); + } + + res.json({ connecte: false }); +}); + +app.post("/api/connexion", function (req, res) +{ + const login = req.body.login; + const motDePasse = req.body.motDePasse; + const utilisateurs = lireJson("utilisateurs.json", []); + + const utilisateur = utilisateurs.find(function (u) + { + return u.login === login; + }); + + if (!utilisateur) + { + return res.status(401).json({ erreur: "Identifiant ou mot de passe incorrect" }); + } + + const motDePasseOk = bcrypt.compareSync(motDePasse, utilisateur.motDePasseHash); + + if (!motDePasseOk) + { + return res.status(401).json({ erreur: "Identifiant ou mot de passe incorrect" }); + } + + req.session.utilisateur = { + id: utilisateur.id, + login: utilisateur.login, + profil: utilisateur.profil + }; + + res.json({ message: "Connexion réussie", utilisateur: req.session.utilisateur }); +}); + +app.post("/api/deconnexion", function (req, res) +{ + req.session.destroy(function () + { + res.json({ message: "Déconnexion réussie" }); + }); +}); + +app.post("/api/utilisateurs", exigerConnexion, exigerAdmin, function (req, res) +{ + const login = req.body.login; + const motDePasse = req.body.motDePasse; + const profil = req.body.profil || "utilisateur"; + + if (!login || !motDePasse) + { + return res.status(400).json({ erreur: "Login et mot de passe obligatoires" }); + } + + if (profil !== "admin" && profil !== "utilisateur") + { + return res.status(400).json({ erreur: "Profil invalide" }); + } + + const utilisateurs = lireJson("utilisateurs.json", []); + const existeDeja = utilisateurs.some(function (u) + { + return u.login === login; + }); + + if (existeDeja) + { + return res.status(400).json({ erreur: "Ce login existe déjà" }); + } + + const nouvelUtilisateur = { + id: genererId(), + login: login, + motDePasseHash: bcrypt.hashSync(motDePasse, 10), + profil: profil + }; + + utilisateurs.push(nouvelUtilisateur); + ecrireJson("utilisateurs.json", utilisateurs); + + res.status(201).json({ + message: "Compte créé", + utilisateur: { + id: nouvelUtilisateur.id, + login: nouvelUtilisateur.login, + profil: nouvelUtilisateur.profil + } + }); +}); + +app.get("/api/utilisateurs", exigerConnexion, exigerAdmin, function (req, res) +{ + const utilisateurs = lireJson("utilisateurs.json", []); + const liste = utilisateurs.map(function (u) + { + return { id: u.id, login: u.login, profil: u.profil }; + }); + + res.json(liste); +}); + +/* ---------- Animaux ---------- */ + +app.get("/api/animaux", exigerConnexion, function (req, res) +{ + const actifsSeulement = req.query.actifs === "oui"; + const archivesSeulement = req.query.archives === "oui"; + let animaux = lireJson("animaux.json", []); + + if (actifsSeulement) + { + animaux = animaux.filter(function (a) + { + return a.actif === true; + }); + } + + if (archivesSeulement) + { + animaux = animaux.filter(function (a) + { + return a.actif === false; + }); + } + + res.json(animaux); +}); + +app.get("/api/animaux/:id", exigerConnexion, function (req, res) +{ + const animaux = lireJson("animaux.json", []); + const animal = animaux.find(function (a) + { + return a.id === req.params.id; + }); + + if (!animal) + { + return res.status(404).json({ erreur: "Animal introuvable" }); + } + + const periodesPonte = lireJson("periodesPonte.json", []).filter(function (p) + { + return p.idAnimal === animal.id; + }); + + const periodesCouvage = lireJson("periodesCouvage.json", []).filter(function (p) + { + return p.idAnimal === animal.id; + }); + + res.json({ + animal: animal, + periodesPonte: periodesPonte, + periodesCouvage: periodesCouvage + }); +}); + +app.post("/api/animaux", exigerConnexion, upload.single("photo"), function (req, res) +{ + const type = req.body.type; + const couleurBague = req.body.couleurBague || ""; + const numeroBague = req.body.numeroBague || ""; + const dateNaissance = req.body.dateNaissance || ""; + const etatSante = req.body.etatSante || "bon"; + + if (type !== "poule" && type !== "coq") + { + return res.status(400).json({ erreur: "Le type doit être poule ou coq" }); + } + + const animaux = lireJson("animaux.json", []); + + const nouvelAnimal = { + id: genererId(), + type: type, + photo: req.file ? "/uploads/" + req.file.filename : "", + couleurBague: couleurBague, + numeroBague: numeroBague, + dateNaissance: dateNaissance, + etatSante: etatSante, + dateFinDeVie: null, + actif: true + }; + + animaux.push(nouvelAnimal); + ecrireJson("animaux.json", animaux); + + res.status(201).json(nouvelAnimal); +}); + +app.put("/api/animaux/:id", exigerConnexion, upload.single("photo"), function (req, res) +{ + const animaux = lireJson("animaux.json", []); + const index = animaux.findIndex(function (a) + { + return a.id === req.params.id; + }); + + if (index === -1) + { + return res.status(404).json({ erreur: "Animal introuvable" }); + } + + const animal = animaux[index]; + + if (req.body.type === "poule" || req.body.type === "coq") + { + animal.type = req.body.type; + } + + if (req.body.couleurBague !== undefined) + { + animal.couleurBague = req.body.couleurBague; + } + + if (req.body.numeroBague !== undefined) + { + animal.numeroBague = req.body.numeroBague; + } + + if (req.body.dateNaissance !== undefined) + { + animal.dateNaissance = req.body.dateNaissance; + } + + if (req.body.etatSante !== undefined) + { + animal.etatSante = req.body.etatSante; + } + + if (req.file) + { + animal.photo = "/uploads/" + req.file.filename; + } + + animaux[index] = animal; + ecrireJson("animaux.json", animaux); + + res.json(animal); +}); + +app.post("/api/animaux/:id/deces", exigerConnexion, function (req, res) +{ + const animaux = lireJson("animaux.json", []); + const index = animaux.findIndex(function (a) + { + return a.id === req.params.id; + }); + + if (index === -1) + { + return res.status(404).json({ erreur: "Animal introuvable" }); + } + + const animal = animaux[index]; + animal.actif = false; + animal.dateFinDeVie = req.body.dateFinDeVie || new Date().toISOString().slice(0, 10); + + /* Clôturer les périodes en cours */ + const periodesPonte = lireJson("periodesPonte.json", []); + periodesPonte.forEach(function (periode) + { + if (periode.idAnimal === animal.id && !periode.dateFin) + { + periode.dateFin = animal.dateFinDeVie; + } + }); + ecrireJson("periodesPonte.json", periodesPonte); + + const periodesCouvage = lireJson("periodesCouvage.json", []); + periodesCouvage.forEach(function (periode) + { + if (periode.idAnimal === animal.id && !periode.dateFin) + { + periode.dateFin = animal.dateFinDeVie; + } + }); + ecrireJson("periodesCouvage.json", periodesCouvage); + + animaux[index] = animal; + ecrireJson("animaux.json", animaux); + + res.json(animal); +}); + +/* ---------- Périodes de ponte ---------- */ + +app.post("/api/periodes-ponte", exigerConnexion, function (req, res) +{ + const idAnimal = req.body.idAnimal; + const dateDebut = req.body.dateDebut; + const dateFin = req.body.dateFin || null; + const remarque = req.body.remarque || ""; + + if (!idAnimal || !dateDebut) + { + return res.status(400).json({ erreur: "idAnimal et dateDebut sont obligatoires" }); + } + + const animaux = lireJson("animaux.json", []); + const animal = animaux.find(function (a) + { + return a.id === idAnimal; + }); + + if (!animal) + { + return res.status(404).json({ erreur: "Animal introuvable" }); + } + + if (animal.type !== "poule") + { + return res.status(400).json({ erreur: "La ponte concerne uniquement les poules" }); + } + + const periodes = lireJson("periodesPonte.json", []); + const nouvellePeriode = { + id: genererId(), + idAnimal: idAnimal, + dateDebut: dateDebut, + dateFin: dateFin, + remarque: remarque + }; + + periodes.push(nouvellePeriode); + ecrireJson("periodesPonte.json", periodes); + + res.status(201).json(nouvellePeriode); +}); + +app.put("/api/periodes-ponte/:id", exigerConnexion, function (req, res) +{ + const periodes = lireJson("periodesPonte.json", []); + const index = periodes.findIndex(function (p) + { + return p.id === req.params.id; + }); + + if (index === -1) + { + return res.status(404).json({ erreur: "Période introuvable" }); + } + + if (req.body.dateDebut !== undefined) + { + periodes[index].dateDebut = req.body.dateDebut; + } + + if (req.body.dateFin !== undefined) + { + periodes[index].dateFin = req.body.dateFin || null; + } + + if (req.body.remarque !== undefined) + { + periodes[index].remarque = req.body.remarque; + } + + ecrireJson("periodesPonte.json", periodes); + res.json(periodes[index]); +}); + +/* ---------- Périodes de couvage ---------- */ + +app.post("/api/periodes-couvage", exigerConnexion, function (req, res) +{ + const idAnimal = req.body.idAnimal; + const dateDebut = req.body.dateDebut; + const dateFin = req.body.dateFin || null; + const remarque = req.body.remarque || ""; + + if (!idAnimal || !dateDebut) + { + return res.status(400).json({ erreur: "idAnimal et dateDebut sont obligatoires" }); + } + + const animaux = lireJson("animaux.json", []); + const animal = animaux.find(function (a) + { + return a.id === idAnimal; + }); + + if (!animal) + { + return res.status(404).json({ erreur: "Animal introuvable" }); + } + + if (animal.type !== "poule") + { + return res.status(400).json({ erreur: "Le couvage concerne uniquement les poules" }); + } + + const periodes = lireJson("periodesCouvage.json", []); + const nouvellePeriode = { + id: genererId(), + idAnimal: idAnimal, + dateDebut: dateDebut, + dateFin: dateFin, + remarque: remarque + }; + + periodes.push(nouvellePeriode); + ecrireJson("periodesCouvage.json", periodes); + + res.status(201).json(nouvellePeriode); +}); + +app.put("/api/periodes-couvage/:id", exigerConnexion, function (req, res) +{ + const periodes = lireJson("periodesCouvage.json", []); + const index = periodes.findIndex(function (p) + { + return p.id === req.params.id; + }); + + if (index === -1) + { + return res.status(404).json({ erreur: "Période introuvable" }); + } + + if (req.body.dateDebut !== undefined) + { + periodes[index].dateDebut = req.body.dateDebut; + } + + if (req.body.dateFin !== undefined) + { + periodes[index].dateFin = req.body.dateFin || null; + } + + if (req.body.remarque !== undefined) + { + periodes[index].remarque = req.body.remarque; + } + + ecrireJson("periodesCouvage.json", periodes); + res.json(periodes[index]); +}); + +/* ---------- Statistiques ---------- */ + +app.get("/api/statistiques", exigerConnexion, function (req, res) +{ + const animaux = lireJson("animaux.json", []); + const actifs = animaux.filter(function (a) + { + return a.actif === true; + }); + + const poulesActives = actifs.filter(function (a) + { + return a.type === "poule"; + }); + + const coqsActifs = actifs.filter(function (a) + { + return a.type === "coq"; + }); + + const periodesPonte = lireJson("periodesPonte.json", []); + const periodesCouvage = lireJson("periodesCouvage.json", []); + + const idsPoules = poulesActives.map(function (p) + { + return p.id; + }); + + const enPonte = idsPoules.filter(function (id) + { + return periodesPonte.some(function (periode) + { + return periode.idAnimal === id && !periode.dateFin; + }); + }); + + const enCouvage = idsPoules.filter(function (id) + { + return periodesCouvage.some(function (periode) + { + return periode.idAnimal === id && !periode.dateFin; + }); + }); + + res.json({ + nombrePoulesActives: poulesActives.length, + nombreCoqsActifs: coqsActifs.length, + nombreTotalActifs: actifs.length, + nombreEnCouvage: enCouvage.length, + nombreEnPonte: enPonte.length + }); +}); + +/* ---------- Démarrage ---------- */ + +app.listen(port, function () +{ + console.log("Mon Poulailler écoute sur http://localhost:" + port); +}); diff --git a/uploads/.gitkeep b/uploads/.gitkeep new file mode 100644 index 0000000..e69de29