diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json
index bae32cdfc4..059bd7dfdf 100644
--- a/node_modules/.package-lock.json
+++ b/node_modules/.package-lock.json
@@ -236,19 +236,6 @@
"node": ">= 6"
}
},
- "node_modules/@azure/core-http/node_modules/tough-cookie": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz",
- "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==",
- "dependencies": {
- "psl": "^1.1.33",
- "punycode": "^2.1.1",
- "universalify": "^0.1.2"
- },
- "engines": {
- "node": ">=6"
- }
- },
"node_modules/@azure/core-http/node_modules/tslib": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
@@ -331,19 +318,18 @@
"integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ=="
},
"node_modules/@azure/ms-rest-js": {
- "version": "2.6.2",
- "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.6.2.tgz",
- "integrity": "sha512-0/8rOxAoR9M3qKUdbGOIYtHtQkm4m5jdoDNdxTU0DkOr84KwyAdJuW/RfjJinGyig4h73DNF0rdCl6XowgCYcg==",
+ "version": "2.7.0",
+ "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.7.0.tgz",
+ "integrity": "sha512-ngbzWbqF+NmztDOpLBVDxYM+XLcUj7nKhxGbSU9WtIsXfRB//cf2ZbAG5HkOrhU9/wd/ORRB6lM/d69RKVjiyA==",
"dependencies": {
"@azure/core-auth": "^1.1.4",
"abort-controller": "^3.0.0",
"form-data": "^2.5.0",
"node-fetch": "^2.6.7",
- "tough-cookie": "^3.0.1",
"tslib": "^1.10.0",
"tunnel": "0.0.6",
"uuid": "^8.3.2",
- "xml2js": "^0.4.19"
+ "xml2js": "^0.5.0"
}
},
"node_modules/@azure/ms-rest-js/node_modules/uuid": {
@@ -3681,14 +3667,6 @@
"node": ">= 0.4"
}
},
- "node_modules/ip-regex": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz",
- "integrity": "sha512-58yWmlHpp7VYfcdTwMTvwMmqx/Elfxjd9RXTDyMsbL7lLWmhMylLEqiYVLKuLzOZqVgiWXD9MfR62Vv89VRxkw==",
- "engines": {
- "node": ">=4"
- }
- },
"node_modules/irregular-plurals": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-3.3.0.tgz",
@@ -5006,6 +4984,11 @@
"node": ">=6"
}
},
+ "node_modules/querystringify": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz",
+ "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ=="
+ },
"node_modules/queue-microtask": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
@@ -5101,6 +5084,11 @@
"node": ">=0.10.5"
}
},
+ "node_modules/requires-port": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
+ "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ=="
+ },
"node_modules/resolve": {
"version": "1.22.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz",
@@ -5716,13 +5704,14 @@
}
},
"node_modules/tough-cookie": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz",
- "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==",
+ "version": "4.1.3",
+ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz",
+ "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==",
"dependencies": {
- "ip-regex": "^2.1.0",
- "psl": "^1.1.28",
- "punycode": "^2.1.1"
+ "psl": "^1.1.33",
+ "punycode": "^2.1.1",
+ "universalify": "^0.2.0",
+ "url-parse": "^1.5.3"
},
"engines": {
"node": ">=6"
@@ -5851,8 +5840,9 @@
"integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w=="
},
"node_modules/universalify": {
- "version": "0.1.2",
- "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz",
+ "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==",
"engines": {
"node": ">= 4.0.0"
}
@@ -5892,6 +5882,15 @@
"punycode": "^2.1.0"
}
},
+ "node_modules/url-parse": {
+ "version": "1.5.10",
+ "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz",
+ "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==",
+ "dependencies": {
+ "querystringify": "^2.1.1",
+ "requires-port": "^1.0.0"
+ }
+ },
"node_modules/util": {
"version": "0.10.4",
"integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==",
diff --git a/node_modules/@azure/core-http/node_modules/tough-cookie/LICENSE b/node_modules/@azure/core-http/node_modules/tough-cookie/LICENSE
deleted file mode 100644
index 22204e8758..0000000000
--- a/node_modules/@azure/core-http/node_modules/tough-cookie/LICENSE
+++ /dev/null
@@ -1,12 +0,0 @@
-Copyright (c) 2015, Salesforce.com, Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
-3. Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/node_modules/@azure/core-http/node_modules/tough-cookie/README.md b/node_modules/@azure/core-http/node_modules/tough-cookie/README.md
deleted file mode 100644
index 2dc9496d82..0000000000
--- a/node_modules/@azure/core-http/node_modules/tough-cookie/README.md
+++ /dev/null
@@ -1,582 +0,0 @@
-[RFC6265](https://tools.ietf.org/html/rfc6265) Cookies and CookieJar for Node.js
-
-[![npm package](https://nodei.co/npm/tough-cookie.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/tough-cookie/)
-
-[![Build Status](https://travis-ci.org/salesforce/tough-cookie.svg?branch=master)](https://travis-ci.org/salesforce/tough-cookie)
-
-# Synopsis
-
-``` javascript
-var tough = require('tough-cookie');
-var Cookie = tough.Cookie;
-var cookie = Cookie.parse(header);
-cookie.value = 'somethingdifferent';
-header = cookie.toString();
-
-var cookiejar = new tough.CookieJar();
-cookiejar.setCookie(cookie, 'http://currentdomain.example.com/path', cb);
-// ...
-cookiejar.getCookies('http://example.com/otherpath',function(err,cookies) {
- res.headers['cookie'] = cookies.join('; ');
-});
-```
-
-# Installation
-
-It's _so_ easy!
-
-`npm install tough-cookie`
-
-Why the name? NPM modules `cookie`, `cookies` and `cookiejar` were already taken.
-
-## Version Support
-
-Support for versions of node.js will follow that of the [request](https://www.npmjs.com/package/request) module.
-
-# API
-
-## tough
-
-Functions on the module you get from `require('tough-cookie')`. All can be used as pure functions and don't need to be "bound".
-
-**Note**: prior to 1.0.x, several of these functions took a `strict` parameter. This has since been removed from the API as it was no longer necessary.
-
-### `parseDate(string)`
-
-Parse a cookie date string into a `Date`. Parses according to RFC6265 Section 5.1.1, not `Date.parse()`.
-
-### `formatDate(date)`
-
-Format a Date into a RFC1123 string (the RFC6265-recommended format).
-
-### `canonicalDomain(str)`
-
-Transforms a domain-name into a canonical domain-name. The canonical domain-name is a trimmed, lowercased, stripped-of-leading-dot and optionally punycode-encoded domain-name (Section 5.1.2 of RFC6265). For the most part, this function is idempotent (can be run again on its output without ill effects).
-
-### `domainMatch(str,domStr[,canonicalize=true])`
-
-Answers "does this real domain match the domain in a cookie?". The `str` is the "current" domain-name and the `domStr` is the "cookie" domain-name. Matches according to RFC6265 Section 5.1.3, but it helps to think of it as a "suffix match".
-
-The `canonicalize` parameter will run the other two parameters through `canonicalDomain` or not.
-
-### `defaultPath(path)`
-
-Given a current request/response path, gives the Path apropriate for storing in a cookie. This is basically the "directory" of a "file" in the path, but is specified by Section 5.1.4 of the RFC.
-
-The `path` parameter MUST be _only_ the pathname part of a URI (i.e. excludes the hostname, query, fragment, etc.). This is the `.pathname` property of node's `uri.parse()` output.
-
-### `pathMatch(reqPath,cookiePath)`
-
-Answers "does the request-path path-match a given cookie-path?" as per RFC6265 Section 5.1.4. Returns a boolean.
-
-This is essentially a prefix-match where `cookiePath` is a prefix of `reqPath`.
-
-### `parse(cookieString[, options])`
-
-alias for `Cookie.parse(cookieString[, options])`
-
-### `fromJSON(string)`
-
-alias for `Cookie.fromJSON(string)`
-
-### `getPublicSuffix(hostname)`
-
-Returns the public suffix of this hostname. The public suffix is the shortest domain-name upon which a cookie can be set. Returns `null` if the hostname cannot have cookies set for it.
-
-For example: `www.example.com` and `www.subdomain.example.com` both have public suffix `example.com`.
-
-For further information, see http://publicsuffix.org/. This module derives its list from that site. This call is currently a wrapper around [`psl`](https://www.npmjs.com/package/psl)'s [get() method](https://www.npmjs.com/package/psl#pslgetdomain).
-
-### `cookieCompare(a,b)`
-
-For use with `.sort()`, sorts a list of cookies into the recommended order given in the RFC (Section 5.4 step 2). The sort algorithm is, in order of precedence:
-
-* Longest `.path`
-* oldest `.creation` (which has a 1ms precision, same as `Date`)
-* lowest `.creationIndex` (to get beyond the 1ms precision)
-
-``` javascript
-var cookies = [ /* unsorted array of Cookie objects */ ];
-cookies = cookies.sort(cookieCompare);
-```
-
-**Note**: Since JavaScript's `Date` is limited to a 1ms precision, cookies within the same milisecond are entirely possible. This is especially true when using the `now` option to `.setCookie()`. The `.creationIndex` property is a per-process global counter, assigned during construction with `new Cookie()`. This preserves the spirit of the RFC sorting: older cookies go first. This works great for `MemoryCookieStore`, since `Set-Cookie` headers are parsed in order, but may not be so great for distributed systems. Sophisticated `Store`s may wish to set this to some other _logical clock_ such that if cookies A and B are created in the same millisecond, but cookie A is created before cookie B, then `A.creationIndex < B.creationIndex`. If you want to alter the global counter, which you probably _shouldn't_ do, it's stored in `Cookie.cookiesCreated`.
-
-### `permuteDomain(domain)`
-
-Generates a list of all possible domains that `domainMatch()` the parameter. May be handy for implementing cookie stores.
-
-### `permutePath(path)`
-
-Generates a list of all possible paths that `pathMatch()` the parameter. May be handy for implementing cookie stores.
-
-
-## Cookie
-
-Exported via `tough.Cookie`.
-
-### `Cookie.parse(cookieString[, options])`
-
-Parses a single Cookie or Set-Cookie HTTP header into a `Cookie` object. Returns `undefined` if the string can't be parsed.
-
-The options parameter is not required and currently has only one property:
-
- * _loose_ - boolean - if `true` enable parsing of key-less cookies like `=abc` and `=`, which are not RFC-compliant.
-
-If options is not an object, it is ignored, which means you can use `Array#map` with it.
-
-Here's how to process the Set-Cookie header(s) on a node HTTP/HTTPS response:
-
-``` javascript
-if (res.headers['set-cookie'] instanceof Array)
- cookies = res.headers['set-cookie'].map(Cookie.parse);
-else
- cookies = [Cookie.parse(res.headers['set-cookie'])];
-```
-
-_Note:_ in version 2.3.3, tough-cookie limited the number of spaces before the `=` to 256 characters. This limitation has since been removed.
-See [Issue 92](https://github.com/salesforce/tough-cookie/issues/92)
-
-### Properties
-
-Cookie object properties:
-
- * _key_ - string - the name or key of the cookie (default "")
- * _value_ - string - the value of the cookie (default "")
- * _expires_ - `Date` - if set, the `Expires=` attribute of the cookie (defaults to the string `"Infinity"`). See `setExpires()`
- * _maxAge_ - seconds - if set, the `Max-Age=` attribute _in seconds_ of the cookie. May also be set to strings `"Infinity"` and `"-Infinity"` for non-expiry and immediate-expiry, respectively. See `setMaxAge()`
- * _domain_ - string - the `Domain=` attribute of the cookie
- * _path_ - string - the `Path=` of the cookie
- * _secure_ - boolean - the `Secure` cookie flag
- * _httpOnly_ - boolean - the `HttpOnly` cookie flag
- * _sameSite_ - string - the `SameSite` cookie attribute (from [RFC6265bis]); must be one of `none`, `lax`, or `strict`
- * _extensions_ - `Array` - any unrecognized cookie attributes as strings (even if equal-signs inside)
- * _creation_ - `Date` - when this cookie was constructed
- * _creationIndex_ - number - set at construction, used to provide greater sort precision (please see `cookieCompare(a,b)` for a full explanation)
-
-After a cookie has been passed through `CookieJar.setCookie()` it will have the following additional attributes:
-
- * _hostOnly_ - boolean - is this a host-only cookie (i.e. no Domain field was set, but was instead implied)
- * _pathIsDefault_ - boolean - if true, there was no Path field on the cookie and `defaultPath()` was used to derive one.
- * _creation_ - `Date` - **modified** from construction to when the cookie was added to the jar
- * _lastAccessed_ - `Date` - last time the cookie got accessed. Will affect cookie cleaning once implemented. Using `cookiejar.getCookies(...)` will update this attribute.
-
-### `Cookie([{properties}])`
-
-Receives an options object that can contain any of the above Cookie properties, uses the default for unspecified properties.
-
-### `.toString()`
-
-encode to a Set-Cookie header value. The Expires cookie field is set using `formatDate()`, but is omitted entirely if `.expires` is `Infinity`.
-
-### `.cookieString()`
-
-encode to a Cookie header value (i.e. the `.key` and `.value` properties joined with '=').
-
-### `.setExpires(String)`
-
-sets the expiry based on a date-string passed through `parseDate()`. If parseDate returns `null` (i.e. can't parse this date string), `.expires` is set to `"Infinity"` (a string) is set.
-
-### `.setMaxAge(number)`
-
-sets the maxAge in seconds. Coerces `-Infinity` to `"-Infinity"` and `Infinity` to `"Infinity"` so it JSON serializes correctly.
-
-### `.expiryTime([now=Date.now()])`
-
-### `.expiryDate([now=Date.now()])`
-
-expiryTime() Computes the absolute unix-epoch milliseconds that this cookie expires. expiryDate() works similarly, except it returns a `Date` object. Note that in both cases the `now` parameter should be milliseconds.
-
-Max-Age takes precedence over Expires (as per the RFC). The `.creation` attribute -- or, by default, the `now` parameter -- is used to offset the `.maxAge` attribute.
-
-If Expires (`.expires`) is set, that's returned.
-
-Otherwise, `expiryTime()` returns `Infinity` and `expiryDate()` returns a `Date` object for "Tue, 19 Jan 2038 03:14:07 GMT" (latest date that can be expressed by a 32-bit `time_t`; the common limit for most user-agents).
-
-### `.TTL([now=Date.now()])`
-
-compute the TTL relative to `now` (milliseconds). The same precedence rules as for `expiryTime`/`expiryDate` apply.
-
-The "number" `Infinity` is returned for cookies without an explicit expiry and `0` is returned if the cookie is expired. Otherwise a time-to-live in milliseconds is returned.
-
-### `.canonicalizedDomain()`
-
-### `.cdomain()`
-
-return the canonicalized `.domain` field. This is lower-cased and punycode (RFC3490) encoded if the domain has any non-ASCII characters.
-
-### `.toJSON()`
-
-For convenience in using `JSON.serialize(cookie)`. Returns a plain-old `Object` that can be JSON-serialized.
-
-Any `Date` properties (i.e., `.expires`, `.creation`, and `.lastAccessed`) are exported in ISO format (`.toISOString()`).
-
-**NOTE**: Custom `Cookie` properties will be discarded. In tough-cookie 1.x, since there was no `.toJSON` method explicitly defined, all enumerable properties were captured. If you want a property to be serialized, add the property name to the `Cookie.serializableProperties` Array.
-
-### `Cookie.fromJSON(strOrObj)`
-
-Does the reverse of `cookie.toJSON()`. If passed a string, will `JSON.parse()` that first.
-
-Any `Date` properties (i.e., `.expires`, `.creation`, and `.lastAccessed`) are parsed via `Date.parse()`, not the tough-cookie `parseDate`, since it's JavaScript/JSON-y timestamps being handled at this layer.
-
-Returns `null` upon JSON parsing error.
-
-### `.clone()`
-
-Does a deep clone of this cookie, exactly implemented as `Cookie.fromJSON(cookie.toJSON())`.
-
-### `.validate()`
-
-Status: *IN PROGRESS*. Works for a few things, but is by no means comprehensive.
-
-validates cookie attributes for semantic correctness. Useful for "lint" checking any Set-Cookie headers you generate. For now, it returns a boolean, but eventually could return a reason string -- you can future-proof with this construct:
-
-``` javascript
-if (cookie.validate() === true) {
- // it's tasty
-} else {
- // yuck!
-}
-```
-
-
-## CookieJar
-
-Exported via `tough.CookieJar`.
-
-### `CookieJar([store],[options])`
-
-Simply use `new CookieJar()`. If you'd like to use a custom store, pass that to the constructor otherwise a `MemoryCookieStore` will be created and used.
-
-The `options` object can be omitted and can have the following properties:
-
- * _rejectPublicSuffixes_ - boolean - default `true` - reject cookies with domains like "com" and "co.uk"
- * _looseMode_ - boolean - default `false` - accept malformed cookies like `bar` and `=bar`, which have an implied empty name.
- * _prefixSecurity_ - string - default `silent` - set to `'unsafe-disabled'`, `'silent'`, or `'strict'`. See [Cookie Prefixes] below.
- * _allowSpecialUseDomain_ - boolean - default `false` - accepts special-use domain suffixes, such as `local`. Useful for testing purposes.
- This is not in the standard, but is used sometimes on the web and is accepted by (most) browsers.
-
-Since eventually this module would like to support database/remote/etc. CookieJars, continuation passing style is used for CookieJar methods.
-
-### `.setCookie(cookieOrString, currentUrl, [{options},] cb(err,cookie))`
-
-Attempt to set the cookie in the cookie jar. If the operation fails, an error will be given to the callback `cb`, otherwise the cookie is passed through. The cookie will have updated `.creation`, `.lastAccessed` and `.hostOnly` properties.
-
-The `options` object can be omitted and can have the following properties:
-
- * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies.
- * _secure_ - boolean - autodetect from url - indicates if this is a "Secure" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`.
- * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies
- * _ignoreError_ - boolean - default `false` - silently ignore things like parse errors and invalid domains. `Store` errors aren't ignored by this option.
- * _sameSiteContext_ - string - default unset - set to `'none'`, `'lax'`, or `'strict'` See [SameSite Cookies] below.
-
-As per the RFC, the `.hostOnly` property is set if there was no "Domain=" parameter in the cookie string (or `.domain` was null on the Cookie object). The `.domain` property is set to the fully-qualified hostname of `currentUrl` in this case. Matching this cookie requires an exact hostname match (not a `domainMatch` as per usual).
-
-### `.setCookieSync(cookieOrString, currentUrl, [{options}])`
-
-Synchronous version of `setCookie`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).
-
-### `.getCookies(currentUrl, [{options},] cb(err,cookies))`
-
-Retrieve the list of cookies that can be sent in a Cookie header for the current url.
-
-If an error is encountered, that's passed as `err` to the callback, otherwise an `Array` of `Cookie` objects is passed. The array is sorted with `cookieCompare()` unless the `{sort:false}` option is given.
-
-The `options` object can be omitted and can have the following properties:
-
- * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies.
- * _secure_ - boolean - autodetect from url - indicates if this is a "Secure" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`.
- * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies
- * _expire_ - boolean - default `true` - perform expiry-time checking of cookies and asynchronously remove expired cookies from the store. Using `false` will return expired cookies and **not** remove them from the store (which is useful for replaying Set-Cookie headers, potentially).
- * _allPaths_ - boolean - default `false` - if `true`, do not scope cookies by path. The default uses RFC-compliant path scoping. **Note**: may not be supported by the underlying store (the default `MemoryCookieStore` supports it).
- * _sameSiteContext_ - string - default unset - Set this to `'none'`, `'lax'` or `'strict'` to enforce SameSite cookies upon retrival. See [SameSite Cookies] below.
-
-The `.lastAccessed` property of the returned cookies will have been updated.
-
-### `.getCookiesSync(currentUrl, [{options}])`
-
-Synchronous version of `getCookies`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).
-
-### `.getCookieString(...)`
-
-Accepts the same options as `.getCookies()` but passes a string suitable for a Cookie header rather than an array to the callback. Simply maps the `Cookie` array via `.cookieString()`.
-
-### `.getCookieStringSync(...)`
-
-Synchronous version of `getCookieString`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).
-
-### `.getSetCookieStrings(...)`
-
-Returns an array of strings suitable for **Set-Cookie** headers. Accepts the same options as `.getCookies()`. Simply maps the cookie array via `.toString()`.
-
-### `.getSetCookieStringsSync(...)`
-
-Synchronous version of `getSetCookieStrings`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).
-
-### `.serialize(cb(err,serializedObject))`
-
-Serialize the Jar if the underlying store supports `.getAllCookies`.
-
-**NOTE**: Custom `Cookie` properties will be discarded. If you want a property to be serialized, add the property name to the `Cookie.serializableProperties` Array.
-
-See [Serialization Format].
-
-### `.serializeSync()`
-
-Sync version of .serialize
-
-### `.toJSON()`
-
-Alias of .serializeSync() for the convenience of `JSON.stringify(cookiejar)`.
-
-### `CookieJar.deserialize(serialized, [store], cb(err,object))`
-
-A new Jar is created and the serialized Cookies are added to the underlying store. Each `Cookie` is added via `store.putCookie` in the order in which they appear in the serialization.
-
-The `store` argument is optional, but should be an instance of `Store`. By default, a new instance of `MemoryCookieStore` is created.
-
-As a convenience, if `serialized` is a string, it is passed through `JSON.parse` first. If that throws an error, this is passed to the callback.
-
-### `CookieJar.deserializeSync(serialized, [store])`
-
-Sync version of `.deserialize`. _Note_ that the `store` must be synchronous for this to work.
-
-### `CookieJar.fromJSON(string)`
-
-Alias of `.deserializeSync` to provide consistency with `Cookie.fromJSON()`.
-
-### `.clone([store,]cb(err,newJar))`
-
-Produces a deep clone of this jar. Modifications to the original won't affect the clone, and vice versa.
-
-The `store` argument is optional, but should be an instance of `Store`. By default, a new instance of `MemoryCookieStore` is created. Transferring between store types is supported so long as the source implements `.getAllCookies()` and the destination implements `.putCookie()`.
-
-### `.cloneSync([store])`
-
-Synchronous version of `.clone`, returning a new `CookieJar` instance.
-
-The `store` argument is optional, but must be a _synchronous_ `Store` instance if specified. If not passed, a new instance of `MemoryCookieStore` is used.
-
-The _source_ and _destination_ must both be synchronous `Store`s. If one or both stores are asynchronous, use `.clone` instead. Recall that `MemoryCookieStore` supports both synchronous and asynchronous API calls.
-
-### `.removeAllCookies(cb(err))`
-
-Removes all cookies from the jar.
-
-This is a new backwards-compatible feature of `tough-cookie` version 2.5, so not all Stores will implement it efficiently. For Stores that do not implement `removeAllCookies`, the fallback is to call `removeCookie` after `getAllCookies`. If `getAllCookies` fails or isn't implemented in the Store, that error is returned. If one or more of the `removeCookie` calls fail, only the first error is returned.
-
-### `.removeAllCookiesSync()`
-
-Sync version of `.removeAllCookies()`
-
-## Store
-
-Base class for CookieJar stores. Available as `tough.Store`.
-
-## Store API
-
-The storage model for each `CookieJar` instance can be replaced with a custom implementation. The default is `MemoryCookieStore` which can be found in the `lib/memstore.js` file. The API uses continuation-passing-style to allow for asynchronous stores.
-
-Stores should inherit from the base `Store` class, which is available as `require('tough-cookie').Store`.
-
-Stores are asynchronous by default, but if `store.synchronous` is set to `true`, then the `*Sync` methods on the of the containing `CookieJar` can be used (however, the continuation-passing style
-
-All `domain` parameters will have been normalized before calling.
-
-The Cookie store must have all of the following methods.
-
-### `store.findCookie(domain, path, key, cb(err,cookie))`
-
-Retrieve a cookie with the given domain, path and key (a.k.a. name). The RFC maintains that exactly one of these cookies should exist in a store. If the store is using versioning, this means that the latest/newest such cookie should be returned.
-
-Callback takes an error and the resulting `Cookie` object. If no cookie is found then `null` MUST be passed instead (i.e. not an error).
-
-### `store.findCookies(domain, path, cb(err,cookies))`
-
-Locates cookies matching the given domain and path. This is most often called in the context of `cookiejar.getCookies()` above.
-
-If no cookies are found, the callback MUST be passed an empty array.
-
-The resulting list will be checked for applicability to the current request according to the RFC (domain-match, path-match, http-only-flag, secure-flag, expiry, etc.), so it's OK to use an optimistic search algorithm when implementing this method. However, the search algorithm used SHOULD try to find cookies that `domainMatch()` the domain and `pathMatch()` the path in order to limit the amount of checking that needs to be done.
-
-As of version 0.9.12, the `allPaths` option to `cookiejar.getCookies()` above will cause the path here to be `null`. If the path is `null`, path-matching MUST NOT be performed (i.e. domain-matching only).
-
-### `store.putCookie(cookie, cb(err))`
-
-Adds a new cookie to the store. The implementation SHOULD replace any existing cookie with the same `.domain`, `.path`, and `.key` properties -- depending on the nature of the implementation, it's possible that between the call to `fetchCookie` and `putCookie` that a duplicate `putCookie` can occur.
-
-The `cookie` object MUST NOT be modified; the caller will have already updated the `.creation` and `.lastAccessed` properties.
-
-Pass an error if the cookie cannot be stored.
-
-### `store.updateCookie(oldCookie, newCookie, cb(err))`
-
-Update an existing cookie. The implementation MUST update the `.value` for a cookie with the same `domain`, `.path` and `.key`. The implementation SHOULD check that the old value in the store is equivalent to `oldCookie` - how the conflict is resolved is up to the store.
-
-The `.lastAccessed` property will always be different between the two objects (to the precision possible via JavaScript's clock). Both `.creation` and `.creationIndex` are guaranteed to be the same. Stores MAY ignore or defer the `.lastAccessed` change at the cost of affecting how cookies are selected for automatic deletion (e.g., least-recently-used, which is up to the store to implement).
-
-Stores may wish to optimize changing the `.value` of the cookie in the store versus storing a new cookie. If the implementation doesn't define this method a stub that calls `putCookie(newCookie,cb)` will be added to the store object.
-
-The `newCookie` and `oldCookie` objects MUST NOT be modified.
-
-Pass an error if the newCookie cannot be stored.
-
-### `store.removeCookie(domain, path, key, cb(err))`
-
-Remove a cookie from the store (see notes on `findCookie` about the uniqueness constraint).
-
-The implementation MUST NOT pass an error if the cookie doesn't exist; only pass an error due to the failure to remove an existing cookie.
-
-### `store.removeCookies(domain, path, cb(err))`
-
-Removes matching cookies from the store. The `path` parameter is optional, and if missing means all paths in a domain should be removed.
-
-Pass an error ONLY if removing any existing cookies failed.
-
-### `store.removeAllCookies(cb(err))`
-
-_Optional_. Removes all cookies from the store.
-
-Pass an error if one or more cookies can't be removed.
-
-**Note**: New method as of `tough-cookie` version 2.5, so not all Stores will implement this, plus some stores may choose not to implement this.
-
-### `store.getAllCookies(cb(err, cookies))`
-
-_Optional_. Produces an `Array` of all cookies during `jar.serialize()`. The items in the array can be true `Cookie` objects or generic `Object`s with the [Serialization Format] data structure.
-
-Cookies SHOULD be returned in creation order to preserve sorting via `compareCookies()`. For reference, `MemoryCookieStore` will sort by `.creationIndex` since it uses true `Cookie` objects internally. If you don't return the cookies in creation order, they'll still be sorted by creation time, but this only has a precision of 1ms. See `compareCookies` for more detail.
-
-Pass an error if retrieval fails.
-
-**Note**: not all Stores can implement this due to technical limitations, so it is optional.
-
-## MemoryCookieStore
-
-Inherits from `Store`.
-
-A just-in-memory CookieJar synchronous store implementation, used by default. Despite being a synchronous implementation, it's usable with both the synchronous and asynchronous forms of the `CookieJar` API. Supports serialization, `getAllCookies`, and `removeAllCookies`.
-
-## Community Cookie Stores
-
-These are some Store implementations authored and maintained by the community. They aren't official and we don't vouch for them but you may be interested to have a look:
-
-- [`db-cookie-store`](https://github.com/JSBizon/db-cookie-store): SQL including SQLite-based databases
-- [`file-cookie-store`](https://github.com/JSBizon/file-cookie-store): Netscape cookie file format on disk
-- [`redis-cookie-store`](https://github.com/benkroeger/redis-cookie-store): Redis
-- [`tough-cookie-filestore`](https://github.com/mitsuru/tough-cookie-filestore): JSON on disk
-- [`tough-cookie-web-storage-store`](https://github.com/exponentjs/tough-cookie-web-storage-store): DOM localStorage and sessionStorage
-
-
-# Serialization Format
-
-**NOTE**: if you want to have custom `Cookie` properties serialized, add the property name to `Cookie.serializableProperties`.
-
-```js
- {
- // The version of tough-cookie that serialized this jar.
- version: 'tough-cookie@1.x.y',
-
- // add the store type, to make humans happy:
- storeType: 'MemoryCookieStore',
-
- // CookieJar configuration:
- rejectPublicSuffixes: true,
- // ... future items go here
-
- // Gets filled from jar.store.getAllCookies():
- cookies: [
- {
- key: 'string',
- value: 'string',
- // ...
- /* other Cookie.serializableProperties go here */
- }
- ]
- }
-```
-
-# RFC6265bis
-
-Support for RFC6265bis revision 02 is being developed. Since this is a bit of an omnibus revision to the RFC6252, support is broken up into the functional areas.
-
-## Leave Secure Cookies Alone
-
-Not yet supported.
-
-This change makes it so that if a cookie is sent from the server to the client with a `Secure` attribute, the channel must also be secure or the cookie is ignored.
-
-## SameSite Cookies
-
-Supported.
-
-This change makes it possible for servers, and supporting clients, to mitigate certain types of CSRF attacks by disallowing `SameSite` cookies from being sent cross-origin.
-
-On the Cookie object itself, you can get/set the `.sameSite` attribute, which will be serialized into the `SameSite=` cookie attribute. When unset or `undefined`, no `SameSite=` attribute will be serialized. The valid values of this attribute are `'none'`, `'lax'`, or `'strict'`. Other values will be serialized as-is.
-
-When parsing cookies with a `SameSite` cookie attribute, values other than `'lax'` or `'strict'` are parsed as `'none'`. For example, `SomeCookie=SomeValue; SameSite=garbage` will parse so that `cookie.sameSite === 'none'`.
-
-In order to support SameSite cookies, you must provide a `sameSiteContext` option to _both_ `setCookie` and `getCookies`. Valid values for this option are just like for the Cookie object, but have particular meanings:
-1. `'strict'` mode - If the request is on the same "site for cookies" (see the RFC draft for what this means), pass this option to add a layer of defense against CSRF.
-2. `'lax'` mode - If the request is from another site, _but_ is directly because of navigation by the user, e.g., `` or ``, pass `sameSiteContext: 'lax'`.
-3. `'none'` - Otherwise, pass `sameSiteContext: 'none'` (this indicates a cross-origin request).
-4. unset/`undefined` - SameSite **will not** be enforced! This can be a valid use-case for when CSRF isn't in the threat model of the system being built.
-
-It is highly recommended that you read RFC 6265bis for fine details on SameSite cookies. In particular [Section 8.8](https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-02#section-8.8) discusses security considerations and defense in depth.
-
-## Cookie Prefixes
-
-Supported.
-
-Cookie prefixes are a way to indicate that a given cookie was set with a set of attributes simply by inspecting the first few characters of the cookie's name.
-
-Cookie prefixes are defined in [Section 4.1.3 of 6265bis](https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-4.1.3). Two prefixes are defined:
-
-1. `"__Secure-" Prefix`: If a cookie's name begins with a case-sensitive match for the string "__Secure-", then the cookie will have been set with a "Secure" attribute.
-2. `"__Host-" Prefix`: If a cookie's name begins with a case-sensitive match for the string "__Host-", then the cookie will have been set with a "Secure" attribute, a "Path" attribute with a value of "/", and no "Domain" attribute.
-
-If `prefixSecurity` is enabled for `CookieJar`, then cookies that match the prefixes defined above but do not obey the attribute restrictions will not be added.
-
-You can define this functionality by passing in `prefixSecurity` option to `CookieJar`. It can be one of 3 values:
-
-1. `silent`: Enable cookie prefix checking but silently fail to add the cookie if conditions not met. Default.
-2. `strict`: Enable cookie prefix checking and error out if conditions not met.
-3. `unsafe-disabled`: Disable cookie prefix checking.
-
-Note that if `ignoreError` is passed in as `true` then the error will be silent regardless of `prefixSecurity` option (assuming it's enabled).
-
-
-# Copyright and License
-
-BSD-3-Clause:
-
-```text
- Copyright (c) 2015, Salesforce.com, Inc.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- 3. Neither the name of Salesforce.com nor the names of its contributors may
- be used to endorse or promote products derived from this software without
- specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-```
diff --git a/node_modules/@azure/core-http/node_modules/tough-cookie/lib/cookie.js b/node_modules/@azure/core-http/node_modules/tough-cookie/lib/cookie.js
deleted file mode 100644
index a042893e11..0000000000
--- a/node_modules/@azure/core-http/node_modules/tough-cookie/lib/cookie.js
+++ /dev/null
@@ -1,1671 +0,0 @@
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-"use strict";
-const punycode = require("punycode");
-const urlParse = require("url").parse;
-const util = require("util");
-const pubsuffix = require("./pubsuffix-psl");
-const Store = require("./store").Store;
-const MemoryCookieStore = require("./memstore").MemoryCookieStore;
-const pathMatch = require("./pathMatch").pathMatch;
-const VERSION = require("./version");
-const { fromCallback } = require("universalify");
-
-// From RFC6265 S4.1.1
-// note that it excludes \x3B ";"
-const COOKIE_OCTETS = /^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]+$/;
-
-const CONTROL_CHARS = /[\x00-\x1F]/;
-
-// From Chromium // '\r', '\n' and '\0' should be treated as a terminator in
-// the "relaxed" mode, see:
-// https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60
-const TERMINATORS = ["\n", "\r", "\0"];
-
-// RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or ";"'
-// Note ';' is \x3B
-const PATH_VALUE = /[\x20-\x3A\x3C-\x7E]+/;
-
-// date-time parsing constants (RFC6265 S5.1.1)
-
-const DATE_DELIM = /[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/;
-
-const MONTH_TO_NUM = {
- jan: 0,
- feb: 1,
- mar: 2,
- apr: 3,
- may: 4,
- jun: 5,
- jul: 6,
- aug: 7,
- sep: 8,
- oct: 9,
- nov: 10,
- dec: 11
-};
-
-const MAX_TIME = 2147483647000; // 31-bit max
-const MIN_TIME = 0; // 31-bit min
-const SAME_SITE_CONTEXT_VAL_ERR =
- 'Invalid sameSiteContext option for getCookies(); expected one of "strict", "lax", or "none"';
-
-function checkSameSiteContext(value) {
- const context = String(value).toLowerCase();
- if (context === "none" || context === "lax" || context === "strict") {
- return context;
- } else {
- return null;
- }
-}
-
-const PrefixSecurityEnum = Object.freeze({
- SILENT: "silent",
- STRICT: "strict",
- DISABLED: "unsafe-disabled"
-});
-
-// Dumped from ip-regex@4.0.0, with the following changes:
-// * all capturing groups converted to non-capturing -- "(?:)"
-// * support for IPv6 Scoped Literal ("%eth1") removed
-// * lowercase hexadecimal only
-var IP_REGEX_LOWERCASE =/(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-f\d]{1,4}:){7}(?:[a-f\d]{1,4}|:)|(?:[a-f\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-f\d]{1,4}|:)|(?:[a-f\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,2}|:)|(?:[a-f\d]{1,4}:){4}(?:(?::[a-f\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,3}|:)|(?:[a-f\d]{1,4}:){3}(?:(?::[a-f\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,4}|:)|(?:[a-f\d]{1,4}:){2}(?:(?::[a-f\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,5}|:)|(?:[a-f\d]{1,4}:){1}(?:(?::[a-f\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,6}|:)|(?::(?:(?::[a-f\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,7}|:)))$)/;
-
-/*
- * Parses a Natural number (i.e., non-negative integer) with either the
- * *DIGIT ( non-digit *OCTET )
- * or
- * *DIGIT
- * grammar (RFC6265 S5.1.1).
- *
- * The "trailingOK" boolean controls if the grammar accepts a
- * "( non-digit *OCTET )" trailer.
- */
-function parseDigits(token, minDigits, maxDigits, trailingOK) {
- let count = 0;
- while (count < token.length) {
- const c = token.charCodeAt(count);
- // "non-digit = %x00-2F / %x3A-FF"
- if (c <= 0x2f || c >= 0x3a) {
- break;
- }
- count++;
- }
-
- // constrain to a minimum and maximum number of digits.
- if (count < minDigits || count > maxDigits) {
- return null;
- }
-
- if (!trailingOK && count != token.length) {
- return null;
- }
-
- return parseInt(token.substr(0, count), 10);
-}
-
-function parseTime(token) {
- const parts = token.split(":");
- const result = [0, 0, 0];
-
- /* RF6256 S5.1.1:
- * time = hms-time ( non-digit *OCTET )
- * hms-time = time-field ":" time-field ":" time-field
- * time-field = 1*2DIGIT
- */
-
- if (parts.length !== 3) {
- return null;
- }
-
- for (let i = 0; i < 3; i++) {
- // "time-field" must be strictly "1*2DIGIT", HOWEVER, "hms-time" can be
- // followed by "( non-digit *OCTET )" so therefore the last time-field can
- // have a trailer
- const trailingOK = i == 2;
- const num = parseDigits(parts[i], 1, 2, trailingOK);
- if (num === null) {
- return null;
- }
- result[i] = num;
- }
-
- return result;
-}
-
-function parseMonth(token) {
- token = String(token)
- .substr(0, 3)
- .toLowerCase();
- const num = MONTH_TO_NUM[token];
- return num >= 0 ? num : null;
-}
-
-/*
- * RFC6265 S5.1.1 date parser (see RFC for full grammar)
- */
-function parseDate(str) {
- if (!str) {
- return;
- }
-
- /* RFC6265 S5.1.1:
- * 2. Process each date-token sequentially in the order the date-tokens
- * appear in the cookie-date
- */
- const tokens = str.split(DATE_DELIM);
- if (!tokens) {
- return;
- }
-
- let hour = null;
- let minute = null;
- let second = null;
- let dayOfMonth = null;
- let month = null;
- let year = null;
-
- for (let i = 0; i < tokens.length; i++) {
- const token = tokens[i].trim();
- if (!token.length) {
- continue;
- }
-
- let result;
-
- /* 2.1. If the found-time flag is not set and the token matches the time
- * production, set the found-time flag and set the hour- value,
- * minute-value, and second-value to the numbers denoted by the digits in
- * the date-token, respectively. Skip the remaining sub-steps and continue
- * to the next date-token.
- */
- if (second === null) {
- result = parseTime(token);
- if (result) {
- hour = result[0];
- minute = result[1];
- second = result[2];
- continue;
- }
- }
-
- /* 2.2. If the found-day-of-month flag is not set and the date-token matches
- * the day-of-month production, set the found-day-of- month flag and set
- * the day-of-month-value to the number denoted by the date-token. Skip
- * the remaining sub-steps and continue to the next date-token.
- */
- if (dayOfMonth === null) {
- // "day-of-month = 1*2DIGIT ( non-digit *OCTET )"
- result = parseDigits(token, 1, 2, true);
- if (result !== null) {
- dayOfMonth = result;
- continue;
- }
- }
-
- /* 2.3. If the found-month flag is not set and the date-token matches the
- * month production, set the found-month flag and set the month-value to
- * the month denoted by the date-token. Skip the remaining sub-steps and
- * continue to the next date-token.
- */
- if (month === null) {
- result = parseMonth(token);
- if (result !== null) {
- month = result;
- continue;
- }
- }
-
- /* 2.4. If the found-year flag is not set and the date-token matches the
- * year production, set the found-year flag and set the year-value to the
- * number denoted by the date-token. Skip the remaining sub-steps and
- * continue to the next date-token.
- */
- if (year === null) {
- // "year = 2*4DIGIT ( non-digit *OCTET )"
- result = parseDigits(token, 2, 4, true);
- if (result !== null) {
- year = result;
- /* From S5.1.1:
- * 3. If the year-value is greater than or equal to 70 and less
- * than or equal to 99, increment the year-value by 1900.
- * 4. If the year-value is greater than or equal to 0 and less
- * than or equal to 69, increment the year-value by 2000.
- */
- if (year >= 70 && year <= 99) {
- year += 1900;
- } else if (year >= 0 && year <= 69) {
- year += 2000;
- }
- }
- }
- }
-
- /* RFC 6265 S5.1.1
- * "5. Abort these steps and fail to parse the cookie-date if:
- * * at least one of the found-day-of-month, found-month, found-
- * year, or found-time flags is not set,
- * * the day-of-month-value is less than 1 or greater than 31,
- * * the year-value is less than 1601,
- * * the hour-value is greater than 23,
- * * the minute-value is greater than 59, or
- * * the second-value is greater than 59.
- * (Note that leap seconds cannot be represented in this syntax.)"
- *
- * So, in order as above:
- */
- if (
- dayOfMonth === null ||
- month === null ||
- year === null ||
- second === null ||
- dayOfMonth < 1 ||
- dayOfMonth > 31 ||
- year < 1601 ||
- hour > 23 ||
- minute > 59 ||
- second > 59
- ) {
- return;
- }
-
- return new Date(Date.UTC(year, month, dayOfMonth, hour, minute, second));
-}
-
-function formatDate(date) {
- return date.toUTCString();
-}
-
-// S5.1.2 Canonicalized Host Names
-function canonicalDomain(str) {
- if (str == null) {
- return null;
- }
- str = str.trim().replace(/^\./, ""); // S4.1.2.3 & S5.2.3: ignore leading .
-
- // convert to IDN if any non-ASCII characters
- if (punycode && /[^\u0001-\u007f]/.test(str)) {
- str = punycode.toASCII(str);
- }
-
- return str.toLowerCase();
-}
-
-// S5.1.3 Domain Matching
-function domainMatch(str, domStr, canonicalize) {
- if (str == null || domStr == null) {
- return null;
- }
- if (canonicalize !== false) {
- str = canonicalDomain(str);
- domStr = canonicalDomain(domStr);
- }
-
- /*
- * S5.1.3:
- * "A string domain-matches a given domain string if at least one of the
- * following conditions hold:"
- *
- * " o The domain string and the string are identical. (Note that both the
- * domain string and the string will have been canonicalized to lower case at
- * this point)"
- */
- if (str == domStr) {
- return true;
- }
-
- /* " o All of the following [three] conditions hold:" */
-
- /* "* The domain string is a suffix of the string" */
- const idx = str.indexOf(domStr);
- if (idx <= 0) {
- return false; // it's a non-match (-1) or prefix (0)
- }
-
- // next, check it's a proper suffix
- // e.g., "a.b.c".indexOf("b.c") === 2
- // 5 === 3+2
- if (str.length !== domStr.length + idx) {
- return false; // it's not a suffix
- }
-
- /* " * The last character of the string that is not included in the
- * domain string is a %x2E (".") character." */
- if (str.substr(idx-1,1) !== '.') {
- return false; // doesn't align on "."
- }
-
- /* " * The string is a host name (i.e., not an IP address)." */
- if (IP_REGEX_LOWERCASE.test(str)) {
- return false; // it's an IP address
- }
-
- return true;
-}
-
-// RFC6265 S5.1.4 Paths and Path-Match
-
-/*
- * "The user agent MUST use an algorithm equivalent to the following algorithm
- * to compute the default-path of a cookie:"
- *
- * Assumption: the path (and not query part or absolute uri) is passed in.
- */
-function defaultPath(path) {
- // "2. If the uri-path is empty or if the first character of the uri-path is not
- // a %x2F ("/") character, output %x2F ("/") and skip the remaining steps.
- if (!path || path.substr(0, 1) !== "/") {
- return "/";
- }
-
- // "3. If the uri-path contains no more than one %x2F ("/") character, output
- // %x2F ("/") and skip the remaining step."
- if (path === "/") {
- return path;
- }
-
- const rightSlash = path.lastIndexOf("/");
- if (rightSlash === 0) {
- return "/";
- }
-
- // "4. Output the characters of the uri-path from the first character up to,
- // but not including, the right-most %x2F ("/")."
- return path.slice(0, rightSlash);
-}
-
-function trimTerminator(str) {
- for (let t = 0; t < TERMINATORS.length; t++) {
- const terminatorIdx = str.indexOf(TERMINATORS[t]);
- if (terminatorIdx !== -1) {
- str = str.substr(0, terminatorIdx);
- }
- }
-
- return str;
-}
-
-function parseCookiePair(cookiePair, looseMode) {
- cookiePair = trimTerminator(cookiePair);
-
- let firstEq = cookiePair.indexOf("=");
- if (looseMode) {
- if (firstEq === 0) {
- // '=' is immediately at start
- cookiePair = cookiePair.substr(1);
- firstEq = cookiePair.indexOf("="); // might still need to split on '='
- }
- } else {
- // non-loose mode
- if (firstEq <= 0) {
- // no '=' or is at start
- return; // needs to have non-empty "cookie-name"
- }
- }
-
- let cookieName, cookieValue;
- if (firstEq <= 0) {
- cookieName = "";
- cookieValue = cookiePair.trim();
- } else {
- cookieName = cookiePair.substr(0, firstEq).trim();
- cookieValue = cookiePair.substr(firstEq + 1).trim();
- }
-
- if (CONTROL_CHARS.test(cookieName) || CONTROL_CHARS.test(cookieValue)) {
- return;
- }
-
- const c = new Cookie();
- c.key = cookieName;
- c.value = cookieValue;
- return c;
-}
-
-function parse(str, options) {
- if (!options || typeof options !== "object") {
- options = {};
- }
- str = str.trim();
-
- // We use a regex to parse the "name-value-pair" part of S5.2
- const firstSemi = str.indexOf(";"); // S5.2 step 1
- const cookiePair = firstSemi === -1 ? str : str.substr(0, firstSemi);
- const c = parseCookiePair(cookiePair, !!options.loose);
- if (!c) {
- return;
- }
-
- if (firstSemi === -1) {
- return c;
- }
-
- // S5.2.3 "unparsed-attributes consist of the remainder of the set-cookie-string
- // (including the %x3B (";") in question)." plus later on in the same section
- // "discard the first ";" and trim".
- const unparsed = str.slice(firstSemi + 1).trim();
-
- // "If the unparsed-attributes string is empty, skip the rest of these
- // steps."
- if (unparsed.length === 0) {
- return c;
- }
-
- /*
- * S5.2 says that when looping over the items "[p]rocess the attribute-name
- * and attribute-value according to the requirements in the following
- * subsections" for every item. Plus, for many of the individual attributes
- * in S5.3 it says to use the "attribute-value of the last attribute in the
- * cookie-attribute-list". Therefore, in this implementation, we overwrite
- * the previous value.
- */
- const cookie_avs = unparsed.split(";");
- while (cookie_avs.length) {
- const av = cookie_avs.shift().trim();
- if (av.length === 0) {
- // happens if ";;" appears
- continue;
- }
- const av_sep = av.indexOf("=");
- let av_key, av_value;
-
- if (av_sep === -1) {
- av_key = av;
- av_value = null;
- } else {
- av_key = av.substr(0, av_sep);
- av_value = av.substr(av_sep + 1);
- }
-
- av_key = av_key.trim().toLowerCase();
-
- if (av_value) {
- av_value = av_value.trim();
- }
-
- switch (av_key) {
- case "expires": // S5.2.1
- if (av_value) {
- const exp = parseDate(av_value);
- // "If the attribute-value failed to parse as a cookie date, ignore the
- // cookie-av."
- if (exp) {
- // over and underflow not realistically a concern: V8's getTime() seems to
- // store something larger than a 32-bit time_t (even with 32-bit node)
- c.expires = exp;
- }
- }
- break;
-
- case "max-age": // S5.2.2
- if (av_value) {
- // "If the first character of the attribute-value is not a DIGIT or a "-"
- // character ...[or]... If the remainder of attribute-value contains a
- // non-DIGIT character, ignore the cookie-av."
- if (/^-?[0-9]+$/.test(av_value)) {
- const delta = parseInt(av_value, 10);
- // "If delta-seconds is less than or equal to zero (0), let expiry-time
- // be the earliest representable date and time."
- c.setMaxAge(delta);
- }
- }
- break;
-
- case "domain": // S5.2.3
- // "If the attribute-value is empty, the behavior is undefined. However,
- // the user agent SHOULD ignore the cookie-av entirely."
- if (av_value) {
- // S5.2.3 "Let cookie-domain be the attribute-value without the leading %x2E
- // (".") character."
- const domain = av_value.trim().replace(/^\./, "");
- if (domain) {
- // "Convert the cookie-domain to lower case."
- c.domain = domain.toLowerCase();
- }
- }
- break;
-
- case "path": // S5.2.4
- /*
- * "If the attribute-value is empty or if the first character of the
- * attribute-value is not %x2F ("/"):
- * Let cookie-path be the default-path.
- * Otherwise:
- * Let cookie-path be the attribute-value."
- *
- * We'll represent the default-path as null since it depends on the
- * context of the parsing.
- */
- c.path = av_value && av_value[0] === "/" ? av_value : null;
- break;
-
- case "secure": // S5.2.5
- /*
- * "If the attribute-name case-insensitively matches the string "Secure",
- * the user agent MUST append an attribute to the cookie-attribute-list
- * with an attribute-name of Secure and an empty attribute-value."
- */
- c.secure = true;
- break;
-
- case "httponly": // S5.2.6 -- effectively the same as 'secure'
- c.httpOnly = true;
- break;
-
- case "samesite": // RFC6265bis-02 S5.3.7
- const enforcement = av_value ? av_value.toLowerCase() : "";
- switch (enforcement) {
- case "strict":
- c.sameSite = "strict";
- break;
- case "lax":
- c.sameSite = "lax";
- break;
- default:
- // RFC6265bis-02 S5.3.7 step 1:
- // "If cookie-av's attribute-value is not a case-insensitive match
- // for "Strict" or "Lax", ignore the "cookie-av"."
- // This effectively sets it to 'none' from the prototype.
- break;
- }
- break;
-
- default:
- c.extensions = c.extensions || [];
- c.extensions.push(av);
- break;
- }
- }
-
- return c;
-}
-
-/**
- * If the cookie-name begins with a case-sensitive match for the
- * string "__Secure-", abort these steps and ignore the cookie
- * entirely unless the cookie's secure-only-flag is true.
- * @param cookie
- * @returns boolean
- */
-function isSecurePrefixConditionMet(cookie) {
- return !cookie.key.startsWith("__Secure-") || cookie.secure;
-}
-
-/**
- * If the cookie-name begins with a case-sensitive match for the
- * string "__Host-", abort these steps and ignore the cookie
- * entirely unless the cookie meets all the following criteria:
- * 1. The cookie's secure-only-flag is true.
- * 2. The cookie's host-only-flag is true.
- * 3. The cookie-attribute-list contains an attribute with an
- * attribute-name of "Path", and the cookie's path is "/".
- * @param cookie
- * @returns boolean
- */
-function isHostPrefixConditionMet(cookie) {
- return (
- !cookie.key.startsWith("__Host-") ||
- (cookie.secure &&
- cookie.hostOnly &&
- cookie.path != null &&
- cookie.path === "/")
- );
-}
-
-// avoid the V8 deoptimization monster!
-function jsonParse(str) {
- let obj;
- try {
- obj = JSON.parse(str);
- } catch (e) {
- return e;
- }
- return obj;
-}
-
-function fromJSON(str) {
- if (!str) {
- return null;
- }
-
- let obj;
- if (typeof str === "string") {
- obj = jsonParse(str);
- if (obj instanceof Error) {
- return null;
- }
- } else {
- // assume it's an Object
- obj = str;
- }
-
- const c = new Cookie();
- for (let i = 0; i < Cookie.serializableProperties.length; i++) {
- const prop = Cookie.serializableProperties[i];
- if (obj[prop] === undefined || obj[prop] === cookieDefaults[prop]) {
- continue; // leave as prototype default
- }
-
- if (prop === "expires" || prop === "creation" || prop === "lastAccessed") {
- if (obj[prop] === null) {
- c[prop] = null;
- } else {
- c[prop] = obj[prop] == "Infinity" ? "Infinity" : new Date(obj[prop]);
- }
- } else {
- c[prop] = obj[prop];
- }
- }
-
- return c;
-}
-
-/* Section 5.4 part 2:
- * "* Cookies with longer paths are listed before cookies with
- * shorter paths.
- *
- * * Among cookies that have equal-length path fields, cookies with
- * earlier creation-times are listed before cookies with later
- * creation-times."
- */
-
-function cookieCompare(a, b) {
- let cmp = 0;
-
- // descending for length: b CMP a
- const aPathLen = a.path ? a.path.length : 0;
- const bPathLen = b.path ? b.path.length : 0;
- cmp = bPathLen - aPathLen;
- if (cmp !== 0) {
- return cmp;
- }
-
- // ascending for time: a CMP b
- const aTime = a.creation ? a.creation.getTime() : MAX_TIME;
- const bTime = b.creation ? b.creation.getTime() : MAX_TIME;
- cmp = aTime - bTime;
- if (cmp !== 0) {
- return cmp;
- }
-
- // break ties for the same millisecond (precision of JavaScript's clock)
- cmp = a.creationIndex - b.creationIndex;
-
- return cmp;
-}
-
-// Gives the permutation of all possible pathMatch()es of a given path. The
-// array is in longest-to-shortest order. Handy for indexing.
-function permutePath(path) {
- if (path === "/") {
- return ["/"];
- }
- const permutations = [path];
- while (path.length > 1) {
- const lindex = path.lastIndexOf("/");
- if (lindex === 0) {
- break;
- }
- path = path.substr(0, lindex);
- permutations.push(path);
- }
- permutations.push("/");
- return permutations;
-}
-
-function getCookieContext(url) {
- if (url instanceof Object) {
- return url;
- }
- // NOTE: decodeURI will throw on malformed URIs (see GH-32).
- // Therefore, we will just skip decoding for such URIs.
- try {
- url = decodeURI(url);
- } catch (err) {
- // Silently swallow error
- }
-
- return urlParse(url);
-}
-
-const cookieDefaults = {
- // the order in which the RFC has them:
- key: "",
- value: "",
- expires: "Infinity",
- maxAge: null,
- domain: null,
- path: null,
- secure: false,
- httpOnly: false,
- extensions: null,
- // set by the CookieJar:
- hostOnly: null,
- pathIsDefault: null,
- creation: null,
- lastAccessed: null,
- sameSite: "none"
-};
-
-class Cookie {
- constructor(options = {}) {
- if (util.inspect.custom) {
- this[util.inspect.custom] = this.inspect;
- }
-
- Object.assign(this, cookieDefaults, options);
- this.creation = this.creation || new Date();
-
- // used to break creation ties in cookieCompare():
- Object.defineProperty(this, "creationIndex", {
- configurable: false,
- enumerable: false, // important for assert.deepEqual checks
- writable: true,
- value: ++Cookie.cookiesCreated
- });
- }
-
- inspect() {
- const now = Date.now();
- const hostOnly = this.hostOnly != null ? this.hostOnly : "?";
- const createAge = this.creation
- ? `${now - this.creation.getTime()}ms`
- : "?";
- const accessAge = this.lastAccessed
- ? `${now - this.lastAccessed.getTime()}ms`
- : "?";
- return `Cookie="${this.toString()}; hostOnly=${hostOnly}; aAge=${accessAge}; cAge=${createAge}"`;
- }
-
- toJSON() {
- const obj = {};
-
- for (const prop of Cookie.serializableProperties) {
- if (this[prop] === cookieDefaults[prop]) {
- continue; // leave as prototype default
- }
-
- if (
- prop === "expires" ||
- prop === "creation" ||
- prop === "lastAccessed"
- ) {
- if (this[prop] === null) {
- obj[prop] = null;
- } else {
- obj[prop] =
- this[prop] == "Infinity" // intentionally not ===
- ? "Infinity"
- : this[prop].toISOString();
- }
- } else if (prop === "maxAge") {
- if (this[prop] !== null) {
- // again, intentionally not ===
- obj[prop] =
- this[prop] == Infinity || this[prop] == -Infinity
- ? this[prop].toString()
- : this[prop];
- }
- } else {
- if (this[prop] !== cookieDefaults[prop]) {
- obj[prop] = this[prop];
- }
- }
- }
-
- return obj;
- }
-
- clone() {
- return fromJSON(this.toJSON());
- }
-
- validate() {
- if (!COOKIE_OCTETS.test(this.value)) {
- return false;
- }
- if (
- this.expires != Infinity &&
- !(this.expires instanceof Date) &&
- !parseDate(this.expires)
- ) {
- return false;
- }
- if (this.maxAge != null && this.maxAge <= 0) {
- return false; // "Max-Age=" non-zero-digit *DIGIT
- }
- if (this.path != null && !PATH_VALUE.test(this.path)) {
- return false;
- }
-
- const cdomain = this.cdomain();
- if (cdomain) {
- if (cdomain.match(/\.$/)) {
- return false; // S4.1.2.3 suggests that this is bad. domainMatch() tests confirm this
- }
- const suffix = pubsuffix.getPublicSuffix(cdomain);
- if (suffix == null) {
- // it's a public suffix
- return false;
- }
- }
- return true;
- }
-
- setExpires(exp) {
- if (exp instanceof Date) {
- this.expires = exp;
- } else {
- this.expires = parseDate(exp) || "Infinity";
- }
- }
-
- setMaxAge(age) {
- if (age === Infinity || age === -Infinity) {
- this.maxAge = age.toString(); // so JSON.stringify() works
- } else {
- this.maxAge = age;
- }
- }
-
- cookieString() {
- let val = this.value;
- if (val == null) {
- val = "";
- }
- if (this.key === "") {
- return val;
- }
- return `${this.key}=${val}`;
- }
-
- // gives Set-Cookie header format
- toString() {
- let str = this.cookieString();
-
- if (this.expires != Infinity) {
- if (this.expires instanceof Date) {
- str += `; Expires=${formatDate(this.expires)}`;
- } else {
- str += `; Expires=${this.expires}`;
- }
- }
-
- if (this.maxAge != null && this.maxAge != Infinity) {
- str += `; Max-Age=${this.maxAge}`;
- }
-
- if (this.domain && !this.hostOnly) {
- str += `; Domain=${this.domain}`;
- }
- if (this.path) {
- str += `; Path=${this.path}`;
- }
-
- if (this.secure) {
- str += "; Secure";
- }
- if (this.httpOnly) {
- str += "; HttpOnly";
- }
- if (this.sameSite && this.sameSite !== "none") {
- const ssCanon = Cookie.sameSiteCanonical[this.sameSite.toLowerCase()];
- str += `; SameSite=${ssCanon ? ssCanon : this.sameSite}`;
- }
- if (this.extensions) {
- this.extensions.forEach(ext => {
- str += `; ${ext}`;
- });
- }
-
- return str;
- }
-
- // TTL() partially replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
- // elsewhere)
- // S5.3 says to give the "latest representable date" for which we use Infinity
- // For "expired" we use 0
- TTL(now) {
- /* RFC6265 S4.1.2.2 If a cookie has both the Max-Age and the Expires
- * attribute, the Max-Age attribute has precedence and controls the
- * expiration date of the cookie.
- * (Concurs with S5.3 step 3)
- */
- if (this.maxAge != null) {
- return this.maxAge <= 0 ? 0 : this.maxAge * 1000;
- }
-
- let expires = this.expires;
- if (expires != Infinity) {
- if (!(expires instanceof Date)) {
- expires = parseDate(expires) || Infinity;
- }
-
- if (expires == Infinity) {
- return Infinity;
- }
-
- return expires.getTime() - (now || Date.now());
- }
-
- return Infinity;
- }
-
- // expiryTime() replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
- // elsewhere)
- expiryTime(now) {
- if (this.maxAge != null) {
- const relativeTo = now || this.creation || new Date();
- const age = this.maxAge <= 0 ? -Infinity : this.maxAge * 1000;
- return relativeTo.getTime() + age;
- }
-
- if (this.expires == Infinity) {
- return Infinity;
- }
- return this.expires.getTime();
- }
-
- // expiryDate() replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
- // elsewhere), except it returns a Date
- expiryDate(now) {
- const millisec = this.expiryTime(now);
- if (millisec == Infinity) {
- return new Date(MAX_TIME);
- } else if (millisec == -Infinity) {
- return new Date(MIN_TIME);
- } else {
- return new Date(millisec);
- }
- }
-
- // This replaces the "persistent-flag" parts of S5.3 step 3
- isPersistent() {
- return this.maxAge != null || this.expires != Infinity;
- }
-
- // Mostly S5.1.2 and S5.2.3:
- canonicalizedDomain() {
- if (this.domain == null) {
- return null;
- }
- return canonicalDomain(this.domain);
- }
-
- cdomain() {
- return this.canonicalizedDomain();
- }
-}
-
-Cookie.cookiesCreated = 0;
-Cookie.parse = parse;
-Cookie.fromJSON = fromJSON;
-Cookie.serializableProperties = Object.keys(cookieDefaults);
-Cookie.sameSiteLevel = {
- strict: 3,
- lax: 2,
- none: 1
-};
-
-Cookie.sameSiteCanonical = {
- strict: "Strict",
- lax: "Lax"
-};
-
-function getNormalizedPrefixSecurity(prefixSecurity) {
- if (prefixSecurity != null) {
- const normalizedPrefixSecurity = prefixSecurity.toLowerCase();
- /* The three supported options */
- switch (normalizedPrefixSecurity) {
- case PrefixSecurityEnum.STRICT:
- case PrefixSecurityEnum.SILENT:
- case PrefixSecurityEnum.DISABLED:
- return normalizedPrefixSecurity;
- }
- }
- /* Default is SILENT */
- return PrefixSecurityEnum.SILENT;
-}
-
-class CookieJar {
- constructor(store, options = { rejectPublicSuffixes: true }) {
- if (typeof options === "boolean") {
- options = { rejectPublicSuffixes: options };
- }
- this.rejectPublicSuffixes = options.rejectPublicSuffixes;
- this.enableLooseMode = !!options.looseMode;
- this.allowSpecialUseDomain = !!options.allowSpecialUseDomain;
- this.store = store || new MemoryCookieStore();
- this.prefixSecurity = getNormalizedPrefixSecurity(options.prefixSecurity);
- this._cloneSync = syncWrap("clone");
- this._importCookiesSync = syncWrap("_importCookies");
- this.getCookiesSync = syncWrap("getCookies");
- this.getCookieStringSync = syncWrap("getCookieString");
- this.getSetCookieStringsSync = syncWrap("getSetCookieStrings");
- this.removeAllCookiesSync = syncWrap("removeAllCookies");
- this.setCookieSync = syncWrap("setCookie");
- this.serializeSync = syncWrap("serialize");
- }
-
- setCookie(cookie, url, options, cb) {
- let err;
- const context = getCookieContext(url);
- if (typeof options === "function") {
- cb = options;
- options = {};
- }
-
- const host = canonicalDomain(context.hostname);
- const loose = options.loose || this.enableLooseMode;
-
- let sameSiteContext = null;
- if (options.sameSiteContext) {
- sameSiteContext = checkSameSiteContext(options.sameSiteContext);
- if (!sameSiteContext) {
- return cb(new Error(SAME_SITE_CONTEXT_VAL_ERR));
- }
- }
-
- // S5.3 step 1
- if (typeof cookie === "string" || cookie instanceof String) {
- cookie = Cookie.parse(cookie, { loose: loose });
- if (!cookie) {
- err = new Error("Cookie failed to parse");
- return cb(options.ignoreError ? null : err);
- }
- } else if (!(cookie instanceof Cookie)) {
- // If you're seeing this error, and are passing in a Cookie object,
- // it *might* be a Cookie object from another loaded version of tough-cookie.
- err = new Error(
- "First argument to setCookie must be a Cookie object or string"
- );
- return cb(options.ignoreError ? null : err);
- }
-
- // S5.3 step 2
- const now = options.now || new Date(); // will assign later to save effort in the face of errors
-
- // S5.3 step 3: NOOP; persistent-flag and expiry-time is handled by getCookie()
-
- // S5.3 step 4: NOOP; domain is null by default
-
- // S5.3 step 5: public suffixes
- if (this.rejectPublicSuffixes && cookie.domain) {
- const suffix = pubsuffix.getPublicSuffix(cookie.cdomain());
- if (suffix == null) {
- // e.g. "com"
- err = new Error("Cookie has domain set to a public suffix");
- return cb(options.ignoreError ? null : err);
- }
- }
-
- // S5.3 step 6:
- if (cookie.domain) {
- if (!domainMatch(host, cookie.cdomain(), false)) {
- err = new Error(
- `Cookie not in this host's domain. Cookie:${cookie.cdomain()} Request:${host}`
- );
- return cb(options.ignoreError ? null : err);
- }
-
- if (cookie.hostOnly == null) {
- // don't reset if already set
- cookie.hostOnly = false;
- }
- } else {
- cookie.hostOnly = true;
- cookie.domain = host;
- }
-
- //S5.2.4 If the attribute-value is empty or if the first character of the
- //attribute-value is not %x2F ("/"):
- //Let cookie-path be the default-path.
- if (!cookie.path || cookie.path[0] !== "/") {
- cookie.path = defaultPath(context.pathname);
- cookie.pathIsDefault = true;
- }
-
- // S5.3 step 8: NOOP; secure attribute
- // S5.3 step 9: NOOP; httpOnly attribute
-
- // S5.3 step 10
- if (options.http === false && cookie.httpOnly) {
- err = new Error("Cookie is HttpOnly and this isn't an HTTP API");
- return cb(options.ignoreError ? null : err);
- }
-
- // 6252bis-02 S5.4 Step 13 & 14:
- if (cookie.sameSite !== "none" && sameSiteContext) {
- // "If the cookie's "same-site-flag" is not "None", and the cookie
- // is being set from a context whose "site for cookies" is not an
- // exact match for request-uri's host's registered domain, then
- // abort these steps and ignore the newly created cookie entirely."
- if (sameSiteContext === "none") {
- err = new Error(
- "Cookie is SameSite but this is a cross-origin request"
- );
- return cb(options.ignoreError ? null : err);
- }
- }
-
- /* 6265bis-02 S5.4 Steps 15 & 16 */
- const ignoreErrorForPrefixSecurity =
- this.prefixSecurity === PrefixSecurityEnum.SILENT;
- const prefixSecurityDisabled =
- this.prefixSecurity === PrefixSecurityEnum.DISABLED;
- /* If prefix checking is not disabled ...*/
- if (!prefixSecurityDisabled) {
- let errorFound = false;
- let errorMsg;
- /* Check secure prefix condition */
- if (!isSecurePrefixConditionMet(cookie)) {
- errorFound = true;
- errorMsg = "Cookie has __Secure prefix but Secure attribute is not set";
- } else if (!isHostPrefixConditionMet(cookie)) {
- /* Check host prefix condition */
- errorFound = true;
- errorMsg =
- "Cookie has __Host prefix but either Secure or HostOnly attribute is not set or Path is not '/'";
- }
- if (errorFound) {
- return cb(
- options.ignoreError || ignoreErrorForPrefixSecurity
- ? null
- : new Error(errorMsg)
- );
- }
- }
-
- const store = this.store;
-
- if (!store.updateCookie) {
- store.updateCookie = function(oldCookie, newCookie, cb) {
- this.putCookie(newCookie, cb);
- };
- }
-
- function withCookie(err, oldCookie) {
- if (err) {
- return cb(err);
- }
-
- const next = function(err) {
- if (err) {
- return cb(err);
- } else {
- cb(null, cookie);
- }
- };
-
- if (oldCookie) {
- // S5.3 step 11 - "If the cookie store contains a cookie with the same name,
- // domain, and path as the newly created cookie:"
- if (options.http === false && oldCookie.httpOnly) {
- // step 11.2
- err = new Error("old Cookie is HttpOnly and this isn't an HTTP API");
- return cb(options.ignoreError ? null : err);
- }
- cookie.creation = oldCookie.creation; // step 11.3
- cookie.creationIndex = oldCookie.creationIndex; // preserve tie-breaker
- cookie.lastAccessed = now;
- // Step 11.4 (delete cookie) is implied by just setting the new one:
- store.updateCookie(oldCookie, cookie, next); // step 12
- } else {
- cookie.creation = cookie.lastAccessed = now;
- store.putCookie(cookie, next); // step 12
- }
- }
-
- store.findCookie(cookie.domain, cookie.path, cookie.key, withCookie);
- }
-
- // RFC6365 S5.4
- getCookies(url, options, cb) {
- const context = getCookieContext(url);
- if (typeof options === "function") {
- cb = options;
- options = {};
- }
-
- const host = canonicalDomain(context.hostname);
- const path = context.pathname || "/";
-
- let secure = options.secure;
- if (
- secure == null &&
- context.protocol &&
- (context.protocol == "https:" || context.protocol == "wss:")
- ) {
- secure = true;
- }
-
- let sameSiteLevel = 0;
- if (options.sameSiteContext) {
- const sameSiteContext = checkSameSiteContext(options.sameSiteContext);
- sameSiteLevel = Cookie.sameSiteLevel[sameSiteContext];
- if (!sameSiteLevel) {
- return cb(new Error(SAME_SITE_CONTEXT_VAL_ERR));
- }
- }
-
- let http = options.http;
- if (http == null) {
- http = true;
- }
-
- const now = options.now || Date.now();
- const expireCheck = options.expire !== false;
- const allPaths = !!options.allPaths;
- const store = this.store;
-
- function matchingCookie(c) {
- // "Either:
- // The cookie's host-only-flag is true and the canonicalized
- // request-host is identical to the cookie's domain.
- // Or:
- // The cookie's host-only-flag is false and the canonicalized
- // request-host domain-matches the cookie's domain."
- if (c.hostOnly) {
- if (c.domain != host) {
- return false;
- }
- } else {
- if (!domainMatch(host, c.domain, false)) {
- return false;
- }
- }
-
- // "The request-uri's path path-matches the cookie's path."
- if (!allPaths && !pathMatch(path, c.path)) {
- return false;
- }
-
- // "If the cookie's secure-only-flag is true, then the request-uri's
- // scheme must denote a "secure" protocol"
- if (c.secure && !secure) {
- return false;
- }
-
- // "If the cookie's http-only-flag is true, then exclude the cookie if the
- // cookie-string is being generated for a "non-HTTP" API"
- if (c.httpOnly && !http) {
- return false;
- }
-
- // RFC6265bis-02 S5.3.7
- if (sameSiteLevel) {
- const cookieLevel = Cookie.sameSiteLevel[c.sameSite || "none"];
- if (cookieLevel > sameSiteLevel) {
- // only allow cookies at or below the request level
- return false;
- }
- }
-
- // deferred from S5.3
- // non-RFC: allow retention of expired cookies by choice
- if (expireCheck && c.expiryTime() <= now) {
- store.removeCookie(c.domain, c.path, c.key, () => {}); // result ignored
- return false;
- }
-
- return true;
- }
-
- store.findCookies(
- host,
- allPaths ? null : path,
- this.allowSpecialUseDomain,
- (err, cookies) => {
- if (err) {
- return cb(err);
- }
-
- cookies = cookies.filter(matchingCookie);
-
- // sorting of S5.4 part 2
- if (options.sort !== false) {
- cookies = cookies.sort(cookieCompare);
- }
-
- // S5.4 part 3
- const now = new Date();
- for (const cookie of cookies) {
- cookie.lastAccessed = now;
- }
- // TODO persist lastAccessed
-
- cb(null, cookies);
- }
- );
- }
-
- getCookieString(...args) {
- const cb = args.pop();
- const next = function(err, cookies) {
- if (err) {
- cb(err);
- } else {
- cb(
- null,
- cookies
- .sort(cookieCompare)
- .map(c => c.cookieString())
- .join("; ")
- );
- }
- };
- args.push(next);
- this.getCookies.apply(this, args);
- }
-
- getSetCookieStrings(...args) {
- const cb = args.pop();
- const next = function(err, cookies) {
- if (err) {
- cb(err);
- } else {
- cb(
- null,
- cookies.map(c => {
- return c.toString();
- })
- );
- }
- };
- args.push(next);
- this.getCookies.apply(this, args);
- }
-
- serialize(cb) {
- let type = this.store.constructor.name;
- if (type === "Object") {
- type = null;
- }
-
- // update README.md "Serialization Format" if you change this, please!
- const serialized = {
- // The version of tough-cookie that serialized this jar. Generally a good
- // practice since future versions can make data import decisions based on
- // known past behavior. When/if this matters, use `semver`.
- version: `tough-cookie@${VERSION}`,
-
- // add the store type, to make humans happy:
- storeType: type,
-
- // CookieJar configuration:
- rejectPublicSuffixes: !!this.rejectPublicSuffixes,
-
- // this gets filled from getAllCookies:
- cookies: []
- };
-
- if (
- !(
- this.store.getAllCookies &&
- typeof this.store.getAllCookies === "function"
- )
- ) {
- return cb(
- new Error(
- "store does not support getAllCookies and cannot be serialized"
- )
- );
- }
-
- this.store.getAllCookies((err, cookies) => {
- if (err) {
- return cb(err);
- }
-
- serialized.cookies = cookies.map(cookie => {
- // convert to serialized 'raw' cookies
- cookie = cookie instanceof Cookie ? cookie.toJSON() : cookie;
-
- // Remove the index so new ones get assigned during deserialization
- delete cookie.creationIndex;
-
- return cookie;
- });
-
- return cb(null, serialized);
- });
- }
-
- toJSON() {
- return this.serializeSync();
- }
-
- // use the class method CookieJar.deserialize instead of calling this directly
- _importCookies(serialized, cb) {
- let cookies = serialized.cookies;
- if (!cookies || !Array.isArray(cookies)) {
- return cb(new Error("serialized jar has no cookies array"));
- }
- cookies = cookies.slice(); // do not modify the original
-
- const putNext = err => {
- if (err) {
- return cb(err);
- }
-
- if (!cookies.length) {
- return cb(err, this);
- }
-
- let cookie;
- try {
- cookie = fromJSON(cookies.shift());
- } catch (e) {
- return cb(e);
- }
-
- if (cookie === null) {
- return putNext(null); // skip this cookie
- }
-
- this.store.putCookie(cookie, putNext);
- };
-
- putNext();
- }
-
- clone(newStore, cb) {
- if (arguments.length === 1) {
- cb = newStore;
- newStore = null;
- }
-
- this.serialize((err, serialized) => {
- if (err) {
- return cb(err);
- }
- CookieJar.deserialize(serialized, newStore, cb);
- });
- }
-
- cloneSync(newStore) {
- if (arguments.length === 0) {
- return this._cloneSync();
- }
- if (!newStore.synchronous) {
- throw new Error(
- "CookieJar clone destination store is not synchronous; use async API instead."
- );
- }
- return this._cloneSync(newStore);
- }
-
- removeAllCookies(cb) {
- const store = this.store;
-
- // Check that the store implements its own removeAllCookies(). The default
- // implementation in Store will immediately call the callback with a "not
- // implemented" Error.
- if (
- typeof store.removeAllCookies === "function" &&
- store.removeAllCookies !== Store.prototype.removeAllCookies
- ) {
- return store.removeAllCookies(cb);
- }
-
- store.getAllCookies((err, cookies) => {
- if (err) {
- return cb(err);
- }
-
- if (cookies.length === 0) {
- return cb(null);
- }
-
- let completedCount = 0;
- const removeErrors = [];
-
- function removeCookieCb(removeErr) {
- if (removeErr) {
- removeErrors.push(removeErr);
- }
-
- completedCount++;
-
- if (completedCount === cookies.length) {
- return cb(removeErrors.length ? removeErrors[0] : null);
- }
- }
-
- cookies.forEach(cookie => {
- store.removeCookie(
- cookie.domain,
- cookie.path,
- cookie.key,
- removeCookieCb
- );
- });
- });
- }
-
- static deserialize(strOrObj, store, cb) {
- if (arguments.length !== 3) {
- // store is optional
- cb = store;
- store = null;
- }
-
- let serialized;
- if (typeof strOrObj === "string") {
- serialized = jsonParse(strOrObj);
- if (serialized instanceof Error) {
- return cb(serialized);
- }
- } else {
- serialized = strOrObj;
- }
-
- const jar = new CookieJar(store, serialized.rejectPublicSuffixes);
- jar._importCookies(serialized, err => {
- if (err) {
- return cb(err);
- }
- cb(null, jar);
- });
- }
-
- static deserializeSync(strOrObj, store) {
- const serialized =
- typeof strOrObj === "string" ? JSON.parse(strOrObj) : strOrObj;
- const jar = new CookieJar(store, serialized.rejectPublicSuffixes);
-
- // catch this mistake early:
- if (!jar.store.synchronous) {
- throw new Error(
- "CookieJar store is not synchronous; use async API instead."
- );
- }
-
- jar._importCookiesSync(serialized);
- return jar;
- }
-}
-CookieJar.fromJSON = CookieJar.deserializeSync;
-
-[
- "_importCookies",
- "clone",
- "getCookies",
- "getCookieString",
- "getSetCookieStrings",
- "removeAllCookies",
- "serialize",
- "setCookie"
-].forEach(name => {
- CookieJar.prototype[name] = fromCallback(CookieJar.prototype[name]);
-});
-CookieJar.deserialize = fromCallback(CookieJar.deserialize);
-
-// Use a closure to provide a true imperative API for synchronous stores.
-function syncWrap(method) {
- return function(...args) {
- if (!this.store.synchronous) {
- throw new Error(
- "CookieJar store is not synchronous; use async API instead."
- );
- }
-
- let syncErr, syncResult;
- this[method](...args, (err, result) => {
- syncErr = err;
- syncResult = result;
- });
-
- if (syncErr) {
- throw syncErr;
- }
- return syncResult;
- };
-}
-
-exports.version = VERSION;
-exports.CookieJar = CookieJar;
-exports.Cookie = Cookie;
-exports.Store = Store;
-exports.MemoryCookieStore = MemoryCookieStore;
-exports.parseDate = parseDate;
-exports.formatDate = formatDate;
-exports.parse = parse;
-exports.fromJSON = fromJSON;
-exports.domainMatch = domainMatch;
-exports.defaultPath = defaultPath;
-exports.pathMatch = pathMatch;
-exports.getPublicSuffix = pubsuffix.getPublicSuffix;
-exports.cookieCompare = cookieCompare;
-exports.permuteDomain = require("./permuteDomain").permuteDomain;
-exports.permutePath = permutePath;
-exports.canonicalDomain = canonicalDomain;
-exports.PrefixSecurityEnum = PrefixSecurityEnum;
diff --git a/node_modules/@azure/core-http/node_modules/tough-cookie/lib/memstore.js b/node_modules/@azure/core-http/node_modules/tough-cookie/lib/memstore.js
deleted file mode 100644
index 912eead354..0000000000
--- a/node_modules/@azure/core-http/node_modules/tough-cookie/lib/memstore.js
+++ /dev/null
@@ -1,190 +0,0 @@
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-"use strict";
-const { fromCallback } = require("universalify");
-const Store = require("./store").Store;
-const permuteDomain = require("./permuteDomain").permuteDomain;
-const pathMatch = require("./pathMatch").pathMatch;
-const util = require("util");
-
-class MemoryCookieStore extends Store {
- constructor() {
- super();
- this.synchronous = true;
- this.idx = {};
- if (util.inspect.custom) {
- this[util.inspect.custom] = this.inspect;
- }
- }
-
- inspect() {
- return `{ idx: ${util.inspect(this.idx, false, 2)} }`;
- }
-
- findCookie(domain, path, key, cb) {
- if (!this.idx[domain]) {
- return cb(null, undefined);
- }
- if (!this.idx[domain][path]) {
- return cb(null, undefined);
- }
- return cb(null, this.idx[domain][path][key] || null);
- }
- findCookies(domain, path, allowSpecialUseDomain, cb) {
- const results = [];
- if (typeof allowSpecialUseDomain === "function") {
- cb = allowSpecialUseDomain;
- allowSpecialUseDomain = false;
- }
- if (!domain) {
- return cb(null, []);
- }
-
- let pathMatcher;
- if (!path) {
- // null means "all paths"
- pathMatcher = function matchAll(domainIndex) {
- for (const curPath in domainIndex) {
- const pathIndex = domainIndex[curPath];
- for (const key in pathIndex) {
- results.push(pathIndex[key]);
- }
- }
- };
- } else {
- pathMatcher = function matchRFC(domainIndex) {
- //NOTE: we should use path-match algorithm from S5.1.4 here
- //(see : https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/canonical_cookie.cc#L299)
- Object.keys(domainIndex).forEach(cookiePath => {
- if (pathMatch(path, cookiePath)) {
- const pathIndex = domainIndex[cookiePath];
- for (const key in pathIndex) {
- results.push(pathIndex[key]);
- }
- }
- });
- };
- }
-
- const domains = permuteDomain(domain, allowSpecialUseDomain) || [domain];
- const idx = this.idx;
- domains.forEach(curDomain => {
- const domainIndex = idx[curDomain];
- if (!domainIndex) {
- return;
- }
- pathMatcher(domainIndex);
- });
-
- cb(null, results);
- }
-
- putCookie(cookie, cb) {
- if (!this.idx[cookie.domain]) {
- this.idx[cookie.domain] = {};
- }
- if (!this.idx[cookie.domain][cookie.path]) {
- this.idx[cookie.domain][cookie.path] = {};
- }
- this.idx[cookie.domain][cookie.path][cookie.key] = cookie;
- cb(null);
- }
- updateCookie(oldCookie, newCookie, cb) {
- // updateCookie() may avoid updating cookies that are identical. For example,
- // lastAccessed may not be important to some stores and an equality
- // comparison could exclude that field.
- this.putCookie(newCookie, cb);
- }
- removeCookie(domain, path, key, cb) {
- if (
- this.idx[domain] &&
- this.idx[domain][path] &&
- this.idx[domain][path][key]
- ) {
- delete this.idx[domain][path][key];
- }
- cb(null);
- }
- removeCookies(domain, path, cb) {
- if (this.idx[domain]) {
- if (path) {
- delete this.idx[domain][path];
- } else {
- delete this.idx[domain];
- }
- }
- return cb(null);
- }
- removeAllCookies(cb) {
- this.idx = {};
- return cb(null);
- }
- getAllCookies(cb) {
- const cookies = [];
- const idx = this.idx;
-
- const domains = Object.keys(idx);
- domains.forEach(domain => {
- const paths = Object.keys(idx[domain]);
- paths.forEach(path => {
- const keys = Object.keys(idx[domain][path]);
- keys.forEach(key => {
- if (key !== null) {
- cookies.push(idx[domain][path][key]);
- }
- });
- });
- });
-
- // Sort by creationIndex so deserializing retains the creation order.
- // When implementing your own store, this SHOULD retain the order too
- cookies.sort((a, b) => {
- return (a.creationIndex || 0) - (b.creationIndex || 0);
- });
-
- cb(null, cookies);
- }
-}
-
-[
- "findCookie",
- "findCookies",
- "putCookie",
- "updateCookie",
- "removeCookie",
- "removeCookies",
- "removeAllCookies",
- "getAllCookies"
-].forEach(name => {
- MemoryCookieStore[name] = fromCallback(MemoryCookieStore.prototype[name]);
-});
-
-exports.MemoryCookieStore = MemoryCookieStore;
diff --git a/node_modules/@azure/core-http/node_modules/tough-cookie/lib/pathMatch.js b/node_modules/@azure/core-http/node_modules/tough-cookie/lib/pathMatch.js
deleted file mode 100644
index 16ff63eea6..0000000000
--- a/node_modules/@azure/core-http/node_modules/tough-cookie/lib/pathMatch.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-"use strict";
-/*
- * "A request-path path-matches a given cookie-path if at least one of the
- * following conditions holds:"
- */
-function pathMatch(reqPath, cookiePath) {
- // "o The cookie-path and the request-path are identical."
- if (cookiePath === reqPath) {
- return true;
- }
-
- const idx = reqPath.indexOf(cookiePath);
- if (idx === 0) {
- // "o The cookie-path is a prefix of the request-path, and the last
- // character of the cookie-path is %x2F ("/")."
- if (cookiePath.substr(-1) === "/") {
- return true;
- }
-
- // " o The cookie-path is a prefix of the request-path, and the first
- // character of the request-path that is not included in the cookie- path
- // is a %x2F ("/") character."
- if (reqPath.substr(cookiePath.length, 1) === "/") {
- return true;
- }
- }
-
- return false;
-}
-
-exports.pathMatch = pathMatch;
diff --git a/node_modules/@azure/core-http/node_modules/tough-cookie/lib/permuteDomain.js b/node_modules/@azure/core-http/node_modules/tough-cookie/lib/permuteDomain.js
deleted file mode 100644
index 78e6cad568..0000000000
--- a/node_modules/@azure/core-http/node_modules/tough-cookie/lib/permuteDomain.js
+++ /dev/null
@@ -1,70 +0,0 @@
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-"use strict";
-const pubsuffix = require("./pubsuffix-psl");
-
-// Gives the permutation of all possible domainMatch()es of a given domain. The
-// array is in shortest-to-longest order. Handy for indexing.
-const SPECIAL_USE_DOMAINS = ["local"]; // RFC 6761
-function permuteDomain(domain, allowSpecialUseDomain) {
- let pubSuf = null;
- if (allowSpecialUseDomain) {
- const domainParts = domain.split(".");
- if (SPECIAL_USE_DOMAINS.includes(domainParts[domainParts.length - 1])) {
- pubSuf = `${domainParts[domainParts.length - 2]}.${
- domainParts[domainParts.length - 1]
- }`;
- } else {
- pubSuf = pubsuffix.getPublicSuffix(domain);
- }
- } else {
- pubSuf = pubsuffix.getPublicSuffix(domain);
- }
-
- if (!pubSuf) {
- return null;
- }
- if (pubSuf == domain) {
- return [domain];
- }
-
- const prefix = domain.slice(0, -(pubSuf.length + 1)); // ".example.com"
- const parts = prefix.split(".").reverse();
- let cur = pubSuf;
- const permutations = [cur];
- while (parts.length) {
- cur = `${parts.shift()}.${cur}`;
- permutations.push(cur);
- }
- return permutations;
-}
-
-exports.permuteDomain = permuteDomain;
diff --git a/node_modules/@azure/core-http/node_modules/tough-cookie/lib/pubsuffix-psl.js b/node_modules/@azure/core-http/node_modules/tough-cookie/lib/pubsuffix-psl.js
deleted file mode 100644
index 93a8577c6b..0000000000
--- a/node_modules/@azure/core-http/node_modules/tough-cookie/lib/pubsuffix-psl.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*!
- * Copyright (c) 2018, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-"use strict";
-const psl = require("psl");
-
-function getPublicSuffix(domain) {
- return psl.get(domain);
-}
-
-exports.getPublicSuffix = getPublicSuffix;
diff --git a/node_modules/@azure/core-http/node_modules/tough-cookie/lib/store.js b/node_modules/@azure/core-http/node_modules/tough-cookie/lib/store.js
deleted file mode 100644
index 2ed0259e02..0000000000
--- a/node_modules/@azure/core-http/node_modules/tough-cookie/lib/store.js
+++ /dev/null
@@ -1,76 +0,0 @@
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-"use strict";
-/*jshint unused:false */
-
-class Store {
- constructor() {
- this.synchronous = false;
- }
-
- findCookie(domain, path, key, cb) {
- throw new Error("findCookie is not implemented");
- }
-
- findCookies(domain, path, allowSpecialUseDomain, cb) {
- throw new Error("findCookies is not implemented");
- }
-
- putCookie(cookie, cb) {
- throw new Error("putCookie is not implemented");
- }
-
- updateCookie(oldCookie, newCookie, cb) {
- // recommended default implementation:
- // return this.putCookie(newCookie, cb);
- throw new Error("updateCookie is not implemented");
- }
-
- removeCookie(domain, path, key, cb) {
- throw new Error("removeCookie is not implemented");
- }
-
- removeCookies(domain, path, cb) {
- throw new Error("removeCookies is not implemented");
- }
-
- removeAllCookies(cb) {
- throw new Error("removeAllCookies is not implemented");
- }
-
- getAllCookies(cb) {
- throw new Error(
- "getAllCookies is not implemented (therefore jar cannot be serialized)"
- );
- }
-}
-
-exports.Store = Store;
diff --git a/node_modules/@azure/core-http/node_modules/tough-cookie/lib/version.js b/node_modules/@azure/core-http/node_modules/tough-cookie/lib/version.js
deleted file mode 100644
index e52f25be72..0000000000
--- a/node_modules/@azure/core-http/node_modules/tough-cookie/lib/version.js
+++ /dev/null
@@ -1,2 +0,0 @@
-// generated by genversion
-module.exports = '4.0.0'
diff --git a/node_modules/@azure/core-http/node_modules/tough-cookie/package.json b/node_modules/@azure/core-http/node_modules/tough-cookie/package.json
deleted file mode 100644
index e07dcb7cbf..0000000000
--- a/node_modules/@azure/core-http/node_modules/tough-cookie/package.json
+++ /dev/null
@@ -1,109 +0,0 @@
-{
- "author": {
- "name": "Jeremy Stashewsky",
- "email": "jstash@gmail.com",
- "website": "https://github.com/stash"
- },
- "contributors": [
- {
- "name": "Ivan Nikulin",
- "website": "https://github.com/inikulin"
- },
- {
- "name": "Shivan Kaul Sahib",
- "website": "https://github.com/ShivanKaul"
- },
- {
- "name": "Clint Ruoho",
- "website": "https://github.com/ruoho"
- },
- {
- "name": "Ian Livingstone",
- "website": "https://github.com/ianlivingstone"
- },
- {
- "name": "Andrew Waterman",
- "website": "https://github.com/awaterma"
- },
- {
- "name": "Michael de Libero ",
- "website": "https://github.com/medelibero-sfdc"
- },
- {
- "name": "Jonathan Stewmon",
- "website": "https://github.com/jstewmon"
- },
- {
- "name": "Miguel Roncancio",
- "website": "https://github.com/miggs125"
- },
- {
- "name": "Sebastian Mayr",
- "website": "https://github.com/Sebmaster"
- },
- {
- "name": "Alexander Savin",
- "website": "https://github.com/apsavin"
- },
- {
- "name": "Lalit Kapoor",
- "website": "https://github.com/lalitkapoor"
- },
- {
- "name": "Sam Thompson",
- "website": "https://github.com/sambthompson"
- }
- ],
- "license": "BSD-3-Clause",
- "name": "tough-cookie",
- "description": "RFC6265 Cookies and Cookie Jar for node.js",
- "keywords": [
- "HTTP",
- "cookie",
- "cookies",
- "set-cookie",
- "cookiejar",
- "jar",
- "RFC6265",
- "RFC2965"
- ],
- "version": "4.0.0",
- "homepage": "https://github.com/salesforce/tough-cookie",
- "repository": {
- "type": "git",
- "url": "git://github.com/salesforce/tough-cookie.git"
- },
- "bugs": {
- "url": "https://github.com/salesforce/tough-cookie/issues"
- },
- "main": "./lib/cookie",
- "files": [
- "lib"
- ],
- "scripts": {
- "version": "genversion lib/version.js && git add lib/version.js",
- "test": "vows test/*_test.js",
- "cover": "nyc --reporter=lcov --reporter=html vows test/*_test.js",
- "eslint": "eslint --env node --ext .js .",
- "prettier": "prettier '**/*.{json,ts,yaml,md}'",
- "format": "npm run eslint -- --fix"
- },
- "engines": {
- "node": ">=6"
- },
- "devDependencies": {
- "async": "^2.6.2",
- "eslint": "^5.16.0",
- "eslint-config-prettier": "^4.2.0",
- "eslint-plugin-prettier": "^3.0.1",
- "genversion": "^2.1.0",
- "nyc": "^14.0.0",
- "prettier": "^1.17.0",
- "vows": "^0.8.2"
- },
- "dependencies": {
- "psl": "^1.1.33",
- "punycode": "^2.1.1",
- "universalify": "^0.1.2"
- }
-}
diff --git a/node_modules/@azure/ms-rest-js/dist/msRest.browser.js b/node_modules/@azure/ms-rest-js/dist/msRest.browser.js
index b2ab5406e7..01442a6fa7 100644
--- a/node_modules/@azure/ms-rest-js/dist/msRest.browser.js
+++ b/node_modules/@azure/ms-rest-js/dist/msRest.browser.js
@@ -262,7 +262,7 @@
* @const
* @type {string}
*/
- msRestVersion: "2.6.2",
+ msRestVersion: "2.7.0",
/**
* Specifies HTTP.
*
@@ -1906,10 +1906,15 @@
// according to the spec. There are no HTML/XSS security concerns on the usage of
// parseFromString() here.
var ttPolicy;
- if (typeof self.trustedTypes !== "undefined") {
- ttPolicy = self.trustedTypes.createPolicy("@azure/ms-rest-js#xml.browser", {
- createHTML: function (s) { return s; },
- });
+ try {
+ if (typeof self.trustedTypes !== "undefined") {
+ ttPolicy = self.trustedTypes.createPolicy("@azure/ms-rest-js#xml.browser", {
+ createHTML: function (s) { return s; },
+ });
+ }
+ }
+ catch (e) {
+ console.warn('Could not create trusted types policy "@azure/ms-rest-js#xml.browser"');
}
function parseXML(str) {
var _a;
diff --git a/node_modules/@azure/ms-rest-js/dist/msRest.browser.js.map b/node_modules/@azure/ms-rest-js/dist/msRest.browser.js.map
index b27ee4dea3..3f80e42713 100644
--- a/node_modules/@azure/ms-rest-js/dist/msRest.browser.js.map
+++ b/node_modules/@azure/ms-rest-js/dist/msRest.browser.js.map
@@ -1 +1 @@
-{"version":3,"file":"msRest.browser.js","sources":["../lib/httpHeaders.ts","../lib/util/base64.browser.ts","../node_modules/uuid/dist/esm-browser/rng.js","../node_modules/uuid/dist/esm-browser/regex.js","../node_modules/uuid/dist/esm-browser/validate.js","../node_modules/uuid/dist/esm-browser/stringify.js","../node_modules/uuid/dist/esm-browser/v4.js","../lib/util/constants.ts","../lib/util/utils.ts","../lib/serializer.ts","../lib/webResource.ts","../node_modules/tslib/tslib.es6.js","../lib/restError.ts","../lib/xhrHttpClient.ts","../lib/httpPipelineLogLevel.ts","../node_modules/@azure/core-auth/src/tokenCredential.ts","../lib/operationParameter.ts","../lib/operationSpec.ts","../lib/util/xml.browser.ts","../lib/policies/requestPolicy.ts","../lib/policies/deserializationPolicy.ts","../lib/policies/exponentialRetryPolicy.ts","../lib/policies/generateClientRequestIdPolicy.ts","../lib/policies/msRestUserAgentPolicy.browser.ts","../lib/policies/userAgentPolicy.ts","../lib/url.ts","../lib/policies/redirectPolicy.ts","../lib/policies/rpRegistrationPolicy.ts","../lib/policies/signingPolicy.ts","../lib/policies/systemErrorRetryPolicy.ts","../lib/queryCollectionFormat.ts","../lib/policies/agentPolicy.browser.ts","../lib/policies/proxyPolicy.browser.ts","../lib/policies/throttlingRetryPolicy.ts","../lib/credentials/azureIdentityTokenCredentialAdapter.ts","../lib/serviceClient.ts","../lib/policies/logPolicy.ts","../lib/credentials/tokenCredentials.ts","../lib/credentials/basicAuthenticationCredentials.ts","../lib/credentials/apiKeyCredentials.ts","../lib/credentials/topicCredentials.ts","../lib/credentials/domainCredentials.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License. See License.txt in the project root for license information.\n\n/**\n * A collection of HttpHeaders that can be sent with a HTTP request.\n */\nfunction getHeaderKey(headerName: string) {\n return headerName.toLowerCase();\n}\n\n/**\n * An individual header within a HttpHeaders collection.\n */\nexport interface HttpHeader {\n /**\n * The name of the header.\n */\n name: string;\n\n /**\n * The value of the header.\n */\n value: string;\n}\n\n/**\n * A HttpHeaders collection represented as a simple JSON object.\n */\nexport type RawHttpHeaders = { [headerName: string]: string };\n\n/**\n * A collection of HTTP header key/value pairs.\n */\nexport interface HttpHeadersLike {\n /**\n * Set a header in this collection with the provided name and value. The name is\n * case-insensitive.\n * @param headerName The name of the header to set. This value is case-insensitive.\n * @param headerValue The value of the header to set.\n */\n set(headerName: string, headerValue: string | number): void;\n /**\n * Get the header value for the provided header name, or undefined if no header exists in this\n * collection with the provided name.\n * @param headerName The name of the header.\n */\n get(headerName: string): string | undefined;\n /**\n * Get whether or not this header collection contains a header entry for the provided header name.\n */\n contains(headerName: string): boolean;\n /**\n * Remove the header with the provided headerName. Return whether or not the header existed and\n * was removed.\n * @param headerName The name of the header to remove.\n */\n remove(headerName: string): boolean;\n /**\n * Get the headers that are contained this collection as an object.\n */\n rawHeaders(): RawHttpHeaders;\n /**\n * Get the headers that are contained in this collection as an array.\n */\n headersArray(): HttpHeader[];\n /**\n * Get the header names that are contained in this collection.\n */\n headerNames(): string[];\n /**\n * Get the header values that are contained in this collection.\n */\n headerValues(): string[];\n /**\n * Create a deep clone/copy of this HttpHeaders collection.\n */\n clone(): HttpHeadersLike;\n /**\n * Get the JSON object representation of this HTTP header collection.\n * The result is the same as `rawHeaders()`.\n */\n toJson(): RawHttpHeaders;\n}\n\nexport function isHttpHeadersLike(object?: any): object is HttpHeadersLike {\n if (!object || typeof object !== \"object\") {\n return false;\n }\n\n if (\n typeof object.rawHeaders === \"function\" &&\n typeof object.clone === \"function\" &&\n typeof object.get === \"function\" &&\n typeof object.set === \"function\" &&\n typeof object.contains === \"function\" &&\n typeof object.remove === \"function\" &&\n typeof object.headersArray === \"function\" &&\n typeof object.headerValues === \"function\" &&\n typeof object.headerNames === \"function\" &&\n typeof object.toJson === \"function\"\n ) {\n return true;\n }\n return false;\n}\n\n/**\n * A collection of HTTP header key/value pairs.\n */\nexport class HttpHeaders {\n private readonly _headersMap: { [headerKey: string]: HttpHeader };\n\n constructor(rawHeaders?: RawHttpHeaders) {\n this._headersMap = {};\n if (rawHeaders) {\n for (const headerName in rawHeaders) {\n this.set(headerName, rawHeaders[headerName]);\n }\n }\n }\n\n /**\n * Set a header in this collection with the provided name and value. The name is\n * case-insensitive.\n * @param headerName The name of the header to set. This value is case-insensitive.\n * @param headerValue The value of the header to set.\n */\n public set(headerName: string, headerValue: string | number): void {\n this._headersMap[getHeaderKey(headerName)] = {\n name: headerName,\n value: headerValue.toString(),\n };\n }\n\n /**\n * Get the header value for the provided header name, or undefined if no header exists in this\n * collection with the provided name.\n * @param headerName The name of the header.\n */\n public get(headerName: string): string | undefined {\n const header: HttpHeader = this._headersMap[getHeaderKey(headerName)];\n return !header ? undefined : header.value;\n }\n\n /**\n * Get whether or not this header collection contains a header entry for the provided header name.\n */\n public contains(headerName: string): boolean {\n return !!this._headersMap[getHeaderKey(headerName)];\n }\n\n /**\n * Remove the header with the provided headerName. Return whether or not the header existed and\n * was removed.\n * @param headerName The name of the header to remove.\n */\n public remove(headerName: string): boolean {\n const result: boolean = this.contains(headerName);\n delete this._headersMap[getHeaderKey(headerName)];\n return result;\n }\n\n /**\n * Get the headers that are contained this collection as an object.\n */\n public rawHeaders(): RawHttpHeaders {\n const result: RawHttpHeaders = {};\n for (const headerKey in this._headersMap) {\n const header: HttpHeader = this._headersMap[headerKey];\n result[header.name.toLowerCase()] = header.value;\n }\n return result;\n }\n\n /**\n * Get the headers that are contained in this collection as an array.\n */\n public headersArray(): HttpHeader[] {\n const headers: HttpHeader[] = [];\n for (const headerKey in this._headersMap) {\n headers.push(this._headersMap[headerKey]);\n }\n return headers;\n }\n\n /**\n * Get the header names that are contained in this collection.\n */\n public headerNames(): string[] {\n const headerNames: string[] = [];\n const headers: HttpHeader[] = this.headersArray();\n for (let i = 0; i < headers.length; ++i) {\n headerNames.push(headers[i].name);\n }\n return headerNames;\n }\n\n /**\n * Get the header names that are contained in this collection.\n */\n public headerValues(): string[] {\n const headerValues: string[] = [];\n const headers: HttpHeader[] = this.headersArray();\n for (let i = 0; i < headers.length; ++i) {\n headerValues.push(headers[i].value);\n }\n return headerValues;\n }\n\n /**\n * Get the JSON object representation of this HTTP header collection.\n */\n public toJson(): RawHttpHeaders {\n return this.rawHeaders();\n }\n\n /**\n * Get the string representation of this HTTP header collection.\n */\n public toString(): string {\n return JSON.stringify(this.toJson());\n }\n\n /**\n * Create a deep clone/copy of this HttpHeaders collection.\n */\n public clone(): HttpHeaders {\n return new HttpHeaders(this.rawHeaders());\n }\n}\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License. See License.txt in the project root for license information.\n\n/**\n * Encodes a string in base64 format.\n * @param value the string to encode\n */\nexport function encodeString(value: string): string {\n return btoa(value);\n}\n\n/**\n * Encodes a byte array in base64 format.\n * @param value the Uint8Aray to encode\n */\nexport function encodeByteArray(value: Uint8Array): string {\n let str = \"\";\n for (let i = 0; i < value.length; i++) {\n str += String.fromCharCode(value[i]);\n }\n return btoa(str);\n}\n\n/**\n * Decodes a base64 string into a byte array.\n * @param value the base64 string to decode\n */\nexport function decodeString(value: string): Uint8Array {\n const byteString = atob(value);\n const arr = new Uint8Array(byteString.length);\n for (let i = 0; i < byteString.length; i++) {\n arr[i] = byteString.charCodeAt(i);\n }\n return arr;\n}\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License. See License.txt in the project root for license information.\n\nexport const Constants = {\n /**\n * The ms-rest version\n * @const\n * @type {string}\n */\n msRestVersion: \"2.6.2\",\n\n /**\n * Specifies HTTP.\n *\n * @const\n * @type {string}\n */\n HTTP: \"http:\",\n\n /**\n * Specifies HTTPS.\n *\n * @const\n * @type {string}\n */\n HTTPS: \"https:\",\n\n /**\n * Specifies HTTP Proxy.\n *\n * @const\n * @type {string}\n */\n HTTP_PROXY: \"HTTP_PROXY\",\n\n /**\n * Specifies HTTPS Proxy.\n *\n * @const\n * @type {string}\n */\n HTTPS_PROXY: \"HTTPS_PROXY\",\n\n /**\n * Specifies NO Proxy.\n */\n NO_PROXY: \"NO_PROXY\",\n\n /**\n * Specifies ALL Proxy.\n */\n ALL_PROXY: \"ALL_PROXY\",\n\n HttpConstants: {\n /**\n * Http Verbs\n *\n * @const\n * @enum {string}\n */\n HttpVerbs: {\n PUT: \"PUT\",\n GET: \"GET\",\n DELETE: \"DELETE\",\n POST: \"POST\",\n MERGE: \"MERGE\",\n HEAD: \"HEAD\",\n PATCH: \"PATCH\",\n },\n\n StatusCodes: {\n TooManyRequests: 429,\n },\n },\n\n /**\n * Defines constants for use with HTTP headers.\n */\n HeaderConstants: {\n /**\n * The Authorization header.\n *\n * @const\n * @type {string}\n */\n AUTHORIZATION: \"authorization\",\n\n AUTHORIZATION_SCHEME: \"Bearer\",\n\n /**\n * The Retry-After response-header field can be used with a 503 (Service\n * Unavailable) or 349 (Too Many Requests) responses to indicate how long\n * the service is expected to be unavailable to the requesting client.\n *\n * @const\n * @type {string}\n */\n RETRY_AFTER: \"Retry-After\",\n\n /**\n * The UserAgent header.\n *\n * @const\n * @type {string}\n */\n USER_AGENT: \"User-Agent\",\n },\n};\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License. See License.txt in the project root for license information.\n\nimport { v4 as uuidv4 } from \"uuid\";\nimport { HttpOperationResponse } from \"../httpOperationResponse\";\nimport { RestError } from \"../restError\";\nimport { WebResourceLike } from \"../webResource\";\nimport { Constants } from \"./constants\";\n\n/**\n * A constant that indicates whether the environment is node.js or browser based.\n */\nexport const isNode =\n typeof process !== \"undefined\" &&\n !!process.version &&\n !!process.versions &&\n !!process.versions.node;\n\n/**\n * Checks if a parsed URL is HTTPS\n *\n * @param {object} urlToCheck The url to check\n * @return {boolean} True if the URL is HTTPS; false otherwise.\n */\nexport function urlIsHTTPS(urlToCheck: { protocol: string }): boolean {\n return urlToCheck.protocol.toLowerCase() === Constants.HTTPS;\n}\n\n/**\n * Encodes an URI.\n *\n * @param {string} uri The URI to be encoded.\n * @return {string} The encoded URI.\n */\nexport function encodeUri(uri: string): string {\n return encodeURIComponent(uri)\n .replace(/!/g, \"%21\")\n .replace(/\"/g, \"%27\")\n .replace(/\\(/g, \"%28\")\n .replace(/\\)/g, \"%29\")\n .replace(/\\*/g, \"%2A\");\n}\n\n/**\n * Returns a stripped version of the Http Response which only contains body,\n * headers and the status.\n *\n * @param {HttpOperationResponse} response The Http Response\n *\n * @return {object} The stripped version of Http Response.\n */\nexport function stripResponse(response: HttpOperationResponse): any {\n const strippedResponse: any = {};\n strippedResponse.body = response.bodyAsText;\n strippedResponse.headers = response.headers;\n strippedResponse.status = response.status;\n return strippedResponse;\n}\n\n/**\n * Returns a stripped version of the Http Request that does not contain the\n * Authorization header.\n *\n * @param {WebResource} request The Http Request object\n *\n * @return {WebResource} The stripped version of Http Request.\n */\nexport function stripRequest(request: WebResourceLike): WebResourceLike {\n const strippedRequest = request.clone();\n if (strippedRequest.headers) {\n strippedRequest.headers.remove(\"authorization\");\n }\n return strippedRequest;\n}\n\n/**\n * Validates the given uuid as a string\n *\n * @param {string} uuid The uuid as a string that needs to be validated\n *\n * @return {boolean} True if the uuid is valid; false otherwise.\n */\nexport function isValidUuid(uuid: string): boolean {\n const validUuidRegex = new RegExp(\n \"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\",\n \"ig\"\n );\n return validUuidRegex.test(uuid);\n}\n\n/**\n * Provides an array of values of an object. For example\n * for a given object { \"a\": \"foo\", \"b\": \"bar\" }, the method returns [\"foo\", \"bar\"].\n *\n * @param {object} obj An object whose properties need to be enumerated so that it\"s values can be provided as an array\n *\n * @return {any[]} An array of values of the given object.\n */\nexport function objectValues(obj: { [key: string]: any }): any[] {\n const result: any[] = [];\n if (obj && obj instanceof Object) {\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n result.push((obj)[key]);\n }\n }\n } else {\n throw new Error(\n `The provided object ${JSON.stringify(\n obj,\n undefined,\n 2\n )} is not a valid object that can be ` + `enumerated to provide its values as an array.`\n );\n }\n return result;\n}\n\n/**\n * Generated UUID\n *\n * @return {string} RFC4122 v4 UUID.\n */\nexport function generateUuid(): string {\n return uuidv4();\n}\n\n/**\n * Executes an array of promises sequentially. Inspiration of this method is here:\n * https://pouchdb.com/2015/05/18/we-have-a-problem-with-promises.html. An awesome blog on promises!\n *\n * @param {Array} promiseFactories An array of promise factories(A function that return a promise)\n *\n * @param {any} [kickstart] Input to the first promise that is used to kickstart the promise chain.\n * If not provided then the promise chain starts with undefined.\n *\n * @return A chain of resolved or rejected promises\n */\nexport function executePromisesSequentially(promiseFactories: Array, kickstart: any) {\n let result = Promise.resolve(kickstart);\n promiseFactories.forEach((promiseFactory) => {\n result = result.then(promiseFactory);\n });\n return result;\n}\n\n/**\n * Merges source object into the target object\n * @param {object} source The object that needs to be merged\n *\n * @param {object} target The object to be merged into\n *\n * @returns {object} Returns the merged target object.\n */\nexport function mergeObjects(source: { [key: string]: any }, target: { [key: string]: any }) {\n Object.keys(source).forEach((key) => {\n target[key] = source[key];\n });\n return target;\n}\n\n/**\n * A wrapper for setTimeout that resolves a promise after t milliseconds.\n * @param {number} t The number of milliseconds to be delayed.\n * @param {T} value The value to be resolved with after a timeout of t milliseconds.\n * @returns {Promise} Resolved promise\n */\nexport function delay(t: number, value?: T): Promise {\n return new Promise((resolve) => setTimeout(() => resolve(value), t));\n}\n\n/**\n * Service callback that is returned for REST requests initiated by the service client.\n */\nexport interface ServiceCallback {\n /**\n * A method that will be invoked as a callback to a service function.\n * @param {Error | RestError | null} err The error occurred if any, while executing the request; otherwise null.\n * @param {TResult} [result] The deserialized response body if an error did not occur.\n * @param {WebResourceLike} [request] The raw/actual request sent to the server if an error did not occur.\n * @param {HttpOperationResponse} [response] The raw/actual response from the server if an error did not occur.\n */\n (\n err: Error | RestError | null,\n result?: TResult,\n request?: WebResourceLike,\n response?: HttpOperationResponse\n ): void;\n}\n\n/**\n * Converts a Promise to a callback.\n * @param {Promise} promise The Promise to be converted to a callback\n * @returns {Function} A function that takes the callback (cb: Function): void\n * @deprecated generated code should instead depend on responseToBody\n */\nexport function promiseToCallback(promise: Promise): Function {\n if (typeof promise.then !== \"function\") {\n throw new Error(\"The provided input is not a Promise.\");\n }\n return (cb: Function): void => {\n promise.then(\n (data: any) => {\n cb(undefined, data);\n },\n (err: Error) => {\n cb(err);\n }\n );\n };\n}\n\n/**\n * Converts a Promise to a service callback.\n * @param {Promise} promise - The Promise of HttpOperationResponse to be converted to a service callback\n * @returns {Function} A function that takes the service callback (cb: ServiceCallback): void\n */\nexport function promiseToServiceCallback(promise: Promise): Function {\n if (typeof promise.then !== \"function\") {\n throw new Error(\"The provided input is not a Promise.\");\n }\n return (cb: ServiceCallback): void => {\n promise.then(\n (data: HttpOperationResponse) => {\n process.nextTick(cb, undefined, data.parsedBody as T, data.request, data);\n },\n (err: Error) => {\n process.nextTick(cb, err);\n }\n );\n };\n}\n\nexport function prepareXMLRootList(obj: any, elementName: string) {\n if (!Array.isArray(obj)) {\n obj = [obj];\n }\n return { [elementName]: obj };\n}\n\n/**\n * Applies the properties on the prototype of sourceCtors to the prototype of targetCtor\n * @param {object} targetCtor The target object on which the properties need to be applied.\n * @param {Array