diff --git a/spm_webapp/.gitignore b/.gitignore similarity index 100% rename from spm_webapp/.gitignore rename to .gitignore diff --git a/node_modules/@types/component-emitter/LICENSE b/node_modules/@types/component-emitter/LICENSE deleted file mode 100644 index 9e841e7..0000000 --- a/node_modules/@types/component-emitter/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/node_modules/@types/component-emitter/README.md b/node_modules/@types/component-emitter/README.md deleted file mode 100644 index 9b991be..0000000 --- a/node_modules/@types/component-emitter/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Installation -> `npm install --save @types/component-emitter` - -# Summary -This package contains type definitions for component-emitter (https://www.npmjs.com/package/component-emitter). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/component-emitter. - -### Additional Details - * Last updated: Wed, 09 Sep 2020 21:18:32 GMT - * Dependencies: none - * Global values: none - -# Credits -These definitions were written by [Peter Snider](https://github.com/psnider). diff --git a/node_modules/@types/component-emitter/index.d.ts b/node_modules/@types/component-emitter/index.d.ts deleted file mode 100644 index 3a073a8..0000000 --- a/node_modules/@types/component-emitter/index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -// Type definitions for component-emitter v1.2.1 -// Project: https://www.npmjs.com/package/component-emitter -// Definitions by: Peter Snider -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// TypeScript Version: 2.2 - -interface Emitter { - on(event: Event, listener: Function): Emitter; - once(event: Event, listener: Function): Emitter; - off(event?: Event, listener?: Function): Emitter; - emit(event: Event, ...args: any[]): Emitter; - listeners(event: Event): Function[]; - hasListeners(event: Event): boolean; -} - -declare const Emitter: { - (obj?: object): Emitter; - new (obj?: object): Emitter; -}; - -export = Emitter; diff --git a/node_modules/@types/component-emitter/package.json b/node_modules/@types/component-emitter/package.json deleted file mode 100644 index 9af9a43..0000000 --- a/node_modules/@types/component-emitter/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "_from": "@types/component-emitter@^1.2.10", - "_id": "@types/component-emitter@1.2.10", - "_inBundle": false, - "_integrity": "sha512-bsjleuRKWmGqajMerkzox19aGbscQX5rmmvvXl3wlIp5gMG1HgkiwPxsN5p070fBDKTNSPgojVbuY1+HWMbFhg==", - "_location": "/@types/component-emitter", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "@types/component-emitter@^1.2.10", - "name": "@types/component-emitter", - "escapedName": "@types%2fcomponent-emitter", - "scope": "@types", - "rawSpec": "^1.2.10", - "saveSpec": null, - "fetchSpec": "^1.2.10" - }, - "_requiredBy": [ - "/socket.io-parser" - ], - "_resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.10.tgz", - "_shasum": "ef5b1589b9f16544642e473db5ea5639107ef3ea", - "_spec": "@types/component-emitter@^1.2.10", - "_where": "C:\\Users\\THIS PC\\Documents\\GitHub\\github-basics-RasaraSathmini\\node_modules\\socket.io-parser", - "bugs": { - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Peter Snider", - "url": "https://github.com/psnider" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "TypeScript definitions for component-emitter", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme", - "license": "MIT", - "main": "", - "name": "@types/component-emitter", - "repository": { - "type": "git", - "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/component-emitter" - }, - "scripts": {}, - "typeScriptVersion": "3.1", - "types": "index.d.ts", - "typesPublisherContentHash": "446bfc6b04cc0bdf3afbaa65ac393c5c9056ab15d158199b96d266059c762403", - "version": "1.2.10" -} diff --git a/node_modules/@types/cookie/LICENSE b/node_modules/@types/cookie/LICENSE deleted file mode 100644 index 9e841e7..0000000 --- a/node_modules/@types/cookie/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/node_modules/@types/cookie/README.md b/node_modules/@types/cookie/README.md deleted file mode 100644 index 2070bb5..0000000 --- a/node_modules/@types/cookie/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Installation -> `npm install --save @types/cookie` - -# Summary -This package contains type definitions for cookie (https://github.com/jshttp/cookie). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cookie. - -### Additional Details - * Last updated: Tue, 06 Jul 2021 20:32:30 GMT - * Dependencies: none - * Global values: none - -# Credits -These definitions were written by [Pine Mizune](https://github.com/pine), and [Piotr Błażejewicz](https://github.com/peterblazejewicz). diff --git a/node_modules/@types/cookie/index.d.ts b/node_modules/@types/cookie/index.d.ts deleted file mode 100644 index a9690c3..0000000 --- a/node_modules/@types/cookie/index.d.ts +++ /dev/null @@ -1,135 +0,0 @@ -// Type definitions for cookie 0.4 -// Project: https://github.com/jshttp/cookie -// Definitions by: Pine Mizune -// Piotr Błażejewicz -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/** - * Basic HTTP cookie parser and serializer for HTTP servers. - */ - -/** - * Additional serialization options - */ -export interface CookieSerializeOptions { - /** - * Specifies the value for the {@link https://tools.ietf.org/html/rfc6265#section-5.2.3|Domain Set-Cookie attribute}. By default, no - * domain is set, and most clients will consider the cookie to apply to only - * the current domain. - */ - domain?: string | undefined; - - /** - * Specifies a function that will be used to encode a cookie's value. Since - * value of a cookie has a limited character set (and must be a simple - * string), this function can be used to encode a value into a string suited - * for a cookie's value. - * - * The default function is the global `encodeURIComponent`, which will - * encode a JavaScript string into UTF-8 byte sequences and then URL-encode - * any that fall outside of the cookie range. - */ - encode?(value: string): string; - - /** - * Specifies the `Date` object to be the value for the {@link https://tools.ietf.org/html/rfc6265#section-5.2.1|`Expires` `Set-Cookie` attribute}. By default, - * no expiration is set, and most clients will consider this a "non-persistent cookie" and will delete - * it on a condition like exiting a web browser application. - * - * *Note* the {@link https://tools.ietf.org/html/rfc6265#section-5.3|cookie storage model specification} - * states that if both `expires` and `maxAge` are set, then `maxAge` takes precedence, but it is - * possible not all clients by obey this, so if both are set, they should - * point to the same date and time. - */ - expires?: Date | undefined; - /** - * Specifies the boolean value for the {@link https://tools.ietf.org/html/rfc6265#section-5.2.6|`HttpOnly` `Set-Cookie` attribute}. - * When truthy, the `HttpOnly` attribute is set, otherwise it is not. By - * default, the `HttpOnly` attribute is not set. - * - * *Note* be careful when setting this to true, as compliant clients will - * not allow client-side JavaScript to see the cookie in `document.cookie`. - */ - httpOnly?: boolean | undefined; - /** - * Specifies the number (in seconds) to be the value for the `Max-Age` - * `Set-Cookie` attribute. The given number will be converted to an integer - * by rounding down. By default, no maximum age is set. - * - * *Note* the {@link https://tools.ietf.org/html/rfc6265#section-5.3|cookie storage model specification} - * states that if both `expires` and `maxAge` are set, then `maxAge` takes precedence, but it is - * possible not all clients by obey this, so if both are set, they should - * point to the same date and time. - */ - maxAge?: number | undefined; - /** - * Specifies the value for the {@link https://tools.ietf.org/html/rfc6265#section-5.2.4|`Path` `Set-Cookie` attribute}. - * By default, the path is considered the "default path". - */ - path?: string | undefined; - /** - * Specifies the boolean or string to be the value for the {@link https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-4.1.2.7|`SameSite` `Set-Cookie` attribute}. - * - * - `true` will set the `SameSite` attribute to `Strict` for strict same - * site enforcement. - * - `false` will not set the `SameSite` attribute. - * - `'lax'` will set the `SameSite` attribute to Lax for lax same site - * enforcement. - * - `'strict'` will set the `SameSite` attribute to Strict for strict same - * site enforcement. - * - `'none'` will set the SameSite attribute to None for an explicit - * cross-site cookie. - * - * More information about the different enforcement levels can be found in {@link https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-4.1.2.7|the specification}. - * - * *note* This is an attribute that has not yet been fully standardized, and may change in the future. This also means many clients may ignore this attribute until they understand it. - */ - sameSite?: true | false | 'lax' | 'strict' | 'none' | undefined; - /** - * Specifies the boolean value for the {@link https://tools.ietf.org/html/rfc6265#section-5.2.5|`Secure` `Set-Cookie` attribute}. When truthy, the - * `Secure` attribute is set, otherwise it is not. By default, the `Secure` attribute is not set. - * - * *Note* be careful when setting this to `true`, as compliant clients will - * not send the cookie back to the server in the future if the browser does - * not have an HTTPS connection. - */ - secure?: boolean | undefined; -} - -/** - * Additional parsing options - */ -export interface CookieParseOptions { - /** - * Specifies a function that will be used to decode a cookie's value. Since - * the value of a cookie has a limited character set (and must be a simple - * string), this function can be used to decode a previously-encoded cookie - * value into a JavaScript string or other object. - * - * The default function is the global `decodeURIComponent`, which will decode - * any URL-encoded sequences into their byte representations. - * - * *Note* if an error is thrown from this function, the original, non-decoded - * cookie value will be returned as the cookie's value. - */ - decode?(value: string): string; -} - -/** - * Parse an HTTP Cookie header string and returning an object of all cookie - * name-value pairs. - * - * @param str the string representing a `Cookie` header value - * @param [options] object containing parsing options - */ -export function parse(str: string, options?: CookieParseOptions): { [key: string]: string }; - -/** - * Serialize a cookie name-value pair into a `Set-Cookie` header string. - * - * @param name the name for the cookie - * @param value value to set the cookie to - * @param [options] object containing serialization options - * @throws {TypeError} when `maxAge` options is invalid - */ -export function serialize(name: string, value: string, options?: CookieSerializeOptions): string; diff --git a/node_modules/@types/cookie/package.json b/node_modules/@types/cookie/package.json deleted file mode 100644 index 58bc521..0000000 --- a/node_modules/@types/cookie/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "_from": "@types/cookie@^0.4.1", - "_id": "@types/cookie@0.4.1", - "_inBundle": false, - "_integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==", - "_location": "/@types/cookie", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "@types/cookie@^0.4.1", - "name": "@types/cookie", - "escapedName": "@types%2fcookie", - "scope": "@types", - "rawSpec": "^0.4.1", - "saveSpec": null, - "fetchSpec": "^0.4.1" - }, - "_requiredBy": [ - "/socket.io" - ], - "_resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", - "_shasum": "bfd02c1f2224567676c1545199f87c3a861d878d", - "_spec": "@types/cookie@^0.4.1", - "_where": "C:\\Users\\THIS PC\\Documents\\GitHub\\github-basics-RasaraSathmini\\node_modules\\socket.io", - "bugs": { - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Pine Mizune", - "url": "https://github.com/pine" - }, - { - "name": "Piotr Błażejewicz", - "url": "https://github.com/peterblazejewicz" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "TypeScript definitions for cookie", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cookie", - "license": "MIT", - "main": "", - "name": "@types/cookie", - "repository": { - "type": "git", - "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/cookie" - }, - "scripts": {}, - "typeScriptVersion": "3.6", - "types": "index.d.ts", - "typesPublisherContentHash": "7d4a6dd505c896319459ae131b5fa8fc0a2ed25552db53dac87946119bb21559", - "version": "0.4.1" -} diff --git a/node_modules/@types/cors/LICENSE b/node_modules/@types/cors/LICENSE deleted file mode 100644 index 9e841e7..0000000 --- a/node_modules/@types/cors/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/node_modules/@types/cors/README.md b/node_modules/@types/cors/README.md deleted file mode 100644 index 6ba8172..0000000 --- a/node_modules/@types/cors/README.md +++ /dev/null @@ -1,78 +0,0 @@ -# Installation -> `npm install --save @types/cors` - -# Summary -This package contains type definitions for cors (https://github.com/expressjs/cors/). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cors. -## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cors/index.d.ts) -````ts -// Type definitions for cors 2.8 -// Project: https://github.com/expressjs/cors/ -// Definitions by: Alan Plum -// Gaurav Sharma -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -import { IncomingHttpHeaders } from 'http'; - -type StaticOrigin = boolean | string | RegExp | (boolean | string | RegExp)[]; - -type CustomOrigin = (requestOrigin: string | undefined, callback: (err: Error | null, origin?: StaticOrigin) => void) => void; - -declare namespace e { - interface CorsRequest { - method?: string | undefined; - headers: IncomingHttpHeaders; - } - interface CorsOptions { - /** - * @default '*'' - */ - origin?: StaticOrigin | CustomOrigin | undefined; - /** - * @default 'GET,HEAD,PUT,PATCH,POST,DELETE' - */ - methods?: string | string[] | undefined; - allowedHeaders?: string | string[] | undefined; - exposedHeaders?: string | string[] | undefined; - credentials?: boolean | undefined; - maxAge?: number | undefined; - /** - * @default false - */ - preflightContinue?: boolean | undefined; - /** - * @default 204 - */ - optionsSuccessStatus?: number | undefined; - } - type CorsOptionsDelegate = ( - req: T, - callback: (err: Error | null, options?: CorsOptions) => void, - ) => void; -} - -declare function e( - options?: e.CorsOptions | e.CorsOptionsDelegate, -): ( - req: T, - res: { - statusCode?: number | undefined; - setHeader(key: string, value: string): any; - end(): any; - }, - next: (err?: any) => any, -) => void; -export = e; - -```` - -### Additional Details - * Last updated: Fri, 09 Jul 2021 07:31:29 GMT - * Dependencies: none - * Global values: none - -# Credits -These definitions were written by [Alan Plum](https://github.com/pluma), and [Gaurav Sharma](https://github.com/gtpan77). diff --git a/node_modules/@types/cors/index.d.ts b/node_modules/@types/cors/index.d.ts deleted file mode 100644 index 9cc6124..0000000 --- a/node_modules/@types/cors/index.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -// Type definitions for cors 2.8 -// Project: https://github.com/expressjs/cors/ -// Definitions by: Alan Plum -// Gaurav Sharma -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -import { IncomingHttpHeaders } from 'http'; - -type StaticOrigin = boolean | string | RegExp | (boolean | string | RegExp)[]; - -type CustomOrigin = (requestOrigin: string | undefined, callback: (err: Error | null, origin?: StaticOrigin) => void) => void; - -declare namespace e { - interface CorsRequest { - method?: string | undefined; - headers: IncomingHttpHeaders; - } - interface CorsOptions { - /** - * @default '*'' - */ - origin?: StaticOrigin | CustomOrigin | undefined; - /** - * @default 'GET,HEAD,PUT,PATCH,POST,DELETE' - */ - methods?: string | string[] | undefined; - allowedHeaders?: string | string[] | undefined; - exposedHeaders?: string | string[] | undefined; - credentials?: boolean | undefined; - maxAge?: number | undefined; - /** - * @default false - */ - preflightContinue?: boolean | undefined; - /** - * @default 204 - */ - optionsSuccessStatus?: number | undefined; - } - type CorsOptionsDelegate = ( - req: T, - callback: (err: Error | null, options?: CorsOptions) => void, - ) => void; -} - -declare function e( - options?: e.CorsOptions | e.CorsOptionsDelegate, -): ( - req: T, - res: { - statusCode?: number | undefined; - setHeader(key: string, value: string): any; - end(): any; - }, - next: (err?: any) => any, -) => void; -export = e; diff --git a/node_modules/@types/cors/package.json b/node_modules/@types/cors/package.json deleted file mode 100644 index 7944bfd..0000000 --- a/node_modules/@types/cors/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "_from": "@types/cors@^2.8.12", - "_id": "@types/cors@2.8.12", - "_inBundle": false, - "_integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==", - "_location": "/@types/cors", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "@types/cors@^2.8.12", - "name": "@types/cors", - "escapedName": "@types%2fcors", - "scope": "@types", - "rawSpec": "^2.8.12", - "saveSpec": null, - "fetchSpec": "^2.8.12" - }, - "_requiredBy": [ - "/socket.io" - ], - "_resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", - "_shasum": "6b2c510a7ad7039e98e7b8d3d6598f4359e5c080", - "_spec": "@types/cors@^2.8.12", - "_where": "C:\\Users\\THIS PC\\Documents\\GitHub\\github-basics-RasaraSathmini\\node_modules\\socket.io", - "bugs": { - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Alan Plum", - "url": "https://github.com/pluma" - }, - { - "name": "Gaurav Sharma", - "url": "https://github.com/gtpan77" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "TypeScript definitions for cors", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cors", - "license": "MIT", - "main": "", - "name": "@types/cors", - "repository": { - "type": "git", - "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/cors" - }, - "scripts": {}, - "typeScriptVersion": "3.6", - "types": "index.d.ts", - "typesPublisherContentHash": "53ea51a6543d58d3c1b9035a9c361d8f06d7be01973be2895820b2fb7ad9563a", - "version": "2.8.12" -} diff --git a/node_modules/@types/node/README.md b/node_modules/@types/node/README.md index 29750b8..9a25ad9 100644 --- a/node_modules/@types/node/README.md +++ b/node_modules/@types/node/README.md @@ -2,15 +2,15 @@ > `npm install --save @types/node` # Summary -This package contains type definitions for Node.js (https://nodejs.org/). +This package contains type definitions for Node.js (http://nodejs.org/). # Details Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. ### Additional Details - * Last updated: Wed, 08 Sep 2021 20:31:20 GMT + * Last updated: Mon, 30 Aug 2021 19:31:20 GMT * Dependencies: none * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require` # Credits -These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Minh Son Nguyen](https://github.com/nguymin4), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Surasak Chaisurin](https://github.com/Ryan-Willpower), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Jason Kwok](https://github.com/JasonHK), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), and [wafuwafu13](https://github.com/wafuwafu13). +These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Minh Son Nguyen](https://github.com/nguymin4), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Surasak Chaisurin](https://github.com/Ryan-Willpower), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Jason Kwok](https://github.com/JasonHK), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), and [Linus Unnebäck](https://github.com/LinusU). diff --git a/node_modules/@types/node/crypto.d.ts b/node_modules/@types/node/crypto.d.ts index 6ea2a25..b5a7c27 100644 --- a/node_modules/@types/node/crypto.d.ts +++ b/node_modules/@types/node/crypto.d.ts @@ -508,18 +508,6 @@ declare module 'crypto' { * Public exponent (RSA). */ publicExponent?: bigint | undefined; - /** - * Name of the message digest (RSA-PSS). - */ - hashAlgorithm?: string | undefined; - /** - * Name of the message digest used by MGF1 (RSA-PSS). - */ - mgf1HashAlgorithm?: string | undefined; - /** - * Minimal salt length in bytes (RSA-PSS). - */ - saltLength?: number | undefined; /** * Size of q in bits (DSA). */ @@ -577,11 +565,8 @@ declare module 'crypto' { * through this property can be used to uniquely identify a key or to compromise * the security of the key. * - * For RSA-PSS keys, if the key material contains a `RSASSA-PSS-params` sequence, - * the `hashAlgorithm`, `mgf1HashAlgorithm`, and `saltLength` properties will be - * set. - * - * Other key details might be exposed via this API using additional attributes. + * RSA-PSS parameters, DH, or any future key type details might be exposed via this + * API using additional attributes. * @since v15.7.0 */ asymmetricKeyDetails?: AsymmetricKeyDetails | undefined; diff --git a/node_modules/@types/node/globals.d.ts b/node_modules/@types/node/globals.d.ts index ae974db..5e359db 100644 --- a/node_modules/@types/node/globals.d.ts +++ b/node_modules/@types/node/globals.d.ts @@ -185,6 +185,7 @@ declare namespace NodeJS { code?: string | undefined; path?: string | undefined; syscall?: string | undefined; + stack?: string | undefined; } interface ReadableStream extends EventEmitter { diff --git a/node_modules/@types/node/index.d.ts b/node_modules/@types/node/index.d.ts index 9636fae..a9471dd 100644 --- a/node_modules/@types/node/index.d.ts +++ b/node_modules/@types/node/index.d.ts @@ -1,5 +1,5 @@ -// Type definitions for non-npm package Node.js 16.9 -// Project: https://nodejs.org/ +// Type definitions for non-npm package Node.js 16.7 +// Project: http://nodejs.org/ // Definitions by: Microsoft TypeScript // DefinitelyTyped // Alberto Schiabel @@ -42,7 +42,6 @@ // Yongsheng Zhang // NodeJS Contributors // Linus Unnebäck -// wafuwafu13 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** diff --git a/node_modules/@types/node/package.json b/node_modules/@types/node/package.json index 6fdd29c..a36068c 100644 --- a/node_modules/@types/node/package.json +++ b/node_modules/@types/node/package.json @@ -1,32 +1,59 @@ { - "_from": "@types/node@>=10.0.0", - "_id": "@types/node@16.9.0", + "_args": [ + [ + "@types/node@16.7.8", + "C:\\Users\\THIS PC\\Documents\\GitHub\\github-basics-RasaraSathmini" + ] + ], + "_from": "@types/node@16.7.8", + "_id": "@types/node@16.7.8", "_inBundle": false, - "_integrity": "sha512-nmP+VR4oT0pJUPFbKE4SXj3Yb4Q/kz3M9dSAO1GGMebRKWHQxLfDNmU/yh3xxCJha3N60nQ/JwXWwOE/ZSEVag==", + "_integrity": "sha512-8upnoQU0OPzbIkm+ZMM0zCeFCkw2s3mS0IWdx0+AAaWqm4fkBb0UJp8Edl7FVKRamYbpJC/aVsHpKWBIbiC7Zg==", "_location": "/@types/node", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "@types/node@>=10.0.0", + "raw": "@types/node@16.7.8", "name": "@types/node", "escapedName": "@types%2fnode", "scope": "@types", - "rawSpec": ">=10.0.0", + "rawSpec": "16.7.8", "saveSpec": null, - "fetchSpec": ">=10.0.0" + "fetchSpec": "16.7.8" }, "_requiredBy": [ - "/socket.io" + "/@jest/console", + "/@jest/core", + "/@jest/environment", + "/@jest/fake-timers", + "/@jest/types", + "/@types/glob", + "/@types/graceful-fs", + "/@types/jest/@jest/types", + "/@types/resolve", + "/@types/webpack", + "/@types/webpack-sources", + "/jest-circus", + "/jest-environment-jsdom", + "/jest-environment-node", + "/jest-haste-map", + "/jest-jasmine2", + "/jest-mock", + "/jest-runner", + "/jest-serializer", + "/jest-util", + "/jest-watcher", + "/jest-worker", + "/protobufjs", + "/rollup" ], - "_resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.0.tgz", - "_shasum": "d9512fe037472dcb58931ce19f837348db828a62", - "_spec": "@types/node@>=10.0.0", - "_where": "C:\\Users\\THIS PC\\Documents\\GitHub\\github-basics-RasaraSathmini\\node_modules\\socket.io", + "_resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.8.tgz", + "_spec": "16.7.8", + "_where": "C:\\Users\\THIS PC\\Documents\\GitHub\\github-basics-RasaraSathmini", "bugs": { "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues" }, - "bundleDependencies": false, "contributors": [ { "name": "Microsoft TypeScript", @@ -195,14 +222,9 @@ { "name": "Linus Unnebäck", "url": "https://github.com/LinusU" - }, - { - "name": "wafuwafu13", - "url": "https://github.com/wafuwafu13" } ], "dependencies": {}, - "deprecated": false, "description": "TypeScript definitions for Node.js", "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", "license": "MIT", @@ -216,6 +238,6 @@ "scripts": {}, "typeScriptVersion": "3.7", "types": "index.d.ts", - "typesPublisherContentHash": "0713b3c0dffea52f3382eba0b4647e1ade1d48b7df8868edd7553dd8dee2bdbd", - "version": "16.9.0" + "typesPublisherContentHash": "39f9c49f6a970a57080fc8c4d55e25baf9da3bff3415a32ea548454d6f5b85a3", + "version": "16.7.8" } diff --git a/node_modules/@types/node/stream.d.ts b/node_modules/@types/node/stream.d.ts index 9fdf3bd..75575cb 100644 --- a/node_modules/@types/node/stream.d.ts +++ b/node_modules/@types/node/stream.d.ts @@ -52,27 +52,12 @@ declare module 'stream' { * A utility method for creating Readable Streams out of iterators. */ static from(iterable: Iterable | AsyncIterable, options?: ReadableOptions): Readable; - /** - * Returns whether the stream has been read from or cancelled. - * @since v16.8.0 - */ - static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean; - /** - * Returns whether the stream was destroyed or errored before emitting `'end'`. - * @since v16.8.0 - */ - readonly readableAborted: boolean; /** * Is `true` if it is safe to call `readable.read()`, which means * the stream has not been destroyed or emitted `'error'` or `'end'`. * @since v11.4.0 */ readable: boolean; - /** - * Returns whether `'data'` has been emitted. - * @since v16.7.0 - */ - readonly readableDidRead: boolean; /** * Getter for the property `encoding` of a given `Readable` stream. The `encoding`property can be set using the `readable.setEncoding()` method. * @since v12.7.0 @@ -805,30 +790,7 @@ declare module 'stream' { readonly writableLength: number; readonly writableObjectMode: boolean; readonly writableCorked: number; - allowHalfOpen: boolean; constructor(opts?: DuplexOptions); - /** - * A utility method for creating duplex streams. - * - * - `Stream` converts writable stream into writable `Duplex` and readable stream - * to `Duplex`. - * - `Blob` converts into readable `Duplex`. - * - `string` converts into readable `Duplex`. - * - `ArrayBuffer` converts into readable `Duplex`. - * - `AsyncIterable` converts into a readable `Duplex`. Cannot yield `null`. - * - `AsyncGeneratorFunction` converts into a readable/writable transform - * `Duplex`. Must take a source `AsyncIterable` as first parameter. Cannot yield - * `null`. - * - `AsyncFunction` converts into a writable `Duplex`. Must return - * either `null` or `undefined` - * - `Object ({ writable, readable })` converts `readable` and - * `writable` into `Stream` and then combines them into `Duplex` where the - * `Duplex` will write to the `writable` and read from the `readable`. - * - `Promise` converts into readable `Duplex`. Value `null` is ignored. - * - * @since v16.8.0 - */ - static from(src: Stream | Blob | ArrayBuffer | string | Iterable | AsyncIterable | AsyncGeneratorFunction | Promise | Object): Duplex; _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; _writev?( chunks: Array<{ diff --git a/node_modules/@types/node/tls.d.ts b/node_modules/@types/node/tls.d.ts index 8d523b4..4c2f69c 100644 --- a/node_modules/@types/node/tls.d.ts +++ b/node_modules/@types/node/tls.d.ts @@ -160,10 +160,9 @@ declare module 'tls' { encrypted: boolean; /** * String containing the selected ALPN protocol. - * Before a handshake has completed, this value is always null. - * When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false. + * When ALPN has no selected protocol, tlsSocket.alpnProtocol equals false. */ - alpnProtocol: string | false | null; + alpnProtocol?: string | undefined; /** * Returns an object representing the local certificate. The returned object has * some properties corresponding to the fields of the certificate. diff --git a/node_modules/@types/node/util.d.ts b/node_modules/@types/node/util.d.ts index b8cb07e..9d8cfe2 100644 --- a/node_modules/@types/node/util.d.ts +++ b/node_modules/@types/node/util.d.ts @@ -141,14 +141,6 @@ declare module 'util' { * @deprecated Since v6.0.0 - Use a third party module instead. */ export function log(string: string): void; - /** - * Returns the `string` after replacing any surrogate code points - * (or equivalently, any unpaired surrogate code units) with the - * Unicode "replacement character" U+FFFD. - * - * @since v16.8.0 - */ - export function toUSVString(string: string): string; /** * The `util.inspect()` method returns a string representation of `object` that is * intended for debugging. The output of `util.inspect` may change at any time diff --git a/node_modules/@types/node/vm.d.ts b/node_modules/@types/node/vm.d.ts index 48d1fc8..9d8b8eb 100644 --- a/node_modules/@types/node/vm.d.ts +++ b/node_modules/@types/node/vm.d.ts @@ -267,11 +267,7 @@ declare module 'vm' { * @since v10.6.0 */ createCachedData(): Buffer; - - /** @deprecated in favor of `script.createCachedData()` */ - cachedDataProduced?: boolean | undefined; cachedDataRejected?: boolean | undefined; - cachedData?: Buffer | undefined; } /** * If given a `contextObject`, the `vm.createContext()` method will `prepare diff --git a/node_modules/accepts/package.json b/node_modules/accepts/package.json index 76d1997..ffb0675 100644 --- a/node_modules/accepts/package.json +++ b/node_modules/accepts/package.json @@ -1,32 +1,37 @@ { - "_from": "accepts@~1.3.4", + "_args": [ + [ + "accepts@1.3.7", + "C:\\Users\\THIS PC\\Documents\\GitHub\\github-basics-RasaraSathmini" + ] + ], + "_from": "accepts@1.3.7", "_id": "accepts@1.3.7", "_inBundle": false, "_integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", "_location": "/accepts", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "accepts@~1.3.4", + "raw": "accepts@1.3.7", "name": "accepts", "escapedName": "accepts", - "rawSpec": "~1.3.4", + "rawSpec": "1.3.7", "saveSpec": null, - "fetchSpec": "~1.3.4" + "fetchSpec": "1.3.7" }, "_requiredBy": [ - "/engine.io", - "/socket.io" + "/compression", + "/express", + "/serve-index" ], "_resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", - "_shasum": "531bc726517a3b2b41f850021c6cc15eaab507cd", - "_spec": "accepts@~1.3.4", - "_where": "C:\\Users\\THIS PC\\Documents\\GitHub\\github-basics-RasaraSathmini\\node_modules\\socket.io", + "_spec": "1.3.7", + "_where": "C:\\Users\\THIS PC\\Documents\\GitHub\\github-basics-RasaraSathmini", "bugs": { "url": "https://github.com/jshttp/accepts/issues" }, - "bundleDependencies": false, "contributors": [ { "name": "Douglas Christopher Wilson", @@ -42,7 +47,6 @@ "mime-types": "~2.1.24", "negotiator": "0.6.2" }, - "deprecated": false, "description": "Higher-level content negotiation", "devDependencies": { "deep-equal": "1.0.1", diff --git a/node_modules/base64-arraybuffer/.npmignore b/node_modules/base64-arraybuffer/.npmignore deleted file mode 100644 index 332ee5a..0000000 --- a/node_modules/base64-arraybuffer/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -/node_modules/ -Gruntfile.js -/test/ diff --git a/node_modules/base64-arraybuffer/.travis.yml b/node_modules/base64-arraybuffer/.travis.yml deleted file mode 100644 index 19259a5..0000000 --- a/node_modules/base64-arraybuffer/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: node_js -node_js: -- '0.12' -- iojs-1 -- iojs-2 -- iojs-3 -- '4.1' -before_script: -- npm install -before_install: npm install -g npm@'>=2.13.5' -deploy: - provider: npm - email: niklasvh@gmail.com - api_key: - secure: oHV9ArprTj5WOk7MP1UF7QMJ70huXw+y7xXb5wF4+V2H8Hyfa5TfE0DiOmqrube1WXTeH1FLgq54shp/sJWi47Hkg/GyeoB5NnsPhYEaJkaON9UG5blML+ODiNVsEnq/1kNBQ8e0+0JItMPLGySKyFmuZ3yflulXKS8O88mfINo= - on: - tags: true - branch: master - repo: niklasvh/base64-arraybuffer diff --git a/node_modules/base64-arraybuffer/LICENSE-MIT b/node_modules/base64-arraybuffer/LICENSE-MIT deleted file mode 100644 index ed27b41..0000000 --- a/node_modules/base64-arraybuffer/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 Niklas von Hertzen - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/base64-arraybuffer/README.md b/node_modules/base64-arraybuffer/README.md deleted file mode 100644 index 50009e4..0000000 --- a/node_modules/base64-arraybuffer/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# base64-arraybuffer - -[![Build Status](https://travis-ci.org/niklasvh/base64-arraybuffer.png)](https://travis-ci.org/niklasvh/base64-arraybuffer) -[![NPM Downloads](https://img.shields.io/npm/dm/base64-arraybuffer.svg)](https://www.npmjs.org/package/base64-arraybuffer) -[![NPM Version](https://img.shields.io/npm/v/base64-arraybuffer.svg)](https://www.npmjs.org/package/base64-arraybuffer) - -Encode/decode base64 data into ArrayBuffers - -## Getting Started -Install the module with: `npm install base64-arraybuffer` - -## API -The library encodes and decodes base64 to and from ArrayBuffers - - - __encode(buffer)__ - Encodes `ArrayBuffer` into base64 string - - __decode(str)__ - Decodes base64 string to `ArrayBuffer` - -## License -Copyright (c) 2012 Niklas von Hertzen -Licensed under the MIT license. diff --git a/node_modules/base64-arraybuffer/lib/base64-arraybuffer.js b/node_modules/base64-arraybuffer/lib/base64-arraybuffer.js deleted file mode 100644 index 362fbfa..0000000 --- a/node_modules/base64-arraybuffer/lib/base64-arraybuffer.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * base64-arraybuffer - * https://github.com/niklasvh/base64-arraybuffer - * - * Copyright (c) 2012 Niklas von Hertzen - * Licensed under the MIT license. - */ -(function(chars){ - "use strict"; - - exports.encode = function(arraybuffer) { - var bytes = new Uint8Array(arraybuffer), - i, len = bytes.length, base64 = ""; - - for (i = 0; i < len; i+=3) { - base64 += chars[bytes[i] >> 2]; - base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)]; - base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)]; - base64 += chars[bytes[i + 2] & 63]; - } - - if ((len % 3) === 2) { - base64 = base64.substring(0, base64.length - 1) + "="; - } else if (len % 3 === 1) { - base64 = base64.substring(0, base64.length - 2) + "=="; - } - - return base64; - }; - - exports.decode = function(base64) { - var bufferLength = base64.length * 0.75, - len = base64.length, i, p = 0, - encoded1, encoded2, encoded3, encoded4; - - if (base64[base64.length - 1] === "=") { - bufferLength--; - if (base64[base64.length - 2] === "=") { - bufferLength--; - } - } - - var arraybuffer = new ArrayBuffer(bufferLength), - bytes = new Uint8Array(arraybuffer); - - for (i = 0; i < len; i+=4) { - encoded1 = chars.indexOf(base64[i]); - encoded2 = chars.indexOf(base64[i+1]); - encoded3 = chars.indexOf(base64[i+2]); - encoded4 = chars.indexOf(base64[i+3]); - - bytes[p++] = (encoded1 << 2) | (encoded2 >> 4); - bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2); - bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63); - } - - return arraybuffer; - }; -})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"); diff --git a/node_modules/base64-arraybuffer/package.json b/node_modules/base64-arraybuffer/package.json deleted file mode 100644 index ee6b5ec..0000000 --- a/node_modules/base64-arraybuffer/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "_from": "base64-arraybuffer@0.1.4", - "_id": "base64-arraybuffer@0.1.4", - "_inBundle": false, - "_integrity": "sha1-mBjHngWbE1X5fgQooBfIOOkLqBI=", - "_location": "/base64-arraybuffer", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "base64-arraybuffer@0.1.4", - "name": "base64-arraybuffer", - "escapedName": "base64-arraybuffer", - "rawSpec": "0.1.4", - "saveSpec": null, - "fetchSpec": "0.1.4" - }, - "_requiredBy": [ - "/engine.io-parser" - ], - "_resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.4.tgz", - "_shasum": "9818c79e059b1355f97e0428a017c838e90ba812", - "_spec": "base64-arraybuffer@0.1.4", - "_where": "C:\\Users\\THIS PC\\Documents\\GitHub\\github-basics-RasaraSathmini\\node_modules\\engine.io-parser", - "author": { - "name": "Niklas von Hertzen", - "email": "niklasvh@gmail.com", - "url": "http://hertzen.com" - }, - "bugs": { - "url": "https://github.com/niklasvh/base64-arraybuffer/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Encode/decode base64 data into ArrayBuffers", - "devDependencies": { - "grunt": "^0.4.5", - "grunt-cli": "^0.1.13", - "grunt-contrib-jshint": "^0.11.2", - "grunt-contrib-nodeunit": "^0.4.1", - "grunt-contrib-watch": "^0.6.1" - }, - "engines": { - "node": ">= 0.6.0" - }, - "homepage": "https://github.com/niklasvh/base64-arraybuffer", - "keywords": [], - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/niklasvh/base64-arraybuffer/blob/master/LICENSE-MIT" - } - ], - "main": "lib/base64-arraybuffer", - "name": "base64-arraybuffer", - "repository": { - "type": "git", - "url": "git+https://github.com/niklasvh/base64-arraybuffer.git" - }, - "scripts": { - "test": "grunt nodeunit" - }, - "version": "0.1.4" -} diff --git a/node_modules/base64id/CHANGELOG.md b/node_modules/base64id/CHANGELOG.md deleted file mode 100644 index b2b8332..0000000 --- a/node_modules/base64id/CHANGELOG.md +++ /dev/null @@ -1,16 +0,0 @@ -# [2.0.0](https://github.com/faeldt/base64id/compare/1.0.0...2.0.0) (2019-05-27) - - -### Code Refactoring - -* **buffer:** replace deprecated Buffer constructor usage ([#11](https://github.com/faeldt/base64id/issues/11)) ([ccfba54](https://github.com/faeldt/base64id/commit/ccfba54)) - - -### BREAKING CHANGES - -* **buffer:** drop support for Node.js ≤ 4.4.x and 5.0.0 - 5.9.x - -See: https://nodejs.org/en/docs/guides/buffer-constructor-deprecation/ - - - diff --git a/node_modules/base64id/LICENSE b/node_modules/base64id/LICENSE deleted file mode 100644 index 0d03c83..0000000 --- a/node_modules/base64id/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2012-2016 Kristian Faeldt - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/base64id/README.md b/node_modules/base64id/README.md deleted file mode 100644 index 17689e6..0000000 --- a/node_modules/base64id/README.md +++ /dev/null @@ -1,18 +0,0 @@ -base64id -======== - -Node.js module that generates a base64 id. - -Uses crypto.randomBytes when available, falls back to unsafe methods for node.js <= 0.4. - -To increase performance, random bytes are buffered to minimize the number of synchronous calls to crypto.randomBytes. - -## Installation - - $ npm install base64id - -## Usage - - var base64id = require('base64id'); - - var id = base64id.generateId(); diff --git a/node_modules/base64id/lib/base64id.js b/node_modules/base64id/lib/base64id.js deleted file mode 100644 index 15afe74..0000000 --- a/node_modules/base64id/lib/base64id.js +++ /dev/null @@ -1,103 +0,0 @@ -/*! - * base64id v0.1.0 - */ - -/** - * Module dependencies - */ - -var crypto = require('crypto'); - -/** - * Constructor - */ - -var Base64Id = function() { }; - -/** - * Get random bytes - * - * Uses a buffer if available, falls back to crypto.randomBytes - */ - -Base64Id.prototype.getRandomBytes = function(bytes) { - - var BUFFER_SIZE = 4096 - var self = this; - - bytes = bytes || 12; - - if (bytes > BUFFER_SIZE) { - return crypto.randomBytes(bytes); - } - - var bytesInBuffer = parseInt(BUFFER_SIZE/bytes); - var threshold = parseInt(bytesInBuffer*0.85); - - if (!threshold) { - return crypto.randomBytes(bytes); - } - - if (this.bytesBufferIndex == null) { - this.bytesBufferIndex = -1; - } - - if (this.bytesBufferIndex == bytesInBuffer) { - this.bytesBuffer = null; - this.bytesBufferIndex = -1; - } - - // No buffered bytes available or index above threshold - if (this.bytesBufferIndex == -1 || this.bytesBufferIndex > threshold) { - - if (!this.isGeneratingBytes) { - this.isGeneratingBytes = true; - crypto.randomBytes(BUFFER_SIZE, function(err, bytes) { - self.bytesBuffer = bytes; - self.bytesBufferIndex = 0; - self.isGeneratingBytes = false; - }); - } - - // Fall back to sync call when no buffered bytes are available - if (this.bytesBufferIndex == -1) { - return crypto.randomBytes(bytes); - } - } - - var result = this.bytesBuffer.slice(bytes*this.bytesBufferIndex, bytes*(this.bytesBufferIndex+1)); - this.bytesBufferIndex++; - - return result; -} - -/** - * Generates a base64 id - * - * (Original version from socket.io ) - */ - -Base64Id.prototype.generateId = function () { - var rand = Buffer.alloc(15); // multiple of 3 for base64 - if (!rand.writeInt32BE) { - return Math.abs(Math.random() * Math.random() * Date.now() | 0).toString() - + Math.abs(Math.random() * Math.random() * Date.now() | 0).toString(); - } - this.sequenceNumber = (this.sequenceNumber + 1) | 0; - rand.writeInt32BE(this.sequenceNumber, 11); - if (crypto.randomBytes) { - this.getRandomBytes(12).copy(rand); - } else { - // not secure for node 0.4 - [0, 4, 8].forEach(function(i) { - rand.writeInt32BE(Math.random() * Math.pow(2, 32) | 0, i); - }); - } - return rand.toString('base64').replace(/\//g, '_').replace(/\+/g, '-'); -}; - -/** - * Export - */ - -exports = module.exports = new Base64Id(); diff --git a/node_modules/base64id/package.json b/node_modules/base64id/package.json deleted file mode 100644 index d2bdce2..0000000 --- a/node_modules/base64id/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "_from": "base64id@~2.0.0", - "_id": "base64id@2.0.0", - "_inBundle": false, - "_integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", - "_location": "/base64id", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "base64id@~2.0.0", - "name": "base64id", - "escapedName": "base64id", - "rawSpec": "~2.0.0", - "saveSpec": null, - "fetchSpec": "~2.0.0" - }, - "_requiredBy": [ - "/engine.io", - "/socket.io" - ], - "_resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", - "_shasum": "2770ac6bc47d312af97a8bf9a634342e0cd25cb6", - "_spec": "base64id@~2.0.0", - "_where": "C:\\Users\\THIS PC\\Documents\\GitHub\\github-basics-RasaraSathmini\\node_modules\\socket.io", - "author": { - "name": "Kristian Faeldt", - "email": "faeldt_kristian@cyberagent.co.jp" - }, - "bugs": { - "url": "https://github.com/faeldt/base64id/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Generates a base64 id", - "engines": { - "node": "^4.5.0 || >= 5.9" - }, - "homepage": "https://github.com/faeldt/base64id#readme", - "license": "MIT", - "main": "./lib/base64id.js", - "name": "base64id", - "repository": { - "type": "git", - "url": "git+https://github.com/faeldt/base64id.git" - }, - "version": "2.0.0" -} diff --git a/node_modules/component-emitter/package.json b/node_modules/component-emitter/package.json index 9875884..b5d1d02 100644 --- a/node_modules/component-emitter/package.json +++ b/node_modules/component-emitter/package.json @@ -1,37 +1,41 @@ { - "_from": "component-emitter@~1.3.0", + "_args": [ + [ + "component-emitter@1.3.0", + "C:\\Users\\THIS PC\\Documents\\GitHub\\github-basics-RasaraSathmini" + ] + ], + "_from": "component-emitter@1.3.0", "_id": "component-emitter@1.3.0", "_inBundle": false, "_integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", "_location": "/component-emitter", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "component-emitter@~1.3.0", + "raw": "component-emitter@1.3.0", "name": "component-emitter", "escapedName": "component-emitter", - "rawSpec": "~1.3.0", + "rawSpec": "1.3.0", "saveSpec": null, - "fetchSpec": "~1.3.0" + "fetchSpec": "1.3.0" }, "_requiredBy": [ - "/socket.io-parser" + "/base", + "/cache-base" ], "_resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "_shasum": "16e4070fba8ae29b679f2215853ee181ab2eabc0", - "_spec": "component-emitter@~1.3.0", - "_where": "C:\\Users\\THIS PC\\Documents\\GitHub\\github-basics-RasaraSathmini\\node_modules\\socket.io-parser", + "_spec": "1.3.0", + "_where": "C:\\Users\\THIS PC\\Documents\\GitHub\\github-basics-RasaraSathmini", "bugs": { "url": "https://github.com/component/emitter/issues" }, - "bundleDependencies": false, "component": { "scripts": { "emitter/index.js": "index.js" } }, - "deprecated": false, "description": "Event emitter", "devDependencies": { "mocha": "*", diff --git a/node_modules/cookie/HISTORY.md b/node_modules/cookie/HISTORY.md index ce080e0..da2bf24 100644 --- a/node_modules/cookie/HISTORY.md +++ b/node_modules/cookie/HISTORY.md @@ -1,8 +1,3 @@ -0.4.1 / 2020-04-21 -================== - - * Fix `maxAge` option to reject invalid values - 0.4.0 / 2019-05-15 ================== diff --git a/node_modules/cookie/README.md b/node_modules/cookie/README.md index 18b2c2c..857fb77 100644 --- a/node_modules/cookie/README.md +++ b/node_modules/cookie/README.md @@ -10,10 +10,6 @@ Basic HTTP cookie parser and serializer for HTTP servers. ## Installation -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - ```sh $ npm install cookie ``` diff --git a/node_modules/cookie/index.js b/node_modules/cookie/index.js index 760f32e..16f56c0 100644 --- a/node_modules/cookie/index.js +++ b/node_modules/cookie/index.js @@ -120,11 +120,7 @@ function serialize(name, val, options) { if (null != opt.maxAge) { var maxAge = opt.maxAge - 0; - - if (isNaN(maxAge) || !isFinite(maxAge)) { - throw new TypeError('option maxAge is invalid') - } - + if (isNaN(maxAge)) throw new Error('maxAge should be a Number'); str += '; Max-Age=' + Math.floor(maxAge); } diff --git a/node_modules/cookie/package.json b/node_modules/cookie/package.json index ddbe0ae..6d1d271 100644 --- a/node_modules/cookie/package.json +++ b/node_modules/cookie/package.json @@ -1,27 +1,32 @@ { - "_from": "cookie@~0.4.1", - "_id": "cookie@0.4.1", + "_args": [ + [ + "cookie@0.4.0", + "C:\\Users\\THIS PC\\Documents\\GitHub\\github-basics-RasaraSathmini" + ] + ], + "_from": "cookie@0.4.0", + "_id": "cookie@0.4.0", "_inBundle": false, - "_integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==", + "_integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", "_location": "/cookie", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "cookie@~0.4.1", + "raw": "cookie@0.4.0", "name": "cookie", "escapedName": "cookie", - "rawSpec": "~0.4.1", + "rawSpec": "0.4.0", "saveSpec": null, - "fetchSpec": "~0.4.1" + "fetchSpec": "0.4.0" }, "_requiredBy": [ - "/engine.io" + "/express" ], - "_resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", - "_shasum": "afd713fe26ebd21ba95ceb61f9a8116e50a537d1", - "_spec": "cookie@~0.4.1", - "_where": "C:\\Users\\THIS PC\\Documents\\GitHub\\github-basics-RasaraSathmini\\node_modules\\engine.io", + "_resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "_spec": "0.4.0", + "_where": "C:\\Users\\THIS PC\\Documents\\GitHub\\github-basics-RasaraSathmini", "author": { "name": "Roman Shtylman", "email": "shtylman@gmail.com" @@ -29,22 +34,20 @@ "bugs": { "url": "https://github.com/jshttp/cookie/issues" }, - "bundleDependencies": false, "contributors": [ { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" } ], - "deprecated": false, "description": "HTTP server cookie parsing and serialization", "devDependencies": { "beautify-benchmark": "0.2.4", "benchmark": "2.1.4", - "eslint": "6.8.0", - "eslint-plugin-markdown": "1.0.2", - "mocha": "7.1.1", - "nyc": "15.0.1" + "eslint": "5.16.0", + "eslint-plugin-markdown": "1.0.0", + "istanbul": "0.4.5", + "mocha": "6.1.4" }, "engines": { "node": ">= 0.6" @@ -69,10 +72,10 @@ "scripts": { "bench": "node benchmark/index.js", "lint": "eslint --plugin markdown --ext js,md .", - "test": "mocha --reporter spec --bail --check-leaks --ui qunit test/", - "test-ci": "nyc --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test", + "test": "mocha --reporter spec --bail --check-leaks 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": "node scripts/version-history.js && git add HISTORY.md" }, - "version": "0.4.1" + "version": "0.4.0" } diff --git a/node_modules/cors/CONTRIBUTING.md b/node_modules/cors/CONTRIBUTING.md deleted file mode 100644 index 591b09a..0000000 --- a/node_modules/cors/CONTRIBUTING.md +++ /dev/null @@ -1,33 +0,0 @@ -# contributing to `cors` - -CORS is a node.js package for providing a [connect](http://www.senchalabs.org/connect/)/[express](http://expressjs.com/) middleware that can be used to enable [CORS](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing) with various options. Learn more about the project in [the README](README.md). - -## The CORS Spec - -[http://www.w3.org/TR/cors/](http://www.w3.org/TR/cors/) - -## Pull Requests Welcome - -* Include `'use strict';` in every javascript file. -* 2 space indentation. -* Please run the testing steps below before submitting. - -## Testing - -```bash -$ npm install -$ npm test -``` - -## Interactive Testing Harness - -[http://node-cors-client.herokuapp.com](http://node-cors-client.herokuapp.com) - -Related git repositories: - -* [https://github.com/TroyGoode/node-cors-server](https://github.com/TroyGoode/node-cors-server) -* [https://github.com/TroyGoode/node-cors-client](https://github.com/TroyGoode/node-cors-client) - -## License - -[MIT License](http://www.opensource.org/licenses/mit-license.php) diff --git a/node_modules/cors/HISTORY.md b/node_modules/cors/HISTORY.md deleted file mode 100644 index 5762bce..0000000 --- a/node_modules/cors/HISTORY.md +++ /dev/null @@ -1,58 +0,0 @@ -2.8.5 / 2018-11-04 -================== - - * Fix setting `maxAge` option to `0` - -2.8.4 / 2017-07-12 -================== - - * Work-around Safari bug in default pre-flight response - -2.8.3 / 2017-03-29 -================== - - * Fix error when options delegate missing `methods` option - -2.8.2 / 2017-03-28 -================== - - * Fix error when frozen options are passed - * Send "Vary: Origin" when using regular expressions - * Send "Vary: Access-Control-Request-Headers" when dynamic `allowedHeaders` - -2.8.1 / 2016-09-08 -================== - -This release only changed documentation. - -2.8.0 / 2016-08-23 -================== - - * Add `optionsSuccessStatus` option - -2.7.2 / 2016-08-23 -================== - - * Fix error when Node.js running in strict mode - -2.7.1 / 2015-05-28 -================== - - * Move module into expressjs organization - -2.7.0 / 2015-05-28 -================== - - * Allow array of matching condition as `origin` option - * Allow regular expression as `origin` option - -2.6.1 / 2015-05-28 -================== - - * Update `license` in package.json - -2.6.0 / 2015-04-27 -================== - - * Add `preflightContinue` option - * Fix "Vary: Origin" header added for "*" diff --git a/node_modules/cors/LICENSE b/node_modules/cors/LICENSE deleted file mode 100644 index fd10c84..0000000 --- a/node_modules/cors/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2013 Troy Goode - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/cors/README.md b/node_modules/cors/README.md deleted file mode 100644 index 732b847..0000000 --- a/node_modules/cors/README.md +++ /dev/null @@ -1,243 +0,0 @@ -# cors - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -CORS is a node.js package for providing a [Connect](http://www.senchalabs.org/connect/)/[Express](http://expressjs.com/) middleware that can be used to enable [CORS](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing) with various options. - -**[Follow me (@troygoode) on Twitter!](https://twitter.com/intent/user?screen_name=troygoode)** - -* [Installation](#installation) -* [Usage](#usage) - * [Simple Usage](#simple-usage-enable-all-cors-requests) - * [Enable CORS for a Single Route](#enable-cors-for-a-single-route) - * [Configuring CORS](#configuring-cors) - * [Configuring CORS Asynchronously](#configuring-cors-asynchronously) - * [Enabling CORS Pre-Flight](#enabling-cors-pre-flight) -* [Configuration Options](#configuration-options) -* [Demo](#demo) -* [License](#license) -* [Author](#author) - -## Installation - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```sh -$ npm install cors -``` - -## Usage - -### Simple Usage (Enable *All* CORS Requests) - -```javascript -var express = require('express') -var cors = require('cors') -var app = express() - -app.use(cors()) - -app.get('/products/:id', function (req, res, next) { - res.json({msg: 'This is CORS-enabled for all origins!'}) -}) - -app.listen(80, function () { - console.log('CORS-enabled web server listening on port 80') -}) -``` - -### Enable CORS for a Single Route - -```javascript -var express = require('express') -var cors = require('cors') -var app = express() - -app.get('/products/:id', cors(), function (req, res, next) { - res.json({msg: 'This is CORS-enabled for a Single Route'}) -}) - -app.listen(80, function () { - console.log('CORS-enabled web server listening on port 80') -}) -``` - -### Configuring CORS - -```javascript -var express = require('express') -var cors = require('cors') -var app = express() - -var corsOptions = { - origin: 'http://example.com', - optionsSuccessStatus: 200 // some legacy browsers (IE11, various SmartTVs) choke on 204 -} - -app.get('/products/:id', cors(corsOptions), function (req, res, next) { - res.json({msg: 'This is CORS-enabled for only example.com.'}) -}) - -app.listen(80, function () { - console.log('CORS-enabled web server listening on port 80') -}) -``` - -### Configuring CORS w/ Dynamic Origin - -```javascript -var express = require('express') -var cors = require('cors') -var app = express() - -var whitelist = ['http://example1.com', 'http://example2.com'] -var corsOptions = { - origin: function (origin, callback) { - if (whitelist.indexOf(origin) !== -1) { - callback(null, true) - } else { - callback(new Error('Not allowed by CORS')) - } - } -} - -app.get('/products/:id', cors(corsOptions), function (req, res, next) { - res.json({msg: 'This is CORS-enabled for a whitelisted domain.'}) -}) - -app.listen(80, function () { - console.log('CORS-enabled web server listening on port 80') -}) -``` - -If you do not want to block REST tools or server-to-server requests, -add a `!origin` check in the origin function like so: - -```javascript -var corsOptions = { - origin: function (origin, callback) { - if (whitelist.indexOf(origin) !== -1 || !origin) { - callback(null, true) - } else { - callback(new Error('Not allowed by CORS')) - } - } -} -``` - -### Enabling CORS Pre-Flight - -Certain CORS requests are considered 'complex' and require an initial -`OPTIONS` request (called the "pre-flight request"). An example of a -'complex' CORS request is one that uses an HTTP verb other than -GET/HEAD/POST (such as DELETE) or that uses custom headers. To enable -pre-flighting, you must add a new OPTIONS handler for the route you want -to support: - -```javascript -var express = require('express') -var cors = require('cors') -var app = express() - -app.options('/products/:id', cors()) // enable pre-flight request for DELETE request -app.del('/products/:id', cors(), function (req, res, next) { - res.json({msg: 'This is CORS-enabled for all origins!'}) -}) - -app.listen(80, function () { - console.log('CORS-enabled web server listening on port 80') -}) -``` - -You can also enable pre-flight across-the-board like so: - -```javascript -app.options('*', cors()) // include before other routes -``` - -### Configuring CORS Asynchronously - -```javascript -var express = require('express') -var cors = require('cors') -var app = express() - -var whitelist = ['http://example1.com', 'http://example2.com'] -var corsOptionsDelegate = function (req, callback) { - var corsOptions; - if (whitelist.indexOf(req.header('Origin')) !== -1) { - corsOptions = { origin: true } // reflect (enable) the requested origin in the CORS response - } else { - corsOptions = { origin: false } // disable CORS for this request - } - callback(null, corsOptions) // callback expects two parameters: error and options -} - -app.get('/products/:id', cors(corsOptionsDelegate), function (req, res, next) { - res.json({msg: 'This is CORS-enabled for a whitelisted domain.'}) -}) - -app.listen(80, function () { - console.log('CORS-enabled web server listening on port 80') -}) -``` - -## Configuration Options - -* `origin`: Configures the **Access-Control-Allow-Origin** CORS header. Possible values: - - `Boolean` - set `origin` to `true` to reflect the [request origin](http://tools.ietf.org/html/draft-abarth-origin-09), as defined by `req.header('Origin')`, or set it to `false` to disable CORS. - - `String` - set `origin` to a specific origin. For example if you set it to `"http://example.com"` only requests from "http://example.com" will be allowed. - - `RegExp` - set `origin` to a regular expression pattern which will be used to test the request origin. If it's a match, the request origin will be reflected. For example the pattern `/example\.com$/` will reflect any request that is coming from an origin ending with "example.com". - - `Array` - set `origin` to an array of valid origins. Each origin can be a `String` or a `RegExp`. For example `["http://example1.com", /\.example2\.com$/]` will accept any request from "http://example1.com" or from a subdomain of "example2.com". - - `Function` - set `origin` to a function implementing some custom logic. The function takes the request origin as the first parameter and a callback (which expects the signature `err [object], allow [bool]`) as the second. -* `methods`: Configures the **Access-Control-Allow-Methods** CORS header. Expects a comma-delimited string (ex: 'GET,PUT,POST') or an array (ex: `['GET', 'PUT', 'POST']`). -* `allowedHeaders`: Configures the **Access-Control-Allow-Headers** CORS header. Expects a comma-delimited string (ex: 'Content-Type,Authorization') or an array (ex: `['Content-Type', 'Authorization']`). If not specified, defaults to reflecting the headers specified in the request's **Access-Control-Request-Headers** header. -* `exposedHeaders`: Configures the **Access-Control-Expose-Headers** CORS header. Expects a comma-delimited string (ex: 'Content-Range,X-Content-Range') or an array (ex: `['Content-Range', 'X-Content-Range']`). If not specified, no custom headers are exposed. -* `credentials`: Configures the **Access-Control-Allow-Credentials** CORS header. Set to `true` to pass the header, otherwise it is omitted. -* `maxAge`: Configures the **Access-Control-Max-Age** CORS header. Set to an integer to pass the header, otherwise it is omitted. -* `preflightContinue`: Pass the CORS preflight response to the next handler. -* `optionsSuccessStatus`: Provides a status code to use for successful `OPTIONS` requests, since some legacy browsers (IE11, various SmartTVs) choke on `204`. - -The default configuration is the equivalent of: - -```json -{ - "origin": "*", - "methods": "GET,HEAD,PUT,PATCH,POST,DELETE", - "preflightContinue": false, - "optionsSuccessStatus": 204 -} -``` - -For details on the effect of each CORS header, read [this](http://www.html5rocks.com/en/tutorials/cors/) article on HTML5 Rocks. - -## Demo - -A demo that illustrates CORS working (and not working) using jQuery is available here: [http://node-cors-client.herokuapp.com/](http://node-cors-client.herokuapp.com/) - -Code for that demo can be found here: - -* Client: [https://github.com/TroyGoode/node-cors-client](https://github.com/TroyGoode/node-cors-client) -* Server: [https://github.com/TroyGoode/node-cors-server](https://github.com/TroyGoode/node-cors-server) - -## License - -[MIT License](http://www.opensource.org/licenses/mit-license.php) - -## Author - -[Troy Goode](https://github.com/TroyGoode) ([troygoode@gmail.com](mailto:troygoode@gmail.com)) - -[coveralls-image]: https://img.shields.io/coveralls/expressjs/cors/master.svg -[coveralls-url]: https://coveralls.io/r/expressjs/cors?branch=master -[downloads-image]: https://img.shields.io/npm/dm/cors.svg -[downloads-url]: https://npmjs.org/package/cors -[npm-image]: https://img.shields.io/npm/v/cors.svg -[npm-url]: https://npmjs.org/package/cors -[travis-image]: https://img.shields.io/travis/expressjs/cors/master.svg -[travis-url]: https://travis-ci.org/expressjs/cors diff --git a/node_modules/cors/lib/index.js b/node_modules/cors/lib/index.js deleted file mode 100644 index 5475aec..0000000 --- a/node_modules/cors/lib/index.js +++ /dev/null @@ -1,238 +0,0 @@ -(function () { - - 'use strict'; - - var assign = require('object-assign'); - var vary = require('vary'); - - var defaults = { - origin: '*', - methods: 'GET,HEAD,PUT,PATCH,POST,DELETE', - preflightContinue: false, - optionsSuccessStatus: 204 - }; - - function isString(s) { - return typeof s === 'string' || s instanceof String; - } - - function isOriginAllowed(origin, allowedOrigin) { - if (Array.isArray(allowedOrigin)) { - for (var i = 0; i < allowedOrigin.length; ++i) { - if (isOriginAllowed(origin, allowedOrigin[i])) { - return true; - } - } - return false; - } else if (isString(allowedOrigin)) { - return origin === allowedOrigin; - } else if (allowedOrigin instanceof RegExp) { - return allowedOrigin.test(origin); - } else { - return !!allowedOrigin; - } - } - - function configureOrigin(options, req) { - var requestOrigin = req.headers.origin, - headers = [], - isAllowed; - - if (!options.origin || options.origin === '*') { - // allow any origin - headers.push([{ - key: 'Access-Control-Allow-Origin', - value: '*' - }]); - } else if (isString(options.origin)) { - // fixed origin - headers.push([{ - key: 'Access-Control-Allow-Origin', - value: options.origin - }]); - headers.push([{ - key: 'Vary', - value: 'Origin' - }]); - } else { - isAllowed = isOriginAllowed(requestOrigin, options.origin); - // reflect origin - headers.push([{ - key: 'Access-Control-Allow-Origin', - value: isAllowed ? requestOrigin : false - }]); - headers.push([{ - key: 'Vary', - value: 'Origin' - }]); - } - - return headers; - } - - function configureMethods(options) { - var methods = options.methods; - if (methods.join) { - methods = options.methods.join(','); // .methods is an array, so turn it into a string - } - return { - key: 'Access-Control-Allow-Methods', - value: methods - }; - } - - function configureCredentials(options) { - if (options.credentials === true) { - return { - key: 'Access-Control-Allow-Credentials', - value: 'true' - }; - } - return null; - } - - function configureAllowedHeaders(options, req) { - var allowedHeaders = options.allowedHeaders || options.headers; - var headers = []; - - if (!allowedHeaders) { - allowedHeaders = req.headers['access-control-request-headers']; // .headers wasn't specified, so reflect the request headers - headers.push([{ - key: 'Vary', - value: 'Access-Control-Request-Headers' - }]); - } else if (allowedHeaders.join) { - allowedHeaders = allowedHeaders.join(','); // .headers is an array, so turn it into a string - } - if (allowedHeaders && allowedHeaders.length) { - headers.push([{ - key: 'Access-Control-Allow-Headers', - value: allowedHeaders - }]); - } - - return headers; - } - - function configureExposedHeaders(options) { - var headers = options.exposedHeaders; - if (!headers) { - return null; - } else if (headers.join) { - headers = headers.join(','); // .headers is an array, so turn it into a string - } - if (headers && headers.length) { - return { - key: 'Access-Control-Expose-Headers', - value: headers - }; - } - return null; - } - - function configureMaxAge(options) { - var maxAge = (typeof options.maxAge === 'number' || options.maxAge) && options.maxAge.toString() - if (maxAge && maxAge.length) { - return { - key: 'Access-Control-Max-Age', - value: maxAge - }; - } - return null; - } - - function applyHeaders(headers, res) { - for (var i = 0, n = headers.length; i < n; i++) { - var header = headers[i]; - if (header) { - if (Array.isArray(header)) { - applyHeaders(header, res); - } else if (header.key === 'Vary' && header.value) { - vary(res, header.value); - } else if (header.value) { - res.setHeader(header.key, header.value); - } - } - } - } - - function cors(options, req, res, next) { - var headers = [], - method = req.method && req.method.toUpperCase && req.method.toUpperCase(); - - if (method === 'OPTIONS') { - // preflight - headers.push(configureOrigin(options, req)); - headers.push(configureCredentials(options, req)); - headers.push(configureMethods(options, req)); - headers.push(configureAllowedHeaders(options, req)); - headers.push(configureMaxAge(options, req)); - headers.push(configureExposedHeaders(options, req)); - applyHeaders(headers, res); - - if (options.preflightContinue) { - next(); - } else { - // Safari (and potentially other browsers) need content-length 0, - // for 204 or they just hang waiting for a body - res.statusCode = options.optionsSuccessStatus; - res.setHeader('Content-Length', '0'); - res.end(); - } - } else { - // actual response - headers.push(configureOrigin(options, req)); - headers.push(configureCredentials(options, req)); - headers.push(configureExposedHeaders(options, req)); - applyHeaders(headers, res); - next(); - } - } - - function middlewareWrapper(o) { - // if options are static (either via defaults or custom options passed in), wrap in a function - var optionsCallback = null; - if (typeof o === 'function') { - optionsCallback = o; - } else { - optionsCallback = function (req, cb) { - cb(null, o); - }; - } - - return function corsMiddleware(req, res, next) { - optionsCallback(req, function (err, options) { - if (err) { - next(err); - } else { - var corsOptions = assign({}, defaults, options); - var originCallback = null; - if (corsOptions.origin && typeof corsOptions.origin === 'function') { - originCallback = corsOptions.origin; - } else if (corsOptions.origin) { - originCallback = function (origin, cb) { - cb(null, corsOptions.origin); - }; - } - - if (originCallback) { - originCallback(req.headers.origin, function (err2, origin) { - if (err2 || !origin) { - next(err2); - } else { - corsOptions.origin = origin; - cors(corsOptions, req, res, next); - } - }); - } else { - next(); - } - } - }); - }; - } - - // can pass either an options hash, an options delegate, or nothing - module.exports = middlewareWrapper; - -}()); diff --git a/node_modules/cors/package.json b/node_modules/cors/package.json deleted file mode 100644 index 6596e3a..0000000 --- a/node_modules/cors/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_from": "cors@~2.8.5", - "_id": "cors@2.8.5", - "_inBundle": false, - "_integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", - "_location": "/cors", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "cors@~2.8.5", - "name": "cors", - "escapedName": "cors", - "rawSpec": "~2.8.5", - "saveSpec": null, - "fetchSpec": "~2.8.5" - }, - "_requiredBy": [ - "/engine.io" - ], - "_resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "_shasum": "eac11da51592dd86b9f06f6e7ac293b3df875d29", - "_spec": "cors@~2.8.5", - "_where": "C:\\Users\\THIS PC\\Documents\\GitHub\\github-basics-RasaraSathmini\\node_modules\\engine.io", - "author": { - "name": "Troy Goode", - "email": "troygoode@gmail.com", - "url": "https://github.com/troygoode/" - }, - "bugs": { - "url": "https://github.com/expressjs/cors/issues" - }, - "bundleDependencies": false, - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "deprecated": false, - "description": "Node.js CORS middleware", - "devDependencies": { - "after": "0.8.2", - "eslint": "2.13.1", - "express": "4.16.3", - "mocha": "5.2.0", - "nyc": "13.1.0", - "supertest": "3.3.0" - }, - "engines": { - "node": ">= 0.10" - }, - "files": [ - "lib/index.js", - "CONTRIBUTING.md", - "HISTORY.md", - "LICENSE", - "README.md" - ], - "homepage": "https://github.com/expressjs/cors#readme", - "keywords": [ - "cors", - "express", - "connect", - "middleware" - ], - "license": "MIT", - "main": "./lib/index.js", - "name": "cors", - "repository": { - "type": "git", - "url": "git+https://github.com/expressjs/cors.git" - }, - "scripts": { - "lint": "eslint lib test", - "test": "npm run lint && nyc --reporter=html --reporter=text mocha --require test/support/env" - }, - "version": "2.8.5" -} diff --git a/node_modules/debug/package.json b/node_modules/debug/package.json index e9560f7..3a73d78 100644 --- a/node_modules/debug/package.json +++ b/node_modules/debug/package.json @@ -1,29 +1,48 @@ { - "_from": "debug@~4.3.2", + "_args": [ + [ + "debug@4.3.2", + "C:\\Users\\THIS PC\\Documents\\GitHub\\github-basics-RasaraSathmini" + ] + ], + "_from": "debug@4.3.2", "_id": "debug@4.3.2", "_inBundle": false, "_integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "_location": "/debug", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "debug@~4.3.2", + "raw": "debug@4.3.2", "name": "debug", "escapedName": "debug", - "rawSpec": "~4.3.2", + "rawSpec": "4.3.2", "saveSpec": null, - "fetchSpec": "~4.3.2" + "fetchSpec": "4.3.2" }, "_requiredBy": [ - "/engine.io", - "/socket.io", - "/socket.io-parser" + "/@babel/core", + "/@babel/helper-define-polyfill-provider", + "/@babel/traverse", + "/@eslint/eslintrc", + "/@humanwhocodes/config-array", + "/@typescript-eslint/eslint-plugin", + "/@typescript-eslint/parser", + "/@typescript-eslint/typescript-estree", + "/agent-base", + "/eslint", + "/eslint-plugin-testing-library/@typescript-eslint/typescript-estree", + "/http-proxy-agent", + "/https-proxy-agent", + "/istanbul-lib-source-maps", + "/spdy", + "/spdy-transport", + "/webpack-dev-server" ], "_resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "_shasum": "f0a49c18ac8779e31d4a0c6029dfb76873c7428b", - "_spec": "debug@~4.3.2", - "_where": "C:\\Users\\THIS PC\\Documents\\GitHub\\github-basics-RasaraSathmini\\node_modules\\socket.io", + "_spec": "4.3.2", + "_where": "C:\\Users\\THIS PC\\Documents\\GitHub\\github-basics-RasaraSathmini", "author": { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" @@ -32,7 +51,6 @@ "bugs": { "url": "https://github.com/visionmedia/debug/issues" }, - "bundleDependencies": false, "contributors": [ { "name": "Nathan Rajlich", @@ -51,7 +69,6 @@ "dependencies": { "ms": "2.1.2" }, - "deprecated": false, "description": "small debugging utility", "devDependencies": { "brfs": "^2.0.1", diff --git a/node_modules/engine.io-parser/CHANGELOG.md b/node_modules/engine.io-parser/CHANGELOG.md deleted file mode 100644 index f2363d2..0000000 --- a/node_modules/engine.io-parser/CHANGELOG.md +++ /dev/null @@ -1,108 +0,0 @@ -## [4.0.3](https://github.com/socketio/engine.io-parser/compare/4.0.2...4.0.3) (2021-08-29) - - -### Bug Fixes - -* respect the offset and length of TypedArray objects ([6d7dd76](https://github.com/socketio/engine.io-parser/commit/6d7dd76130690afda6c214d5c04305d2bbc4eb4d)) - - -## [4.0.2](https://github.com/socketio/engine.io-parser/compare/4.0.1...4.0.2) (2020-12-07) - - -### Bug Fixes - -* add base64-arraybuffer as prod dependency ([2ccdeb2](https://github.com/socketio/engine.io-parser/commit/2ccdeb277955bed8742a29f2dcbbf57ca95eb12a)) - - -## [2.2.1](https://github.com/socketio/engine.io-parser/compare/2.2.0...2.2.1) (2020-09-30) - - -## [4.0.1](https://github.com/socketio/engine.io-parser/compare/4.0.0...4.0.1) (2020-09-10) - - -### Bug Fixes - -* use a terser-compatible representation of the separator ([886f9ea](https://github.com/socketio/engine.io-parser/commit/886f9ea7c4e717573152c31320f6fb6c6664061b)) - - -# [4.0.0](https://github.com/socketio/engine.io-parser/compare/v4.0.0-alpha.1...4.0.0) (2020-09-08) - -This major release contains the necessary changes for the version 4 of the Engine.IO protocol. More information about the new version can be found [there](https://github.com/socketio/engine.io-protocol#difference-between-v3-and-v4). - -Encoding changes between v3 and v4: - -- encodePacket with string - - input: `{ type: "message", data: "hello" }` - - output in v3: `"4hello"` - - output in v4: `"4hello"` - -- encodePacket with binary - - input: `{ type: 'message', data: }` - - output in v3: `` - - output in v4: `` - -- encodePayload with strings - - input: `[ { type: 'message', data: 'hello' }, { type: 'message', data: '€€€' } ]` - - output in v3: `"6:4hello4:4€€€"` - - output in v4: `"4hello\x1e4€€€"` - -- encodePayload with string and binary - - input: `[ { type: 'message', data: 'hello' }, { type: 'message', data: } ]` - - output in v3: `` - - output in v4: `"4hello\x1ebAQID"` - -Please note that the parser is now dependency-free! This should help reduce the size of the browser bundle. - -### Bug Fixes - -* keep track of the buffer initial length ([8edf2d1](https://github.com/socketio/engine.io-parser/commit/8edf2d1478026da442f519c2d2521af43ba01832)) - - -### Features - -* restore the upgrade mechanism ([6efedfa](https://github.com/socketio/engine.io-parser/commit/6efedfa0f3048506a4ba99e70674ddf4c0732e0c)) - - - -# [4.0.0-alpha.1](https://github.com/socketio/engine.io-parser/compare/v4.0.0-alpha.0...v4.0.0-alpha.1) (2020-05-19) - - -### Features - -* implement the version 4 of the protocol ([cab7db0](https://github.com/socketio/engine.io-parser/commit/cab7db0404e0a69f86a05ececd62c8c31f4d97d5)) - - - -# [4.0.0-alpha.0](https://github.com/socketio/engine.io-parser/compare/2.2.0...v4.0.0-alpha.0) (2020-02-04) - - -### Bug Fixes - -* properly decode binary packets ([5085373](https://github.com/socketio/engine.io-parser/commit/50853738e0c6c16f9cee0d7887651155f4b78240)) - - -### Features - -* remove packet type when encoding binary packets ([a947ae5](https://github.com/socketio/engine.io-parser/commit/a947ae59a2844e4041db58ff36b270d1528b3bee)) - - -### BREAKING CHANGES - -* the packet containing binary data will now be sent without any transformation - -Protocol v3: { type: 'message', data: } => -Protocol v4: { type: 'message', data: } => - - - -# [2.2.0](https://github.com/socketio/engine.io-parser/compare/2.1.3...2.2.0) (2019-09-13) - - -* [refactor] Use `Buffer.allocUnsafe` instead of `new Buffer` (#104) ([aedf8eb](https://github.com/socketio/engine.io-parser/commit/aedf8eb29e8bf6aeb5c6cc68965d986c4c958ae2)), closes [#104](https://github.com/socketio/engine.io-parser/issues/104) - - -### BREAKING CHANGES - -* drop support for Node.js 4 (since Buffer.allocUnsafe was added in v5.10.0) - -Reference: https://nodejs.org/docs/latest/api/buffer.html#buffer_class_method_buffer_allocunsafe_size diff --git a/node_modules/engine.io-parser/LICENSE b/node_modules/engine.io-parser/LICENSE deleted file mode 100644 index d8fdaec..0000000 --- a/node_modules/engine.io-parser/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2016 Guillermo Rauch (@rauchg) - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/engine.io-parser/Readme.md b/node_modules/engine.io-parser/Readme.md deleted file mode 100644 index 9c57c5e..0000000 --- a/node_modules/engine.io-parser/Readme.md +++ /dev/null @@ -1,158 +0,0 @@ - -# engine.io-parser - -[![Build Status](https://github.com/socketio/engine.io-parser/workflows/CI/badge.svg)](https://github.com/socketio/engine.io-parser/actions) -[![NPM version](https://badge.fury.io/js/engine.io-parser.svg)](https://npmjs.com/package/engine.io-parser) - -This is the JavaScript parser for the engine.io protocol encoding, -shared by both -[engine.io-client](https://github.com/socketio/engine.io-client) and -[engine.io](https://github.com/socketio/engine.io). - -## How to use - -### Standalone - -The parser can encode/decode packets, payloads, and payloads as binary -with the following methods: `encodePacket`, `decodePacket`, `encodePayload`, -`decodePayload`. - -Example: - -```js -const parser = require("engine.io-parser"); -const data = Buffer.from([ 1, 2, 3, 4 ]); - -parser.encodePacket({ type: "message", data }, encoded => { - const decodedData = parser.decodePacket(encoded); // decodedData === data -}); -``` - -### With browserify - -Engine.IO Parser is a commonjs module, which means you can include it by using -`require` on the browser and package using [browserify](http://browserify.org/): - -1. install the parser package - - ```shell - npm install engine.io-parser - ``` - -1. write your app code - - ```js - const parser = require("engine.io-parser"); - - const testBuffer = new Int8Array(10); - for (let i = 0; i < testBuffer.length; i++) testBuffer[i] = i; - - const packets = [{ type: "message", data: testBuffer.buffer }, { type: "message", data: "hello" }]; - - parser.encodePayload(packets, encoded => { - parser.decodePayload(encoded, - (packet, index, total) => { - const isLast = index + 1 == total; - if (!isLast) { - const buffer = new Int8Array(packet.data); // testBuffer - } else { - const message = packet.data; // "hello" - } - }); - }); - ``` - -1. build your app bundle - - ```bash - $ browserify app.js > bundle.js - ``` - -1. include on your page - - ```html - - ``` - -## Features - -- Runs on browser and node.js seamlessly -- Runs inside HTML5 WebWorker -- Can encode and decode packets - - Encodes from/to ArrayBuffer or Blob when in browser, and Buffer or ArrayBuffer in Node - -## API - -Note: `cb(type)` means the type is a callback function that contains a parameter of type `type` when called. - -### Node - -- `encodePacket` - - Encodes a packet. - - **Parameters** - - `Object`: the packet to encode, has `type` and `data`. - - `data`: can be a `String`, `Number`, `Buffer`, `ArrayBuffer` - - `Boolean`: binary support - - `Function`: callback, returns the encoded packet (`cb(String)`) -- `decodePacket` - - Decodes a packet. Data also available as an ArrayBuffer if requested. - - Returns data as `String` or (`Blob` on browser, `ArrayBuffer` on Node) - - **Parameters** - - `String` | `ArrayBuffer`: the packet to decode, has `type` and `data` - - `String`: optional, the binary type - -- `encodePayload` - - Encodes multiple messages (payload). - - If any contents are binary, they will be encoded as base64 strings. Base64 - encoded strings are marked with a b before the length specifier - - **Parameters** - - `Array`: an array of packets - - `Function`: callback, returns the encoded payload (`cb(String)`) -- `decodePayload` - - Decodes data when a payload is maybe expected. Possible binary contents are - decoded from their base64 representation. - - **Parameters** - - `String`: the payload - - `Function`: callback, returns (cb(`Object`: packet, `Number`:packet index, `Number`:packet total)) - -## Tests - -Standalone tests can be run with `npm test` which will run the node.js tests. - -Browser tests are run using [zuul](https://github.com/defunctzombie/zuul). -(You must have zuul setup with a saucelabs account.) - -You can run the tests locally using the following command: - -``` -npm run test:browser -``` - -## Support - -The support channels for `engine.io-parser` are the same as `socket.io`: - - irc.freenode.net **#socket.io** - - [Github Discussions](https://github.com/socketio/socket.io/discussions) - - [Website](https://socket.io) - -## Development - -To contribute patches, run tests or benchmarks, make sure to clone the -repository: - -```bash -git clone git://github.com/socketio/engine.io-parser.git -``` - -Then: - -```bash -cd engine.io-parser -npm ci -``` - -See the `Tests` section above for how to run tests before submitting any patches. - -## License - -MIT diff --git a/node_modules/engine.io-parser/lib/commons.js b/node_modules/engine.io-parser/lib/commons.js deleted file mode 100644 index 4fcea4c..0000000 --- a/node_modules/engine.io-parser/lib/commons.js +++ /dev/null @@ -1,21 +0,0 @@ -const PACKET_TYPES = Object.create(null); // no Map = no polyfill -PACKET_TYPES["open"] = "0"; -PACKET_TYPES["close"] = "1"; -PACKET_TYPES["ping"] = "2"; -PACKET_TYPES["pong"] = "3"; -PACKET_TYPES["message"] = "4"; -PACKET_TYPES["upgrade"] = "5"; -PACKET_TYPES["noop"] = "6"; - -const PACKET_TYPES_REVERSE = Object.create(null); -Object.keys(PACKET_TYPES).forEach(key => { - PACKET_TYPES_REVERSE[PACKET_TYPES[key]] = key; -}); - -const ERROR_PACKET = { type: "error", data: "parser error" }; - -module.exports = { - PACKET_TYPES, - PACKET_TYPES_REVERSE, - ERROR_PACKET -}; diff --git a/node_modules/engine.io-parser/lib/decodePacket.browser.js b/node_modules/engine.io-parser/lib/decodePacket.browser.js deleted file mode 100644 index 06a0081..0000000 --- a/node_modules/engine.io-parser/lib/decodePacket.browser.js +++ /dev/null @@ -1,57 +0,0 @@ -const { PACKET_TYPES_REVERSE, ERROR_PACKET } = require("./commons"); - -const withNativeArrayBuffer = typeof ArrayBuffer === "function"; - -let base64decoder; -if (withNativeArrayBuffer) { - base64decoder = require("base64-arraybuffer"); -} - -const decodePacket = (encodedPacket, binaryType) => { - if (typeof encodedPacket !== "string") { - return { - type: "message", - data: mapBinary(encodedPacket, binaryType) - }; - } - const type = encodedPacket.charAt(0); - if (type === "b") { - return { - type: "message", - data: decodeBase64Packet(encodedPacket.substring(1), binaryType) - }; - } - const packetType = PACKET_TYPES_REVERSE[type]; - if (!packetType) { - return ERROR_PACKET; - } - return encodedPacket.length > 1 - ? { - type: PACKET_TYPES_REVERSE[type], - data: encodedPacket.substring(1) - } - : { - type: PACKET_TYPES_REVERSE[type] - }; -}; - -const decodeBase64Packet = (data, binaryType) => { - if (base64decoder) { - const decoded = base64decoder.decode(data); - return mapBinary(decoded, binaryType); - } else { - return { base64: true, data }; // fallback for old browsers - } -}; - -const mapBinary = (data, binaryType) => { - switch (binaryType) { - case "blob": - return data instanceof ArrayBuffer ? new Blob([data]) : data; - case "arraybuffer": - default: - return data; // assuming the data is already an ArrayBuffer - } -}; - -module.exports = decodePacket; diff --git a/node_modules/engine.io-parser/lib/decodePacket.js b/node_modules/engine.io-parser/lib/decodePacket.js deleted file mode 100644 index bd47dbd..0000000 --- a/node_modules/engine.io-parser/lib/decodePacket.js +++ /dev/null @@ -1,51 +0,0 @@ -const { PACKET_TYPES_REVERSE, ERROR_PACKET } = require("./commons"); - -const decodePacket = (encodedPacket, binaryType) => { - if (typeof encodedPacket !== "string") { - return { - type: "message", - data: mapBinary(encodedPacket, binaryType) - }; - } - const type = encodedPacket.charAt(0); - if (type === "b") { - const buffer = Buffer.from(encodedPacket.substring(1), "base64"); - return { - type: "message", - data: mapBinary(buffer, binaryType) - }; - } - if (!PACKET_TYPES_REVERSE[type]) { - return ERROR_PACKET; - } - return encodedPacket.length > 1 - ? { - type: PACKET_TYPES_REVERSE[type], - data: encodedPacket.substring(1) - } - : { - type: PACKET_TYPES_REVERSE[type] - }; -}; - -const mapBinary = (data, binaryType) => { - const isBuffer = Buffer.isBuffer(data); - switch (binaryType) { - case "arraybuffer": - return isBuffer ? toArrayBuffer(data) : data; - case "nodebuffer": - default: - return data; // assuming the data is already a Buffer - } -}; - -const toArrayBuffer = buffer => { - const arrayBuffer = new ArrayBuffer(buffer.length); - const view = new Uint8Array(arrayBuffer); - for (let i = 0; i < buffer.length; i++) { - view[i] = buffer[i]; - } - return arrayBuffer; -}; - -module.exports = decodePacket; diff --git a/node_modules/engine.io-parser/lib/encodePacket.browser.js b/node_modules/engine.io-parser/lib/encodePacket.browser.js deleted file mode 100644 index 48023d7..0000000 --- a/node_modules/engine.io-parser/lib/encodePacket.browser.js +++ /dev/null @@ -1,46 +0,0 @@ -const { PACKET_TYPES } = require("./commons"); - -const withNativeBlob = - typeof Blob === "function" || - (typeof Blob !== "undefined" && - Object.prototype.toString.call(Blob) === "[object BlobConstructor]"); -const withNativeArrayBuffer = typeof ArrayBuffer === "function"; - -// ArrayBuffer.isView method is not defined in IE10 -const isView = obj => { - return typeof ArrayBuffer.isView === "function" - ? ArrayBuffer.isView(obj) - : obj && obj.buffer instanceof ArrayBuffer; -}; - -const encodePacket = ({ type, data }, supportsBinary, callback) => { - if (withNativeBlob && data instanceof Blob) { - if (supportsBinary) { - return callback(data); - } else { - return encodeBlobAsBase64(data, callback); - } - } else if ( - withNativeArrayBuffer && - (data instanceof ArrayBuffer || isView(data)) - ) { - if (supportsBinary) { - return callback(data); - } else { - return encodeBlobAsBase64(new Blob([data]), callback); - } - } - // plain string - return callback(PACKET_TYPES[type] + (data || "")); -}; - -const encodeBlobAsBase64 = (data, callback) => { - const fileReader = new FileReader(); - fileReader.onload = function() { - const content = fileReader.result.split(",")[1]; - callback("b" + content); - }; - return fileReader.readAsDataURL(data); -}; - -module.exports = encodePacket; diff --git a/node_modules/engine.io-parser/lib/encodePacket.js b/node_modules/engine.io-parser/lib/encodePacket.js deleted file mode 100644 index c4a84ec..0000000 --- a/node_modules/engine.io-parser/lib/encodePacket.js +++ /dev/null @@ -1,27 +0,0 @@ -const { PACKET_TYPES } = require("./commons"); - -const encodePacket = ({ type, data }, supportsBinary, callback) => { - if (data instanceof ArrayBuffer || ArrayBuffer.isView(data)) { - const buffer = toBuffer(data); - return callback(encodeBuffer(buffer, supportsBinary)); - } - // plain string - return callback(PACKET_TYPES[type] + (data || "")); -}; - -const toBuffer = data => { - if (Buffer.isBuffer(data)) { - return data; - } else if (data instanceof ArrayBuffer) { - return Buffer.from(data); - } else { - return Buffer.from(data.buffer, data.byteOffset, data.byteLength); - } -}; - -// only 'message' packets can contain binary, so the type prefix is not needed -const encodeBuffer = (data, supportsBinary) => { - return supportsBinary ? data : "b" + data.toString("base64"); -}; - -module.exports = encodePacket; diff --git a/node_modules/engine.io-parser/lib/index.js b/node_modules/engine.io-parser/lib/index.js deleted file mode 100644 index a412b46..0000000 --- a/node_modules/engine.io-parser/lib/index.js +++ /dev/null @@ -1,42 +0,0 @@ -const encodePacket = require("./encodePacket"); -const decodePacket = require("./decodePacket"); - -const SEPARATOR = String.fromCharCode(30); // see https://en.wikipedia.org/wiki/Delimiter#ASCII_delimited_text - -const encodePayload = (packets, callback) => { - // some packets may be added to the array while encoding, so the initial length must be saved - const length = packets.length; - const encodedPackets = new Array(length); - let count = 0; - - packets.forEach((packet, i) => { - // force base64 encoding for binary packets - encodePacket(packet, false, encodedPacket => { - encodedPackets[i] = encodedPacket; - if (++count === length) { - callback(encodedPackets.join(SEPARATOR)); - } - }); - }); -}; - -const decodePayload = (encodedPayload, binaryType) => { - const encodedPackets = encodedPayload.split(SEPARATOR); - const packets = []; - for (let i = 0; i < encodedPackets.length; i++) { - const decodedPacket = decodePacket(encodedPackets[i], binaryType); - packets.push(decodedPacket); - if (decodedPacket.type === "error") { - break; - } - } - return packets; -}; - -module.exports = { - protocol: 4, - encodePacket, - encodePayload, - decodePacket, - decodePayload -}; diff --git a/node_modules/engine.io-parser/package.json b/node_modules/engine.io-parser/package.json deleted file mode 100644 index 3705f1e..0000000 --- a/node_modules/engine.io-parser/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_from": "engine.io-parser@~4.0.0", - "_id": "engine.io-parser@4.0.3", - "_inBundle": false, - "_integrity": "sha512-xEAAY0msNnESNPc00e19y5heTPX4y/TJ36gr8t1voOaNmTojP9b3oK3BbJLFufW2XFPQaaijpFewm2g2Um3uqA==", - "_location": "/engine.io-parser", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "engine.io-parser@~4.0.0", - "name": "engine.io-parser", - "escapedName": "engine.io-parser", - "rawSpec": "~4.0.0", - "saveSpec": null, - "fetchSpec": "~4.0.0" - }, - "_requiredBy": [ - "/engine.io" - ], - "_resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-4.0.3.tgz", - "_shasum": "83d3a17acfd4226f19e721bb22a1ee8f7662d2f6", - "_spec": "engine.io-parser@~4.0.0", - "_where": "C:\\Users\\THIS PC\\Documents\\GitHub\\github-basics-RasaraSathmini\\node_modules\\engine.io", - "browser": { - "./lib/encodePacket.js": "./lib/encodePacket.browser.js", - "./lib/decodePacket.js": "./lib/decodePacket.browser.js" - }, - "bugs": { - "url": "https://github.com/socketio/engine.io-parser/issues" - }, - "bundleDependencies": false, - "dependencies": { - "base64-arraybuffer": "0.1.4" - }, - "deprecated": false, - "description": "Parser for the client for the realtime Engine", - "devDependencies": { - "@babel/core": "~7.9.6", - "@babel/preset-env": "~7.9.6", - "babel-eslint": "^10.0.3", - "babelify": "^10.0.0", - "benchmark": "^2.1.4", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.9.0", - "expect.js": "0.3.1", - "mocha": "^5.2.0", - "nyc": "~15.0.1", - "prettier": "^1.19.1", - "socket.io-browsers": "^1.0.4", - "zuul": "3.11.1", - "zuul-ngrok": "4.0.0" - }, - "engines": { - "node": ">=8.0.0" - }, - "files": [ - "lib/" - ], - "homepage": "https://github.com/socketio/engine.io-parser", - "license": "MIT", - "main": "lib/index.js", - "name": "engine.io-parser", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/socketio/engine.io-parser.git" - }, - "scripts": { - "format:check": "prettier --check 'lib/**/*.js' 'test/**/*.js'", - "format:fix": "prettier --write 'lib/**/*.js' 'test/**/*.js'", - "lint": "eslint 'lib/**/*.js' 'test/**/*.js'", - "test": "npm run lint && npm run format:check && if test \"$BROWSERS\" = \"1\" ; then npm run test:browser; else npm run test:node; fi", - "test:browser": "zuul test/index.js --no-coverage", - "test:node": "nyc mocha test/index.js" - }, - "version": "4.0.3" -} diff --git a/node_modules/engine.io/CHANGELOG.md b/node_modules/engine.io/CHANGELOG.md deleted file mode 100644 index f82431c..0000000 --- a/node_modules/engine.io/CHANGELOG.md +++ /dev/null @@ -1,266 +0,0 @@ -# [5.2.0](https://github.com/socketio/engine.io/compare/5.1.1...5.2.0) (2021-08-29) - -No change on the server-side, this matches the client release. - - -## [5.1.1](https://github.com/socketio/engine.io/compare/5.1.0...5.1.1) (2021-05-16) - - -### Bug Fixes - -* properly close the websocket connection upon handshake error ([4360686](https://github.com/socketio/engine.io/commit/43606865e5299747cbb31f3ed9baf4567502a879)) - - -# [5.1.0](https://github.com/socketio/engine.io/compare/5.0.0...5.1.0) (2021-05-04) - - -### Features - -* add a "connection_error" event ([7096e98](https://github.com/socketio/engine.io/commit/7096e98a02295a62c8ea2aa56461d4875887092d)) -* add the "initial_headers" and "headers" events ([2527543](https://github.com/socketio/engine.io/commit/252754353a0e88eb036ebb3082e9d6a9a5f497db)) - - -### Performance Improvements - -* **websocket:** add a "wsPreEncoded" writing option ([7706b12](https://github.com/socketio/engine.io/commit/7706b123df914777d19c8179b45ab6932f82916c)) -* **websocket:** fix write back-pressure ([#618](https://github.com/socketio/engine.io/issues/618)) ([ad5306a](https://github.com/socketio/engine.io/commit/ad5306aeaedf06ac7a49f791e1b76e55c35a564e)) - - -# [5.0.0](https://github.com/socketio/engine.io/compare/4.1.1...5.0.0) (2021-03-10) - - -### Bug Fixes - -* set default protocol version to 3 ([#616](https://github.com/socketio/engine.io/issues/616)) ([868d891](https://github.com/socketio/engine.io/commit/868d89111de0ab5bd0e147ecaff7983afbf5d087)) - - -### Features - -* increase the default value of pingTimeout ([5a7fa13](https://github.com/socketio/engine.io/commit/5a7fa132c442bc1e7eefa1cf38168ee951575ded)) -* remove dynamic require() with wsEngine ([edb7343](https://github.com/socketio/engine.io/commit/edb734316f143bf0f1bbc344e966d18e2676b934)) - - -### BREAKING CHANGES - -* the syntax of the "wsEngine" option is updated - -Before: - -```js -const eioServer = require("engine.io")(httpServer, { - wsEngine: "eiows" -}); -``` - -After: - -```js -const eioServer = require("engine.io")(httpServer, { - wsEngine: require("eiows").Server -}); -``` - - -## [4.1.1](https://github.com/socketio/engine.io/compare/4.1.0...4.1.1) (2021-02-02) - - -### Bug Fixes - -* do not reset the ping timer after upgrade ([ff2b8ab](https://github.com/socketio/engine.io/commit/ff2b8aba48ebcb0de5626d3b76fddc94c398395f)), closes [/github.com/socketio/socket.io-client-swift/pull/1309#issuecomment-768475704](https://github.com//github.com/socketio/socket.io-client-swift/pull/1309/issues/issuecomment-768475704) - - -# [4.1.0](https://github.com/socketio/engine.io/compare/4.0.6...4.1.0) (2021-01-14) - - -### Features - -* add support for v3.x clients ([663d326](https://github.com/socketio/engine.io/commit/663d326d18de598318bd2120b2b70cd51adf8955)) - - -## [4.0.6](https://github.com/socketio/engine.io/compare/4.0.5...4.0.6) (2021-01-04) - - -### Bug Fixes - -* correctly pass the options when using the Server constructor ([#610](https://github.com/socketio/engine.io/issues/610)) ([cec2750](https://github.com/socketio/engine.io/commit/cec27502f5b55c8a2ff289db34019629bf6a97ca)) - - - -# [3.5.0](https://github.com/socketio/engine.io/compare/3.4.2...3.5.0) (2020-12-30) - - -### Features - -* add support for all cookie options ([19cc582](https://github.com/socketio/engine.io/commit/19cc58264a06dca47ed401fbaca32dcdb80a903b)), closes [/github.com/jshttp/cookie#options-1](https://github.com//github.com/jshttp/cookie/issues/options-1) -* disable perMessageDeflate by default ([5ad2736](https://github.com/socketio/engine.io/commit/5ad273601eb66c7b318542f87026837bf9dddd21)) - - - -## [4.0.5](https://github.com/socketio/engine.io/compare/4.0.4...4.0.5) (2020-12-07) - -No change on the server-side, this matches the client release. - -## [4.0.4](https://github.com/socketio/engine.io/compare/4.0.3...4.0.4) (2020-11-17) - -No change on the server-side, this matches the client release. - -## [4.0.3](https://github.com/socketio/engine.io/compare/4.0.2...4.0.3) (2020-11-17) - -No change on the server-side, this matches the client release. - -## [4.0.2](https://github.com/socketio/engine.io/compare/4.0.1...4.0.2) (2020-11-09) - - -### Bug Fixes - -* add extension in the package.json main entry ([#608](https://github.com/socketio/engine.io/issues/608)) ([17b8c2f](https://github.com/socketio/engine.io/commit/17b8c2f199e7a307b6d6294b8599abacb3ec56e7)) - - -## [4.0.1](https://github.com/socketio/engine.io/compare/4.0.0...4.0.1) (2020-10-21) - - -### Bug Fixes - -* do not overwrite CORS headers upon error ([fe093ba](https://github.com/socketio/engine.io/commit/fe093bae1adce99e01dfdd3ce7542957785098b5)) - - - -# [4.0.0](https://github.com/socketio/engine.io/compare/v4.0.0-alpha.1...4.0.0) (2020-09-10) - -More details about this release in the blog post: https://socket.io/blog/engine-io-4-release/ - -### Bug Fixes - -* ignore errors when forcefully closing the socket ([#601](https://github.com/socketio/engine.io/issues/601)) ([dcdbccb](https://github.com/socketio/engine.io/commit/dcdbccb3dd8a7b7db057d23925356034fcd35d48)) -* remove implicit require of uws ([82cdca2](https://github.com/socketio/engine.io/commit/82cdca23bab0ed69b61b60961900d456a3065e6a)) - - -### Features - -* disable perMessageDeflate by default ([078527a](https://github.com/socketio/engine.io/commit/078527a384b70dc46d99083fa218be5d45213e51)) - -#### Links - -- Diff: [v4.0.0-alpha.1...4.0.0](https://github.com/socketio/engine.io/compare/v4.0.0-alpha.1...4.0.0) -- Full diff: [3.4.0...4.0.0](https://github.com/socketio/engine.io/compare/3.4.0...4.0.0) -- Client release: [4.0.0](https://github.com/socketio/engine.io-client/releases/tag/4.0.0) -- ws version: [^7.1.2](https://github.com/websockets/ws/releases/tag/7.1.2) - - -## [3.4.2](https://github.com/socketio/engine.io/compare/3.4.1...3.4.2) (2020-06-04) - - -### Bug Fixes - -* remove explicit require of uws ([85e544a](https://github.com/socketio/engine.io/commit/85e544afd95a5890761a613263a5eba0c9a18a93)) - -#### Links - -- Diff: [3.4.1...3.4.2](https://github.com/socketio/engine.io/compare/3.4.1...3.4.2) -- Client release: - -- ws version: [^7.1.2](https://github.com/websockets/ws/releases/tag/7.1.2) - - - -## [3.4.1](https://github.com/socketio/engine.io/compare/3.4.0...3.4.1) (2020-04-17) - - -### Bug Fixes - -* ignore errors when forcefully closing the socket ([da851ec](https://github.com/socketio/engine.io/commit/da851ec4ec89d96df2ee5c711f328b5d795423e9)) -* use SameSite=Strict by default ([001ca62](https://github.com/socketio/engine.io/commit/001ca62cc4a8f511f3b2fbd9e4493ad274a6a0e5)) - -#### Links - -- Diff: [3.4.0...3.4.1](https://github.com/socketio/engine.io/compare/3.4.0...3.4.1) -- Client release: [3.4.1](https://github.com/socketio/engine.io-client/releases/tag/3.4.1) -- ws version: [^7.1.2](https://github.com/websockets/ws/releases/tag/7.1.2) - - - -# [4.0.0-alpha.1](https://github.com/socketio/engine.io/compare/v4.0.0-alpha.0...v4.0.0-alpha.1) (2020-02-12) - -#### Links - -- Diff: [v4.0.0-alpha.0...v4.0.0-alpha.1](https://github.com/socketio/engine.io-client/compare/v4.0.0-alpha.0...v4.0.0-alpha.1) -- Client release: [v4.0.0-alpha.1](https://github.com/socketio/engine.io-client/releases/tag/v4.0.0-alpha.1) -- ws version: [^7.1.2](https://github.com/websockets/ws/releases/tag/7.1.2) - - - -# [4.0.0-alpha.0](https://github.com/socketio/engine.io/compare/3.4.0...v4.0.0-alpha.0) (2020-02-12) - - -### Features - -* decrease the default value of maxHttpBufferSize ([734f9d1](https://github.com/socketio/engine.io/commit/734f9d1268840722c41219e69eb58318e0b2ac6b)) -* disable cookie by default and add sameSite attribute ([a374471](https://github.com/socketio/engine.io/commit/a374471d06e3681a769766a1d068898182f9305f)), closes [/github.com/jshttp/cookie#options-1](https://github.com//github.com/jshttp/cookie/issues/options-1) -* generateId method can now return a Promise ([f3c291f](https://github.com/socketio/engine.io/commit/f3c291fa613a9d50c924d74293035737fdace4f2)) -* reverse the ping-pong mechanism ([31ff875](https://github.com/socketio/engine.io/commit/31ff87593f231b86dc47ec5761936439ebd53c20)) -* use the cors module to handle cross-origin requests ([61b9492](https://github.com/socketio/engine.io/commit/61b949259ed966ef6fc8bfd61f14d1a2ef06d319)) - - -### BREAKING CHANGES - -* the handlePreflightRequest option is removed by the change. - -Before: - -``` -new Server({ - handlePreflightRequest: (req, res) => { - res.writeHead(200, { - "Access-Control-Allow-Origin": 'https://example.com', - "Access-Control-Allow-Methods": 'GET', - "Access-Control-Allow-Headers": 'Authorization', - "Access-Control-Allow-Credentials": true - }); - res.end(); - } -}) -``` - -After: - -``` -new Server({ - cors: { - origin: "https://example.com", - methods: ["GET"], - allowedHeaders: ["Authorization"], - credentials: true - } -}) -``` -* the syntax has changed from - -``` -new Server({ - cookieName: "test", - cookieHttpOnly: false, - cookiePath: "/custom" -}) -``` - -to - -``` -new Server({ - cookie: { - name: "test", - httpOnly: false, - path: "/custom" - } -}) -``` - -All other options (domain, maxAge, sameSite, ...) are now supported. - -* v3.x clients will not be able to connect anymore (they will send a ping packet and timeout while waiting for a pong packet). - -#### Links - -- Diff: [3.4.0...v4.0.0-alpha.0](https://github.com/socketio/engine.io-client/compare/3.4.0...v4.0.0-alpha.0) -- Client release: [v4.0.0-alpha.0](https://github.com/socketio/engine.io-client/releases/tag/v4.0.0-alpha.0) -- ws version: [^7.1.2](https://github.com/websockets/ws/releases/tag/7.1.2) - diff --git a/node_modules/engine.io/LICENSE b/node_modules/engine.io/LICENSE deleted file mode 100644 index 6494c3c..0000000 --- a/node_modules/engine.io/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Guillermo Rauch - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the 'Software'), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or -substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING -BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/node_modules/engine.io/README.md b/node_modules/engine.io/README.md deleted file mode 100644 index 0f5a9da..0000000 --- a/node_modules/engine.io/README.md +++ /dev/null @@ -1,596 +0,0 @@ - -# Engine.IO: the realtime engine - -[![Build Status](https://github.com/socketio/engine.io/workflows/CI/badge.svg?branch=master))](https://github.com/socketio/engine.io/actions) -[![NPM version](https://badge.fury.io/js/engine.io.svg)](http://badge.fury.io/js/engine.io) - -`Engine.IO` is the implementation of transport-based -cross-browser/cross-device bi-directional communication layer for -[Socket.IO](http://github.com/socketio/socket.io). - -## How to use - -### Server - -#### (A) Listening on a port - -```js -const engine = require('engine.io'); -const server = engine.listen(80); - -server.on('connection', socket => { - socket.send('utf 8 string'); - socket.send(Buffer.from([0, 1, 2, 3, 4, 5])); // binary data -}); -``` - -#### (B) Intercepting requests for a http.Server - -```js -const engine = require('engine.io'); -const http = require('http').createServer().listen(3000); -const server = engine.attach(http); - -server.on('connection', socket => { - socket.on('message', data => { }); - socket.on('close', () => { }); -}); -``` - -#### (C) Passing in requests - -```js -const engine = require('engine.io'); -const server = new engine.Server(); - -server.on('connection', socket => { - socket.send('hi'); -}); - -// … -httpServer.on('upgrade', (req, socket, head) => { - server.handleUpgrade(req, socket, head); -}); - -httpServer.on('request', (req, res) => { - server.handleRequest(req, res); -}); -``` - -### Client - -```html - - -``` - -For more information on the client refer to the -[engine-client](http://github.com/socketio/engine.io-client) repository. - -## What features does it have? - -- **Maximum reliability**. Connections are established even in the presence of: - - proxies and load balancers. - - personal firewall and antivirus software. - - for more information refer to **Goals** and **Architecture** sections -- **Minimal client size** aided by: - - lazy loading of flash transports. - - lack of redundant transports. -- **Scalable** - - load balancer friendly -- **Future proof** -- **100% Node.JS core style** - - No API sugar (left for higher level projects) - - Written in readable vanilla JavaScript - -## API - -### Server - -

