formation преди 2 години
родител
ревизия
9f81a9b948
променени са 29 файла, в които са добавени 13253 реда и са изтрити 11827 реда
  1. 17 36
      Jenkinsfile
  2. 4 55
      angular-client/angular.json
  3. 11761 9299
      angular-client/package-lock.json
  4. 14 18
      angular-client/package.json
  5. 0 60
      angular-client/server.ts
  6. 1 1
      angular-client/src/app/components/auth/gain/gain-list/gain-list.component.html
  7. 6 3
      angular-client/src/app/components/auth/gain/gain-list/gain-list.component.ts
  8. 9 1
      angular-client/src/app/components/auth/gain/gain.component.ts
  9. 2 2
      angular-client/src/app/components/register/register.component.html
  10. 20 6
      angular-client/src/app/components/register/register.component.ts
  11. 1 0
      angular-client/src/app/models/token.ts
  12. 22 24
      angular-client/src/app/services/auth.service.ts
  13. 0 3
      angular-client/tsconfig.json
  14. 0 17
      angular-client/tsconfig.server.json
  15. 1 1
      express-server/controllers/gain.js
  16. 9 3
      express-server/index.js
  17. 8 0
      express-server/node_modules/body-parser/HISTORY.md
  18. 11 10
      express-server/node_modules/body-parser/README.md
  19. 15 4
      express-server/node_modules/body-parser/lib/types/json.js
  20. 18 60
      express-server/node_modules/body-parser/package.json
  21. 5 0
      express-server/node_modules/content-type/HISTORY.md
  22. 21 19
      express-server/node_modules/content-type/README.md
  23. 12 9
      express-server/node_modules/content-type/index.js
  24. 27 61
      express-server/node_modules/content-type/package.json
  25. 0 742
      express-server/node_modules/source-map/README.md
  26. 0 212
      express-server/node_modules/source-map/package.json
  27. 1262 1174
      express-server/package-lock.json
  28. 3 3
      express-server/package.json
  29. 4 4
      express-server/routes/google.js

+ 17 - 36
Jenkinsfile

@@ -45,40 +45,22 @@ node{
     stage('stage 2bis'){
         sh 'ls -ls'
     }
-    stage('Test') 
-    {
-        
-       dir("${env.WORKSPACE}/angular-client")
-       {
-            // sh 'npm i @angular-devkit/build-angular'
-          		
-			// try
-			// {
-			// 	sh 'npm run test-ci'
-			// } 
-			// catch(err) 
-			// {
-			// 	sh 'echo TEST FAILED'
-			// 	junit 'target/surefire-reports/TESTS-TestSuite.xml/*.xml'
-			// 	throw err
-			// }
-            
-             def karma = docker.image('trion/ng-cli-karma')
+   stage('Test') {
+    steps {
+        dir("${env.WORKSPACE}/angular-client") {
+            def karma = docker.image('trion/ng-cli-karma')
             karma.pull()
 
-             try 
-             {
-               karma.run(' -u $(id -u) -v ${WORKSPACE}:/app trion/ng-cli-karma ')
-                karma.inside 
-               {
+            try {
+                karma.run('-u $(id -u) -v ${WORKSPACE}:/app trion/ng-cli-karma') {
                     sh 'npm install --force'
-                
-                    try 
-                    {
+
+                    // Ajouter la configuration spécifique pour le fournisseur d'OpenSSL
+                    sh 'export NODE_OPTIONS=--openssl-legacy-provider'
+
+                    try {
                         sh 'ng test'
-                    }
-                    catch(err) 
-                    {
+                    } catch (err) {
                         sh 'echo TEST FAILED'
                         step([$class: 'JUnitResultArchiver', testResults: 'target/surefire-reports/TESTS-TestSuite.xml/*.xml', healthScaleFactor: 1.0])
                         throw err
@@ -86,14 +68,13 @@ node{
                     sh 'echo DO SOMETHING ELSE AFTER TEST'
                 }
                 sh 'ls -al '
-            } 
-            catch(err) 
-            {
-            sh 'echo RUN DOCKER FAILED'
-            throw err
+            } catch (err) {
+                sh 'echo RUN DOCKER FAILED'
+                throw err
             }
-       }
+        }
     }
+}
 
 
     // def imageApache = stage("Build apache preprod")

+ 4 - 55
angular-client/angular.json

@@ -17,11 +17,12 @@
         "build": {
           "builder": "@angular-devkit/build-angular:browser",
           "options": {
-            "outputPath": "dist/fatboar/browser",
+            "outputPath": "dist/fatboar",
             "index": "src/index.html",
             "main": "src/main.ts",
             "polyfills": "src/polyfills.ts",
             "tsConfig": "tsconfig.app.json",
+            "aot": true,
             "assets": [
               "src/favicon.ico",
               "src/assets"
@@ -31,13 +32,7 @@
               "src/styles.scss",
               "./node_modules/leaflet/dist/leaflet.css"
             ],
-            "scripts": [],
-            "vendorChunk": true,
-            "extractLicenses": false,
-            "buildOptimizer": false,
-            "sourceMap": true,
-            "optimization": false,
-            "namedChunks": true
+            "scripts": []
           },
           "configurations": {
             "production": {
@@ -50,6 +45,7 @@
               "optimization": true,
               "outputHashing": "all",
               "sourceMap": false,
+              "extractCss": true,
               "namedChunks": false,
               "extractLicenses": true,
               "vendorChunk": false,
@@ -128,53 +124,6 @@
               "devServerTarget": "fatboar:serve:production"
             }
           }
-        },
-        "server": {
-          "builder": "@angular-devkit/build-angular:server",
-          "options": {
-            "outputPath": "dist/fatboar/server",
-            "main": "server.ts",
-            "tsConfig": "tsconfig.server.json"
-          },
-          "configurations": {
-            "production": {
-              "outputHashing": "media",
-              "fileReplacements": [
-                {
-                  "replace": "src/environments/environment.ts",
-                  "with": "src/environments/environment.prod.ts"
-                }
-              ],
-              "sourceMap": false,
-              "optimization": true
-            }
-          }
-        },
-        "serve-ssr": {
-          "builder": "@nguniversal/builders:ssr-dev-server",
-          "options": {
-            "browserTarget": "fatboar:build",
-            "serverTarget": "fatboar:server"
-          },
-          "configurations": {
-            "production": {
-              "browserTarget": "fatboar:build:production",
-              "serverTarget": "fatboar:server:production"
-            }
-          }
-        },
-        "prerender": {
-          "builder": "@nguniversal/builders:prerender",
-          "options": {
-            "browserTarget": "fatboar:build:production",
-            "serverTarget": "fatboar:server:production",
-            "routes": [
-              "/"
-            ]
-          },
-          "configurations": {
-            "production": {}
-          }
         }
       }
     }

Файловите разлики са ограничени, защото са твърде много
+ 11761 - 9299
angular-client/package-lock.json


+ 14 - 18
angular-client/package.json

@@ -8,25 +8,21 @@
     "test": "ng test",
     "lint": "ng lint",
     "e2e": "ng e2e",
-    "test-ci": "ng test --karma-config=karma-ci.conf.js --no-progress",
-    "dev:ssr": "ng run fatboar:serve-ssr",
-    "serve:ssr": "node dist/fatboar/server/main.js",
-    "build:ssr": "ng build --prod && ng run fatboar:server:production",
-    "prerender": "ng run fatboar:prerender"
+    "test-ci": "ng test --karma-config=karma-ci.conf.js --no-progress"
   },
   "private": true,
   "dependencies": {
-    "@angular/animations": "~9.1.4",
+    "@angular/animations": "^9.1.4",
     "@angular/cdk": "^9.2.2",
-    "@angular/common": "~9.1.4",
+    "@angular/common": "^9.1.4",
     "@angular/compiler": "~9.1.4",
-    "@angular/core": "~9.1.4",
+    "@angular/core": "^9.1.4",
     "@angular/flex-layout": "^9.0.0-beta.29",
-    "@angular/forms": "~9.1.4",
+    "@angular/forms": "^9.1.4",
     "@angular/material": "^9.2.2",
-    "@angular/platform-browser": "~9.1.4",
-    "@angular/platform-browser-dynamic": "~9.1.4",
-    "@angular/router": "~9.1.4",
+    "@angular/platform-browser": "^9.1.4",
+    "@angular/platform-browser-dynamic": "^9.1.4",
+    "@angular/router": "^9.1.4",
     "@types/jwt-decode": "^2.2.1",
     "@types/leaflet": "^1.5.12",
     "bootstrap": "^4.4.1",
@@ -44,18 +40,18 @@
     "zone.js": "~0.10.2"
   },
   "devDependencies": {
-    "@angular-devkit/build-angular": "~0.901.4",
-    "@angular/cli": "~9.1.4",
+    "@angular-devkit/build-angular": "^0.900.7",
+    "@angular/cli": "^9.1.4",
     "@angular/compiler-cli": "~9.1.4",
     "@angular/language-service": "~9.1.4",
     "@types/jasmine": "~3.5.0",
     "@types/jasminewd2": "~2.0.3",
     "@types/node": "^12.11.1",
     "chai": "^4.2.0",
-    "codelyzer": "^5.1.2",
+    "codelyzer": "^0.0.28",
     "jasmine-core": "~3.5.0",
     "jasmine-spec-reporter": "~4.2.1",
-    "karma": "^5.1.1",
+    "karma": "^6.4.1",
     "karma-chai": "^0.1.0",
     "karma-chrome-launcher": "^3.1.0",
     "karma-coverage-istanbul-reporter": "~2.1.0",
@@ -63,11 +59,11 @@
     "karma-jasmine-html-reporter": "^1.4.2",
     "karma-junit-reporter": "^2.0.1",
     "karma-mocha": "^2.0.1",
-    "mocha": "^8.1.1",
+    "mocha": "^10.2.0",
     "protractor": "~5.4.3",
     "puppeteer": "^5.2.1",
     "ts-node": "~8.3.0",
     "tslint": "~6.1.0",
     "typescript": "~3.8.3"
   }
-}
+}

+ 0 - 60
angular-client/server.ts

@@ -1,60 +0,0 @@
-import 'zone.js/dist/zone-node';
-
-import { ngExpressEngine } from '@nguniversal/express-engine';
-import * as express from 'express';
-import { join } from 'path';
-
-import { AppServerModule } from './src/main.server';
-import { APP_BASE_HREF } from '@angular/common';
-import { existsSync } from 'fs';
-
-// The Express app is exported so that it can be used by serverless Functions.
-export function app() {
-  const server = express();
-  const distFolder = join(process.cwd(), 'dist/fatboar/browser');
-  const indexHtml = existsSync(join(distFolder, 'index.original.html')) ? 'index.original.html' : 'index';
-
-  // Our Universal express-engine (found @ https://github.com/angular/universal/tree/master/modules/express-engine)
-  server.engine('html', ngExpressEngine({
-    bootstrap: AppServerModule,
-  }));
-
-  server.set('view engine', 'html');
-  server.set('views', distFolder);
-
-  // Example Express Rest API endpoints
-  // server.get('/api/**', (req, res) => { });
-  // Serve static files from /browser
-  server.get('*.*', express.static(distFolder, {
-    maxAge: '1y'
-  }));
-
-  // All regular routes use the Universal engine
-  server.get('*', (req, res) => {
-    res.render(indexHtml, { req, providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }] });
-  });
-
-  return server;
-}
-
-function run() {
-  const port = process.env.PORT || 4000;
-
-  // Start up the Node server
-  const server = app();
-  server.listen(port, () => {
-    console.log(`Node Express server listening on http://localhost:${port}`);
-  });
-}
-
-// Webpack will replace 'require' with '__webpack_require__'
-// '__non_webpack_require__' is a proxy to Node 'require'
-// The below code is to ensure that the server is run only when not requiring the bundle.
-declare const __non_webpack_require__: NodeRequire;
-const mainModule = __non_webpack_require__.main;
-const moduleFilename = mainModule && mainModule.filename || '';
-if (moduleFilename === __filename || moduleFilename.includes('iisnode')) {
-  run();
-}
-
-export * from './src/main.server';

