ocr design update
This commit is contained in:
23
express-server/node_modules/axios/package.json
generated
vendored
23
express-server/node_modules/axios/package.json
generated
vendored
@ -1,28 +1,33 @@
|
||||
{
|
||||
"_from": "axios",
|
||||
"_from": "axios@^0.18.0",
|
||||
"_id": "axios@0.18.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=",
|
||||
"_location": "/axios",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "tag",
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "axios",
|
||||
"raw": "axios@^0.18.0",
|
||||
"name": "axios",
|
||||
"escapedName": "axios",
|
||||
"rawSpec": "",
|
||||
"rawSpec": "^0.18.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "latest"
|
||||
"fetchSpec": "^0.18.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER",
|
||||
"/"
|
||||
"/",
|
||||
"/gcp-metadata",
|
||||
"/google-auth-library",
|
||||
"/google-auto-auth/gcp-metadata",
|
||||
"/google-auto-auth/google-auth-library",
|
||||
"/gtoken"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/axios/-/axios-0.18.0.tgz",
|
||||
"_resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz",
|
||||
"_shasum": "32d53e4851efdc0a11993b6cd000789d70c05102",
|
||||
"_spec": "axios",
|
||||
"_where": "D:\\Desktop\\smartshopperNodeReworkFirebase",
|
||||
"_spec": "axios@^0.18.0",
|
||||
"_where": "D:\\5CHITM\\Diplomarbeit\\repos\\SmartShopper\\express-server",
|
||||
"author": {
|
||||
"name": "Matt Zabriskie"
|
||||
},
|
||||
|
34
express-server/node_modules/follow-redirects/README.md
generated
vendored
34
express-server/node_modules/follow-redirects/README.md
generated
vendored
@ -96,42 +96,26 @@ var followRedirects = require('follow-redirects').wrap({
|
||||
|
||||
Such custom protocols only need an implementation of the `request` method.
|
||||
|
||||
## Browserify Usage
|
||||
## Browser Usage
|
||||
|
||||
Due to the way `XMLHttpRequest` works, the `browserify` versions of `http` and `https` already follow redirects.
|
||||
If you are *only* targeting the browser, then this library has little value for you. If you want to write cross
|
||||
platform code for node and the browser, `follow-redirects` provides a great solution for making the native node
|
||||
modules behave the same as they do in browserified builds in the browser. To avoid bundling unnecessary code
|
||||
you should tell browserify to swap out `follow-redirects` with the standard modules when bundling.
|
||||
To make this easier, you need to change how you require the modules:
|
||||
Due to the way the browser works,
|
||||
the `http` and `https` browser equivalents perform redirects by default.
|
||||
|
||||
By requiring `follow-redirects` this way:
|
||||
```javascript
|
||||
var http = require('follow-redirects/http');
|
||||
var https = require('follow-redirects/https');
|
||||
```
|
||||
you can easily tell webpack and friends to replace
|
||||
`follow-redirect` by the built-in versions:
|
||||
|
||||
You can then replace `follow-redirects` in your browserify configuration like so:
|
||||
|
||||
```javascript
|
||||
"browser": {
|
||||
```json
|
||||
{
|
||||
"follow-redirects/http" : "http",
|
||||
"follow-redirects/https" : "https"
|
||||
}
|
||||
```
|
||||
|
||||
The `browserify-http` module has not kept pace with node development, and no long behaves identically to the native
|
||||
module when running in the browser. If you are experiencing problems, you may want to check out
|
||||
[browserify-http-2](https://www.npmjs.com/package/http-browserify-2). It is more actively maintained and
|
||||
attempts to address a few of the shortcomings of `browserify-http`. In that case, your browserify config should
|
||||
look something like this:
|
||||
|
||||
```javascript
|
||||
"browser": {
|
||||
"follow-redirects/http" : "browserify-http-2/http",
|
||||
"follow-redirects/https" : "browserify-http-2/https"
|
||||
}
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Pull Requests are always welcome. Please [file an issue](https://github.com/follow-redirects/follow-redirects/issues)
|
||||
@ -152,4 +136,4 @@ Pull Requests are always welcome. Please [file an issue](https://github.com/foll
|
||||
|
||||
## License
|
||||
|
||||
[https://github.com/follow-redirects/follow-redirects/blob/master/LICENSE](MIT License)
|
||||
[MIT License](https://github.com/follow-redirects/follow-redirects/blob/master/LICENSE)
|
||||
|
125
express-server/node_modules/follow-redirects/index.js
generated
vendored
125
express-server/node_modules/follow-redirects/index.js
generated
vendored
@ -1,4 +1,5 @@
|
||||
var url = require("url");
|
||||
var URL = url.URL;
|
||||
var http = require("http");
|
||||
var https = require("https");
|
||||
var assert = require("assert");
|
||||
@ -23,6 +24,8 @@ function RedirectableRequest(options, responseCallback) {
|
||||
Writable.call(this);
|
||||
options.headers = options.headers || {};
|
||||
this._options = options;
|
||||
this._ended = false;
|
||||
this._ending = false;
|
||||
this._redirectCount = 0;
|
||||
this._redirects = [];
|
||||
this._requestBodyLength = 0;
|
||||
@ -69,6 +72,11 @@ RedirectableRequest.prototype = Object.create(Writable.prototype);
|
||||
|
||||
// Writes buffered data to the current native request
|
||||
RedirectableRequest.prototype.write = function (data, encoding, callback) {
|
||||
// Writing is not allowed if end has been called
|
||||
if (this._ending) {
|
||||
throw new Error("write after end");
|
||||
}
|
||||
|
||||
// Validate input and shift parameters if necessary
|
||||
if (!(typeof data === "string" || typeof data === "object" && ("length" in data))) {
|
||||
throw new Error("data should be a string, Buffer or Uint8Array");
|
||||
@ -111,11 +119,20 @@ RedirectableRequest.prototype.end = function (data, encoding, callback) {
|
||||
encoding = null;
|
||||
}
|
||||
|
||||
// Write data and end
|
||||
var currentRequest = this._currentRequest;
|
||||
this.write(data || "", encoding, function () {
|
||||
currentRequest.end(null, null, callback);
|
||||
});
|
||||
// Write data if needed and end
|
||||
if (!data) {
|
||||
this._ended = this._ending = true;
|
||||
this._currentRequest.end(null, null, callback);
|
||||
}
|
||||
else {
|
||||
var self = this;
|
||||
var currentRequest = this._currentRequest;
|
||||
this.write(data, encoding, function () {
|
||||
self._ended = true;
|
||||
currentRequest.end(null, null, callback);
|
||||
});
|
||||
this._ending = true;
|
||||
}
|
||||
};
|
||||
|
||||
// Sets a header value on the current native request
|
||||
@ -183,14 +200,29 @@ RedirectableRequest.prototype._performRequest = function () {
|
||||
if (this._isRedirect) {
|
||||
// Write the request entity and end.
|
||||
var i = 0;
|
||||
var self = this;
|
||||
var buffers = this._requestBodyBuffers;
|
||||
(function writeNext() {
|
||||
if (i < buffers.length) {
|
||||
var buffer = buffers[i++];
|
||||
request.write(buffer.data, buffer.encoding, writeNext);
|
||||
}
|
||||
else {
|
||||
request.end();
|
||||
(function writeNext(error) {
|
||||
// Only write if this request has not been redirected yet
|
||||
/* istanbul ignore else */
|
||||
if (request === self._currentRequest) {
|
||||
// Report any write errors
|
||||
/* istanbul ignore if */
|
||||
if (error) {
|
||||
self.emit("error", error);
|
||||
}
|
||||
// Write the next buffer if there are still left
|
||||
else if (i < buffers.length) {
|
||||
var buffer = buffers[i++];
|
||||
/* istanbul ignore else */
|
||||
if (!request.finished) {
|
||||
request.write(buffer.data, buffer.encoding, writeNext);
|
||||
}
|
||||
}
|
||||
// End the request if `end` has been called on us
|
||||
else if (self._ended) {
|
||||
request.end();
|
||||
}
|
||||
}
|
||||
}());
|
||||
}
|
||||
@ -216,6 +248,11 @@ RedirectableRequest.prototype._processResponse = function (response) {
|
||||
var location = response.headers.location;
|
||||
if (location && this._options.followRedirects !== false &&
|
||||
response.statusCode >= 300 && response.statusCode < 400) {
|
||||
// Abort the current request
|
||||
this._currentRequest.removeAllListeners();
|
||||
this._currentRequest.on("error", noop);
|
||||
this._currentRequest.abort();
|
||||
|
||||
// RFC7231§6.4: A client SHOULD detect and intervene
|
||||
// in cyclical redirections (i.e., "infinite" redirection loops).
|
||||
if (++this._redirectCount > this._options.maxRedirects) {
|
||||
@ -289,27 +326,46 @@ function wrap(protocols) {
|
||||
var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);
|
||||
|
||||
// Executes a request, following redirects
|
||||
wrappedProtocol.request = function (options, callback) {
|
||||
if (typeof options === "string") {
|
||||
options = url.parse(options);
|
||||
options.maxRedirects = exports.maxRedirects;
|
||||
wrappedProtocol.request = function (input, options, callback) {
|
||||
// Parse parameters
|
||||
if (typeof input === "string") {
|
||||
var urlStr = input;
|
||||
try {
|
||||
input = urlToOptions(new URL(urlStr));
|
||||
}
|
||||
catch (err) {
|
||||
/* istanbul ignore next */
|
||||
input = url.parse(urlStr);
|
||||
}
|
||||
}
|
||||
else if (URL && (input instanceof URL)) {
|
||||
input = urlToOptions(input);
|
||||
}
|
||||
else {
|
||||
options = Object.assign({
|
||||
protocol: protocol,
|
||||
maxRedirects: exports.maxRedirects,
|
||||
maxBodyLength: exports.maxBodyLength,
|
||||
}, options);
|
||||
callback = options;
|
||||
options = input;
|
||||
input = { protocol: protocol };
|
||||
}
|
||||
if (typeof options === "function") {
|
||||
callback = options;
|
||||
options = null;
|
||||
}
|
||||
|
||||
// Set defaults
|
||||
options = Object.assign({
|
||||
maxRedirects: exports.maxRedirects,
|
||||
maxBodyLength: exports.maxBodyLength,
|
||||
}, input, options);
|
||||
options.nativeProtocols = nativeProtocols;
|
||||
|
||||
assert.equal(options.protocol, protocol, "protocol mismatch");
|
||||
debug("options", options);
|
||||
return new RedirectableRequest(options, callback);
|
||||
};
|
||||
|
||||
// Executes a GET request, following redirects
|
||||
wrappedProtocol.get = function (options, callback) {
|
||||
var request = wrappedProtocol.request(options, callback);
|
||||
wrappedProtocol.get = function (input, options, callback) {
|
||||
var request = wrappedProtocol.request(input, options, callback);
|
||||
request.end();
|
||||
return request;
|
||||
};
|
||||
@ -317,6 +373,29 @@ function wrap(protocols) {
|
||||
return exports;
|
||||
}
|
||||
|
||||
/* istanbul ignore next */
|
||||
function noop() { /* empty */ }
|
||||
|
||||
// from https://github.com/nodejs/node/blob/master/lib/internal/url.js
|
||||
function urlToOptions(urlObject) {
|
||||
var options = {
|
||||
protocol: urlObject.protocol,
|
||||
hostname: urlObject.hostname.startsWith("[") ?
|
||||
/* istanbul ignore next */
|
||||
urlObject.hostname.slice(1, -1) :
|
||||
urlObject.hostname,
|
||||
hash: urlObject.hash,
|
||||
search: urlObject.search,
|
||||
pathname: urlObject.pathname,
|
||||
path: urlObject.pathname + urlObject.search,
|
||||
href: urlObject.href,
|
||||
};
|
||||
if (urlObject.port !== "") {
|
||||
options.port = Number(urlObject.port);
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
// Exports
|
||||
module.exports = wrap({ http: http, https: https });
|
||||
module.exports.wrap = wrap;
|
||||
|
17
express-server/node_modules/follow-redirects/package.json
generated
vendored
17
express-server/node_modules/follow-redirects/package.json
generated
vendored
@ -1,8 +1,8 @@
|
||||
{
|
||||
"_from": "follow-redirects@^1.3.0",
|
||||
"_id": "follow-redirects@1.5.10",
|
||||
"_id": "follow-redirects@1.6.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==",
|
||||
"_integrity": "sha512-t2JCjbzxQpWvbhts3l6SH1DKzSrx8a+SsaVf4h6bG4kOXUuPYS/kg2Lr4gQSb7eemaHqJkOThF1BGyjlUkO1GQ==",
|
||||
"_location": "/follow-redirects",
|
||||
"_phantomChildren": {
|
||||
"ms": "2.0.0"
|
||||
@ -20,10 +20,10 @@
|
||||
"_requiredBy": [
|
||||
"/axios"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz",
|
||||
"_shasum": "7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a",
|
||||
"_resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.6.1.tgz",
|
||||
"_shasum": "514973c44b5757368bad8bddfe52f81f015c94cb",
|
||||
"_spec": "follow-redirects@^1.3.0",
|
||||
"_where": "D:\\Desktop\\smartshopperNodeReworkFirebase\\node_modules\\axios",
|
||||
"_where": "D:\\5CHITM\\Diplomarbeit\\repos\\SmartShopper\\express-server\\node_modules\\axios",
|
||||
"author": {
|
||||
"name": "Ruben Verborgh",
|
||||
"email": "ruben@verborgh.org",
|
||||
@ -61,10 +61,7 @@
|
||||
"node": ">=4.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"create.js",
|
||||
"http.js",
|
||||
"https.js"
|
||||
"*.js"
|
||||
],
|
||||
"homepage": "https://github.com/follow-redirects/follow-redirects",
|
||||
"keywords": [
|
||||
@ -94,5 +91,5 @@
|
||||
"mocha": "nyc mocha",
|
||||
"test": "npm run lint && npm run mocha"
|
||||
},
|
||||
"version": "1.5.10"
|
||||
"version": "1.6.1"
|
||||
}
|
||||
|
Reference in New Issue
Block a user