- -#### Top-level - -These are exposed by `require('engine.io')`: - -##### Events - -- `flush` - - Called when a socket buffer is being flushed. - - **Arguments** - - `Socket`: socket being flushed - - `Array`: write buffer -- `drain` - - Called when a socket buffer is drained - - **Arguments** - - `Socket`: socket being flushed - -##### Properties - -- `protocol` _(Number)_: protocol revision number -- `Server`: Server class constructor -- `Socket`: Socket class constructor -- `Transport` _(Function)_: transport constructor -- `transports` _(Object)_: map of available transports - -##### Methods - -- `()` - - Returns a new `Server` instance. If the first argument is an `http.Server` then the - new `Server` instance will be attached to it. Otherwise, the arguments are passed - directly to the `Server` constructor. - - **Parameters** - - `http.Server`: optional, server to attach to. - - `Object`: optional, options object (see `Server#constructor` api docs below) - - The following are identical ways to instantiate a server and then attach it. - -```js -const httpServer; // previously created with `http.createServer();` from node.js api. - -// create a server first, and then attach -const eioServer = require('engine.io').Server(); -eioServer.attach(httpServer); - -// or call the module as a function to get `Server` -const eioServer = require('engine.io')(); -eioServer.attach(httpServer); - -// immediately attach -const eioServer = require('engine.io')(httpServer); - -// with custom options -const eioServer = require('engine.io')(httpServer, { - maxHttpBufferSize: 1e3 -}); -``` - -- `listen` - - Creates an `http.Server` which listens on the given port and attaches WS - to it. It returns `501 Not Implemented` for regular http requests. - - **Parameters** - - `Number`: port to listen on. - - `Object`: optional, options object - - `Function`: callback for `listen`. - - **Options** - - All options from `Server.attach` method, documented below. - - **Additionally** See Server `constructor` below for options you can pass for creating the new Server - - **Returns** `Server` - -```js -const engine = require('engine.io'); -const server = engine.listen(3000, { - pingTimeout: 2000, - pingInterval: 10000 -}); - -server.on('connection', /* ... */); -``` - -- `attach` - - Captures `upgrade` requests for a `http.Server`. In other words, makes - a regular http.Server WebSocket-compatible. - - **Parameters** - - `http.Server`: server to attach to. - - `Object`: optional, options object - - **Options** - - All options from `Server.attach` method, documented below. - - **Additionally** See Server `constructor` below for options you can pass for creating the new Server - - **Returns** `Server` a new Server instance. - -```js -const engine = require('engine.io'); -const httpServer = require('http').createServer().listen(3000); -const server = engine.attach(httpServer, { - wsEngine: require('eiows').Server // requires having eiows as dependency -}); - -server.on('connection', /* ... */); -``` - -#### Server - -The main server/manager. _Inherits from EventEmitter_. - -##### Events - -- `connection` - - Fired when a new connection is established. - - **Arguments** - - `Socket`: a Socket object - -- `initial_headers` - - Fired on the first request of the connection, before writing the response headers - - **Arguments** - - `headers` (`Object`): a hash of headers - - `req` (`http.IncomingMessage`): the request - -- `headers` - - Fired on the all requests of the connection, before writing the response headers - - **Arguments** - - `headers` (`Object`): a hash of headers - - `req` (`http.IncomingMessage`): the request - -- `connection_error` - - Fired when an error occurs when establishing the connection. - - **Arguments** - - `error`: an object with following properties: - - `req` (`http.IncomingMessage`): the request that was dropped - - `code` (`Number`): one of `Server.errors` - - `message` (`string`): one of `Server.errorMessages` - - `context` (`Object`): extra info about the error - -| Code | Message | -| ---- | ------- | -| 0 | "Transport unknown" -| 1 | "Session ID unknown" -| 2 | "Bad handshake method" -| 3 | "Bad request" -| 4 | "Forbidden" -| 5 | "Unsupported protocol version" - - -##### Properties - -**Important**: if you plan to use Engine.IO in a scalable way, please -keep in mind the properties below will only reflect the clients connected -to a single process. - -- `clients` _(Object)_: hash of connected clients by id. -- `clientsCount` _(Number)_: number of connected clients. - -##### Methods - -- **constructor** - - Initializes the server - - **Parameters** - - `Object`: optional, options object - - **Options** - - `pingTimeout` (`Number`): how many ms without a pong packet to - consider the connection closed (`20000`) - - `pingInterval` (`Number`): how many ms before sending a new ping - packet (`25000`) - - `upgradeTimeout` (`Number`): how many ms before an uncompleted transport upgrade is cancelled (`10000`) - - `maxHttpBufferSize` (`Number`): how many bytes or characters a message - can be, before closing the session (to avoid DoS). Default - value is `1E6`. - - `allowRequest` (`Function`): A function that receives a given handshake - or upgrade request as its first parameter, and can decide whether to - continue or not. The second argument is a function that needs to be - called with the decided information: `fn(err, success)`, where - `success` is a boolean value where false means that the request is - rejected, and err is an error code. - - `transports` (` String`): transports to allow connections - to (`['polling', 'websocket']`) - - `allowUpgrades` (`Boolean`): whether to allow transport upgrades - (`true`) - - `perMessageDeflate` (`Object|Boolean`): parameters of the WebSocket permessage-deflate extension - (see [ws module](https://github.com/einaros/ws) api docs). Set to `true` to enable. (defaults to `false`) - - `threshold` (`Number`): data is compressed only if the byte size is above this value (`1024`) - - `httpCompression` (`Object|Boolean`): parameters of the http compression for the polling transports - (see [zlib](http://nodejs.org/api/zlib.html#zlib_options) api docs). Set to `false` to disable. (`true`) - - `threshold` (`Number`): data is compressed only if the byte size is above this value (`1024`) - - `cookie` (`Object|Boolean`): configuration of the cookie that - contains the client sid to send as part of handshake response - headers. This cookie might be used for sticky-session. Defaults to not sending any cookie (`false`). - See [here](https://github.com/jshttp/cookie#options-1) for all supported options. - - `wsEngine` (`Function`): what WebSocket server implementation to use. Specified module must conform to the `ws` interface (see [ws module api docs](https://github.com/websockets/ws/blob/master/doc/ws.md)). Default value is `ws`. An alternative c++ addon is also available by installing `eiows` module. - - `cors` (`Object`): the options that will be forwarded to the cors module. See [there](https://github.com/expressjs/cors#configuration-options) for all available options. Defaults to no CORS allowed. - - `initialPacket` (`Object`): an optional packet which will be concatenated to the handshake packet emitted by Engine.IO. - - `allowEIO3` (`Boolean`): whether to support v3 Engine.IO clients (defaults to `false`) -- `close` - - Closes all clients - - **Returns** `Server` for chaining -- `handleRequest` - - Called internally when a `Engine` request is intercepted. - - **Parameters** - - `http.IncomingMessage`: a node request object - - `http.ServerResponse`: a node response object - - **Returns** `Server` for chaining -- `handleUpgrade` - - Called internally when a `Engine` ws upgrade is intercepted. - - **Parameters** (same as `upgrade` event) - - `http.IncomingMessage`: a node request object - - `net.Stream`: TCP socket for the request - - `Buffer`: legacy tail bytes - - **Returns** `Server` for chaining -- `attach` - - Attach this Server instance to an `http.Server` - - Captures `upgrade` requests for a `http.Server`. In other words, makes - a regular http.Server WebSocket-compatible. - - **Parameters** - - `http.Server`: server to attach to. - - `Object`: optional, options object - - **Options** - - `path` (`String`): name of the path to capture (`/engine.io`). - - `destroyUpgrade` (`Boolean`): destroy unhandled upgrade requests (`true`) - - `destroyUpgradeTimeout` (`Number`): milliseconds after which unhandled requests are ended (`1000`) -- `generateId` - - Generate a socket id. - - Overwrite this method to generate your custom socket id. - - **Parameters** - - `http.IncomingMessage`: a node request object - - **Returns** A socket id for connected client. - -