+ 1 - 1
angular-client/src/app/components/auth/gain/gain-list/gain-list.component.html

@@ -1,5 +1,5 @@
  <!-- table of users -->
-{{lots.code}}
+
     <table *ngIf="lots" mat-table  [dataSource]="lots" class="tablegain">
 
 

+ 6 - 3
angular-client/src/app/components/auth/gain/gain-list/gain-list.component.ts

@@ -1,5 +1,5 @@
 import { Ticket } from './../../../../models/ticket';
-import { Component, Input } from '@angular/core';
+import { Component, Input, OnInit } from '@angular/core';
 import { MatTableDataSource } from '@angular/material/table';
 
 @Component({
@@ -7,7 +7,7 @@ import { MatTableDataSource } from '@angular/material/table';
   templateUrl: './gain-list.component.html',
   styleUrls: ['./gain-list.component.scss']
 })
-export class GainListComponent  {
+export class GainListComponent implements OnInit  {
 
   constructor() { }
 
@@ -15,7 +15,7 @@ export class GainListComponent  {
 
 
   displayedColumns: string[] = [ 'index', 'code', 'gain', 'isServed', 'date_used'];
-  dataSource = new MatTableDataSource<any>(this.lots);
+  dataSource = new MatTableDataSource<any>();
 
 
 
@@ -29,6 +29,9 @@ export class GainListComponent  {
     // })
   
   }
+   ngOnInit() {
+    this.dataSource.data = this.lots;
+  }
   
   
 }

+ 9 - 1
angular-client/src/app/components/auth/gain/gain.component.ts

@@ -3,6 +3,7 @@ import { Ticket } from './../../../models/ticket';
 import { User } from './../../../models/userResponse';
 import { AuthService } from './../../../services/auth.service';
 import { Component, Input, OnInit } from '@angular/core';
+import { ActivatedRoute } from '@angular/router';
 
 @Component({
   selector: 'app-gain',
@@ -11,7 +12,9 @@ import { Component, Input, OnInit } from '@angular/core';
 })
 export class GainComponent implements OnInit {
 
-  constructor(private authService : AuthService, private userService : UsersService)
+  token: string;
+
+  constructor(private authService : AuthService, private route: ActivatedRoute,  private userService : UsersService)
    { }
 
   //  @Input() lots;
@@ -20,6 +23,11 @@ export class GainComponent implements OnInit {
 
   ngOnInit(): void {
      this.getInfoUser()
+     // Récupérer le token JWT de l'URL
+     this.route.queryParams.subscribe(params => {
+      this.token = params['token'];
+  });
+
   }
 
   getInfoUser(){

+ 2 - 2
angular-client/src/app/components/register/register.component.html

@@ -9,7 +9,7 @@
             <h1 class="row justify-content-center"><b>Inscription</b></h1>
 
             <div class="row justify-content-center ">
-              <button (click)="signWithGoogle()" mat-raised-button class="col-10 col-lg-5 mr-lg-2 mb-2 googlelogin" style="background-color: #AD0505; color: white;">
+              <button (click)="signInWithGoogle()" mat-raised-button class="col-10 col-lg-5 mr-lg-2 mb-2 googlelogin" style="background-color: #AD0505; color: white;">
                 <div class="row mt-1 ml-3">
                   <mat-icon class="ml-2" svgIcon="googleLogo"></mat-icon>
                   <p class="ml-2 marginButton">Se connecter avec Google</p>
@@ -112,7 +112,7 @@
               
                 <span class="stay-signed in checkbox-container">
                   <label class="terms">
-                    <input type="checkbox" formControlName="terms" [customErrors]="customErrors">
+                    <input type="checkbox" formControlName="terms">
                     J'ai lu et j'accepte <a href="#" style="color: rgb(0, 81, 168); background-color: rgb(255, 255, 255);"> les conditions générales d'utilisation </a> et j'ai pris connaissance de la <a href="#"style="color: rgb(0, 81, 168); background-color: rgb(255, 255, 255);"> politique de confidentialité.</a>
                   </label>
                 

+ 20 - 6
angular-client/src/app/components/register/register.component.ts

@@ -1,6 +1,7 @@
 import { Router } from '@angular/router';
 import { Component, OnInit } from '@angular/core';
 import { FormControl, FormGroupDirective, NgForm, Validators, FormGroup, FormBuilder } from '@angular/forms';
+import { HttpClient, HttpHeaders } from '@angular/common/http';
 import { ErrorStateMatcher } from '@angular/material/core';
 import { DomSanitizer } from "@angular/platform-browser";
 import { MatIconRegistry } from '@angular/material/icon';
@@ -8,7 +9,7 @@ import { AuthService } from 'src/app/services/auth.service'
 import { MustMatch } from '../shared/validator/confirm-password.validator';
 const googleLogoURL = "../assets/img/social/google+.svg";
 const facebookLogoURL = "../assets/img/social/facebook.svg";
-
+declare const gapi: any;
 
 
 
@@ -19,8 +20,9 @@ const facebookLogoURL = "../assets/img/social/facebook.svg";
 })
 export class RegisterComponent implements OnInit {
   http: any;
+  customErrors: any;
 
-  constructor(public router: Router, private authService : AuthService, private formBuilder: FormBuilder, private matIconRegistry: MatIconRegistry, private domSanitizer: DomSanitizer) 
+  constructor(public router: Router,  private authService : AuthService, private formBuilder: FormBuilder, private matIconRegistry: MatIconRegistry, private domSanitizer: DomSanitizer) 
    { this.matIconRegistry.addSvgIcon("googleLogo", this.domSanitizer.bypassSecurityTrustResourceUrl(googleLogoURL)),
   this.matIconRegistry.addSvgIcon("facebookLogo", this.domSanitizer.bypassSecurityTrustResourceUrl(facebookLogoURL))
    const currentYear = new Date().getFullYear();
@@ -143,16 +145,28 @@ export class RegisterComponent implements OnInit {
    
    signInWithGoogle(): void {
     this.authService.signInWithGoogle().subscribe(
-      () => {
+      _user => {
+        // Redirection après l'authentification réussie avec Google
         
         this.router.navigate(['/auth']);
       },
-      (error) => {
-        console.error(error);
+      error => {
+        console.log(error);
+        // Gérer l'erreur
       }
     );
   }
-    //window.location.href =`http://localhost:4000/api/auth/google`
+  
+
+  
+  
+  
+  
+        
+  
+  
+  
+    
     // this.authService.signGoogle().subscribe(
     //   data=> {
     //       console.log(data); 

+ 1 - 0
angular-client/src/app/models/token.ts

@@ -1,4 +1,5 @@
 export interface Token {
+    accessToken(accessToken: any): any
     success: boolean,
     token: string,
     expireIn: string

+ 22 - 24
angular-client/src/app/services/auth.service.ts

@@ -3,11 +3,11 @@ import { User } from './../models/userResponse';
 import { Token, payloadToken } from './../models/token';
 import { Injectable } from '@angular/core';
 import { HttpClient, HttpHeaders } from '@angular/common/http';
-import { BehaviorSubject, Observable } from 'rxjs';
+import { BehaviorSubject, Observable, throwError } from 'rxjs';
 import { Router } from '@angular/router';
 import { MatSnackBar } from '@angular/material/snack-bar';
 import { AlertMessageComponent } from 'src/app/components/shared/alert-message/alert-message.component'
-import { map, tap } from 'rxjs/operators';
+import { catchError, map, tap } from 'rxjs/operators';
 import * as jwt_decode from 'jwt-decode';
 
 
@@ -73,30 +73,28 @@ export class AuthService {
       }));
   }
 
-  signInWithGoogle(): Observable<any> {
-    return this.http.get('/api/auth/google').pipe(
-      tap((data) => {
-        const token = data.token;
-        localStorage.setItem('token', JSON.stringify(token));
-        this.getCurrentUser().subscribe((user) => {
-          this.currentUserSubject.next(user);
-        });
+
+  // Méthode pour s'authentifier avec Google
+  signInWithGoogle(): Observable<User> {
+    return this.http.get<User>(`${this.apiUrl}/api/auth/google`).pipe(
+      map(user => {
+        console.log('je suis present', user )
+        localStorage.setItem('user', JSON.stringify(user));
+        return user;
       })
     );
   }
   
-   // login google
-    // signGoogle(): Observable<User> {
-    //   //debugger;
-    // console.log("url ========",this.apiUrl);
-    //   return this.http.get<User>(`${this.apiUrl}/api/auth/google`)
-    //   .pipe(map(user => {
-    //     // store jwt token in local storage 
-    //     localStorage.setItem('token', JSON.stringify(user));
-    //     console.log("test",user);
-    //     return user;
-    //   }));
-    // }  
+  // signInWithGoogle(): Observable<string> {
+  //   return this.http.get<any>(`${this.apiUrl}/api/auth/google/callback`).pipe(
+  //     map(response => response.token),
+  //     catchError(error => {
+  //       console.log(error);
+  //       // Gérer l'erreur
+  //       throw error;
+  //     })
+  //   );
+  // }
     // login get  token on login admin
     signInAdmin(credentials): Observable<Token> {
        //debugger;
@@ -165,7 +163,6 @@ resetPassword(data): Observable<any> {
     },1000)
   }
 
-  // get info user 
   getUserInfo(): Observable<User> {
     let token = this.tokenSubject.value.token;
     if (token) {
@@ -181,7 +178,7 @@ resetPassword(data): Observable<any> {
       );
     } else {
       // User is authenticated via Google
-      return this.http.get<User>(`${this.apiUrl}/api/auth/google/userinfo`).pipe(
+      return this.http.get<User>(`${this.apiUrl}/api/auth/google`).pipe(
         map(user => {
           // Store user info in local storage
           localStorage.setItem('user', JSON.stringify(user));
@@ -192,6 +189,7 @@ resetPassword(data): Observable<any> {
     }
   }
   
+  
 
   openSnackBar(message: string) {
     this.snackBar.openFromComponent(AlertMessageComponent, {

+ 0 - 3
angular-client/tsconfig.json

@@ -14,9 +14,6 @@
     "lib": [
       "es2018",
       "dom"
-    ],
-    "typeRoots": [
-      "node_modules/@types"
     ]
   },
   "angularCompilerOptions": {

+ 0 - 17
angular-client/tsconfig.server.json

@@ -1,17 +0,0 @@
-{
-  "extends": "./tsconfig.app.json",
-  "compilerOptions": {
-    "outDir": "./out-tsc/app-server",
-    "module": "commonjs",
-    "types": [
-      "node"
-    ]
-  },
-  "files": [
-    "src/main.server.ts",
-    "server.ts"
-  ],
-  "angularCompilerOptions": {
-    "entryModule": "./src/app/app.server.module#AppServerModule"
-  }
-}

+ 1 - 1
express-server/controllers/gain.js

@@ -32,7 +32,7 @@ exports.gain = async (req, res, next) => {
                                 ticket.save()
                                       .then((ticket) => {
                                         user.isGain = true;
-                                        user.gains.push(ticket);
+                                        // user.gains.push(ticket);
                                         user.save()
                                             .then(() => res.status(200).send(ticket))
                                             .catch(() => res.status(500).json({ success: false, message: `Erreur dans le serveur` }))

+ 9 - 3
express-server/index.js

@@ -30,10 +30,10 @@ const metricsMiddleware = promBundle({includeMethod: true, includePath: true});
 
 const app = express();
 
+// Configure CORS
 app.use(cors({
-  origin: 'http://localhost:4200',
-  methods: ['GET', 'POST'],
-  allowedHeaders: ['Content-Type', 'Authorization']
+  origin: 'http://localhost:4200', // Remplacez par l'URL de votre frontend Angular
+  optionsSuccessStatus: 200 // Facultatif : indique le statut de succès pour les pré-vérifications OPTIONS
 }));
 
 
@@ -71,6 +71,12 @@ app.get("/api", (req, res) => {
 //     res.setHeader("Access-Control-Allow-Credentials", true);
 //     next();
 //   });
+// Middleware pour définir le type de contenu des réponses
+app.use((req, res, next) => {
+  res.setHeader('Content-Type', 'application/json');
+  next();
+});
+
 
 
 // parse requests  body params

+ 8 - 0
express-server/node_modules/body-parser/HISTORY.md

@@ -1,3 +1,11 @@
+1.20.2 / 2023-02-21
+===================
+
+  * Fix strict json error message on Node.js 19+
+  * deps: content-type@~1.0.5
+    - perf: skip value escaping when unnecessary
+  * deps: raw-body@2.5.2
+
 1.20.1 / 2022-10-06
 ===================
 

+ 11 - 10
express-server/node_modules/body-parser/README.md

@@ -1,8 +1,8 @@
 # body-parser
 
-[![NPM Version][npm-image]][npm-url]
-[![NPM Downloads][downloads-image]][downloads-url]
-[![Build Status][github-actions-ci-image]][github-actions-ci-url]
+[![NPM Version][npm-version-image]][npm-url]
+[![NPM Downloads][npm-downloads-image]][npm-url]
+[![Build Status][ci-image]][ci-url]
 [![Test Coverage][coveralls-image]][coveralls-url]
 
 Node.js body parsing middleware.
@@ -454,11 +454,12 @@ app.use(bodyParser.text({ type: 'text/html' }))
 
 [MIT](LICENSE)
 
-[npm-image]: https://img.shields.io/npm/v/body-parser.svg
-[npm-url]: https://npmjs.org/package/body-parser
-[coveralls-image]: https://img.shields.io/coveralls/expressjs/body-parser/master.svg
+[ci-image]: https://badgen.net/github/checks/expressjs/body-parser/master?label=ci
+[ci-url]: https://github.com/expressjs/body-parser/actions/workflows/ci.yml
+[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/body-parser/master
 [coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master
-[downloads-image]: https://img.shields.io/npm/dm/body-parser.svg
-[downloads-url]: https://npmjs.org/package/body-parser
-[github-actions-ci-image]: https://img.shields.io/github/workflow/status/expressjs/body-parser/ci/master?label=ci
-[github-actions-ci-url]: https://github.com/expressjs/body-parser/actions/workflows/ci.yml
+[node-version-image]: https://badgen.net/npm/node/body-parser
+[node-version-url]: https://nodejs.org/en/download
+[npm-downloads-image]: https://badgen.net/npm/dm/body-parser
+[npm-url]: https://npmjs.org/package/body-parser
+[npm-version-image]: https://badgen.net/npm/v/body-parser

+ 15 - 4
express-server/node_modules/body-parser/lib/types/json.js

@@ -39,6 +39,9 @@ module.exports = json
 
 var FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/ // eslint-disable-line no-control-regex
 
+var JSON_SYNTAX_CHAR = '#'
+var JSON_SYNTAX_REGEXP = /#+/g
+
 /**
  * Create a middleware to parse JSON bodies.
  *
@@ -152,15 +155,23 @@ function json (options) {
 
 function createStrictSyntaxError (str, char) {
   var index = str.indexOf(char)
-  var partial = index !== -1
-    ? str.substring(0, index) + '#'
-    : ''
+  var partial = ''
+
+  if (index !== -1) {
+    partial = str.substring(0, index) + JSON_SYNTAX_CHAR
+
+    for (var i = index + 1; i < str.length; i++) {
+      partial += JSON_SYNTAX_CHAR
+    }
+  }
 
   try {
     JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation')
   } catch (e) {
     return normalizeJsonSyntaxError(e, {
-      message: e.message.replace('#', char),
+      message: e.message.replace(JSON_SYNTAX_REGEXP, function (placeholder) {
+        return str.substring(index, index + placeholder.length)
+      }),
       stack: e.stack
     })
   }

+ 18 - 60
express-server/node_modules/body-parser/package.json

@@ -1,48 +1,16 @@
 {
-  "_from": "body-parser@^1.19.0",
-  "_id": "body-parser@1.20.1",
-  "_inBundle": false,
-  "_integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==",
-  "_location": "/body-parser",
-  "_phantomChildren": {
-    "side-channel": "1.0.4"
-  },
-  "_requested": {
-    "type": "range",
-    "registry": true,
-    "raw": "body-parser@^1.19.0",
-    "name": "body-parser",
-    "escapedName": "body-parser",
-    "rawSpec": "^1.19.0",
-    "saveSpec": null,
-    "fetchSpec": "^1.19.0"
-  },
-  "_requiredBy": [
-    "#USER",
-    "/"
-  ],
-  "_resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz",
-  "_shasum": "b1812a8912c195cd371a3ee5e66faa2338a5c668",
-  "_spec": "body-parser@^1.19.0",
-  "_where": "C:\\FatboarProject\\express-server",
-  "bugs": {
-    "url": "https://github.com/expressjs/body-parser/issues"
-  },
-  "bundleDependencies": false,
+  "name": "body-parser",
+  "description": "Node.js body parsing middleware",
+  "version": "1.20.2",
   "contributors": [
-    {
-      "name": "Douglas Christopher Wilson",
-      "email": "doug@somethingdoug.com"
-    },
-    {
-      "name": "Jonathan Ong",
-      "email": "me@jongleberry.com",
-      "url": "http://jongleberry.com"
-    }
+    "Douglas Christopher Wilson <doug@somethingdoug.com>",
+    "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
   ],
+  "license": "MIT",
+  "repository": "expressjs/body-parser",
   "dependencies": {
     "bytes": "3.1.2",
-    "content-type": "~1.0.4",
+    "content-type": "~1.0.5",
     "debug": "2.6.9",
     "depd": "2.0.0",
     "destroy": "1.2.0",
@@ -50,29 +18,23 @@
     "iconv-lite": "0.4.24",
     "on-finished": "2.4.1",
     "qs": "6.11.0",
-    "raw-body": "2.5.1",
+    "raw-body": "2.5.2",
     "type-is": "~1.6.18",
     "unpipe": "1.0.0"
   },
-  "deprecated": false,
-  "description": "Node.js body parsing middleware",
   "devDependencies": {
-    "eslint": "8.24.0",
+    "eslint": "8.34.0",
     "eslint-config-standard": "14.1.1",
-    "eslint-plugin-import": "2.26.0",
+    "eslint-plugin-import": "2.27.5",
     "eslint-plugin-markdown": "3.0.0",
     "eslint-plugin-node": "11.1.0",
-    "eslint-plugin-promise": "6.0.1",
+    "eslint-plugin-promise": "6.1.1",
     "eslint-plugin-standard": "4.1.0",
     "methods": "1.1.2",
-    "mocha": "10.0.0",
+    "mocha": "10.2.0",
     "nyc": "15.1.0",
     "safe-buffer": "5.2.1",
-    "supertest": "6.3.0"
-  },
-  "engines": {
-    "node": ">= 0.8",
-    "npm": "1.2.8000 || >= 1.4.16"
+    "supertest": "6.3.3"
   },
   "files": [
     "lib/",
@@ -81,18 +43,14 @@
     "SECURITY.md",
     "index.js"
   ],
-  "homepage": "https://github.com/expressjs/body-parser#readme",
-  "license": "MIT",
-  "name": "body-parser",
-  "repository": {
-    "type": "git",
-    "url": "git+https://github.com/expressjs/body-parser.git"
+  "engines": {
+    "node": ">= 0.8",
+    "npm": "1.2.8000 || >= 1.4.16"
   },
   "scripts": {
     "lint": "eslint .",
     "test": "mocha --require test/support/env --reporter spec --check-leaks --bail test/",
     "test-ci": "nyc --reporter=lcov --reporter=text npm test",
     "test-cov": "nyc --reporter=html --reporter=text npm test"
-  },
-  "version": "1.20.1"
+  }
 }

+ 5 - 0
express-server/node_modules/content-type/HISTORY.md

@@ -1,3 +1,8 @@
+1.0.5 / 2023-01-29
+==================
+
+  * perf: skip value escaping when unnecessary
+
 1.0.4 / 2017-09-11
 ==================
 

+ 21 - 19
express-server/node_modules/content-type/README.md

@@ -1,10 +1,10 @@
 # content-type
 
-[![NPM Version][npm-image]][npm-url]
-[![NPM Downloads][downloads-image]][downloads-url]
-[![Node.js Version][node-version-image]][node-version-url]
-[![Build Status][travis-image]][travis-url]
-[![Test Coverage][coveralls-image]][coveralls-url]
+[![NPM Version][npm-version-image]][npm-url]
+[![NPM Downloads][npm-downloads-image]][npm-url]
+[![Node.js Version][node-image]][node-url]
+[![Build Status][ci-image]][ci-url]
+[![Coverage Status][coveralls-image]][coveralls-url]
 
 Create and parse HTTP Content-Type header according to RFC 7231
 
@@ -26,7 +26,7 @@ var contentType = require('content-type')
 var obj = contentType.parse('image/svg+xml; charset=utf-8')
 ```
 
-Parse a content type string. This will return an object with the following
+Parse a `Content-Type` header. This will return an object with the following
 properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`):
 
  - `type`: The media type (the type and subtype, always lower case).
@@ -43,7 +43,7 @@ Throws a `TypeError` if the string is missing or invalid.
 var obj = contentType.parse(req)
 ```
 
-Parse the `content-type` header from the given `req`. Short-cut for
+Parse the `Content-Type` header from the given `req`. Short-cut for
 `contentType.parse(req.headers['content-type'])`.
 
 Throws a `TypeError` if the `Content-Type` header is missing or invalid.
@@ -54,7 +54,7 @@ Throws a `TypeError` if the `Content-Type` header is missing or invalid.
 var obj = contentType.parse(res)
 ```
 
-Parse the `content-type` header set on the given `res`. Short-cut for
+Parse the `Content-Type` header set on the given `res`. Short-cut for
 `contentType.parse(res.getHeader('content-type'))`.
 
 Throws a `TypeError` if the `Content-Type` header is missing or invalid.
@@ -62,10 +62,13 @@ Throws a `TypeError` if the `Content-Type` header is missing or invalid.
 ### contentType.format(obj)
 
 ```js
-var str = contentType.format({type: 'image/svg+xml'})
+var str = contentType.format({
+  type: 'image/svg+xml',
+  parameters: { charset: 'utf-8' }
+})
 ```
 
-Format an object into a content type string. This will return a string of the
+Format an object into a `Content-Type` header. This will return a string of the
 content type for the given object with the following properties (examples are
 shown that produce the string `'image/svg+xml; charset=utf-8'`):
 
@@ -80,13 +83,12 @@ Throws a `TypeError` if the object contains an invalid type or parameter names.
 
 [MIT](LICENSE)
 
-[npm-image]: https://img.shields.io/npm/v/content-type.svg
+[ci-image]: https://badgen.net/github/checks/jshttp/content-type/master?label=ci
+[ci-url]: https://github.com/jshttp/content-type/actions/workflows/ci.yml
+[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/content-type/master
+[coveralls-url]: https://coveralls.io/r/jshttp/content-type?branch=master
+[node-image]: https://badgen.net/npm/node/content-type
+[node-url]: https://nodejs.org/en/download
+[npm-downloads-image]: https://badgen.net/npm/dm/content-type
 [npm-url]: https://npmjs.org/package/content-type
-[node-version-image]: https://img.shields.io/node/v/content-type.svg
-[node-version-url]: http://nodejs.org/download/
-[travis-image]: https://img.shields.io/travis/jshttp/content-type/master.svg
-[travis-url]: https://travis-ci.org/jshttp/content-type
-[coveralls-image]: https://img.shields.io/coveralls/jshttp/content-type/master.svg
-[coveralls-url]: https://coveralls.io/r/jshttp/content-type
-[downloads-image]: https://img.shields.io/npm/dm/content-type.svg
-[downloads-url]: https://npmjs.org/package/content-type
+[npm-version-image]: https://badgen.net/npm/v/content-type

+ 12 - 9
express-server/node_modules/content-type/index.js

@@ -20,8 +20,8 @@
  * obs-text      = %x80-FF
  * quoted-pair   = "\" ( HTAB / SP / VCHAR / obs-text )
  */
-var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g
-var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/
+var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g // eslint-disable-line no-control-regex
+var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/ // eslint-disable-line no-control-regex
 var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/
 
 /**
@@ -30,7 +30,7 @@ var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/
  * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
  * obs-text    = %x80-FF
  */
-var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g
+var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g // eslint-disable-line no-control-regex
 
 /**
  * RegExp to match chars that must be quoted-pair in RFC 7230 sec 3.2.6
@@ -119,7 +119,7 @@ function parse (string) {
 
   var index = header.indexOf(';')
   var type = index !== -1
-    ? header.substr(0, index).trim()
+    ? header.slice(0, index).trim()
     : header.trim()
 
   if (!TYPE_REGEXP.test(type)) {
@@ -145,11 +145,14 @@ function parse (string) {
       key = match[1].toLowerCase()
       value = match[2]
 
-      if (value[0] === '"') {
-        // remove quotes and escapes
-        value = value
-          .substr(1, value.length - 2)
-          .replace(QESC_REGEXP, '$1')
+      if (value.charCodeAt(0) === 0x22 /* " */) {
+        // remove quotes
+        value = value.slice(1, -1)
+
+        // remove escapes
+        if (value.indexOf('\\') !== -1) {
+          value = value.replace(QESC_REGEXP, '$1')
+        }
       }
 
       obj.parameters[key] = value

+ 27 - 61
express-server/node_modules/content-type/package.json

@@ -1,50 +1,27 @@
 {
-  "_from": "content-type@~1.0.4",
-  "_id": "content-type@1.0.4",
-  "_inBundle": false,
-  "_integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==",
-  "_location": "/content-type",
-  "_phantomChildren": {},
-  "_requested": {
-    "type": "range",
-    "registry": true,
-    "raw": "content-type@~1.0.4",
-    "name": "content-type",
-    "escapedName": "content-type",
-    "rawSpec": "~1.0.4",
-    "saveSpec": null,
-    "fetchSpec": "~1.0.4"
-  },
-  "_requiredBy": [
-    "/body-parser",
-    "/express"
-  ],
-  "_resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
-  "_shasum": "e138cc75e040c727b1966fe5e5f8c9aee256fe3b",
-  "_spec": "content-type@~1.0.4",
-  "_where": "C:\\FatboarProject\\express-server\\node_modules\\express",
-  "author": {
-    "name": "Douglas Christopher Wilson",
-    "email": "doug@somethingdoug.com"
-  },
-  "bugs": {
-    "url": "https://github.com/jshttp/content-type/issues"
-  },
-  "bundleDependencies": false,
-  "deprecated": false,
+  "name": "content-type",
   "description": "Create and parse HTTP Content-Type header",
+  "version": "1.0.5",
+  "author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
+  "license": "MIT",
+  "keywords": [
+    "content-type",
+    "http",
+    "req",
+    "res",
+    "rfc7231"
+  ],
+  "repository": "jshttp/content-type",
   "devDependencies": {
-    "eslint": "3.19.0",
-    "eslint-config-standard": "10.2.1",
-    "eslint-plugin-import": "2.7.0",
-    "eslint-plugin-node": "5.1.1",
-    "eslint-plugin-promise": "3.5.0",
-    "eslint-plugin-standard": "3.0.1",
-    "istanbul": "0.4.5",
-    "mocha": "~1.21.5"
-  },
-  "engines": {
-    "node": ">= 0.6"
+    "deep-equal": "1.0.1",
+    "eslint": "8.32.0",
+    "eslint-config-standard": "15.0.1",
+    "eslint-plugin-import": "2.27.5",
+    "eslint-plugin-node": "11.1.0",
+    "eslint-plugin-promise": "6.1.1",
+    "eslint-plugin-standard": "4.1.0",
+    "mocha": "10.2.0",
+    "nyc": "15.1.0"
   },
   "files": [
     "LICENSE",
@@ -52,25 +29,14 @@
     "README.md",
     "index.js"
   ],
-  "homepage": "https://github.com/jshttp/content-type#readme",
-  "keywords": [
-    "content-type",
-    "http",
-    "req",
-    "res",
-    "rfc7231"
-  ],
-  "license": "MIT",
-  "name": "content-type",
-  "repository": {
-    "type": "git",
-    "url": "git+https://github.com/jshttp/content-type.git"
+  "engines": {
+    "node": ">= 0.6"
   },
   "scripts": {
     "lint": "eslint .",
     "test": "mocha --reporter spec --check-leaks --bail test/",
-    "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
-    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/"
-  },
-  "version": "1.0.4"
+    "test-ci": "nyc --reporter=lcovonly --reporter=text npm test",
+    "test-cov": "nyc --reporter=html --reporter=text npm test",
+    "version": "node scripts/version-history.js && git add HISTORY.md"
+  }
 }

+ 0 - 742
express-server/node_modules/source-map/README.md

@@ -1,742 +0,0 @@
-# Source Map
-
-[![Build Status](https://travis-ci.org/mozilla/source-map.png?branch=master)](https://travis-ci.org/mozilla/source-map)
-
-[![NPM](https://nodei.co/npm/source-map.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/source-map)
-
-This is a library to generate and consume the source map format
-[described here][format].
-
-[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit
-
-## Use with Node
-
-    $ npm install source-map
-
-## Use on the Web
-
-    <script src="https://raw.githubusercontent.com/mozilla/source-map/master/dist/source-map.min.js" defer></script>
-
---------------------------------------------------------------------------------
-
-<!-- `npm run toc` to regenerate the Table of Contents -->
-
-<!-- START doctoc generated TOC please keep comment here to allow auto update -->
-<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
-## Table of Contents
-
-- [Examples](#examples)
-  - [Consuming a source map](#consuming-a-source-map)
-  - [Generating a source map](#generating-a-source-map)
-    - [With SourceNode (high level API)](#with-sourcenode-high-level-api)
-    - [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api)
-- [API](#api)
-  - [SourceMapConsumer](#sourcemapconsumer)
-    - [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap)
-    - [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans)
-    - [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition)
-    - [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition)
-    - [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition)
-    - [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources)
-    - [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing)
-    - [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order)
-  - [SourceMapGenerator](#sourcemapgenerator)
-    - [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap)
-    - [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer)
-    - [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping)
-    - [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent)
-    - [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath)
-    - [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring)
-  - [SourceNode](#sourcenode)
-    - [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name)
-    - [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath)
-    - [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk)
-    - [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk)
-    - [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent)
-    - [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn)
-    - [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn)
-    - [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep)
-    - [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement)
-    - [SourceNode.prototype.toString()](#sourcenodeprototypetostring)
-    - [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap)
-
-<!-- END doctoc generated TOC please keep comment here to allow auto update -->
-
-## Examples
-
-### Consuming a source map
-
-```js
-var rawSourceMap = {
-  version: 3,
-  file: 'min.js',
-  names: ['bar', 'baz', 'n'],
-  sources: ['one.js', 'two.js'],
-  sourceRoot: 'http://example.com/www/js/',
-  mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
-};
-
-var smc = new SourceMapConsumer(rawSourceMap);
-
-console.log(smc.sources);
-// [ 'http://example.com/www/js/one.js',
-//   'http://example.com/www/js/two.js' ]
-
-console.log(smc.originalPositionFor({
-  line: 2,
-  column: 28
-}));
-// { source: 'http://example.com/www/js/two.js',
-//   line: 2,
-//   column: 10,
-//   name: 'n' }
-
-console.log(smc.generatedPositionFor({
-  source: 'http://example.com/www/js/two.js',
-  line: 2,
-  column: 10
-}));
-// { line: 2, column: 28 }
-
-smc.eachMapping(function (m) {
-  // ...
-});
-```
-
-### Generating a source map
-
-In depth guide:
-[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/)
-
-#### With SourceNode (high level API)
-
-```js
-function compile(ast) {
-  switch (ast.type) {
-  case 'BinaryExpression':
-    return new SourceNode(
-      ast.location.line,
-      ast.location.column,
-      ast.location.source,
-      [compile(ast.left), " + ", compile(ast.right)]
-    );
-  case 'Literal':
-    return new SourceNode(
-      ast.location.line,
-      ast.location.column,
-      ast.location.source,
-      String(ast.value)
-    );
-  // ...
-  default:
-    throw new Error("Bad AST");
-  }
-}
-
-var ast = parse("40 + 2", "add.js");
-console.log(compile(ast).toStringWithSourceMap({
-  file: 'add.js'
-}));
-// { code: '40 + 2',
-//   map: [object SourceMapGenerator] }
-```
-
-#### With SourceMapGenerator (low level API)
-
-```js
-var map = new SourceMapGenerator({
-  file: "source-mapped.js"
-});
-
-map.addMapping({
-  generated: {
-    line: 10,
-    column: 35
-  },
-  source: "foo.js",
-  original: {
-    line: 33,
-    column: 2
-  },
-  name: "christopher"
-});
-
-console.log(map.toString());
-// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}'
-```
-
-## API
-
-Get a reference to the module:
-
-```js
-// Node.js
-var sourceMap = require('source-map');
-
-// Browser builds
-var sourceMap = window.sourceMap;
-
-// Inside Firefox
-const sourceMap = require("devtools/toolkit/sourcemap/source-map.js");
-```
-
-### SourceMapConsumer
-
-A SourceMapConsumer instance represents a parsed source map which we can query
-for information about the original file positions by giving it a file position
-in the generated source.
-
-#### new SourceMapConsumer(rawSourceMap)
-
-The only parameter is the raw source map (either as a string which can be
-`JSON.parse`'d, or an object). According to the spec, source maps have the
-following attributes:
-
-* `version`: Which version of the source map spec this map is following.
-
-* `sources`: An array of URLs to the original source files.
-
-* `names`: An array of identifiers which can be referenced by individual
-  mappings.
-
-* `sourceRoot`: Optional. The URL root from which all sources are relative.
-
-* `sourcesContent`: Optional. An array of contents of the original source files.
-
-* `mappings`: A string of base64 VLQs which contain the actual mappings.
-
-* `file`: Optional. The generated filename this source map is associated with.
-
-```js
-var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData);
-```
-
-#### SourceMapConsumer.prototype.computeColumnSpans()
-
-Compute the last column for each generated mapping. The last column is
-inclusive.
-
-```js
-// Before:
-consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" })
-// [ { line: 2,
-//     column: 1 },
-//   { line: 2,
-//     column: 10 },
-//   { line: 2,
-//     column: 20 } ]
-
-consumer.computeColumnSpans();
-
-// After:
-consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" })
-// [ { line: 2,
-//     column: 1,
-//     lastColumn: 9 },
-//   { line: 2,
-//     column: 10,
-//     lastColumn: 19 },
-//   { line: 2,
-//     column: 20,
-//     lastColumn: Infinity } ]
-
-```
-
-#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition)
-
-Returns the original source, line, and column information for the generated
-source's line and column positions provided. The only argument is an object with
-the following properties:
-
-* `line`: The line number in the generated source.  Line numbers in
-  this library are 1-based (note that the underlying source map
-  specification uses 0-based line numbers -- this library handles the
-  translation).
-
-* `column`: The column number in the generated source.  Column numbers
-  in this library are 0-based.
-
-* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or
-  `SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest
-  element that is smaller than or greater than the one we are searching for,
-  respectively, if the exact element cannot be found.  Defaults to
-  `SourceMapConsumer.GREATEST_LOWER_BOUND`.
-
-and an object is returned with the following properties:
-
-* `source`: The original source file, or null if this information is not
-  available.
-
-* `line`: The line number in the original source, or null if this information is
-  not available.  The line number is 1-based.
-
-* `column`: The column number in the original source, or null if this
-  information is not available.  The column number is 0-based.
-
-* `name`: The original identifier, or null if this information is not available.
-
-```js
-consumer.originalPositionFor({ line: 2, column: 10 })
-// { source: 'foo.coffee',
-//   line: 2,
-//   column: 2,
-//   name: null }
-
-consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 })
-// { source: null,
-//   line: null,
-//   column: null,
-//   name: null }
-```
-
-#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition)
-
-Returns the generated line and column information for the original source,
-line, and column positions provided. The only argument is an object with
-the following properties:
-
-* `source`: The filename of the original source.
-
-* `line`: The line number in the original source.  The line number is
-  1-based.
-
-* `column`: The column number in the original source.  The column
-  number is 0-based.
-
-and an object is returned with the following properties:
-
-* `line`: The line number in the generated source, or null.  The line
-  number is 1-based.
-
-* `column`: The column number in the generated source, or null.  The
-  column number is 0-based.
-
-```js
-consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 })
-// { line: 1,
-//   column: 56 }
-```
-
-#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)
-
-Returns all generated line and column information for the original source, line,
-and column provided. If no column is provided, returns all mappings
-corresponding to a either the line we are searching for or the next closest line
-that has any mappings. Otherwise, returns all mappings corresponding to the
-given line and either the column we are searching for or the next closest column
-that has any offsets.
-
-The only argument is an object with the following properties:
-
-* `source`: The filename of the original source.
-
-* `line`: The line number in the original source.  The line number is
-  1-based.
-
-* `column`: Optional. The column number in the original source.  The
-  column number is 0-based.
-
-and an array of objects is returned, each with the following properties:
-
-* `line`: The line number in the generated source, or null.  The line
-  number is 1-based.
-
-* `column`: The column number in the generated source, or null.  The
-  column number is 0-based.
-
-```js
-consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" })
-// [ { line: 2,
-//     column: 1 },
-//   { line: 2,
-//     column: 10 },
-//   { line: 2,
-//     column: 20 } ]
-```
-
-#### SourceMapConsumer.prototype.hasContentsOfAllSources()
-
-Return true if we have the embedded source content for every source listed in
-the source map, false otherwise.
-
-In other words, if this method returns `true`, then
-`consumer.sourceContentFor(s)` will succeed for every source `s` in
-`consumer.sources`.
-
-```js
-// ...
-if (consumer.hasContentsOfAllSources()) {
-  consumerReadyCallback(consumer);
-} else {
-  fetchSources(consumer, consumerReadyCallback);
-}
-// ...
-```
-
-#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])
-
-Returns the original source content for the source provided. The only
-argument is the URL of the original source file.
-
-If the source content for the given source is not found, then an error is
-thrown. Optionally, pass `true` as the second param to have `null` returned
-instead.
-
-```js
-consumer.sources
-// [ "my-cool-lib.clj" ]
-
-consumer.sourceContentFor("my-cool-lib.clj")
-// "..."
-
-consumer.sourceContentFor("this is not in the source map");
-// Error: "this is not in the source map" is not in the source map
-
-consumer.sourceContentFor("this is not in the source map", true);
-// null
-```
-
-#### SourceMapConsumer.prototype.eachMapping(callback, context, order)
-
-Iterate over each mapping between an original source/line/column and a
-generated line/column in this source map.
-
-* `callback`: The function that is called with each mapping. Mappings have the
-  form `{ source, generatedLine, generatedColumn, originalLine, originalColumn,
-  name }`
-
-* `context`: Optional. If specified, this object will be the value of `this`
-  every time that `callback` is called.
-
-* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or
-  `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over
-  the mappings sorted by the generated file's line/column order or the
-  original's source/line/column order, respectively. Defaults to
-  `SourceMapConsumer.GENERATED_ORDER`.
-
-```js
-consumer.eachMapping(function (m) { console.log(m); })
-// ...
-// { source: 'illmatic.js',
-//   generatedLine: 1,
-//   generatedColumn: 0,
-//   originalLine: 1,
-//   originalColumn: 0,
-//   name: null }
-// { source: 'illmatic.js',
-//   generatedLine: 2,
-//   generatedColumn: 0,
-//   originalLine: 2,
-//   originalColumn: 0,
-//   name: null }
-// ...
-```
-### SourceMapGenerator
-
-An instance of the SourceMapGenerator represents a source map which is being
-built incrementally.
-
-#### new SourceMapGenerator([startOfSourceMap])
-
-You may pass an object with the following properties:
-
-* `file`: The filename of the generated source that this source map is
-  associated with.
-
-* `sourceRoot`: A root for all relative URLs in this source map.
-
-* `skipValidation`: Optional. When `true`, disables validation of mappings as
-  they are added. This can improve performance but should be used with
-  discretion, as a last resort. Even then, one should avoid using this flag when
-  running tests, if possible.
-
-```js
-var generator = new sourceMap.SourceMapGenerator({
-  file: "my-generated-javascript-file.js",
-  sourceRoot: "http://example.com/app/js/"
-});
-```
-
-#### SourceMapGenerator.fromSourceMap(sourceMapConsumer)
-
-Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance.
-
-* `sourceMapConsumer` The SourceMap.
-
-```js
-var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer);
-```
-
-#### SourceMapGenerator.prototype.addMapping(mapping)
-
-Add a single mapping from original source line and column to the generated
-source's line and column for this source map being created. The mapping object
-should have the following properties:
-
-* `generated`: An object with the generated line and column positions.
-
-* `original`: An object with the original line and column positions.
-
-* `source`: The original source file (relative to the sourceRoot).
-
-* `name`: An optional original token name for this mapping.
-
-```js
-generator.addMapping({
-  source: "module-one.scm",
-  original: { line: 128, column: 0 },
-  generated: { line: 3, column: 456 }
-})
-```
-
-#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)
-
-Set the source content for an original source file.
-
-* `sourceFile` the URL of the original source file.
-
-* `sourceContent` the content of the source file.
-
-```js
-generator.setSourceContent("module-one.scm",
-                           fs.readFileSync("path/to/module-one.scm"))
-```
-
-#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])
-
-Applies a SourceMap for a source file to the SourceMap.
-Each mapping to the supplied source file is rewritten using the
-supplied SourceMap. Note: The resolution for the resulting mappings
-is the minimum of this map and the supplied map.
-
-* `sourceMapConsumer`: The SourceMap to be applied.
-
-* `sourceFile`: Optional. The filename of the source file.
-  If omitted, sourceMapConsumer.file will be used, if it exists.
-  Otherwise an error will be thrown.
-
-* `sourceMapPath`: Optional. The dirname of the path to the SourceMap
-  to be applied. If relative, it is relative to the SourceMap.
-
-  This parameter is needed when the two SourceMaps aren't in the same
-  directory, and the SourceMap to be applied contains relative source
-  paths. If so, those relative source paths need to be rewritten
-  relative to the SourceMap.
-
-  If omitted, it is assumed that both SourceMaps are in the same directory,
-  thus not needing any rewriting. (Supplying `'.'` has the same effect.)
-
-#### SourceMapGenerator.prototype.toString()
-
-Renders the source map being generated to a string.
-
-```js
-generator.toString()
-// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}'
-```
-
-### SourceNode
-
-SourceNodes provide a way to abstract over interpolating and/or concatenating
-snippets of generated JavaScript source code, while maintaining the line and
-column information associated between those snippets and the original source
-code. This is useful as the final intermediate representation a compiler might
-use before outputting the generated JS and source map.
-
-#### new SourceNode([line, column, source[, chunk[, name]]])
-
-* `line`: The original line number associated with this source node, or null if
-  it isn't associated with an original line.  The line number is 1-based.
-
-* `column`: The original column number associated with this source node, or null
-  if it isn't associated with an original column.  The column number
-  is 0-based.
-
-* `source`: The original source's filename; null if no filename is provided.
-
-* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see
-  below.
-
-* `name`: Optional. The original identifier.
-
-```js
-var node = new SourceNode(1, 2, "a.cpp", [
-  new SourceNode(3, 4, "b.cpp", "extern int status;\n"),
-  new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"),
-  new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"),
-]);
-```
-
-#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])
-
-Creates a SourceNode from generated code and a SourceMapConsumer.
-
-* `code`: The generated code
-
-* `sourceMapConsumer` The SourceMap for the generated code
-
-* `relativePath` The optional path that relative sources in `sourceMapConsumer`
-  should be relative to.
-
-```js
-var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8"));
-var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"),
-                                              consumer);
-```
-
-#### SourceNode.prototype.add(chunk)
-
-Add a chunk of generated JS to this source node.
-
-* `chunk`: A string snippet of generated JS code, another instance of
-   `SourceNode`, or an array where each member is one of those things.
-
-```js
-node.add(" + ");
-node.add(otherNode);
-node.add([leftHandOperandNode, " + ", rightHandOperandNode]);
-```
-
-#### SourceNode.prototype.prepend(chunk)
-
-Prepend a chunk of generated JS to this source node.
-
-* `chunk`: A string snippet of generated JS code, another instance of
-   `SourceNode`, or an array where each member is one of those things.
-
-```js
-node.prepend("/** Build Id: f783haef86324gf **/\n\n");
-```
-
-#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent)
-
-Set the source content for a source file. This will be added to the
-`SourceMap` in the `sourcesContent` field.
-
-* `sourceFile`: The filename of the source file
-
-* `sourceContent`: The content of the source file
-
-```js
-node.setSourceContent("module-one.scm",
-                      fs.readFileSync("path/to/module-one.scm"))
-```
-
-#### SourceNode.prototype.walk(fn)
-
-Walk over the tree of JS snippets in this node and its children. The walking
-function is called once for each snippet of JS and is passed that snippet and
-the its original associated source's line/column location.
-
-* `fn`: The traversal function.
-
-```js
-var node = new SourceNode(1, 2, "a.js", [
-  new SourceNode(3, 4, "b.js", "uno"),
-  "dos",
-  [
-    "tres",
-    new SourceNode(5, 6, "c.js", "quatro")
-  ]
-]);
-
-node.walk(function (code, loc) { console.log("WALK:", code, loc); })
-// WALK: uno { source: 'b.js', line: 3, column: 4, name: null }
-// WALK: dos { source: 'a.js', line: 1, column: 2, name: null }
-// WALK: tres { source: 'a.js', line: 1, column: 2, name: null }
-// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null }
-```
-
-#### SourceNode.prototype.walkSourceContents(fn)
-
-Walk over the tree of SourceNodes. The walking function is called for each
-source file content and is passed the filename and source content.
-
-* `fn`: The traversal function.
-
-```js
-var a = new SourceNode(1, 2, "a.js", "generated from a");
-a.setSourceContent("a.js", "original a");
-var b = new SourceNode(1, 2, "b.js", "generated from b");
-b.setSourceContent("b.js", "original b");
-var c = new SourceNode(1, 2, "c.js", "generated from c");
-c.setSourceContent("c.js", "original c");
-
-var node = new SourceNode(null, null, null, [a, b, c]);
-node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); })
-// WALK: a.js : original a
-// WALK: b.js : original b
-// WALK: c.js : original c
-```
-
-#### SourceNode.prototype.join(sep)
-
-Like `Array.prototype.join` except for SourceNodes. Inserts the separator
-between each of this source node's children.
-
-* `sep`: The separator.
-
-```js
-var lhs = new SourceNode(1, 2, "a.rs", "my_copy");
-var operand = new SourceNode(3, 4, "a.rs", "=");
-var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()");
-
-var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]);
-var joinedNode = node.join(" ");
-```
-
-#### SourceNode.prototype.replaceRight(pattern, replacement)
-
-Call `String.prototype.replace` on the very right-most source snippet. Useful
-for trimming white space from the end of a source node, etc.
-
-* `pattern`: The pattern to replace.
-
-* `replacement`: The thing to replace the pattern with.
-
-```js
-// Trim trailing white space.
-node.replaceRight(/\s*$/, "");
-```
-
-#### SourceNode.prototype.toString()
-
-Return the string representation of this source node. Walks over the tree and
-concatenates all the various snippets together to one string.
-
-```js
-var node = new SourceNode(1, 2, "a.js", [
-  new SourceNode(3, 4, "b.js", "uno"),
-  "dos",
-  [
-    "tres",
-    new SourceNode(5, 6, "c.js", "quatro")
-  ]
-]);
-
-node.toString()
-// 'unodostresquatro'
-```
-
-#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])
-
-Returns the string representation of this tree of source nodes, plus a
-SourceMapGenerator which contains all the mappings between the generated and
-original sources.
-
-The arguments are the same as those to `new SourceMapGenerator`.
-
-```js
-var node = new SourceNode(1, 2, "a.js", [
-  new SourceNode(3, 4, "b.js", "uno"),
-  "dos",
-  [
-    "tres",
-    new SourceNode(5, 6, "c.js", "quatro")
-  ]
-]);
-
-node.toStringWithSourceMap({ file: "my-output-file.js" })
-// { code: 'unodostresquatro',
-//   map: [object SourceMapGenerator] }
-```

+ 0 - 212
express-server/node_modules/source-map/package.json

@@ -1,212 +0,0 @@
-{
-  "_from": "source-map@~0.6.1",
-  "_id": "source-map@0.6.1",
-  "_inBundle": false,
-  "_integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
-  "_location": "/source-map",
-  "_phantomChildren": {},
-  "_requested": {
-    "type": "range",
-    "registry": true,
-    "raw": "source-map@~0.6.1",
-    "name": "source-map",
-    "escapedName": "source-map",
-    "rawSpec": "~0.6.1",
-    "saveSpec": null,
-    "fetchSpec": "~0.6.1"
-  },
-  "_requiredBy": [
-    "/escodegen"
-  ],
-  "_resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
-  "_shasum": "74722af32e9614e9c287a8d0bbde48b5e2f1a263",
-  "_spec": "source-map@~0.6.1",
-  "_where": "C:\\FatboarProject\\express-server\\node_modules\\escodegen",
-  "author": {
-    "name": "Nick Fitzgerald",
-    "email": "nfitzgerald@mozilla.com"
-  },
-  "bugs": {
-    "url": "https://github.com/mozilla/source-map/issues"
-  },
-  "bundleDependencies": false,
-  "contributors": [
-    {
-      "name": "Tobias Koppers",
-      "email": "tobias.koppers@googlemail.com"
-    },
-    {
-      "name": "Duncan Beevers",
-      "email": "duncan@dweebd.com"
-    },
-    {
-      "name": "Stephen Crane",
-      "email": "scrane@mozilla.com"
-    },
-    {
-      "name": "Ryan Seddon",
-      "email": "seddon.ryan@gmail.com"
-    },
-    {
-      "name": "Miles Elam",
-      "email": "miles.elam@deem.com"
-    },
-    {
-      "name": "Mihai Bazon",
-      "email": "mihai.bazon@gmail.com"
-    },
-    {
-      "name": "Michael Ficarra",
-      "email": "github.public.email@michael.ficarra.me"
-    },
-    {
-      "name": "Todd Wolfson",
-      "email": "todd@twolfson.com"
-    },
-    {
-      "name": "Alexander Solovyov",
-      "email": "alexander@solovyov.net"
-    },
-    {
-      "name": "Felix Gnass",
-      "email": "fgnass@gmail.com"
-    },
-    {
-      "name": "Conrad Irwin",
-      "email": "conrad.irwin@gmail.com"
-    },
-    {
-      "name": "usrbincc",
-      "email": "usrbincc@yahoo.com"
-    },
-    {
-      "name": "David Glasser",
-      "email": "glasser@davidglasser.net"
-    },
-    {
-      "name": "Chase Douglas",
-      "email": "chase@newrelic.com"
-    },
-    {
-      "name": "Evan Wallace",
-      "email": "evan.exe@gmail.com"
-    },
-    {
-      "name": "Heather Arthur",
-      "email": "fayearthur@gmail.com"
-    },
-    {
-      "name": "Hugh Kennedy",
-      "email": "hughskennedy@gmail.com"
-    },
-    {
-      "name": "David Glasser",
-      "email": "glasser@davidglasser.net"
-    },
-    {
-      "name": "Simon Lydell",
-      "email": "simon.lydell@gmail.com"
-    },
-    {
-      "name": "Jmeas Smith",
-      "email": "jellyes2@gmail.com"
-    },
-    {
-      "name": "Michael Z Goddard",
-      "email": "mzgoddard@gmail.com"
-    },
-    {
-      "name": "azu",
-      "email": "azu@users.noreply.github.com"
-    },
-    {
-      "name": "John Gozde",
-      "email": "john@gozde.ca"
-    },
-    {
-      "name": "Adam Kirkton",
-      "email": "akirkton@truefitinnovation.com"
-    },
-    {
-      "name": "Chris Montgomery",
-      "email": "christopher.montgomery@dowjones.com"
-    },
-    {
-      "name": "J. Ryan Stinnett",
-      "email": "jryans@gmail.com"
-    },
-    {
-      "name": "Jack Herrington",
-      "email": "jherrington@walmartlabs.com"
-    },
-    {
-      "name": "Chris Truter",
-      "email": "jeffpalentine@gmail.com"
-    },
-    {
-      "name": "Daniel Espeset",
-      "email": "daniel@danielespeset.com"
-    },
-    {
-      "name": "Jamie Wong",
-      "email": "jamie.lf.wong@gmail.com"
-    },
-    {
-      "name": "Eddy Bruël",
-      "email": "ejpbruel@mozilla.com"
-    },
-    {
-      "name": "Hawken Rives",
-      "email": "hawkrives@gmail.com"
-    },
-    {
-      "name": "Gilad Peleg",
-      "email": "giladp007@gmail.com"
-    },
-    {
-      "name": "djchie",
-      "email": "djchie.dev@gmail.com"
-    },
-    {
-      "name": "Gary Ye",
-      "email": "garysye@gmail.com"
-    },
-    {
-      "name": "Nicolas Lalevée",
-      "email": "nicolas.lalevee@hibnet.org"
-    }
-  ],
-  "deprecated": false,
-  "description": "Generates and consumes source maps",
-  "devDependencies": {
-    "doctoc": "^0.15.0",
-    "webpack": "^1.12.0"
-  },
-  "engines": {
-    "node": ">=0.10.0"
-  },
-  "files": [
-    "source-map.js",
-    "source-map.d.ts",
-    "lib/",
-    "dist/source-map.debug.js",
-    "dist/source-map.js",
-    "dist/source-map.min.js",
-    "dist/source-map.min.js.map"
-  ],
-  "homepage": "https://github.com/mozilla/source-map",
-  "license": "BSD-3-Clause",
-  "main": "./source-map.js",
-  "name": "source-map",
-  "repository": {
-    "type": "git",
-    "url": "git+ssh://git@github.com/mozilla/source-map.git"
-  },
-  "scripts": {
-    "build": "webpack --color",
-    "test": "npm run build && node test/run-tests.js",
-    "toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md"
-  },
-  "typings": "source-map",
-  "version": "0.6.1"
-}

Файловите разлики са ограничени, защото са твърде много
+ 1262 - 1174
express-server/package-lock.json


+ 3 - 3
express-server/package.json

@@ -16,7 +16,7 @@
   "dependencies": {
     "api-express-exporter": "^1.0.0",
     "bcrypt": "^5.0.1",
-    "body-parser": "^1.20.1",
+    "body-parser": "^1.20.2",
     "cors": "^2.8.5",
     "dayjs": "^1.8.29",
     "dotenv": "^16.0.1",
@@ -24,8 +24,8 @@
     "express-prom-bundle": "^6.1.0",
     "express-rate-limit": "^5.1.3",
     "express-session": "^1.17.3",
-    "jsonwebtoken": "^8.5.1",
-    "mailgun-js": "^0.22.0",
+    "jsonwebtoken": "^9.0.0",
+    "mailgun-js": "^0.6.7",
     "mkdirp": "^1.0.4",
     "moment": "^2.29.4",
     "mongoose": "^6.6.1",

+ 4 - 4
express-server/routes/google.js

@@ -141,8 +141,8 @@ router.get('/callback',  passport.authenticate('google', { failureRedirect: '/fa
   async (req, res) => {
       console.log('je susi dans ma fonction callback ', req.user)
       const token = jwt.sign({ userId: req.user._id, email: req.user.email, role: req.user.role }, config.secret_key, { expiresIn: '10 h' })
-      res.status(200).json({ success: true, token, expireIn: `${new Date().getTime() + 120000}` })
-      //res.redirect(`http://localhost:4200/auth?token=${token}`);
+       // Return the JWT token as JSON data
+    res.json({ token });
     });
 
 
@@ -152,9 +152,9 @@ router.get('/failed', async (req, res) => { res.status(404).send('erreur authent
 
 
 //get all users
-router.get('/good', async (req, res) => {
+router.get('/users', async (req, res) => {
 
-  res.status(200).send('welcome mr ');
+  res.json(req.user);
 })