- -#### Socket - -A representation of a client. _Inherits from EventEmitter_. - -##### Events - -- `close` - - Fired when the client is disconnected. - - **Arguments** - - `String`: reason for closing - - `Object`: description object (optional) -- `message` - - Fired when the client sends a message. - - **Arguments** - - `String` or `Buffer`: Unicode string or Buffer with binary contents -- `error` - - Fired when an error occurs. - - **Arguments** - - `Error`: error object -- `flush` - - Called when the write buffer is being flushed. - - **Arguments** - - `Array`: write buffer -- `drain` - - Called when the write buffer is drained -- `packet` - - Called when a socket received a packet (`message`, `ping`) - - **Arguments** - - `type`: packet type - - `data`: packet data (if type is message) -- `packetCreate` - - Called before a socket sends a packet (`message`, `ping`) - - **Arguments** - - `type`: packet type - - `data`: packet data (if type is message) -- `heartbeat` - - Called when `ping` or `pong` packed is received (depends of client version) - -##### Properties - -- `id` _(String)_: unique identifier -- `server` _(Server)_: engine parent reference -- `request` _(http.IncomingMessage)_: request that originated the Socket -- `upgraded` _(Boolean)_: whether the transport has been upgraded -- `readyState` _(String)_: opening|open|closing|closed -- `transport` _(Transport)_: transport reference - -##### Methods - -- `send`: - - Sends a message, performing `message = toString(arguments[0])` unless - sending binary data, which is sent as is. - - **Parameters** - - `String` | `Buffer` | `ArrayBuffer` | `ArrayBufferView`: a string or any object implementing `toString()`, with outgoing data, or a Buffer or ArrayBuffer with binary data. Also any ArrayBufferView can be sent as is. - - `Object`: optional, options object - - `Function`: optional, a callback executed when the message gets flushed out by the transport - - **Options** - - `compress` (`Boolean`): whether to compress sending data. This option might be ignored and forced to be `true` when using polling. (`true`) - - **Returns** `Socket` for chaining -- `close` - - Disconnects the client - - **Returns** `Socket` for chaining - -### Client - -

- -Exposed in the `eio` global namespace (in the browser), or by -`require('engine.io-client')` (in Node.JS). - -For the client API refer to the -[engine-client](http://github.com/learnboost/engine.io-client) repository. - -## Debug / logging - -Engine.IO is powered by [debug](http://github.com/visionmedia/debug). -In order to see all the debug output, run your app with the environment variable -`DEBUG` including the desired scope. - -To see the output from all of Engine.IO's debugging scopes you can use: - -``` -DEBUG=engine* node myapp -``` - -## Transports - -- `polling`: XHR / JSONP polling transport. -- `websocket`: WebSocket transport. - -## Plugins - -- [engine.io-conflation](https://github.com/EugenDueck/engine.io-conflation): Makes **conflation and aggregation** of messages straightforward. - -## Support - -The support channels for `engine.io` are the same as `socket.io`: - - irc.freenode.net **#socket.io** - - [Google Groups](http://groups.google.com/group/socket_io) - - [Website](http://socket.io) - -## Development - -To contribute patches, run tests or benchmarks, make sure to clone the -repository: - -``` -git clone git://github.com/LearnBoost/engine.io.git -``` - -Then: - -``` -cd engine.io -npm install -``` - -## Tests - -Tests run with `npm test`. It runs the server tests that are aided by -the usage of `engine.io-client`. - -Make sure `npm install` is run first. - -## Goals - -The main goal of `Engine` is ensuring the most reliable realtime communication. -Unlike the previous Socket.IO core, it always establishes a long-polling -connection first, then tries to upgrade to better transports that are "tested" on -the side. - -During the lifetime of the Socket.IO projects, we've found countless drawbacks -to relying on `HTML5 WebSocket` or `Flash Socket` as the first connection -mechanisms. - -Both are clearly the _right way_ of establishing a bidirectional communication, -with HTML5 WebSocket being the way of the future. However, to answer most business -needs, alternative traditional HTTP 1.1 mechanisms are just as good as delivering -the same solution. - -WebSocket based connections have two fundamental benefits: - -1. **Better server performance** - - _A: Load balancers_
- Load balancing a long polling connection poses a serious architectural nightmare - since requests can come from any number of open sockets by the user agent, but - they all need to be routed to the process and computer that owns the `Engine` - connection. This negatively impacts RAM and CPU usage. - - _B: Network traffic_
- WebSocket is designed around the premise that each message frame has to be - surrounded by the least amount of data. In HTTP 1.1 transports, each message - frame is surrounded by HTTP headers and chunked encoding frames. If you try to - send the message _"Hello world"_ with xhr-polling, the message ultimately - becomes larger than if you were to send it with WebSocket. - - _C: Lightweight parser_
- As an effect of **B**, the server has to do a lot more work to parse the network - data and figure out the message when traditional HTTP requests are used - (as in long polling). This means that another advantage of WebSocket is - less server CPU usage. - -2. **Better user experience** - - Due to the reasons stated in point **1**, the most important effect of being able - to establish a WebSocket connection is raw data transfer speed, which translates - in _some_ cases in better user experience. - - Applications with heavy realtime interaction (such as games) will benefit greatly, - whereas applications like realtime chat (Gmail/Facebook), newsfeeds (Facebook) or - timelines (Twitter) will have negligible user experience improvements. - -Having said this, attempting to establish a WebSocket connection directly so far has -proven problematic: - -1. **Proxies**
- Many corporate proxies block WebSocket traffic. - -2. **Personal firewall and antivirus software**
- As a result of our research, we've found that at least 3 personal security - applications block WebSocket traffic. - -3. **Cloud application platforms**
- Platforms like Heroku or No.de have had trouble keeping up with the fast-paced - nature of the evolution of the WebSocket protocol. Applications therefore end up - inevitably using long polling, but the seamless installation experience of - Socket.IO we strive for (_"require() it and it just works"_) disappears. - -Some of these problems have solutions. In the case of proxies and personal programs, -however, the solutions many times involve upgrading software. Experience has shown -that relying on client software upgrades to deliver a business solution is -fruitless: the very existence of this project has to do with a fragmented panorama -of user agent distribution, with clients connecting with latest versions of the most -modern user agents (Chrome, Firefox and Safari), but others with versions as low as -IE 5.5. - -From the user perspective, an unsuccessful WebSocket connection can translate in -up to at least 10 seconds of waiting for the realtime application to begin -exchanging data. This **perceptively** hurts user experience. - -To summarize, **Engine** focuses on reliability and user experience first, marginal -potential UX improvements and increased server performance second. `Engine` is the -result of all the lessons learned with WebSocket in the wild. - -## Architecture - -The main premise of `Engine`, and the core of its existence, is the ability to -swap transports on the fly. A connection starts as xhr-polling, but it can -switch to WebSocket. - -The central problem this poses is: how do we switch transports without losing -messages? - -`Engine` only switches from polling to another transport in between polling -cycles. Since the server closes the connection after a certain timeout when -there's no activity, and the polling transport implementation buffers messages -in between connections, this ensures no message loss and optimal performance. - -Another benefit of this design is that we workaround almost all the limitations -of **Flash Socket**, such as slow connection times, increased file size (we can -safely lazy load it without hurting user experience), etc. - -## FAQ - -### Can I use engine without Socket.IO ? - -Absolutely. Although the recommended framework for building realtime applications -is Socket.IO, since it provides fundamental features for real-world applications -such as multiplexing, reconnection support, etc. - -`Engine` is to Socket.IO what Connect is to Express. An essential piece for building -realtime frameworks, but something you _probably_ won't be using for building -actual applications. - -### Does the server serve the client? - -No. The main reason is that `Engine` is meant to be bundled with frameworks. -Socket.IO includes `Engine`, therefore serving two clients is not necessary. If -you use Socket.IO, including - -```html -