j?j:g+f));return 1===d?(b=a[c-1],e.push(k[b>>2]+k[63&b<<4]+"==")):2===d&&(b=(a[c-2]<<8)+a[c-1],e.push(k[b>>10]+k[63&b>>4]+k[63&b<<2]+"=")),e.join("")}c.byteLength=function(a){var b=d(a),c=b[0],e=b[1];return 3*(c+e)/4-e},c.toByteArray=f,c.fromByteArray=j;for(var k=[],l=[],m="undefined"==typeof Uint8Array?Array:Uint8Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,p=n.length;o 0) {
- throw new Error('Invalid string. Length must be a multiple of 4')
- }
-
- // Trim off extra bytes after placeholder bytes are found
- // See: https://github.com/beatgammit/base64-js/issues/42
- var validLen = b64.indexOf('=')
- if (validLen === -1) validLen = len
-
- var placeHoldersLen = validLen === len
- ? 0
- : 4 - (validLen % 4)
-
- return [validLen, placeHoldersLen]
-}
-
-// base64 is 4/3 + up to two characters of the original data
-function byteLength (b64) {
- var lens = getLens(b64)
- var validLen = lens[0]
- var placeHoldersLen = lens[1]
- return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
-}
-
-function _byteLength (b64, validLen, placeHoldersLen) {
- return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
-}
-
-function toByteArray (b64) {
- var tmp
- var lens = getLens(b64)
- var validLen = lens[0]
- var placeHoldersLen = lens[1]
-
- var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
-
- var curByte = 0
-
- // if there are placeholders, only get up to the last complete 4 chars
- var len = placeHoldersLen > 0
- ? validLen - 4
- : validLen
-
- var i
- for (i = 0; i < len; i += 4) {
- tmp =
- (revLookup[b64.charCodeAt(i)] << 18) |
- (revLookup[b64.charCodeAt(i + 1)] << 12) |
- (revLookup[b64.charCodeAt(i + 2)] << 6) |
- revLookup[b64.charCodeAt(i + 3)]
- arr[curByte++] = (tmp >> 16) & 0xFF
- arr[curByte++] = (tmp >> 8) & 0xFF
- arr[curByte++] = tmp & 0xFF
- }
-
- if (placeHoldersLen === 2) {
- tmp =
- (revLookup[b64.charCodeAt(i)] << 2) |
- (revLookup[b64.charCodeAt(i + 1)] >> 4)
- arr[curByte++] = tmp & 0xFF
- }
-
- if (placeHoldersLen === 1) {
- tmp =
- (revLookup[b64.charCodeAt(i)] << 10) |
- (revLookup[b64.charCodeAt(i + 1)] << 4) |
- (revLookup[b64.charCodeAt(i + 2)] >> 2)
- arr[curByte++] = (tmp >> 8) & 0xFF
- arr[curByte++] = tmp & 0xFF
- }
-
- return arr
-}
-
-function tripletToBase64 (num) {
- return lookup[num >> 18 & 0x3F] +
- lookup[num >> 12 & 0x3F] +
- lookup[num >> 6 & 0x3F] +
- lookup[num & 0x3F]
-}
-
-function encodeChunk (uint8, start, end) {
- var tmp
- var output = []
- for (var i = start; i < end; i += 3) {
- tmp =
- ((uint8[i] << 16) & 0xFF0000) +
- ((uint8[i + 1] << 8) & 0xFF00) +
- (uint8[i + 2] & 0xFF)
- output.push(tripletToBase64(tmp))
- }
- return output.join('')
-}
-
-function fromByteArray (uint8) {
- var tmp
- var len = uint8.length
- var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
- var parts = []
- var maxChunkLength = 16383 // must be multiple of 3
-
- // go through the array every three bytes, we'll deal with trailing stuff later
- for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
- parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
- }
-
- // pad the end with zeros, but make sure to not forget the extra bytes
- if (extraBytes === 1) {
- tmp = uint8[len - 1]
- parts.push(
- lookup[tmp >> 2] +
- lookup[(tmp << 4) & 0x3F] +
- '=='
- )
- } else if (extraBytes === 2) {
- tmp = (uint8[len - 2] << 8) + uint8[len - 1]
- parts.push(
- lookup[tmp >> 10] +
- lookup[(tmp >> 4) & 0x3F] +
- lookup[(tmp << 2) & 0x3F] +
- '='
- )
- }
-
- return parts.join('')
-}
diff --git a/node_modules/base64-js/package.json b/node_modules/base64-js/package.json
deleted file mode 100644
index c3972e3..0000000
--- a/node_modules/base64-js/package.json
+++ /dev/null
@@ -1,47 +0,0 @@
-{
- "name": "base64-js",
- "description": "Base64 encoding/decoding in pure JS",
- "version": "1.5.1",
- "author": "T. Jameson Little ",
- "typings": "index.d.ts",
- "bugs": {
- "url": "https://github.com/beatgammit/base64-js/issues"
- },
- "devDependencies": {
- "babel-minify": "^0.5.1",
- "benchmark": "^2.1.4",
- "browserify": "^16.3.0",
- "standard": "*",
- "tape": "4.x"
- },
- "homepage": "https://github.com/beatgammit/base64-js",
- "keywords": [
- "base64"
- ],
- "license": "MIT",
- "main": "index.js",
- "repository": {
- "type": "git",
- "url": "git://github.com/beatgammit/base64-js.git"
- },
- "scripts": {
- "build": "browserify -s base64js -r ./ | minify > base64js.min.js",
- "lint": "standard",
- "test": "npm run lint && npm run unit",
- "unit": "tape test/*.js"
- },
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ]
-}
diff --git a/node_modules/bcrypt-pbkdf/CONTRIBUTING.md b/node_modules/bcrypt-pbkdf/CONTRIBUTING.md
deleted file mode 100644
index 401d34e..0000000
--- a/node_modules/bcrypt-pbkdf/CONTRIBUTING.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# Contributing
-
-This repository uses [cr.joyent.us](https://cr.joyent.us) (Gerrit) for new
-changes. Anyone can submit changes. To get started, see the [cr.joyent.us user
-guide](https://github.com/joyent/joyent-gerrit/blob/master/docs/user/README.md).
-This repo does not use GitHub pull requests.
-
-See the [Joyent Engineering
-Guidelines](https://github.com/joyent/eng/blob/master/docs/index.md) for general
-best practices expected in this repository.
-
-If you're changing something non-trivial or user-facing, you may want to submit
-an issue first.
diff --git a/node_modules/bcrypt-pbkdf/LICENSE b/node_modules/bcrypt-pbkdf/LICENSE
deleted file mode 100644
index fc58d2a..0000000
--- a/node_modules/bcrypt-pbkdf/LICENSE
+++ /dev/null
@@ -1,66 +0,0 @@
-The Blowfish portions are under the following license:
-
-Blowfish block cipher for OpenBSD
-Copyright 1997 Niels Provos
-All rights reserved.
-
-Implementation advice by David Mazieres .
-
-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. The name of the author may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
-
-
-
-The bcrypt_pbkdf portions are under the following license:
-
-Copyright (c) 2013 Ted Unangst
-
-Permission to use, copy, modify, and distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-
-
-Performance improvements (Javascript-specific):
-
-Copyright 2016, Joyent Inc
-Author: Alex Wilson
-
-Permission to use, copy, modify, and distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/bcrypt-pbkdf/README.md b/node_modules/bcrypt-pbkdf/README.md
deleted file mode 100644
index 7551f33..0000000
--- a/node_modules/bcrypt-pbkdf/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-Port of the OpenBSD `bcrypt_pbkdf` function to pure Javascript. `npm`-ified
-version of [Devi Mandiri's port](https://github.com/devi/tmp/blob/master/js/bcrypt_pbkdf.js),
-with some minor performance improvements. The code is copied verbatim (and
-un-styled) from Devi's work.
-
-This product includes software developed by Niels Provos.
-
-## API
-
-### `bcrypt_pbkdf.pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds)`
-
-Derive a cryptographic key of arbitrary length from a given password and salt,
-using the OpenBSD `bcrypt_pbkdf` function. This is a combination of Blowfish and
-SHA-512.
-
-See [this article](http://www.tedunangst.com/flak/post/bcrypt-pbkdf) for
-further information.
-
-Parameters:
-
- * `pass`, a Uint8Array of length `passlen`
- * `passlen`, an integer Number
- * `salt`, a Uint8Array of length `saltlen`
- * `saltlen`, an integer Number
- * `key`, a Uint8Array of length `keylen`, will be filled with output
- * `keylen`, an integer Number
- * `rounds`, an integer Number, number of rounds of the PBKDF to run
-
-### `bcrypt_pbkdf.hash(sha2pass, sha2salt, out)`
-
-Calculate a Blowfish hash, given SHA2-512 output of a password and salt. Used as
-part of the inner round function in the PBKDF.
-
-Parameters:
-
- * `sha2pass`, a Uint8Array of length 64
- * `sha2salt`, a Uint8Array of length 64
- * `out`, a Uint8Array of length 32, will be filled with output
-
-## License
-
-This source form is a 1:1 port from the OpenBSD `blowfish.c` and `bcrypt_pbkdf.c`.
-As a result, it retains the original copyright and license. The two files are
-under slightly different (but compatible) licenses, and are here combined in
-one file. For each of the full license texts see `LICENSE`.
diff --git a/node_modules/bcrypt-pbkdf/index.js b/node_modules/bcrypt-pbkdf/index.js
deleted file mode 100644
index b1b5ad4..0000000
--- a/node_modules/bcrypt-pbkdf/index.js
+++ /dev/null
@@ -1,556 +0,0 @@
-'use strict';
-
-var crypto_hash_sha512 = require('tweetnacl').lowlevel.crypto_hash;
-
-/*
- * This file is a 1:1 port from the OpenBSD blowfish.c and bcrypt_pbkdf.c. As a
- * result, it retains the original copyright and license. The two files are
- * under slightly different (but compatible) licenses, and are here combined in
- * one file.
- *
- * Credit for the actual porting work goes to:
- * Devi Mandiri
- */
-
-/*
- * The Blowfish portions are under the following license:
- *
- * Blowfish block cipher for OpenBSD
- * Copyright 1997 Niels Provos
- * All rights reserved.
- *
- * Implementation advice by David Mazieres .
- *
- * 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. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-/*
- * The bcrypt_pbkdf portions are under the following license:
- *
- * Copyright (c) 2013 Ted Unangst
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
- * Performance improvements (Javascript-specific):
- *
- * Copyright 2016, Joyent Inc
- * Author: Alex Wilson
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-// Ported from OpenBSD bcrypt_pbkdf.c v1.9
-
-var BLF_J = 0;
-
-var Blowfish = function() {
- this.S = [
- new Uint32Array([
- 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7,
- 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99,
- 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,
- 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e,
- 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee,
- 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,
- 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef,
- 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e,
- 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,
- 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440,
- 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce,
- 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,
- 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e,
- 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677,
- 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,
- 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032,
- 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88,
- 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,
- 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e,
- 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0,
- 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,
- 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98,
- 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88,
- 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,
- 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6,
- 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d,
- 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,
- 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7,
- 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba,
- 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,
- 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f,
- 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09,
- 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,
- 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb,
- 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279,
- 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,
- 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab,
- 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82,
- 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,
- 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573,
- 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0,
- 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,
- 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790,
- 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8,
- 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,
- 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0,
- 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7,
- 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,
- 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad,
- 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1,
- 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,
- 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9,
- 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477,
- 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,
- 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49,
- 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af,
- 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,
- 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5,
- 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41,
- 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,
- 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400,
- 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915,
- 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,
- 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a]),
- new Uint32Array([
- 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623,
- 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,
- 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,
- 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e,
- 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6,
- 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,
- 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e,
- 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,
- 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,
- 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8,
- 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff,
- 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,
- 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701,
- 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,
- 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,
- 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331,
- 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf,
- 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,
- 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e,
- 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,
- 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,
- 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2,
- 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16,
- 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,
- 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b,
- 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,
- 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,
- 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3,
- 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f,
- 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,
- 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4,
- 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,
- 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,
- 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28,
- 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802,
- 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,
- 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510,
- 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,
- 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,
- 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e,
- 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50,
- 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,
- 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8,
- 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,
- 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,
- 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696,
- 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128,
- 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,
- 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0,
- 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,
- 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,
- 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250,
- 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3,
- 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,
- 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00,
- 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,
- 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,
- 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e,
- 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735,
- 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,
- 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9,
- 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,
- 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,
- 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7]),
- new Uint32Array([
- 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934,
- 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068,
- 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,
- 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,
- 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45,
- 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,
- 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a,
- 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb,
- 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,
- 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,
- 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42,
- 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,
- 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2,
- 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb,
- 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,
- 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,
- 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33,
- 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,
- 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3,
- 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc,
- 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,
- 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,
- 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b,
- 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,
- 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922,
- 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728,
- 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,
- 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,
- 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37,
- 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,
- 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804,
- 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b,
- 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,
- 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,
- 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d,
- 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,
- 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350,
- 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9,
- 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,
- 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,
- 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d,
- 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,
- 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f,
- 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61,
- 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,
- 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,
- 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2,
- 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,
- 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e,
- 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633,
- 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,
- 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,
- 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52,
- 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,
- 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5,
- 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62,
- 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,
- 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,
- 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24,
- 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,
- 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4,
- 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c,
- 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,
- 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0]),
- new Uint32Array([
- 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b,
- 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe,
- 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,
- 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4,
- 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8,
- 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,
- 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304,
- 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22,
- 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,
- 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6,
- 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9,
- 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,
- 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593,
- 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51,
- 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,
- 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c,
- 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b,
- 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,
- 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c,
- 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd,
- 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,
- 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319,
- 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb,
- 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,
- 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991,
- 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32,
- 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,
- 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166,
- 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae,
- 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,
- 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5,
- 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47,
- 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,
- 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d,
- 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84,
- 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,
- 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8,
- 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd,
- 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,
- 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7,
- 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38,
- 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,
- 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c,
- 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525,
- 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,
- 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442,
- 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964,
- 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,
- 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8,
- 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d,
- 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,
- 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299,
- 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02,
- 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,
- 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614,
- 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a,
- 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,
- 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b,
- 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0,
- 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,
- 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e,
- 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9,
- 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,
- 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6])
- ];
- this.P = new Uint32Array([
- 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344,
- 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,
- 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,
- 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,
- 0x9216d5d9, 0x8979fb1b]);
-};
-
-function F(S, x8, i) {
- return (((S[0][x8[i+3]] +
- S[1][x8[i+2]]) ^
- S[2][x8[i+1]]) +
- S[3][x8[i]]);
-};
-
-Blowfish.prototype.encipher = function(x, x8) {
- if (x8 === undefined) {
- x8 = new Uint8Array(x.buffer);
- if (x.byteOffset !== 0)
- x8 = x8.subarray(x.byteOffset);
- }
- x[0] ^= this.P[0];
- for (var i = 1; i < 16; i += 2) {
- x[1] ^= F(this.S, x8, 0) ^ this.P[i];
- x[0] ^= F(this.S, x8, 4) ^ this.P[i+1];
- }
- var t = x[0];
- x[0] = x[1] ^ this.P[17];
- x[1] = t;
-};
-
-Blowfish.prototype.decipher = function(x) {
- var x8 = new Uint8Array(x.buffer);
- if (x.byteOffset !== 0)
- x8 = x8.subarray(x.byteOffset);
- x[0] ^= this.P[17];
- for (var i = 16; i > 0; i -= 2) {
- x[1] ^= F(this.S, x8, 0) ^ this.P[i];
- x[0] ^= F(this.S, x8, 4) ^ this.P[i-1];
- }
- var t = x[0];
- x[0] = x[1] ^ this.P[0];
- x[1] = t;
-};
-
-function stream2word(data, databytes){
- var i, temp = 0;
- for (i = 0; i < 4; i++, BLF_J++) {
- if (BLF_J >= databytes) BLF_J = 0;
- temp = (temp << 8) | data[BLF_J];
- }
- return temp;
-};
-
-Blowfish.prototype.expand0state = function(key, keybytes) {
- var d = new Uint32Array(2), i, k;
- var d8 = new Uint8Array(d.buffer);
-
- for (i = 0, BLF_J = 0; i < 18; i++) {
- this.P[i] ^= stream2word(key, keybytes);
- }
- BLF_J = 0;
-
- for (i = 0; i < 18; i += 2) {
- this.encipher(d, d8);
- this.P[i] = d[0];
- this.P[i+1] = d[1];
- }
-
- for (i = 0; i < 4; i++) {
- for (k = 0; k < 256; k += 2) {
- this.encipher(d, d8);
- this.S[i][k] = d[0];
- this.S[i][k+1] = d[1];
- }
- }
-};
-
-Blowfish.prototype.expandstate = function(data, databytes, key, keybytes) {
- var d = new Uint32Array(2), i, k;
-
- for (i = 0, BLF_J = 0; i < 18; i++) {
- this.P[i] ^= stream2word(key, keybytes);
- }
-
- for (i = 0, BLF_J = 0; i < 18; i += 2) {
- d[0] ^= stream2word(data, databytes);
- d[1] ^= stream2word(data, databytes);
- this.encipher(d);
- this.P[i] = d[0];
- this.P[i+1] = d[1];
- }
-
- for (i = 0; i < 4; i++) {
- for (k = 0; k < 256; k += 2) {
- d[0] ^= stream2word(data, databytes);
- d[1] ^= stream2word(data, databytes);
- this.encipher(d);
- this.S[i][k] = d[0];
- this.S[i][k+1] = d[1];
- }
- }
- BLF_J = 0;
-};
-
-Blowfish.prototype.enc = function(data, blocks) {
- for (var i = 0; i < blocks; i++) {
- this.encipher(data.subarray(i*2));
- }
-};
-
-Blowfish.prototype.dec = function(data, blocks) {
- for (var i = 0; i < blocks; i++) {
- this.decipher(data.subarray(i*2));
- }
-};
-
-var BCRYPT_BLOCKS = 8,
- BCRYPT_HASHSIZE = 32;
-
-function bcrypt_hash(sha2pass, sha2salt, out) {
- var state = new Blowfish(),
- cdata = new Uint32Array(BCRYPT_BLOCKS), i,
- ciphertext = new Uint8Array([79,120,121,99,104,114,111,109,97,116,105,
- 99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109,
- 105,116,101]); //"OxychromaticBlowfishSwatDynamite"
-
- state.expandstate(sha2salt, 64, sha2pass, 64);
- for (i = 0; i < 64; i++) {
- state.expand0state(sha2salt, 64);
- state.expand0state(sha2pass, 64);
- }
-
- for (i = 0; i < BCRYPT_BLOCKS; i++)
- cdata[i] = stream2word(ciphertext, ciphertext.byteLength);
- for (i = 0; i < 64; i++)
- state.enc(cdata, cdata.byteLength / 8);
-
- for (i = 0; i < BCRYPT_BLOCKS; i++) {
- out[4*i+3] = cdata[i] >>> 24;
- out[4*i+2] = cdata[i] >>> 16;
- out[4*i+1] = cdata[i] >>> 8;
- out[4*i+0] = cdata[i];
- }
-};
-
-function bcrypt_pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds) {
- var sha2pass = new Uint8Array(64),
- sha2salt = new Uint8Array(64),
- out = new Uint8Array(BCRYPT_HASHSIZE),
- tmpout = new Uint8Array(BCRYPT_HASHSIZE),
- countsalt = new Uint8Array(saltlen+4),
- i, j, amt, stride, dest, count,
- origkeylen = keylen;
-
- if (rounds < 1)
- return -1;
- if (passlen === 0 || saltlen === 0 || keylen === 0 ||
- keylen > (out.byteLength * out.byteLength) || saltlen > (1<<20))
- return -1;
-
- stride = Math.floor((keylen + out.byteLength - 1) / out.byteLength);
- amt = Math.floor((keylen + stride - 1) / stride);
-
- for (i = 0; i < saltlen; i++)
- countsalt[i] = salt[i];
-
- crypto_hash_sha512(sha2pass, pass, passlen);
-
- for (count = 1; keylen > 0; count++) {
- countsalt[saltlen+0] = count >>> 24;
- countsalt[saltlen+1] = count >>> 16;
- countsalt[saltlen+2] = count >>> 8;
- countsalt[saltlen+3] = count;
-
- crypto_hash_sha512(sha2salt, countsalt, saltlen + 4);
- bcrypt_hash(sha2pass, sha2salt, tmpout);
- for (i = out.byteLength; i--;)
- out[i] = tmpout[i];
-
- for (i = 1; i < rounds; i++) {
- crypto_hash_sha512(sha2salt, tmpout, tmpout.byteLength);
- bcrypt_hash(sha2pass, sha2salt, tmpout);
- for (j = 0; j < out.byteLength; j++)
- out[j] ^= tmpout[j];
- }
-
- amt = Math.min(amt, keylen);
- for (i = 0; i < amt; i++) {
- dest = i * stride + (count - 1);
- if (dest >= origkeylen)
- break;
- key[dest] = out[i];
- }
- keylen -= i;
- }
-
- return 0;
-};
-
-module.exports = {
- BLOCKS: BCRYPT_BLOCKS,
- HASHSIZE: BCRYPT_HASHSIZE,
- hash: bcrypt_hash,
- pbkdf: bcrypt_pbkdf
-};
diff --git a/node_modules/bcrypt-pbkdf/package.json b/node_modules/bcrypt-pbkdf/package.json
deleted file mode 100644
index e93a969..0000000
--- a/node_modules/bcrypt-pbkdf/package.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "name": "bcrypt-pbkdf",
- "version": "1.0.2",
- "description": "Port of the OpenBSD bcrypt_pbkdf function to pure JS",
- "repository": {
- "type": "git",
- "url": "git://github.com/joyent/node-bcrypt-pbkdf.git"
- },
- "main": "index.js",
- "dependencies": {
- "tweetnacl": "^0.14.3"
- },
- "devDependencies": {},
- "license": "BSD-3-Clause"
-}
diff --git a/node_modules/bl/.travis.yml b/node_modules/bl/.travis.yml
deleted file mode 100644
index 016eaf5..0000000
--- a/node_modules/bl/.travis.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-sudo: false
-arch:
- - amd64
- - ppc64le
-language: node_js
-node_js:
- - '6'
- - '8'
- - '10'
- - '12'
- - '14'
- - '15'
- - lts/*
-notifications:
- email:
- - rod@vagg.org
- - matteo.collina@gmail.com
diff --git a/node_modules/bl/BufferList.js b/node_modules/bl/BufferList.js
deleted file mode 100644
index 471ee77..0000000
--- a/node_modules/bl/BufferList.js
+++ /dev/null
@@ -1,396 +0,0 @@
-'use strict'
-
-const { Buffer } = require('buffer')
-const symbol = Symbol.for('BufferList')
-
-function BufferList (buf) {
- if (!(this instanceof BufferList)) {
- return new BufferList(buf)
- }
-
- BufferList._init.call(this, buf)
-}
-
-BufferList._init = function _init (buf) {
- Object.defineProperty(this, symbol, { value: true })
-
- this._bufs = []
- this.length = 0
-
- if (buf) {
- this.append(buf)
- }
-}
-
-BufferList.prototype._new = function _new (buf) {
- return new BufferList(buf)
-}
-
-BufferList.prototype._offset = function _offset (offset) {
- if (offset === 0) {
- return [0, 0]
- }
-
- let tot = 0
-
- for (let i = 0; i < this._bufs.length; i++) {
- const _t = tot + this._bufs[i].length
- if (offset < _t || i === this._bufs.length - 1) {
- return [i, offset - tot]
- }
- tot = _t
- }
-}
-
-BufferList.prototype._reverseOffset = function (blOffset) {
- const bufferId = blOffset[0]
- let offset = blOffset[1]
-
- for (let i = 0; i < bufferId; i++) {
- offset += this._bufs[i].length
- }
-
- return offset
-}
-
-BufferList.prototype.get = function get (index) {
- if (index > this.length || index < 0) {
- return undefined
- }
-
- const offset = this._offset(index)
-
- return this._bufs[offset[0]][offset[1]]
-}
-
-BufferList.prototype.slice = function slice (start, end) {
- if (typeof start === 'number' && start < 0) {
- start += this.length
- }
-
- if (typeof end === 'number' && end < 0) {
- end += this.length
- }
-
- return this.copy(null, 0, start, end)
-}
-
-BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) {
- if (typeof srcStart !== 'number' || srcStart < 0) {
- srcStart = 0
- }
-
- if (typeof srcEnd !== 'number' || srcEnd > this.length) {
- srcEnd = this.length
- }
-
- if (srcStart >= this.length) {
- return dst || Buffer.alloc(0)
- }
-
- if (srcEnd <= 0) {
- return dst || Buffer.alloc(0)
- }
-
- const copy = !!dst
- const off = this._offset(srcStart)
- const len = srcEnd - srcStart
- let bytes = len
- let bufoff = (copy && dstStart) || 0
- let start = off[1]
-
- // copy/slice everything
- if (srcStart === 0 && srcEnd === this.length) {
- if (!copy) {
- // slice, but full concat if multiple buffers
- return this._bufs.length === 1
- ? this._bufs[0]
- : Buffer.concat(this._bufs, this.length)
- }
-
- // copy, need to copy individual buffers
- for (let i = 0; i < this._bufs.length; i++) {
- this._bufs[i].copy(dst, bufoff)
- bufoff += this._bufs[i].length
- }
-
- return dst
- }
-
- // easy, cheap case where it's a subset of one of the buffers
- if (bytes <= this._bufs[off[0]].length - start) {
- return copy
- ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes)
- : this._bufs[off[0]].slice(start, start + bytes)
- }
-
- if (!copy) {
- // a slice, we need something to copy in to
- dst = Buffer.allocUnsafe(len)
- }
-
- for (let i = off[0]; i < this._bufs.length; i++) {
- const l = this._bufs[i].length - start
-
- if (bytes > l) {
- this._bufs[i].copy(dst, bufoff, start)
- bufoff += l
- } else {
- this._bufs[i].copy(dst, bufoff, start, start + bytes)
- bufoff += l
- break
- }
-
- bytes -= l
-
- if (start) {
- start = 0
- }
- }
-
- // safeguard so that we don't return uninitialized memory
- if (dst.length > bufoff) return dst.slice(0, bufoff)
-
- return dst
-}
-
-BufferList.prototype.shallowSlice = function shallowSlice (start, end) {
- start = start || 0
- end = typeof end !== 'number' ? this.length : end
-
- if (start < 0) {
- start += this.length
- }
-
- if (end < 0) {
- end += this.length
- }
-
- if (start === end) {
- return this._new()
- }
-
- const startOffset = this._offset(start)
- const endOffset = this._offset(end)
- const buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1)
-
- if (endOffset[1] === 0) {
- buffers.pop()
- } else {
- buffers[buffers.length - 1] = buffers[buffers.length - 1].slice(0, endOffset[1])
- }
-
- if (startOffset[1] !== 0) {
- buffers[0] = buffers[0].slice(startOffset[1])
- }
-
- return this._new(buffers)
-}
-
-BufferList.prototype.toString = function toString (encoding, start, end) {
- return this.slice(start, end).toString(encoding)
-}
-
-BufferList.prototype.consume = function consume (bytes) {
- // first, normalize the argument, in accordance with how Buffer does it
- bytes = Math.trunc(bytes)
- // do nothing if not a positive number
- if (Number.isNaN(bytes) || bytes <= 0) return this
-
- while (this._bufs.length) {
- if (bytes >= this._bufs[0].length) {
- bytes -= this._bufs[0].length
- this.length -= this._bufs[0].length
- this._bufs.shift()
- } else {
- this._bufs[0] = this._bufs[0].slice(bytes)
- this.length -= bytes
- break
- }
- }
-
- return this
-}
-
-BufferList.prototype.duplicate = function duplicate () {
- const copy = this._new()
-
- for (let i = 0; i < this._bufs.length; i++) {
- copy.append(this._bufs[i])
- }
-
- return copy
-}
-
-BufferList.prototype.append = function append (buf) {
- if (buf == null) {
- return this
- }
-
- if (buf.buffer) {
- // append a view of the underlying ArrayBuffer
- this._appendBuffer(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength))
- } else if (Array.isArray(buf)) {
- for (let i = 0; i < buf.length; i++) {
- this.append(buf[i])
- }
- } else if (this._isBufferList(buf)) {
- // unwrap argument into individual BufferLists
- for (let i = 0; i < buf._bufs.length; i++) {
- this.append(buf._bufs[i])
- }
- } else {
- // coerce number arguments to strings, since Buffer(number) does
- // uninitialized memory allocation
- if (typeof buf === 'number') {
- buf = buf.toString()
- }
-
- this._appendBuffer(Buffer.from(buf))
- }
-
- return this
-}
-
-BufferList.prototype._appendBuffer = function appendBuffer (buf) {
- this._bufs.push(buf)
- this.length += buf.length
-}
-
-BufferList.prototype.indexOf = function (search, offset, encoding) {
- if (encoding === undefined && typeof offset === 'string') {
- encoding = offset
- offset = undefined
- }
-
- if (typeof search === 'function' || Array.isArray(search)) {
- throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.')
- } else if (typeof search === 'number') {
- search = Buffer.from([search])
- } else if (typeof search === 'string') {
- search = Buffer.from(search, encoding)
- } else if (this._isBufferList(search)) {
- search = search.slice()
- } else if (Array.isArray(search.buffer)) {
- search = Buffer.from(search.buffer, search.byteOffset, search.byteLength)
- } else if (!Buffer.isBuffer(search)) {
- search = Buffer.from(search)
- }
-
- offset = Number(offset || 0)
-
- if (isNaN(offset)) {
- offset = 0
- }
-
- if (offset < 0) {
- offset = this.length + offset
- }
-
- if (offset < 0) {
- offset = 0
- }
-
- if (search.length === 0) {
- return offset > this.length ? this.length : offset
- }
-
- const blOffset = this._offset(offset)
- let blIndex = blOffset[0] // index of which internal buffer we're working on
- let buffOffset = blOffset[1] // offset of the internal buffer we're working on
-
- // scan over each buffer
- for (; blIndex < this._bufs.length; blIndex++) {
- const buff = this._bufs[blIndex]
-
- while (buffOffset < buff.length) {
- const availableWindow = buff.length - buffOffset
-
- if (availableWindow >= search.length) {
- const nativeSearchResult = buff.indexOf(search, buffOffset)
-
- if (nativeSearchResult !== -1) {
- return this._reverseOffset([blIndex, nativeSearchResult])
- }
-
- buffOffset = buff.length - search.length + 1 // end of native search window
- } else {
- const revOffset = this._reverseOffset([blIndex, buffOffset])
-
- if (this._match(revOffset, search)) {
- return revOffset
- }
-
- buffOffset++
- }
- }
-
- buffOffset = 0
- }
-
- return -1
-}
-
-BufferList.prototype._match = function (offset, search) {
- if (this.length - offset < search.length) {
- return false
- }
-
- for (let searchOffset = 0; searchOffset < search.length; searchOffset++) {
- if (this.get(offset + searchOffset) !== search[searchOffset]) {
- return false
- }
- }
- return true
-}
-
-;(function () {
- const methods = {
- readDoubleBE: 8,
- readDoubleLE: 8,
- readFloatBE: 4,
- readFloatLE: 4,
- readInt32BE: 4,
- readInt32LE: 4,
- readUInt32BE: 4,
- readUInt32LE: 4,
- readInt16BE: 2,
- readInt16LE: 2,
- readUInt16BE: 2,
- readUInt16LE: 2,
- readInt8: 1,
- readUInt8: 1,
- readIntBE: null,
- readIntLE: null,
- readUIntBE: null,
- readUIntLE: null
- }
-
- for (const m in methods) {
- (function (m) {
- if (methods[m] === null) {
- BufferList.prototype[m] = function (offset, byteLength) {
- return this.slice(offset, offset + byteLength)[m](0, byteLength)
- }
- } else {
- BufferList.prototype[m] = function (offset = 0) {
- return this.slice(offset, offset + methods[m])[m](0)
- }
- }
- }(m))
- }
-}())
-
-// Used internally by the class and also as an indicator of this object being
-// a `BufferList`. It's not possible to use `instanceof BufferList` in a browser
-// environment because there could be multiple different copies of the
-// BufferList class and some `BufferList`s might be `BufferList`s.
-BufferList.prototype._isBufferList = function _isBufferList (b) {
- return b instanceof BufferList || BufferList.isBufferList(b)
-}
-
-BufferList.isBufferList = function isBufferList (b) {
- return b != null && b[symbol]
-}
-
-module.exports = BufferList
diff --git a/node_modules/bl/LICENSE.md b/node_modules/bl/LICENSE.md
deleted file mode 100644
index ecbe516..0000000
--- a/node_modules/bl/LICENSE.md
+++ /dev/null
@@ -1,13 +0,0 @@
-The MIT License (MIT)
-=====================
-
-Copyright (c) 2013-2019 bl contributors
-----------------------------------
-
-*bl contributors listed at *
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/bl/README.md b/node_modules/bl/README.md
deleted file mode 100644
index 9680b1d..0000000
--- a/node_modules/bl/README.md
+++ /dev/null
@@ -1,247 +0,0 @@
-# bl *(BufferList)*
-
-[](https://travis-ci.com/rvagg/bl/)
-
-**A Node.js Buffer list collector, reader and streamer thingy.**
-
-[](https://nodei.co/npm/bl/)
-
-**bl** is a storage object for collections of Node Buffers, exposing them with the main Buffer readable API. Also works as a duplex stream so you can collect buffers from a stream that emits them and emit buffers to a stream that consumes them!
-
-The original buffers are kept intact and copies are only done as necessary. Any reads that require the use of a single original buffer will return a slice of that buffer only (which references the same memory as the original buffer). Reads that span buffers perform concatenation as required and return the results transparently.
-
-```js
-const { BufferList } = require('bl')
-
-const bl = new BufferList()
-bl.append(Buffer.from('abcd'))
-bl.append(Buffer.from('efg'))
-bl.append('hi') // bl will also accept & convert Strings
-bl.append(Buffer.from('j'))
-bl.append(Buffer.from([ 0x3, 0x4 ]))
-
-console.log(bl.length) // 12
-
-console.log(bl.slice(0, 10).toString('ascii')) // 'abcdefghij'
-console.log(bl.slice(3, 10).toString('ascii')) // 'defghij'
-console.log(bl.slice(3, 6).toString('ascii')) // 'def'
-console.log(bl.slice(3, 8).toString('ascii')) // 'defgh'
-console.log(bl.slice(5, 10).toString('ascii')) // 'fghij'
-
-console.log(bl.indexOf('def')) // 3
-console.log(bl.indexOf('asdf')) // -1
-
-// or just use toString!
-console.log(bl.toString()) // 'abcdefghij\u0003\u0004'
-console.log(bl.toString('ascii', 3, 8)) // 'defgh'
-console.log(bl.toString('ascii', 5, 10)) // 'fghij'
-
-// other standard Buffer readables
-console.log(bl.readUInt16BE(10)) // 0x0304
-console.log(bl.readUInt16LE(10)) // 0x0403
-```
-
-Give it a callback in the constructor and use it just like **[concat-stream](https://github.com/maxogden/node-concat-stream)**:
-
-```js
-const { BufferListStream } = require('bl')
-const fs = require('fs')
-
-fs.createReadStream('README.md')
- .pipe(BufferListStream((err, data) => { // note 'new' isn't strictly required
- // `data` is a complete Buffer object containing the full data
- console.log(data.toString())
- }))
-```
-
-Note that when you use the *callback* method like this, the resulting `data` parameter is a concatenation of all `Buffer` objects in the list. If you want to avoid the overhead of this concatenation (in cases of extreme performance consciousness), then avoid the *callback* method and just listen to `'end'` instead, like a standard Stream.
-
-Or to fetch a URL using [hyperquest](https://github.com/substack/hyperquest) (should work with [request](http://github.com/mikeal/request) and even plain Node http too!):
-
-```js
-const hyperquest = require('hyperquest')
-const { BufferListStream } = require('bl')
-
-const url = 'https://raw.github.com/rvagg/bl/master/README.md'
-
-hyperquest(url).pipe(BufferListStream((err, data) => {
- console.log(data.toString())
-}))
-```
-
-Or, use it as a readable stream to recompose a list of Buffers to an output source:
-
-```js
-const { BufferListStream } = require('bl')
-const fs = require('fs')
-
-var bl = new BufferListStream()
-bl.append(Buffer.from('abcd'))
-bl.append(Buffer.from('efg'))
-bl.append(Buffer.from('hi'))
-bl.append(Buffer.from('j'))
-
-bl.pipe(fs.createWriteStream('gibberish.txt'))
-```
-
-## API
-
- * new BufferList([ buf ])
- * BufferList.isBufferList(obj)
- * bl.length
- * bl.append(buffer)
- * bl.get(index)
- * bl.indexOf(value[, byteOffset][, encoding])
- * bl.slice([ start[, end ] ])
- * bl.shallowSlice([ start[, end ] ])
- * bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])
- * bl.duplicate()
- * bl.consume(bytes)
- * bl.toString([encoding, [ start, [ end ]]])
- * bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8()
- * new BufferListStream([ callback ])
-
---------------------------------------------------------
-
-### new BufferList([ Buffer | Buffer array | BufferList | BufferList array | String ])
-No arguments are _required_ for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` objects.
-
-`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with:
-
-```js
-const { BufferList } = require('bl')
-const bl = BufferList()
-
-// equivalent to:
-
-const { BufferList } = require('bl')
-const bl = new BufferList()
-```
-
---------------------------------------------------------
-
-### BufferList.isBufferList(obj)
-Determines if the passed object is a `BufferList`. It will return `true` if the passed object is an instance of `BufferList` **or** `BufferListStream` and `false` otherwise.
-
-N.B. this won't return `true` for `BufferList` or `BufferListStream` instances created by versions of this library before this static method was added.
-
---------------------------------------------------------
-
-### bl.length
-Get the length of the list in bytes. This is the sum of the lengths of all of the buffers contained in the list, minus any initial offset for a semi-consumed buffer at the beginning. Should accurately represent the total number of bytes that can be read from the list.
-
---------------------------------------------------------
-
-### bl.append(Buffer | Buffer array | BufferList | BufferList array | String)
-`append(buffer)` adds an additional buffer or BufferList to the internal list. `this` is returned so it can be chained.
-
---------------------------------------------------------
-
-### bl.get(index)
-`get()` will return the byte at the specified index.
-
---------------------------------------------------------
-
-### bl.indexOf(value[, byteOffset][, encoding])
-`get()` will return the byte at the specified index.
-`indexOf()` method returns the first index at which a given element can be found in the BufferList, or -1 if it is not present.
-
---------------------------------------------------------
-
-### bl.slice([ start, [ end ] ])
-`slice()` returns a new `Buffer` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively.
-
-If the requested range spans a single internal buffer then a slice of that buffer will be returned which shares the original memory range of that Buffer. If the range spans multiple buffers then copy operations will likely occur to give you a uniform Buffer.
-
---------------------------------------------------------
-
-### bl.shallowSlice([ start, [ end ] ])
-`shallowSlice()` returns a new `BufferList` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively.
-
-No copies will be performed. All buffers in the result share memory with the original list.
-
---------------------------------------------------------
-
-### bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])
-`copy()` copies the content of the list in the `dest` buffer, starting from `destStart` and containing the bytes within the range specified with `srcStart` to `srcEnd`. `destStart`, `start` and `end` are optional and will default to the beginning of the `dest` buffer, and the beginning and end of the list respectively.
-
---------------------------------------------------------
-
-### bl.duplicate()
-`duplicate()` performs a **shallow-copy** of the list. The internal Buffers remains the same, so if you change the underlying Buffers, the change will be reflected in both the original and the duplicate. This method is needed if you want to call `consume()` or `pipe()` and still keep the original list.Example:
-
-```js
-var bl = new BufferListStream()
-
-bl.append('hello')
-bl.append(' world')
-bl.append('\n')
-
-bl.duplicate().pipe(process.stdout, { end: false })
-
-console.log(bl.toString())
-```
-
---------------------------------------------------------
-
-### bl.consume(bytes)
-`consume()` will shift bytes *off the start of the list*. The number of bytes consumed don't need to line up with the sizes of the internal Buffers—initial offsets will be calculated accordingly in order to give you a consistent view of the data.
-
---------------------------------------------------------
-
-### bl.toString([encoding, [ start, [ end ]]])
-`toString()` will return a string representation of the buffer. The optional `start` and `end` arguments are passed on to `slice()`, while the `encoding` is passed on to `toString()` of the resulting Buffer. See the [Buffer#toString()](http://nodejs.org/docs/latest/api/buffer.html#buffer_buf_tostring_encoding_start_end) documentation for more information.
-
---------------------------------------------------------
-
-### bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8()
-
-All of the standard byte-reading methods of the `Buffer` interface are implemented and will operate across internal Buffer boundaries transparently.
-
-See the [Buffer](http://nodejs.org/docs/latest/api/buffer.html) documentation for how these work.
-
---------------------------------------------------------
-
-### new BufferListStream([ callback | Buffer | Buffer array | BufferList | BufferList array | String ])
-**BufferListStream** is a Node **[Duplex Stream](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_duplex)**, so it can be read from and written to like a standard Node stream. You can also `pipe()` to and from a **BufferListStream** instance.
-
-The constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream.
-
-Normally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object.
-
-`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with:
-
-```js
-const { BufferListStream } = require('bl')
-const bl = BufferListStream()
-
-// equivalent to:
-
-const { BufferListStream } = require('bl')
-const bl = new BufferListStream()
-```
-
-N.B. For backwards compatibility reasons, `BufferListStream` is the **default** export when you `require('bl')`:
-
-```js
-const { BufferListStream } = require('bl')
-// equivalent to:
-const BufferListStream = require('bl')
-```
-
---------------------------------------------------------
-
-## Contributors
-
-**bl** is brought to you by the following hackers:
-
- * [Rod Vagg](https://github.com/rvagg)
- * [Matteo Collina](https://github.com/mcollina)
- * [Jarett Cruger](https://github.com/jcrugzz)
-
-
-## License & copyright
-
-Copyright (c) 2013-2019 bl contributors (listed above).
-
-bl is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.
diff --git a/node_modules/bl/bl.js b/node_modules/bl/bl.js
deleted file mode 100644
index 40228f8..0000000
--- a/node_modules/bl/bl.js
+++ /dev/null
@@ -1,84 +0,0 @@
-'use strict'
-
-const DuplexStream = require('readable-stream').Duplex
-const inherits = require('inherits')
-const BufferList = require('./BufferList')
-
-function BufferListStream (callback) {
- if (!(this instanceof BufferListStream)) {
- return new BufferListStream(callback)
- }
-
- if (typeof callback === 'function') {
- this._callback = callback
-
- const piper = function piper (err) {
- if (this._callback) {
- this._callback(err)
- this._callback = null
- }
- }.bind(this)
-
- this.on('pipe', function onPipe (src) {
- src.on('error', piper)
- })
- this.on('unpipe', function onUnpipe (src) {
- src.removeListener('error', piper)
- })
-
- callback = null
- }
-
- BufferList._init.call(this, callback)
- DuplexStream.call(this)
-}
-
-inherits(BufferListStream, DuplexStream)
-Object.assign(BufferListStream.prototype, BufferList.prototype)
-
-BufferListStream.prototype._new = function _new (callback) {
- return new BufferListStream(callback)
-}
-
-BufferListStream.prototype._write = function _write (buf, encoding, callback) {
- this._appendBuffer(buf)
-
- if (typeof callback === 'function') {
- callback()
- }
-}
-
-BufferListStream.prototype._read = function _read (size) {
- if (!this.length) {
- return this.push(null)
- }
-
- size = Math.min(size, this.length)
- this.push(this.slice(0, size))
- this.consume(size)
-}
-
-BufferListStream.prototype.end = function end (chunk) {
- DuplexStream.prototype.end.call(this, chunk)
-
- if (this._callback) {
- this._callback(null, this.slice())
- this._callback = null
- }
-}
-
-BufferListStream.prototype._destroy = function _destroy (err, cb) {
- this._bufs.length = 0
- this.length = 0
- cb(err)
-}
-
-BufferListStream.prototype._isBufferList = function _isBufferList (b) {
- return b instanceof BufferListStream || b instanceof BufferList || BufferListStream.isBufferList(b)
-}
-
-BufferListStream.isBufferList = BufferList.isBufferList
-
-module.exports = BufferListStream
-module.exports.BufferListStream = BufferListStream
-module.exports.BufferList = BufferList
diff --git a/node_modules/bl/package.json b/node_modules/bl/package.json
deleted file mode 100644
index 3b2be3f..0000000
--- a/node_modules/bl/package.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "name": "bl",
- "version": "4.1.0",
- "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!",
- "license": "MIT",
- "main": "bl.js",
- "scripts": {
- "lint": "standard *.js test/*.js",
- "test": "npm run lint && node test/test.js | faucet"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/rvagg/bl.git"
- },
- "homepage": "https://github.com/rvagg/bl",
- "authors": [
- "Rod Vagg (https://github.com/rvagg)",
- "Matteo Collina (https://github.com/mcollina)",
- "Jarett Cruger (https://github.com/jcrugzz)"
- ],
- "keywords": [
- "buffer",
- "buffers",
- "stream",
- "awesomesauce"
- ],
- "dependencies": {
- "buffer": "^5.5.0",
- "inherits": "^2.0.4",
- "readable-stream": "^3.4.0"
- },
- "devDependencies": {
- "faucet": "~0.0.1",
- "standard": "^14.3.0",
- "tape": "^4.11.0"
- }
-}
diff --git a/node_modules/bl/test/convert.js b/node_modules/bl/test/convert.js
deleted file mode 100644
index 9f3e235..0000000
--- a/node_modules/bl/test/convert.js
+++ /dev/null
@@ -1,21 +0,0 @@
-'use strict'
-
-const tape = require('tape')
-const { BufferList, BufferListStream } = require('../')
-const { Buffer } = require('buffer')
-
-tape('convert from BufferList to BufferListStream', (t) => {
- const data = Buffer.from(`TEST-${Date.now()}`)
- const bl = new BufferList(data)
- const bls = new BufferListStream(bl)
- t.ok(bl.slice().equals(bls.slice()))
- t.end()
-})
-
-tape('convert from BufferListStream to BufferList', (t) => {
- const data = Buffer.from(`TEST-${Date.now()}`)
- const bls = new BufferListStream(data)
- const bl = new BufferList(bls)
- t.ok(bl.slice().equals(bls.slice()))
- t.end()
-})
diff --git a/node_modules/bl/test/indexOf.js b/node_modules/bl/test/indexOf.js
deleted file mode 100644
index 62dcb01..0000000
--- a/node_modules/bl/test/indexOf.js
+++ /dev/null
@@ -1,492 +0,0 @@
-'use strict'
-
-const tape = require('tape')
-const BufferList = require('../')
-const { Buffer } = require('buffer')
-
-tape('indexOf single byte needle', (t) => {
- const bl = new BufferList(['abcdefg', 'abcdefg', '12345'])
-
- t.equal(bl.indexOf('e'), 4)
- t.equal(bl.indexOf('e', 5), 11)
- t.equal(bl.indexOf('e', 12), -1)
- t.equal(bl.indexOf('5'), 18)
-
- t.end()
-})
-
-tape('indexOf multiple byte needle', (t) => {
- const bl = new BufferList(['abcdefg', 'abcdefg'])
-
- t.equal(bl.indexOf('ef'), 4)
- t.equal(bl.indexOf('ef', 5), 11)
-
- t.end()
-})
-
-tape('indexOf multiple byte needles across buffer boundaries', (t) => {
- const bl = new BufferList(['abcdefg', 'abcdefg'])
-
- t.equal(bl.indexOf('fgabc'), 5)
-
- t.end()
-})
-
-tape('indexOf takes a Uint8Array search', (t) => {
- const bl = new BufferList(['abcdefg', 'abcdefg'])
- const search = new Uint8Array([102, 103, 97, 98, 99]) // fgabc
-
- t.equal(bl.indexOf(search), 5)
-
- t.end()
-})
-
-tape('indexOf takes a buffer list search', (t) => {
- const bl = new BufferList(['abcdefg', 'abcdefg'])
- const search = new BufferList('fgabc')
-
- t.equal(bl.indexOf(search), 5)
-
- t.end()
-})
-
-tape('indexOf a zero byte needle', (t) => {
- const b = new BufferList('abcdef')
- const bufEmpty = Buffer.from('')
-
- t.equal(b.indexOf(''), 0)
- t.equal(b.indexOf('', 1), 1)
- t.equal(b.indexOf('', b.length + 1), b.length)
- t.equal(b.indexOf('', Infinity), b.length)
- t.equal(b.indexOf(bufEmpty), 0)
- t.equal(b.indexOf(bufEmpty, 1), 1)
- t.equal(b.indexOf(bufEmpty, b.length + 1), b.length)
- t.equal(b.indexOf(bufEmpty, Infinity), b.length)
-
- t.end()
-})
-
-tape('indexOf buffers smaller and larger than the needle', (t) => {
- const bl = new BufferList(['abcdefg', 'a', 'bcdefg', 'a', 'bcfgab'])
-
- t.equal(bl.indexOf('fgabc'), 5)
- t.equal(bl.indexOf('fgabc', 6), 12)
- t.equal(bl.indexOf('fgabc', 13), -1)
-
- t.end()
-})
-
-// only present in node 6+
-;(process.version.substr(1).split('.')[0] >= 6) && tape('indexOf latin1 and binary encoding', (t) => {
- const b = new BufferList('abcdef')
-
- // test latin1 encoding
- t.equal(
- new BufferList(Buffer.from(b.toString('latin1'), 'latin1'))
- .indexOf('d', 0, 'latin1'),
- 3
- )
- t.equal(
- new BufferList(Buffer.from(b.toString('latin1'), 'latin1'))
- .indexOf(Buffer.from('d', 'latin1'), 0, 'latin1'),
- 3
- )
- t.equal(
- new BufferList(Buffer.from('aa\u00e8aa', 'latin1'))
- .indexOf('\u00e8', 'latin1'),
- 2
- )
- t.equal(
- new BufferList(Buffer.from('\u00e8', 'latin1'))
- .indexOf('\u00e8', 'latin1'),
- 0
- )
- t.equal(
- new BufferList(Buffer.from('\u00e8', 'latin1'))
- .indexOf(Buffer.from('\u00e8', 'latin1'), 'latin1'),
- 0
- )
-
- // test binary encoding
- t.equal(
- new BufferList(Buffer.from(b.toString('binary'), 'binary'))
- .indexOf('d', 0, 'binary'),
- 3
- )
- t.equal(
- new BufferList(Buffer.from(b.toString('binary'), 'binary'))
- .indexOf(Buffer.from('d', 'binary'), 0, 'binary'),
- 3
- )
- t.equal(
- new BufferList(Buffer.from('aa\u00e8aa', 'binary'))
- .indexOf('\u00e8', 'binary'),
- 2
- )
- t.equal(
- new BufferList(Buffer.from('\u00e8', 'binary'))
- .indexOf('\u00e8', 'binary'),
- 0
- )
- t.equal(
- new BufferList(Buffer.from('\u00e8', 'binary'))
- .indexOf(Buffer.from('\u00e8', 'binary'), 'binary'),
- 0
- )
-
- t.end()
-})
-
-tape('indexOf the entire nodejs10 buffer test suite', (t) => {
- const b = new BufferList('abcdef')
- const bufA = Buffer.from('a')
- const bufBc = Buffer.from('bc')
- const bufF = Buffer.from('f')
- const bufZ = Buffer.from('z')
-
- const stringComparison = 'abcdef'
-
- t.equal(b.indexOf('a'), 0)
- t.equal(b.indexOf('a', 1), -1)
- t.equal(b.indexOf('a', -1), -1)
- t.equal(b.indexOf('a', -4), -1)
- t.equal(b.indexOf('a', -b.length), 0)
- t.equal(b.indexOf('a', NaN), 0)
- t.equal(b.indexOf('a', -Infinity), 0)
- t.equal(b.indexOf('a', Infinity), -1)
- t.equal(b.indexOf('bc'), 1)
- t.equal(b.indexOf('bc', 2), -1)
- t.equal(b.indexOf('bc', -1), -1)
- t.equal(b.indexOf('bc', -3), -1)
- t.equal(b.indexOf('bc', -5), 1)
- t.equal(b.indexOf('bc', NaN), 1)
- t.equal(b.indexOf('bc', -Infinity), 1)
- t.equal(b.indexOf('bc', Infinity), -1)
- t.equal(b.indexOf('f'), b.length - 1)
- t.equal(b.indexOf('z'), -1)
-
- // empty search tests
- t.equal(b.indexOf(bufA), 0)
- t.equal(b.indexOf(bufA, 1), -1)
- t.equal(b.indexOf(bufA, -1), -1)
- t.equal(b.indexOf(bufA, -4), -1)
- t.equal(b.indexOf(bufA, -b.length), 0)
- t.equal(b.indexOf(bufA, NaN), 0)
- t.equal(b.indexOf(bufA, -Infinity), 0)
- t.equal(b.indexOf(bufA, Infinity), -1)
- t.equal(b.indexOf(bufBc), 1)
- t.equal(b.indexOf(bufBc, 2), -1)
- t.equal(b.indexOf(bufBc, -1), -1)
- t.equal(b.indexOf(bufBc, -3), -1)
- t.equal(b.indexOf(bufBc, -5), 1)
- t.equal(b.indexOf(bufBc, NaN), 1)
- t.equal(b.indexOf(bufBc, -Infinity), 1)
- t.equal(b.indexOf(bufBc, Infinity), -1)
- t.equal(b.indexOf(bufF), b.length - 1)
- t.equal(b.indexOf(bufZ), -1)
- t.equal(b.indexOf(0x61), 0)
- t.equal(b.indexOf(0x61, 1), -1)
- t.equal(b.indexOf(0x61, -1), -1)
- t.equal(b.indexOf(0x61, -4), -1)
- t.equal(b.indexOf(0x61, -b.length), 0)
- t.equal(b.indexOf(0x61, NaN), 0)
- t.equal(b.indexOf(0x61, -Infinity), 0)
- t.equal(b.indexOf(0x61, Infinity), -1)
- t.equal(b.indexOf(0x0), -1)
-
- // test offsets
- t.equal(b.indexOf('d', 2), 3)
- t.equal(b.indexOf('f', 5), 5)
- t.equal(b.indexOf('f', -1), 5)
- t.equal(b.indexOf('f', 6), -1)
-
- t.equal(b.indexOf(Buffer.from('d'), 2), 3)
- t.equal(b.indexOf(Buffer.from('f'), 5), 5)
- t.equal(b.indexOf(Buffer.from('f'), -1), 5)
- t.equal(b.indexOf(Buffer.from('f'), 6), -1)
-
- t.equal(Buffer.from('ff').indexOf(Buffer.from('f'), 1, 'ucs2'), -1)
-
- // test invalid and uppercase encoding
- t.equal(b.indexOf('b', 'utf8'), 1)
- t.equal(b.indexOf('b', 'UTF8'), 1)
- t.equal(b.indexOf('62', 'HEX'), 1)
- t.throws(() => b.indexOf('bad', 'enc'), TypeError)
-
- // test hex encoding
- t.equal(
- Buffer.from(b.toString('hex'), 'hex')
- .indexOf('64', 0, 'hex'),
- 3
- )
- t.equal(
- Buffer.from(b.toString('hex'), 'hex')
- .indexOf(Buffer.from('64', 'hex'), 0, 'hex'),
- 3
- )
-
- // test base64 encoding
- t.equal(
- Buffer.from(b.toString('base64'), 'base64')
- .indexOf('ZA==', 0, 'base64'),
- 3
- )
- t.equal(
- Buffer.from(b.toString('base64'), 'base64')
- .indexOf(Buffer.from('ZA==', 'base64'), 0, 'base64'),
- 3
- )
-
- // test ascii encoding
- t.equal(
- Buffer.from(b.toString('ascii'), 'ascii')
- .indexOf('d', 0, 'ascii'),
- 3
- )
- t.equal(
- Buffer.from(b.toString('ascii'), 'ascii')
- .indexOf(Buffer.from('d', 'ascii'), 0, 'ascii'),
- 3
- )
-
- // test optional offset with passed encoding
- t.equal(Buffer.from('aaaa0').indexOf('30', 'hex'), 4)
- t.equal(Buffer.from('aaaa00a').indexOf('3030', 'hex'), 4)
-
- {
- // test usc2 encoding
- const twoByteString = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2')
-
- t.equal(8, twoByteString.indexOf('\u0395', 4, 'ucs2'))
- t.equal(6, twoByteString.indexOf('\u03a3', -4, 'ucs2'))
- t.equal(4, twoByteString.indexOf('\u03a3', -6, 'ucs2'))
- t.equal(4, twoByteString.indexOf(
- Buffer.from('\u03a3', 'ucs2'), -6, 'ucs2'))
- t.equal(-1, twoByteString.indexOf('\u03a3', -2, 'ucs2'))
- }
-
- const mixedByteStringUcs2 =
- Buffer.from('\u039a\u0391abc\u03a3\u03a3\u0395', 'ucs2')
-
- t.equal(6, mixedByteStringUcs2.indexOf('bc', 0, 'ucs2'))
- t.equal(10, mixedByteStringUcs2.indexOf('\u03a3', 0, 'ucs2'))
- t.equal(-1, mixedByteStringUcs2.indexOf('\u0396', 0, 'ucs2'))
-
- t.equal(
- 6, mixedByteStringUcs2.indexOf(Buffer.from('bc', 'ucs2'), 0, 'ucs2'))
- t.equal(
- 10, mixedByteStringUcs2.indexOf(Buffer.from('\u03a3', 'ucs2'), 0, 'ucs2'))
- t.equal(
- -1, mixedByteStringUcs2.indexOf(Buffer.from('\u0396', 'ucs2'), 0, 'ucs2'))
-
- {
- const twoByteString = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2')
-
- // Test single char pattern
- t.equal(0, twoByteString.indexOf('\u039a', 0, 'ucs2'))
- let index = twoByteString.indexOf('\u0391', 0, 'ucs2')
- t.equal(2, index, `Alpha - at index ${index}`)
- index = twoByteString.indexOf('\u03a3', 0, 'ucs2')
- t.equal(4, index, `First Sigma - at index ${index}`)
- index = twoByteString.indexOf('\u03a3', 6, 'ucs2')
- t.equal(6, index, `Second Sigma - at index ${index}`)
- index = twoByteString.indexOf('\u0395', 0, 'ucs2')
- t.equal(8, index, `Epsilon - at index ${index}`)
- index = twoByteString.indexOf('\u0392', 0, 'ucs2')
- t.equal(-1, index, `Not beta - at index ${index}`)
-
- // Test multi-char pattern
- index = twoByteString.indexOf('\u039a\u0391', 0, 'ucs2')
- t.equal(0, index, `Lambda Alpha - at index ${index}`)
- index = twoByteString.indexOf('\u0391\u03a3', 0, 'ucs2')
- t.equal(2, index, `Alpha Sigma - at index ${index}`)
- index = twoByteString.indexOf('\u03a3\u03a3', 0, 'ucs2')
- t.equal(4, index, `Sigma Sigma - at index ${index}`)
- index = twoByteString.indexOf('\u03a3\u0395', 0, 'ucs2')
- t.equal(6, index, `Sigma Epsilon - at index ${index}`)
- }
-
- const mixedByteStringUtf8 = Buffer.from('\u039a\u0391abc\u03a3\u03a3\u0395')
-
- t.equal(5, mixedByteStringUtf8.indexOf('bc'))
- t.equal(5, mixedByteStringUtf8.indexOf('bc', 5))
- t.equal(5, mixedByteStringUtf8.indexOf('bc', -8))
- t.equal(7, mixedByteStringUtf8.indexOf('\u03a3'))
- t.equal(-1, mixedByteStringUtf8.indexOf('\u0396'))
-
- // Test complex string indexOf algorithms. Only trigger for long strings.
- // Long string that isn't a simple repeat of a shorter string.
- let longString = 'A'
- for (let i = 66; i < 76; i++) { // from 'B' to 'K'
- longString = longString + String.fromCharCode(i) + longString
- }
-
- const longBufferString = Buffer.from(longString)
-
- // pattern of 15 chars, repeated every 16 chars in long
- let pattern = 'ABACABADABACABA'
- for (let i = 0; i < longBufferString.length - pattern.length; i += 7) {
- const index = longBufferString.indexOf(pattern, i)
- t.equal((i + 15) & ~0xf, index,
- `Long ABACABA...-string at index ${i}`)
- }
-
- let index = longBufferString.indexOf('AJABACA')
- t.equal(510, index, `Long AJABACA, First J - at index ${index}`)
- index = longBufferString.indexOf('AJABACA', 511)
- t.equal(1534, index, `Long AJABACA, Second J - at index ${index}`)
-
- pattern = 'JABACABADABACABA'
- index = longBufferString.indexOf(pattern)
- t.equal(511, index, `Long JABACABA..., First J - at index ${index}`)
- index = longBufferString.indexOf(pattern, 512)
- t.equal(
- 1535, index, `Long JABACABA..., Second J - at index ${index}`)
-
- // Search for a non-ASCII string in a pure ASCII string.
- const asciiString = Buffer.from(
- 'somethingnotatallsinisterwhichalsoworks')
- t.equal(-1, asciiString.indexOf('\x2061'))
- t.equal(3, asciiString.indexOf('eth', 0))
-
- // Search in string containing many non-ASCII chars.
- const allCodePoints = []
- for (let i = 0; i < 65536; i++) {
- allCodePoints[i] = i
- }
-
- const allCharsString = String.fromCharCode.apply(String, allCodePoints)
- const allCharsBufferUtf8 = Buffer.from(allCharsString)
- const allCharsBufferUcs2 = Buffer.from(allCharsString, 'ucs2')
-
- // Search for string long enough to trigger complex search with ASCII pattern
- // and UC16 subject.
- t.equal(-1, allCharsBufferUtf8.indexOf('notfound'))
- t.equal(-1, allCharsBufferUcs2.indexOf('notfound'))
-
- // Needle is longer than haystack, but only because it's encoded as UTF-16
- t.equal(Buffer.from('aaaa').indexOf('a'.repeat(4), 'ucs2'), -1)
-
- t.equal(Buffer.from('aaaa').indexOf('a'.repeat(4), 'utf8'), 0)
- t.equal(Buffer.from('aaaa').indexOf('你好', 'ucs2'), -1)
-
- // Haystack has odd length, but the needle is UCS2.
- t.equal(Buffer.from('aaaaa').indexOf('b', 'ucs2'), -1)
-
- {
- // Find substrings in Utf8.
- const lengths = [1, 3, 15] // Single char, simple and complex.
- const indices = [0x5, 0x60, 0x400, 0x680, 0x7ee, 0xFF02, 0x16610, 0x2f77b]
- for (let lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) {
- for (let i = 0; i < indices.length; i++) {
- const index = indices[i]
- let length = lengths[lengthIndex]
-
- if (index + length > 0x7F) {
- length = 2 * length
- }
-
- if (index + length > 0x7FF) {
- length = 3 * length
- }
-
- if (index + length > 0xFFFF) {
- length = 4 * length
- }
-
- const patternBufferUtf8 = allCharsBufferUtf8.slice(index, index + length)
- t.equal(index, allCharsBufferUtf8.indexOf(patternBufferUtf8))
-
- const patternStringUtf8 = patternBufferUtf8.toString()
- t.equal(index, allCharsBufferUtf8.indexOf(patternStringUtf8))
- }
- }
- }
-
- {
- // Find substrings in Usc2.
- const lengths = [2, 4, 16] // Single char, simple and complex.
- const indices = [0x5, 0x65, 0x105, 0x205, 0x285, 0x2005, 0x2085, 0xfff0]
-
- for (let lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) {
- for (let i = 0; i < indices.length; i++) {
- const index = indices[i] * 2
- const length = lengths[lengthIndex]
-
- const patternBufferUcs2 =
- allCharsBufferUcs2.slice(index, index + length)
- t.equal(
- index, allCharsBufferUcs2.indexOf(patternBufferUcs2, 0, 'ucs2'))
-
- const patternStringUcs2 = patternBufferUcs2.toString('ucs2')
- t.equal(
- index, allCharsBufferUcs2.indexOf(patternStringUcs2, 0, 'ucs2'))
- }
- }
- }
-
- [
- () => {},
- {},
- []
- ].forEach((val) => {
- t.throws(() => b.indexOf(val), TypeError, `"${JSON.stringify(val)}" should throw`)
- })
-
- // Test weird offset arguments.
- // The following offsets coerce to NaN or 0, searching the whole Buffer
- t.equal(b.indexOf('b', undefined), 1)
- t.equal(b.indexOf('b', {}), 1)
- t.equal(b.indexOf('b', 0), 1)
- t.equal(b.indexOf('b', null), 1)
- t.equal(b.indexOf('b', []), 1)
-
- // The following offset coerces to 2, in other words +[2] === 2
- t.equal(b.indexOf('b', [2]), -1)
-
- // Behavior should match String.indexOf()
- t.equal(
- b.indexOf('b', undefined),
- stringComparison.indexOf('b', undefined))
- t.equal(
- b.indexOf('b', {}),
- stringComparison.indexOf('b', {}))
- t.equal(
- b.indexOf('b', 0),
- stringComparison.indexOf('b', 0))
- t.equal(
- b.indexOf('b', null),
- stringComparison.indexOf('b', null))
- t.equal(
- b.indexOf('b', []),
- stringComparison.indexOf('b', []))
- t.equal(
- b.indexOf('b', [2]),
- stringComparison.indexOf('b', [2]))
-
- // test truncation of Number arguments to uint8
- {
- const buf = Buffer.from('this is a test')
-
- t.equal(buf.indexOf(0x6973), 3)
- t.equal(buf.indexOf(0x697320), 4)
- t.equal(buf.indexOf(0x69732069), 2)
- t.equal(buf.indexOf(0x697374657374), 0)
- t.equal(buf.indexOf(0x69737374), 0)
- t.equal(buf.indexOf(0x69737465), 11)
- t.equal(buf.indexOf(0x69737465), 11)
- t.equal(buf.indexOf(-140), 0)
- t.equal(buf.indexOf(-152), 1)
- t.equal(buf.indexOf(0xff), -1)
- t.equal(buf.indexOf(0xffff), -1)
- }
-
- // Test that Uint8Array arguments are okay.
- {
- const needle = new Uint8Array([0x66, 0x6f, 0x6f])
- const haystack = new BufferList(Buffer.from('a foo b foo'))
- t.equal(haystack.indexOf(needle), 2)
- }
-
- t.end()
-})
diff --git a/node_modules/bl/test/isBufferList.js b/node_modules/bl/test/isBufferList.js
deleted file mode 100644
index 9d895d5..0000000
--- a/node_modules/bl/test/isBufferList.js
+++ /dev/null
@@ -1,32 +0,0 @@
-'use strict'
-
-const tape = require('tape')
-const { BufferList, BufferListStream } = require('../')
-const { Buffer } = require('buffer')
-
-tape('isBufferList positives', (t) => {
- t.ok(BufferList.isBufferList(new BufferList()))
- t.ok(BufferList.isBufferList(new BufferListStream()))
-
- t.end()
-})
-
-tape('isBufferList negatives', (t) => {
- const types = [
- null,
- undefined,
- NaN,
- true,
- false,
- {},
- [],
- Buffer.alloc(0),
- [Buffer.alloc(0)]
- ]
-
- for (const obj of types) {
- t.notOk(BufferList.isBufferList(obj))
- }
-
- t.end()
-})
diff --git a/node_modules/bl/test/test.js b/node_modules/bl/test/test.js
deleted file mode 100644
index e523d0c..0000000
--- a/node_modules/bl/test/test.js
+++ /dev/null
@@ -1,869 +0,0 @@
-'use strict'
-
-const tape = require('tape')
-const crypto = require('crypto')
-const fs = require('fs')
-const path = require('path')
-const BufferList = require('../')
-const { Buffer } = require('buffer')
-
-const encodings =
- ('hex utf8 utf-8 ascii binary base64' +
- (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ')
-
-require('./indexOf')
-require('./isBufferList')
-require('./convert')
-
-tape('single bytes from single buffer', function (t) {
- const bl = new BufferList()
-
- bl.append(Buffer.from('abcd'))
-
- t.equal(bl.length, 4)
- t.equal(bl.get(-1), undefined)
- t.equal(bl.get(0), 97)
- t.equal(bl.get(1), 98)
- t.equal(bl.get(2), 99)
- t.equal(bl.get(3), 100)
- t.equal(bl.get(4), undefined)
-
- t.end()
-})
-
-tape('single bytes from multiple buffers', function (t) {
- const bl = new BufferList()
-
- bl.append(Buffer.from('abcd'))
- bl.append(Buffer.from('efg'))
- bl.append(Buffer.from('hi'))
- bl.append(Buffer.from('j'))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.get(0), 97)
- t.equal(bl.get(1), 98)
- t.equal(bl.get(2), 99)
- t.equal(bl.get(3), 100)
- t.equal(bl.get(4), 101)
- t.equal(bl.get(5), 102)
- t.equal(bl.get(6), 103)
- t.equal(bl.get(7), 104)
- t.equal(bl.get(8), 105)
- t.equal(bl.get(9), 106)
-
- t.end()
-})
-
-tape('multi bytes from single buffer', function (t) {
- const bl = new BufferList()
-
- bl.append(Buffer.from('abcd'))
-
- t.equal(bl.length, 4)
-
- t.equal(bl.slice(0, 4).toString('ascii'), 'abcd')
- t.equal(bl.slice(0, 3).toString('ascii'), 'abc')
- t.equal(bl.slice(1, 4).toString('ascii'), 'bcd')
- t.equal(bl.slice(-4, -1).toString('ascii'), 'abc')
-
- t.end()
-})
-
-tape('multi bytes from single buffer (negative indexes)', function (t) {
- const bl = new BufferList()
-
- bl.append(Buffer.from('buffer'))
-
- t.equal(bl.length, 6)
-
- t.equal(bl.slice(-6, -1).toString('ascii'), 'buffe')
- t.equal(bl.slice(-6, -2).toString('ascii'), 'buff')
- t.equal(bl.slice(-5, -2).toString('ascii'), 'uff')
-
- t.end()
-})
-
-tape('multiple bytes from multiple buffers', function (t) {
- const bl = new BufferList()
-
- bl.append(Buffer.from('abcd'))
- bl.append(Buffer.from('efg'))
- bl.append(Buffer.from('hi'))
- bl.append(Buffer.from('j'))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
- t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
- t.equal(bl.slice(3, 6).toString('ascii'), 'def')
- t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
- t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
- t.equal(bl.slice(-7, -4).toString('ascii'), 'def')
-
- t.end()
-})
-
-tape('multiple bytes from multiple buffer lists', function (t) {
- const bl = new BufferList()
-
- bl.append(new BufferList([Buffer.from('abcd'), Buffer.from('efg')]))
- bl.append(new BufferList([Buffer.from('hi'), Buffer.from('j')]))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
-
- t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
- t.equal(bl.slice(3, 6).toString('ascii'), 'def')
- t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
- t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
-
- t.end()
-})
-
-// same data as previous test, just using nested constructors
-tape('multiple bytes from crazy nested buffer lists', function (t) {
- const bl = new BufferList()
-
- bl.append(new BufferList([
- new BufferList([
- new BufferList(Buffer.from('abc')),
- Buffer.from('d'),
- new BufferList(Buffer.from('efg'))
- ]),
- new BufferList([Buffer.from('hi')]),
- new BufferList(Buffer.from('j'))
- ]))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
-
- t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
- t.equal(bl.slice(3, 6).toString('ascii'), 'def')
- t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
- t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
-
- t.end()
-})
-
-tape('append accepts arrays of Buffers', function (t) {
- const bl = new BufferList()
-
- bl.append(Buffer.from('abc'))
- bl.append([Buffer.from('def')])
- bl.append([Buffer.from('ghi'), Buffer.from('jkl')])
- bl.append([Buffer.from('mnop'), Buffer.from('qrstu'), Buffer.from('vwxyz')])
- t.equal(bl.length, 26)
- t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
-
- t.end()
-})
-
-tape('append accepts arrays of Uint8Arrays', function (t) {
- const bl = new BufferList()
-
- bl.append(new Uint8Array([97, 98, 99]))
- bl.append([Uint8Array.from([100, 101, 102])])
- bl.append([new Uint8Array([103, 104, 105]), new Uint8Array([106, 107, 108])])
- bl.append([new Uint8Array([109, 110, 111, 112]), new Uint8Array([113, 114, 115, 116, 117]), new Uint8Array([118, 119, 120, 121, 122])])
- t.equal(bl.length, 26)
- t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
-
- t.end()
-})
-
-tape('append accepts arrays of BufferLists', function (t) {
- const bl = new BufferList()
-
- bl.append(Buffer.from('abc'))
- bl.append([new BufferList('def')])
- bl.append(new BufferList([Buffer.from('ghi'), new BufferList('jkl')]))
- bl.append([Buffer.from('mnop'), new BufferList([Buffer.from('qrstu'), Buffer.from('vwxyz')])])
- t.equal(bl.length, 26)
- t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
-
- t.end()
-})
-
-tape('append chainable', function (t) {
- const bl = new BufferList()
-
- t.ok(bl.append(Buffer.from('abcd')) === bl)
- t.ok(bl.append([Buffer.from('abcd')]) === bl)
- t.ok(bl.append(new BufferList(Buffer.from('abcd'))) === bl)
- t.ok(bl.append([new BufferList(Buffer.from('abcd'))]) === bl)
-
- t.end()
-})
-
-tape('append chainable (test results)', function (t) {
- const bl = new BufferList('abc')
- .append([new BufferList('def')])
- .append(new BufferList([Buffer.from('ghi'), new BufferList('jkl')]))
- .append([Buffer.from('mnop'), new BufferList([Buffer.from('qrstu'), Buffer.from('vwxyz')])])
-
- t.equal(bl.length, 26)
- t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
-
- t.end()
-})
-
-tape('consuming from multiple buffers', function (t) {
- const bl = new BufferList()
-
- bl.append(Buffer.from('abcd'))
- bl.append(Buffer.from('efg'))
- bl.append(Buffer.from('hi'))
- bl.append(Buffer.from('j'))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
-
- bl.consume(3)
- t.equal(bl.length, 7)
- t.equal(bl.slice(0, 7).toString('ascii'), 'defghij')
-
- bl.consume(2)
- t.equal(bl.length, 5)
- t.equal(bl.slice(0, 5).toString('ascii'), 'fghij')
-
- bl.consume(1)
- t.equal(bl.length, 4)
- t.equal(bl.slice(0, 4).toString('ascii'), 'ghij')
-
- bl.consume(1)
- t.equal(bl.length, 3)
- t.equal(bl.slice(0, 3).toString('ascii'), 'hij')
-
- bl.consume(2)
- t.equal(bl.length, 1)
- t.equal(bl.slice(0, 1).toString('ascii'), 'j')
-
- t.end()
-})
-
-tape('complete consumption', function (t) {
- const bl = new BufferList()
-
- bl.append(Buffer.from('a'))
- bl.append(Buffer.from('b'))
-
- bl.consume(2)
-
- t.equal(bl.length, 0)
- t.equal(bl._bufs.length, 0)
-
- t.end()
-})
-
-tape('test readUInt8 / readInt8', function (t) {
- const buf1 = Buffer.alloc(1)
- const buf2 = Buffer.alloc(3)
- const buf3 = Buffer.alloc(3)
- const bl = new BufferList()
-
- buf1[0] = 0x1
- buf2[1] = 0x3
- buf2[2] = 0x4
- buf3[0] = 0x23
- buf3[1] = 0x42
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readUInt8(), 0x1)
- t.equal(bl.readUInt8(2), 0x3)
- t.equal(bl.readInt8(2), 0x3)
- t.equal(bl.readUInt8(3), 0x4)
- t.equal(bl.readInt8(3), 0x4)
- t.equal(bl.readUInt8(4), 0x23)
- t.equal(bl.readInt8(4), 0x23)
- t.equal(bl.readUInt8(5), 0x42)
- t.equal(bl.readInt8(5), 0x42)
-
- t.end()
-})
-
-tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) {
- const buf1 = Buffer.alloc(1)
- const buf2 = Buffer.alloc(3)
- const buf3 = Buffer.alloc(3)
- const bl = new BufferList()
-
- buf1[0] = 0x1
- buf2[1] = 0x3
- buf2[2] = 0x4
- buf3[0] = 0x23
- buf3[1] = 0x42
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readUInt16BE(), 0x0100)
- t.equal(bl.readUInt16LE(), 0x0001)
- t.equal(bl.readUInt16BE(2), 0x0304)
- t.equal(bl.readUInt16LE(2), 0x0403)
- t.equal(bl.readInt16BE(2), 0x0304)
- t.equal(bl.readInt16LE(2), 0x0403)
- t.equal(bl.readUInt16BE(3), 0x0423)
- t.equal(bl.readUInt16LE(3), 0x2304)
- t.equal(bl.readInt16BE(3), 0x0423)
- t.equal(bl.readInt16LE(3), 0x2304)
- t.equal(bl.readUInt16BE(4), 0x2342)
- t.equal(bl.readUInt16LE(4), 0x4223)
- t.equal(bl.readInt16BE(4), 0x2342)
- t.equal(bl.readInt16LE(4), 0x4223)
-
- t.end()
-})
-
-tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) {
- const buf1 = Buffer.alloc(1)
- const buf2 = Buffer.alloc(3)
- const buf3 = Buffer.alloc(3)
- const bl = new BufferList()
-
- buf1[0] = 0x1
- buf2[1] = 0x3
- buf2[2] = 0x4
- buf3[0] = 0x23
- buf3[1] = 0x42
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readUInt32BE(), 0x01000304)
- t.equal(bl.readUInt32LE(), 0x04030001)
- t.equal(bl.readUInt32BE(2), 0x03042342)
- t.equal(bl.readUInt32LE(2), 0x42230403)
- t.equal(bl.readInt32BE(2), 0x03042342)
- t.equal(bl.readInt32LE(2), 0x42230403)
-
- t.end()
-})
-
-tape('test readUIntLE / readUIntBE / readIntLE / readIntBE', function (t) {
- const buf1 = Buffer.alloc(1)
- const buf2 = Buffer.alloc(3)
- const buf3 = Buffer.alloc(3)
- const bl = new BufferList()
-
- buf2[0] = 0x2
- buf2[1] = 0x3
- buf2[2] = 0x4
- buf3[0] = 0x23
- buf3[1] = 0x42
- buf3[2] = 0x61
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readUIntBE(1, 1), 0x02)
- t.equal(bl.readUIntBE(1, 2), 0x0203)
- t.equal(bl.readUIntBE(1, 3), 0x020304)
- t.equal(bl.readUIntBE(1, 4), 0x02030423)
- t.equal(bl.readUIntBE(1, 5), 0x0203042342)
- t.equal(bl.readUIntBE(1, 6), 0x020304234261)
- t.equal(bl.readUIntLE(1, 1), 0x02)
- t.equal(bl.readUIntLE(1, 2), 0x0302)
- t.equal(bl.readUIntLE(1, 3), 0x040302)
- t.equal(bl.readUIntLE(1, 4), 0x23040302)
- t.equal(bl.readUIntLE(1, 5), 0x4223040302)
- t.equal(bl.readUIntLE(1, 6), 0x614223040302)
- t.equal(bl.readIntBE(1, 1), 0x02)
- t.equal(bl.readIntBE(1, 2), 0x0203)
- t.equal(bl.readIntBE(1, 3), 0x020304)
- t.equal(bl.readIntBE(1, 4), 0x02030423)
- t.equal(bl.readIntBE(1, 5), 0x0203042342)
- t.equal(bl.readIntBE(1, 6), 0x020304234261)
- t.equal(bl.readIntLE(1, 1), 0x02)
- t.equal(bl.readIntLE(1, 2), 0x0302)
- t.equal(bl.readIntLE(1, 3), 0x040302)
- t.equal(bl.readIntLE(1, 4), 0x23040302)
- t.equal(bl.readIntLE(1, 5), 0x4223040302)
- t.equal(bl.readIntLE(1, 6), 0x614223040302)
-
- t.end()
-})
-
-tape('test readFloatLE / readFloatBE', function (t) {
- const buf1 = Buffer.alloc(1)
- const buf2 = Buffer.alloc(3)
- const buf3 = Buffer.alloc(3)
- const bl = new BufferList()
-
- buf1[0] = 0x01
- buf2[1] = 0x00
- buf2[2] = 0x00
- buf3[0] = 0x80
- buf3[1] = 0x3f
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- const canonical = Buffer.concat([buf1, buf2, buf3])
- t.equal(bl.readFloatLE(), canonical.readFloatLE())
- t.equal(bl.readFloatBE(), canonical.readFloatBE())
- t.equal(bl.readFloatLE(2), canonical.readFloatLE(2))
- t.equal(bl.readFloatBE(2), canonical.readFloatBE(2))
-
- t.end()
-})
-
-tape('test readDoubleLE / readDoubleBE', function (t) {
- const buf1 = Buffer.alloc(1)
- const buf2 = Buffer.alloc(3)
- const buf3 = Buffer.alloc(10)
- const bl = new BufferList()
-
- buf1[0] = 0x01
- buf2[1] = 0x55
- buf2[2] = 0x55
- buf3[0] = 0x55
- buf3[1] = 0x55
- buf3[2] = 0x55
- buf3[3] = 0x55
- buf3[4] = 0xd5
- buf3[5] = 0x3f
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- const canonical = Buffer.concat([buf1, buf2, buf3])
- t.equal(bl.readDoubleBE(), canonical.readDoubleBE())
- t.equal(bl.readDoubleLE(), canonical.readDoubleLE())
- t.equal(bl.readDoubleBE(2), canonical.readDoubleBE(2))
- t.equal(bl.readDoubleLE(2), canonical.readDoubleLE(2))
-
- t.end()
-})
-
-tape('test toString', function (t) {
- const bl = new BufferList()
-
- bl.append(Buffer.from('abcd'))
- bl.append(Buffer.from('efg'))
- bl.append(Buffer.from('hi'))
- bl.append(Buffer.from('j'))
-
- t.equal(bl.toString('ascii', 0, 10), 'abcdefghij')
- t.equal(bl.toString('ascii', 3, 10), 'defghij')
- t.equal(bl.toString('ascii', 3, 6), 'def')
- t.equal(bl.toString('ascii', 3, 8), 'defgh')
- t.equal(bl.toString('ascii', 5, 10), 'fghij')
-
- t.end()
-})
-
-tape('test toString encoding', function (t) {
- const bl = new BufferList()
- const b = Buffer.from('abcdefghij\xff\x00')
-
- bl.append(Buffer.from('abcd'))
- bl.append(Buffer.from('efg'))
- bl.append(Buffer.from('hi'))
- bl.append(Buffer.from('j'))
- bl.append(Buffer.from('\xff\x00'))
-
- encodings.forEach(function (enc) {
- t.equal(bl.toString(enc), b.toString(enc), enc)
- })
-
- t.end()
-})
-
-tape('uninitialized memory', function (t) {
- const secret = crypto.randomBytes(256)
- for (let i = 0; i < 1e6; i++) {
- const clone = Buffer.from(secret)
- const bl = new BufferList()
- bl.append(Buffer.from('a'))
- bl.consume(-1024)
- const buf = bl.slice(1)
- if (buf.indexOf(clone) !== -1) {
- t.fail(`Match (at ${i})`)
- break
- }
- }
- t.end()
-})
-
-!process.browser && tape('test stream', function (t) {
- const random = crypto.randomBytes(65534)
-
- const bl = new BufferList((err, buf) => {
- t.ok(Buffer.isBuffer(buf))
- t.ok(err === null)
- t.ok(random.equals(bl.slice()))
- t.ok(random.equals(buf.slice()))
-
- bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat'))
- .on('close', function () {
- const rndhash = crypto.createHash('md5').update(random).digest('hex')
- const md5sum = crypto.createHash('md5')
- const s = fs.createReadStream('/tmp/bl_test_rnd_out.dat')
-
- s.on('data', md5sum.update.bind(md5sum))
- s.on('end', function () {
- t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!')
- t.end()
- })
- })
- })
-
- fs.writeFileSync('/tmp/bl_test_rnd.dat', random)
- fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl)
-})
-
-tape('instantiation with Buffer', function (t) {
- const buf = crypto.randomBytes(1024)
- const buf2 = crypto.randomBytes(1024)
- let b = BufferList(buf)
-
- t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer')
- b = BufferList([buf, buf2])
- t.equal(b.slice().toString('hex'), Buffer.concat([buf, buf2]).toString('hex'), 'same buffer')
-
- t.end()
-})
-
-tape('test String appendage', function (t) {
- const bl = new BufferList()
- const b = Buffer.from('abcdefghij\xff\x00')
-
- bl.append('abcd')
- bl.append('efg')
- bl.append('hi')
- bl.append('j')
- bl.append('\xff\x00')
-
- encodings.forEach(function (enc) {
- t.equal(bl.toString(enc), b.toString(enc))
- })
-
- t.end()
-})
-
-tape('test Number appendage', function (t) {
- const bl = new BufferList()
- const b = Buffer.from('1234567890')
-
- bl.append(1234)
- bl.append(567)
- bl.append(89)
- bl.append(0)
-
- encodings.forEach(function (enc) {
- t.equal(bl.toString(enc), b.toString(enc))
- })
-
- t.end()
-})
-
-tape('write nothing, should get empty buffer', function (t) {
- t.plan(3)
- BufferList(function (err, data) {
- t.notOk(err, 'no error')
- t.ok(Buffer.isBuffer(data), 'got a buffer')
- t.equal(0, data.length, 'got a zero-length buffer')
- t.end()
- }).end()
-})
-
-tape('unicode string', function (t) {
- t.plan(2)
-
- const inp1 = '\u2600'
- const inp2 = '\u2603'
- const exp = inp1 + ' and ' + inp2
- const bl = BufferList()
-
- bl.write(inp1)
- bl.write(' and ')
- bl.write(inp2)
- t.equal(exp, bl.toString())
- t.equal(Buffer.from(exp).toString('hex'), bl.toString('hex'))
-})
-
-tape('should emit finish', function (t) {
- const source = BufferList()
- const dest = BufferList()
-
- source.write('hello')
- source.pipe(dest)
-
- dest.on('finish', function () {
- t.equal(dest.toString('utf8'), 'hello')
- t.end()
- })
-})
-
-tape('basic copy', function (t) {
- const buf = crypto.randomBytes(1024)
- const buf2 = Buffer.alloc(1024)
- const b = BufferList(buf)
-
- b.copy(buf2)
- t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
-
- t.end()
-})
-
-tape('copy after many appends', function (t) {
- const buf = crypto.randomBytes(512)
- const buf2 = Buffer.alloc(1024)
- const b = BufferList(buf)
-
- b.append(buf)
- b.copy(buf2)
- t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
-
- t.end()
-})
-
-tape('copy at a precise position', function (t) {
- const buf = crypto.randomBytes(1004)
- const buf2 = Buffer.alloc(1024)
- const b = BufferList(buf)
-
- b.copy(buf2, 20)
- t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer')
-
- t.end()
-})
-
-tape('copy starting from a precise location', function (t) {
- const buf = crypto.randomBytes(10)
- const buf2 = Buffer.alloc(5)
- const b = BufferList(buf)
-
- b.copy(buf2, 0, 5)
- t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer')
-
- t.end()
-})
-
-tape('copy in an interval', function (t) {
- const rnd = crypto.randomBytes(10)
- const b = BufferList(rnd) // put the random bytes there
- const actual = Buffer.alloc(3)
- const expected = Buffer.alloc(3)
-
- rnd.copy(expected, 0, 5, 8)
- b.copy(actual, 0, 5, 8)
-
- t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer')
-
- t.end()
-})
-
-tape('copy an interval between two buffers', function (t) {
- const buf = crypto.randomBytes(10)
- const buf2 = Buffer.alloc(10)
- const b = BufferList(buf)
-
- b.append(buf)
- b.copy(buf2, 0, 5, 15)
-
- t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer')
-
- t.end()
-})
-
-tape('shallow slice across buffer boundaries', function (t) {
- const bl = new BufferList(['First', 'Second', 'Third'])
-
- t.equal(bl.shallowSlice(3, 13).toString(), 'stSecondTh')
-
- t.end()
-})
-
-tape('shallow slice within single buffer', function (t) {
- t.plan(2)
-
- const bl = new BufferList(['First', 'Second', 'Third'])
-
- t.equal(bl.shallowSlice(5, 10).toString(), 'Secon')
- t.equal(bl.shallowSlice(7, 10).toString(), 'con')
-
- t.end()
-})
-
-tape('shallow slice single buffer', function (t) {
- t.plan(3)
-
- const bl = new BufferList(['First', 'Second', 'Third'])
-
- t.equal(bl.shallowSlice(0, 5).toString(), 'First')
- t.equal(bl.shallowSlice(5, 11).toString(), 'Second')
- t.equal(bl.shallowSlice(11, 16).toString(), 'Third')
-})
-
-tape('shallow slice with negative or omitted indices', function (t) {
- t.plan(4)
-
- const bl = new BufferList(['First', 'Second', 'Third'])
-
- t.equal(bl.shallowSlice().toString(), 'FirstSecondThird')
- t.equal(bl.shallowSlice(5).toString(), 'SecondThird')
- t.equal(bl.shallowSlice(5, -3).toString(), 'SecondTh')
- t.equal(bl.shallowSlice(-8).toString(), 'ondThird')
-})
-
-tape('shallow slice does not make a copy', function (t) {
- t.plan(1)
-
- const buffers = [Buffer.from('First'), Buffer.from('Second'), Buffer.from('Third')]
- const bl = (new BufferList(buffers)).shallowSlice(5, -3)
-
- buffers[1].fill('h')
- buffers[2].fill('h')
-
- t.equal(bl.toString(), 'hhhhhhhh')
-})
-
-tape('shallow slice with 0 length', function (t) {
- t.plan(1)
-
- const buffers = [Buffer.from('First'), Buffer.from('Second'), Buffer.from('Third')]
- const bl = (new BufferList(buffers)).shallowSlice(0, 0)
-
- t.equal(bl.length, 0)
-})
-
-tape('shallow slice with 0 length from middle', function (t) {
- t.plan(1)
-
- const buffers = [Buffer.from('First'), Buffer.from('Second'), Buffer.from('Third')]
- const bl = (new BufferList(buffers)).shallowSlice(10, 10)
-
- t.equal(bl.length, 0)
-})
-
-tape('duplicate', function (t) {
- t.plan(2)
-
- const bl = new BufferList('abcdefghij\xff\x00')
- const dup = bl.duplicate()
-
- t.equal(bl.prototype, dup.prototype)
- t.equal(bl.toString('hex'), dup.toString('hex'))
-})
-
-tape('destroy no pipe', function (t) {
- t.plan(2)
-
- const bl = new BufferList('alsdkfja;lsdkfja;lsdk')
-
- bl.destroy()
-
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
-})
-
-tape('destroy with error', function (t) {
- t.plan(3)
-
- const bl = new BufferList('alsdkfja;lsdkfja;lsdk')
- const err = new Error('kaboom')
-
- bl.destroy(err)
- bl.on('error', function (_err) {
- t.equal(_err, err)
- })
-
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
-})
-
-!process.browser && tape('destroy with pipe before read end', function (t) {
- t.plan(2)
-
- const bl = new BufferList()
- fs.createReadStream(path.join(__dirname, '/test.js'))
- .pipe(bl)
-
- bl.destroy()
-
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
-})
-
-!process.browser && tape('destroy with pipe before read end with race', function (t) {
- t.plan(2)
-
- const bl = new BufferList()
-
- fs.createReadStream(path.join(__dirname, '/test.js'))
- .pipe(bl)
-
- setTimeout(function () {
- bl.destroy()
- setTimeout(function () {
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
- }, 500)
- }, 500)
-})
-
-!process.browser && tape('destroy with pipe after read end', function (t) {
- t.plan(2)
-
- const bl = new BufferList()
-
- fs.createReadStream(path.join(__dirname, '/test.js'))
- .on('end', onEnd)
- .pipe(bl)
-
- function onEnd () {
- bl.destroy()
-
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
- }
-})
-
-!process.browser && tape('destroy with pipe while writing to a destination', function (t) {
- t.plan(4)
-
- const bl = new BufferList()
- const ds = new BufferList()
-
- fs.createReadStream(path.join(__dirname, '/test.js'))
- .on('end', onEnd)
- .pipe(bl)
-
- function onEnd () {
- bl.pipe(ds)
-
- setTimeout(function () {
- bl.destroy()
-
- t.equals(bl._bufs.length, 0)
- t.equals(bl.length, 0)
-
- ds.destroy()
-
- t.equals(bl._bufs.length, 0)
- t.equals(bl.length, 0)
- }, 100)
- }
-})
-
-!process.browser && tape('handle error', function (t) {
- t.plan(2)
-
- fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) {
- t.ok(err instanceof Error, 'has error')
- t.notOk(data, 'no data')
- }))
-})
diff --git a/node_modules/buffer/AUTHORS.md b/node_modules/buffer/AUTHORS.md
deleted file mode 100644
index 22eb171..0000000
--- a/node_modules/buffer/AUTHORS.md
+++ /dev/null
@@ -1,70 +0,0 @@
-# Authors
-
-#### Ordered by first contribution.
-
-- Romain Beauxis (toots@rastageeks.org)
-- Tobias Koppers (tobias.koppers@googlemail.com)
-- Janus (ysangkok@gmail.com)
-- Rainer Dreyer (rdrey1@gmail.com)
-- Tõnis Tiigi (tonistiigi@gmail.com)
-- James Halliday (mail@substack.net)
-- Michael Williamson (mike@zwobble.org)
-- elliottcable (github@elliottcable.name)
-- rafael (rvalle@livelens.net)
-- Andrew Kelley (superjoe30@gmail.com)
-- Andreas Madsen (amwebdk@gmail.com)
-- Mike Brevoort (mike.brevoort@pearson.com)
-- Brian White (mscdex@mscdex.net)
-- Feross Aboukhadijeh (feross@feross.org)
-- Ruben Verborgh (ruben@verborgh.org)
-- eliang (eliang.cs@gmail.com)
-- Jesse Tane (jesse.tane@gmail.com)
-- Alfonso Boza (alfonso@cloud.com)
-- Mathias Buus (mathiasbuus@gmail.com)
-- Devon Govett (devongovett@gmail.com)
-- Daniel Cousens (github@dcousens.com)
-- Joseph Dykstra (josephdykstra@gmail.com)
-- Parsha Pourkhomami (parshap+git@gmail.com)
-- Damjan Košir (damjan.kosir@gmail.com)
-- daverayment (dave.rayment@gmail.com)
-- kawanet (u-suke@kawa.net)
-- Linus Unnebäck (linus@folkdatorn.se)
-- Nolan Lawson (nolan.lawson@gmail.com)
-- Calvin Metcalf (calvin.metcalf@gmail.com)
-- Koki Takahashi (hakatasiloving@gmail.com)
-- Guy Bedford (guybedford@gmail.com)
-- Jan Schär (jscissr@gmail.com)
-- RaulTsc (tomescu.raul@gmail.com)
-- Matthieu Monsch (monsch@alum.mit.edu)
-- Dan Ehrenberg (littledan@chromium.org)
-- Kirill Fomichev (fanatid@ya.ru)
-- Yusuke Kawasaki (u-suke@kawa.net)
-- DC (dcposch@dcpos.ch)
-- John-David Dalton (john.david.dalton@gmail.com)
-- adventure-yunfei (adventure030@gmail.com)
-- Emil Bay (github@tixz.dk)
-- Sam Sudar (sudar.sam@gmail.com)
-- Volker Mische (volker.mische@gmail.com)
-- David Walton (support@geekstocks.com)
-- Сковорода Никита Андреевич (chalkerx@gmail.com)
-- greenkeeper[bot] (greenkeeper[bot]@users.noreply.github.com)
-- ukstv (sergey.ukustov@machinomy.com)
-- Renée Kooi (renee@kooi.me)
-- ranbochen (ranbochen@qq.com)
-- Vladimir Borovik (bobahbdb@gmail.com)
-- greenkeeper[bot] (23040076+greenkeeper[bot]@users.noreply.github.com)
-- kumavis (aaron@kumavis.me)
-- Sergey Ukustov (sergey.ukustov@machinomy.com)
-- Fei Liu (liu.feiwood@gmail.com)
-- Blaine Bublitz (blaine.bublitz@gmail.com)
-- clement (clement@seald.io)
-- Koushik Dutta (koushd@gmail.com)
-- Jordan Harband (ljharb@gmail.com)
-- Niklas Mischkulnig (mischnic@users.noreply.github.com)
-- Nikolai Vavilov (vvnicholas@gmail.com)
-- Fedor Nezhivoi (gyzerok@users.noreply.github.com)
-- Peter Newman (peternewman@users.noreply.github.com)
-- mathmakgakpak (44949126+mathmakgakpak@users.noreply.github.com)
-- jkkang (jkkang@smartauth.kr)
-
-#### Generated by bin/update-authors.sh.
diff --git a/node_modules/buffer/LICENSE b/node_modules/buffer/LICENSE
deleted file mode 100644
index d6bf75d..0000000
--- a/node_modules/buffer/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Feross Aboukhadijeh, and other contributors.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/node_modules/buffer/README.md b/node_modules/buffer/README.md
deleted file mode 100644
index 9a23d7c..0000000
--- a/node_modules/buffer/README.md
+++ /dev/null
@@ -1,410 +0,0 @@
-# buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
-
-[travis-image]: https://img.shields.io/travis/feross/buffer/master.svg
-[travis-url]: https://travis-ci.org/feross/buffer
-[npm-image]: https://img.shields.io/npm/v/buffer.svg
-[npm-url]: https://npmjs.org/package/buffer
-[downloads-image]: https://img.shields.io/npm/dm/buffer.svg
-[downloads-url]: https://npmjs.org/package/buffer
-[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
-[standard-url]: https://standardjs.com
-
-#### The buffer module from [node.js](https://nodejs.org/), for the browser.
-
-[![saucelabs][saucelabs-image]][saucelabs-url]
-
-[saucelabs-image]: https://saucelabs.com/browser-matrix/buffer.svg
-[saucelabs-url]: https://saucelabs.com/u/buffer
-
-With [browserify](http://browserify.org), simply `require('buffer')` or use the `Buffer` global and you will get this module.
-
-The goal is to provide an API that is 100% identical to
-[node's Buffer API](https://nodejs.org/api/buffer.html). Read the
-[official docs](https://nodejs.org/api/buffer.html) for the full list of properties,
-instance methods, and class methods that are supported.
-
-## features
-
-- Manipulate binary data like a boss, in all browsers!
-- Super fast. Backed by Typed Arrays (`Uint8Array`/`ArrayBuffer`, not `Object`)
-- Extremely small bundle size (**6.75KB minified + gzipped**, 51.9KB with comments)
-- Excellent browser support (Chrome, Firefox, Edge, Safari 9+, IE 11, iOS 9+, Android, etc.)
-- Preserves Node API exactly, with one minor difference (see below)
-- Square-bracket `buf[4]` notation works!
-- Does not modify any browser prototypes or put anything on `window`
-- Comprehensive test suite (including all buffer tests from node.js core)
-
-## install
-
-To use this module directly (without browserify), install it:
-
-```bash
-npm install buffer
-```
-
-This module was previously called **native-buffer-browserify**, but please use **buffer**
-from now on.
-
-If you do not use a bundler, you can use the [standalone script](https://bundle.run/buffer).
-
-## usage
-
-The module's API is identical to node's `Buffer` API. Read the
-[official docs](https://nodejs.org/api/buffer.html) for the full list of properties,
-instance methods, and class methods that are supported.
-
-As mentioned above, `require('buffer')` or use the `Buffer` global with
-[browserify](http://browserify.org) and this module will automatically be included
-in your bundle. Almost any npm module will work in the browser, even if it assumes that
-the node `Buffer` API will be available.
-
-To depend on this module explicitly (without browserify), require it like this:
-
-```js
-var Buffer = require('buffer/').Buffer // note: the trailing slash is important!
-```
-
-To require this module explicitly, use `require('buffer/')` which tells the node.js module
-lookup algorithm (also used by browserify) to use the **npm module** named `buffer`
-instead of the **node.js core** module named `buffer`!
-
-
-## how does it work?
-
-The Buffer constructor returns instances of `Uint8Array` that have their prototype
-changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of `Uint8Array`,
-so the returned instances will have all the node `Buffer` methods and the
-`Uint8Array` methods. Square bracket notation works as expected -- it returns a
-single octet.
-
-The `Uint8Array` prototype remains unmodified.
-
-
-## tracking the latest node api
-
-This module tracks the Buffer API in the latest (unstable) version of node.js. The Buffer
-API is considered **stable** in the
-[node stability index](https://nodejs.org/docs/latest/api/documentation.html#documentation_stability_index),
-so it is unlikely that there will ever be breaking changes.
-Nonetheless, when/if the Buffer API changes in node, this module's API will change
-accordingly.
-
-## related packages
-
-- [`buffer-reverse`](https://www.npmjs.com/package/buffer-reverse) - Reverse a buffer
-- [`buffer-xor`](https://www.npmjs.com/package/buffer-xor) - Bitwise xor a buffer
-- [`is-buffer`](https://www.npmjs.com/package/is-buffer) - Determine if an object is a Buffer without including the whole `Buffer` package
-
-## conversion packages
-
-### convert typed array to buffer
-
-Use [`typedarray-to-buffer`](https://www.npmjs.com/package/typedarray-to-buffer) to convert any kind of typed array to a `Buffer`. Does not perform a copy, so it's super fast.
-
-### convert buffer to typed array
-
-`Buffer` is a subclass of `Uint8Array` (which is a typed array). So there is no need to explicitly convert to typed array. Just use the buffer as a `Uint8Array`.
-
-### convert blob to buffer
-
-Use [`blob-to-buffer`](https://www.npmjs.com/package/blob-to-buffer) to convert a `Blob` to a `Buffer`.
-
-### convert buffer to blob
-
-To convert a `Buffer` to a `Blob`, use the `Blob` constructor:
-
-```js
-var blob = new Blob([ buffer ])
-```
-
-Optionally, specify a mimetype:
-
-```js
-var blob = new Blob([ buffer ], { type: 'text/html' })
-```
-
-### convert arraybuffer to buffer
-
-To convert an `ArrayBuffer` to a `Buffer`, use the `Buffer.from` function. Does not perform a copy, so it's super fast.
-
-```js
-var buffer = Buffer.from(arrayBuffer)
-```
-
-### convert buffer to arraybuffer
-
-To convert a `Buffer` to an `ArrayBuffer`, use the `.buffer` property (which is present on all `Uint8Array` objects):
-
-```js
-var arrayBuffer = buffer.buffer.slice(
- buffer.byteOffset, buffer.byteOffset + buffer.byteLength
-)
-```
-
-Alternatively, use the [`to-arraybuffer`](https://www.npmjs.com/package/to-arraybuffer) module.
-
-## performance
-
-See perf tests in `/perf`.
-
-`BrowserBuffer` is the browser `buffer` module (this repo). `Uint8Array` is included as a
-sanity check (since `BrowserBuffer` uses `Uint8Array` under the hood, `Uint8Array` will
-always be at least a bit faster). Finally, `NodeBuffer` is the node.js buffer module,
-which is included to compare against.
-
-NOTE: Performance has improved since these benchmarks were taken. PR welcome to update the README.
-
-### Chrome 38
-
-| Method | Operations | Accuracy | Sampled | Fastest |
-|:-------|:-----------|:---------|:--------|:-------:|
-| BrowserBuffer#bracket-notation | 11,457,464 ops/sec | ±0.86% | 66 | ✓ |
-| Uint8Array#bracket-notation | 10,824,332 ops/sec | ±0.74% | 65 | |
-| | | | |
-| BrowserBuffer#concat | 450,532 ops/sec | ±0.76% | 68 | |
-| Uint8Array#concat | 1,368,911 ops/sec | ±1.50% | 62 | ✓ |
-| | | | |
-| BrowserBuffer#copy(16000) | 903,001 ops/sec | ±0.96% | 67 | |
-| Uint8Array#copy(16000) | 1,422,441 ops/sec | ±1.04% | 66 | ✓ |
-| | | | |
-| BrowserBuffer#copy(16) | 11,431,358 ops/sec | ±0.46% | 69 | |
-| Uint8Array#copy(16) | 13,944,163 ops/sec | ±1.12% | 68 | ✓ |
-| | | | |
-| BrowserBuffer#new(16000) | 106,329 ops/sec | ±6.70% | 44 | |
-| Uint8Array#new(16000) | 131,001 ops/sec | ±2.85% | 31 | ✓ |
-| | | | |
-| BrowserBuffer#new(16) | 1,554,491 ops/sec | ±1.60% | 65 | |
-| Uint8Array#new(16) | 6,623,930 ops/sec | ±1.66% | 65 | ✓ |
-| | | | |
-| BrowserBuffer#readDoubleBE | 112,830 ops/sec | ±0.51% | 69 | ✓ |
-| DataView#getFloat64 | 93,500 ops/sec | ±0.57% | 68 | |
-| | | | |
-| BrowserBuffer#readFloatBE | 146,678 ops/sec | ±0.95% | 68 | ✓ |
-| DataView#getFloat32 | 99,311 ops/sec | ±0.41% | 67 | |
-| | | | |
-| BrowserBuffer#readUInt32LE | 843,214 ops/sec | ±0.70% | 69 | ✓ |
-| DataView#getUint32 | 103,024 ops/sec | ±0.64% | 67 | |
-| | | | |
-| BrowserBuffer#slice | 1,013,941 ops/sec | ±0.75% | 67 | |
-| Uint8Array#subarray | 1,903,928 ops/sec | ±0.53% | 67 | ✓ |
-| | | | |
-| BrowserBuffer#writeFloatBE | 61,387 ops/sec | ±0.90% | 67 | |
-| DataView#setFloat32 | 141,249 ops/sec | ±0.40% | 66 | ✓ |
-
-
-### Firefox 33
-
-| Method | Operations | Accuracy | Sampled | Fastest |
-|:-------|:-----------|:---------|:--------|:-------:|
-| BrowserBuffer#bracket-notation | 20,800,421 ops/sec | ±1.84% | 60 | |
-| Uint8Array#bracket-notation | 20,826,235 ops/sec | ±2.02% | 61 | ✓ |
-| | | | |
-| BrowserBuffer#concat | 153,076 ops/sec | ±2.32% | 61 | |
-| Uint8Array#concat | 1,255,674 ops/sec | ±8.65% | 52 | ✓ |
-| | | | |
-| BrowserBuffer#copy(16000) | 1,105,312 ops/sec | ±1.16% | 63 | |
-| Uint8Array#copy(16000) | 1,615,911 ops/sec | ±0.55% | 66 | ✓ |
-| | | | |
-| BrowserBuffer#copy(16) | 16,357,599 ops/sec | ±0.73% | 68 | |
-| Uint8Array#copy(16) | 31,436,281 ops/sec | ±1.05% | 68 | ✓ |
-| | | | |
-| BrowserBuffer#new(16000) | 52,995 ops/sec | ±6.01% | 35 | |
-| Uint8Array#new(16000) | 87,686 ops/sec | ±5.68% | 45 | ✓ |
-| | | | |
-| BrowserBuffer#new(16) | 252,031 ops/sec | ±1.61% | 66 | |
-| Uint8Array#new(16) | 8,477,026 ops/sec | ±0.49% | 68 | ✓ |
-| | | | |
-| BrowserBuffer#readDoubleBE | 99,871 ops/sec | ±0.41% | 69 | |
-| DataView#getFloat64 | 285,663 ops/sec | ±0.70% | 68 | ✓ |
-| | | | |
-| BrowserBuffer#readFloatBE | 115,540 ops/sec | ±0.42% | 69 | |
-| DataView#getFloat32 | 288,722 ops/sec | ±0.82% | 68 | ✓ |
-| | | | |
-| BrowserBuffer#readUInt32LE | 633,926 ops/sec | ±1.08% | 67 | ✓ |
-| DataView#getUint32 | 294,808 ops/sec | ±0.79% | 64 | |
-| | | | |
-| BrowserBuffer#slice | 349,425 ops/sec | ±0.46% | 69 | |
-| Uint8Array#subarray | 5,965,819 ops/sec | ±0.60% | 65 | ✓ |
-| | | | |
-| BrowserBuffer#writeFloatBE | 59,980 ops/sec | ±0.41% | 67 | |
-| DataView#setFloat32 | 317,634 ops/sec | ±0.63% | 68 | ✓ |
-
-### Safari 8
-
-| Method | Operations | Accuracy | Sampled | Fastest |
-|:-------|:-----------|:---------|:--------|:-------:|
-| BrowserBuffer#bracket-notation | 10,279,729 ops/sec | ±2.25% | 56 | ✓ |
-| Uint8Array#bracket-notation | 10,030,767 ops/sec | ±2.23% | 59 | |
-| | | | |
-| BrowserBuffer#concat | 144,138 ops/sec | ±1.38% | 65 | |
-| Uint8Array#concat | 4,950,764 ops/sec | ±1.70% | 63 | ✓ |
-| | | | |
-| BrowserBuffer#copy(16000) | 1,058,548 ops/sec | ±1.51% | 64 | |
-| Uint8Array#copy(16000) | 1,409,666 ops/sec | ±1.17% | 65 | ✓ |
-| | | | |
-| BrowserBuffer#copy(16) | 6,282,529 ops/sec | ±1.88% | 58 | |
-| Uint8Array#copy(16) | 11,907,128 ops/sec | ±2.87% | 58 | ✓ |
-| | | | |
-| BrowserBuffer#new(16000) | 101,663 ops/sec | ±3.89% | 57 | |
-| Uint8Array#new(16000) | 22,050,818 ops/sec | ±6.51% | 46 | ✓ |
-| | | | |
-| BrowserBuffer#new(16) | 176,072 ops/sec | ±2.13% | 64 | |
-| Uint8Array#new(16) | 24,385,731 ops/sec | ±5.01% | 51 | ✓ |
-| | | | |
-| BrowserBuffer#readDoubleBE | 41,341 ops/sec | ±1.06% | 67 | |
-| DataView#getFloat64 | 322,280 ops/sec | ±0.84% | 68 | ✓ |
-| | | | |
-| BrowserBuffer#readFloatBE | 46,141 ops/sec | ±1.06% | 65 | |
-| DataView#getFloat32 | 337,025 ops/sec | ±0.43% | 69 | ✓ |
-| | | | |
-| BrowserBuffer#readUInt32LE | 151,551 ops/sec | ±1.02% | 66 | |
-| DataView#getUint32 | 308,278 ops/sec | ±0.94% | 67 | ✓ |
-| | | | |
-| BrowserBuffer#slice | 197,365 ops/sec | ±0.95% | 66 | |
-| Uint8Array#subarray | 9,558,024 ops/sec | ±3.08% | 58 | ✓ |
-| | | | |
-| BrowserBuffer#writeFloatBE | 17,518 ops/sec | ±1.03% | 63 | |
-| DataView#setFloat32 | 319,751 ops/sec | ±0.48% | 68 | ✓ |
-
-
-### Node 0.11.14
-
-| Method | Operations | Accuracy | Sampled | Fastest |
-|:-------|:-----------|:---------|:--------|:-------:|
-| BrowserBuffer#bracket-notation | 10,489,828 ops/sec | ±3.25% | 90 | |
-| Uint8Array#bracket-notation | 10,534,884 ops/sec | ±0.81% | 92 | ✓ |
-| NodeBuffer#bracket-notation | 10,389,910 ops/sec | ±0.97% | 87 | |
-| | | | |
-| BrowserBuffer#concat | 487,830 ops/sec | ±2.58% | 88 | |
-| Uint8Array#concat | 1,814,327 ops/sec | ±1.28% | 88 | ✓ |
-| NodeBuffer#concat | 1,636,523 ops/sec | ±1.88% | 73 | |
-| | | | |
-| BrowserBuffer#copy(16000) | 1,073,665 ops/sec | ±0.77% | 90 | |
-| Uint8Array#copy(16000) | 1,348,517 ops/sec | ±0.84% | 89 | ✓ |
-| NodeBuffer#copy(16000) | 1,289,533 ops/sec | ±0.82% | 93 | |
-| | | | |
-| BrowserBuffer#copy(16) | 12,782,706 ops/sec | ±0.74% | 85 | |
-| Uint8Array#copy(16) | 14,180,427 ops/sec | ±0.93% | 92 | ✓ |
-| NodeBuffer#copy(16) | 11,083,134 ops/sec | ±1.06% | 89 | |
-| | | | |
-| BrowserBuffer#new(16000) | 141,678 ops/sec | ±3.30% | 67 | |
-| Uint8Array#new(16000) | 161,491 ops/sec | ±2.96% | 60 | |
-| NodeBuffer#new(16000) | 292,699 ops/sec | ±3.20% | 55 | ✓ |
-| | | | |
-| BrowserBuffer#new(16) | 1,655,466 ops/sec | ±2.41% | 82 | |
-| Uint8Array#new(16) | 14,399,926 ops/sec | ±0.91% | 94 | ✓ |
-| NodeBuffer#new(16) | 3,894,696 ops/sec | ±0.88% | 92 | |
-| | | | |
-| BrowserBuffer#readDoubleBE | 109,582 ops/sec | ±0.75% | 93 | ✓ |
-| DataView#getFloat64 | 91,235 ops/sec | ±0.81% | 90 | |
-| NodeBuffer#readDoubleBE | 88,593 ops/sec | ±0.96% | 81 | |
-| | | | |
-| BrowserBuffer#readFloatBE | 139,854 ops/sec | ±1.03% | 85 | ✓ |
-| DataView#getFloat32 | 98,744 ops/sec | ±0.80% | 89 | |
-| NodeBuffer#readFloatBE | 92,769 ops/sec | ±0.94% | 93 | |
-| | | | |
-| BrowserBuffer#readUInt32LE | 710,861 ops/sec | ±0.82% | 92 | |
-| DataView#getUint32 | 117,893 ops/sec | ±0.84% | 91 | |
-| NodeBuffer#readUInt32LE | 851,412 ops/sec | ±0.72% | 93 | ✓ |
-| | | | |
-| BrowserBuffer#slice | 1,673,877 ops/sec | ±0.73% | 94 | |
-| Uint8Array#subarray | 6,919,243 ops/sec | ±0.67% | 90 | ✓ |
-| NodeBuffer#slice | 4,617,604 ops/sec | ±0.79% | 93 | |
-| | | | |
-| BrowserBuffer#writeFloatBE | 66,011 ops/sec | ±0.75% | 93 | |
-| DataView#setFloat32 | 127,760 ops/sec | ±0.72% | 93 | ✓ |
-| NodeBuffer#writeFloatBE | 103,352 ops/sec | ±0.83% | 93 | |
-
-### iojs 1.8.1
-
-| Method | Operations | Accuracy | Sampled | Fastest |
-|:-------|:-----------|:---------|:--------|:-------:|
-| BrowserBuffer#bracket-notation | 10,990,488 ops/sec | ±1.11% | 91 | |
-| Uint8Array#bracket-notation | 11,268,757 ops/sec | ±0.65% | 97 | |
-| NodeBuffer#bracket-notation | 11,353,260 ops/sec | ±0.83% | 94 | ✓ |
-| | | | |
-| BrowserBuffer#concat | 378,954 ops/sec | ±0.74% | 94 | |
-| Uint8Array#concat | 1,358,288 ops/sec | ±0.97% | 87 | |
-| NodeBuffer#concat | 1,934,050 ops/sec | ±1.11% | 78 | ✓ |
-| | | | |
-| BrowserBuffer#copy(16000) | 894,538 ops/sec | ±0.56% | 84 | |
-| Uint8Array#copy(16000) | 1,442,656 ops/sec | ±0.71% | 96 | |
-| NodeBuffer#copy(16000) | 1,457,898 ops/sec | ±0.53% | 92 | ✓ |
-| | | | |
-| BrowserBuffer#copy(16) | 12,870,457 ops/sec | ±0.67% | 95 | |
-| Uint8Array#copy(16) | 16,643,989 ops/sec | ±0.61% | 93 | ✓ |
-| NodeBuffer#copy(16) | 14,885,848 ops/sec | ±0.74% | 94 | |
-| | | | |
-| BrowserBuffer#new(16000) | 109,264 ops/sec | ±4.21% | 63 | |
-| Uint8Array#new(16000) | 138,916 ops/sec | ±1.87% | 61 | |
-| NodeBuffer#new(16000) | 281,449 ops/sec | ±3.58% | 51 | ✓ |
-| | | | |
-| BrowserBuffer#new(16) | 1,362,935 ops/sec | ±0.56% | 99 | |
-| Uint8Array#new(16) | 6,193,090 ops/sec | ±0.64% | 95 | ✓ |
-| NodeBuffer#new(16) | 4,745,425 ops/sec | ±1.56% | 90 | |
-| | | | |
-| BrowserBuffer#readDoubleBE | 118,127 ops/sec | ±0.59% | 93 | ✓ |
-| DataView#getFloat64 | 107,332 ops/sec | ±0.65% | 91 | |
-| NodeBuffer#readDoubleBE | 116,274 ops/sec | ±0.94% | 95 | |
-| | | | |
-| BrowserBuffer#readFloatBE | 150,326 ops/sec | ±0.58% | 95 | ✓ |
-| DataView#getFloat32 | 110,541 ops/sec | ±0.57% | 98 | |
-| NodeBuffer#readFloatBE | 121,599 ops/sec | ±0.60% | 87 | |
-| | | | |
-| BrowserBuffer#readUInt32LE | 814,147 ops/sec | ±0.62% | 93 | |
-| DataView#getUint32 | 137,592 ops/sec | ±0.64% | 90 | |
-| NodeBuffer#readUInt32LE | 931,650 ops/sec | ±0.71% | 96 | ✓ |
-| | | | |
-| BrowserBuffer#slice | 878,590 ops/sec | ±0.68% | 93 | |
-| Uint8Array#subarray | 2,843,308 ops/sec | ±1.02% | 90 | |
-| NodeBuffer#slice | 4,998,316 ops/sec | ±0.68% | 90 | ✓ |
-| | | | |
-| BrowserBuffer#writeFloatBE | 65,927 ops/sec | ±0.74% | 93 | |
-| DataView#setFloat32 | 139,823 ops/sec | ±0.97% | 89 | ✓ |
-| NodeBuffer#writeFloatBE | 135,763 ops/sec | ±0.65% | 96 | |
-| | | | |
-
-## Testing the project
-
-First, install the project:
-
- npm install
-
-Then, to run tests in Node.js, run:
-
- npm run test-node
-
-To test locally in a browser, you can run:
-
- npm run test-browser-es5-local # For ES5 browsers that don't support ES6
- npm run test-browser-es6-local # For ES6 compliant browsers
-
-This will print out a URL that you can then open in a browser to run the tests, using [airtap](https://www.npmjs.com/package/airtap).
-
-To run automated browser tests using Saucelabs, ensure that your `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY` environment variables are set, then run:
-
- npm test
-
-This is what's run in Travis, to check against various browsers. The list of browsers is kept in the `bin/airtap-es5.yml` and `bin/airtap-es6.yml` files.
-
-## JavaScript Standard Style
-
-This module uses [JavaScript Standard Style](https://github.com/feross/standard).
-
-[](https://github.com/feross/standard)
-
-To test that the code conforms to the style, `npm install` and run:
-
- ./node_modules/.bin/standard
-
-## credit
-
-This was originally forked from [buffer-browserify](https://github.com/toots/buffer-browserify).
-
-## Security Policies and Procedures
-
-The `buffer` team and community take all security bugs in `buffer` seriously. Please see our [security policies and procedures](https://github.com/feross/security) document to learn how to report issues.
-
-## license
-
-MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org), and other contributors. Originally forked from an MIT-licensed module by Romain Beauxis.
diff --git a/node_modules/buffer/index.d.ts b/node_modules/buffer/index.d.ts
deleted file mode 100644
index 5d1a804..0000000
--- a/node_modules/buffer/index.d.ts
+++ /dev/null
@@ -1,186 +0,0 @@
-export class Buffer extends Uint8Array {
- length: number
- write(string: string, offset?: number, length?: number, encoding?: string): number;
- toString(encoding?: string, start?: number, end?: number): string;
- toJSON(): { type: 'Buffer', data: any[] };
- equals(otherBuffer: Buffer): boolean;
- compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
- copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
- slice(start?: number, end?: number): Buffer;
- writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
- writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
- writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
- writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
- readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
- readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
- readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
- readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
- readUInt8(offset: number, noAssert?: boolean): number;
- readUInt16LE(offset: number, noAssert?: boolean): number;
- readUInt16BE(offset: number, noAssert?: boolean): number;
- readUInt32LE(offset: number, noAssert?: boolean): number;
- readUInt32BE(offset: number, noAssert?: boolean): number;
- readInt8(offset: number, noAssert?: boolean): number;
- readInt16LE(offset: number, noAssert?: boolean): number;
- readInt16BE(offset: number, noAssert?: boolean): number;
- readInt32LE(offset: number, noAssert?: boolean): number;
- readInt32BE(offset: number, noAssert?: boolean): number;
- readFloatLE(offset: number, noAssert?: boolean): number;
- readFloatBE(offset: number, noAssert?: boolean): number;
- readDoubleLE(offset: number, noAssert?: boolean): number;
- readDoubleBE(offset: number, noAssert?: boolean): number;
- reverse(): this;
- swap16(): Buffer;
- swap32(): Buffer;
- swap64(): Buffer;
- writeUInt8(value: number, offset: number, noAssert?: boolean): number;
- writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;
- writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;
- writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;
- writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;
- writeInt8(value: number, offset: number, noAssert?: boolean): number;
- writeInt16LE(value: number, offset: number, noAssert?: boolean): number;
- writeInt16BE(value: number, offset: number, noAssert?: boolean): number;
- writeInt32LE(value: number, offset: number, noAssert?: boolean): number;
- writeInt32BE(value: number, offset: number, noAssert?: boolean): number;
- writeFloatLE(value: number, offset: number, noAssert?: boolean): number;
- writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
- writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
- writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
- fill(value: any, offset?: number, end?: number): this;
- indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
- lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
- includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean;
-
- /**
- * Allocates a new buffer containing the given {str}.
- *
- * @param str String to store in buffer.
- * @param encoding encoding to use, optional. Default is 'utf8'
- */
- constructor (str: string, encoding?: string);
- /**
- * Allocates a new buffer of {size} octets.
- *
- * @param size count of octets to allocate.
- */
- constructor (size: number);
- /**
- * Allocates a new buffer containing the given {array} of octets.
- *
- * @param array The octets to store.
- */
- constructor (array: Uint8Array);
- /**
- * Produces a Buffer backed by the same allocated memory as
- * the given {ArrayBuffer}.
- *
- *
- * @param arrayBuffer The ArrayBuffer with which to share memory.
- */
- constructor (arrayBuffer: ArrayBuffer);
- /**
- * Allocates a new buffer containing the given {array} of octets.
- *
- * @param array The octets to store.
- */
- constructor (array: any[]);
- /**
- * Copies the passed {buffer} data onto a new {Buffer} instance.
- *
- * @param buffer The buffer to copy.
- */
- constructor (buffer: Buffer);
- prototype: Buffer;
- /**
- * Allocates a new Buffer using an {array} of octets.
- *
- * @param array
- */
- static from(array: any[]): Buffer;
- /**
- * When passed a reference to the .buffer property of a TypedArray instance,
- * the newly created Buffer will share the same allocated memory as the TypedArray.
- * The optional {byteOffset} and {length} arguments specify a memory range
- * within the {arrayBuffer} that will be shared by the Buffer.
- *
- * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()
- * @param byteOffset
- * @param length
- */
- static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
- /**
- * Copies the passed {buffer} data onto a new Buffer instance.
- *
- * @param buffer
- */
- static from(buffer: Buffer | Uint8Array): Buffer;
- /**
- * Creates a new Buffer containing the given JavaScript string {str}.
- * If provided, the {encoding} parameter identifies the character encoding.
- * If not provided, {encoding} defaults to 'utf8'.
- *
- * @param str
- */
- static from(str: string, encoding?: string): Buffer;
- /**
- * Returns true if {obj} is a Buffer
- *
- * @param obj object to test.
- */
- static isBuffer(obj: any): obj is Buffer;
- /**
- * Returns true if {encoding} is a valid encoding argument.
- * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
- *
- * @param encoding string to test.
- */
- static isEncoding(encoding: string): boolean;
- /**
- * Gives the actual byte length of a string. encoding defaults to 'utf8'.
- * This is not the same as String.prototype.length since that returns the number of characters in a string.
- *
- * @param string string to test.
- * @param encoding encoding used to evaluate (defaults to 'utf8')
- */
- static byteLength(string: string, encoding?: string): number;
- /**
- * Returns a buffer which is the result of concatenating all the buffers in the list together.
- *
- * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
- * If the list has exactly one item, then the first item of the list is returned.
- * If the list has more than one item, then a new Buffer is created.
- *
- * @param list An array of Buffer objects to concatenate
- * @param totalLength Total length of the buffers when concatenated.
- * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
- */
- static concat(list: Buffer[], totalLength?: number): Buffer;
- /**
- * The same as buf1.compare(buf2).
- */
- static compare(buf1: Buffer, buf2: Buffer): number;
- /**
- * Allocates a new buffer of {size} octets.
- *
- * @param size count of octets to allocate.
- * @param fill if specified, buffer will be initialized by calling buf.fill(fill).
- * If parameter is omitted, buffer will be filled with zeros.
- * @param encoding encoding used for call to buf.fill while initializing
- */
- static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer;
- /**
- * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
- * of the newly created Buffer are unknown and may contain sensitive data.
- *
- * @param size count of octets to allocate
- */
- static allocUnsafe(size: number): Buffer;
- /**
- * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
- * of the newly created Buffer are unknown and may contain sensitive data.
- *
- * @param size count of octets to allocate
- */
- static allocUnsafeSlow(size: number): Buffer;
-}
diff --git a/node_modules/buffer/index.js b/node_modules/buffer/index.js
deleted file mode 100644
index 609cf31..0000000
--- a/node_modules/buffer/index.js
+++ /dev/null
@@ -1,1817 +0,0 @@
-/*!
- * The buffer module from node.js, for the browser.
- *
- * @author Feross Aboukhadijeh
- * @license MIT
- */
-/* eslint-disable no-proto */
-
-'use strict'
-
-var base64 = require('base64-js')
-var ieee754 = require('ieee754')
-var customInspectSymbol =
- (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation
- ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
- : null
-
-exports.Buffer = Buffer
-exports.SlowBuffer = SlowBuffer
-exports.INSPECT_MAX_BYTES = 50
-
-var K_MAX_LENGTH = 0x7fffffff
-exports.kMaxLength = K_MAX_LENGTH
-
-/**
- * If `Buffer.TYPED_ARRAY_SUPPORT`:
- * === true Use Uint8Array implementation (fastest)
- * === false Print warning and recommend using `buffer` v4.x which has an Object
- * implementation (most compatible, even IE6)
- *
- * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
- * Opera 11.6+, iOS 4.2+.
- *
- * We report that the browser does not support typed arrays if the are not subclassable
- * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
- * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
- * for __proto__ and has a buggy typed array implementation.
- */
-Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
-
-if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
- typeof console.error === 'function') {
- console.error(
- 'This browser lacks typed array (Uint8Array) support which is required by ' +
- '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
- )
-}
-
-function typedArraySupport () {
- // Can typed array instances can be augmented?
- try {
- var arr = new Uint8Array(1)
- var proto = { foo: function () { return 42 } }
- Object.setPrototypeOf(proto, Uint8Array.prototype)
- Object.setPrototypeOf(arr, proto)
- return arr.foo() === 42
- } catch (e) {
- return false
- }
-}
-
-Object.defineProperty(Buffer.prototype, 'parent', {
- enumerable: true,
- get: function () {
- if (!Buffer.isBuffer(this)) return undefined
- return this.buffer
- }
-})
-
-Object.defineProperty(Buffer.prototype, 'offset', {
- enumerable: true,
- get: function () {
- if (!Buffer.isBuffer(this)) return undefined
- return this.byteOffset
- }
-})
-
-function createBuffer (length) {
- if (length > K_MAX_LENGTH) {
- throw new RangeError('The value "' + length + '" is invalid for option "size"')
- }
- // Return an augmented `Uint8Array` instance
- var buf = new Uint8Array(length)
- Object.setPrototypeOf(buf, Buffer.prototype)
- return buf
-}
-
-/**
- * The Buffer constructor returns instances of `Uint8Array` that have their
- * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
- * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
- * and the `Uint8Array` methods. Square bracket notation works as expected -- it
- * returns a single octet.
- *
- * The `Uint8Array` prototype remains unmodified.
- */
-
-function Buffer (arg, encodingOrOffset, length) {
- // Common case.
- if (typeof arg === 'number') {
- if (typeof encodingOrOffset === 'string') {
- throw new TypeError(
- 'The "string" argument must be of type string. Received type number'
- )
- }
- return allocUnsafe(arg)
- }
- return from(arg, encodingOrOffset, length)
-}
-
-Buffer.poolSize = 8192 // not used by this implementation
-
-function from (value, encodingOrOffset, length) {
- if (typeof value === 'string') {
- return fromString(value, encodingOrOffset)
- }
-
- if (ArrayBuffer.isView(value)) {
- return fromArrayView(value)
- }
-
- if (value == null) {
- throw new TypeError(
- 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
- 'or Array-like Object. Received type ' + (typeof value)
- )
- }
-
- if (isInstance(value, ArrayBuffer) ||
- (value && isInstance(value.buffer, ArrayBuffer))) {
- return fromArrayBuffer(value, encodingOrOffset, length)
- }
-
- if (typeof SharedArrayBuffer !== 'undefined' &&
- (isInstance(value, SharedArrayBuffer) ||
- (value && isInstance(value.buffer, SharedArrayBuffer)))) {
- return fromArrayBuffer(value, encodingOrOffset, length)
- }
-
- if (typeof value === 'number') {
- throw new TypeError(
- 'The "value" argument must not be of type number. Received type number'
- )
- }
-
- var valueOf = value.valueOf && value.valueOf()
- if (valueOf != null && valueOf !== value) {
- return Buffer.from(valueOf, encodingOrOffset, length)
- }
-
- var b = fromObject(value)
- if (b) return b
-
- if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&
- typeof value[Symbol.toPrimitive] === 'function') {
- return Buffer.from(
- value[Symbol.toPrimitive]('string'), encodingOrOffset, length
- )
- }
-
- throw new TypeError(
- 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
- 'or Array-like Object. Received type ' + (typeof value)
- )
-}
-
-/**
- * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
- * if value is a number.
- * Buffer.from(str[, encoding])
- * Buffer.from(array)
- * Buffer.from(buffer)
- * Buffer.from(arrayBuffer[, byteOffset[, length]])
- **/
-Buffer.from = function (value, encodingOrOffset, length) {
- return from(value, encodingOrOffset, length)
-}
-
-// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
-// https://github.com/feross/buffer/pull/148
-Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)
-Object.setPrototypeOf(Buffer, Uint8Array)
-
-function assertSize (size) {
- if (typeof size !== 'number') {
- throw new TypeError('"size" argument must be of type number')
- } else if (size < 0) {
- throw new RangeError('The value "' + size + '" is invalid for option "size"')
- }
-}
-
-function alloc (size, fill, encoding) {
- assertSize(size)
- if (size <= 0) {
- return createBuffer(size)
- }
- if (fill !== undefined) {
- // Only pay attention to encoding if it's a string. This
- // prevents accidentally sending in a number that would
- // be interpreted as a start offset.
- return typeof encoding === 'string'
- ? createBuffer(size).fill(fill, encoding)
- : createBuffer(size).fill(fill)
- }
- return createBuffer(size)
-}
-
-/**
- * Creates a new filled Buffer instance.
- * alloc(size[, fill[, encoding]])
- **/
-Buffer.alloc = function (size, fill, encoding) {
- return alloc(size, fill, encoding)
-}
-
-function allocUnsafe (size) {
- assertSize(size)
- return createBuffer(size < 0 ? 0 : checked(size) | 0)
-}
-
-/**
- * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
- * */
-Buffer.allocUnsafe = function (size) {
- return allocUnsafe(size)
-}
-/**
- * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
- */
-Buffer.allocUnsafeSlow = function (size) {
- return allocUnsafe(size)
-}
-
-function fromString (string, encoding) {
- if (typeof encoding !== 'string' || encoding === '') {
- encoding = 'utf8'
- }
-
- if (!Buffer.isEncoding(encoding)) {
- throw new TypeError('Unknown encoding: ' + encoding)
- }
-
- var length = byteLength(string, encoding) | 0
- var buf = createBuffer(length)
-
- var actual = buf.write(string, encoding)
-
- if (actual !== length) {
- // Writing a hex string, for example, that contains invalid characters will
- // cause everything after the first invalid character to be ignored. (e.g.
- // 'abxxcd' will be treated as 'ab')
- buf = buf.slice(0, actual)
- }
-
- return buf
-}
-
-function fromArrayLike (array) {
- var length = array.length < 0 ? 0 : checked(array.length) | 0
- var buf = createBuffer(length)
- for (var i = 0; i < length; i += 1) {
- buf[i] = array[i] & 255
- }
- return buf
-}
-
-function fromArrayView (arrayView) {
- if (isInstance(arrayView, Uint8Array)) {
- var copy = new Uint8Array(arrayView)
- return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)
- }
- return fromArrayLike(arrayView)
-}
-
-function fromArrayBuffer (array, byteOffset, length) {
- if (byteOffset < 0 || array.byteLength < byteOffset) {
- throw new RangeError('"offset" is outside of buffer bounds')
- }
-
- if (array.byteLength < byteOffset + (length || 0)) {
- throw new RangeError('"length" is outside of buffer bounds')
- }
-
- var buf
- if (byteOffset === undefined && length === undefined) {
- buf = new Uint8Array(array)
- } else if (length === undefined) {
- buf = new Uint8Array(array, byteOffset)
- } else {
- buf = new Uint8Array(array, byteOffset, length)
- }
-
- // Return an augmented `Uint8Array` instance
- Object.setPrototypeOf(buf, Buffer.prototype)
-
- return buf
-}
-
-function fromObject (obj) {
- if (Buffer.isBuffer(obj)) {
- var len = checked(obj.length) | 0
- var buf = createBuffer(len)
-
- if (buf.length === 0) {
- return buf
- }
-
- obj.copy(buf, 0, 0, len)
- return buf
- }
-
- if (obj.length !== undefined) {
- if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
- return createBuffer(0)
- }
- return fromArrayLike(obj)
- }
-
- if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
- return fromArrayLike(obj.data)
- }
-}
-
-function checked (length) {
- // Note: cannot use `length < K_MAX_LENGTH` here because that fails when
- // length is NaN (which is otherwise coerced to zero.)
- if (length >= K_MAX_LENGTH) {
- throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
- 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
- }
- return length | 0
-}
-
-function SlowBuffer (length) {
- if (+length != length) { // eslint-disable-line eqeqeq
- length = 0
- }
- return Buffer.alloc(+length)
-}
-
-Buffer.isBuffer = function isBuffer (b) {
- return b != null && b._isBuffer === true &&
- b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false
-}
-
-Buffer.compare = function compare (a, b) {
- if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)
- if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)
- if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
- throw new TypeError(
- 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
- )
- }
-
- if (a === b) return 0
-
- var x = a.length
- var y = b.length
-
- for (var i = 0, len = Math.min(x, y); i < len; ++i) {
- if (a[i] !== b[i]) {
- x = a[i]
- y = b[i]
- break
- }
- }
-
- if (x < y) return -1
- if (y < x) return 1
- return 0
-}
-
-Buffer.isEncoding = function isEncoding (encoding) {
- switch (String(encoding).toLowerCase()) {
- case 'hex':
- case 'utf8':
- case 'utf-8':
- case 'ascii':
- case 'latin1':
- case 'binary':
- case 'base64':
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return true
- default:
- return false
- }
-}
-
-Buffer.concat = function concat (list, length) {
- if (!Array.isArray(list)) {
- throw new TypeError('"list" argument must be an Array of Buffers')
- }
-
- if (list.length === 0) {
- return Buffer.alloc(0)
- }
-
- var i
- if (length === undefined) {
- length = 0
- for (i = 0; i < list.length; ++i) {
- length += list[i].length
- }
- }
-
- var buffer = Buffer.allocUnsafe(length)
- var pos = 0
- for (i = 0; i < list.length; ++i) {
- var buf = list[i]
- if (isInstance(buf, Uint8Array)) {
- if (pos + buf.length > buffer.length) {
- Buffer.from(buf).copy(buffer, pos)
- } else {
- Uint8Array.prototype.set.call(
- buffer,
- buf,
- pos
- )
- }
- } else if (!Buffer.isBuffer(buf)) {
- throw new TypeError('"list" argument must be an Array of Buffers')
- } else {
- buf.copy(buffer, pos)
- }
- pos += buf.length
- }
- return buffer
-}
-
-function byteLength (string, encoding) {
- if (Buffer.isBuffer(string)) {
- return string.length
- }
- if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {
- return string.byteLength
- }
- if (typeof string !== 'string') {
- throw new TypeError(
- 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' +
- 'Received type ' + typeof string
- )
- }
-
- var len = string.length
- var mustMatch = (arguments.length > 2 && arguments[2] === true)
- if (!mustMatch && len === 0) return 0
-
- // Use a for loop to avoid recursion
- var loweredCase = false
- for (;;) {
- switch (encoding) {
- case 'ascii':
- case 'latin1':
- case 'binary':
- return len
- case 'utf8':
- case 'utf-8':
- return utf8ToBytes(string).length
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return len * 2
- case 'hex':
- return len >>> 1
- case 'base64':
- return base64ToBytes(string).length
- default:
- if (loweredCase) {
- return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8
- }
- encoding = ('' + encoding).toLowerCase()
- loweredCase = true
- }
- }
-}
-Buffer.byteLength = byteLength
-
-function slowToString (encoding, start, end) {
- var loweredCase = false
-
- // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
- // property of a typed array.
-
- // This behaves neither like String nor Uint8Array in that we set start/end
- // to their upper/lower bounds if the value passed is out of range.
- // undefined is handled specially as per ECMA-262 6th Edition,
- // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
- if (start === undefined || start < 0) {
- start = 0
- }
- // Return early if start > this.length. Done here to prevent potential uint32
- // coercion fail below.
- if (start > this.length) {
- return ''
- }
-
- if (end === undefined || end > this.length) {
- end = this.length
- }
-
- if (end <= 0) {
- return ''
- }
-
- // Force coercion to uint32. This will also coerce falsey/NaN values to 0.
- end >>>= 0
- start >>>= 0
-
- if (end <= start) {
- return ''
- }
-
- if (!encoding) encoding = 'utf8'
-
- while (true) {
- switch (encoding) {
- case 'hex':
- return hexSlice(this, start, end)
-
- case 'utf8':
- case 'utf-8':
- return utf8Slice(this, start, end)
-
- case 'ascii':
- return asciiSlice(this, start, end)
-
- case 'latin1':
- case 'binary':
- return latin1Slice(this, start, end)
-
- case 'base64':
- return base64Slice(this, start, end)
-
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return utf16leSlice(this, start, end)
-
- default:
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
- encoding = (encoding + '').toLowerCase()
- loweredCase = true
- }
- }
-}
-
-// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
-// to detect a Buffer instance. It's not possible to use `instanceof Buffer`
-// reliably in a browserify context because there could be multiple different
-// copies of the 'buffer' package in use. This method works even for Buffer
-// instances that were created from another copy of the `buffer` package.
-// See: https://github.com/feross/buffer/issues/154
-Buffer.prototype._isBuffer = true
-
-function swap (b, n, m) {
- var i = b[n]
- b[n] = b[m]
- b[m] = i
-}
-
-Buffer.prototype.swap16 = function swap16 () {
- var len = this.length
- if (len % 2 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 16-bits')
- }
- for (var i = 0; i < len; i += 2) {
- swap(this, i, i + 1)
- }
- return this
-}
-
-Buffer.prototype.swap32 = function swap32 () {
- var len = this.length
- if (len % 4 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 32-bits')
- }
- for (var i = 0; i < len; i += 4) {
- swap(this, i, i + 3)
- swap(this, i + 1, i + 2)
- }
- return this
-}
-
-Buffer.prototype.swap64 = function swap64 () {
- var len = this.length
- if (len % 8 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 64-bits')
- }
- for (var i = 0; i < len; i += 8) {
- swap(this, i, i + 7)
- swap(this, i + 1, i + 6)
- swap(this, i + 2, i + 5)
- swap(this, i + 3, i + 4)
- }
- return this
-}
-
-Buffer.prototype.toString = function toString () {
- var length = this.length
- if (length === 0) return ''
- if (arguments.length === 0) return utf8Slice(this, 0, length)
- return slowToString.apply(this, arguments)
-}
-
-Buffer.prototype.toLocaleString = Buffer.prototype.toString
-
-Buffer.prototype.equals = function equals (b) {
- if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
- if (this === b) return true
- return Buffer.compare(this, b) === 0
-}
-
-Buffer.prototype.inspect = function inspect () {
- var str = ''
- var max = exports.INSPECT_MAX_BYTES
- str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()
- if (this.length > max) str += ' ... '
- return ''
-}
-if (customInspectSymbol) {
- Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect
-}
-
-Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
- if (isInstance(target, Uint8Array)) {
- target = Buffer.from(target, target.offset, target.byteLength)
- }
- if (!Buffer.isBuffer(target)) {
- throw new TypeError(
- 'The "target" argument must be one of type Buffer or Uint8Array. ' +
- 'Received type ' + (typeof target)
- )
- }
-
- if (start === undefined) {
- start = 0
- }
- if (end === undefined) {
- end = target ? target.length : 0
- }
- if (thisStart === undefined) {
- thisStart = 0
- }
- if (thisEnd === undefined) {
- thisEnd = this.length
- }
-
- if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
- throw new RangeError('out of range index')
- }
-
- if (thisStart >= thisEnd && start >= end) {
- return 0
- }
- if (thisStart >= thisEnd) {
- return -1
- }
- if (start >= end) {
- return 1
- }
-
- start >>>= 0
- end >>>= 0
- thisStart >>>= 0
- thisEnd >>>= 0
-
- if (this === target) return 0
-
- var x = thisEnd - thisStart
- var y = end - start
- var len = Math.min(x, y)
-
- var thisCopy = this.slice(thisStart, thisEnd)
- var targetCopy = target.slice(start, end)
-
- for (var i = 0; i < len; ++i) {
- if (thisCopy[i] !== targetCopy[i]) {
- x = thisCopy[i]
- y = targetCopy[i]
- break
- }
- }
-
- if (x < y) return -1
- if (y < x) return 1
- return 0
-}
-
-// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
-// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
-//
-// Arguments:
-// - buffer - a Buffer to search
-// - val - a string, Buffer, or number
-// - byteOffset - an index into `buffer`; will be clamped to an int32
-// - encoding - an optional encoding, relevant is val is a string
-// - dir - true for indexOf, false for lastIndexOf
-function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
- // Empty buffer means no match
- if (buffer.length === 0) return -1
-
- // Normalize byteOffset
- if (typeof byteOffset === 'string') {
- encoding = byteOffset
- byteOffset = 0
- } else if (byteOffset > 0x7fffffff) {
- byteOffset = 0x7fffffff
- } else if (byteOffset < -0x80000000) {
- byteOffset = -0x80000000
- }
- byteOffset = +byteOffset // Coerce to Number.
- if (numberIsNaN(byteOffset)) {
- // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
- byteOffset = dir ? 0 : (buffer.length - 1)
- }
-
- // Normalize byteOffset: negative offsets start from the end of the buffer
- if (byteOffset < 0) byteOffset = buffer.length + byteOffset
- if (byteOffset >= buffer.length) {
- if (dir) return -1
- else byteOffset = buffer.length - 1
- } else if (byteOffset < 0) {
- if (dir) byteOffset = 0
- else return -1
- }
-
- // Normalize val
- if (typeof val === 'string') {
- val = Buffer.from(val, encoding)
- }
-
- // Finally, search either indexOf (if dir is true) or lastIndexOf
- if (Buffer.isBuffer(val)) {
- // Special case: looking for empty string/buffer always fails
- if (val.length === 0) {
- return -1
- }
- return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
- } else if (typeof val === 'number') {
- val = val & 0xFF // Search for a byte value [0-255]
- if (typeof Uint8Array.prototype.indexOf === 'function') {
- if (dir) {
- return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
- } else {
- return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
- }
- }
- return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)
- }
-
- throw new TypeError('val must be string, number or Buffer')
-}
-
-function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
- var indexSize = 1
- var arrLength = arr.length
- var valLength = val.length
-
- if (encoding !== undefined) {
- encoding = String(encoding).toLowerCase()
- if (encoding === 'ucs2' || encoding === 'ucs-2' ||
- encoding === 'utf16le' || encoding === 'utf-16le') {
- if (arr.length < 2 || val.length < 2) {
- return -1
- }
- indexSize = 2
- arrLength /= 2
- valLength /= 2
- byteOffset /= 2
- }
- }
-
- function read (buf, i) {
- if (indexSize === 1) {
- return buf[i]
- } else {
- return buf.readUInt16BE(i * indexSize)
- }
- }
-
- var i
- if (dir) {
- var foundIndex = -1
- for (i = byteOffset; i < arrLength; i++) {
- if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
- if (foundIndex === -1) foundIndex = i
- if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
- } else {
- if (foundIndex !== -1) i -= i - foundIndex
- foundIndex = -1
- }
- }
- } else {
- if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
- for (i = byteOffset; i >= 0; i--) {
- var found = true
- for (var j = 0; j < valLength; j++) {
- if (read(arr, i + j) !== read(val, j)) {
- found = false
- break
- }
- }
- if (found) return i
- }
- }
-
- return -1
-}
-
-Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
- return this.indexOf(val, byteOffset, encoding) !== -1
-}
-
-Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
- return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
-}
-
-Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
- return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
-}
-
-function hexWrite (buf, string, offset, length) {
- offset = Number(offset) || 0
- var remaining = buf.length - offset
- if (!length) {
- length = remaining
- } else {
- length = Number(length)
- if (length > remaining) {
- length = remaining
- }
- }
-
- var strLen = string.length
-
- if (length > strLen / 2) {
- length = strLen / 2
- }
- for (var i = 0; i < length; ++i) {
- var parsed = parseInt(string.substr(i * 2, 2), 16)
- if (numberIsNaN(parsed)) return i
- buf[offset + i] = parsed
- }
- return i
-}
-
-function utf8Write (buf, string, offset, length) {
- return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
-}
-
-function asciiWrite (buf, string, offset, length) {
- return blitBuffer(asciiToBytes(string), buf, offset, length)
-}
-
-function base64Write (buf, string, offset, length) {
- return blitBuffer(base64ToBytes(string), buf, offset, length)
-}
-
-function ucs2Write (buf, string, offset, length) {
- return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
-}
-
-Buffer.prototype.write = function write (string, offset, length, encoding) {
- // Buffer#write(string)
- if (offset === undefined) {
- encoding = 'utf8'
- length = this.length
- offset = 0
- // Buffer#write(string, encoding)
- } else if (length === undefined && typeof offset === 'string') {
- encoding = offset
- length = this.length
- offset = 0
- // Buffer#write(string, offset[, length][, encoding])
- } else if (isFinite(offset)) {
- offset = offset >>> 0
- if (isFinite(length)) {
- length = length >>> 0
- if (encoding === undefined) encoding = 'utf8'
- } else {
- encoding = length
- length = undefined
- }
- } else {
- throw new Error(
- 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
- )
- }
-
- var remaining = this.length - offset
- if (length === undefined || length > remaining) length = remaining
-
- if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
- throw new RangeError('Attempt to write outside buffer bounds')
- }
-
- if (!encoding) encoding = 'utf8'
-
- var loweredCase = false
- for (;;) {
- switch (encoding) {
- case 'hex':
- return hexWrite(this, string, offset, length)
-
- case 'utf8':
- case 'utf-8':
- return utf8Write(this, string, offset, length)
-
- case 'ascii':
- case 'latin1':
- case 'binary':
- return asciiWrite(this, string, offset, length)
-
- case 'base64':
- // Warning: maxLength not taken into account in base64Write
- return base64Write(this, string, offset, length)
-
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return ucs2Write(this, string, offset, length)
-
- default:
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
- encoding = ('' + encoding).toLowerCase()
- loweredCase = true
- }
- }
-}
-
-Buffer.prototype.toJSON = function toJSON () {
- return {
- type: 'Buffer',
- data: Array.prototype.slice.call(this._arr || this, 0)
- }
-}
-
-function base64Slice (buf, start, end) {
- if (start === 0 && end === buf.length) {
- return base64.fromByteArray(buf)
- } else {
- return base64.fromByteArray(buf.slice(start, end))
- }
-}
-
-function utf8Slice (buf, start, end) {
- end = Math.min(buf.length, end)
- var res = []
-
- var i = start
- while (i < end) {
- var firstByte = buf[i]
- var codePoint = null
- var bytesPerSequence = (firstByte > 0xEF)
- ? 4
- : (firstByte > 0xDF)
- ? 3
- : (firstByte > 0xBF)
- ? 2
- : 1
-
- if (i + bytesPerSequence <= end) {
- var secondByte, thirdByte, fourthByte, tempCodePoint
-
- switch (bytesPerSequence) {
- case 1:
- if (firstByte < 0x80) {
- codePoint = firstByte
- }
- break
- case 2:
- secondByte = buf[i + 1]
- if ((secondByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
- if (tempCodePoint > 0x7F) {
- codePoint = tempCodePoint
- }
- }
- break
- case 3:
- secondByte = buf[i + 1]
- thirdByte = buf[i + 2]
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
- if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
- codePoint = tempCodePoint
- }
- }
- break
- case 4:
- secondByte = buf[i + 1]
- thirdByte = buf[i + 2]
- fourthByte = buf[i + 3]
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
- if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
- codePoint = tempCodePoint
- }
- }
- }
- }
-
- if (codePoint === null) {
- // we did not generate a valid codePoint so insert a
- // replacement char (U+FFFD) and advance only 1 byte
- codePoint = 0xFFFD
- bytesPerSequence = 1
- } else if (codePoint > 0xFFFF) {
- // encode to utf16 (surrogate pair dance)
- codePoint -= 0x10000
- res.push(codePoint >>> 10 & 0x3FF | 0xD800)
- codePoint = 0xDC00 | codePoint & 0x3FF
- }
-
- res.push(codePoint)
- i += bytesPerSequence
- }
-
- return decodeCodePointsArray(res)
-}
-
-// Based on http://stackoverflow.com/a/22747272/680742, the browser with
-// the lowest limit is Chrome, with 0x10000 args.
-// We go 1 magnitude less, for safety
-var MAX_ARGUMENTS_LENGTH = 0x1000
-
-function decodeCodePointsArray (codePoints) {
- var len = codePoints.length
- if (len <= MAX_ARGUMENTS_LENGTH) {
- return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
- }
-
- // Decode in chunks to avoid "call stack size exceeded".
- var res = ''
- var i = 0
- while (i < len) {
- res += String.fromCharCode.apply(
- String,
- codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
- )
- }
- return res
-}
-
-function asciiSlice (buf, start, end) {
- var ret = ''
- end = Math.min(buf.length, end)
-
- for (var i = start; i < end; ++i) {
- ret += String.fromCharCode(buf[i] & 0x7F)
- }
- return ret
-}
-
-function latin1Slice (buf, start, end) {
- var ret = ''
- end = Math.min(buf.length, end)
-
- for (var i = start; i < end; ++i) {
- ret += String.fromCharCode(buf[i])
- }
- return ret
-}
-
-function hexSlice (buf, start, end) {
- var len = buf.length
-
- if (!start || start < 0) start = 0
- if (!end || end < 0 || end > len) end = len
-
- var out = ''
- for (var i = start; i < end; ++i) {
- out += hexSliceLookupTable[buf[i]]
- }
- return out
-}
-
-function utf16leSlice (buf, start, end) {
- var bytes = buf.slice(start, end)
- var res = ''
- // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)
- for (var i = 0; i < bytes.length - 1; i += 2) {
- res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
- }
- return res
-}
-
-Buffer.prototype.slice = function slice (start, end) {
- var len = this.length
- start = ~~start
- end = end === undefined ? len : ~~end
-
- if (start < 0) {
- start += len
- if (start < 0) start = 0
- } else if (start > len) {
- start = len
- }
-
- if (end < 0) {
- end += len
- if (end < 0) end = 0
- } else if (end > len) {
- end = len
- }
-
- if (end < start) end = start
-
- var newBuf = this.subarray(start, end)
- // Return an augmented `Uint8Array` instance
- Object.setPrototypeOf(newBuf, Buffer.prototype)
-
- return newBuf
-}
-
-/*
- * Need to make sure that buffer isn't trying to write out of bounds.
- */
-function checkOffset (offset, ext, length) {
- if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
- if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
-}
-
-Buffer.prototype.readUintLE =
-Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var val = this[offset]
- var mul = 1
- var i = 0
- while (++i < byteLength && (mul *= 0x100)) {
- val += this[offset + i] * mul
- }
-
- return val
-}
-
-Buffer.prototype.readUintBE =
-Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) {
- checkOffset(offset, byteLength, this.length)
- }
-
- var val = this[offset + --byteLength]
- var mul = 1
- while (byteLength > 0 && (mul *= 0x100)) {
- val += this[offset + --byteLength] * mul
- }
-
- return val
-}
-
-Buffer.prototype.readUint8 =
-Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 1, this.length)
- return this[offset]
-}
-
-Buffer.prototype.readUint16LE =
-Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 2, this.length)
- return this[offset] | (this[offset + 1] << 8)
-}
-
-Buffer.prototype.readUint16BE =
-Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 2, this.length)
- return (this[offset] << 8) | this[offset + 1]
-}
-
-Buffer.prototype.readUint32LE =
-Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return ((this[offset]) |
- (this[offset + 1] << 8) |
- (this[offset + 2] << 16)) +
- (this[offset + 3] * 0x1000000)
-}
-
-Buffer.prototype.readUint32BE =
-Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset] * 0x1000000) +
- ((this[offset + 1] << 16) |
- (this[offset + 2] << 8) |
- this[offset + 3])
-}
-
-Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var val = this[offset]
- var mul = 1
- var i = 0
- while (++i < byteLength && (mul *= 0x100)) {
- val += this[offset + i] * mul
- }
- mul *= 0x80
-
- if (val >= mul) val -= Math.pow(2, 8 * byteLength)
-
- return val
-}
-
-Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var i = byteLength
- var mul = 1
- var val = this[offset + --i]
- while (i > 0 && (mul *= 0x100)) {
- val += this[offset + --i] * mul
- }
- mul *= 0x80
-
- if (val >= mul) val -= Math.pow(2, 8 * byteLength)
-
- return val
-}
-
-Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 1, this.length)
- if (!(this[offset] & 0x80)) return (this[offset])
- return ((0xff - this[offset] + 1) * -1)
-}
-
-Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 2, this.length)
- var val = this[offset] | (this[offset + 1] << 8)
- return (val & 0x8000) ? val | 0xFFFF0000 : val
-}
-
-Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 2, this.length)
- var val = this[offset + 1] | (this[offset] << 8)
- return (val & 0x8000) ? val | 0xFFFF0000 : val
-}
-
-Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset]) |
- (this[offset + 1] << 8) |
- (this[offset + 2] << 16) |
- (this[offset + 3] << 24)
-}
-
-Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset] << 24) |
- (this[offset + 1] << 16) |
- (this[offset + 2] << 8) |
- (this[offset + 3])
-}
-
-Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
- return ieee754.read(this, offset, true, 23, 4)
-}
-
-Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 4, this.length)
- return ieee754.read(this, offset, false, 23, 4)
-}
-
-Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 8, this.length)
- return ieee754.read(this, offset, true, 52, 8)
-}
-
-Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
- offset = offset >>> 0
- if (!noAssert) checkOffset(offset, 8, this.length)
- return ieee754.read(this, offset, false, 52, 8)
-}
-
-function checkInt (buf, value, offset, ext, max, min) {
- if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
- if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
- if (offset + ext > buf.length) throw new RangeError('Index out of range')
-}
-
-Buffer.prototype.writeUintLE =
-Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) {
- var maxBytes = Math.pow(2, 8 * byteLength) - 1
- checkInt(this, value, offset, byteLength, maxBytes, 0)
- }
-
- var mul = 1
- var i = 0
- this[offset] = value & 0xFF
- while (++i < byteLength && (mul *= 0x100)) {
- this[offset + i] = (value / mul) & 0xFF
- }
-
- return offset + byteLength
-}
-
-Buffer.prototype.writeUintBE =
-Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset >>> 0
- byteLength = byteLength >>> 0
- if (!noAssert) {
- var maxBytes = Math.pow(2, 8 * byteLength) - 1
- checkInt(this, value, offset, byteLength, maxBytes, 0)
- }
-
- var i = byteLength - 1
- var mul = 1
- this[offset + i] = value & 0xFF
- while (--i >= 0 && (mul *= 0x100)) {
- this[offset + i] = (value / mul) & 0xFF
- }
-
- return offset + byteLength
-}
-
-Buffer.prototype.writeUint8 =
-Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
- this[offset] = (value & 0xff)
- return offset + 1
-}
-
-Buffer.prototype.writeUint16LE =
-Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- return offset + 2
-}
-
-Buffer.prototype.writeUint16BE =
-Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
- this[offset] = (value >>> 8)
- this[offset + 1] = (value & 0xff)
- return offset + 2
-}
-
-Buffer.prototype.writeUint32LE =
-Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
- this[offset + 3] = (value >>> 24)
- this[offset + 2] = (value >>> 16)
- this[offset + 1] = (value >>> 8)
- this[offset] = (value & 0xff)
- return offset + 4
-}
-
-Buffer.prototype.writeUint32BE =
-Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
- this[offset] = (value >>> 24)
- this[offset + 1] = (value >>> 16)
- this[offset + 2] = (value >>> 8)
- this[offset + 3] = (value & 0xff)
- return offset + 4
-}
-
-Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) {
- var limit = Math.pow(2, (8 * byteLength) - 1)
-
- checkInt(this, value, offset, byteLength, limit - 1, -limit)
- }
-
- var i = 0
- var mul = 1
- var sub = 0
- this[offset] = value & 0xFF
- while (++i < byteLength && (mul *= 0x100)) {
- if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
- sub = 1
- }
- this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
- }
-
- return offset + byteLength
-}
-
-Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) {
- var limit = Math.pow(2, (8 * byteLength) - 1)
-
- checkInt(this, value, offset, byteLength, limit - 1, -limit)
- }
-
- var i = byteLength - 1
- var mul = 1
- var sub = 0
- this[offset + i] = value & 0xFF
- while (--i >= 0 && (mul *= 0x100)) {
- if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
- sub = 1
- }
- this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
- }
-
- return offset + byteLength
-}
-
-Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
- if (value < 0) value = 0xff + value + 1
- this[offset] = (value & 0xff)
- return offset + 1
-}
-
-Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- return offset + 2
-}
-
-Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
- this[offset] = (value >>> 8)
- this[offset + 1] = (value & 0xff)
- return offset + 2
-}
-
-Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- this[offset + 2] = (value >>> 16)
- this[offset + 3] = (value >>> 24)
- return offset + 4
-}
-
-Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
- if (value < 0) value = 0xffffffff + value + 1
- this[offset] = (value >>> 24)
- this[offset + 1] = (value >>> 16)
- this[offset + 2] = (value >>> 8)
- this[offset + 3] = (value & 0xff)
- return offset + 4
-}
-
-function checkIEEE754 (buf, value, offset, ext, max, min) {
- if (offset + ext > buf.length) throw new RangeError('Index out of range')
- if (offset < 0) throw new RangeError('Index out of range')
-}
-
-function writeFloat (buf, value, offset, littleEndian, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
- }
- ieee754.write(buf, value, offset, littleEndian, 23, 4)
- return offset + 4
-}
-
-Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
- return writeFloat(this, value, offset, true, noAssert)
-}
-
-Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
- return writeFloat(this, value, offset, false, noAssert)
-}
-
-function writeDouble (buf, value, offset, littleEndian, noAssert) {
- value = +value
- offset = offset >>> 0
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
- }
- ieee754.write(buf, value, offset, littleEndian, 52, 8)
- return offset + 8
-}
-
-Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
- return writeDouble(this, value, offset, true, noAssert)
-}
-
-Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
- return writeDouble(this, value, offset, false, noAssert)
-}
-
-// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
-Buffer.prototype.copy = function copy (target, targetStart, start, end) {
- if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')
- if (!start) start = 0
- if (!end && end !== 0) end = this.length
- if (targetStart >= target.length) targetStart = target.length
- if (!targetStart) targetStart = 0
- if (end > 0 && end < start) end = start
-
- // Copy 0 bytes; we're done
- if (end === start) return 0
- if (target.length === 0 || this.length === 0) return 0
-
- // Fatal error conditions
- if (targetStart < 0) {
- throw new RangeError('targetStart out of bounds')
- }
- if (start < 0 || start >= this.length) throw new RangeError('Index out of range')
- if (end < 0) throw new RangeError('sourceEnd out of bounds')
-
- // Are we oob?
- if (end > this.length) end = this.length
- if (target.length - targetStart < end - start) {
- end = target.length - targetStart + start
- }
-
- var len = end - start
-
- if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {
- // Use built-in when available, missing from IE11
- this.copyWithin(targetStart, start, end)
- } else {
- Uint8Array.prototype.set.call(
- target,
- this.subarray(start, end),
- targetStart
- )
- }
-
- return len
-}
-
-// Usage:
-// buffer.fill(number[, offset[, end]])
-// buffer.fill(buffer[, offset[, end]])
-// buffer.fill(string[, offset[, end]][, encoding])
-Buffer.prototype.fill = function fill (val, start, end, encoding) {
- // Handle string cases:
- if (typeof val === 'string') {
- if (typeof start === 'string') {
- encoding = start
- start = 0
- end = this.length
- } else if (typeof end === 'string') {
- encoding = end
- end = this.length
- }
- if (encoding !== undefined && typeof encoding !== 'string') {
- throw new TypeError('encoding must be a string')
- }
- if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
- throw new TypeError('Unknown encoding: ' + encoding)
- }
- if (val.length === 1) {
- var code = val.charCodeAt(0)
- if ((encoding === 'utf8' && code < 128) ||
- encoding === 'latin1') {
- // Fast path: If `val` fits into a single byte, use that numeric value.
- val = code
- }
- }
- } else if (typeof val === 'number') {
- val = val & 255
- } else if (typeof val === 'boolean') {
- val = Number(val)
- }
-
- // Invalid ranges are not set to a default, so can range check early.
- if (start < 0 || this.length < start || this.length < end) {
- throw new RangeError('Out of range index')
- }
-
- if (end <= start) {
- return this
- }
-
- start = start >>> 0
- end = end === undefined ? this.length : end >>> 0
-
- if (!val) val = 0
-
- var i
- if (typeof val === 'number') {
- for (i = start; i < end; ++i) {
- this[i] = val
- }
- } else {
- var bytes = Buffer.isBuffer(val)
- ? val
- : Buffer.from(val, encoding)
- var len = bytes.length
- if (len === 0) {
- throw new TypeError('The value "' + val +
- '" is invalid for argument "value"')
- }
- for (i = 0; i < end - start; ++i) {
- this[i + start] = bytes[i % len]
- }
- }
-
- return this
-}
-
-// HELPER FUNCTIONS
-// ================
-
-var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g
-
-function base64clean (str) {
- // Node takes equal signs as end of the Base64 encoding
- str = str.split('=')[0]
- // Node strips out invalid characters like \n and \t from the string, base64-js does not
- str = str.trim().replace(INVALID_BASE64_RE, '')
- // Node converts strings with length < 2 to ''
- if (str.length < 2) return ''
- // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
- while (str.length % 4 !== 0) {
- str = str + '='
- }
- return str
-}
-
-function utf8ToBytes (string, units) {
- units = units || Infinity
- var codePoint
- var length = string.length
- var leadSurrogate = null
- var bytes = []
-
- for (var i = 0; i < length; ++i) {
- codePoint = string.charCodeAt(i)
-
- // is surrogate component
- if (codePoint > 0xD7FF && codePoint < 0xE000) {
- // last char was a lead
- if (!leadSurrogate) {
- // no lead yet
- if (codePoint > 0xDBFF) {
- // unexpected trail
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- continue
- } else if (i + 1 === length) {
- // unpaired lead
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- continue
- }
-
- // valid lead
- leadSurrogate = codePoint
-
- continue
- }
-
- // 2 leads in a row
- if (codePoint < 0xDC00) {
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- leadSurrogate = codePoint
- continue
- }
-
- // valid surrogate pair
- codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
- } else if (leadSurrogate) {
- // valid bmp char, but last char was a lead
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- }
-
- leadSurrogate = null
-
- // encode utf8
- if (codePoint < 0x80) {
- if ((units -= 1) < 0) break
- bytes.push(codePoint)
- } else if (codePoint < 0x800) {
- if ((units -= 2) < 0) break
- bytes.push(
- codePoint >> 0x6 | 0xC0,
- codePoint & 0x3F | 0x80
- )
- } else if (codePoint < 0x10000) {
- if ((units -= 3) < 0) break
- bytes.push(
- codePoint >> 0xC | 0xE0,
- codePoint >> 0x6 & 0x3F | 0x80,
- codePoint & 0x3F | 0x80
- )
- } else if (codePoint < 0x110000) {
- if ((units -= 4) < 0) break
- bytes.push(
- codePoint >> 0x12 | 0xF0,
- codePoint >> 0xC & 0x3F | 0x80,
- codePoint >> 0x6 & 0x3F | 0x80,
- codePoint & 0x3F | 0x80
- )
- } else {
- throw new Error('Invalid code point')
- }
- }
-
- return bytes
-}
-
-function asciiToBytes (str) {
- var byteArray = []
- for (var i = 0; i < str.length; ++i) {
- // Node's code seems to be doing this and not & 0x7F..
- byteArray.push(str.charCodeAt(i) & 0xFF)
- }
- return byteArray
-}
-
-function utf16leToBytes (str, units) {
- var c, hi, lo
- var byteArray = []
- for (var i = 0; i < str.length; ++i) {
- if ((units -= 2) < 0) break
-
- c = str.charCodeAt(i)
- hi = c >> 8
- lo = c % 256
- byteArray.push(lo)
- byteArray.push(hi)
- }
-
- return byteArray
-}
-
-function base64ToBytes (str) {
- return base64.toByteArray(base64clean(str))
-}
-
-function blitBuffer (src, dst, offset, length) {
- for (var i = 0; i < length; ++i) {
- if ((i + offset >= dst.length) || (i >= src.length)) break
- dst[i + offset] = src[i]
- }
- return i
-}
-
-// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass
-// the `instanceof` check but they should be treated as of that type.
-// See: https://github.com/feross/buffer/issues/166
-function isInstance (obj, type) {
- return obj instanceof type ||
- (obj != null && obj.constructor != null && obj.constructor.name != null &&
- obj.constructor.name === type.name)
-}
-function numberIsNaN (obj) {
- // For IE11 support
- return obj !== obj // eslint-disable-line no-self-compare
-}
-
-// Create lookup table for `toString('hex')`
-// See: https://github.com/feross/buffer/issues/219
-var hexSliceLookupTable = (function () {
- var alphabet = '0123456789abcdef'
- var table = new Array(256)
- for (var i = 0; i < 16; ++i) {
- var i16 = i * 16
- for (var j = 0; j < 16; ++j) {
- table[i16 + j] = alphabet[i] + alphabet[j]
- }
- }
- return table
-})()
diff --git a/node_modules/buffer/package.json b/node_modules/buffer/package.json
deleted file mode 100644
index 3b1b498..0000000
--- a/node_modules/buffer/package.json
+++ /dev/null
@@ -1,96 +0,0 @@
-{
- "name": "buffer",
- "description": "Node.js Buffer API, for the browser",
- "version": "5.7.1",
- "author": {
- "name": "Feross Aboukhadijeh",
- "email": "feross@feross.org",
- "url": "https://feross.org"
- },
- "bugs": {
- "url": "https://github.com/feross/buffer/issues"
- },
- "contributors": [
- "Romain Beauxis ",
- "James Halliday "
- ],
- "dependencies": {
- "base64-js": "^1.3.1",
- "ieee754": "^1.1.13"
- },
- "devDependencies": {
- "airtap": "^3.0.0",
- "benchmark": "^2.1.4",
- "browserify": "^17.0.0",
- "concat-stream": "^2.0.0",
- "hyperquest": "^2.1.3",
- "is-buffer": "^2.0.4",
- "is-nan": "^1.3.0",
- "split": "^1.0.1",
- "standard": "*",
- "tape": "^5.0.1",
- "through2": "^4.0.2",
- "uglify-js": "^3.11.3"
- },
- "homepage": "https://github.com/feross/buffer",
- "jspm": {
- "map": {
- "./index.js": {
- "node": "@node/buffer"
- }
- }
- },
- "keywords": [
- "arraybuffer",
- "browser",
- "browserify",
- "buffer",
- "compatible",
- "dataview",
- "uint8array"
- ],
- "license": "MIT",
- "main": "index.js",
- "types": "index.d.ts",
- "repository": {
- "type": "git",
- "url": "git://github.com/feross/buffer.git"
- },
- "scripts": {
- "perf": "browserify --debug perf/bracket-notation.js > perf/bundle.js && open perf/index.html",
- "perf-node": "node perf/bracket-notation.js && node perf/concat.js && node perf/copy-big.js && node perf/copy.js && node perf/new-big.js && node perf/new.js && node perf/readDoubleBE.js && node perf/readFloatBE.js && node perf/readUInt32LE.js && node perf/slice.js && node perf/writeFloatBE.js",
- "size": "browserify -r ./ | uglifyjs -c -m | gzip | wc -c",
- "test": "standard && node ./bin/test.js",
- "test-browser-es5": "airtap -- test/*.js",
- "test-browser-es5-local": "airtap --local -- test/*.js",
- "test-browser-es6": "airtap -- test/*.js test/node/*.js",
- "test-browser-es6-local": "airtap --local -- test/*.js test/node/*.js",
- "test-node": "tape test/*.js test/node/*.js",
- "update-authors": "./bin/update-authors.sh"
- },
- "standard": {
- "ignore": [
- "test/node/**/*.js",
- "test/common.js",
- "test/_polyfill.js",
- "perf/**/*.js"
- ],
- "globals": [
- "SharedArrayBuffer"
- ]
- },
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ]
-}
diff --git a/node_modules/chownr/LICENSE b/node_modules/chownr/LICENSE
deleted file mode 100644
index 19129e3..0000000
--- a/node_modules/chownr/LICENSE
+++ /dev/null
@@ -1,15 +0,0 @@
-The ISC License
-
-Copyright (c) Isaac Z. Schlueter and Contributors
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
-IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/chownr/README.md b/node_modules/chownr/README.md
deleted file mode 100644
index 70e9a54..0000000
--- a/node_modules/chownr/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-Like `chown -R`.
-
-Takes the same arguments as `fs.chown()`
diff --git a/node_modules/chownr/chownr.js b/node_modules/chownr/chownr.js
deleted file mode 100644
index 0d40932..0000000
--- a/node_modules/chownr/chownr.js
+++ /dev/null
@@ -1,167 +0,0 @@
-'use strict'
-const fs = require('fs')
-const path = require('path')
-
-/* istanbul ignore next */
-const LCHOWN = fs.lchown ? 'lchown' : 'chown'
-/* istanbul ignore next */
-const LCHOWNSYNC = fs.lchownSync ? 'lchownSync' : 'chownSync'
-
-/* istanbul ignore next */
-const needEISDIRHandled = fs.lchown &&
- !process.version.match(/v1[1-9]+\./) &&
- !process.version.match(/v10\.[6-9]/)
-
-const lchownSync = (path, uid, gid) => {
- try {
- return fs[LCHOWNSYNC](path, uid, gid)
- } catch (er) {
- if (er.code !== 'ENOENT')
- throw er
- }
-}
-
-/* istanbul ignore next */
-const chownSync = (path, uid, gid) => {
- try {
- return fs.chownSync(path, uid, gid)
- } catch (er) {
- if (er.code !== 'ENOENT')
- throw er
- }
-}
-
-/* istanbul ignore next */
-const handleEISDIR =
- needEISDIRHandled ? (path, uid, gid, cb) => er => {
- // Node prior to v10 had a very questionable implementation of
- // fs.lchown, which would always try to call fs.open on a directory
- // Fall back to fs.chown in those cases.
- if (!er || er.code !== 'EISDIR')
- cb(er)
- else
- fs.chown(path, uid, gid, cb)
- }
- : (_, __, ___, cb) => cb
-
-/* istanbul ignore next */
-const handleEISDirSync =
- needEISDIRHandled ? (path, uid, gid) => {
- try {
- return lchownSync(path, uid, gid)
- } catch (er) {
- if (er.code !== 'EISDIR')
- throw er
- chownSync(path, uid, gid)
- }
- }
- : (path, uid, gid) => lchownSync(path, uid, gid)
-
-// fs.readdir could only accept an options object as of node v6
-const nodeVersion = process.version
-let readdir = (path, options, cb) => fs.readdir(path, options, cb)
-let readdirSync = (path, options) => fs.readdirSync(path, options)
-/* istanbul ignore next */
-if (/^v4\./.test(nodeVersion))
- readdir = (path, options, cb) => fs.readdir(path, cb)
-
-const chown = (cpath, uid, gid, cb) => {
- fs[LCHOWN](cpath, uid, gid, handleEISDIR(cpath, uid, gid, er => {
- // Skip ENOENT error
- cb(er && er.code !== 'ENOENT' ? er : null)
- }))
-}
-
-const chownrKid = (p, child, uid, gid, cb) => {
- if (typeof child === 'string')
- return fs.lstat(path.resolve(p, child), (er, stats) => {
- // Skip ENOENT error
- if (er)
- return cb(er.code !== 'ENOENT' ? er : null)
- stats.name = child
- chownrKid(p, stats, uid, gid, cb)
- })
-
- if (child.isDirectory()) {
- chownr(path.resolve(p, child.name), uid, gid, er => {
- if (er)
- return cb(er)
- const cpath = path.resolve(p, child.name)
- chown(cpath, uid, gid, cb)
- })
- } else {
- const cpath = path.resolve(p, child.name)
- chown(cpath, uid, gid, cb)
- }
-}
-
-
-const chownr = (p, uid, gid, cb) => {
- readdir(p, { withFileTypes: true }, (er, children) => {
- // any error other than ENOTDIR or ENOTSUP means it's not readable,
- // or doesn't exist. give up.
- if (er) {
- if (er.code === 'ENOENT')
- return cb()
- else if (er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP')
- return cb(er)
- }
- if (er || !children.length)
- return chown(p, uid, gid, cb)
-
- let len = children.length
- let errState = null
- const then = er => {
- if (errState)
- return
- if (er)
- return cb(errState = er)
- if (-- len === 0)
- return chown(p, uid, gid, cb)
- }
-
- children.forEach(child => chownrKid(p, child, uid, gid, then))
- })
-}
-
-const chownrKidSync = (p, child, uid, gid) => {
- if (typeof child === 'string') {
- try {
- const stats = fs.lstatSync(path.resolve(p, child))
- stats.name = child
- child = stats
- } catch (er) {
- if (er.code === 'ENOENT')
- return
- else
- throw er
- }
- }
-
- if (child.isDirectory())
- chownrSync(path.resolve(p, child.name), uid, gid)
-
- handleEISDirSync(path.resolve(p, child.name), uid, gid)
-}
-
-const chownrSync = (p, uid, gid) => {
- let children
- try {
- children = readdirSync(p, { withFileTypes: true })
- } catch (er) {
- if (er.code === 'ENOENT')
- return
- else if (er.code === 'ENOTDIR' || er.code === 'ENOTSUP')
- return handleEISDirSync(p, uid, gid)
- else
- throw er
- }
-
- if (children && children.length)
- children.forEach(child => chownrKidSync(p, child, uid, gid))
-
- return handleEISDirSync(p, uid, gid)
-}
-
-module.exports = chownr
-chownr.sync = chownrSync
diff --git a/node_modules/chownr/package.json b/node_modules/chownr/package.json
deleted file mode 100644
index c273a7d..0000000
--- a/node_modules/chownr/package.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "author": "Isaac Z. Schlueter (http://blog.izs.me/)",
- "name": "chownr",
- "description": "like `chown -R`",
- "version": "1.1.4",
- "repository": {
- "type": "git",
- "url": "git://github.com/isaacs/chownr.git"
- },
- "main": "chownr.js",
- "files": [
- "chownr.js"
- ],
- "devDependencies": {
- "mkdirp": "0.3",
- "rimraf": "^2.7.1",
- "tap": "^14.10.6"
- },
- "tap": {
- "check-coverage": true
- },
- "scripts": {
- "test": "tap",
- "preversion": "npm test",
- "postversion": "npm publish",
- "prepublishOnly": "git push origin --follow-tags"
- },
- "license": "ISC"
-}
diff --git a/node_modules/debug/LICENSE b/node_modules/debug/LICENSE
deleted file mode 100644
index 1a9820e..0000000
--- a/node_modules/debug/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-(The MIT License)
-
-Copyright (c) 2014-2017 TJ Holowaychuk
-Copyright (c) 2018-2021 Josh Junon
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software
-and associated documentation files (the 'Software'), to deal in the Software without restriction,
-including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
-LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
diff --git a/node_modules/debug/README.md b/node_modules/debug/README.md
deleted file mode 100644
index 9ebdfbf..0000000
--- a/node_modules/debug/README.md
+++ /dev/null
@@ -1,481 +0,0 @@
-# debug
-[](#backers)
-[](#sponsors)
-
-
-
-A tiny JavaScript debugging utility modelled after Node.js core's debugging
-technique. Works in Node.js and web browsers.
-
-## Installation
-
-```bash
-$ npm install debug
-```
-
-## Usage
-
-`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.
-
-Example [_app.js_](./examples/node/app.js):
-
-```js
-var debug = require('debug')('http')
- , http = require('http')
- , name = 'My App';
-
-// fake app
-
-debug('booting %o', name);
-
-http.createServer(function(req, res){
- debug(req.method + ' ' + req.url);
- res.end('hello\n');
-}).listen(3000, function(){
- debug('listening');
-});
-
-// fake worker of some kind
-
-require('./worker');
-```
-
-Example [_worker.js_](./examples/node/worker.js):
-
-```js
-var a = require('debug')('worker:a')
- , b = require('debug')('worker:b');
-
-function work() {
- a('doing lots of uninteresting work');
- setTimeout(work, Math.random() * 1000);
-}
-
-work();
-
-function workb() {
- b('doing some work');
- setTimeout(workb, Math.random() * 2000);
-}
-
-workb();
-```
-
-The `DEBUG` environment variable is then used to enable these based on space or
-comma-delimited names.
-
-Here are some examples:
-
-
-
-
-
-#### Windows command prompt notes
-
-##### CMD
-
-On Windows the environment variable is set using the `set` command.
-
-```cmd
-set DEBUG=*,-not_this
-```
-
-Example:
-
-```cmd
-set DEBUG=* & node app.js
-```
-
-##### PowerShell (VS Code default)
-
-PowerShell uses different syntax to set environment variables.
-
-```cmd
-$env:DEBUG = "*,-not_this"
-```
-
-Example:
-
-```cmd
-$env:DEBUG='app';node app.js
-```
-
-Then, run the program to be debugged as usual.
-
-npm script example:
-```js
- "windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js",
-```
-
-## Namespace Colors
-
-Every debug instance has a color generated for it based on its namespace name.
-This helps when visually parsing the debug output to identify which debug instance
-a debug line belongs to.
-
-#### Node.js
-
-In Node.js, colors are enabled when stderr is a TTY. You also _should_ install
-the [`supports-color`](https://npmjs.org/supports-color) module alongside debug,
-otherwise debug will only use a small handful of basic colors.
-
-
-
-#### Web Browser
-
-Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
-option. These are WebKit web inspectors, Firefox ([since version
-31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
-and the Firebug plugin for Firefox (any version).
-
-
-
-
-## Millisecond diff
-
-When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
-
-
-
-When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below:
-
-
-
-
-## Conventions
-
-If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output.
-
-## Wildcards
-
-The `*` character may be used as a wildcard. Suppose for example your library has
-debuggers named "connect:bodyParser", "connect:compress", "connect:session",
-instead of listing all three with
-`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do
-`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
-
-You can also exclude specific debuggers by prefixing them with a "-" character.
-For example, `DEBUG=*,-connect:*` would include all debuggers except those
-starting with "connect:".
-
-## Environment Variables
-
-When running through Node.js, you can set a few environment variables that will
-change the behavior of the debug logging:
-
-| Name | Purpose |
-|-----------|-------------------------------------------------|
-| `DEBUG` | Enables/disables specific debugging namespaces. |
-| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). |
-| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |
-| `DEBUG_DEPTH` | Object inspection depth. |
-| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |
-
-
-__Note:__ The environment variables beginning with `DEBUG_` end up being
-converted into an Options object that gets used with `%o`/`%O` formatters.
-See the Node.js documentation for
-[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
-for the complete list.
-
-## Formatters
-
-Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting.
-Below are the officially supported formatters:
-
-| Formatter | Representation |
-|-----------|----------------|
-| `%O` | Pretty-print an Object on multiple lines. |
-| `%o` | Pretty-print an Object all on a single line. |
-| `%s` | String. |
-| `%d` | Number (both integer and float). |
-| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. |
-| `%%` | Single percent sign ('%'). This does not consume an argument. |
-
-
-### Custom formatters
-
-You can add custom formatters by extending the `debug.formatters` object.
-For example, if you wanted to add support for rendering a Buffer as hex with
-`%h`, you could do something like:
-
-```js
-const createDebug = require('debug')
-createDebug.formatters.h = (v) => {
- return v.toString('hex')
-}
-
-// …elsewhere
-const debug = createDebug('foo')
-debug('this is hex: %h', new Buffer('hello world'))
-// foo this is hex: 68656c6c6f20776f726c6421 +0ms
-```
-
-
-## Browser Support
-
-You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
-or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
-if you don't want to build it yourself.
-
-Debug's enable state is currently persisted by `localStorage`.
-Consider the situation shown below where you have `worker:a` and `worker:b`,
-and wish to debug both. You can enable this using `localStorage.debug`:
-
-```js
-localStorage.debug = 'worker:*'
-```
-
-And then refresh the page.
-
-```js
-a = debug('worker:a');
-b = debug('worker:b');
-
-setInterval(function(){
- a('doing some work');
-}, 1000);
-
-setInterval(function(){
- b('doing some work');
-}, 1200);
-```
-
-In Chromium-based web browsers (e.g. Brave, Chrome, and Electron), the JavaScript console will—by default—only show messages logged by `debug` if the "Verbose" log level is _enabled_.
-
-
-
-## Output streams
-
- By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:
-
-Example [_stdout.js_](./examples/node/stdout.js):
-
-```js
-var debug = require('debug');
-var error = debug('app:error');
-
-// by default stderr is used
-error('goes to stderr!');
-
-var log = debug('app:log');
-// set this namespace to log via console.log
-log.log = console.log.bind(console); // don't forget to bind to console!
-log('goes to stdout');
-error('still goes to stderr!');
-
-// set all output to go via console.info
-// overrides all per-namespace log settings
-debug.log = console.info.bind(console);
-error('now goes to stdout via console.info');
-log('still goes to stdout, but via console.info now');
-```
-
-## Extend
-You can simply extend debugger
-```js
-const log = require('debug')('auth');
-
-//creates new debug instance with extended namespace
-const logSign = log.extend('sign');
-const logLogin = log.extend('login');
-
-log('hello'); // auth hello
-logSign('hello'); //auth:sign hello
-logLogin('hello'); //auth:login hello
-```
-
-## Set dynamically
-
-You can also enable debug dynamically by calling the `enable()` method :
-
-```js
-let debug = require('debug');
-
-console.log(1, debug.enabled('test'));
-
-debug.enable('test');
-console.log(2, debug.enabled('test'));
-
-debug.disable();
-console.log(3, debug.enabled('test'));
-
-```
-
-print :
-```
-1 false
-2 true
-3 false
-```
-
-Usage :
-`enable(namespaces)`
-`namespaces` can include modes separated by a colon and wildcards.
-
-Note that calling `enable()` completely overrides previously set DEBUG variable :
-
-```
-$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))'
-=> false
-```
-
-`disable()`
-
-Will disable all namespaces. The functions returns the namespaces currently
-enabled (and skipped). This can be useful if you want to disable debugging
-temporarily without knowing what was enabled to begin with.
-
-For example:
-
-```js
-let debug = require('debug');
-debug.enable('foo:*,-foo:bar');
-let namespaces = debug.disable();
-debug.enable(namespaces);
-```
-
-Note: There is no guarantee that the string will be identical to the initial
-enable string, but semantically they will be identical.
-
-## Checking whether a debug target is enabled
-
-After you've created a debug instance, you can determine whether or not it is
-enabled by checking the `enabled` property:
-
-```javascript
-const debug = require('debug')('http');
-
-if (debug.enabled) {
- // do stuff...
-}
-```
-
-You can also manually toggle this property to force the debug instance to be
-enabled or disabled.
-
-## Usage in child processes
-
-Due to the way `debug` detects if the output is a TTY or not, colors are not shown in child processes when `stderr` is piped. A solution is to pass the `DEBUG_COLORS=1` environment variable to the child process.
-For example:
-
-```javascript
-worker = fork(WORKER_WRAP_PATH, [workerPath], {
- stdio: [
- /* stdin: */ 0,
- /* stdout: */ 'pipe',
- /* stderr: */ 'pipe',
- 'ipc',
- ],
- env: Object.assign({}, process.env, {
- DEBUG_COLORS: 1 // without this settings, colors won't be shown
- }),
-});
-
-worker.stderr.pipe(process.stderr, { end: false });
-```
-
-
-## Authors
-
- - TJ Holowaychuk
- - Nathan Rajlich
- - Andrew Rhyne
- - Josh Junon
-
-## Backers
-
-Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-## Sponsors
-
-Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-## License
-
-(The MIT License)
-
-Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
-Copyright (c) 2018-2021 Josh Junon
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-'Software'), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/debug/package.json b/node_modules/debug/package.json
deleted file mode 100644
index 2f782eb..0000000
--- a/node_modules/debug/package.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
- "name": "debug",
- "version": "4.3.7",
- "repository": {
- "type": "git",
- "url": "git://github.com/debug-js/debug.git"
- },
- "description": "Lightweight debugging utility for Node.js and the browser",
- "keywords": [
- "debug",
- "log",
- "debugger"
- ],
- "files": [
- "src",
- "LICENSE",
- "README.md"
- ],
- "author": "Josh Junon (https://github.com/qix-)",
- "contributors": [
- "TJ Holowaychuk ",
- "Nathan Rajlich (http://n8.io)",
- "Andrew Rhyne "
- ],
- "license": "MIT",
- "scripts": {
- "lint": "xo",
- "test": "npm run test:node && npm run test:browser && npm run lint",
- "test:node": "istanbul cover _mocha -- test.js test.node.js",
- "test:browser": "karma start --single-run",
- "test:coverage": "cat ./coverage/lcov.info | coveralls"
- },
- "dependencies": {
- "ms": "^2.1.3"
- },
- "devDependencies": {
- "brfs": "^2.0.1",
- "browserify": "^16.2.3",
- "coveralls": "^3.0.2",
- "istanbul": "^0.4.5",
- "karma": "^3.1.4",
- "karma-browserify": "^6.0.0",
- "karma-chrome-launcher": "^2.2.0",
- "karma-mocha": "^1.3.0",
- "mocha": "^5.2.0",
- "mocha-lcov-reporter": "^1.2.0",
- "sinon": "^14.0.0",
- "xo": "^0.23.0"
- },
- "peerDependenciesMeta": {
- "supports-color": {
- "optional": true
- }
- },
- "main": "./src/index.js",
- "browser": "./src/browser.js",
- "engines": {
- "node": ">=6.0"
- }
-}
diff --git a/node_modules/debug/src/browser.js b/node_modules/debug/src/browser.js
deleted file mode 100644
index 8d808e5..0000000
--- a/node_modules/debug/src/browser.js
+++ /dev/null
@@ -1,271 +0,0 @@
-/* eslint-env browser */
-
-/**
- * This is the web browser implementation of `debug()`.
- */
-
-exports.formatArgs = formatArgs;
-exports.save = save;
-exports.load = load;
-exports.useColors = useColors;
-exports.storage = localstorage();
-exports.destroy = (() => {
- let warned = false;
-
- return () => {
- if (!warned) {
- warned = true;
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
- }
- };
-})();
-
-/**
- * Colors.
- */
-
-exports.colors = [
- '#0000CC',
- '#0000FF',
- '#0033CC',
- '#0033FF',
- '#0066CC',
- '#0066FF',
- '#0099CC',
- '#0099FF',
- '#00CC00',
- '#00CC33',
- '#00CC66',
- '#00CC99',
- '#00CCCC',
- '#00CCFF',
- '#3300CC',
- '#3300FF',
- '#3333CC',
- '#3333FF',
- '#3366CC',
- '#3366FF',
- '#3399CC',
- '#3399FF',
- '#33CC00',
- '#33CC33',
- '#33CC66',
- '#33CC99',
- '#33CCCC',
- '#33CCFF',
- '#6600CC',
- '#6600FF',
- '#6633CC',
- '#6633FF',
- '#66CC00',
- '#66CC33',
- '#9900CC',
- '#9900FF',
- '#9933CC',
- '#9933FF',
- '#99CC00',
- '#99CC33',
- '#CC0000',
- '#CC0033',
- '#CC0066',
- '#CC0099',
- '#CC00CC',
- '#CC00FF',
- '#CC3300',
- '#CC3333',
- '#CC3366',
- '#CC3399',
- '#CC33CC',
- '#CC33FF',
- '#CC6600',
- '#CC6633',
- '#CC9900',
- '#CC9933',
- '#CCCC00',
- '#CCCC33',
- '#FF0000',
- '#FF0033',
- '#FF0066',
- '#FF0099',
- '#FF00CC',
- '#FF00FF',
- '#FF3300',
- '#FF3333',
- '#FF3366',
- '#FF3399',
- '#FF33CC',
- '#FF33FF',
- '#FF6600',
- '#FF6633',
- '#FF9900',
- '#FF9933',
- '#FFCC00',
- '#FFCC33'
-];
-
-/**
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
- * and the Firebug extension (any Firefox version) are known
- * to support "%c" CSS customizations.
- *
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
- */
-
-// eslint-disable-next-line complexity
-function useColors() {
- // NB: In an Electron preload script, document will be defined but not fully
- // initialized. Since we know we're in Chrome, we'll just detect this case
- // explicitly
- if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
- return true;
- }
-
- // Internet Explorer and Edge do not support colors.
- if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
- return false;
- }
-
- let m;
-
- // Is webkit? http://stackoverflow.com/a/16459606/376773
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
- return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
- // Is firebug? http://stackoverflow.com/a/398120/376773
- (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
- // Is firefox >= v31?
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
- (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
- // Double check webkit in userAgent just in case we are in a worker
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
-}
-
-/**
- * Colorize log arguments if enabled.
- *
- * @api public
- */
-
-function formatArgs(args) {
- args[0] = (this.useColors ? '%c' : '') +
- this.namespace +
- (this.useColors ? ' %c' : ' ') +
- args[0] +
- (this.useColors ? '%c ' : ' ') +
- '+' + module.exports.humanize(this.diff);
-
- if (!this.useColors) {
- return;
- }
-
- const c = 'color: ' + this.color;
- args.splice(1, 0, c, 'color: inherit');
-
- // The final "%c" is somewhat tricky, because there could be other
- // arguments passed either before or after the %c, so we need to
- // figure out the correct index to insert the CSS into
- let index = 0;
- let lastC = 0;
- args[0].replace(/%[a-zA-Z%]/g, match => {
- if (match === '%%') {
- return;
- }
- index++;
- if (match === '%c') {
- // We only are interested in the *last* %c
- // (the user may have provided their own)
- lastC = index;
- }
- });
-
- args.splice(lastC, 0, c);
-}
-
-/**
- * Invokes `console.debug()` when available.
- * No-op when `console.debug` is not a "function".
- * If `console.debug` is not available, falls back
- * to `console.log`.
- *
- * @api public
- */
-exports.log = console.debug || console.log || (() => {});
-
-/**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
- */
-function save(namespaces) {
- try {
- if (namespaces) {
- exports.storage.setItem('debug', namespaces);
- } else {
- exports.storage.removeItem('debug');
- }
- } catch (error) {
- // Swallow
- // XXX (@Qix-) should we be logging these?
- }
-}
-
-/**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
-function load() {
- let r;
- try {
- r = exports.storage.getItem('debug');
- } catch (error) {
- // Swallow
- // XXX (@Qix-) should we be logging these?
- }
-
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
- if (!r && typeof process !== 'undefined' && 'env' in process) {
- r = process.env.DEBUG;
- }
-
- return r;
-}
-
-/**
- * Localstorage attempts to return the localstorage.
- *
- * This is necessary because safari throws
- * when a user disables cookies/localstorage
- * and you attempt to access it.
- *
- * @return {LocalStorage}
- * @api private
- */
-
-function localstorage() {
- try {
- // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
- // The Browser also has localStorage in the global context.
- return localStorage;
- } catch (error) {
- // Swallow
- // XXX (@Qix-) should we be logging these?
- }
-}
-
-module.exports = require('./common')(exports);
-
-const {formatters} = module.exports;
-
-/**
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
- */
-
-formatters.j = function (v) {
- try {
- return JSON.stringify(v);
- } catch (error) {
- return '[UnexpectedJSONParseError]: ' + error.message;
- }
-};
diff --git a/node_modules/debug/src/common.js b/node_modules/debug/src/common.js
deleted file mode 100644
index e3291b2..0000000
--- a/node_modules/debug/src/common.js
+++ /dev/null
@@ -1,274 +0,0 @@
-
-/**
- * This is the common logic for both the Node.js and web browser
- * implementations of `debug()`.
- */
-
-function setup(env) {
- createDebug.debug = createDebug;
- createDebug.default = createDebug;
- createDebug.coerce = coerce;
- createDebug.disable = disable;
- createDebug.enable = enable;
- createDebug.enabled = enabled;
- createDebug.humanize = require('ms');
- createDebug.destroy = destroy;
-
- Object.keys(env).forEach(key => {
- createDebug[key] = env[key];
- });
-
- /**
- * The currently active debug mode names, and names to skip.
- */
-
- createDebug.names = [];
- createDebug.skips = [];
-
- /**
- * Map of special "%n" handling functions, for the debug "format" argument.
- *
- * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
- */
- createDebug.formatters = {};
-
- /**
- * Selects a color for a debug namespace
- * @param {String} namespace The namespace string for the debug instance to be colored
- * @return {Number|String} An ANSI color code for the given namespace
- * @api private
- */
- function selectColor(namespace) {
- let hash = 0;
-
- for (let i = 0; i < namespace.length; i++) {
- hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
- hash |= 0; // Convert to 32bit integer
- }
-
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
- }
- createDebug.selectColor = selectColor;
-
- /**
- * Create a debugger with the given `namespace`.
- *
- * @param {String} namespace
- * @return {Function}
- * @api public
- */
- function createDebug(namespace) {
- let prevTime;
- let enableOverride = null;
- let namespacesCache;
- let enabledCache;
-
- function debug(...args) {
- // Disabled?
- if (!debug.enabled) {
- return;
- }
-
- const self = debug;
-
- // Set `diff` timestamp
- const curr = Number(new Date());
- const ms = curr - (prevTime || curr);
- self.diff = ms;
- self.prev = prevTime;
- self.curr = curr;
- prevTime = curr;
-
- args[0] = createDebug.coerce(args[0]);
-
- if (typeof args[0] !== 'string') {
- // Anything else let's inspect with %O
- args.unshift('%O');
- }
-
- // Apply any `formatters` transformations
- let index = 0;
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
- // If we encounter an escaped % then don't increase the array index
- if (match === '%%') {
- return '%';
- }
- index++;
- const formatter = createDebug.formatters[format];
- if (typeof formatter === 'function') {
- const val = args[index];
- match = formatter.call(self, val);
-
- // Now we need to remove `args[index]` since it's inlined in the `format`
- args.splice(index, 1);
- index--;
- }
- return match;
- });
-
- // Apply env-specific formatting (colors, etc.)
- createDebug.formatArgs.call(self, args);
-
- const logFn = self.log || createDebug.log;
- logFn.apply(self, args);
- }
-
- debug.namespace = namespace;
- debug.useColors = createDebug.useColors();
- debug.color = createDebug.selectColor(namespace);
- debug.extend = extend;
- debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
-
- Object.defineProperty(debug, 'enabled', {
- enumerable: true,
- configurable: false,
- get: () => {
- if (enableOverride !== null) {
- return enableOverride;
- }
- if (namespacesCache !== createDebug.namespaces) {
- namespacesCache = createDebug.namespaces;
- enabledCache = createDebug.enabled(namespace);
- }
-
- return enabledCache;
- },
- set: v => {
- enableOverride = v;
- }
- });
-
- // Env-specific initialization logic for debug instances
- if (typeof createDebug.init === 'function') {
- createDebug.init(debug);
- }
-
- return debug;
- }
-
- function extend(namespace, delimiter) {
- const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
- newDebug.log = this.log;
- return newDebug;
- }
-
- /**
- * Enables a debug mode by namespaces. This can include modes
- * separated by a colon and wildcards.
- *
- * @param {String} namespaces
- * @api public
- */
- function enable(namespaces) {
- createDebug.save(namespaces);
- createDebug.namespaces = namespaces;
-
- createDebug.names = [];
- createDebug.skips = [];
-
- let i;
- const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
- const len = split.length;
-
- for (i = 0; i < len; i++) {
- if (!split[i]) {
- // ignore empty strings
- continue;
- }
-
- namespaces = split[i].replace(/\*/g, '.*?');
-
- if (namespaces[0] === '-') {
- createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
- } else {
- createDebug.names.push(new RegExp('^' + namespaces + '$'));
- }
- }
- }
-
- /**
- * Disable debug output.
- *
- * @return {String} namespaces
- * @api public
- */
- function disable() {
- const namespaces = [
- ...createDebug.names.map(toNamespace),
- ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
- ].join(',');
- createDebug.enable('');
- return namespaces;
- }
-
- /**
- * Returns true if the given mode name is enabled, false otherwise.
- *
- * @param {String} name
- * @return {Boolean}
- * @api public
- */
- function enabled(name) {
- if (name[name.length - 1] === '*') {
- return true;
- }
-
- let i;
- let len;
-
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
- if (createDebug.skips[i].test(name)) {
- return false;
- }
- }
-
- for (i = 0, len = createDebug.names.length; i < len; i++) {
- if (createDebug.names[i].test(name)) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Convert regexp to namespace
- *
- * @param {RegExp} regxep
- * @return {String} namespace
- * @api private
- */
- function toNamespace(regexp) {
- return regexp.toString()
- .substring(2, regexp.toString().length - 2)
- .replace(/\.\*\?$/, '*');
- }
-
- /**
- * Coerce `val`.
- *
- * @param {Mixed} val
- * @return {Mixed}
- * @api private
- */
- function coerce(val) {
- if (val instanceof Error) {
- return val.stack || val.message;
- }
- return val;
- }
-
- /**
- * XXX DO NOT USE. This is a temporary stub function.
- * XXX It WILL be removed in the next major release.
- */
- function destroy() {
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
- }
-
- createDebug.enable(createDebug.load());
-
- return createDebug;
-}
-
-module.exports = setup;
diff --git a/node_modules/debug/src/index.js b/node_modules/debug/src/index.js
deleted file mode 100644
index bf4c57f..0000000
--- a/node_modules/debug/src/index.js
+++ /dev/null
@@ -1,10 +0,0 @@
-/**
- * Detect Electron renderer / nwjs process, which is node, but we should
- * treat as a browser.
- */
-
-if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
- module.exports = require('./browser.js');
-} else {
- module.exports = require('./node.js');
-}
diff --git a/node_modules/debug/src/node.js b/node_modules/debug/src/node.js
deleted file mode 100644
index 715560a..0000000
--- a/node_modules/debug/src/node.js
+++ /dev/null
@@ -1,263 +0,0 @@
-/**
- * Module dependencies.
- */
-
-const tty = require('tty');
-const util = require('util');
-
-/**
- * This is the Node.js implementation of `debug()`.
- */
-
-exports.init = init;
-exports.log = log;
-exports.formatArgs = formatArgs;
-exports.save = save;
-exports.load = load;
-exports.useColors = useColors;
-exports.destroy = util.deprecate(
- () => {},
- 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
-);
-
-/**
- * Colors.
- */
-
-exports.colors = [6, 2, 3, 4, 5, 1];
-
-try {
- // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
- // eslint-disable-next-line import/no-extraneous-dependencies
- const supportsColor = require('supports-color');
-
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
- exports.colors = [
- 20,
- 21,
- 26,
- 27,
- 32,
- 33,
- 38,
- 39,
- 40,
- 41,
- 42,
- 43,
- 44,
- 45,
- 56,
- 57,
- 62,
- 63,
- 68,
- 69,
- 74,
- 75,
- 76,
- 77,
- 78,
- 79,
- 80,
- 81,
- 92,
- 93,
- 98,
- 99,
- 112,
- 113,
- 128,
- 129,
- 134,
- 135,
- 148,
- 149,
- 160,
- 161,
- 162,
- 163,
- 164,
- 165,
- 166,
- 167,
- 168,
- 169,
- 170,
- 171,
- 172,
- 173,
- 178,
- 179,
- 184,
- 185,
- 196,
- 197,
- 198,
- 199,
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 207,
- 208,
- 209,
- 214,
- 215,
- 220,
- 221
- ];
- }
-} catch (error) {
- // Swallow - we only care if `supports-color` is available; it doesn't have to be.
-}
-
-/**
- * Build up the default `inspectOpts` object from the environment variables.
- *
- * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
- */
-
-exports.inspectOpts = Object.keys(process.env).filter(key => {
- return /^debug_/i.test(key);
-}).reduce((obj, key) => {
- // Camel-case
- const prop = key
- .substring(6)
- .toLowerCase()
- .replace(/_([a-z])/g, (_, k) => {
- return k.toUpperCase();
- });
-
- // Coerce string value into JS value
- let val = process.env[key];
- if (/^(yes|on|true|enabled)$/i.test(val)) {
- val = true;
- } else if (/^(no|off|false|disabled)$/i.test(val)) {
- val = false;
- } else if (val === 'null') {
- val = null;
- } else {
- val = Number(val);
- }
-
- obj[prop] = val;
- return obj;
-}, {});
-
-/**
- * Is stdout a TTY? Colored output is enabled when `true`.
- */
-
-function useColors() {
- return 'colors' in exports.inspectOpts ?
- Boolean(exports.inspectOpts.colors) :
- tty.isatty(process.stderr.fd);
-}
-
-/**
- * Adds ANSI color escape codes if enabled.
- *
- * @api public
- */
-
-function formatArgs(args) {
- const {namespace: name, useColors} = this;
-
- if (useColors) {
- const c = this.color;
- const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
- const prefix = ` ${colorCode};1m${name} \u001B[0m`;
-
- args[0] = prefix + args[0].split('\n').join('\n' + prefix);
- args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
- } else {
- args[0] = getDate() + name + ' ' + args[0];
- }
-}
-
-function getDate() {
- if (exports.inspectOpts.hideDate) {
- return '';
- }
- return new Date().toISOString() + ' ';
-}
-
-/**
- * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
- */
-
-function log(...args) {
- return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
-}
-
-/**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
- */
-function save(namespaces) {
- if (namespaces) {
- process.env.DEBUG = namespaces;
- } else {
- // If you set a process.env field to null or undefined, it gets cast to the
- // string 'null' or 'undefined'. Just delete instead.
- delete process.env.DEBUG;
- }
-}
-
-/**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
-
-function load() {
- return process.env.DEBUG;
-}
-
-/**
- * Init logic for `debug` instances.
- *
- * Create a new `inspectOpts` object in case `useColors` is set
- * differently for a particular `debug` instance.
- */
-
-function init(debug) {
- debug.inspectOpts = {};
-
- const keys = Object.keys(exports.inspectOpts);
- for (let i = 0; i < keys.length; i++) {
- debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
- }
-}
-
-module.exports = require('./common')(exports);
-
-const {formatters} = module.exports;
-
-/**
- * Map %o to `util.inspect()`, all on a single line.
- */
-
-formatters.o = function (v) {
- this.inspectOpts.colors = this.useColors;
- return util.inspect(v, this.inspectOpts)
- .split('\n')
- .map(str => str.trim())
- .join(' ');
-};
-
-/**
- * Map %O to `util.inspect()`, allowing multiple lines if needed.
- */
-
-formatters.O = function (v) {
- this.inspectOpts.colors = this.useColors;
- return util.inspect(v, this.inspectOpts);
-};
diff --git a/node_modules/docker-modem/.eslintrc b/node_modules/docker-modem/.eslintrc
deleted file mode 100644
index ce9a475..0000000
--- a/node_modules/docker-modem/.eslintrc
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "env": {
- "mocha": true,
- "node": true
- },
- "rules": {
- /* Possible Errors */
- "no-extra-parens": 2,
- "valid-jsdoc": 2,
- /* Best Practices */
- "block-scoped-var": 2,
- "complexity": [1, 3],
- "default-case": 2,
- "dot-notation": [2],
- "guard-for-in": 2,
- "no-div-regex": 2,
- "no-else-return": 2,
- "no-eq-null": 2,
- "no-floating-decimal": 2,
- "no-process-env": 2,
- "no-self-compare": 2,
- "no-void": 2,
- "no-warning-comments": 2,
- "radix": 2,
- "vars-on-top": 2,
- "wrap-iife": 2,
- /* Variables */
- "no-catch-shadow": 2,
- /* Node.JS */
- "no-sync": 2,
- /* Stylistic Issues */
- "no-mixed-spaces-and-tabs": 2,
- "no-underscore-dangle": 2,
- "quotes": [1, "single", "avoid-escape"]
-}}
diff --git a/node_modules/docker-modem/.travis.yml b/node_modules/docker-modem/.travis.yml
deleted file mode 100644
index 162ad20..0000000
--- a/node_modules/docker-modem/.travis.yml
+++ /dev/null
@@ -1,36 +0,0 @@
-sudo: required
-
-git:
- quiet: true
-
-language: node_js
-
-node_js:
- - "8"
-
-before_script:
- - docker pull ubuntu
-
-services:
- - docker
-
-before_install:
- - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- - sudo apt-get update
- - sudo apt-get -y install docker-ce
- - cd ..
- - git clone --depth=50 --branch=master https://github.com/apocas/dockerode.git
- - cd dockerode
- - npm install
- - cd ../docker-modem
-
-install:
- - npm install
-
-script:
- - npm test
- - cd ../dockerode
- - rm -rf ./node_modules/docker-modem
- - npm install git://github.com/apocas/docker-modem
- - npm test
diff --git a/node_modules/docker-modem/LICENSE b/node_modules/docker-modem/LICENSE
deleted file mode 100644
index 8dada3e..0000000
--- a/node_modules/docker-modem/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "{}"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright {yyyy} {name of copyright owner}
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/node_modules/docker-modem/README.md b/node_modules/docker-modem/README.md
deleted file mode 100644
index 0ae0336..0000000
--- a/node_modules/docker-modem/README.md
+++ /dev/null
@@ -1,63 +0,0 @@
-# docker-modem
-
-[Docker](https://www.docker.com/)'s Remote API network layer module.
-
-`docker-modem` will help you interacting with `Docker`, since it already implements all the network strategies needed to support all `Docker`'s Remote API endpoints.
-
-It is the module powering (network wise) [dockerode](https://github.com/apocas/dockerode) and other modules.
-
-## Usage
-
-### Getting started
-
-``` js
-var Modem = require('docker-modem');
-var modem1 = new Modem({socketPath: '/var/run/docker.sock'});
-var modem2 = new Modem(); //defaults to above if env variables are not used
-var modem3 = new Modem({host: 'http://192.168.1.10', port: 3000});
-var modem4 = new Modem({protocol:'http', host: '127.0.0.1', port: 3000});
-var modem5 = new Modem({host: '127.0.0.1', port: 3000}); //defaults to http
-```
-
-### SSH
-
-You can connect to the Docker daemon via SSH in two ways:
-
-* Using the built-in SSH agent.
-* Implement your own custom agent.
-
-``` js
-//built-in SSH agent
-var modem1 = new Modem({
- protocol: 'ssh',
- host: 'ssh://127.0.0.1',
- port: 22
-});
-
-//custom agent
-var customAgent = myOwnSSHAgent({host: 'ssh://127.0.0.1', port: 22});
-var modem2 = new Modem({
- agent: customAgent,
-});
-```
-
-## Tests
-
- * Tests are implemented using `mocha` and `chai`. Run them with `npm test`.
- * Check [dockerode](https://github.com/apocas/dockerode) tests, which is indirectly co-testing `docker-modem`.
-
-## Sponsors
-
-Amazing entities that [sponsor](https://github.com/sponsors/apocas) my open-source work. Check them out!
-
-[](https://github.com/httptoolkit)
-
-## License
-
-Pedro Dias - [@pedromdias](https://twitter.com/pedromdias)
-
-Licensed under the Apache license, version 2.0 (the "license"); You may not use this file except in compliance with the license. You may obtain a copy of the license at:
-
-http://www.apache.org/licenses/LICENSE-2.0.html
-
-Unless required by applicable law or agreed to in writing, software distributed under the license is distributed on an "as is" basis, without warranties or conditions of any kind, either express or implied. See the license for the specific language governing permissions and limitations under the license.
diff --git a/node_modules/docker-modem/lib/http.js b/node_modules/docker-modem/lib/http.js
deleted file mode 100644
index a2dda2b..0000000
--- a/node_modules/docker-modem/lib/http.js
+++ /dev/null
@@ -1,87 +0,0 @@
-//Based on follow-redirects v0.0.x
-
-var nativeHttps = require('https'),
- nativeHttp = require('http'),
- url = require('url'),
- utils = require('./utils');
-
-var maxRedirects = module.exports.maxRedirects = 5;
-
-var protocols = {
- https: nativeHttps,
- http: nativeHttp
-};
-
-for (var protocol in protocols) {
- var h = function() {};
- h.prototype = protocols[protocol];
- h = new h();
-
- h.request = function(h) {
- return function(options, callback, redirectOptions) {
-
- redirectOptions = redirectOptions || {};
-
- var max = (typeof options === 'object' && 'maxRedirects' in options) ? options.maxRedirects : exports.maxRedirects;
-
- var redirect = utils.extend({
- count: 0,
- max: max,
- clientRequest: null,
- userCallback: callback
- }, redirectOptions);
-
- if (redirect.count > redirect.max) {
- var err = new Error('Max redirects exceeded. To allow more redirects, pass options.maxRedirects property.');
- redirect.clientRequest.emit('error', err);
- return redirect.clientRequest;
- }
-
- redirect.count++;
-
- var reqUrl;
- if (typeof options === 'string') {
- reqUrl = options;
- } else {
- reqUrl = url.format(utils.extend({
- protocol: protocol
- }, options));
- }
-
- var clientRequest = Object.getPrototypeOf(h).request(options, redirectCallback(reqUrl, redirect));
-
- if (!redirect.clientRequest) redirect.clientRequest = clientRequest;
-
- function redirectCallback(reqUrl, redirect) {
- return function(res) {
- if (res.statusCode < 300 || res.statusCode > 399) {
- return redirect.userCallback(res);
- }
-
- if (!('location' in res.headers)) {
- return redirect.userCallback(res);
- }
-
- var redirectUrl = url.resolve(reqUrl, res.headers.location);
-
- var proto = url.parse(redirectUrl).protocol;
- proto = proto.substr(0, proto.length - 1);
- return module.exports[proto].get(redirectUrl, redirectCallback(reqUrl, redirect), redirect);
- };
- }
-
- return clientRequest;
- };
- }(h);
-
- // see https://github.com/joyent/node/blob/master/lib/http.js#L1623
- h.get = function(h) {
- return function(options, cb, redirectOptions) {
- var req = h.request(options, cb, redirectOptions);
- req.end();
- return req;
- };
- }(h);
-
- module.exports[protocol] = h;
-}
diff --git a/node_modules/docker-modem/lib/http_duplex.js b/node_modules/docker-modem/lib/http_duplex.js
deleted file mode 100644
index 2bc87af..0000000
--- a/node_modules/docker-modem/lib/http_duplex.js
+++ /dev/null
@@ -1,55 +0,0 @@
-module.exports = HttpDuplex;
-
-var util = require('util'),
- stream = require('readable-stream');
-
-util.inherits(HttpDuplex, stream.Duplex);
-
-function HttpDuplex(req, res, options) {
- var self = this;
-
- if (!(self instanceof HttpDuplex)) return new HttpDuplex(req, res, options);
-
- stream.Duplex.call(self, options);
- self._output = null;
-
- self.connect(req, res);
-}
-
-HttpDuplex.prototype.connect = function(req, res) {
- var self = this;
- self.req = req;
- self._output = res;
- self.emit('response', res);
-
- res.on('data', function(c) {
- if (!self.push(c)) self._output.pause();
- });
- res.on('end', function() {
- self.push(null);
- });
-};
-
-HttpDuplex.prototype._read = function(n) {
- if (this._output) this._output.resume();
-};
-
-HttpDuplex.prototype._write = function(chunk, encoding, cb) {
- this.req.write(chunk, encoding);
- cb();
-};
-
-HttpDuplex.prototype.end = function(chunk, encoding, cb) {
- this._output.socket.destroySoon();
- return this.req.end(chunk, encoding, cb);
-};
-
-HttpDuplex.prototype.destroy = function() {
- this.req.destroy();
- this._output.socket.destroy();
-};
-
-HttpDuplex.prototype.destroySoon = function() {
- this.req.destroy();
- this._output.socket.destroy();
-};
diff --git a/node_modules/docker-modem/lib/modem.js b/node_modules/docker-modem/lib/modem.js
deleted file mode 100644
index 6e60587..0000000
--- a/node_modules/docker-modem/lib/modem.js
+++ /dev/null
@@ -1,548 +0,0 @@
-var querystring = require('querystring'),
- http = require('./http'),
- fs = require('fs'),
- path = require('path'),
- url = require('url'),
- ssh = require('./ssh'),
- HttpDuplex = require('./http_duplex'),
- debug = require('debug')('modem'),
- utils = require('./utils'),
- util = require('util'),
- splitca = require('split-ca'),
- os = require('os'),
- isWin = os.type() === 'Windows_NT',
- stream = require('stream');
-
-var defaultOpts = function () {
- var host;
- var opts = {};
-
- if (!process.env.DOCKER_HOST) {
- // Windows socket path: //./pipe/docker_engine ( Windows 10 )
- // Linux & Darwin socket path is /var/run/docker.sock when running system-wide,
- // or $HOME/.docker/run/docker.sock in new Docker Desktop installs.
- opts.socketPath = isWin ? '//./pipe/docker_engine' : findDefaultUnixSocket;
- } else if (process.env.DOCKER_HOST.indexOf('unix://') === 0) {
- // Strip off unix://, fall back to default if unix:// was passed without a path
- opts.socketPath = process.env.DOCKER_HOST.substring(7) || findDefaultUnixSocket;
- } else if (process.env.DOCKER_HOST.indexOf('npipe://') === 0) {
- // Strip off npipe://, fall back to default of //./pipe/docker_engine if
- // npipe:// was passed without a path
- opts.socketPath = process.env.DOCKER_HOST.substring(8) || '//./pipe/docker_engine';
- } else {
- var hostStr = process.env.DOCKER_HOST;
- if (hostStr.indexOf('\/\/') < 0) {
- hostStr = 'tcp://' + hostStr;
- }
- try {
- host = new url.URL(hostStr);
- } catch (err) {
- throw new Error('DOCKER_HOST env variable should be something like tcp://localhost:1234');
- }
-
- opts.port = host.port;
-
- if (process.env.DOCKER_TLS_VERIFY === '1' || opts.port === '2376') {
- opts.protocol = 'https';
- } else if (host.protocol === 'ssh:') {
- opts.protocol = 'ssh';
- opts.username = host.username;
- opts.sshOptions = {
- agent: process.env.SSH_AUTH_SOCK,
- }
- } else {
- opts.protocol = 'http';
- }
-
- if (process.env.DOCKER_PATH_PREFIX) {
- opts.pathPrefix = process.env.DOCKER_PATH_PREFIX;
- }
- else {
- opts.pathPrefix = '/';
- }
-
- opts.host = host.hostname;
-
- if (process.env.DOCKER_CERT_PATH) {
- opts.ca = splitca(path.join(process.env.DOCKER_CERT_PATH, 'ca.pem'));
- opts.cert = fs.readFileSync(path.join(process.env.DOCKER_CERT_PATH, 'cert.pem'));
- opts.key = fs.readFileSync(path.join(process.env.DOCKER_CERT_PATH, 'key.pem'));
- }
-
- if (process.env.DOCKER_CLIENT_TIMEOUT) {
- opts.timeout = parseInt(process.env.DOCKER_CLIENT_TIMEOUT, 10);
- }
- }
-
- return opts;
-};
-
-var findDefaultUnixSocket = function () {
- return new Promise(function (resolve) {
- var userDockerSocket = path.join(os.homedir(), '.docker', 'run', 'docker.sock');
- fs.access(userDockerSocket, function (err) {
- if (err) resolve('/var/run/docker.sock');
- else resolve(userDockerSocket);
- })
- });
-}
-
-
-var Modem = function (options) {
- var optDefaults = defaultOpts();
- var opts = Object.assign({}, optDefaults, options);
-
- this.host = opts.host;
-
- if (!this.host) {
- this.socketPath = opts.socketPath;
- }
-
- this.port = opts.port;
- this.pathPrefix = opts.pathPrefix;
- this.username = opts.username;
- this.password = opts.password;
- this.version = opts.version;
- this.key = opts.key;
- this.cert = opts.cert;
- this.ca = opts.ca;
- this.timeout = opts.timeout;
- this.connectionTimeout = opts.connectionTimeout;
- this.checkServerIdentity = opts.checkServerIdentity;
- this.agent = opts.agent;
- this.headers = opts.headers || {};
- this.sshOptions = Object.assign({}, options ? options.sshOptions : {}, optDefaults.sshOptions);
- //retrocompabitlity
- if (this.sshOptions.agentForward === undefined) {
- this.sshOptions.agentForward = opts.agentForward;
- }
-
- if (this.key && this.cert && this.ca) {
- this.protocol = 'https';
- }
- this.protocol = opts.protocol || this.protocol || 'http';
-};
-
-Modem.prototype.dial = function (options, callback) {
- var opts, address, data;
-
- if (options.options) {
- opts = options.options;
- }
-
- // Prevent credentials from showing up in URL
- if (opts && opts.authconfig) {
- delete opts.authconfig;
- }
-
- // Prevent abortsignal from showing up in the URL
- if (opts && opts.abortSignal) {
- delete opts.abortSignal;
- }
-
- if (this.version) {
- options.path = '/' + this.version + options.path;
- }
-
- if (this.host) {
- var parsed = url.parse(this.host);
- address = url.format({
- protocol: parsed.protocol || this.protocol,
- hostname: parsed.hostname || this.host,
- port: this.port,
- pathname: parsed.pathname || this.pathPrefix,
- });
- address = url.resolve(address, options.path);
- } else {
- address = options.path;
- }
-
- if (options.path.indexOf('?') !== -1) {
- if (opts && Object.keys(opts).length > 0) {
- address += this.buildQuerystring(opts._query || opts);
- } else {
- address = address.substring(0, address.length - 1);
- }
- }
-
- var optionsf = {
- path: address,
- method: options.method,
- headers: options.headers || Object.assign({}, this.headers),
- key: this.key,
- cert: this.cert,
- ca: this.ca
- };
-
-
- if (this.checkServerIdentity) {
- optionsf.checkServerIdentity = this.checkServerIdentity;
- }
-
- if (this.agent) {
- optionsf.agent = this.agent;
- }
-
- if (options.authconfig) {
- optionsf.headers['X-Registry-Auth'] = options.authconfig.key || options.authconfig.base64 ||
- Buffer.from(JSON.stringify(options.authconfig)).toString('base64').replace(/\+/g, "-").replace(/\//g, "_");
- }
-
- if (options.registryconfig) {
- optionsf.headers['X-Registry-Config'] = options.registryconfig.base64 ||
- Buffer.from(JSON.stringify(options.registryconfig)).toString('base64');
- }
-
- if (options.abortSignal) {
- optionsf.signal = options.abortSignal;
- }
-
- if (options.file) {
- if (typeof options.file === 'string') {
- data = fs.createReadStream(path.resolve(options.file));
- } else {
- data = options.file;
- }
- optionsf.headers['Content-Type'] = 'application/tar';
- } else if (opts && options.method === 'POST') {
- data = JSON.stringify(opts._body || opts);
- if (options.allowEmpty) {
- optionsf.headers['Content-Type'] = 'application/json';
- } else {
- if (data !== '{}' && data !== '""') {
- optionsf.headers['Content-Type'] = 'application/json';
- } else {
- data = undefined;
- }
- }
- }
-
- if (typeof data === 'string') {
- optionsf.headers['Content-Length'] = Buffer.byteLength(data);
- } else if (Buffer.isBuffer(data) === true) {
- optionsf.headers['Content-Length'] = data.length;
- } else if (optionsf.method === 'PUT' || options.hijack || options.openStdin) {
- optionsf.headers['Transfer-Encoding'] = 'chunked';
- }
-
- if (options.hijack) {
- optionsf.headers.Connection = 'Upgrade';
- optionsf.headers.Upgrade = 'tcp';
- }
-
- if (this.socketPath) {
- // SocketPath may be a function that can return a promise:
- this.getSocketPath().then((socketPath) => {
- optionsf.socketPath = socketPath;
- this.buildRequest(optionsf, options, data, callback);
- });
- } else {
- var urlp = url.parse(address);
- optionsf.hostname = urlp.hostname;
- optionsf.port = urlp.port;
- optionsf.path = urlp.path;
-
- this.buildRequest(optionsf, options, data, callback);
- }
-};
-
-Modem.prototype.getSocketPath = function () {
- if (!this.socketPath) return;
- if (this.socketPathCache) return Promise.resolve(this.socketPathCache);
-
- var socketPathValue = typeof this.socketPath === 'function'
- ? this.socketPath() : this.socketPath;
-
- this.socketPathCache = socketPathValue;
-
- return Promise.resolve(socketPathValue);
-}
-
-Modem.prototype.buildRequest = function (options, context, data, callback) {
- var self = this;
- var connectionTimeoutTimer;
- var finished = false;
-
- var opts = self.protocol === 'ssh' ? Object.assign(options, {
- agent: ssh(Object.assign({}, self.sshOptions, {
- 'host': self.host,
- 'port': self.port,
- 'username': self.username,
- 'password': self.password,
- })),
- protocol: 'http:',
- }) : options;
-
- var req = http[self.protocol === 'ssh' ? 'http' : self.protocol].request(opts, function () { });
-
- debug('Sending: %s', util.inspect(options, {
- showHidden: true,
- depth: null
- }));
-
- if (self.connectionTimeout) {
- connectionTimeoutTimer = setTimeout(function () {
- debug('Connection Timeout of %s ms exceeded', self.connectionTimeout);
- req.abort();
- }, self.connectionTimeout);
- }
-
- if (self.timeout) {
- req.on('socket', function (socket) {
- socket.setTimeout(self.timeout);
- socket.on('timeout', function () {
- debug('Timeout of %s ms exceeded', self.timeout);
- req.abort();
- });
- });
- }
-
- if (context.hijack === true) {
- clearTimeout(connectionTimeoutTimer);
- req.on('upgrade', function (res, sock, head) {
- if (finished === false) {
- finished = true;
- return callback(null, sock);
- }
- });
- }
-
- req.on('connect', function () {
- clearTimeout(connectionTimeoutTimer);
- });
-
- req.on('disconnect', function () {
- clearTimeout(connectionTimeoutTimer);
- });
-
- req.on('response', function (res) {
- clearTimeout(connectionTimeoutTimer);
- if (context.isStream === true) {
- if (finished === false) {
- finished = true;
- self.buildPayload(null, context.isStream, context.statusCodes, context.openStdin, req, res, null, callback);
- }
- } else {
- // The native 'request' method only handles aborting during the request lifecycle not the response lifecycle.
- // We need to make the response stream abortable so that it's destroyed with an error on abort and then
- // it triggers the request 'error' event
- if (options.signal != null) {
- stream.addAbortSignal(options.signal, res)
- }
- var chunks = [];
- res.on('data', function (chunk) {
- chunks.push(chunk);
- });
-
- res.on('end', function () {
- var buffer = Buffer.concat(chunks);
- var result = buffer.toString();
-
- debug('Received: %s', result);
-
- var json = utils.parseJSON(result) || buffer;
- if (finished === false) {
- finished = true;
- self.buildPayload(null, context.isStream, context.statusCodes, false, req, res, json, callback);
- }
- });
- }
- });
-
- req.on('error', function (error) {
- clearTimeout(connectionTimeoutTimer);
- if (finished === false) {
- finished = true;
- self.buildPayload(error, context.isStream, context.statusCodes, false, {}, {}, null, callback);
- }
- });
-
- if (typeof data === 'string' || Buffer.isBuffer(data)) {
- req.write(data);
- } else if (data) {
- data.on('error', function (error) {
- req.destroy(error);
- });
- data.pipe(req);
- }
-
- if (!context.hijack && !context.openStdin && (typeof data === 'string' || data === undefined || Buffer.isBuffer(data))) {
- req.end();
- }
-};
-
-Modem.prototype.buildPayload = function (err, isStream, statusCodes, openStdin, req, res, json, cb) {
- if (err) return cb(err, null);
-
- if (statusCodes[res.statusCode] !== true) {
- getCause(isStream, res, json, function (err, cause) {
- if (err) {
- return cb(err, null);
- }
- var msg = new Error(
- '(HTTP code ' + res.statusCode + ') ' +
- (statusCodes[res.statusCode] || 'unexpected') + ' - ' +
- (cause.message || cause) + ' '
- );
- msg.reason = statusCodes[res.statusCode];
- msg.statusCode = res.statusCode;
- msg.json = json;
- cb(msg, null);
- });
- } else {
- if (openStdin) {
- cb(null, new HttpDuplex(req, res));
- } else if (isStream) {
- cb(null, res);
- } else {
- cb(null, json);
- }
- }
-
- function getCause(isStream, res, json, callback) {
- var chunks = '';
- var done = false;
-
- if (isStream) {
- res.on('data', function (chunk) {
- chunks += chunk;
- });
- res.on('error', function (err) {
- handler(err, null);
- });
- res.on('end', function () {
- handler(null, utils.parseJSON(chunks) || chunks)
- });
- } else {
- callback(null, json);
- }
-
- function handler(err, data) {
- if (done === false) {
- if (err) {
- callback(err);
- } else {
- callback(null, data);
- }
- }
- done = true;
- }
- }
-};
-
-Modem.prototype.demuxStream = function (streama, stdout, stderr) {
- var nextDataType = null;
- var nextDataLength = null;
- var buffer = Buffer.from('');
- function processData(data) {
- if (data) {
- buffer = Buffer.concat([buffer, data]);
- }
- if (!nextDataType) {
- if (buffer.length >= 8) {
- var header = bufferSlice(8);
- nextDataType = header.readUInt8(0);
- nextDataLength = header.readUInt32BE(4);
- // It's possible we got a "data" that contains multiple messages
- // Process the next one
- processData();
- }
- } else {
- if (buffer.length >= nextDataLength) {
- var content = bufferSlice(nextDataLength);
- if (nextDataType === 1) {
- stdout.write(content);
- } else {
- stderr.write(content);
- }
- nextDataType = null;
- // It's possible we got a "data" that contains multiple messages
- // Process the next one
- processData();
- }
- }
- }
-
- function bufferSlice(end) {
- var out = buffer.subarray(0, end);
- buffer = Buffer.from(buffer.subarray(end, buffer.length));
- return out;
- }
-
- streama.on('data', processData);
-};
-
-Modem.prototype.followProgress = function (streama, onFinished, onProgress) {
- var buf = '';
- var output = [];
- var finished = false;
-
- streama.on('data', onStreamEvent);
- streama.on('error', onStreamError);
- streama.on('end', onStreamEnd);
- streama.on('close', onStreamEnd);
-
- function onStreamEvent(data) {
- buf += data.toString();
- pump();
-
- function pump() {
- var pos;
- while ((pos = buf.indexOf('\n')) >= 0) {
- if (pos == 0) {
- buf = buf.slice(1);
- continue;
- }
- processLine(buf.slice(0, pos));
- buf = buf.slice(pos + 1);
- }
- }
-
- function processLine(line) {
- if (line[line.length - 1] == '\r') line = line.substr(0, line.length - 1);
- if (line.length > 0) {
- var obj = JSON.parse(line);
- output.push(obj);
- if (onProgress) {
- onProgress(obj);
- }
- }
- }
- };
-
- function onStreamError(err) {
- finished = true;
- streama.removeListener('data', onStreamEvent);
- streama.removeListener('error', onStreamError);
- streama.removeListener('end', onStreamEnd);
- streama.removeListener('close', onStreamEnd);
- onFinished(err, output);
- }
-
- function onStreamEnd() {
- if (!finished) onFinished(null, output);
- finished = true;
- }
-};
-
-Modem.prototype.buildQuerystring = function (opts) {
- var clone = {};
-
- // serialize map and array values as JSON strings, else querystring truncates.
- // 't' and 'extrahosts' can be arrays but need special treatment so that they're
- // passed as multiple qs parameters instead of JSON values.
- Object.keys(opts).map(function (key, i) {
- if (opts[key]
- && typeof opts[key] === 'object'
- && !['t', 'extrahosts'].includes(key)
- ) {
- clone[key] = JSON.stringify(opts[key]);
- } else {
- clone[key] = opts[key];
- }
- });
-
- return querystring.stringify(clone);
-};
-
-module.exports = Modem;
diff --git a/node_modules/docker-modem/lib/ssh.js b/node_modules/docker-modem/lib/ssh.js
deleted file mode 100644
index 2d44564..0000000
--- a/node_modules/docker-modem/lib/ssh.js
+++ /dev/null
@@ -1,44 +0,0 @@
-var Client = require('ssh2').Client,
- http = require('http');
-
-module.exports = function (opt) {
- var conn = new Client();
- var agent = new http.Agent();
-
- agent.createConnection = function (options, fn) {
- try {
- conn.once('ready', function () {
- conn.exec('docker system dial-stdio', function (err, stream) {
- if (err) {
- handleError(err);
- }
-
- fn(null, stream);
-
- stream.addListener('error', (err) => {
- handleError(err);
- });
- stream.once('close', () => {
- conn.end();
- agent.destroy();
- });
- });
- }).on('error', (err) => {
- handleError(err);
- })
- .connect(opt);
- conn.once('end', () => agent.destroy());
-
- } catch (err) {
- handleError(err);
- }
- };
-
- function handleError(err) {
- conn.end();
- agent.destroy();
- throw err;
- }
-
- return agent;
-};
diff --git a/node_modules/docker-modem/lib/utils.js b/node_modules/docker-modem/lib/utils.js
deleted file mode 100644
index 92bd5eb..0000000
--- a/node_modules/docker-modem/lib/utils.js
+++ /dev/null
@@ -1,24 +0,0 @@
-// https://github.com/HenrikJoreteg/extend-object/blob/v0.1.0/extend-object.js
-
-var arr = [];
-var each = arr.forEach;
-var slice = arr.slice;
-
-module.exports.extend = function(obj) {
- each.call(slice.call(arguments, 1), function(source) {
- if (source) {
- for (var prop in source) {
- obj[prop] = source[prop];
- }
- }
- });
- return obj;
-};
-
-module.exports.parseJSON = function(s) {
- try {
- return JSON.parse(s);
- } catch (e) {
- return null;
- }
-};
diff --git a/node_modules/docker-modem/package.json b/node_modules/docker-modem/package.json
deleted file mode 100644
index 31f5540..0000000
--- a/node_modules/docker-modem/package.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "name": "docker-modem",
- "description": "Docker remote API network layer module.",
- "version": "5.0.3",
- "author": "Pedro Dias ",
- "maintainers": [
- "apocas "
- ],
- "license": "Apache-2.0",
- "repository": {
- "type": "git",
- "url": "http://github.com/apocas/docker-modem.git"
- },
- "keywords": [
- "containers",
- "api",
- "docker"
- ],
- "dependencies": {
- "debug": "^4.1.1",
- "readable-stream": "^3.5.0",
- "split-ca": "^1.0.1",
- "ssh2": "^1.15.0"
- },
- "devDependencies": {
- "chai": "~4.2.0",
- "mocha": "^10.2.0"
- },
- "main": "./lib/modem",
- "scripts": {
- "test": "./node_modules/mocha/bin/mocha.js -R spec --exit"
- },
- "engines": {
- "node": ">= 8.0"
- }
-}
diff --git a/node_modules/docker-modem/test/modem_test.js b/node_modules/docker-modem/test/modem_test.js
deleted file mode 100644
index 2b1bef4..0000000
--- a/node_modules/docker-modem/test/modem_test.js
+++ /dev/null
@@ -1,229 +0,0 @@
-var assert = require('assert');
-var path = require('path');
-var os = require('os');
-var http = require('http');
-var Modem = require('../lib/modem');
-
-var unixDefaultSocketPaths = ['/var/run/docker.sock', path.join(os.homedir(), '.docker/run/docker.sock')]
-var defaultSocketPaths = os.type() === 'Windows_NT' ? ['//./pipe/docker_engine'] : unixDefaultSocketPaths;
-
-describe('Modem', function () {
- beforeEach(function () {
- delete process.env.DOCKER_HOST;
- });
-
- it('should default to default socket path', function () {
- var modem = new Modem();
-
- return modem.getSocketPath().then((socketPath) => {
- assert.ok(socketPath);
- assert.ok(defaultSocketPaths.includes(socketPath));
- });
- });
-
- it('should use specific cert, key and ca', function () {
- var ca = 'caaaaa';
- var cert = 'certtttt';
- var key = 'keyyyyy';
- var modem = new Modem({
- version: 'v1.39',
- host: '127.0.0.1',
- port: 2376,
- ca,
- cert,
- key
- });
-
- assert.strictEqual(ca, modem.ca);
- assert.strictEqual(cert, modem.cert);
- assert.strictEqual(key, modem.key);
- });
-
- it('shouldn\'t default to default socket path', function () {
- var modem = new Modem({
- protocol: 'http',
- host: '127.0.0.1',
- port: 2375
- });
- assert.ok(modem.host);
- assert.strictEqual(modem.socketPath, undefined);
- });
-
- it('should use default value if argument not defined in constructor parameter object', function () {
- var customHeaders = {
- host: 'my-custom-host'
- };
- var modem = new Modem({
- headers: customHeaders
- });
- assert.ok(modem.headers);
- assert.strictEqual(modem.headers, customHeaders);
-
- return modem.getSocketPath().then((socketPath) => {
- assert.ok(socketPath);
- assert.ok(defaultSocketPaths.includes(socketPath));
- });
- });
-
- it('should allow DOCKER_HOST=unix:///path/to/docker.sock', function () {
- process.env.DOCKER_HOST = 'unix:///tmp/docker.sock';
-
- var modem = new Modem();
- assert.ok(modem.socketPath);
- assert.strictEqual(modem.socketPath, '/tmp/docker.sock');
- });
-
- it('should interpret DOCKER_HOST=unix:// as /var/run/docker.sock', function () {
- process.env.DOCKER_HOST = 'unix://';
-
- var modem = new Modem();
- return modem.getSocketPath().then((socketPath) => {
- assert.ok(socketPath);
- assert.ok(unixDefaultSocketPaths.includes(socketPath));
- });
- });
-
- it('should use custom socketPath function once', function () {
- var count = 0;
- var modem = new Modem();
- modem.socketPath = function() {
- assert(++count === 1);
- return 'testpath';
- }
- modem.getSocketPath().then((socketPath) => {
- assert.ok(socketPath);
- assert.ok('testpath');
- });
- return modem.getSocketPath().then((socketPath) => {
- assert.ok(socketPath);
- assert.ok('testpath');
- });
- });
-
- it('should interpret DOCKER_HOST=tcp://N.N.N.N:2376 as https', function () {
- process.env.DOCKER_HOST = 'tcp://192.168.59.103:2376';
-
- var modem = new Modem();
- assert.ok(modem.host);
- assert.ok(modem.port);
- assert.ok(modem.protocol);
- assert.strictEqual(modem.host, '192.168.59.103');
- assert.strictEqual(modem.port, '2376');
- assert.strictEqual(modem.protocol, 'https');
- });
-
- it('should interpret DOCKER_HOST=tcp://[::1]:12345', function () {
- process.env.DOCKER_HOST = 'tcp://[::1]:12345';
-
- var modem = new Modem();
- assert.ok(modem.host);
- assert.ok(modem.port);
- assert.ok(modem.protocol);
- assert.strictEqual(modem.host, '[::1]');
- assert.strictEqual(modem.port, '12345');
- assert.strictEqual(modem.protocol, 'http');
- });
-
- it('should interpret DOCKER_HOST=tcp://N.N.N.N:5555 as http', function () {
- delete process.env.DOCKER_TLS_VERIFY;
- process.env.DOCKER_HOST = 'tcp://192.168.59.105:5555';
-
- var modem = new Modem();
- assert.ok(modem.host);
- assert.ok(modem.port);
- assert.ok(modem.protocol);
- assert.strictEqual(modem.host, '192.168.59.105');
- assert.strictEqual(modem.port, '5555');
- assert.strictEqual(modem.protocol, 'http');
- });
-
- it('should interpret DOCKER_HOST=tcp://N.N.N.N:5555 as http', function () {
- process.env.DOCKER_TLS_VERIFY = '1';
- process.env.DOCKER_HOST = 'tcp://192.168.59.105:5555';
-
- var modem = new Modem();
- assert.ok(modem.host);
- assert.ok(modem.port);
- assert.ok(modem.protocol);
- assert.strictEqual(modem.host, '192.168.59.105');
- assert.strictEqual(modem.port, '5555');
- assert.strictEqual(modem.protocol, 'https');
- });
-
- it('should accept DOCKER_HOST=N.N.N.N:5555 as http', function () {
- delete process.env.DOCKER_TLS_VERIFY;
- process.env.DOCKER_HOST = '192.168.59.105:5555';
-
- var modem = new Modem();
- assert.ok(modem.host);
- assert.ok(modem.port);
- assert.ok(modem.protocol);
- assert.strictEqual(modem.host, '192.168.59.105');
- assert.strictEqual(modem.port, '5555');
- assert.strictEqual(modem.protocol, 'http');
- });
-
- it('should auto encode querystring option maps as JSON', function () {
- var modem = new Modem();
-
- var opts = {
- "limit": 12,
- "filters": {
- "label": ["staging", "env=green"]
- },
- "t": ["repo:latest", "repo:1.0.0"]
- };
- var control = 'limit=12&filters={"label"%3A["staging"%2C"env%3Dgreen"]}&t=repo%3Alatest&t=repo%3A1.0.0';
- var qs = modem.buildQuerystring(opts);
- assert.strictEqual(decodeURI(qs), control);
- });
-
- it('should parse DOCKER_CLIENT_TIMEOUT from environment', function () {
- process.env.DOCKER_HOST = '192.168.59.105:5555';
- process.env.DOCKER_CLIENT_TIMEOUT = 3000;
-
- var modem = new Modem();
- assert.strictEqual(modem.timeout, 3000);
- });
-
- it('should use default http agent when no agent is specified', function () {
- var modem = new Modem();
- assert.strictEqual(typeof modem.agent, 'undefined');
- });
-
- it('should use custom http agent', function () {
- var httpAgent = new http.Agent({
- keepAlive: true
- });
- var modem = new Modem({
- agent: httpAgent
- });
- assert.ok(modem.agent instanceof http.Agent);
- assert.strictEqual(modem.agent, httpAgent);
- });
-
- it('should set default ssh agent options from DOCKER_HOST', function() {
- process.env.DOCKER_HOST = 'ssh://user@192.168.59.105:5555';
- process.env.SSH_AUTH_SOCK = '/var/lib/sock';
-
- var modem = new Modem();
- assert.strictEqual(modem.protocol, 'ssh');
- assert.strictEqual(modem.username, 'user');
- assert.ok(modem.sshOptions);
- assert.strictEqual(modem.sshOptions.agent, '/var/lib/sock');
- });
-
- it('should combine custom ssh agent options', function() {
- process.env.DOCKER_HOST = 'ssh://user@192.168.59.105:5555';
- process.env.SSH_AUTH_SOCK = '/var/lib/sock';
-
- var modem = new Modem({
- sshOptions: {
- foo: 'bar', // options are arbitrary, whatever ssh2 supports
- },
- });
- assert.ok(modem.sshOptions);
- assert.strictEqual(modem.sshOptions.agent, '/var/lib/sock');
- assert.strictEqual(modem.sshOptions.foo, 'bar');
- });
-});
diff --git a/node_modules/dockerode/.eslintignore b/node_modules/dockerode/.eslintignore
deleted file mode 100644
index 469500d..0000000
--- a/node_modules/dockerode/.eslintignore
+++ /dev/null
@@ -1,2 +0,0 @@
-# 3rd-party files
-node_modules
diff --git a/node_modules/dockerode/.eslintrc b/node_modules/dockerode/.eslintrc
deleted file mode 100644
index 29deb6d..0000000
--- a/node_modules/dockerode/.eslintrc
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "env": {
- "mocha": true,
- "node": true
- },
- "rules": {
- /* Possible Errors */
- "no-extra-parens": 2,
- "valid-jsdoc": 2,
- /* Best Practices */
- "block-scoped-var": 2,
- "complexity": [1, 3],
- "default-case": 2,
- "dot-notation": [2],
- "guard-for-in": 2,
- "no-div-regex": 2,
- "no-else-return": 2,
- "no-eq-null": 2,
- "no-floating-decimal": 2,
- "no-process-env": 2,
- "no-self-compare": 2,
- "no-void": 2,
- "no-warning-comments": 2,
- "radix": 2,
- "vars-on-top": 2,
- "wrap-iife": 2,
- /* Variables */
- "no-catch-shadow": 2,
- /* Node.JS */
- "no-sync": 2,
- /* Stylistic Issues */
- "no-mixed-spaces-and-tabs": 2,
- "no-underscore-dangle": 2,
- "quotes": [1, "single", "avoid-escape"]
- }}
diff --git a/node_modules/dockerode/.github/stale.yml b/node_modules/dockerode/.github/stale.yml
deleted file mode 100644
index b86e920..0000000
--- a/node_modules/dockerode/.github/stale.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-# Number of days of inactivity before an issue becomes stale
-daysUntilStale: 550
-# Number of days of inactivity before a stale issue is closed
-daysUntilClose: 7
-# Issues with these labels will never be considered stale
-exemptLabels:
- - question
- - bug
- - enhancement
- - "needs love"
- - "needs inspection"
-
-# Label to use when marking an issue as stale
-staleLabel: stale
-# Comment to post when marking an issue as stale. Set to `false` to disable
-markComment: >
- This issue has been automatically marked as stale because it has not had
- recent activity. It will be closed if no further activity occurs. Open a new issue if needed.
-# Comment to post when closing a stale issue. Set to `false` to disable
-closeComment: false
\ No newline at end of file
diff --git a/node_modules/dockerode/.travis.yml b/node_modules/dockerode/.travis.yml
deleted file mode 100644
index 4e7598d..0000000
--- a/node_modules/dockerode/.travis.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-sudo: required
-
-language: node_js
-
-node_js:
- - "8"
-
-before_script:
- - docker pull ubuntu
-
-services:
- - docker
-
-before_install:
- - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- - sudo apt-get update
- - sudo apt-get -y install docker-ce
-
-install:
- - npm install
-
-script:
- - npm test
diff --git a/node_modules/dockerode/LICENSE b/node_modules/dockerode/LICENSE
deleted file mode 100644
index 8dada3e..0000000
--- a/node_modules/dockerode/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "{}"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright {yyyy} {name of copyright owner}
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/node_modules/dockerode/README.md b/node_modules/dockerode/README.md
deleted file mode 100644
index 8ba70ed..0000000
--- a/node_modules/dockerode/README.md
+++ /dev/null
@@ -1,528 +0,0 @@
-# dockerode
-
-Not another Node.js Docker Remote API module.
-
-`dockerode` objectives:
-
-* **streams** - `dockerode` does NOT break any stream, it passes them to you allowing for some stream voodoo.
-* **stream demux** - Supports optional [stream demultiplexing](https://github.com/apocas/dockerode#helper-functions).
-* **entities** - containers, images and execs are defined entities and not random static methods.
-* **run** - `dockerode` allow you to seamless run commands in a container ala `docker run`.
-* **tests** - `dockerode` really aims to have a good test set, allowing to follow `Docker` changes easily, quickly and painlessly.
-* **feature-rich** - There's a real effort in keeping **All** `Docker` Remote API features implemented and tested.
-* **interfaces** - Features **callback** and **promise** based interfaces, making everyone happy :)
-
-## Ecosystem
-
- * docker-modem [https://github.com/apocas/docker-modem](https://github.com/apocas/docker-modem) - Docker's API network stack
- * dockerode-compose [https://github.com/apocas/dockerode-compose](https://github.com/apocas/dockerode-compose) - docker-compose in Node.js
-
-## Installation
-
-`npm install dockerode`
-
-## Usage
-
- * Input options are directly passed to Docker. Check [Docker API documentation](https://docs.docker.com/engine/api/latest/) for more details.
- * Return values are unchanged from Docker, official Docker documentation will also apply to them.
- * Check the tests and examples folder for more examples.
-
-### Getting started
-
-To use `dockerode` first you need to instantiate it:
-
-``` js
-var Docker = require('dockerode');
-var docker = new Docker({socketPath: '/var/run/docker.sock'});
-var docker1 = new Docker(); //defaults to above if env variables are not used
-var docker2 = new Docker({host: 'http://192.168.1.10', port: 3000});
-var docker3 = new Docker({protocol:'http', host: '127.0.0.1', port: 3000});
-var docker4 = new Docker({host: '127.0.0.1', port: 3000}); //defaults to http
-
-//protocol http vs https is automatically detected
-var docker5 = new Docker({
- host: '192.168.1.10',
- port: process.env.DOCKER_PORT || 2375,
- ca: fs.readFileSync('ca.pem'),
- cert: fs.readFileSync('cert.pem'),
- key: fs.readFileSync('key.pem'),
- version: 'v1.25' // required when Docker >= v1.13, https://docs.docker.com/engine/api/version-history/
-});
-
-var docker6 = new Docker({
- protocol: 'https', //you can enforce a protocol
- host: '192.168.1.10',
- port: process.env.DOCKER_PORT || 2375,
- ca: fs.readFileSync('ca.pem'),
- cert: fs.readFileSync('cert.pem'),
- key: fs.readFileSync('key.pem')
-});
-
-//using a different promise library (default is the native one)
-var docker7 = new Docker({
- Promise: require('bluebird')
- //...
-});
-//...
-```
-
-### Manipulating a container:
-
-``` js
-// create a container entity. does not query API
-var container = docker.getContainer('71501a8ab0f8');
-
-// query API for container info
-container.inspect(function (err, data) {
- console.log(data);
-});
-
-container.start(function (err, data) {
- console.log(data);
-});
-
-container.remove(function (err, data) {
- console.log(data);
-});
-
-// promises are supported
-var auxContainer;
-docker.createContainer({
- Image: 'ubuntu',
- AttachStdin: false,
- AttachStdout: true,
- AttachStderr: true,
- Tty: true,
- Cmd: ['/bin/bash', '-c', 'tail -f /var/log/dmesg'],
- OpenStdin: false,
- StdinOnce: false
-}).then(function(container) {
- auxContainer = container;
- return auxContainer.start();
-}).then(function(data) {
- return auxContainer.resize({
- h: process.stdout.rows,
- w: process.stdout.columns
- });
-}).then(function(data) {
- return auxContainer.stop();
-}).then(function(data) {
- return auxContainer.remove();
-}).then(function(data) {
- console.log('container removed');
-}).catch(function(err) {
- console.log(err);
-});
-```
-
-You may also specify default options for each container's operations, which will always be used for the specified container and operation.
-
-``` js
-container.defaultOptions.start.Binds = ["/tmp:/tmp:rw"];
-```
-
-### Stopping all containers on a host
-
-``` js
-docker.listContainers(function (err, containers) {
- containers.forEach(function (containerInfo) {
- docker.getContainer(containerInfo.Id).stop(cb);
- });
-});
-```
-
-### Building an Image
-Context: provides the path to the Dockerfile. Additionaly files that are involved in the build *must* be explicitly mentioned in src array, since they are sent to a temp env to build. Example: file for COPY command are extracted from that temporary environment.
-
-``` js
-docker.buildImage('archive.tar', {t: imageName}, function (err, response){
- //...
-});
-
-docker.buildImage({
- context: __dirname,
- src: ['Dockerfile', 'file1', 'file2']
-}, {t: imageName}, function (err, response) {
- //...
-});
-```
-
-`buildImage` returns a Promise of NodeJS stream. In case you want to find out when the build has finished, you must follow the progress of the build with the `modem` instance in dockerode:
-
-``` js
-let dockerode = new Dockerode();
-let stream = await dockerode.buildImage(...);
-await new Promise((resolve, reject) => {
- dockerode.modem.followProgress(stream, (err, res) => err ? reject(err) : resolve(res));
-});
-// Build has finished
-```
-
-
-### Creating a container:
-
-``` js
-docker.createContainer({Image: 'ubuntu', Cmd: ['/bin/bash'], name: 'ubuntu-test'}, function (err, container) {
- container.start(function (err, data) {
- //...
- });
-});
-//...
-```
-
-### Streams goodness:
-
-``` js
-//tty:true
-docker.createContainer({ /*...*/ Tty: true /*...*/ }, function(err, container) {
-
- /* ... */
-
- container.attach({stream: true, stdout: true, stderr: true}, function (err, stream) {
- stream.pipe(process.stdout);
- });
-
- /* ... */
-});
-
-//tty:false
-docker.createContainer({ /*...*/ Tty: false /*...*/ }, function(err, container) {
-
- /* ... */
-
- container.attach({stream: true, stdout: true, stderr: true}, function (err, stream) {
- //dockerode may demultiplex attach streams for you :)
- container.modem.demuxStream(stream, process.stdout, process.stderr);
- });
-
- /* ... */
-});
-
-docker.createImage({fromImage: 'ubuntu'}, function (err, stream) {
- stream.pipe(process.stdout);
-});
-
-//...
-```
-
-There is also support for [HTTP connection hijacking](https://docs.docker.com/engine/api/v1.22/#32-hijacking),
-which allows for cleaner interactions with commands that work with stdin and stdout separately.
-
-```js
-docker.createContainer({Tty: false, /*... other options */}, function(err, container) {
- container.start(function(err) {
- container.exec({Cmd: ['shasum', '-'], AttachStdin: true, AttachStdout: true}, function(err, exec) {
- exec.start({hijack: true, stdin: true}, function(err, stream) {
- // shasum can't finish until after its stdin has been closed, telling it that it has
- // read all the bytes it needs to sum. Without a socket upgrade, there is no way to
- // close the write-side of the stream without also closing the read-side!
- fs.createReadStream('node-v5.1.0.tgz', 'binary').pipe(stream);
-
- // Fortunately, we have a regular TCP socket now, so when the readstream finishes and closes our
- // stream, it is still open for reading and we will still get our results :-)
- docker.modem.demuxStream(stream, process.stdout, process.stderr);
- });
- });
- });
-});
-```
-
-### Equivalent of `docker run` in `dockerode`:
-
-* `image` - container image
-* `cmd` - command to be executed
-* `stream` - stream(s) which will be used for execution output.
-* `create_options` - (optional) Options used for container creation. Refer to the [DockerEngine ContainerCreate documentation](https://docs.docker.com/engine/api/v1.37/#operation/ContainerCreate) for the possible values
-* `start_options` - (optional) Options used for container start. Refer to the [DockerEngine ContainerStart documentation](https://docs.docker.com/engine/api/v1.37/#operation/ContainerStart) for the possible values
-* `callback` - callback called when execution ends (optional, promise will be returned if not used).
-
-``` js
-//callback
-docker.run('ubuntu', ['bash', '-c', 'uname -a'], process.stdout, function (err, data, container) {
- console.log(data.StatusCode);
-});
-
-//promise
-docker.run(testImage, ['bash', '-c', 'uname -a'], process.stdout).then(function(data) {
- var output = data[0];
- var container = data[1];
- console.log(output.StatusCode);
- return container.remove();
-}).then(function(data) {
- console.log('container removed');
-}).catch(function(err) {
- console.log(err);
-});
-```
-
-or, if you want to split stdout and stderr (you must to pass `Tty:false` as an option for this to work)
-
-``` js
-docker.run('ubuntu', ['bash', '-c', 'uname -a'], [process.stdout, process.stderr], {Tty:false}, function (err, data, container) {
- console.log(data.StatusCode);
-});
-```
-
-If you provide a callback, `run` will return an EventEmitter supporting the following events: container, stream, data.
-If a callback isn't provided a promise will be returned.
-
-``` js
-docker.run('ubuntu', ['bash', '-c', 'uname -a'], [process.stdout, process.stderr], {Tty:false}, function (err, data, container) {
- //...
-}).on('container', function (container) {
- //...
-});
-```
-
-And here is one more complex example using auto-remove and Docker network.
-
-``` js
-docker.run('some-python-image', ['python', 'main.py', arg], process.stdout, {name: 'my-python-container', HostConfig: { AutoRemove: true, NetworkMode: 'my_network'}}, function(err, data, container) {
- // Do stuff
-});
-```
-
-### Equivalent of `docker pull` in `dockerode`:
-
-* `repoTag` - container image name (optionally with tag)
- `myrepo/myname:withtag`
-* `options` - extra options passed to create image.
-* `callback` - callback called when execution ends.
-
-``` js
-docker.pull('myrepo/myname:tag', function (err, stream) {
- // streaming output from pull...
-});
-```
-
-#### Pull from private repos
-
-`docker-modem` already base64 encodes the necessary auth object for you.
-
-``` js
-var auth = {
- username: 'username',
- password: 'password',
- auth: '',
- email: 'your@email.email',
- serveraddress: 'https://index.docker.io/v1'
-};
-
-docker.pull('tag', {'authconfig': auth}, function (err, stream) {
- //...
-});
-```
-
-If you already have a base64 encoded auth object, you can use it directly:
-
-```js
-var auth = { key: 'yJ1J2ZXJhZGRyZXNzIjoitZSI6Im4OCIsImF1dGgiOiIiLCJlbWFpbCI6ImZvbGllLmFkcmc2VybmF0iLCJzZX5jb2aHR0cHM6Ly9pbmRleC5kb2NrZXIuaW8vdZvbGllYSIsInBhc3N3b3JkIjoiRGVjZW1icmUjEvIn0=' }
-```
-
-
-## Helper functions
-
-* `followProgress` - allows to fire a callback only in the end of a stream based process. (build, pull, ...)
-
-``` js
-//followProgress(stream, onFinished, [onProgress])
-docker.pull(repoTag, function(err, stream) {
- //...
- docker.modem.followProgress(stream, onFinished, onProgress);
-
- function onFinished(err, output) {
- //output is an array with output json parsed objects
- //...
- }
- function onProgress(event) {
- //...
- }
-});
-```
-
-* `demuxStream` - demux stdout and stderr
-
-``` js
-//demuxStream(stream, stdout, stderr)
-container.attach({
- stream: true,
- stdout: true,
- stderr: true
-}, function handler(err, stream) {
- //...
- container.modem.demuxStream(stream, process.stdout, process.stderr);
- //...
-});
-```
-
-## Sponsors
-
-Amazing entities that [sponsor](https://github.com/sponsors/apocas) my open-source work. Check them out!
-
-[](https://github.com/httptoolkit)
-
-## Documentation
-
-### Docker
-
-- docker.createContainer(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerCreate)
-- docker.createImage([auth], options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageCreate)
-- docker.loadImage(file, options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageLoad)
-- docker.importImage(file, options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageCreate)
-- docker.buildImage(file, options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageBuild)
-- docker.checkAuth(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SystemAuth)
-- docker.getContainer(id) - Returns a Container object.
-- docker.getImage(name) - Returns an Image object.
-- docker.getVolume(name) - Returns a Volume object.
-- docker.getPlugin(name) - Returns a Plugin object.
-- docker.getService(id) - Returns a Service object.
-- docker.getTask(id) - Returns a Task object.
-- docker.getNode(id) - Returns a Node object.
-- docker.getNetwork(id) - Returns a Network object.
-- docker.getSecret(id) - Returns a Secret object.
-- docker.getConfig(id) - Returns a Config object.
-- docker.getExec(id) - Returns a Exec object.
-- docker.listContainers(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerList)
-- docker.listImages(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageList)
-- docker.listServices(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ServiceList)
-- docker.listNodes(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/NodeList)
-- docker.listTasks(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/TaskList)
-- docker.listSecrets(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SecretList)
-- docker.listConfigs(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ConfigList)
-- docker.listPlugins(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/PluginList)
-- docker.listVolumes(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/VolumeList)
-- docker.listNetworks(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/NetworkList)
-- docker.createSecret(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SecretCreate)
-- docker.createConfig(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ConfigCreate)
-- docker.createPlugin(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/PluginCreate)
-- docker.createVolume(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/VolumeCreate)
-- docker.createService(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ServiceCreate)
-- docker.createNetwork(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/NetworkCreate)
-- docker.pruneImages(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImagePrune)
-- docker.pruneBuilder() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/BuildPrune)
-- docker.pruneContainers(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerPrune)
-- docker.pruneVolumes(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/VolumePrune)
-- docker.pruneNetworks(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/NetworkPrune)
-- docker.searchImages(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageSearch)
-- docker.info() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SystemInfo)
-- docker.version() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SystemVersion)
-- docker.ping() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SystemPing)
-- docker.df() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SystemDataUsage)
-- docker.getEvents(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SystemEvents)
-- docker.swarmInit(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SwarmInit)
-- docker.swarmJoin(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SwarmJoin)
-- docker.swarmLeave(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SwarmLeave)
-- docker.swarmUpdate(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SwarmUpdate)
-- docker.swarmInspect() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SwarmInspect)
-- docker.pull(repoTag, options, callback, auth) - Like Docker's CLI pull
-- docker.run(image, cmd, stream, createOptions, startOptions) - Like Docker's CLI run
-
-
-### Container
-
-- container.inspect(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerInspect)
-- container.rename(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerRename)
-- container.update(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerUpdate)
-- container.top(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerTop)
-- container.changes() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerChanges)
-- container.export() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerExport)
-- container.start(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerStart)
-- container.stop(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerStop)
-- container.pause(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerPause)
-- container.unpause(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerUnpause)
-- container.exec(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerExec)
-- container.commit(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageCommit)
-- container.restart(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerRestart)
-- container.kill(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerKill)
-- container.resize(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerResize)
-- container.attach(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerAttach)
-- container.wait(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerWait)
-- container.remove(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerDelete)
-- container.getArchive(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerArchive)
-- container.infoArchive(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerArchiveInfo)
-- container.putArchive(file, options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/PutContainerArchive)
-- container.logs(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerLogs)
-- container.stats(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ContainerStats)
-
-### Exec
-
-- exec.start(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ExecStart)
-- exec.resize(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ExecResize)
-- exec.inspect() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ExecInspect)
-
-### Image
-
-- image.inspect() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageInspect)
-- image.history() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageHistory)
-- image.push(options, callback, auth) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImagePush)
-- image.tag(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageTag)
-- image.remove(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageDelete)
-- image.get() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ImageGet)
-
-### Network
-
-- network.inspect() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/NetworkInspect)
-- network.remove(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/NetworkDelete)
-- network.connect(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/NetworkConnect)
-- network.disconnect(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/NetworkDisconnect)
-
-### Node
-
-- node.inspect() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/NodeInspect)
-- node.remove(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/NodeDelete)
-- node.update(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/NodeUpdate)
-
-### Plugin
-
-- plugin.privileges() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/GetPluginPrivileges)
-- plugin.pull(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/PluginPull)
-- plugin.inspect() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/PluginInspect)
-- plugin.remove(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/PluginDelete)
-- plugin.enable(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/PluginEnable)
-- plugin.disable(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/PluginDisable)
-- plugin.update([auth], options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/PluginUpgrade)
-- plugin.push(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/PluginPush)
-- plugin.configure(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/PluginSet)
-
-### Secret
-
-- secret.inspect() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SecretInspect)
-- secret.remove() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SecretDelete)
-- secret.update(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/SecretUpdate)
-
-### Service
-
-- service.inspect() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ServiceInspect)
-- service.remove(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ServiceDelete)
-- service.update(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ServiceUpdate)
-- service.logs(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/ServiceLogs)
-
-### Task
-
-- task.inspect() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/TaskInspect)
-- task.logs(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/Session)
-
-### Volume
-
-- volume.inspect() - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/VolumeInspect)
-- volume.remove(options) - [Docker API Endpoint](https://docs.docker.com/engine/api/v1.37/#operation/VolumeDelete)
-
-
-## Tests
-
- * `docker pull ubuntu:latest` to prepare your system for the tests.
- * Tests are implemented using `mocha` and `chai`. Run them with `npm test`.
-
-## Examples
-
-Check the examples folder for more specific use cases examples.
-
-## License
-
-Pedro Dias - [@pedromdias](https://twitter.com/pedromdias)
-
-Licensed under the Apache license, version 2.0 (the "license"); You may not use this file except in compliance with the license. You may obtain a copy of the license at:
-
- http://www.apache.org/licenses/LICENSE-2.0.html
-
-Unless required by applicable law or agreed to in writing, software distributed under the license is distributed on an "as is" basis, without warranties or conditions of any kind, either express or implied. See the license for the specific language governing permissions and limitations under the license.
diff --git a/node_modules/dockerode/lib/config.js b/node_modules/dockerode/lib/config.js
deleted file mode 100644
index 8e31711..0000000
--- a/node_modules/dockerode/lib/config.js
+++ /dev/null
@@ -1,135 +0,0 @@
-var util = require('./util');
-
-/**
- * Represents a config
- * @param {Object} modem docker-modem
- * @param {String} id Config's id
- */
-var Config = function(modem, id) {
- this.modem = modem;
- this.id = id;
-};
-
-Config.prototype[require('util').inspect.custom] = function() { return this; };
-
-/**
- * Inspect
- *
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback, if specified Docker will be queried.
- * @return {Object} Name only if callback isn't specified.
- */
-Config.prototype.inspect = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/configs/' + this.id,
- method: 'GET',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 404: 'config not found',
- 500: 'server error',
- 503: 'node is not part of a swarm'
- }
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Update a config.
- *
- * @param {object} opts
- * @param {function} callback
- */
-Config.prototype.update = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/configs/' + this.id + '/update?',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 404: 'config not found',
- 500: 'server error',
- 503: 'node is not part of a swarm'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-
-/**
- * Removes the config
- * @param {[Object]} opts Remove options (optional)
- * @param {Function} callback Callback
- */
-Config.prototype.remove = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/configs/' + this.id,
- method: 'DELETE',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 204: true,
- 404: 'config not found',
- 500: 'server error',
- 503: 'node is not part of a swarm'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-
-
-module.exports = Config;
diff --git a/node_modules/dockerode/lib/container.js b/node_modules/dockerode/lib/container.js
deleted file mode 100644
index 38279bf..0000000
--- a/node_modules/dockerode/lib/container.js
+++ /dev/null
@@ -1,1085 +0,0 @@
-var extend = require('./util').extend,
- Exec = require('./exec'),
- util = require('./util');
-
-/**
- * Represents a Container
- * @param {Object} modem docker-modem
- * @param {String} id Container's ID
- */
-var Container = function(modem, id) {
- this.modem = modem;
- this.id = id;
-
- this.defaultOptions = {
- top: {},
- start: {},
- commit: {},
- stop: {},
- pause: {},
- unpause: {},
- restart: {},
- resize: {},
- attach: {},
- remove: {},
- copy: {},
- kill: {},
- exec: {},
- rename: {},
- log: {},
- stats: {},
- getArchive: {},
- infoArchive: {},
- putArchive: {},
- update: {},
- wait: {}
- };
-};
-
-Container.prototype[require('util').inspect.custom] = function() { return this; };
-
-/**
- * Inspect
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback, if supplied will query Docker.
- * @return {Object} ID only and only if callback isn't supplied.
- */
-Container.prototype.inspect = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/containers/' + this.id + '/json?',
- method: 'GET',
- options: args.opts,
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 404: 'no such container',
- 500: 'server error'
- }
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Rename
- * @param {Object} opts Rename options
- * @param {Function} callback Callback
- */
-Container.prototype.rename = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback, this.defaultOptions.rename);
-
- var optsf = {
- path: '/containers/' + this.id + '/rename?',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 204: true,
- 404: 'no such container',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Update
- * @param {Object} opts Update options
- * @param {Function} callback Callback
- */
-Container.prototype.update = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback, this.defaultOptions.update);
-
- var optsf = {
- path: '/containers/' + this.id + '/update',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 204: true,
- 400: 'bad parameter',
- 404: 'no such container',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Top
- * @param {Object} opts like 'ps_args' (optional)
- * @param {Function} callback Callback
- */
-Container.prototype.top = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback, this.defaultOptions.top);
-
- var optsf = {
- path: '/containers/' + this.id + '/top?',
- method: 'GET',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 404: 'no such container',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Containers changes
- * @param {Object} Options
- * @param {Function} callback Callback
- */
-Container.prototype.changes = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/containers/' + this.id + '/changes',
- method: 'GET',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 404: 'no such container',
- 500: 'server error'
- }
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Checkpoints list
- * @param {Object} opts List checkpoints options (optional)
- * @param {Function} callback Callback
- */
-Container.prototype.listCheckpoint = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/containers/' + this.id + '/checkpoints?',
- method: 'GET',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 404: 'no such container',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-
-/**
- * Delete checkpoint
- * @param {Object} opts Delete checkpoint options (optional)
- * @param {Function} callback Callback
- */
-Container.prototype.deleteCheckpoint = function(checkpoint, opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/containers/' + this.id + '/checkpoints/' + checkpoint + '?',
- method: 'DELETE',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true, // unofficial, but proxies may return it
- 204: true,
- 404: 'no such container',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Create checkpoint
- * @param {Object} opts Create checkpoint options (optional)
- * @param {Function} callback Callback
- */
-Container.prototype.createCheckpoint = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/containers/' + this.id + '/checkpoints',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- allowEmpty: true,
- statusCodes: {
- 200: true, //unofficial, but proxies may return it
- 201: true,
- 204: true,
- 404: 'no such container',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-
-/**
- * Export
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback with the octet-stream.
- */
-Container.prototype.export = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/containers/' + this.id + '/export',
- method: 'GET',
- abortSignal: args.opts.abortSignal,
- isStream: true,
- statusCodes: {
- 200: true,
- 404: 'no such container',
- 500: 'server error'
- }
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Start
- * @param {Object} opts Container start options (optional)
- * @param {Function} callback Callback
- */
-Container.prototype.start = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback, this.defaultOptions.start);
-
- var optsf = {
- path: '/containers/' + this.id + '/start?',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true, // unofficial, but proxies may return it
- 204: true,
- 304: 'container already started',
- 404: 'no such container',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Pause
- * @param {Object} opts Pause options (optional)
- * @param {Function} callback Callback
- */
-Container.prototype.pause = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback, this.defaultOptions.pause);
-
- var optsf = {
- path: '/containers/' + this.id + '/pause',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true, // unofficial, but proxies may return it
- 204: true,
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Unpause
- * @param {Object} opts Unpause options (optional)
- * @param {Function} callback Callback
- */
-Container.prototype.unpause = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback, this.defaultOptions.unpause);
-
- var optsf = {
- path: '/containers/' + this.id + '/unpause',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true, // unofficial, but proxies may return it
- 204: true,
- 404: 'no such container',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Setup an exec call to a running container
- *
- * @param {object} opts
- * @param {function} callback
- */
-Container.prototype.exec = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback, this.defaultOptions.exec);
-
- var optsf = {
- path: '/containers/' + this.id + '/exec',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true, // unofficial, but proxies may return it
- 201: true,
- 404: 'no such container',
- 409: 'container stopped/paused',
- 500: 'server error'
- },
- options: args.opts
- };
-
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(new Exec(self.modem, data.Id));
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- if (err) return args.callback(err, data);
- args.callback(err, new Exec(self.modem, data.Id));
- });
- }
-};
-
-/**
- * Commit
- * @param {Object} opts Commit options like 'Hostname' (optional)
- * @param {Function} callback Callback
- */
-Container.prototype.commit = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback, this.defaultOptions.commit);
-
- args.opts.container = this.id;
-
- var optsf = {
- path: '/commit?',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true, // unofficial, but proxies may return it
- 201: true,
- 404: 'no such container',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Stop
- * @param {Object} opts Container stop options, like 't' (optional)
- * @param {Function} callback Callback
- */
-Container.prototype.stop = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback, this.defaultOptions.stop);
-
- var optsf = {
- path: '/containers/' + this.id + '/stop?',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true, // unofficial, but proxies may return it
- 204: true,
- 304: 'container already stopped',
- 404: 'no such container',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Restart
- * @param {Object} opts Container restart options, like 't' (optional)
- * @param {Function} callback Callback
- */
-Container.prototype.restart = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback, this.defaultOptions.restart);
-
- var optsf = {
- path: '/containers/' + this.id + '/restart?',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true, // unofficial, but proxies may return it
- 204: true,
- 404: 'no such container',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Kill
- * @param {Object} opts Container kill options, like 'signal' (optional)
- * @param {Function} callback Callback
- */
-Container.prototype.kill = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback, this.defaultOptions.kill);
-
- var optsf = {
- path: '/containers/' + this.id + '/kill?',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true, // unofficial, but proxies may return it
- 204: true,
- 404: 'no such container',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Container resize
- * @param {[type]} opts Resize options. (optional)
- * @param {Function} callback Callback
- */
-Container.prototype.resize = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback, this.defaultOptions.resize);
-
- var optsf = {
- path: '/containers/' + this.id + '/resize?',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 400: 'bad parameter',
- 404: 'no such container',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Attach
- * @param {Object} opts Attach options, like 'logs' (optional)
- * @param {Function} callback Callback with stream.
- */
-Container.prototype.attach = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback, this.defaultOptions.attach);
-
- var optsf = {
- path: '/containers/' + this.id + '/attach?',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- isStream: true,
- hijack: args.opts.hijack,
- openStdin: args.opts.stdin,
- statusCodes: {
- 200: true,
- 404: 'no such container',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, stream) {
- if (err) {
- return reject(err);
- }
- resolve(stream);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, stream) {
- args.callback(err, stream);
- });
- }
-};
-
-/**
- * Waits for a container to end.
- * @param {[type]} opts Container wait options, like condition. (optional)
- * @param {Function} callback Callback
- */
-Container.prototype.wait = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback, this.defaultOptions.wait);
-
- var optsf = {
- path: '/containers/' + this.id + '/wait?',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 400: 'bad parameter',
- 404: 'no such container',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Removes a container
- * @param {Object} opts Remove options, like 'force' (optional)
- * @param {Function} callback Callback
- */
-Container.prototype.remove = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback, this.defaultOptions.remove);
-
- var optsf = {
- path: '/containers/' + this.id + '?',
- method: 'DELETE',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true, // unofficial, but proxies may return it
- 204: true,
- 400: 'bad parameter',
- 404: 'no such container',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Copy (WARNING: DEPRECATED since RAPI v1.20)
- * @param {Object} opts Copy options, like 'Resource' (optional)
- * @param {Function} callback Callback with stream.
- */
-Container.prototype.copy = function(opts, callback) {
- var self = this;
- console.log('container.copy is deprecated since Docker v1.8.x');
- var args = util.processArgs(opts, callback, this.defaultOptions.copy);
-
- var optsf = {
- path: '/containers/' + this.id + '/copy',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- isStream: true,
- statusCodes: {
- 200: true,
- 404: 'no such container',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * getArchive
- * @param {Object} opts Archive options, like 'path'
- * @param {Function} callback Callback with stream.
- */
-Container.prototype.getArchive = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback, this.defaultOptions.getArchive);
-
- var optsf = {
- path: '/containers/' + this.id + '/archive?',
- method: 'GET',
- abortSignal: args.opts.abortSignal,
- isStream: true,
- statusCodes: {
- 200: true,
- 400: 'client error, bad parameters',
- 404: 'no such container',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * infoArchive
- * @param {Object} opts Archive options, like 'path'
- * @param {Function} callback Callback with stream.
- */
-Container.prototype.infoArchive = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback, this.defaultOptions.infoArchive);
-
- var optsf = {
- path: '/containers/' + this.id + '/archive?',
- method: 'HEAD',
- abortSignal: args.opts.abortSignal,
- isStream: true,
- statusCodes: {
- 200: true,
- 400: 'client error, bad parameters',
- 404: 'no such container',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * putArchive
- * @param {Object} opts Archive options, like 'path'
- * @param {Function} callback Callback with stream.
- */
-Container.prototype.putArchive = function(file, opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback, this.defaultOptions.putArchive);
-
- var optsf = {
- path: '/containers/' + this.id + '/archive?',
- method: 'PUT',
- file: file,
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 400: 'client error, bad parameters',
- 403: 'client error, permission denied',
- 404: 'no such container',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Container logs
- * @param {Object} opts Logs options. (optional)
- * @param {Function} callback Callback with data
- */
-Container.prototype.logs = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback, this.defaultOptions.log);
-
- var optsf = {
- path: '/containers/' + this.id + '/logs?',
- method: 'GET',
- abortSignal: args.opts.abortSignal,
- isStream: args.opts.follow || false,
- statusCodes: {
- 200: true,
- 404: 'no such container',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Container stats
- * @param {Object} opts Stats options. (optional)
- * @param {Function} callback Callback with data
- */
-Container.prototype.stats = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback, this.defaultOptions.stats);
- var isStream = true;
- if (args.opts.stream === false) {
- isStream = false;
- }
- var optsf = {
- path: '/containers/' + this.id + '/stats?',
- method: 'GET',
- abortSignal: args.opts.abortSignal,
- isStream: isStream,
- statusCodes: {
- 200: true,
- 404: 'no such container',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-module.exports = Container;
diff --git a/node_modules/dockerode/lib/docker.js b/node_modules/dockerode/lib/docker.js
deleted file mode 100644
index c37753a..0000000
--- a/node_modules/dockerode/lib/docker.js
+++ /dev/null
@@ -1,1832 +0,0 @@
-var EventEmitter = require('events').EventEmitter,
- Modem = require('docker-modem'),
- Container = require('./container'),
- Image = require('./image'),
- Volume = require('./volume'),
- Network = require('./network'),
- Service = require('./service'),
- Plugin = require('./plugin'),
- Secret = require('./secret'),
- Config = require('./config'),
- Task = require('./task'),
- Node = require('./node'),
- Exec = require('./exec'),
- util = require('./util'),
- extend = util.extend;
-
-var Docker = function(opts) {
- if (!(this instanceof Docker)) return new Docker(opts);
-
- var plibrary = global.Promise;
-
- if (opts && opts.Promise) {
- plibrary = opts.Promise;
-
- if (Object.keys(opts).length === 1) {
- opts = undefined;
- }
- }
-
- if (opts && opts.modem) {
- this.modem = opts.modem;
- } else {
- this.modem = new Modem(opts);
- }
- this.modem.Promise = plibrary;
-};
-
-/**
- * Creates a new container
- * @param {Object} opts Create options
- * @param {Function} callback Callback
- */
-Docker.prototype.createContainer = function(opts, callback) {
- var self = this;
- var optsf = {
- path: '/containers/create?',
- method: 'POST',
- options: opts,
- authconfig: opts.authconfig,
- abortSignal: opts.abortSignal,
- statusCodes: {
- 200: true, // unofficial, but proxies may return it
- 201: true,
- 400: 'bad parameter',
- 404: 'no such container',
- 406: 'impossible to attach',
- 500: 'server error'
- }
- };
-
- delete opts.authconfig;
-
- if (callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(self.getContainer(data.Id));
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- if (err) return callback(err, data);
- callback(err, self.getContainer(data.Id));
- });
- }
-};
-
-/**
- * Creates a new image
- * @param {Object} auth Authentication (optional)
- * @param {Object} opts Create options
- * @param {Function} callback Callback
- */
-Docker.prototype.createImage = function(auth, opts, callback) {
- var self = this;
- if (!callback && typeof opts === 'function') {
- callback = opts;
- opts = auth;
- auth = opts.authconfig || undefined;
- } else if (!callback && !opts) {
- opts = auth;
- auth = opts.authconfig;
- }
-
- var optsf = {
- path: '/images/create?',
- method: 'POST',
- options: opts,
- authconfig: auth,
- abortSignal: opts.abortSignal,
- isStream: true,
- statusCodes: {
- 200: true,
- 500: 'server error'
- }
- };
-
- if (callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- callback(err, data);
- });
- }
-};
-
-/**
- * Load image
- * @param {String} file File
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback
- */
-Docker.prototype.loadImage = function(file, opts, callback) {
- var self = this;
- if (!callback && typeof opts === 'function') {
- callback = opts;
- opts = null;
- }
-
- var optsf = {
- path: '/images/load?',
- method: 'POST',
- options: opts,
- file: file,
- abortSignal: opts && opts.abortSignal,
- isStream: true,
- statusCodes: {
- 200: true,
- 500: 'server error'
- }
- };
-
- if (callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- callback(err, data);
- });
- }
-};
-
-/**
- * Import image from a tar archive
- * @param {String} file File
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback
- */
-Docker.prototype.importImage = function(file, opts, callback) {
- var self = this;
- if (!callback && typeof opts === 'function') {
- callback = opts;
- opts = undefined;
- }
-
- if (!opts)
- opts = {};
-
- opts.fromSrc = '-';
-
- var optsf = {
- path: '/images/create?',
- method: 'POST',
- options: opts,
- file: file,
- abortSignal: opts.abortSignal,
- isStream: true,
- statusCodes: {
- 200: true,
- 500: 'server error'
- }
- };
-
- if (callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- callback(err, data);
- });
- }
-};
-
-/**
- * Verifies auth
- * @param {Object} opts Options
- * @param {Function} callback Callback
- */
-Docker.prototype.checkAuth = function(opts, callback) {
- var self = this;
- var optsf = {
- path: '/auth',
- method: 'POST',
- options: opts,
- abortSignal: opts.abortSignal,
- statusCodes: {
- 200: true,
- 204: true,
- 500: 'server error'
- }
- };
-
- if (callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- callback(err, data);
- });
- }
-};
-
-/**
- * Builds an image
- * @param {String} file File
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback
- */
-Docker.prototype.buildImage = function(file, opts, callback) {
- var self = this;
-
- if (!callback && typeof opts === 'function') {
- callback = opts;
- opts = null;
- }
-
- var optsf = {
- path: '/build?',
- method: 'POST',
- file: undefined,
- options: opts,
- abortSignal: opts && opts.abortSignal,
- isStream: true,
- statusCodes: {
- 200: true,
- 500: 'server error'
- }
- };
-
- if (opts) {
- if (opts.registryconfig) {
- optsf.registryconfig = optsf.options.registryconfig;
- delete optsf.options.registryconfig;
- }
-
- //undocumented?
- if (opts.authconfig) {
- optsf.authconfig = optsf.options.authconfig;
- delete optsf.options.authconfig;
- }
- }
-
- if (callback === undefined) {
- return new self.modem.Promise(function(resolve, reject) {
- util.prepareBuildContext(file, (ctx) => {
- optsf.file = ctx;
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- });
- } else {
- util.prepareBuildContext(file, (ctx) => {
- optsf.file = ctx;
- self.modem.dial(optsf, function(err, data) {
- callback(err, data);
- });
- })
- }
-};
-
-/**
- * Fetches a Container by ID
- * @param {String} id Container's ID
- */
-Docker.prototype.getContainer = function(id) {
- return new Container(this.modem, id);
-};
-
-/**
- * Fetches an Image by name
- * @param {String} name Image's name
- */
-Docker.prototype.getImage = function(name) {
- return new Image(this.modem, name);
-};
-
-/**
- * Fetches a Volume by name
- * @param {String} name Volume's name
- */
-Docker.prototype.getVolume = function(name) {
- return new Volume(this.modem, name);
-};
-
-/**
- * Fetches a Plugin by name
- * @param {String} name Volume's name
- */
-Docker.prototype.getPlugin = function(name, remote) {
- return new Plugin(this.modem, name, remote);
-};
-
-/**
- * Fetches a Service by id
- * @param {String} id Services's id
- */
-Docker.prototype.getService = function(id) {
- return new Service(this.modem, id);
-};
-
-/**
- * Fetches a Task by id
- * @param {String} id Task's id
- */
-Docker.prototype.getTask = function(id) {
- return new Task(this.modem, id);
-};
-
-/**
- * Fetches Node by id
- * @param {String} id Node's id
- */
-Docker.prototype.getNode = function(id) {
- return new Node(this.modem, id);
-};
-
-/**
- * Fetches a Network by id
- * @param {String} id network's id
- */
-Docker.prototype.getNetwork = function(id) {
- return new Network(this.modem, id);
-};
-
-/**
- * Fetches a Secret by id
- * @param {String} id network's id
- */
-Docker.prototype.getSecret = function(id) {
- return new Secret(this.modem, id);
-};
-
-/**
- * Fetches a Config by id
- * @param {String} id network's id
- */
-Docker.prototype.getConfig = function(id) {
- return new Config(this.modem, id);
-};
-
-/**
- * Fetches an Exec instance by ID
- * @param {String} id Exec instance's ID
- */
-Docker.prototype.getExec = function(id) {
- return new Exec(this.modem, id);
-};
-
-/**
- * Lists containers
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback
- */
-Docker.prototype.listContainers = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/containers/json?',
- method: 'GET',
- options: args.opts,
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 400: 'bad parameter',
- 500: 'server error'
- }
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Lists images
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback
- */
-Docker.prototype.listImages = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/images/json?',
- method: 'GET',
- options: args.opts,
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 400: 'bad parameter',
- 500: 'server error'
- }
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Get images
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback
- */
-Docker.prototype.getImages = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/images/get?',
- method: 'GET',
- options: args.opts,
- abortSignal: args.opts.abortSignal,
- isStream: true,
- statusCodes: {
- 200: true,
- 400: 'bad parameter',
- 500: 'server error'
- }
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Lists Services
- * @param {Object} opts
- * @param {Function} callback Callback
- */
-Docker.prototype.listServices = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/services?',
- method: 'GET',
- options: args.opts,
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 500: 'server error'
- }
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Lists Nodes
- * @param {Object} opts
- * @param {Function} callback Callback
- */
-Docker.prototype.listNodes = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/nodes?',
- method: 'GET',
- options: args.opts,
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 400: 'bad parameter',
- 404: 'no such node',
- 500: 'server error',
- 503: 'node is not part of a swarm',
- }
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Lists Tasks
- * @param {Object} opts
- * @param {Function} callback Callback
- */
-Docker.prototype.listTasks = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/tasks?',
- method: 'GET',
- options: args.opts,
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 500: 'server error'
- }
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Creates a new secret
- * @param {Object} opts Create options
- * @param {Function} callback Callback
- */
-Docker.prototype.createSecret = function(opts, callback) {
- var args = util.processArgs(opts, callback);
- var self = this;
- var optsf = {
- path: '/secrets/create?',
- method: 'POST',
- options: args.opts,
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true, // unofficial, but proxies may return it
- 201: true,
- 406: 'server error or node is not part of a swarm',
- 409: 'name conflicts with an existing object',
- 500: 'server error'
- }
- };
-
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(self.getSecret(data.ID));
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- if (err) return args.callback(err, data);
- args.callback(err, self.getSecret(data.ID));
- });
- }
-};
-
-
-/**
- * Creates a new config
- * @param {Object} opts Config options
- * @param {Function} callback Callback
- */
-Docker.prototype.createConfig = function(opts, callback) {
- var args = util.processArgs(opts, callback);
- var self = this;
- var optsf = {
- path: '/configs/create?',
- method: 'POST',
- options: args.opts,
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true, // unofficial, but proxies may return it
- 201: true,
- 406: 'server error or node is not part of a swarm',
- 409: 'name conflicts with an existing object',
- 500: 'server error'
- }
- };
-
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(self.getConfig(data.ID));
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- if (err) return args.callback(err, data);
- args.callback(err, self.getConfig(data.ID));
- });
- }
-};
-
-
-/**
- * Lists secrets
- * @param {Object} opts
- * @param {Function} callback Callback
- */
-Docker.prototype.listSecrets = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/secrets?',
- method: 'GET',
- options: args.opts,
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 500: 'server error'
- }
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Lists configs
- * @param {Object} opts
- * @param {Function} callback Callback
- */
-Docker.prototype.listConfigs = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/configs?',
- method: 'GET',
- options: args.opts,
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 500: 'server error'
- }
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Creates a new plugin
- * @param {Object} opts Create options
- * @param {Function} callback Callback
- */
-Docker.prototype.createPlugin = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
- var optsf = {
- path: '/plugins/create?',
- method: 'POST',
- options: args.opts,
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true, // unofficial, but proxies may return it
- 204: true,
- 500: 'server error'
- }
- };
-
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(self.getPlugin(args.opts.name));
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- if (err) return args.callback(err, data);
- args.callback(err, self.getPlugin(args.opts.name));
- });
- }
-};
-
-
-/**
- * Lists plugins
- * @param {Object} opts
- * @param {Function} callback Callback
- */
-Docker.prototype.listPlugins = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/plugins?',
- method: 'GET',
- options: args.opts,
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 500: 'server error'
- }
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Prune images
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback
- */
-Docker.prototype.pruneImages = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/images/prune?',
- method: 'POST',
- options: args.opts,
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 500: 'server error'
- }
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Prune builder
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback
- */
-Docker.prototype.pruneBuilder = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/build/prune',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 500: 'server error'
- }
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Prune containers
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback
- */
-Docker.prototype.pruneContainers = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/containers/prune?',
- method: 'POST',
- options: args.opts,
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 500: 'server error'
- }
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Prune volumes
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback
- */
-Docker.prototype.pruneVolumes = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/volumes/prune?',
- method: 'POST',
- options: args.opts,
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 500: 'server error'
- }
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Prune networks
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback
- */
-Docker.prototype.pruneNetworks = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/networks/prune?',
- method: 'POST',
- options: args.opts,
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 500: 'server error'
- }
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-
-/**
- * Creates a new volume
- * @param {Object} opts Create options
- * @param {Function} callback Callback
- */
-Docker.prototype.createVolume = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
- var optsf = {
- path: '/volumes/create?',
- method: 'POST',
- allowEmpty: true,
- options: args.opts,
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true, // unofficial, but proxies may return it
- 201: true,
- 500: 'server error'
- }
- };
-
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(self.getVolume(data.Name));
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- if (err) return args.callback(err, data);
- args.callback(err, self.getVolume(data.Name));
- });
- }
-};
-
-/**
- * Creates a new service
- * @param {Object} auth
- * @param {Object} opts Create options
- * @param {Function} callback Callback
- */
-Docker.prototype.createService = function(auth, opts, callback) {
- if (!callback && typeof opts === 'function') {
- callback = opts;
- opts = auth;
- auth = opts.authconfig || undefined;
- } else if (!opts && !callback) {
- opts = auth;
- }
-
-
- var self = this;
- var optsf = {
- path: '/services/create',
- method: 'POST',
- options: opts,
- authconfig: auth,
- abortSignal: opts && opts.abortSignal,
- statusCodes: {
- 200: true,
- 201: true,
- 500: 'server error'
- }
- };
-
-
- if (callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(self.getService(data.ID || data.Id));
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- if (err) return callback(err, data);
- callback(err, self.getService(data.ID || data.Id));
- });
- }
-};
-
-/**
- * Lists volumes
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback
- */
-Docker.prototype.listVolumes = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/volumes?',
- method: 'GET',
- options: args.opts,
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 400: 'bad parameter',
- 500: 'server error'
- }
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Creates a new network
- * @param {Object} opts Create options
- * @param {Function} callback Callback
- */
-Docker.prototype.createNetwork = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
- var optsf = {
- path: '/networks/create?',
- method: 'POST',
- options: args.opts,
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true, // unofficial, but proxies may return it
- 201: true,
- 404: 'driver not found',
- 500: 'server error'
- }
- };
-
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(self.getNetwork(data.Id));
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- if (err) return args.callback(err, data);
- args.callback(err, self.getNetwork(data.Id));
- });
- }
-};
-
-/**
- * Lists networks
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback
- */
-Docker.prototype.listNetworks = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/networks?',
- method: 'GET',
- options: args.opts,
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 400: 'bad parameter',
- 500: 'server error'
- }
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Search images
- * @param {Object} opts Options
- * @param {Function} callback Callback
- */
-Docker.prototype.searchImages = function(opts, callback) {
- var self = this;
- var optsf = {
- path: '/images/search?',
- method: 'GET',
- options: opts,
- authconfig: opts.authconfig,
- abortSignal: opts.abortSignal,
- statusCodes: {
- 200: true,
- 500: 'server error'
- }
- };
-
- if (callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- callback(err, data);
- });
- }
-};
-
-/**
- * Info
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback with info
- */
-Docker.prototype.info = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var opts = {
- path: '/info',
- method: 'GET',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 500: 'server error'
- }
- };
-
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(opts, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(opts, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Version
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback
- */
-Docker.prototype.version = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var opts = {
- path: '/version',
- method: 'GET',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 500: 'server error'
- }
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(opts, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(opts, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Ping
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback
- */
-Docker.prototype.ping = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/_ping',
- method: 'GET',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 500: 'server error'
- }
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * SystemDf equivalent to system/df API Engine
- * get usage data information
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback
- */
-Docker.prototype.df = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/system/df',
- method: 'GET',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 500: 'server error'
- }
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Events
- * @param {Object} opts Events options, like 'since' (optional)
- * @param {Function} callback Callback
- */
-Docker.prototype.getEvents = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/events?',
- method: 'GET',
- options: args.opts,
- abortSignal: args.opts.abortSignal,
- isStream: true,
- statusCodes: {
- 200: true,
- 500: 'server error'
- }
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Pull is a wrapper around createImage, parsing image's tags.
- * @param {String} repoTag Repository tag
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback
- * @param {Object} auth Authentication (optional)
- * @return {Object} Image
- */
-Docker.prototype.pull = function(repoTag, opts, callback, auth) {
- var args = util.processArgs(opts, callback);
-
- var imageSrc = util.parseRepositoryTag(repoTag);
- args.opts.fromImage = imageSrc.repository;
- args.opts.tag = imageSrc.tag || 'latest';
-
- var argsf = [args.opts, args.callback];
- if (auth) {
- argsf = [auth, args.opts, args.callback];
- }
- return this.createImage.apply(this, argsf);
-};
-
-/**
- * Like run command from Docker's CLI
- * @param {String} image Image name to be used.
- * @param {Array} cmd Command to run in array format.
- * @param {Object} streamo Output stream
- * @param {Object} createOptions Container create options (optional)
- * @param {Object} startOptions Container start options (optional)
- * @param {Function} callback Callback
- * @return {Object} EventEmitter
- */
-Docker.prototype.run = function(image, cmd, streamo, createOptions, startOptions, callback) {
- if (typeof arguments[arguments.length - 1] === 'function') {
- return this.runCallback(image, cmd, streamo, createOptions, startOptions, callback);
- } else {
- return this.runPromise(image, cmd, streamo, createOptions, startOptions);
- }
-};
-
-
-Docker.prototype.runCallback = function(image, cmd, streamo, createOptions, startOptions, callback) {
- if (!callback && typeof createOptions === 'function') {
- callback = createOptions;
- createOptions = {};
- startOptions = {};
- } else if (!callback && typeof startOptions === 'function') {
- callback = startOptions;
- startOptions = {};
- }
-
- var hub = new EventEmitter();
-
- function handler(err, container) {
- if (err) return callback(err, null, container);
-
- hub.emit('container', container);
-
- container.attach({
- stream: true,
- stdout: true,
- stderr: true
- }, function handler(err, stream) {
- if (err) return callback(err, null, container);
-
- hub.emit('stream', stream);
-
- if (streamo) {
- if (streamo instanceof Array) {
- stream.on('end', function() {
- try {
- streamo[0].end();
- } catch (e) {}
- try {
- streamo[1].end();
- } catch (e) {}
- });
- container.modem.demuxStream(stream, streamo[0], streamo[1]);
- } else {
- stream.setEncoding('utf8');
- stream.pipe(streamo, {
- end: true
- });
- }
- }
-
- container.start(startOptions, function(err, data) {
- if (err) return callback(err, data, container);
- hub.emit('start', container);
-
- container.wait(function(err, data) {
- hub.emit('data', data);
- callback(err, data, container);
- });
- });
- });
- }
-
- var optsc = {
- 'Hostname': '',
- 'User': '',
- 'AttachStdin': false,
- 'AttachStdout': true,
- 'AttachStderr': true,
- 'Tty': true,
- 'OpenStdin': false,
- 'StdinOnce': false,
- 'Env': null,
- 'Cmd': cmd,
- 'Image': image,
- 'Volumes': {},
- 'VolumesFrom': []
- };
-
- extend(optsc, createOptions);
-
- this.createContainer(optsc, handler);
-
- return hub;
-};
-
-Docker.prototype.runPromise = function(image, cmd, streamo, createOptions, startOptions) {
- var self = this;
-
- createOptions = createOptions || {};
- startOptions = startOptions || {};
-
- var optsc = {
- 'Hostname': '',
- 'User': '',
- 'AttachStdin': false,
- 'AttachStdout': true,
- 'AttachStderr': true,
- 'Tty': true,
- 'OpenStdin': false,
- 'StdinOnce': false,
- 'Env': null,
- 'Cmd': cmd,
- 'Image': image,
- 'Volumes': {},
- 'VolumesFrom': []
- };
-
- extend(optsc, createOptions);
-
- var containero;
-
- return new this.modem.Promise(function(resolve, reject) {
- self.createContainer(optsc).then(function(container) {
- containero = container;
- return container.attach({
- stream: true,
- stdout: true,
- stderr: true
- });
- }).then(function(stream) {
- if (streamo) {
- if (streamo instanceof Array) {
- stream.on('end', function() {
- try {
- streamo[0].end();
- } catch (e) {}
- try {
- streamo[1].end();
- } catch (e) {}
- });
- containero.modem.demuxStream(stream, streamo[0], streamo[1]);
- } else {
- stream.setEncoding('utf8');
- stream.pipe(streamo, {
- end: true
- });
- }
- }
- return containero.start(startOptions);
- }).then(function(data) {
- return containero.wait();
- }).then(function(data) {
- resolve([data, containero]);
- }).catch(function(err) {
- reject(err);
- });
- });
-};
-
-/**
- * Init swarm.
- *
- * @param {object} opts
- * @param {function} callback
- */
-Docker.prototype.swarmInit = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/swarm/init',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 400: 'bad parameter',
- 406: 'node is already part of a Swarm'
- },
- options: args.opts
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Join swarm.
- *
- * @param {object} opts
- * @param {function} callback
- */
-Docker.prototype.swarmJoin = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/swarm/join',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 400: 'bad parameter',
- 406: 'node is already part of a Swarm'
- },
- options: args.opts
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Leave swarm.
- *
- * @param {object} opts
- * @param {function} callback
- */
-Docker.prototype.swarmLeave = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/swarm/leave?',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 406: 'node is not part of a Swarm'
- },
- options: args.opts
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Update swarm.
- *
- * @param {object} opts
- * @param {function} callback
- */
-Docker.prototype.swarmUpdate = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/swarm/update?',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 400: 'bad parameter',
- 406: 'node is already part of a Swarm'
- },
- options: args.opts
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-
-/**
- * Inspect a Swarm.
- * Warning: This method is not documented in the API
- *
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback
- */
-Docker.prototype.swarmInspect = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/swarm',
- method: 'GET',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 406: 'This node is not a swarm manager',
- 500: 'server error'
- }
- };
-
- if (args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-Docker.Container = Container;
-Docker.Image = Image;
-Docker.Volume = Volume;
-Docker.Network = Network;
-Docker.Service = Service;
-Docker.Plugin = Plugin;
-Docker.Secret = Secret;
-Docker.Task = Task;
-Docker.Node = Node;
-Docker.Exec = Exec;
-
-module.exports = Docker;
diff --git a/node_modules/dockerode/lib/exec.js b/node_modules/dockerode/lib/exec.js
deleted file mode 100644
index 953b6c0..0000000
--- a/node_modules/dockerode/lib/exec.js
+++ /dev/null
@@ -1,139 +0,0 @@
-var util = require('./util');
-
-/**
- * Represents an Exec
- * @param {Object} modem docker-modem
- * @param {String} id Exec's ID
- */
-var Exec = function(modem, id) {
- this.modem = modem;
- this.id = id;
-};
-
-Exec.prototype[require('util').inspect.custom] = function() { return this; };
-
-/**
- * Start the exec call that was setup.
- *
- * @param {object} opts
- * @param {function} callback
- */
-Exec.prototype.start = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/exec/' + this.id + '/start',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- isStream: true,
- allowEmpty: true,
- hijack: args.opts.hijack,
- openStdin: args.opts.stdin,
- statusCodes: {
- 200: true,
- 204: true,
- 404: 'no such exec',
- 409: 'container stopped/paused',
- 500: 'container not running'
- },
- options: args.opts
- };
-
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- if (err) return args.callback(err, data);
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Resize the exec call that was setup.
- *
- * @param {object} opts
- * @param {function} callback
- */
-Exec.prototype.resize = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/exec/' + this.id + '/resize?',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 404: 'no such exec',
- 500: 'container not running'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- if (err) return args.callback(err, data);
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Get low-level information about the exec call.
- *
- * @param {Object} opts Options (optional)
- * @param {function} callback
- */
-Exec.prototype.inspect = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/exec/' + this.id + '/json',
- method: 'GET',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 404: 'no such exec',
- 500: 'server error'
- }
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- if (err) return args.callback(err, data);
- args.callback(err, data);
- });
- }
-};
-
-
-module.exports = Exec;
diff --git a/node_modules/dockerode/lib/image.js b/node_modules/dockerode/lib/image.js
deleted file mode 100644
index 1a81413..0000000
--- a/node_modules/dockerode/lib/image.js
+++ /dev/null
@@ -1,276 +0,0 @@
-var util = require('./util');
-
-/**
- * Represents an image
- * @param {Object} modem docker-modem
- * @param {String} name Image's name
- */
-var Image = function(modem, name) {
- this.modem = modem;
- this.name = name;
-};
-
-Image.prototype[require('util').inspect.custom] = function() { return this; };
-
-/**
- * Inspect
- * @param {Function} callback Callback, if specified Docker will be queried.
- * @return {Object} Name only if callback isn't specified.
- */
-Image.prototype.inspect = function(callback) {
- var self = this;
-
- var opts = {
- path: '/images/' + this.name + '/json',
- method: 'GET',
- statusCodes: {
- 200: true,
- 404: 'no such image',
- 500: 'server error'
- }
- };
-
- if(callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(opts, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(opts, function(err, data) {
- if (err) return callback(err, data);
- callback(err, data);
- });
- }
-};
-
-/**
- * Distribution
- * @param {Object} opts
- * @param {Function} callback Callback, if specified Docker will be queried.
- * @return {Object} Name only if callback isn't specified.
- */
-Image.prototype.distribution = function(opts, callback) {
- var args = util.processArgs(opts, callback);
- var self = this;
-
- var fopts = {
- path: '/distribution/' + this.name + '/json',
- method: 'GET',
- statusCodes: {
- 200: true,
- 401: 'no such image',
- 500: 'server error'
- },
- authconfig: (args.opts) ? args.opts.authconfig : undefined
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(fopts, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(fopts, function(err, data) {
- if (err) return args.callback(err, data);
- args.callback(err, data);
- });
- }
-};
-
-/**
- * History
- * @param {Function} callback Callback
- */
-Image.prototype.history = function(callback) {
- var self = this;
- var opts = {
- path: '/images/' + this.name + '/history',
- method: 'GET',
- statusCodes: {
- 200: true,
- 404: 'no such image',
- 500: 'server error'
- }
- };
-
- if(callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(opts, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(opts, function(err, data) {
- if (err) return callback(err, data);
- callback(err, data);
- });
- }
-};
-
-/**
- * Get
- * @param {Function} callback Callback with data stream.
- */
-Image.prototype.get = function(callback) {
- var self = this;
- var opts = {
- path: '/images/' + this.name + '/get',
- method: 'GET',
- isStream: true,
- statusCodes: {
- 200: true,
- 500: 'server error'
- }
- };
-
- if(callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(opts, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(opts, function(err, data) {
- if (err) return callback(err, data);
- callback(err, data);
- });
- }
-};
-
-/**
- * Push
- * @param {Object} opts Push options, like 'registry' (optional)
- * @param {Function} callback Callback with stream.
- * @param {Object} auth Registry authentication
- */
-Image.prototype.push = function(opts, callback, auth) {
- var self = this;
- var args = util.processArgs(opts, callback);
- var isStream = true;
- if (args.opts.stream === false) {
- isStream = false;
- }
- var optsf = {
- path: '/images/' + this.name + '/push?',
- method: 'POST',
- options: args.opts,
- authconfig: args.opts.authconfig || auth,
- abortSignal: args.opts.abortSignal,
- isStream: isStream,
- statusCodes: {
- 200: true,
- 404: 'no such image',
- 500: 'server error'
- }
- };
-
- delete optsf.options.authconfig;
-
- if(callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- callback(err, data);
- });
- }
-};
-
-/**
- * Tag
- * @param {Object} opts Tag options, like 'repo' (optional)
- * @param {Function} callback Callback
- */
-Image.prototype.tag = function(opts, callback) {
- var self = this;
- var optsf = {
- path: '/images/' + this.name + '/tag?',
- method: 'POST',
- options: opts,
- abortSignal: opts && opts.abortSignal,
- statusCodes: {
- 200: true, // unofficial, but proxies may return it
- 201: true,
- 400: 'bad parameter',
- 404: 'no such image',
- 409: 'conflict',
- 500: 'server error'
- }
- };
-
- if(callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- callback(err, data);
- });
- }
-};
-
-/**
- * Removes the image
- * @param {[Object]} opts Remove options (optional)
- * @param {Function} callback Callback
- */
-Image.prototype.remove = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/images/' + this.name + '?',
- method: 'DELETE',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 404: 'no such image',
- 409: 'conflict',
- 500: 'server error'
- },
- options: args.opts
- };
-
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-module.exports = Image;
diff --git a/node_modules/dockerode/lib/network.js b/node_modules/dockerode/lib/network.js
deleted file mode 100644
index f80c7f3..0000000
--- a/node_modules/dockerode/lib/network.js
+++ /dev/null
@@ -1,171 +0,0 @@
-var util = require('./util');
-
-/**
- * Represents an network
- * @param {Object} modem docker-modem
- * @param {String} id Network's id
- */
-var Network = function(modem, id) {
- this.modem = modem;
- this.id = id;
-};
-
-Network.prototype[require('util').inspect.custom] = function() { return this; };
-
-/**
- * Inspect
- * @param {Function} callback Callback, if specified Docker will be queried.
- * @return {Object} Id only if callback isn't specified.
- */
-Network.prototype.inspect = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var opts = {
- path: '/networks/' + this.id + '?',
- method: 'GET',
- statusCodes: {
- 200: true,
- 404: 'no such network',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(opts, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(opts, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Removes the network
- * @param {[Object]} opts Remove options (optional)
- * @param {Function} callback Callback
- */
-Network.prototype.remove = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/networks/' + this.id,
- method: 'DELETE',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 204: true,
- 404: 'no such network',
- 409: 'conflict',
- 500: 'server error'
- },
- options: args.opts
- };
-
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Connects a container to a network
- * @param {[Object]} opts Connect options (optional)
- * @param {Function} callback Callback
- */
-Network.prototype.connect = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/networks/' + this.id + '/connect',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 201: true,
- 404: 'network or container is not found',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-
-/**
- * Disconnects a container from a network
- * @param {[Object]} opts Disconnect options (optional)
- * @param {Function} callback Callback
- */
-Network.prototype.disconnect = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/networks/' + this.id + '/disconnect',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 201: true,
- 404: 'network or container is not found',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-
-
-
-module.exports = Network;
diff --git a/node_modules/dockerode/lib/node.js b/node_modules/dockerode/lib/node.js
deleted file mode 100644
index b953935..0000000
--- a/node_modules/dockerode/lib/node.js
+++ /dev/null
@@ -1,135 +0,0 @@
-var util = require('./util');
-
-/**
- * Represents an Node
- * @param {Object} modem docker-modem
- * @param {String} id Node's ID
- */
-var Node = function(modem, id) {
- this.modem = modem;
- this.id = id;
-};
-
-Node.prototype[require('util').inspect.custom] = function() { return this; };
-
-/**
- * Query Docker for Node details.
- *
- * @param {Object} opts Options (optional)
- * @param {function} callback
- */
-Node.prototype.inspect = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/nodes/' + this.id,
- method: 'GET',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 404: 'no such node',
- 500: 'server error'
- }
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-
-/**
- * Update a node.
- *
- * @param {object} opts
- * @param {function} callback
- */
-Node.prototype.update = function(opts, callback) {
- var self = this;
- if (!callback && typeof opts === 'function') {
- callback = opts;
- }
-
- var optsf = {
- path: '/nodes/' + this.id + '/update?',
- method: 'POST',
- abortSignal: opts && opts.abortSignal,
- statusCodes: {
- 200: true,
- 404: 'no such node',
- 406: 'node is not part of a swarm',
- 500: 'server error'
- },
- options: opts
- };
-
- if(callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- callback(err, data);
- });
- }
-};
-
-
-/**
- * Remove a Node.
- * Warning: This method is not documented in the API.
- *
- * @param {object} opts
- * @param {function} callback
- */
-Node.prototype.remove = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/nodes/' + this.id + '?',
- method: 'DELETE',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 404: 'no such node',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-
-module.exports = Node;
diff --git a/node_modules/dockerode/lib/plugin.js b/node_modules/dockerode/lib/plugin.js
deleted file mode 100644
index e119257..0000000
--- a/node_modules/dockerode/lib/plugin.js
+++ /dev/null
@@ -1,371 +0,0 @@
-var util = require('./util');
-
-/**
- * Represents a plugin
- * @param {Object} modem docker-modem
- * @param {String} name Plugin's name
- */
-var Plugin = function(modem, name, remote) {
- this.modem = modem;
- this.name = name;
- this.remote = remote || name;
-};
-
-Plugin.prototype[require('util').inspect.custom] = function() { return this; };
-
-/**
- * Inspect
- *
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback, if specified Docker will be queried.
- * @return {Object} Name only if callback isn't specified.
- */
-Plugin.prototype.inspect = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/plugins/' + this.name,
- method: 'GET',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 404: 'plugin is not installed',
- 500: 'server error'
- }
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Removes the plugin
- * @param {[Object]} opts Remove options (optional)
- * @param {Function} callback Callback
- */
-Plugin.prototype.remove = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/plugins/' + this.name + '?',
- method: 'DELETE',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 404: 'plugin is not installed',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- if (err) return args.callback(err, data);
- args.callback(err, data);
- });
- }
-};
-
-/**
- * get privileges
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback
- * @return {Object} Name only if callback isn't specified.
- */
-Plugin.prototype.privileges = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/plugins/privileges?',
- method: 'GET',
- options: {
- 'remote': this.remote
- },
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 500: 'server error'
- }
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-
-/**
- * Installs a new plugin
- * @param {Object} opts Create options
- * @param {Function} callback Callback
- */
-Plugin.prototype.pull = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- if(args.opts._query && !args.opts._query.name) {
- args.opts._query.name = this.name;
- }
- if(args.opts._query && !args.opts._query.remote) {
- args.opts._query.remote = this.remote;
- }
-
- var optsf = {
- path: '/plugins/pull?',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- isStream: true,
- options: args.opts,
- statusCodes: {
- 200: true, // unofficial, but proxies may return it
- 204: true,
- 500: 'server error'
- }
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-
-/**
- * Enable
- * @param {Object} opts Plugin enable options (optional)
- * @param {Function} callback Callback
- */
-Plugin.prototype.enable = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/plugins/' + this.name + '/enable?',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Disable
- * @param {Object} opts Plugin disable options (optional)
- * @param {Function} callback Callback
- */
-Plugin.prototype.disable = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/plugins/' + this.name + '/disable',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Push
- * @param {Object} opts Plugin push options (optional)
- * @param {Function} callback Callback
- */
-Plugin.prototype.push = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/plugins/' + this.name + '/push',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 404: 'plugin not installed',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * COnfigure
- * @param {Object} opts Plugin configure options (optional)
- * @param {Function} callback Callback
- */
-Plugin.prototype.configure = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/plugins/' + this.name + '/set',
- method: 'POST',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 404: 'plugin not installed',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-
-/**
- * Upgrade plugin
- *
- * @param {object} auth
- * @param {object} opts
- * @param {function} callback
- */
-Plugin.prototype.upgrade = function(auth, opts, callback) {
- var self = this;
- if (!callback && typeof opts === 'function') {
- callback = opts;
- opts = auth;
- auth = opts.authconfig || undefined;
- }
-
- var optsf = {
- path: '/plugins/' + this.name + '/upgrade?',
- method: 'POST',
- abortSignal: opts && opts.abortSignal,
- statusCodes: {
- 200: true,
- 204: true,
- 404: 'plugin not installed',
- 500: 'server error'
- },
- authconfig: auth,
- options: opts
- };
-
- if(callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- callback(err, data);
- });
- }
-};
-
-
-module.exports = Plugin;
diff --git a/node_modules/dockerode/lib/secret.js b/node_modules/dockerode/lib/secret.js
deleted file mode 100644
index 43fbd75..0000000
--- a/node_modules/dockerode/lib/secret.js
+++ /dev/null
@@ -1,134 +0,0 @@
-var util = require('./util');
-
-/**
- * Represents a secret
- * @param {Object} modem docker-modem
- * @param {String} id Secret's id
- */
-var Secret = function(modem, id) {
- this.modem = modem;
- this.id = id;
-};
-
-Secret.prototype[require('util').inspect.custom] = function() { return this; };
-
-/**
- * Inspect
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback, if specified Docker will be queried.
- * @return {Object} Name only if callback isn't specified.
- */
-Secret.prototype.inspect = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/secrets/' + this.id,
- method: 'GET',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 404: 'secret not found',
- 406: 'node is not part of a swarm',
- 500: 'server error'
- }
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Update a secret.
- *
- * @param {object} opts
- * @param {function} callback
- */
-Secret.prototype.update = function(opts, callback) {
- var self = this;
- if (!callback && typeof opts === 'function') {
- callback = opts;
- }
-
- var optsf = {
- path: '/secrets/' + this.id + '/update?',
- method: 'POST',
- abortSignal: opts && opts.abortSignal,
- statusCodes: {
- 200: true,
- 404: 'secret not found',
- 500: 'server error'
- },
- options: opts
- };
-
- if(callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- callback(err, data);
- });
- }
-};
-
-
-/**
- * Removes the secret
- * @param {[Object]} opts Remove options (optional)
- * @param {Function} callback Callback
- */
-Secret.prototype.remove = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/secrets/' + this.id,
- method: 'DELETE',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 204: true,
- 404: 'secret not found',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-
-
-module.exports = Secret;
diff --git a/node_modules/dockerode/lib/service.js b/node_modules/dockerode/lib/service.js
deleted file mode 100644
index db444bb..0000000
--- a/node_modules/dockerode/lib/service.js
+++ /dev/null
@@ -1,183 +0,0 @@
-var util = require('./util');
-
-/**
- * Represents an Service
- * @param {Object} modem docker-modem
- * @param {String} id Service's ID
- */
-var Service = function(modem, id) {
- this.modem = modem;
- this.id = id;
-};
-
-Service.prototype[require('util').inspect.custom] = function() { return this; };
-
-/**
- * Query Docker for service details.
- *
- * @param {Object} opts Options (optional)
- * @param {function} callback
- */
-Service.prototype.inspect = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/services/' + this.id,
- method: 'GET',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 404: 'no such service',
- 500: 'server error'
- }
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Delete Service
- *
- * @param {Object} opts Options (optional)
- * @param {function} callback
- */
-Service.prototype.remove = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/services/' + this.id,
- method: 'DELETE',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 204: true,
- 404: 'no such service',
- 500: 'server error'
- }
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Update service
- *
- * @param {object} auth
- * @param {object} opts
- * @param {function} callback
- */
-Service.prototype.update = function(auth, opts, callback) {
- var self = this;
- if (!callback) {
- var t = typeof opts;
- if(t === 'function'){
- callback = opts;
- opts = auth;
- auth = opts.authconfig || undefined;
- } else if (t === 'undefined'){
- opts = auth;
- auth = opts.authconfig || undefined;
- }
- }
-
- var optsf = {
- path: '/services/' + this.id + '/update?',
- method: 'POST',
- abortSignal: opts && opts.abortSignal,
- statusCodes: {
- 200: true,
- 404: 'no such service',
- 500: 'server error'
- },
- authconfig: auth,
- options: opts
- };
-
- if(callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- callback(err, data);
- });
- }
-};
-
-
-
-/**
- * Service logs
- * @param {Object} opts Logs options. (optional)
- * @param {Function} callback Callback with data
- */
-Service.prototype.logs = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback, {});
-
- var optsf = {
- path: '/services/' + this.id + '/logs?',
- method: 'GET',
- abortSignal: args.opts.abortSignal,
- isStream: args.opts.follow || false,
- statusCodes: {
- 200: true,
- 404: 'no such service',
- 500: 'server error',
- 503: 'node is not part of a swarm'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-
-
-module.exports = Service;
diff --git a/node_modules/dockerode/lib/task.js b/node_modules/dockerode/lib/task.js
deleted file mode 100644
index 7adf968..0000000
--- a/node_modules/dockerode/lib/task.js
+++ /dev/null
@@ -1,97 +0,0 @@
-var util = require('./util');
-
-/**
- * Represents an Task
- * @param {Object} modem docker-modem
- * @param {String} id Task's ID
- */
-var Task = function(modem, id) {
- this.modem = modem;
- this.id = id;
-
- this.defaultOptions = {
- log: {}
- };
-};
-
-Task.prototype[require('util').inspect.custom] = function() { return this; };
-
-/**
- * Query Docker for Task details.
- *
- * @param {Object} opts Options (optional)
- * @param {function} callback
- */
-Task.prototype.inspect = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/tasks/' + this.id,
- method: 'GET',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 404: 'unknown task',
- 500: 'server error'
- }
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Task logs
- * @param {Object} opts Logs options. (optional)
- * @param {Function} callback Callback with data
- */
-Task.prototype.logs = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback, this.defaultOptions.log);
-
- var optsf = {
- path: '/tasks/' + this.id + '/logs?',
- method: 'GET',
- abortSignal: args.opts.abortSignal,
- isStream: args.opts.follow || false,
- statusCodes: {
- 101: true,
- 200: true,
- 404: 'no such container',
- 500: 'server error',
- 503: 'node is not part of a swarm'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-
-module.exports = Task;
diff --git a/node_modules/dockerode/lib/util.js b/node_modules/dockerode/lib/util.js
deleted file mode 100644
index e16f3aa..0000000
--- a/node_modules/dockerode/lib/util.js
+++ /dev/null
@@ -1,106 +0,0 @@
-var DockerIgnore = require('@balena/dockerignore');
-var fs = require('fs');
-var path = require('path');
-var tar = require('tar-fs');
-var zlib = require('zlib');
-
-// https://github.com/HenrikJoreteg/extend-object/blob/v0.1.0/extend-object.js
-
-var arr = [];
-var each = arr.forEach;
-var slice = arr.slice;
-
-module.exports.extend = function(obj) {
- each.call(slice.call(arguments, 1), function(source) {
- if (source) {
- for (var prop in source) {
- obj[prop] = source[prop];
- }
- }
- });
- return obj;
-};
-
-module.exports.processArgs = function(opts, callback, defaultOpts) {
- if (!callback && typeof opts === 'function') {
- callback = opts;
- opts = null;
- }
- return {
- callback: callback,
- opts: module.exports.extend({}, defaultOpts, opts)
- };
-};
-
-
-/**
- * Parse the given repo tag name (as a string) and break it out into repo/tag pair.
- * // if given the input http://localhost:8080/woot:latest
- * {
- * repository: 'http://localhost:8080/woot',
- * tag: 'latest'
- * }
- * @param {String} input Input e.g: 'repo/foo', 'ubuntu', 'ubuntu:latest'
- * @return {Object} input parsed into the repo and tag.
- */
-module.exports.parseRepositoryTag = function(input) {
- var separatorPos;
- var digestPos = input.indexOf('@');
- var colonPos = input.lastIndexOf(':');
- // @ symbol is more important
- if (digestPos >= 0) {
- separatorPos = digestPos;
- } else if (colonPos >= 0) {
- separatorPos = colonPos;
- } else {
- // no colon nor @
- return {
- repository: input
- };
- }
-
- // last colon is either the tag (or part of a port designation)
- var tag = input.slice(separatorPos + 1);
-
- // if it contains a / its not a tag and is part of the url
- if (tag.indexOf('/') === -1) {
- return {
- repository: input.slice(0, separatorPos),
- tag: tag
- };
- }
-
- return {
- repository: input
- };
-};
-
-
-module.exports.prepareBuildContext = function(file, next) {
- if (file && file.context) {
- fs.readFile(path.join(file.context, '.dockerignore'), (err, data) => {
- let ignoreFn;
- let filterFn;
-
- if (!err) {
- const dockerIgnore = DockerIgnore({ ignorecase: false }).add(data.toString());
-
- filterFn = dockerIgnore.createFilter();
- ignoreFn = (path) => {
- return !filterFn(path);
- }
- }
-
- const entries = file.src.slice() || []
-
- const pack = tar.pack(file.context, {
- entries: filterFn ? entries.filter(filterFn) : entries,
- ignore: ignoreFn // Only works on directories
- });
-
- next(pack.pipe(zlib.createGzip()));
- })
- } else {
- next(file);
- }
-}
diff --git a/node_modules/dockerode/lib/volume.js b/node_modules/dockerode/lib/volume.js
deleted file mode 100644
index 1284e35..0000000
--- a/node_modules/dockerode/lib/volume.js
+++ /dev/null
@@ -1,90 +0,0 @@
-var util = require('./util');
-
-/**
- * Represents a volume
- * @param {Object} modem docker-modem
- * @param {String} name Volume's name
- */
-var Volume = function(modem, name) {
- this.modem = modem;
- this.name = name;
-};
-
-Volume.prototype[require('util').inspect.custom] = function() { return this; };
-
-/**
- * Inspect
- * @param {Object} opts Options (optional)
- * @param {Function} callback Callback, if specified Docker will be queried.
- * @return {Object} Name only if callback isn't specified.
- */
-Volume.prototype.inspect = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/volumes/' + this.name,
- method: 'GET',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 200: true,
- 404: 'no such volume',
- 500: 'server error'
- }
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-/**
- * Removes the volume
- * @param {[Object]} opts Remove options (optional)
- * @param {Function} callback Callback
- */
-Volume.prototype.remove = function(opts, callback) {
- var self = this;
- var args = util.processArgs(opts, callback);
-
- var optsf = {
- path: '/volumes/' + this.name,
- method: 'DELETE',
- abortSignal: args.opts.abortSignal,
- statusCodes: {
- 204: true,
- 404: 'no such volume',
- 409: 'conflict',
- 500: 'server error'
- },
- options: args.opts
- };
-
- if(args.callback === undefined) {
- return new this.modem.Promise(function(resolve, reject) {
- self.modem.dial(optsf, function(err, data) {
- if (err) {
- return reject(err);
- }
- resolve(data);
- });
- });
- } else {
- this.modem.dial(optsf, function(err, data) {
- args.callback(err, data);
- });
- }
-};
-
-module.exports = Volume;
diff --git a/node_modules/dockerode/package.json b/node_modules/dockerode/package.json
deleted file mode 100644
index b8793d3..0000000
--- a/node_modules/dockerode/package.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "name": "dockerode",
- "description": "Docker Remote API module.",
- "version": "4.0.2",
- "author": "Pedro Dias ",
- "maintainers": [
- "apocas "
- ],
- "repository": {
- "type": "git",
- "url": "http://github.com/apocas/dockerode.git"
- },
- "keywords": [
- "docker",
- "docker.io"
- ],
- "dependencies": {
- "@balena/dockerignore": "^1.0.2",
- "docker-modem": "^5.0.3",
- "tar-fs": "~2.0.1"
- },
- "devDependencies": {
- "bluebird": "^3.7.0",
- "chai": "~4.2.0",
- "memorystream": "~0.3.0",
- "mocha": "^10.2.0"
- },
- "main": "./lib/docker",
- "scripts": {
- "test": "./node_modules/mocha/bin/mocha.js -R spec --exit"
- },
- "license": "Apache-2.0",
- "engines": {
- "node": ">= 8.0"
- }
-}
diff --git a/node_modules/end-of-stream/LICENSE b/node_modules/end-of-stream/LICENSE
deleted file mode 100644
index 757562e..0000000
--- a/node_modules/end-of-stream/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Mathias Buus
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/end-of-stream/README.md b/node_modules/end-of-stream/README.md
deleted file mode 100644
index 857b14b..0000000
--- a/node_modules/end-of-stream/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-# end-of-stream
-
-A node module that calls a callback when a readable/writable/duplex stream has completed or failed.
-
- npm install end-of-stream
-
-[](https://travis-ci.org/mafintosh/end-of-stream)
-
-## Usage
-
-Simply pass a stream and a callback to the `eos`.
-Both legacy streams, streams2 and stream3 are supported.
-
-``` js
-var eos = require('end-of-stream');
-
-eos(readableStream, function(err) {
- // this will be set to the stream instance
- if (err) return console.log('stream had an error or closed early');
- console.log('stream has ended', this === readableStream);
-});
-
-eos(writableStream, function(err) {
- if (err) return console.log('stream had an error or closed early');
- console.log('stream has finished', this === writableStream);
-});
-
-eos(duplexStream, function(err) {
- if (err) return console.log('stream had an error or closed early');
- console.log('stream has ended and finished', this === duplexStream);
-});
-
-eos(duplexStream, {readable:false}, function(err) {
- if (err) return console.log('stream had an error or closed early');
- console.log('stream has finished but might still be readable');
-});
-
-eos(duplexStream, {writable:false}, function(err) {
- if (err) return console.log('stream had an error or closed early');
- console.log('stream has ended but might still be writable');
-});
-
-eos(readableStream, {error:false}, function(err) {
- // do not treat emit('error', err) as a end-of-stream
-});
-```
-
-## License
-
-MIT
-
-## Related
-
-`end-of-stream` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one.
diff --git a/node_modules/end-of-stream/index.js b/node_modules/end-of-stream/index.js
deleted file mode 100644
index c77f0d5..0000000
--- a/node_modules/end-of-stream/index.js
+++ /dev/null
@@ -1,94 +0,0 @@
-var once = require('once');
-
-var noop = function() {};
-
-var isRequest = function(stream) {
- return stream.setHeader && typeof stream.abort === 'function';
-};
-
-var isChildProcess = function(stream) {
- return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
-};
-
-var eos = function(stream, opts, callback) {
- if (typeof opts === 'function') return eos(stream, null, opts);
- if (!opts) opts = {};
-
- callback = once(callback || noop);
-
- var ws = stream._writableState;
- var rs = stream._readableState;
- var readable = opts.readable || (opts.readable !== false && stream.readable);
- var writable = opts.writable || (opts.writable !== false && stream.writable);
- var cancelled = false;
-
- var onlegacyfinish = function() {
- if (!stream.writable) onfinish();
- };
-
- var onfinish = function() {
- writable = false;
- if (!readable) callback.call(stream);
- };
-
- var onend = function() {
- readable = false;
- if (!writable) callback.call(stream);
- };
-
- var onexit = function(exitCode) {
- callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
- };
-
- var onerror = function(err) {
- callback.call(stream, err);
- };
-
- var onclose = function() {
- process.nextTick(onclosenexttick);
- };
-
- var onclosenexttick = function() {
- if (cancelled) return;
- if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
- if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
- };
-
- var onrequest = function() {
- stream.req.on('finish', onfinish);
- };
-
- if (isRequest(stream)) {
- stream.on('complete', onfinish);
- stream.on('abort', onclose);
- if (stream.req) onrequest();
- else stream.on('request', onrequest);
- } else if (writable && !ws) { // legacy streams
- stream.on('end', onlegacyfinish);
- stream.on('close', onlegacyfinish);
- }
-
- if (isChildProcess(stream)) stream.on('exit', onexit);
-
- stream.on('end', onend);
- stream.on('finish', onfinish);
- if (opts.error !== false) stream.on('error', onerror);
- stream.on('close', onclose);
-
- return function() {
- cancelled = true;
- stream.removeListener('complete', onfinish);
- stream.removeListener('abort', onclose);
- stream.removeListener('request', onrequest);
- if (stream.req) stream.req.removeListener('finish', onfinish);
- stream.removeListener('end', onlegacyfinish);
- stream.removeListener('close', onlegacyfinish);
- stream.removeListener('finish', onfinish);
- stream.removeListener('exit', onexit);
- stream.removeListener('end', onend);
- stream.removeListener('error', onerror);
- stream.removeListener('close', onclose);
- };
-};
-
-module.exports = eos;
diff --git a/node_modules/end-of-stream/package.json b/node_modules/end-of-stream/package.json
deleted file mode 100644
index b75bbf0..0000000
--- a/node_modules/end-of-stream/package.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "name": "end-of-stream",
- "version": "1.4.4",
- "description": "Call a callback when a readable/writable/duplex stream has completed or failed.",
- "repository": {
- "type": "git",
- "url": "git://github.com/mafintosh/end-of-stream.git"
- },
- "dependencies": {
- "once": "^1.4.0"
- },
- "scripts": {
- "test": "node test.js"
- },
- "files": [
- "index.js"
- ],
- "keywords": [
- "stream",
- "streams",
- "callback",
- "finish",
- "close",
- "end",
- "wait"
- ],
- "bugs": {
- "url": "https://github.com/mafintosh/end-of-stream/issues"
- },
- "homepage": "https://github.com/mafintosh/end-of-stream",
- "main": "index.js",
- "author": "Mathias Buus ",
- "license": "MIT",
- "devDependencies": {
- "tape": "^4.11.0"
- }
-}
diff --git a/node_modules/fs-constants/LICENSE b/node_modules/fs-constants/LICENSE
deleted file mode 100644
index cb757e5..0000000
--- a/node_modules/fs-constants/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2018 Mathias Buus
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/node_modules/fs-constants/README.md b/node_modules/fs-constants/README.md
deleted file mode 100644
index 62b3374..0000000
--- a/node_modules/fs-constants/README.md
+++ /dev/null
@@ -1,26 +0,0 @@
-# fs-constants
-
-Small module that allows you to get the fs constants across
-Node and the browser.
-
-```
-npm install fs-constants
-```
-
-Previously you would use `require('constants')` for this in node but that has been
-deprecated and changed to `require('fs').constants` which does not browserify.
-
-This module uses `require('constants')` in the browser and `require('fs').constants` in node to work around this
-
-
-## Usage
-
-``` js
-var constants = require('fs-constants')
-
-console.log('constants:', constants)
-```
-
-## License
-
-MIT
diff --git a/node_modules/fs-constants/browser.js b/node_modules/fs-constants/browser.js
deleted file mode 100644
index 3c87638..0000000
--- a/node_modules/fs-constants/browser.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('constants')
diff --git a/node_modules/fs-constants/index.js b/node_modules/fs-constants/index.js
deleted file mode 100644
index 2a3aadf..0000000
--- a/node_modules/fs-constants/index.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('fs').constants || require('constants')
diff --git a/node_modules/fs-constants/package.json b/node_modules/fs-constants/package.json
deleted file mode 100644
index 6f2b8f2..0000000
--- a/node_modules/fs-constants/package.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "fs-constants",
- "version": "1.0.0",
- "description": "Require constants across node and the browser",
- "main": "index.js",
- "browser": "browser.js",
- "dependencies": {},
- "devDependencies": {},
- "repository": {
- "type": "git",
- "url": "https://github.com/mafintosh/fs-constants.git"
- },
- "author": "Mathias Buus (@mafintosh)",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/mafintosh/fs-constants/issues"
- },
- "homepage": "https://github.com/mafintosh/fs-constants"
-}
diff --git a/node_modules/https-proxy-agent/README.md b/node_modules/https-proxy-agent/README.md
deleted file mode 100644
index 328656a..0000000
--- a/node_modules/https-proxy-agent/README.md
+++ /dev/null
@@ -1,137 +0,0 @@
-https-proxy-agent
-================
-### An HTTP(s) proxy `http.Agent` implementation for HTTPS
-[](https://github.com/TooTallNate/node-https-proxy-agent/actions?workflow=Node+CI)
-
-This module provides an `http.Agent` implementation that connects to a specified
-HTTP or HTTPS proxy server, and can be used with the built-in `https` module.
-
-Specifically, this `Agent` implementation connects to an intermediary "proxy"
-server and issues the [CONNECT HTTP method][CONNECT], which tells the proxy to
-open a direct TCP connection to the destination server.
-
-Since this agent implements the CONNECT HTTP method, it also works with other
-protocols that use this method when connecting over proxies (i.e. WebSockets).
-See the "Examples" section below for more.
-
-
-Installation
-------------
-
-Install with `npm`:
-
-``` bash
-$ npm install https-proxy-agent
-```
-
-
-Examples
---------
-
-#### `https` module example
-
-``` js
-var url = require('url');
-var https = require('https');
-var HttpsProxyAgent = require('https-proxy-agent');
-
-// HTTP/HTTPS proxy to connect to
-var proxy = process.env.http_proxy || 'http://168.63.76.32:3128';
-console.log('using proxy server %j', proxy);
-
-// HTTPS endpoint for the proxy to connect to
-var endpoint = process.argv[2] || 'https://graph.facebook.com/tootallnate';
-console.log('attempting to GET %j', endpoint);
-var options = url.parse(endpoint);
-
-// create an instance of the `HttpsProxyAgent` class with the proxy server information
-var agent = new HttpsProxyAgent(proxy);
-options.agent = agent;
-
-https.get(options, function (res) {
- console.log('"response" event!', res.headers);
- res.pipe(process.stdout);
-});
-```
-
-#### `ws` WebSocket connection example
-
-``` js
-var url = require('url');
-var WebSocket = require('ws');
-var HttpsProxyAgent = require('https-proxy-agent');
-
-// HTTP/HTTPS proxy to connect to
-var proxy = process.env.http_proxy || 'http://168.63.76.32:3128';
-console.log('using proxy server %j', proxy);
-
-// WebSocket endpoint for the proxy to connect to
-var endpoint = process.argv[2] || 'ws://echo.websocket.org';
-var parsed = url.parse(endpoint);
-console.log('attempting to connect to WebSocket %j', endpoint);
-
-// create an instance of the `HttpsProxyAgent` class with the proxy server information
-var options = url.parse(proxy);
-
-var agent = new HttpsProxyAgent(options);
-
-// finally, initiate the WebSocket connection
-var socket = new WebSocket(endpoint, { agent: agent });
-
-socket.on('open', function () {
- console.log('"open" event!');
- socket.send('hello world');
-});
-
-socket.on('message', function (data, flags) {
- console.log('"message" event! %j %j', data, flags);
- socket.close();
-});
-```
-
-API
----
-
-### new HttpsProxyAgent(Object options)
-
-The `HttpsProxyAgent` class implements an `http.Agent` subclass that connects
-to the specified "HTTP(s) proxy server" in order to proxy HTTPS and/or WebSocket
-requests. This is achieved by using the [HTTP `CONNECT` method][CONNECT].
-
-The `options` argument may either be a string URI of the proxy server to use, or an
-"options" object with more specific properties:
-
- * `host` - String - Proxy host to connect to (may use `hostname` as well). Required.
- * `port` - Number - Proxy port to connect to. Required.
- * `protocol` - String - If `https:`, then use TLS to connect to the proxy.
- * `headers` - Object - Additional HTTP headers to be sent on the HTTP CONNECT method.
- * Any other options given are passed to the `net.connect()`/`tls.connect()` functions.
-
-
-License
--------
-
-(The MIT License)
-
-Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-'Software'), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-[CONNECT]: http://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_Tunneling
diff --git a/node_modules/https-proxy-agent/dist/agent.d.ts b/node_modules/https-proxy-agent/dist/agent.d.ts
deleted file mode 100644
index 4f1c636..0000000
--- a/node_modules/https-proxy-agent/dist/agent.d.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-///
-import net from 'net';
-import { Agent, ClientRequest, RequestOptions } from 'agent-base';
-import { HttpsProxyAgentOptions } from '.';
-/**
- * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
- * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
- *
- * Outgoing HTTP requests are first tunneled through the proxy server using the
- * `CONNECT` HTTP request method to establish a connection to the proxy server,
- * and then the proxy server connects to the destination target and issues the
- * HTTP request from the proxy server.
- *
- * `https:` requests have their socket connection upgraded to TLS once
- * the connection to the proxy server has been established.
- *
- * @api public
- */
-export default class HttpsProxyAgent extends Agent {
- private secureProxy;
- private proxy;
- constructor(_opts: string | HttpsProxyAgentOptions);
- /**
- * Called when the node-core HTTP client library is creating a
- * new HTTP request.
- *
- * @api protected
- */
- callback(req: ClientRequest, opts: RequestOptions): Promise;
-}
diff --git a/node_modules/https-proxy-agent/dist/agent.js b/node_modules/https-proxy-agent/dist/agent.js
deleted file mode 100644
index 75d1136..0000000
--- a/node_modules/https-proxy-agent/dist/agent.js
+++ /dev/null
@@ -1,177 +0,0 @@
-"use strict";
-var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
-};
-var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-Object.defineProperty(exports, "__esModule", { value: true });
-const net_1 = __importDefault(require("net"));
-const tls_1 = __importDefault(require("tls"));
-const url_1 = __importDefault(require("url"));
-const assert_1 = __importDefault(require("assert"));
-const debug_1 = __importDefault(require("debug"));
-const agent_base_1 = require("agent-base");
-const parse_proxy_response_1 = __importDefault(require("./parse-proxy-response"));
-const debug = debug_1.default('https-proxy-agent:agent');
-/**
- * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
- * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
- *
- * Outgoing HTTP requests are first tunneled through the proxy server using the
- * `CONNECT` HTTP request method to establish a connection to the proxy server,
- * and then the proxy server connects to the destination target and issues the
- * HTTP request from the proxy server.
- *
- * `https:` requests have their socket connection upgraded to TLS once
- * the connection to the proxy server has been established.
- *
- * @api public
- */
-class HttpsProxyAgent extends agent_base_1.Agent {
- constructor(_opts) {
- let opts;
- if (typeof _opts === 'string') {
- opts = url_1.default.parse(_opts);
- }
- else {
- opts = _opts;
- }
- if (!opts) {
- throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!');
- }
- debug('creating new HttpsProxyAgent instance: %o', opts);
- super(opts);
- const proxy = Object.assign({}, opts);
- // If `true`, then connect to the proxy server over TLS.
- // Defaults to `false`.
- this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol);
- // Prefer `hostname` over `host`, and set the `port` if needed.
- proxy.host = proxy.hostname || proxy.host;
- if (typeof proxy.port === 'string') {
- proxy.port = parseInt(proxy.port, 10);
- }
- if (!proxy.port && proxy.host) {
- proxy.port = this.secureProxy ? 443 : 80;
- }
- // ALPN is supported by Node.js >= v5.
- // attempt to negotiate http/1.1 for proxy servers that support http/2
- if (this.secureProxy && !('ALPNProtocols' in proxy)) {
- proxy.ALPNProtocols = ['http 1.1'];
- }
- if (proxy.host && proxy.path) {
- // If both a `host` and `path` are specified then it's most likely
- // the result of a `url.parse()` call... we need to remove the
- // `path` portion so that `net.connect()` doesn't attempt to open
- // that as a Unix socket file.
- delete proxy.path;
- delete proxy.pathname;
- }
- this.proxy = proxy;
- }
- /**
- * Called when the node-core HTTP client library is creating a
- * new HTTP request.
- *
- * @api protected
- */
- callback(req, opts) {
- return __awaiter(this, void 0, void 0, function* () {
- const { proxy, secureProxy } = this;
- // Create a socket connection to the proxy server.
- let socket;
- if (secureProxy) {
- debug('Creating `tls.Socket`: %o', proxy);
- socket = tls_1.default.connect(proxy);
- }
- else {
- debug('Creating `net.Socket`: %o', proxy);
- socket = net_1.default.connect(proxy);
- }
- const headers = Object.assign({}, proxy.headers);
- const hostname = `${opts.host}:${opts.port}`;
- let payload = `CONNECT ${hostname} HTTP/1.1\r\n`;
- // Inject the `Proxy-Authorization` header if necessary.
- if (proxy.auth) {
- headers['Proxy-Authorization'] = `Basic ${Buffer.from(proxy.auth).toString('base64')}`;
- }
- // The `Host` header should only include the port
- // number when it is not the default port.
- let { host, port, secureEndpoint } = opts;
- if (!isDefaultPort(port, secureEndpoint)) {
- host += `:${port}`;
- }
- headers.Host = host;
- headers.Connection = 'close';
- for (const name of Object.keys(headers)) {
- payload += `${name}: ${headers[name]}\r\n`;
- }
- const proxyResponsePromise = parse_proxy_response_1.default(socket);
- socket.write(`${payload}\r\n`);
- const { statusCode, buffered } = yield proxyResponsePromise;
- if (statusCode === 200) {
- req.once('socket', resume);
- if (opts.secureEndpoint) {
- // The proxy is connecting to a TLS server, so upgrade
- // this socket connection to a TLS connection.
- debug('Upgrading socket connection to TLS');
- const servername = opts.servername || opts.host;
- return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket,
- servername }));
- }
- return socket;
- }
- // Some other status code that's not 200... need to re-play the HTTP
- // header "data" events onto the socket once the HTTP machinery is
- // attached so that the node core `http` can parse and handle the
- // error status code.
- // Close the original socket, and a new "fake" socket is returned
- // instead, so that the proxy doesn't get the HTTP request
- // written to it (which may contain `Authorization` headers or other
- // sensitive data).
- //
- // See: https://hackerone.com/reports/541502
- socket.destroy();
- const fakeSocket = new net_1.default.Socket({ writable: false });
- fakeSocket.readable = true;
- // Need to wait for the "socket" event to re-play the "data" events.
- req.once('socket', (s) => {
- debug('replaying proxy buffer for failed request');
- assert_1.default(s.listenerCount('data') > 0);
- // Replay the "buffered" Buffer onto the fake `socket`, since at
- // this point the HTTP module machinery has been hooked up for
- // the user.
- s.push(buffered);
- s.push(null);
- });
- return fakeSocket;
- });
- }
-}
-exports.default = HttpsProxyAgent;
-function resume(socket) {
- socket.resume();
-}
-function isDefaultPort(port, secure) {
- return Boolean((!secure && port === 80) || (secure && port === 443));
-}
-function isHTTPS(protocol) {
- return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false;
-}
-function omit(obj, ...keys) {
- const ret = {};
- let key;
- for (key in obj) {
- if (!keys.includes(key)) {
- ret[key] = obj[key];
- }
- }
- return ret;
-}
-//# sourceMappingURL=agent.js.map
\ No newline at end of file
diff --git a/node_modules/https-proxy-agent/dist/agent.js.map b/node_modules/https-proxy-agent/dist/agent.js.map
deleted file mode 100644
index 0af6c17..0000000
--- a/node_modules/https-proxy-agent/dist/agent.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,8CAAsB;AACtB,8CAAsB;AACtB,8CAAsB;AACtB,oDAA4B;AAC5B,kDAAgC;AAEhC,2CAAkE;AAElE,kFAAwD;AAExD,MAAM,KAAK,GAAG,eAAW,CAAC,yBAAyB,CAAC,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,MAAqB,eAAgB,SAAQ,kBAAK;IAIjD,YAAY,KAAsC;QACjD,IAAI,IAA4B,CAAC;QACjC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC9B,IAAI,GAAG,aAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACxB;aAAM;YACN,IAAI,GAAG,KAAK,CAAC;SACb;QACD,IAAI,CAAC,IAAI,EAAE;YACV,MAAM,IAAI,KAAK,CACd,8DAA8D,CAC9D,CAAC;SACF;QACD,KAAK,CAAC,2CAA2C,EAAE,IAAI,CAAC,CAAC;QACzD,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,MAAM,KAAK,qBAAgC,IAAI,CAAE,CAAC;QAElD,wDAAwD;QACxD,uBAAuB;QACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAE/D,+DAA+D;QAC/D,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC;QAC1C,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;YACnC,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;SACtC;QACD,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE;YAC9B,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;SACzC;QAED,sCAAsC;QACtC,sEAAsE;QACtE,IAAI,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC,eAAe,IAAI,KAAK,CAAC,EAAE;YACpD,KAAK,CAAC,aAAa,GAAG,CAAC,UAAU,CAAC,CAAC;SACnC;QAED,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE;YAC7B,kEAAkE;YAClE,8DAA8D;YAC9D,iEAAiE;YACjE,8BAA8B;YAC9B,OAAO,KAAK,CAAC,IAAI,CAAC;YAClB,OAAO,KAAK,CAAC,QAAQ,CAAC;SACtB;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACG,QAAQ,CACb,GAAkB,EAClB,IAAoB;;YAEpB,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;YAEpC,kDAAkD;YAClD,IAAI,MAAkB,CAAC;YACvB,IAAI,WAAW,EAAE;gBAChB,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;gBAC1C,MAAM,GAAG,aAAG,CAAC,OAAO,CAAC,KAA8B,CAAC,CAAC;aACrD;iBAAM;gBACN,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;gBAC1C,MAAM,GAAG,aAAG,CAAC,OAAO,CAAC,KAA2B,CAAC,CAAC;aAClD;YAED,MAAM,OAAO,qBAA6B,KAAK,CAAC,OAAO,CAAE,CAAC;YAC1D,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YAC7C,IAAI,OAAO,GAAG,WAAW,QAAQ,eAAe,CAAC;YAEjD,wDAAwD;YACxD,IAAI,KAAK,CAAC,IAAI,EAAE;gBACf,OAAO,CAAC,qBAAqB,CAAC,GAAG,SAAS,MAAM,CAAC,IAAI,CACpD,KAAK,CAAC,IAAI,CACV,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;aACvB;YAED,iDAAiD;YACjD,0CAA0C;YAC1C,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;YAC1C,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,cAAc,CAAC,EAAE;gBACzC,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;aACnB;YACD,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;YAEpB,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC;YAC7B,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;gBACxC,OAAO,IAAI,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;aAC3C;YAED,MAAM,oBAAoB,GAAG,8BAAkB,CAAC,MAAM,CAAC,CAAC;YAExD,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,MAAM,CAAC,CAAC;YAE/B,MAAM,EACL,UAAU,EACV,QAAQ,EACR,GAAG,MAAM,oBAAoB,CAAC;YAE/B,IAAI,UAAU,KAAK,GAAG,EAAE;gBACvB,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;gBAE3B,IAAI,IAAI,CAAC,cAAc,EAAE;oBACxB,sDAAsD;oBACtD,8CAA8C;oBAC9C,KAAK,CAAC,oCAAoC,CAAC,CAAC;oBAC5C,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC;oBAChD,OAAO,aAAG,CAAC,OAAO,iCACd,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,KACjD,MAAM;wBACN,UAAU,IACT,CAAC;iBACH;gBAED,OAAO,MAAM,CAAC;aACd;YAED,oEAAoE;YACpE,kEAAkE;YAClE,iEAAiE;YACjE,qBAAqB;YAErB,iEAAiE;YACjE,0DAA0D;YAC1D,oEAAoE;YACpE,mBAAmB;YACnB,EAAE;YACF,4CAA4C;YAC5C,MAAM,CAAC,OAAO,EAAE,CAAC;YAEjB,MAAM,UAAU,GAAG,IAAI,aAAG,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;YACvD,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC;YAE3B,oEAAoE;YACpE,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAa,EAAE,EAAE;gBACpC,KAAK,CAAC,2CAA2C,CAAC,CAAC;gBACnD,gBAAM,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;gBAEpC,gEAAgE;gBAChE,8DAA8D;gBAC9D,YAAY;gBACZ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACjB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACd,CAAC,CAAC,CAAC;YAEH,OAAO,UAAU,CAAC;QACnB,CAAC;KAAA;CACD;AA3JD,kCA2JC;AAED,SAAS,MAAM,CAAC,MAAkC;IACjD,MAAM,CAAC,MAAM,EAAE,CAAC;AACjB,CAAC;AAED,SAAS,aAAa,CAAC,IAAY,EAAE,MAAe;IACnD,OAAO,OAAO,CAAC,CAAC,CAAC,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;AACtE,CAAC;AAED,SAAS,OAAO,CAAC,QAAwB;IACxC,OAAO,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC3E,CAAC;AAED,SAAS,IAAI,CACZ,GAAM,EACN,GAAG,IAAO;IAIV,MAAM,GAAG,GAAG,EAEX,CAAC;IACF,IAAI,GAAqB,CAAC;IAC1B,KAAK,GAAG,IAAI,GAAG,EAAE;QAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACxB,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;SACpB;KACD;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"}
\ No newline at end of file
diff --git a/node_modules/https-proxy-agent/dist/index.d.ts b/node_modules/https-proxy-agent/dist/index.d.ts
deleted file mode 100644
index 0d60062..0000000
--- a/node_modules/https-proxy-agent/dist/index.d.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-///
-import net from 'net';
-import tls from 'tls';
-import { Url } from 'url';
-import { AgentOptions } from 'agent-base';
-import { OutgoingHttpHeaders } from 'http';
-import _HttpsProxyAgent from './agent';
-declare function createHttpsProxyAgent(opts: string | createHttpsProxyAgent.HttpsProxyAgentOptions): _HttpsProxyAgent;
-declare namespace createHttpsProxyAgent {
- interface BaseHttpsProxyAgentOptions {
- headers?: OutgoingHttpHeaders;
- secureProxy?: boolean;
- host?: string | null;
- path?: string | null;
- port?: string | number | null;
- }
- export interface HttpsProxyAgentOptions extends AgentOptions, BaseHttpsProxyAgentOptions, Partial> {
- }
- export type HttpsProxyAgent = _HttpsProxyAgent;
- export const HttpsProxyAgent: typeof _HttpsProxyAgent;
- export {};
-}
-export = createHttpsProxyAgent;
diff --git a/node_modules/https-proxy-agent/dist/index.js b/node_modules/https-proxy-agent/dist/index.js
deleted file mode 100644
index b03e763..0000000
--- a/node_modules/https-proxy-agent/dist/index.js
+++ /dev/null
@@ -1,14 +0,0 @@
-"use strict";
-var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-const agent_1 = __importDefault(require("./agent"));
-function createHttpsProxyAgent(opts) {
- return new agent_1.default(opts);
-}
-(function (createHttpsProxyAgent) {
- createHttpsProxyAgent.HttpsProxyAgent = agent_1.default;
- createHttpsProxyAgent.prototype = agent_1.default.prototype;
-})(createHttpsProxyAgent || (createHttpsProxyAgent = {}));
-module.exports = createHttpsProxyAgent;
-//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/https-proxy-agent/dist/index.js.map b/node_modules/https-proxy-agent/dist/index.js.map
deleted file mode 100644
index f3ce559..0000000
--- a/node_modules/https-proxy-agent/dist/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAKA,oDAAuC;AAEvC,SAAS,qBAAqB,CAC7B,IAA2D;IAE3D,OAAO,IAAI,eAAgB,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC;AAED,WAAU,qBAAqB;IAoBjB,qCAAe,GAAG,eAAgB,CAAC;IAEhD,qBAAqB,CAAC,SAAS,GAAG,eAAgB,CAAC,SAAS,CAAC;AAC9D,CAAC,EAvBS,qBAAqB,KAArB,qBAAqB,QAuB9B;AAED,iBAAS,qBAAqB,CAAC"}
\ No newline at end of file
diff --git a/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts b/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts
deleted file mode 100644
index 7565674..0000000
--- a/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-///
-import { Readable } from 'stream';
-export interface ProxyResponse {
- statusCode: number;
- buffered: Buffer;
-}
-export default function parseProxyResponse(socket: Readable): Promise;
diff --git a/node_modules/https-proxy-agent/dist/parse-proxy-response.js b/node_modules/https-proxy-agent/dist/parse-proxy-response.js
deleted file mode 100644
index aa5ce3c..0000000
--- a/node_modules/https-proxy-agent/dist/parse-proxy-response.js
+++ /dev/null
@@ -1,66 +0,0 @@
-"use strict";
-var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-Object.defineProperty(exports, "__esModule", { value: true });
-const debug_1 = __importDefault(require("debug"));
-const debug = debug_1.default('https-proxy-agent:parse-proxy-response');
-function parseProxyResponse(socket) {
- return new Promise((resolve, reject) => {
- // we need to buffer any HTTP traffic that happens with the proxy before we get
- // the CONNECT response, so that if the response is anything other than an "200"
- // response code, then we can re-play the "data" events on the socket once the
- // HTTP parser is hooked up...
- let buffersLength = 0;
- const buffers = [];
- function read() {
- const b = socket.read();
- if (b)
- ondata(b);
- else
- socket.once('readable', read);
- }
- function cleanup() {
- socket.removeListener('end', onend);
- socket.removeListener('error', onerror);
- socket.removeListener('close', onclose);
- socket.removeListener('readable', read);
- }
- function onclose(err) {
- debug('onclose had error %o', err);
- }
- function onend() {
- debug('onend');
- }
- function onerror(err) {
- cleanup();
- debug('onerror %o', err);
- reject(err);
- }
- function ondata(b) {
- buffers.push(b);
- buffersLength += b.length;
- const buffered = Buffer.concat(buffers, buffersLength);
- const endOfHeaders = buffered.indexOf('\r\n\r\n');
- if (endOfHeaders === -1) {
- // keep buffering
- debug('have not received end of HTTP headers yet...');
- read();
- return;
- }
- const firstLine = buffered.toString('ascii', 0, buffered.indexOf('\r\n'));
- const statusCode = +firstLine.split(' ')[1];
- debug('got proxy server response: %o', firstLine);
- resolve({
- statusCode,
- buffered
- });
- }
- socket.on('error', onerror);
- socket.on('close', onclose);
- socket.on('end', onend);
- read();
- });
-}
-exports.default = parseProxyResponse;
-//# sourceMappingURL=parse-proxy-response.js.map
\ No newline at end of file
diff --git a/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map b/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map
deleted file mode 100644
index bacdb84..0000000
--- a/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"parse-proxy-response.js","sourceRoot":"","sources":["../src/parse-proxy-response.ts"],"names":[],"mappings":";;;;;AAAA,kDAAgC;AAGhC,MAAM,KAAK,GAAG,eAAW,CAAC,wCAAwC,CAAC,CAAC;AAOpE,SAAwB,kBAAkB,CACzC,MAAgB;IAEhB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,+EAA+E;QAC/E,gFAAgF;QAChF,8EAA8E;QAC9E,8BAA8B;QAC9B,IAAI,aAAa,GAAG,CAAC,CAAC;QACtB,MAAM,OAAO,GAAa,EAAE,CAAC;QAE7B,SAAS,IAAI;YACZ,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;YACxB,IAAI,CAAC;gBAAE,MAAM,CAAC,CAAC,CAAC,CAAC;;gBACZ,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACpC,CAAC;QAED,SAAS,OAAO;YACf,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YACpC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACxC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACxC,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACzC,CAAC;QAED,SAAS,OAAO,CAAC,GAAW;YAC3B,KAAK,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAC;QACpC,CAAC;QAED,SAAS,KAAK;YACb,KAAK,CAAC,OAAO,CAAC,CAAC;QAChB,CAAC;QAED,SAAS,OAAO,CAAC,GAAU;YAC1B,OAAO,EAAE,CAAC;YACV,KAAK,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;YACzB,MAAM,CAAC,GAAG,CAAC,CAAC;QACb,CAAC;QAED,SAAS,MAAM,CAAC,CAAS;YACxB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAChB,aAAa,IAAI,CAAC,CAAC,MAAM,CAAC;YAE1B,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;YACvD,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;YAElD,IAAI,YAAY,KAAK,CAAC,CAAC,EAAE;gBACxB,iBAAiB;gBACjB,KAAK,CAAC,8CAA8C,CAAC,CAAC;gBACtD,IAAI,EAAE,CAAC;gBACP,OAAO;aACP;YAED,MAAM,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAClC,OAAO,EACP,CAAC,EACD,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CACxB,CAAC;YACF,MAAM,UAAU,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5C,KAAK,CAAC,+BAA+B,EAAE,SAAS,CAAC,CAAC;YAClD,OAAO,CAAC;gBACP,UAAU;gBACV,QAAQ;aACR,CAAC,CAAC;QACJ,CAAC;QAED,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC5B,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC5B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAExB,IAAI,EAAE,CAAC;IACR,CAAC,CAAC,CAAC;AACJ,CAAC;AAvED,qCAuEC"}
\ No newline at end of file
diff --git a/node_modules/https-proxy-agent/package.json b/node_modules/https-proxy-agent/package.json
deleted file mode 100644
index fb2aba1..0000000
--- a/node_modules/https-proxy-agent/package.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
- "name": "https-proxy-agent",
- "version": "5.0.1",
- "description": "An HTTP(s) proxy `http.Agent` implementation for HTTPS",
- "main": "dist/index",
- "types": "dist/index",
- "files": [
- "dist"
- ],
- "scripts": {
- "prebuild": "rimraf dist",
- "build": "tsc",
- "test": "mocha --reporter spec",
- "test-lint": "eslint src --ext .js,.ts",
- "prepublishOnly": "npm run build"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/TooTallNate/node-https-proxy-agent.git"
- },
- "keywords": [
- "https",
- "proxy",
- "endpoint",
- "agent"
- ],
- "author": "Nathan Rajlich (http://n8.io/)",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/TooTallNate/node-https-proxy-agent/issues"
- },
- "dependencies": {
- "agent-base": "6",
- "debug": "4"
- },
- "devDependencies": {
- "@types/debug": "4",
- "@types/node": "^12.12.11",
- "@typescript-eslint/eslint-plugin": "1.6.0",
- "@typescript-eslint/parser": "1.1.0",
- "eslint": "5.16.0",
- "eslint-config-airbnb": "17.1.0",
- "eslint-config-prettier": "4.1.0",
- "eslint-import-resolver-typescript": "1.1.1",
- "eslint-plugin-import": "2.16.0",
- "eslint-plugin-jsx-a11y": "6.2.1",
- "eslint-plugin-react": "7.12.4",
- "mocha": "^6.2.2",
- "proxy": "1",
- "rimraf": "^3.0.0",
- "typescript": "^3.5.3"
- },
- "engines": {
- "node": ">= 6"
- }
-}
diff --git a/node_modules/ieee754/LICENSE b/node_modules/ieee754/LICENSE
deleted file mode 100644
index 5aac82c..0000000
--- a/node_modules/ieee754/LICENSE
+++ /dev/null
@@ -1,11 +0,0 @@
-Copyright 2008 Fair Oaks Labs, Inc.
-
-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 the copyright holder 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/ieee754/README.md b/node_modules/ieee754/README.md
deleted file mode 100644
index cb7527b..0000000
--- a/node_modules/ieee754/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-# ieee754 [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
-
-[travis-image]: https://img.shields.io/travis/feross/ieee754/master.svg
-[travis-url]: https://travis-ci.org/feross/ieee754
-[npm-image]: https://img.shields.io/npm/v/ieee754.svg
-[npm-url]: https://npmjs.org/package/ieee754
-[downloads-image]: https://img.shields.io/npm/dm/ieee754.svg
-[downloads-url]: https://npmjs.org/package/ieee754
-[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
-[standard-url]: https://standardjs.com
-
-[![saucelabs][saucelabs-image]][saucelabs-url]
-
-[saucelabs-image]: https://saucelabs.com/browser-matrix/ieee754.svg
-[saucelabs-url]: https://saucelabs.com/u/ieee754
-
-### Read/write IEEE754 floating point numbers from/to a Buffer or array-like object.
-
-## install
-
-```
-npm install ieee754
-```
-
-## methods
-
-`var ieee754 = require('ieee754')`
-
-The `ieee754` object has the following functions:
-
-```
-ieee754.read = function (buffer, offset, isLE, mLen, nBytes)
-ieee754.write = function (buffer, value, offset, isLE, mLen, nBytes)
-```
-
-The arguments mean the following:
-
-- buffer = the buffer
-- offset = offset into the buffer
-- value = value to set (only for `write`)
-- isLe = is little endian?
-- mLen = mantissa length
-- nBytes = number of bytes
-
-## what is ieee754?
-
-The IEEE Standard for Floating-Point Arithmetic (IEEE 754) is a technical standard for floating-point computation. [Read more](http://en.wikipedia.org/wiki/IEEE_floating_point).
-
-## license
-
-BSD 3 Clause. Copyright (c) 2008, Fair Oaks Labs, Inc.
diff --git a/node_modules/ieee754/index.d.ts b/node_modules/ieee754/index.d.ts
deleted file mode 100644
index f1e4354..0000000
--- a/node_modules/ieee754/index.d.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-declare namespace ieee754 {
- export function read(
- buffer: Uint8Array, offset: number, isLE: boolean, mLen: number,
- nBytes: number): number;
- export function write(
- buffer: Uint8Array, value: number, offset: number, isLE: boolean,
- mLen: number, nBytes: number): void;
- }
-
- export = ieee754;
\ No newline at end of file
diff --git a/node_modules/ieee754/index.js b/node_modules/ieee754/index.js
deleted file mode 100644
index 81d26c3..0000000
--- a/node_modules/ieee754/index.js
+++ /dev/null
@@ -1,85 +0,0 @@
-/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */
-exports.read = function (buffer, offset, isLE, mLen, nBytes) {
- var e, m
- var eLen = (nBytes * 8) - mLen - 1
- var eMax = (1 << eLen) - 1
- var eBias = eMax >> 1
- var nBits = -7
- var i = isLE ? (nBytes - 1) : 0
- var d = isLE ? -1 : 1
- var s = buffer[offset + i]
-
- i += d
-
- e = s & ((1 << (-nBits)) - 1)
- s >>= (-nBits)
- nBits += eLen
- for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
-
- m = e & ((1 << (-nBits)) - 1)
- e >>= (-nBits)
- nBits += mLen
- for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
-
- if (e === 0) {
- e = 1 - eBias
- } else if (e === eMax) {
- return m ? NaN : ((s ? -1 : 1) * Infinity)
- } else {
- m = m + Math.pow(2, mLen)
- e = e - eBias
- }
- return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
-}
-
-exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
- var e, m, c
- var eLen = (nBytes * 8) - mLen - 1
- var eMax = (1 << eLen) - 1
- var eBias = eMax >> 1
- var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
- var i = isLE ? 0 : (nBytes - 1)
- var d = isLE ? 1 : -1
- var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
-
- value = Math.abs(value)
-
- if (isNaN(value) || value === Infinity) {
- m = isNaN(value) ? 1 : 0
- e = eMax
- } else {
- e = Math.floor(Math.log(value) / Math.LN2)
- if (value * (c = Math.pow(2, -e)) < 1) {
- e--
- c *= 2
- }
- if (e + eBias >= 1) {
- value += rt / c
- } else {
- value += rt * Math.pow(2, 1 - eBias)
- }
- if (value * c >= 2) {
- e++
- c /= 2
- }
-
- if (e + eBias >= eMax) {
- m = 0
- e = eMax
- } else if (e + eBias >= 1) {
- m = ((value * c) - 1) * Math.pow(2, mLen)
- e = e + eBias
- } else {
- m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
- e = 0
- }
- }
-
- for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
-
- e = (e << mLen) | m
- eLen += mLen
- for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
-
- buffer[offset + i - d] |= s * 128
-}
diff --git a/node_modules/ieee754/package.json b/node_modules/ieee754/package.json
deleted file mode 100644
index 7b23851..0000000
--- a/node_modules/ieee754/package.json
+++ /dev/null
@@ -1,52 +0,0 @@
-{
- "name": "ieee754",
- "description": "Read/write IEEE754 floating point numbers from/to a Buffer or array-like object",
- "version": "1.2.1",
- "author": {
- "name": "Feross Aboukhadijeh",
- "email": "feross@feross.org",
- "url": "https://feross.org"
- },
- "contributors": [
- "Romain Beauxis "
- ],
- "devDependencies": {
- "airtap": "^3.0.0",
- "standard": "*",
- "tape": "^5.0.1"
- },
- "keywords": [
- "IEEE 754",
- "buffer",
- "convert",
- "floating point",
- "ieee754"
- ],
- "license": "BSD-3-Clause",
- "main": "index.js",
- "types": "index.d.ts",
- "repository": {
- "type": "git",
- "url": "git://github.com/feross/ieee754.git"
- },
- "scripts": {
- "test": "standard && npm run test-node && npm run test-browser",
- "test-browser": "airtap -- test/*.js",
- "test-browser-local": "airtap --local -- test/*.js",
- "test-node": "tape test/*.js"
- },
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ]
-}
diff --git a/node_modules/inherits/LICENSE b/node_modules/inherits/LICENSE
deleted file mode 100644
index dea3013..0000000
--- a/node_modules/inherits/LICENSE
+++ /dev/null
@@ -1,16 +0,0 @@
-The ISC License
-
-Copyright (c) Isaac Z. Schlueter
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
-
diff --git a/node_modules/inherits/README.md b/node_modules/inherits/README.md
deleted file mode 100644
index b1c5665..0000000
--- a/node_modules/inherits/README.md
+++ /dev/null
@@ -1,42 +0,0 @@
-Browser-friendly inheritance fully compatible with standard node.js
-[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).
-
-This package exports standard `inherits` from node.js `util` module in
-node environment, but also provides alternative browser-friendly
-implementation through [browser
-field](https://gist.github.com/shtylman/4339901). Alternative
-implementation is a literal copy of standard one located in standalone
-module to avoid requiring of `util`. It also has a shim for old
-browsers with no `Object.create` support.
-
-While keeping you sure you are using standard `inherits`
-implementation in node.js environment, it allows bundlers such as
-[browserify](https://github.com/substack/node-browserify) to not
-include full `util` package to your client code if all you need is
-just `inherits` function. It worth, because browser shim for `util`
-package is large and `inherits` is often the single function you need
-from it.
-
-It's recommended to use this package instead of
-`require('util').inherits` for any code that has chances to be used
-not only in node.js but in browser too.
-
-## usage
-
-```js
-var inherits = require('inherits');
-// then use exactly as the standard one
-```
-
-## note on version ~1.0
-
-Version ~1.0 had completely different motivation and is not compatible
-neither with 2.0 nor with standard node.js `inherits`.
-
-If you are using version ~1.0 and planning to switch to ~2.0, be
-careful:
-
-* new version uses `super_` instead of `super` for referencing
- superclass
-* new version overwrites current prototype while old one preserves any
- existing fields on it
diff --git a/node_modules/inherits/inherits.js b/node_modules/inherits/inherits.js
deleted file mode 100644
index f71f2d9..0000000
--- a/node_modules/inherits/inherits.js
+++ /dev/null
@@ -1,9 +0,0 @@
-try {
- var util = require('util');
- /* istanbul ignore next */
- if (typeof util.inherits !== 'function') throw '';
- module.exports = util.inherits;
-} catch (e) {
- /* istanbul ignore next */
- module.exports = require('./inherits_browser.js');
-}
diff --git a/node_modules/inherits/inherits_browser.js b/node_modules/inherits/inherits_browser.js
deleted file mode 100644
index 86bbb3d..0000000
--- a/node_modules/inherits/inherits_browser.js
+++ /dev/null
@@ -1,27 +0,0 @@
-if (typeof Object.create === 'function') {
- // implementation from standard node.js 'util' module
- module.exports = function inherits(ctor, superCtor) {
- if (superCtor) {
- ctor.super_ = superCtor
- ctor.prototype = Object.create(superCtor.prototype, {
- constructor: {
- value: ctor,
- enumerable: false,
- writable: true,
- configurable: true
- }
- })
- }
- };
-} else {
- // old school shim for old browsers
- module.exports = function inherits(ctor, superCtor) {
- if (superCtor) {
- ctor.super_ = superCtor
- var TempCtor = function () {}
- TempCtor.prototype = superCtor.prototype
- ctor.prototype = new TempCtor()
- ctor.prototype.constructor = ctor
- }
- }
-}
diff --git a/node_modules/inherits/package.json b/node_modules/inherits/package.json
deleted file mode 100644
index 37b4366..0000000
--- a/node_modules/inherits/package.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "name": "inherits",
- "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()",
- "version": "2.0.4",
- "keywords": [
- "inheritance",
- "class",
- "klass",
- "oop",
- "object-oriented",
- "inherits",
- "browser",
- "browserify"
- ],
- "main": "./inherits.js",
- "browser": "./inherits_browser.js",
- "repository": "git://github.com/isaacs/inherits",
- "license": "ISC",
- "scripts": {
- "test": "tap"
- },
- "devDependencies": {
- "tap": "^14.2.4"
- },
- "files": [
- "inherits.js",
- "inherits_browser.js"
- ]
-}
diff --git a/node_modules/mime-db/HISTORY.md b/node_modules/mime-db/HISTORY.md
deleted file mode 100644
index 7436f64..0000000
--- a/node_modules/mime-db/HISTORY.md
+++ /dev/null
@@ -1,507 +0,0 @@
-1.52.0 / 2022-02-21
-===================
-
- * Add extensions from IANA for more `image/*` types
- * Add extension `.asc` to `application/pgp-keys`
- * Add extensions to various XML types
- * Add new upstream MIME types
-
-1.51.0 / 2021-11-08
-===================
-
- * Add new upstream MIME types
- * Mark `image/vnd.microsoft.icon` as compressible
- * Mark `image/vnd.ms-dds` as compressible
-
-1.50.0 / 2021-09-15
-===================
-
- * Add deprecated iWorks mime types and extensions
- * Add new upstream MIME types
-
-1.49.0 / 2021-07-26
-===================
-
- * Add extension `.trig` to `application/trig`
- * Add new upstream MIME types
-
-1.48.0 / 2021-05-30
-===================
-
- * Add extension `.mvt` to `application/vnd.mapbox-vector-tile`
- * Add new upstream MIME types
- * Mark `text/yaml` as compressible
-
-1.47.0 / 2021-04-01
-===================
-
- * Add new upstream MIME types
- * Remove ambigious extensions from IANA for `application/*+xml` types
- * Update primary extension to `.es` for `application/ecmascript`
-
-1.46.0 / 2021-02-13
-===================
-
- * Add extension `.amr` to `audio/amr`
- * Add extension `.m4s` to `video/iso.segment`
- * Add extension `.opus` to `audio/ogg`
- * Add new upstream MIME types
-
-1.45.0 / 2020-09-22
-===================
-
- * Add `application/ubjson` with extension `.ubj`
- * Add `image/avif` with extension `.avif`
- * Add `image/ktx2` with extension `.ktx2`
- * Add extension `.dbf` to `application/vnd.dbf`
- * Add extension `.rar` to `application/vnd.rar`
- * Add extension `.td` to `application/urc-targetdesc+xml`
- * Add new upstream MIME types
- * Fix extension of `application/vnd.apple.keynote` to be `.key`
-
-1.44.0 / 2020-04-22
-===================
-
- * Add charsets from IANA
- * Add extension `.cjs` to `application/node`
- * Add new upstream MIME types
-
-1.43.0 / 2020-01-05
-===================
-
- * Add `application/x-keepass2` with extension `.kdbx`
- * Add extension `.mxmf` to `audio/mobile-xmf`
- * Add extensions from IANA for `application/*+xml` types
- * Add new upstream MIME types
-
-1.42.0 / 2019-09-25
-===================
-
- * Add `image/vnd.ms-dds` with extension `.dds`
- * Add new upstream MIME types
- * Remove compressible from `multipart/mixed`
-
-1.41.0 / 2019-08-30
-===================
-
- * Add new upstream MIME types
- * Add `application/toml` with extension `.toml`
- * Mark `font/ttf` as compressible
-
-1.40.0 / 2019-04-20
-===================
-
- * Add extensions from IANA for `model/*` types
- * Add `text/mdx` with extension `.mdx`
-
-1.39.0 / 2019-04-04
-===================
-
- * Add extensions `.siv` and `.sieve` to `application/sieve`
- * Add new upstream MIME types
-
-1.38.0 / 2019-02-04
-===================
-
- * Add extension `.nq` to `application/n-quads`
- * Add extension `.nt` to `application/n-triples`
- * Add new upstream MIME types
- * Mark `text/less` as compressible
-
-1.37.0 / 2018-10-19
-===================
-
- * Add extensions to HEIC image types
- * Add new upstream MIME types
-
-1.36.0 / 2018-08-20
-===================
-
- * Add Apple file extensions from IANA
- * Add extensions from IANA for `image/*` types
- * Add new upstream MIME types
-
-1.35.0 / 2018-07-15
-===================
-
- * Add extension `.owl` to `application/rdf+xml`
- * Add new upstream MIME types
- - Removes extension `.woff` from `application/font-woff`
-
-1.34.0 / 2018-06-03
-===================
-
- * Add extension `.csl` to `application/vnd.citationstyles.style+xml`
- * Add extension `.es` to `application/ecmascript`
- * Add new upstream MIME types
- * Add `UTF-8` as default charset for `text/turtle`
- * Mark all XML-derived types as compressible
-
-1.33.0 / 2018-02-15
-===================
-
- * Add extensions from IANA for `message/*` types
- * Add new upstream MIME types
- * Fix some incorrect OOXML types
- * Remove `application/font-woff2`
-
-1.32.0 / 2017-11-29
-===================
-
- * Add new upstream MIME types
- * Update `text/hjson` to registered `application/hjson`
- * Add `text/shex` with extension `.shex`
-
-1.31.0 / 2017-10-25
-===================
-
- * Add `application/raml+yaml` with extension `.raml`
- * Add `application/wasm` with extension `.wasm`
- * Add new `font` type from IANA
- * Add new upstream font extensions
- * Add new upstream MIME types
- * Add extensions for JPEG-2000 images
-
-1.30.0 / 2017-08-27
-===================
-
- * Add `application/vnd.ms-outlook`
- * Add `application/x-arj`
- * Add extension `.mjs` to `application/javascript`
- * Add glTF types and extensions
- * Add new upstream MIME types
- * Add `text/x-org`
- * Add VirtualBox MIME types
- * Fix `source` records for `video/*` types that are IANA
- * Update `font/opentype` to registered `font/otf`
-
-1.29.0 / 2017-07-10
-===================
-
- * Add `application/fido.trusted-apps+json`
- * Add extension `.wadl` to `application/vnd.sun.wadl+xml`
- * Add new upstream MIME types
- * Add `UTF-8` as default charset for `text/css`
-
-1.28.0 / 2017-05-14
-===================
-
- * Add new upstream MIME types
- * Add extension `.gz` to `application/gzip`
- * Update extensions `.md` and `.markdown` to be `text/markdown`
-
-1.27.0 / 2017-03-16
-===================
-
- * Add new upstream MIME types
- * Add `image/apng` with extension `.apng`
-
-1.26.0 / 2017-01-14
-===================
-
- * Add new upstream MIME types
- * Add extension `.geojson` to `application/geo+json`
-
-1.25.0 / 2016-11-11
-===================
-
- * Add new upstream MIME types
-
-1.24.0 / 2016-09-18
-===================
-
- * Add `audio/mp3`
- * Add new upstream MIME types
-
-1.23.0 / 2016-05-01
-===================
-
- * Add new upstream MIME types
- * Add extension `.3gpp` to `audio/3gpp`
-
-1.22.0 / 2016-02-15
-===================
-
- * Add `text/slim`
- * Add extension `.rng` to `application/xml`
- * Add new upstream MIME types
- * Fix extension of `application/dash+xml` to be `.mpd`
- * Update primary extension to `.m4a` for `audio/mp4`
-
-1.21.0 / 2016-01-06
-===================
-
- * Add Google document types
- * Add new upstream MIME types
-
-1.20.0 / 2015-11-10
-===================
-
- * Add `text/x-suse-ymp`
- * Add new upstream MIME types
-
-1.19.0 / 2015-09-17
-===================
-
- * Add `application/vnd.apple.pkpass`
- * Add new upstream MIME types
-
-1.18.0 / 2015-09-03
-===================
-
- * Add new upstream MIME types
-
-1.17.0 / 2015-08-13
-===================
-
- * Add `application/x-msdos-program`
- * Add `audio/g711-0`
- * Add `image/vnd.mozilla.apng`
- * Add extension `.exe` to `application/x-msdos-program`
-
-1.16.0 / 2015-07-29
-===================
-
- * Add `application/vnd.uri-map`
-
-1.15.0 / 2015-07-13
-===================
-
- * Add `application/x-httpd-php`
-
-1.14.0 / 2015-06-25
-===================
-
- * Add `application/scim+json`
- * Add `application/vnd.3gpp.ussd+xml`
- * Add `application/vnd.biopax.rdf+xml`
- * Add `text/x-processing`
-
-1.13.0 / 2015-06-07
-===================
-
- * Add nginx as a source
- * Add `application/x-cocoa`
- * Add `application/x-java-archive-diff`
- * Add `application/x-makeself`
- * Add `application/x-perl`
- * Add `application/x-pilot`
- * Add `application/x-redhat-package-manager`
- * Add `application/x-sea`
- * Add `audio/x-m4a`
- * Add `audio/x-realaudio`
- * Add `image/x-jng`
- * Add `text/mathml`
-
-1.12.0 / 2015-06-05
-===================
-
- * Add `application/bdoc`
- * Add `application/vnd.hyperdrive+json`
- * Add `application/x-bdoc`
- * Add extension `.rtf` to `text/rtf`
-
-1.11.0 / 2015-05-31
-===================
-
- * Add `audio/wav`
- * Add `audio/wave`
- * Add extension `.litcoffee` to `text/coffeescript`
- * Add extension `.sfd-hdstx` to `application/vnd.hydrostatix.sof-data`
- * Add extension `.n-gage` to `application/vnd.nokia.n-gage.symbian.install`
-
-1.10.0 / 2015-05-19
-===================
-
- * Add `application/vnd.balsamiq.bmpr`
- * Add `application/vnd.microsoft.portable-executable`
- * Add `application/x-ns-proxy-autoconfig`
-
-1.9.1 / 2015-04-19
-==================
-
- * Remove `.json` extension from `application/manifest+json`
- - This is causing bugs downstream
-
-1.9.0 / 2015-04-19
-==================
-
- * Add `application/manifest+json`
- * Add `application/vnd.micro+json`
- * Add `image/vnd.zbrush.pcx`
- * Add `image/x-ms-bmp`
-
-1.8.0 / 2015-03-13
-==================
-
- * Add `application/vnd.citationstyles.style+xml`
- * Add `application/vnd.fastcopy-disk-image`
- * Add `application/vnd.gov.sk.xmldatacontainer+xml`
- * Add extension `.jsonld` to `application/ld+json`
-
-1.7.0 / 2015-02-08
-==================
-
- * Add `application/vnd.gerber`
- * Add `application/vnd.msa-disk-image`
-
-1.6.1 / 2015-02-05
-==================
-
- * Community extensions ownership transferred from `node-mime`
-
-1.6.0 / 2015-01-29
-==================
-
- * Add `application/jose`
- * Add `application/jose+json`
- * Add `application/json-seq`
- * Add `application/jwk+json`
- * Add `application/jwk-set+json`
- * Add `application/jwt`
- * Add `application/rdap+json`
- * Add `application/vnd.gov.sk.e-form+xml`
- * Add `application/vnd.ims.imsccv1p3`
-
-1.5.0 / 2014-12-30
-==================
-
- * Add `application/vnd.oracle.resource+json`
- * Fix various invalid MIME type entries
- - `application/mbox+xml`
- - `application/oscp-response`
- - `application/vwg-multiplexed`
- - `audio/g721`
-
-1.4.0 / 2014-12-21
-==================
-
- * Add `application/vnd.ims.imsccv1p2`
- * Fix various invalid MIME type entries
- - `application/vnd-acucobol`
- - `application/vnd-curl`
- - `application/vnd-dart`
- - `application/vnd-dxr`
- - `application/vnd-fdf`
- - `application/vnd-mif`
- - `application/vnd-sema`
- - `application/vnd-wap-wmlc`
- - `application/vnd.adobe.flash-movie`
- - `application/vnd.dece-zip`
- - `application/vnd.dvb_service`
- - `application/vnd.micrografx-igx`
- - `application/vnd.sealed-doc`
- - `application/vnd.sealed-eml`
- - `application/vnd.sealed-mht`
- - `application/vnd.sealed-ppt`
- - `application/vnd.sealed-tiff`
- - `application/vnd.sealed-xls`
- - `application/vnd.sealedmedia.softseal-html`
- - `application/vnd.sealedmedia.softseal-pdf`
- - `application/vnd.wap-slc`
- - `application/vnd.wap-wbxml`
- - `audio/vnd.sealedmedia.softseal-mpeg`
- - `image/vnd-djvu`
- - `image/vnd-svf`
- - `image/vnd-wap-wbmp`
- - `image/vnd.sealed-png`
- - `image/vnd.sealedmedia.softseal-gif`
- - `image/vnd.sealedmedia.softseal-jpg`
- - `model/vnd-dwf`
- - `model/vnd.parasolid.transmit-binary`
- - `model/vnd.parasolid.transmit-text`
- - `text/vnd-a`
- - `text/vnd-curl`
- - `text/vnd.wap-wml`
- * Remove example template MIME types
- - `application/example`
- - `audio/example`
- - `image/example`
- - `message/example`
- - `model/example`
- - `multipart/example`
- - `text/example`
- - `video/example`
-
-1.3.1 / 2014-12-16
-==================
-
- * Fix missing extensions
- - `application/json5`
- - `text/hjson`
-
-1.3.0 / 2014-12-07
-==================
-
- * Add `application/a2l`
- * Add `application/aml`
- * Add `application/atfx`
- * Add `application/atxml`
- * Add `application/cdfx+xml`
- * Add `application/dii`
- * Add `application/json5`
- * Add `application/lxf`
- * Add `application/mf4`
- * Add `application/vnd.apache.thrift.compact`
- * Add `application/vnd.apache.thrift.json`
- * Add `application/vnd.coffeescript`
- * Add `application/vnd.enphase.envoy`
- * Add `application/vnd.ims.imsccv1p1`
- * Add `text/csv-schema`
- * Add `text/hjson`
- * Add `text/markdown`
- * Add `text/yaml`
-
-1.2.0 / 2014-11-09
-==================
-
- * Add `application/cea`
- * Add `application/dit`
- * Add `application/vnd.gov.sk.e-form+zip`
- * Add `application/vnd.tmd.mediaflex.api+xml`
- * Type `application/epub+zip` is now IANA-registered
-
-1.1.2 / 2014-10-23
-==================
-
- * Rebuild database for `application/x-www-form-urlencoded` change
-
-1.1.1 / 2014-10-20
-==================
-
- * Mark `application/x-www-form-urlencoded` as compressible.
-
-1.1.0 / 2014-09-28
-==================
-
- * Add `application/font-woff2`
-
-1.0.3 / 2014-09-25
-==================
-
- * Fix engine requirement in package
-
-1.0.2 / 2014-09-25
-==================
-
- * Add `application/coap-group+json`
- * Add `application/dcd`
- * Add `application/vnd.apache.thrift.binary`
- * Add `image/vnd.tencent.tap`
- * Mark all JSON-derived types as compressible
- * Update `text/vtt` data
-
-1.0.1 / 2014-08-30
-==================
-
- * Fix extension ordering
-
-1.0.0 / 2014-08-30
-==================
-
- * Add `application/atf`
- * Add `application/merge-patch+json`
- * Add `multipart/x-mixed-replace`
- * Add `source: 'apache'` metadata
- * Add `source: 'iana'` metadata
- * Remove badly-assumed charset data
diff --git a/node_modules/mime-db/LICENSE b/node_modules/mime-db/LICENSE
deleted file mode 100644
index 0751cb1..0000000
--- a/node_modules/mime-db/LICENSE
+++ /dev/null
@@ -1,23 +0,0 @@
-(The MIT License)
-
-Copyright (c) 2014 Jonathan Ong
-Copyright (c) 2015-2022 Douglas Christopher Wilson
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-'Software'), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/mime-db/README.md b/node_modules/mime-db/README.md
deleted file mode 100644
index 5a8fcfe..0000000
--- a/node_modules/mime-db/README.md
+++ /dev/null
@@ -1,100 +0,0 @@
-# mime-db
-
-[![NPM Version][npm-version-image]][npm-url]
-[![NPM Downloads][npm-downloads-image]][npm-url]
-[![Node.js Version][node-image]][node-url]
-[![Build Status][ci-image]][ci-url]
-[![Coverage Status][coveralls-image]][coveralls-url]
-
-This is a large database of mime types and information about them.
-It consists of a single, public JSON file and does not include any logic,
-allowing it to remain as un-opinionated as possible with an API.
-It aggregates data from the following sources:
-
-- http://www.iana.org/assignments/media-types/media-types.xhtml
-- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
-- http://hg.nginx.org/nginx/raw-file/default/conf/mime.types
-
-## Installation
-
-```bash
-npm install mime-db
-```
-
-### Database Download
-
-If you're crazy enough to use this in the browser, you can just grab the
-JSON file using [jsDelivr](https://www.jsdelivr.com/). It is recommended to
-replace `master` with [a release tag](https://github.com/jshttp/mime-db/tags)
-as the JSON format may change in the future.
-
-```
-https://cdn.jsdelivr.net/gh/jshttp/mime-db@master/db.json
-```
-
-## Usage
-
-```js
-var db = require('mime-db')
-
-// grab data on .js files
-var data = db['application/javascript']
-```
-
-## Data Structure
-
-The JSON file is a map lookup for lowercased mime types.
-Each mime type has the following properties:
-
-- `.source` - where the mime type is defined.
- If not set, it's probably a custom media type.
- - `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types)
- - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml)
- - `nginx` - [nginx media types](http://hg.nginx.org/nginx/raw-file/default/conf/mime.types)
-- `.extensions[]` - known extensions associated with this mime type.
-- `.compressible` - whether a file of this type can be gzipped.
-- `.charset` - the default charset associated with this type, if any.
-
-If unknown, every property could be `undefined`.
-
-## Contributing
-
-To edit the database, only make PRs against `src/custom-types.json` or
-`src/custom-suffix.json`.
-
-The `src/custom-types.json` file is a JSON object with the MIME type as the
-keys and the values being an object with the following keys:
-
-- `compressible` - leave out if you don't know, otherwise `true`/`false` to
- indicate whether the data represented by the type is typically compressible.
-- `extensions` - include an array of file extensions that are associated with
- the type.
-- `notes` - human-readable notes about the type, typically what the type is.
-- `sources` - include an array of URLs of where the MIME type and the associated
- extensions are sourced from. This needs to be a [primary source](https://en.wikipedia.org/wiki/Primary_source);
- links to type aggregating sites and Wikipedia are _not acceptable_.
-
-To update the build, run `npm run build`.
-
-### Adding Custom Media Types
-
-The best way to get new media types included in this library is to register
-them with the IANA. The community registration procedure is outlined in
-[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types
-registered with the IANA are automatically pulled into this library.
-
-If that is not possible / feasible, they can be added directly here as a
-"custom" type. To do this, it is required to have a primary source that
-definitively lists the media type. If an extension is going to be listed as
-associateed with this media type, the source must definitively link the
-media type and extension as well.
-
-[ci-image]: https://badgen.net/github/checks/jshttp/mime-db/master?label=ci
-[ci-url]: https://github.com/jshttp/mime-db/actions?query=workflow%3Aci
-[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-db/master
-[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master
-[node-image]: https://badgen.net/npm/node/mime-db
-[node-url]: https://nodejs.org/en/download
-[npm-downloads-image]: https://badgen.net/npm/dm/mime-db
-[npm-url]: https://npmjs.org/package/mime-db
-[npm-version-image]: https://badgen.net/npm/v/mime-db
diff --git a/node_modules/mime-db/db.json b/node_modules/mime-db/db.json
deleted file mode 100644
index eb9c42c..0000000
--- a/node_modules/mime-db/db.json
+++ /dev/null
@@ -1,8519 +0,0 @@
-{
- "application/1d-interleaved-parityfec": {
- "source": "iana"
- },
- "application/3gpdash-qoe-report+xml": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true
- },
- "application/3gpp-ims+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/3gpphal+json": {
- "source": "iana",
- "compressible": true
- },
- "application/3gpphalforms+json": {
- "source": "iana",
- "compressible": true
- },
- "application/a2l": {
- "source": "iana"
- },
- "application/ace+cbor": {
- "source": "iana"
- },
- "application/activemessage": {
- "source": "iana"
- },
- "application/activity+json": {
- "source": "iana",
- "compressible": true
- },
- "application/alto-costmap+json": {
- "source": "iana",
- "compressible": true
- },
- "application/alto-costmapfilter+json": {
- "source": "iana",
- "compressible": true
- },
- "application/alto-directory+json": {
- "source": "iana",
- "compressible": true
- },
- "application/alto-endpointcost+json": {
- "source": "iana",
- "compressible": true
- },
- "application/alto-endpointcostparams+json": {
- "source": "iana",
- "compressible": true
- },
- "application/alto-endpointprop+json": {
- "source": "iana",
- "compressible": true
- },
- "application/alto-endpointpropparams+json": {
- "source": "iana",
- "compressible": true
- },
- "application/alto-error+json": {
- "source": "iana",
- "compressible": true
- },
- "application/alto-networkmap+json": {
- "source": "iana",
- "compressible": true
- },
- "application/alto-networkmapfilter+json": {
- "source": "iana",
- "compressible": true
- },
- "application/alto-updatestreamcontrol+json": {
- "source": "iana",
- "compressible": true
- },
- "application/alto-updatestreamparams+json": {
- "source": "iana",
- "compressible": true
- },
- "application/aml": {
- "source": "iana"
- },
- "application/andrew-inset": {
- "source": "iana",
- "extensions": ["ez"]
- },
- "application/applefile": {
- "source": "iana"
- },
- "application/applixware": {
- "source": "apache",
- "extensions": ["aw"]
- },
- "application/at+jwt": {
- "source": "iana"
- },
- "application/atf": {
- "source": "iana"
- },
- "application/atfx": {
- "source": "iana"
- },
- "application/atom+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["atom"]
- },
- "application/atomcat+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["atomcat"]
- },
- "application/atomdeleted+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["atomdeleted"]
- },
- "application/atomicmail": {
- "source": "iana"
- },
- "application/atomsvc+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["atomsvc"]
- },
- "application/atsc-dwd+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["dwd"]
- },
- "application/atsc-dynamic-event-message": {
- "source": "iana"
- },
- "application/atsc-held+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["held"]
- },
- "application/atsc-rdt+json": {
- "source": "iana",
- "compressible": true
- },
- "application/atsc-rsat+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["rsat"]
- },
- "application/atxml": {
- "source": "iana"
- },
- "application/auth-policy+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/bacnet-xdd+zip": {
- "source": "iana",
- "compressible": false
- },
- "application/batch-smtp": {
- "source": "iana"
- },
- "application/bdoc": {
- "compressible": false,
- "extensions": ["bdoc"]
- },
- "application/beep+xml": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true
- },
- "application/calendar+json": {
- "source": "iana",
- "compressible": true
- },
- "application/calendar+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["xcs"]
- },
- "application/call-completion": {
- "source": "iana"
- },
- "application/cals-1840": {
- "source": "iana"
- },
- "application/captive+json": {
- "source": "iana",
- "compressible": true
- },
- "application/cbor": {
- "source": "iana"
- },
- "application/cbor-seq": {
- "source": "iana"
- },
- "application/cccex": {
- "source": "iana"
- },
- "application/ccmp+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/ccxml+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["ccxml"]
- },
- "application/cdfx+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["cdfx"]
- },
- "application/cdmi-capability": {
- "source": "iana",
- "extensions": ["cdmia"]
- },
- "application/cdmi-container": {
- "source": "iana",
- "extensions": ["cdmic"]
- },
- "application/cdmi-domain": {
- "source": "iana",
- "extensions": ["cdmid"]
- },
- "application/cdmi-object": {
- "source": "iana",
- "extensions": ["cdmio"]
- },
- "application/cdmi-queue": {
- "source": "iana",
- "extensions": ["cdmiq"]
- },
- "application/cdni": {
- "source": "iana"
- },
- "application/cea": {
- "source": "iana"
- },
- "application/cea-2018+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/cellml+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/cfw": {
- "source": "iana"
- },
- "application/city+json": {
- "source": "iana",
- "compressible": true
- },
- "application/clr": {
- "source": "iana"
- },
- "application/clue+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/clue_info+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/cms": {
- "source": "iana"
- },
- "application/cnrp+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/coap-group+json": {
- "source": "iana",
- "compressible": true
- },
- "application/coap-payload": {
- "source": "iana"
- },
- "application/commonground": {
- "source": "iana"
- },
- "application/conference-info+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/cose": {
- "source": "iana"
- },
- "application/cose-key": {
- "source": "iana"
- },
- "application/cose-key-set": {
- "source": "iana"
- },
- "application/cpl+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["cpl"]
- },
- "application/csrattrs": {
- "source": "iana"
- },
- "application/csta+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/cstadata+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/csvm+json": {
- "source": "iana",
- "compressible": true
- },
- "application/cu-seeme": {
- "source": "apache",
- "extensions": ["cu"]
- },
- "application/cwt": {
- "source": "iana"
- },
- "application/cybercash": {
- "source": "iana"
- },
- "application/dart": {
- "compressible": true
- },
- "application/dash+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["mpd"]
- },
- "application/dash-patch+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["mpp"]
- },
- "application/dashdelta": {
- "source": "iana"
- },
- "application/davmount+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["davmount"]
- },
- "application/dca-rft": {
- "source": "iana"
- },
- "application/dcd": {
- "source": "iana"
- },
- "application/dec-dx": {
- "source": "iana"
- },
- "application/dialog-info+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/dicom": {
- "source": "iana"
- },
- "application/dicom+json": {
- "source": "iana",
- "compressible": true
- },
- "application/dicom+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/dii": {
- "source": "iana"
- },
- "application/dit": {
- "source": "iana"
- },
- "application/dns": {
- "source": "iana"
- },
- "application/dns+json": {
- "source": "iana",
- "compressible": true
- },
- "application/dns-message": {
- "source": "iana"
- },
- "application/docbook+xml": {
- "source": "apache",
- "compressible": true,
- "extensions": ["dbk"]
- },
- "application/dots+cbor": {
- "source": "iana"
- },
- "application/dskpp+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/dssc+der": {
- "source": "iana",
- "extensions": ["dssc"]
- },
- "application/dssc+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["xdssc"]
- },
- "application/dvcs": {
- "source": "iana"
- },
- "application/ecmascript": {
- "source": "iana",
- "compressible": true,
- "extensions": ["es","ecma"]
- },
- "application/edi-consent": {
- "source": "iana"
- },
- "application/edi-x12": {
- "source": "iana",
- "compressible": false
- },
- "application/edifact": {
- "source": "iana",
- "compressible": false
- },
- "application/efi": {
- "source": "iana"
- },
- "application/elm+json": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true
- },
- "application/elm+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/emergencycalldata.cap+xml": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true
- },
- "application/emergencycalldata.comment+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/emergencycalldata.control+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/emergencycalldata.deviceinfo+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/emergencycalldata.ecall.msd": {
- "source": "iana"
- },
- "application/emergencycalldata.providerinfo+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/emergencycalldata.serviceinfo+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/emergencycalldata.subscriberinfo+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/emergencycalldata.veds+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/emma+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["emma"]
- },
- "application/emotionml+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["emotionml"]
- },
- "application/encaprtp": {
- "source": "iana"
- },
- "application/epp+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/epub+zip": {
- "source": "iana",
- "compressible": false,
- "extensions": ["epub"]
- },
- "application/eshop": {
- "source": "iana"
- },
- "application/exi": {
- "source": "iana",
- "extensions": ["exi"]
- },
- "application/expect-ct-report+json": {
- "source": "iana",
- "compressible": true
- },
- "application/express": {
- "source": "iana",
- "extensions": ["exp"]
- },
- "application/fastinfoset": {
- "source": "iana"
- },
- "application/fastsoap": {
- "source": "iana"
- },
- "application/fdt+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["fdt"]
- },
- "application/fhir+json": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true
- },
- "application/fhir+xml": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true
- },
- "application/fido.trusted-apps+json": {
- "compressible": true
- },
- "application/fits": {
- "source": "iana"
- },
- "application/flexfec": {
- "source": "iana"
- },
- "application/font-sfnt": {
- "source": "iana"
- },
- "application/font-tdpfr": {
- "source": "iana",
- "extensions": ["pfr"]
- },
- "application/font-woff": {
- "source": "iana",
- "compressible": false
- },
- "application/framework-attributes+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/geo+json": {
- "source": "iana",
- "compressible": true,
- "extensions": ["geojson"]
- },
- "application/geo+json-seq": {
- "source": "iana"
- },
- "application/geopackage+sqlite3": {
- "source": "iana"
- },
- "application/geoxacml+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/gltf-buffer": {
- "source": "iana"
- },
- "application/gml+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["gml"]
- },
- "application/gpx+xml": {
- "source": "apache",
- "compressible": true,
- "extensions": ["gpx"]
- },
- "application/gxf": {
- "source": "apache",
- "extensions": ["gxf"]
- },
- "application/gzip": {
- "source": "iana",
- "compressible": false,
- "extensions": ["gz"]
- },
- "application/h224": {
- "source": "iana"
- },
- "application/held+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/hjson": {
- "extensions": ["hjson"]
- },
- "application/http": {
- "source": "iana"
- },
- "application/hyperstudio": {
- "source": "iana",
- "extensions": ["stk"]
- },
- "application/ibe-key-request+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/ibe-pkg-reply+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/ibe-pp-data": {
- "source": "iana"
- },
- "application/iges": {
- "source": "iana"
- },
- "application/im-iscomposing+xml": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true
- },
- "application/index": {
- "source": "iana"
- },
- "application/index.cmd": {
- "source": "iana"
- },
- "application/index.obj": {
- "source": "iana"
- },
- "application/index.response": {
- "source": "iana"
- },
- "application/index.vnd": {
- "source": "iana"
- },
- "application/inkml+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["ink","inkml"]
- },
- "application/iotp": {
- "source": "iana"
- },
- "application/ipfix": {
- "source": "iana",
- "extensions": ["ipfix"]
- },
- "application/ipp": {
- "source": "iana"
- },
- "application/isup": {
- "source": "iana"
- },
- "application/its+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["its"]
- },
- "application/java-archive": {
- "source": "apache",
- "compressible": false,
- "extensions": ["jar","war","ear"]
- },
- "application/java-serialized-object": {
- "source": "apache",
- "compressible": false,
- "extensions": ["ser"]
- },
- "application/java-vm": {
- "source": "apache",
- "compressible": false,
- "extensions": ["class"]
- },
- "application/javascript": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true,
- "extensions": ["js","mjs"]
- },
- "application/jf2feed+json": {
- "source": "iana",
- "compressible": true
- },
- "application/jose": {
- "source": "iana"
- },
- "application/jose+json": {
- "source": "iana",
- "compressible": true
- },
- "application/jrd+json": {
- "source": "iana",
- "compressible": true
- },
- "application/jscalendar+json": {
- "source": "iana",
- "compressible": true
- },
- "application/json": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true,
- "extensions": ["json","map"]
- },
- "application/json-patch+json": {
- "source": "iana",
- "compressible": true
- },
- "application/json-seq": {
- "source": "iana"
- },
- "application/json5": {
- "extensions": ["json5"]
- },
- "application/jsonml+json": {
- "source": "apache",
- "compressible": true,
- "extensions": ["jsonml"]
- },
- "application/jwk+json": {
- "source": "iana",
- "compressible": true
- },
- "application/jwk-set+json": {
- "source": "iana",
- "compressible": true
- },
- "application/jwt": {
- "source": "iana"
- },
- "application/kpml-request+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/kpml-response+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/ld+json": {
- "source": "iana",
- "compressible": true,
- "extensions": ["jsonld"]
- },
- "application/lgr+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["lgr"]
- },
- "application/link-format": {
- "source": "iana"
- },
- "application/load-control+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/lost+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["lostxml"]
- },
- "application/lostsync+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/lpf+zip": {
- "source": "iana",
- "compressible": false
- },
- "application/lxf": {
- "source": "iana"
- },
- "application/mac-binhex40": {
- "source": "iana",
- "extensions": ["hqx"]
- },
- "application/mac-compactpro": {
- "source": "apache",
- "extensions": ["cpt"]
- },
- "application/macwriteii": {
- "source": "iana"
- },
- "application/mads+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["mads"]
- },
- "application/manifest+json": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true,
- "extensions": ["webmanifest"]
- },
- "application/marc": {
- "source": "iana",
- "extensions": ["mrc"]
- },
- "application/marcxml+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["mrcx"]
- },
- "application/mathematica": {
- "source": "iana",
- "extensions": ["ma","nb","mb"]
- },
- "application/mathml+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["mathml"]
- },
- "application/mathml-content+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/mathml-presentation+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/mbms-associated-procedure-description+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/mbms-deregister+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/mbms-envelope+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/mbms-msk+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/mbms-msk-response+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/mbms-protection-description+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/mbms-reception-report+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/mbms-register+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/mbms-register-response+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/mbms-schedule+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/mbms-user-service-description+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/mbox": {
- "source": "iana",
- "extensions": ["mbox"]
- },
- "application/media-policy-dataset+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["mpf"]
- },
- "application/media_control+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/mediaservercontrol+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["mscml"]
- },
- "application/merge-patch+json": {
- "source": "iana",
- "compressible": true
- },
- "application/metalink+xml": {
- "source": "apache",
- "compressible": true,
- "extensions": ["metalink"]
- },
- "application/metalink4+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["meta4"]
- },
- "application/mets+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["mets"]
- },
- "application/mf4": {
- "source": "iana"
- },
- "application/mikey": {
- "source": "iana"
- },
- "application/mipc": {
- "source": "iana"
- },
- "application/missing-blocks+cbor-seq": {
- "source": "iana"
- },
- "application/mmt-aei+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["maei"]
- },
- "application/mmt-usd+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["musd"]
- },
- "application/mods+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["mods"]
- },
- "application/moss-keys": {
- "source": "iana"
- },
- "application/moss-signature": {
- "source": "iana"
- },
- "application/mosskey-data": {
- "source": "iana"
- },
- "application/mosskey-request": {
- "source": "iana"
- },
- "application/mp21": {
- "source": "iana",
- "extensions": ["m21","mp21"]
- },
- "application/mp4": {
- "source": "iana",
- "extensions": ["mp4s","m4p"]
- },
- "application/mpeg4-generic": {
- "source": "iana"
- },
- "application/mpeg4-iod": {
- "source": "iana"
- },
- "application/mpeg4-iod-xmt": {
- "source": "iana"
- },
- "application/mrb-consumer+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/mrb-publish+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/msc-ivr+xml": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true
- },
- "application/msc-mixer+xml": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true
- },
- "application/msword": {
- "source": "iana",
- "compressible": false,
- "extensions": ["doc","dot"]
- },
- "application/mud+json": {
- "source": "iana",
- "compressible": true
- },
- "application/multipart-core": {
- "source": "iana"
- },
- "application/mxf": {
- "source": "iana",
- "extensions": ["mxf"]
- },
- "application/n-quads": {
- "source": "iana",
- "extensions": ["nq"]
- },
- "application/n-triples": {
- "source": "iana",
- "extensions": ["nt"]
- },
- "application/nasdata": {
- "source": "iana"
- },
- "application/news-checkgroups": {
- "source": "iana",
- "charset": "US-ASCII"
- },
- "application/news-groupinfo": {
- "source": "iana",
- "charset": "US-ASCII"
- },
- "application/news-transmission": {
- "source": "iana"
- },
- "application/nlsml+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/node": {
- "source": "iana",
- "extensions": ["cjs"]
- },
- "application/nss": {
- "source": "iana"
- },
- "application/oauth-authz-req+jwt": {
- "source": "iana"
- },
- "application/oblivious-dns-message": {
- "source": "iana"
- },
- "application/ocsp-request": {
- "source": "iana"
- },
- "application/ocsp-response": {
- "source": "iana"
- },
- "application/octet-stream": {
- "source": "iana",
- "compressible": false,
- "extensions": ["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]
- },
- "application/oda": {
- "source": "iana",
- "extensions": ["oda"]
- },
- "application/odm+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/odx": {
- "source": "iana"
- },
- "application/oebps-package+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["opf"]
- },
- "application/ogg": {
- "source": "iana",
- "compressible": false,
- "extensions": ["ogx"]
- },
- "application/omdoc+xml": {
- "source": "apache",
- "compressible": true,
- "extensions": ["omdoc"]
- },
- "application/onenote": {
- "source": "apache",
- "extensions": ["onetoc","onetoc2","onetmp","onepkg"]
- },
- "application/opc-nodeset+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/oscore": {
- "source": "iana"
- },
- "application/oxps": {
- "source": "iana",
- "extensions": ["oxps"]
- },
- "application/p21": {
- "source": "iana"
- },
- "application/p21+zip": {
- "source": "iana",
- "compressible": false
- },
- "application/p2p-overlay+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["relo"]
- },
- "application/parityfec": {
- "source": "iana"
- },
- "application/passport": {
- "source": "iana"
- },
- "application/patch-ops-error+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["xer"]
- },
- "application/pdf": {
- "source": "iana",
- "compressible": false,
- "extensions": ["pdf"]
- },
- "application/pdx": {
- "source": "iana"
- },
- "application/pem-certificate-chain": {
- "source": "iana"
- },
- "application/pgp-encrypted": {
- "source": "iana",
- "compressible": false,
- "extensions": ["pgp"]
- },
- "application/pgp-keys": {
- "source": "iana",
- "extensions": ["asc"]
- },
- "application/pgp-signature": {
- "source": "iana",
- "extensions": ["asc","sig"]
- },
- "application/pics-rules": {
- "source": "apache",
- "extensions": ["prf"]
- },
- "application/pidf+xml": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true
- },
- "application/pidf-diff+xml": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true
- },
- "application/pkcs10": {
- "source": "iana",
- "extensions": ["p10"]
- },
- "application/pkcs12": {
- "source": "iana"
- },
- "application/pkcs7-mime": {
- "source": "iana",
- "extensions": ["p7m","p7c"]
- },
- "application/pkcs7-signature": {
- "source": "iana",
- "extensions": ["p7s"]
- },
- "application/pkcs8": {
- "source": "iana",
- "extensions": ["p8"]
- },
- "application/pkcs8-encrypted": {
- "source": "iana"
- },
- "application/pkix-attr-cert": {
- "source": "iana",
- "extensions": ["ac"]
- },
- "application/pkix-cert": {
- "source": "iana",
- "extensions": ["cer"]
- },
- "application/pkix-crl": {
- "source": "iana",
- "extensions": ["crl"]
- },
- "application/pkix-pkipath": {
- "source": "iana",
- "extensions": ["pkipath"]
- },
- "application/pkixcmp": {
- "source": "iana",
- "extensions": ["pki"]
- },
- "application/pls+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["pls"]
- },
- "application/poc-settings+xml": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true
- },
- "application/postscript": {
- "source": "iana",
- "compressible": true,
- "extensions": ["ai","eps","ps"]
- },
- "application/ppsp-tracker+json": {
- "source": "iana",
- "compressible": true
- },
- "application/problem+json": {
- "source": "iana",
- "compressible": true
- },
- "application/problem+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/provenance+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["provx"]
- },
- "application/prs.alvestrand.titrax-sheet": {
- "source": "iana"
- },
- "application/prs.cww": {
- "source": "iana",
- "extensions": ["cww"]
- },
- "application/prs.cyn": {
- "source": "iana",
- "charset": "7-BIT"
- },
- "application/prs.hpub+zip": {
- "source": "iana",
- "compressible": false
- },
- "application/prs.nprend": {
- "source": "iana"
- },
- "application/prs.plucker": {
- "source": "iana"
- },
- "application/prs.rdf-xml-crypt": {
- "source": "iana"
- },
- "application/prs.xsf+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/pskc+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["pskcxml"]
- },
- "application/pvd+json": {
- "source": "iana",
- "compressible": true
- },
- "application/qsig": {
- "source": "iana"
- },
- "application/raml+yaml": {
- "compressible": true,
- "extensions": ["raml"]
- },
- "application/raptorfec": {
- "source": "iana"
- },
- "application/rdap+json": {
- "source": "iana",
- "compressible": true
- },
- "application/rdf+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["rdf","owl"]
- },
- "application/reginfo+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["rif"]
- },
- "application/relax-ng-compact-syntax": {
- "source": "iana",
- "extensions": ["rnc"]
- },
- "application/remote-printing": {
- "source": "iana"
- },
- "application/reputon+json": {
- "source": "iana",
- "compressible": true
- },
- "application/resource-lists+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["rl"]
- },
- "application/resource-lists-diff+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["rld"]
- },
- "application/rfc+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/riscos": {
- "source": "iana"
- },
- "application/rlmi+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/rls-services+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["rs"]
- },
- "application/route-apd+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["rapd"]
- },
- "application/route-s-tsid+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["sls"]
- },
- "application/route-usd+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["rusd"]
- },
- "application/rpki-ghostbusters": {
- "source": "iana",
- "extensions": ["gbr"]
- },
- "application/rpki-manifest": {
- "source": "iana",
- "extensions": ["mft"]
- },
- "application/rpki-publication": {
- "source": "iana"
- },
- "application/rpki-roa": {
- "source": "iana",
- "extensions": ["roa"]
- },
- "application/rpki-updown": {
- "source": "iana"
- },
- "application/rsd+xml": {
- "source": "apache",
- "compressible": true,
- "extensions": ["rsd"]
- },
- "application/rss+xml": {
- "source": "apache",
- "compressible": true,
- "extensions": ["rss"]
- },
- "application/rtf": {
- "source": "iana",
- "compressible": true,
- "extensions": ["rtf"]
- },
- "application/rtploopback": {
- "source": "iana"
- },
- "application/rtx": {
- "source": "iana"
- },
- "application/samlassertion+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/samlmetadata+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/sarif+json": {
- "source": "iana",
- "compressible": true
- },
- "application/sarif-external-properties+json": {
- "source": "iana",
- "compressible": true
- },
- "application/sbe": {
- "source": "iana"
- },
- "application/sbml+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["sbml"]
- },
- "application/scaip+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/scim+json": {
- "source": "iana",
- "compressible": true
- },
- "application/scvp-cv-request": {
- "source": "iana",
- "extensions": ["scq"]
- },
- "application/scvp-cv-response": {
- "source": "iana",
- "extensions": ["scs"]
- },
- "application/scvp-vp-request": {
- "source": "iana",
- "extensions": ["spq"]
- },
- "application/scvp-vp-response": {
- "source": "iana",
- "extensions": ["spp"]
- },
- "application/sdp": {
- "source": "iana",
- "extensions": ["sdp"]
- },
- "application/secevent+jwt": {
- "source": "iana"
- },
- "application/senml+cbor": {
- "source": "iana"
- },
- "application/senml+json": {
- "source": "iana",
- "compressible": true
- },
- "application/senml+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["senmlx"]
- },
- "application/senml-etch+cbor": {
- "source": "iana"
- },
- "application/senml-etch+json": {
- "source": "iana",
- "compressible": true
- },
- "application/senml-exi": {
- "source": "iana"
- },
- "application/sensml+cbor": {
- "source": "iana"
- },
- "application/sensml+json": {
- "source": "iana",
- "compressible": true
- },
- "application/sensml+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["sensmlx"]
- },
- "application/sensml-exi": {
- "source": "iana"
- },
- "application/sep+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/sep-exi": {
- "source": "iana"
- },
- "application/session-info": {
- "source": "iana"
- },
- "application/set-payment": {
- "source": "iana"
- },
- "application/set-payment-initiation": {
- "source": "iana",
- "extensions": ["setpay"]
- },
- "application/set-registration": {
- "source": "iana"
- },
- "application/set-registration-initiation": {
- "source": "iana",
- "extensions": ["setreg"]
- },
- "application/sgml": {
- "source": "iana"
- },
- "application/sgml-open-catalog": {
- "source": "iana"
- },
- "application/shf+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["shf"]
- },
- "application/sieve": {
- "source": "iana",
- "extensions": ["siv","sieve"]
- },
- "application/simple-filter+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/simple-message-summary": {
- "source": "iana"
- },
- "application/simplesymbolcontainer": {
- "source": "iana"
- },
- "application/sipc": {
- "source": "iana"
- },
- "application/slate": {
- "source": "iana"
- },
- "application/smil": {
- "source": "iana"
- },
- "application/smil+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["smi","smil"]
- },
- "application/smpte336m": {
- "source": "iana"
- },
- "application/soap+fastinfoset": {
- "source": "iana"
- },
- "application/soap+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/sparql-query": {
- "source": "iana",
- "extensions": ["rq"]
- },
- "application/sparql-results+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["srx"]
- },
- "application/spdx+json": {
- "source": "iana",
- "compressible": true
- },
- "application/spirits-event+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/sql": {
- "source": "iana"
- },
- "application/srgs": {
- "source": "iana",
- "extensions": ["gram"]
- },
- "application/srgs+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["grxml"]
- },
- "application/sru+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["sru"]
- },
- "application/ssdl+xml": {
- "source": "apache",
- "compressible": true,
- "extensions": ["ssdl"]
- },
- "application/ssml+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["ssml"]
- },
- "application/stix+json": {
- "source": "iana",
- "compressible": true
- },
- "application/swid+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["swidtag"]
- },
- "application/tamp-apex-update": {
- "source": "iana"
- },
- "application/tamp-apex-update-confirm": {
- "source": "iana"
- },
- "application/tamp-community-update": {
- "source": "iana"
- },
- "application/tamp-community-update-confirm": {
- "source": "iana"
- },
- "application/tamp-error": {
- "source": "iana"
- },
- "application/tamp-sequence-adjust": {
- "source": "iana"
- },
- "application/tamp-sequence-adjust-confirm": {
- "source": "iana"
- },
- "application/tamp-status-query": {
- "source": "iana"
- },
- "application/tamp-status-response": {
- "source": "iana"
- },
- "application/tamp-update": {
- "source": "iana"
- },
- "application/tamp-update-confirm": {
- "source": "iana"
- },
- "application/tar": {
- "compressible": true
- },
- "application/taxii+json": {
- "source": "iana",
- "compressible": true
- },
- "application/td+json": {
- "source": "iana",
- "compressible": true
- },
- "application/tei+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["tei","teicorpus"]
- },
- "application/tetra_isi": {
- "source": "iana"
- },
- "application/thraud+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["tfi"]
- },
- "application/timestamp-query": {
- "source": "iana"
- },
- "application/timestamp-reply": {
- "source": "iana"
- },
- "application/timestamped-data": {
- "source": "iana",
- "extensions": ["tsd"]
- },
- "application/tlsrpt+gzip": {
- "source": "iana"
- },
- "application/tlsrpt+json": {
- "source": "iana",
- "compressible": true
- },
- "application/tnauthlist": {
- "source": "iana"
- },
- "application/token-introspection+jwt": {
- "source": "iana"
- },
- "application/toml": {
- "compressible": true,
- "extensions": ["toml"]
- },
- "application/trickle-ice-sdpfrag": {
- "source": "iana"
- },
- "application/trig": {
- "source": "iana",
- "extensions": ["trig"]
- },
- "application/ttml+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["ttml"]
- },
- "application/tve-trigger": {
- "source": "iana"
- },
- "application/tzif": {
- "source": "iana"
- },
- "application/tzif-leap": {
- "source": "iana"
- },
- "application/ubjson": {
- "compressible": false,
- "extensions": ["ubj"]
- },
- "application/ulpfec": {
- "source": "iana"
- },
- "application/urc-grpsheet+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/urc-ressheet+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["rsheet"]
- },
- "application/urc-targetdesc+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["td"]
- },
- "application/urc-uisocketdesc+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vcard+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vcard+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vemmi": {
- "source": "iana"
- },
- "application/vividence.scriptfile": {
- "source": "apache"
- },
- "application/vnd.1000minds.decision-model+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["1km"]
- },
- "application/vnd.3gpp-prose+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp-prose-pc3ch+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp-v2x-local-service-information": {
- "source": "iana"
- },
- "application/vnd.3gpp.5gnas": {
- "source": "iana"
- },
- "application/vnd.3gpp.access-transfer-events+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.bsf+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.gmop+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.gtpc": {
- "source": "iana"
- },
- "application/vnd.3gpp.interworking-data": {
- "source": "iana"
- },
- "application/vnd.3gpp.lpp": {
- "source": "iana"
- },
- "application/vnd.3gpp.mc-signalling-ear": {
- "source": "iana"
- },
- "application/vnd.3gpp.mcdata-affiliation-command+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcdata-info+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcdata-payload": {
- "source": "iana"
- },
- "application/vnd.3gpp.mcdata-service-config+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcdata-signalling": {
- "source": "iana"
- },
- "application/vnd.3gpp.mcdata-ue-config+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcdata-user-profile+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcptt-affiliation-command+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcptt-floor-request+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcptt-info+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcptt-location-info+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcptt-mbms-usage-info+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcptt-service-config+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcptt-signed+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcptt-ue-config+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcptt-ue-init-config+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcptt-user-profile+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcvideo-affiliation-command+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcvideo-affiliation-info+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcvideo-info+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcvideo-location-info+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcvideo-service-config+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcvideo-transmission-request+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcvideo-ue-config+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mcvideo-user-profile+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.mid-call+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.ngap": {
- "source": "iana"
- },
- "application/vnd.3gpp.pfcp": {
- "source": "iana"
- },
- "application/vnd.3gpp.pic-bw-large": {
- "source": "iana",
- "extensions": ["plb"]
- },
- "application/vnd.3gpp.pic-bw-small": {
- "source": "iana",
- "extensions": ["psb"]
- },
- "application/vnd.3gpp.pic-bw-var": {
- "source": "iana",
- "extensions": ["pvb"]
- },
- "application/vnd.3gpp.s1ap": {
- "source": "iana"
- },
- "application/vnd.3gpp.sms": {
- "source": "iana"
- },
- "application/vnd.3gpp.sms+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.srvcc-ext+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.srvcc-info+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.state-and-event-info+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp.ussd+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp2.bcmcsinfo+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.3gpp2.sms": {
- "source": "iana"
- },
- "application/vnd.3gpp2.tcap": {
- "source": "iana",
- "extensions": ["tcap"]
- },
- "application/vnd.3lightssoftware.imagescal": {
- "source": "iana"
- },
- "application/vnd.3m.post-it-notes": {
- "source": "iana",
- "extensions": ["pwn"]
- },
- "application/vnd.accpac.simply.aso": {
- "source": "iana",
- "extensions": ["aso"]
- },
- "application/vnd.accpac.simply.imp": {
- "source": "iana",
- "extensions": ["imp"]
- },
- "application/vnd.acucobol": {
- "source": "iana",
- "extensions": ["acu"]
- },
- "application/vnd.acucorp": {
- "source": "iana",
- "extensions": ["atc","acutc"]
- },
- "application/vnd.adobe.air-application-installer-package+zip": {
- "source": "apache",
- "compressible": false,
- "extensions": ["air"]
- },
- "application/vnd.adobe.flash.movie": {
- "source": "iana"
- },
- "application/vnd.adobe.formscentral.fcdt": {
- "source": "iana",
- "extensions": ["fcdt"]
- },
- "application/vnd.adobe.fxp": {
- "source": "iana",
- "extensions": ["fxp","fxpl"]
- },
- "application/vnd.adobe.partial-upload": {
- "source": "iana"
- },
- "application/vnd.adobe.xdp+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["xdp"]
- },
- "application/vnd.adobe.xfdf": {
- "source": "iana",
- "extensions": ["xfdf"]
- },
- "application/vnd.aether.imp": {
- "source": "iana"
- },
- "application/vnd.afpc.afplinedata": {
- "source": "iana"
- },
- "application/vnd.afpc.afplinedata-pagedef": {
- "source": "iana"
- },
- "application/vnd.afpc.cmoca-cmresource": {
- "source": "iana"
- },
- "application/vnd.afpc.foca-charset": {
- "source": "iana"
- },
- "application/vnd.afpc.foca-codedfont": {
- "source": "iana"
- },
- "application/vnd.afpc.foca-codepage": {
- "source": "iana"
- },
- "application/vnd.afpc.modca": {
- "source": "iana"
- },
- "application/vnd.afpc.modca-cmtable": {
- "source": "iana"
- },
- "application/vnd.afpc.modca-formdef": {
- "source": "iana"
- },
- "application/vnd.afpc.modca-mediummap": {
- "source": "iana"
- },
- "application/vnd.afpc.modca-objectcontainer": {
- "source": "iana"
- },
- "application/vnd.afpc.modca-overlay": {
- "source": "iana"
- },
- "application/vnd.afpc.modca-pagesegment": {
- "source": "iana"
- },
- "application/vnd.age": {
- "source": "iana",
- "extensions": ["age"]
- },
- "application/vnd.ah-barcode": {
- "source": "iana"
- },
- "application/vnd.ahead.space": {
- "source": "iana",
- "extensions": ["ahead"]
- },
- "application/vnd.airzip.filesecure.azf": {
- "source": "iana",
- "extensions": ["azf"]
- },
- "application/vnd.airzip.filesecure.azs": {
- "source": "iana",
- "extensions": ["azs"]
- },
- "application/vnd.amadeus+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.amazon.ebook": {
- "source": "apache",
- "extensions": ["azw"]
- },
- "application/vnd.amazon.mobi8-ebook": {
- "source": "iana"
- },
- "application/vnd.americandynamics.acc": {
- "source": "iana",
- "extensions": ["acc"]
- },
- "application/vnd.amiga.ami": {
- "source": "iana",
- "extensions": ["ami"]
- },
- "application/vnd.amundsen.maze+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.android.ota": {
- "source": "iana"
- },
- "application/vnd.android.package-archive": {
- "source": "apache",
- "compressible": false,
- "extensions": ["apk"]
- },
- "application/vnd.anki": {
- "source": "iana"
- },
- "application/vnd.anser-web-certificate-issue-initiation": {
- "source": "iana",
- "extensions": ["cii"]
- },
- "application/vnd.anser-web-funds-transfer-initiation": {
- "source": "apache",
- "extensions": ["fti"]
- },
- "application/vnd.antix.game-component": {
- "source": "iana",
- "extensions": ["atx"]
- },
- "application/vnd.apache.arrow.file": {
- "source": "iana"
- },
- "application/vnd.apache.arrow.stream": {
- "source": "iana"
- },
- "application/vnd.apache.thrift.binary": {
- "source": "iana"
- },
- "application/vnd.apache.thrift.compact": {
- "source": "iana"
- },
- "application/vnd.apache.thrift.json": {
- "source": "iana"
- },
- "application/vnd.api+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.aplextor.warrp+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.apothekende.reservation+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.apple.installer+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["mpkg"]
- },
- "application/vnd.apple.keynote": {
- "source": "iana",
- "extensions": ["key"]
- },
- "application/vnd.apple.mpegurl": {
- "source": "iana",
- "extensions": ["m3u8"]
- },
- "application/vnd.apple.numbers": {
- "source": "iana",
- "extensions": ["numbers"]
- },
- "application/vnd.apple.pages": {
- "source": "iana",
- "extensions": ["pages"]
- },
- "application/vnd.apple.pkpass": {
- "compressible": false,
- "extensions": ["pkpass"]
- },
- "application/vnd.arastra.swi": {
- "source": "iana"
- },
- "application/vnd.aristanetworks.swi": {
- "source": "iana",
- "extensions": ["swi"]
- },
- "application/vnd.artisan+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.artsquare": {
- "source": "iana"
- },
- "application/vnd.astraea-software.iota": {
- "source": "iana",
- "extensions": ["iota"]
- },
- "application/vnd.audiograph": {
- "source": "iana",
- "extensions": ["aep"]
- },
- "application/vnd.autopackage": {
- "source": "iana"
- },
- "application/vnd.avalon+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.avistar+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.balsamiq.bmml+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["bmml"]
- },
- "application/vnd.balsamiq.bmpr": {
- "source": "iana"
- },
- "application/vnd.banana-accounting": {
- "source": "iana"
- },
- "application/vnd.bbf.usp.error": {
- "source": "iana"
- },
- "application/vnd.bbf.usp.msg": {
- "source": "iana"
- },
- "application/vnd.bbf.usp.msg+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.bekitzur-stech+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.bint.med-content": {
- "source": "iana"
- },
- "application/vnd.biopax.rdf+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.blink-idb-value-wrapper": {
- "source": "iana"
- },
- "application/vnd.blueice.multipass": {
- "source": "iana",
- "extensions": ["mpm"]
- },
- "application/vnd.bluetooth.ep.oob": {
- "source": "iana"
- },
- "application/vnd.bluetooth.le.oob": {
- "source": "iana"
- },
- "application/vnd.bmi": {
- "source": "iana",
- "extensions": ["bmi"]
- },
- "application/vnd.bpf": {
- "source": "iana"
- },
- "application/vnd.bpf3": {
- "source": "iana"
- },
- "application/vnd.businessobjects": {
- "source": "iana",
- "extensions": ["rep"]
- },
- "application/vnd.byu.uapi+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.cab-jscript": {
- "source": "iana"
- },
- "application/vnd.canon-cpdl": {
- "source": "iana"
- },
- "application/vnd.canon-lips": {
- "source": "iana"
- },
- "application/vnd.capasystems-pg+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.cendio.thinlinc.clientconf": {
- "source": "iana"
- },
- "application/vnd.century-systems.tcp_stream": {
- "source": "iana"
- },
- "application/vnd.chemdraw+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["cdxml"]
- },
- "application/vnd.chess-pgn": {
- "source": "iana"
- },
- "application/vnd.chipnuts.karaoke-mmd": {
- "source": "iana",
- "extensions": ["mmd"]
- },
- "application/vnd.ciedi": {
- "source": "iana"
- },
- "application/vnd.cinderella": {
- "source": "iana",
- "extensions": ["cdy"]
- },
- "application/vnd.cirpack.isdn-ext": {
- "source": "iana"
- },
- "application/vnd.citationstyles.style+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["csl"]
- },
- "application/vnd.claymore": {
- "source": "iana",
- "extensions": ["cla"]
- },
- "application/vnd.cloanto.rp9": {
- "source": "iana",
- "extensions": ["rp9"]
- },
- "application/vnd.clonk.c4group": {
- "source": "iana",
- "extensions": ["c4g","c4d","c4f","c4p","c4u"]
- },
- "application/vnd.cluetrust.cartomobile-config": {
- "source": "iana",
- "extensions": ["c11amc"]
- },
- "application/vnd.cluetrust.cartomobile-config-pkg": {
- "source": "iana",
- "extensions": ["c11amz"]
- },
- "application/vnd.coffeescript": {
- "source": "iana"
- },
- "application/vnd.collabio.xodocuments.document": {
- "source": "iana"
- },
- "application/vnd.collabio.xodocuments.document-template": {
- "source": "iana"
- },
- "application/vnd.collabio.xodocuments.presentation": {
- "source": "iana"
- },
- "application/vnd.collabio.xodocuments.presentation-template": {
- "source": "iana"
- },
- "application/vnd.collabio.xodocuments.spreadsheet": {
- "source": "iana"
- },
- "application/vnd.collabio.xodocuments.spreadsheet-template": {
- "source": "iana"
- },
- "application/vnd.collection+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.collection.doc+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.collection.next+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.comicbook+zip": {
- "source": "iana",
- "compressible": false
- },
- "application/vnd.comicbook-rar": {
- "source": "iana"
- },
- "application/vnd.commerce-battelle": {
- "source": "iana"
- },
- "application/vnd.commonspace": {
- "source": "iana",
- "extensions": ["csp"]
- },
- "application/vnd.contact.cmsg": {
- "source": "iana",
- "extensions": ["cdbcmsg"]
- },
- "application/vnd.coreos.ignition+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.cosmocaller": {
- "source": "iana",
- "extensions": ["cmc"]
- },
- "application/vnd.crick.clicker": {
- "source": "iana",
- "extensions": ["clkx"]
- },
- "application/vnd.crick.clicker.keyboard": {
- "source": "iana",
- "extensions": ["clkk"]
- },
- "application/vnd.crick.clicker.palette": {
- "source": "iana",
- "extensions": ["clkp"]
- },
- "application/vnd.crick.clicker.template": {
- "source": "iana",
- "extensions": ["clkt"]
- },
- "application/vnd.crick.clicker.wordbank": {
- "source": "iana",
- "extensions": ["clkw"]
- },
- "application/vnd.criticaltools.wbs+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["wbs"]
- },
- "application/vnd.cryptii.pipe+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.crypto-shade-file": {
- "source": "iana"
- },
- "application/vnd.cryptomator.encrypted": {
- "source": "iana"
- },
- "application/vnd.cryptomator.vault": {
- "source": "iana"
- },
- "application/vnd.ctc-posml": {
- "source": "iana",
- "extensions": ["pml"]
- },
- "application/vnd.ctct.ws+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.cups-pdf": {
- "source": "iana"
- },
- "application/vnd.cups-postscript": {
- "source": "iana"
- },
- "application/vnd.cups-ppd": {
- "source": "iana",
- "extensions": ["ppd"]
- },
- "application/vnd.cups-raster": {
- "source": "iana"
- },
- "application/vnd.cups-raw": {
- "source": "iana"
- },
- "application/vnd.curl": {
- "source": "iana"
- },
- "application/vnd.curl.car": {
- "source": "apache",
- "extensions": ["car"]
- },
- "application/vnd.curl.pcurl": {
- "source": "apache",
- "extensions": ["pcurl"]
- },
- "application/vnd.cyan.dean.root+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.cybank": {
- "source": "iana"
- },
- "application/vnd.cyclonedx+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.cyclonedx+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.d2l.coursepackage1p0+zip": {
- "source": "iana",
- "compressible": false
- },
- "application/vnd.d3m-dataset": {
- "source": "iana"
- },
- "application/vnd.d3m-problem": {
- "source": "iana"
- },
- "application/vnd.dart": {
- "source": "iana",
- "compressible": true,
- "extensions": ["dart"]
- },
- "application/vnd.data-vision.rdz": {
- "source": "iana",
- "extensions": ["rdz"]
- },
- "application/vnd.datapackage+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.dataresource+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.dbf": {
- "source": "iana",
- "extensions": ["dbf"]
- },
- "application/vnd.debian.binary-package": {
- "source": "iana"
- },
- "application/vnd.dece.data": {
- "source": "iana",
- "extensions": ["uvf","uvvf","uvd","uvvd"]
- },
- "application/vnd.dece.ttml+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["uvt","uvvt"]
- },
- "application/vnd.dece.unspecified": {
- "source": "iana",
- "extensions": ["uvx","uvvx"]
- },
- "application/vnd.dece.zip": {
- "source": "iana",
- "extensions": ["uvz","uvvz"]
- },
- "application/vnd.denovo.fcselayout-link": {
- "source": "iana",
- "extensions": ["fe_launch"]
- },
- "application/vnd.desmume.movie": {
- "source": "iana"
- },
- "application/vnd.dir-bi.plate-dl-nosuffix": {
- "source": "iana"
- },
- "application/vnd.dm.delegation+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.dna": {
- "source": "iana",
- "extensions": ["dna"]
- },
- "application/vnd.document+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.dolby.mlp": {
- "source": "apache",
- "extensions": ["mlp"]
- },
- "application/vnd.dolby.mobile.1": {
- "source": "iana"
- },
- "application/vnd.dolby.mobile.2": {
- "source": "iana"
- },
- "application/vnd.doremir.scorecloud-binary-document": {
- "source": "iana"
- },
- "application/vnd.dpgraph": {
- "source": "iana",
- "extensions": ["dpg"]
- },
- "application/vnd.dreamfactory": {
- "source": "iana",
- "extensions": ["dfac"]
- },
- "application/vnd.drive+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.ds-keypoint": {
- "source": "apache",
- "extensions": ["kpxx"]
- },
- "application/vnd.dtg.local": {
- "source": "iana"
- },
- "application/vnd.dtg.local.flash": {
- "source": "iana"
- },
- "application/vnd.dtg.local.html": {
- "source": "iana"
- },
- "application/vnd.dvb.ait": {
- "source": "iana",
- "extensions": ["ait"]
- },
- "application/vnd.dvb.dvbisl+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.dvb.dvbj": {
- "source": "iana"
- },
- "application/vnd.dvb.esgcontainer": {
- "source": "iana"
- },
- "application/vnd.dvb.ipdcdftnotifaccess": {
- "source": "iana"
- },
- "application/vnd.dvb.ipdcesgaccess": {
- "source": "iana"
- },
- "application/vnd.dvb.ipdcesgaccess2": {
- "source": "iana"
- },
- "application/vnd.dvb.ipdcesgpdd": {
- "source": "iana"
- },
- "application/vnd.dvb.ipdcroaming": {
- "source": "iana"
- },
- "application/vnd.dvb.iptv.alfec-base": {
- "source": "iana"
- },
- "application/vnd.dvb.iptv.alfec-enhancement": {
- "source": "iana"
- },
- "application/vnd.dvb.notif-aggregate-root+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.dvb.notif-container+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.dvb.notif-generic+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.dvb.notif-ia-msglist+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.dvb.notif-ia-registration-request+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.dvb.notif-ia-registration-response+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.dvb.notif-init+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.dvb.pfr": {
- "source": "iana"
- },
- "application/vnd.dvb.service": {
- "source": "iana",
- "extensions": ["svc"]
- },
- "application/vnd.dxr": {
- "source": "iana"
- },
- "application/vnd.dynageo": {
- "source": "iana",
- "extensions": ["geo"]
- },
- "application/vnd.dzr": {
- "source": "iana"
- },
- "application/vnd.easykaraoke.cdgdownload": {
- "source": "iana"
- },
- "application/vnd.ecdis-update": {
- "source": "iana"
- },
- "application/vnd.ecip.rlp": {
- "source": "iana"
- },
- "application/vnd.eclipse.ditto+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.ecowin.chart": {
- "source": "iana",
- "extensions": ["mag"]
- },
- "application/vnd.ecowin.filerequest": {
- "source": "iana"
- },
- "application/vnd.ecowin.fileupdate": {
- "source": "iana"
- },
- "application/vnd.ecowin.series": {
- "source": "iana"
- },
- "application/vnd.ecowin.seriesrequest": {
- "source": "iana"
- },
- "application/vnd.ecowin.seriesupdate": {
- "source": "iana"
- },
- "application/vnd.efi.img": {
- "source": "iana"
- },
- "application/vnd.efi.iso": {
- "source": "iana"
- },
- "application/vnd.emclient.accessrequest+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.enliven": {
- "source": "iana",
- "extensions": ["nml"]
- },
- "application/vnd.enphase.envoy": {
- "source": "iana"
- },
- "application/vnd.eprints.data+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.epson.esf": {
- "source": "iana",
- "extensions": ["esf"]
- },
- "application/vnd.epson.msf": {
- "source": "iana",
- "extensions": ["msf"]
- },
- "application/vnd.epson.quickanime": {
- "source": "iana",
- "extensions": ["qam"]
- },
- "application/vnd.epson.salt": {
- "source": "iana",
- "extensions": ["slt"]
- },
- "application/vnd.epson.ssf": {
- "source": "iana",
- "extensions": ["ssf"]
- },
- "application/vnd.ericsson.quickcall": {
- "source": "iana"
- },
- "application/vnd.espass-espass+zip": {
- "source": "iana",
- "compressible": false
- },
- "application/vnd.eszigno3+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["es3","et3"]
- },
- "application/vnd.etsi.aoc+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.etsi.asic-e+zip": {
- "source": "iana",
- "compressible": false
- },
- "application/vnd.etsi.asic-s+zip": {
- "source": "iana",
- "compressible": false
- },
- "application/vnd.etsi.cug+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.etsi.iptvcommand+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.etsi.iptvdiscovery+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.etsi.iptvprofile+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.etsi.iptvsad-bc+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.etsi.iptvsad-cod+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.etsi.iptvsad-npvr+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.etsi.iptvservice+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.etsi.iptvsync+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.etsi.iptvueprofile+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.etsi.mcid+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.etsi.mheg5": {
- "source": "iana"
- },
- "application/vnd.etsi.overload-control-policy-dataset+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.etsi.pstn+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.etsi.sci+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.etsi.simservs+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.etsi.timestamp-token": {
- "source": "iana"
- },
- "application/vnd.etsi.tsl+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.etsi.tsl.der": {
- "source": "iana"
- },
- "application/vnd.eu.kasparian.car+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.eudora.data": {
- "source": "iana"
- },
- "application/vnd.evolv.ecig.profile": {
- "source": "iana"
- },
- "application/vnd.evolv.ecig.settings": {
- "source": "iana"
- },
- "application/vnd.evolv.ecig.theme": {
- "source": "iana"
- },
- "application/vnd.exstream-empower+zip": {
- "source": "iana",
- "compressible": false
- },
- "application/vnd.exstream-package": {
- "source": "iana"
- },
- "application/vnd.ezpix-album": {
- "source": "iana",
- "extensions": ["ez2"]
- },
- "application/vnd.ezpix-package": {
- "source": "iana",
- "extensions": ["ez3"]
- },
- "application/vnd.f-secure.mobile": {
- "source": "iana"
- },
- "application/vnd.familysearch.gedcom+zip": {
- "source": "iana",
- "compressible": false
- },
- "application/vnd.fastcopy-disk-image": {
- "source": "iana"
- },
- "application/vnd.fdf": {
- "source": "iana",
- "extensions": ["fdf"]
- },
- "application/vnd.fdsn.mseed": {
- "source": "iana",
- "extensions": ["mseed"]
- },
- "application/vnd.fdsn.seed": {
- "source": "iana",
- "extensions": ["seed","dataless"]
- },
- "application/vnd.ffsns": {
- "source": "iana"
- },
- "application/vnd.ficlab.flb+zip": {
- "source": "iana",
- "compressible": false
- },
- "application/vnd.filmit.zfc": {
- "source": "iana"
- },
- "application/vnd.fints": {
- "source": "iana"
- },
- "application/vnd.firemonkeys.cloudcell": {
- "source": "iana"
- },
- "application/vnd.flographit": {
- "source": "iana",
- "extensions": ["gph"]
- },
- "application/vnd.fluxtime.clip": {
- "source": "iana",
- "extensions": ["ftc"]
- },
- "application/vnd.font-fontforge-sfd": {
- "source": "iana"
- },
- "application/vnd.framemaker": {
- "source": "iana",
- "extensions": ["fm","frame","maker","book"]
- },
- "application/vnd.frogans.fnc": {
- "source": "iana",
- "extensions": ["fnc"]
- },
- "application/vnd.frogans.ltf": {
- "source": "iana",
- "extensions": ["ltf"]
- },
- "application/vnd.fsc.weblaunch": {
- "source": "iana",
- "extensions": ["fsc"]
- },
- "application/vnd.fujifilm.fb.docuworks": {
- "source": "iana"
- },
- "application/vnd.fujifilm.fb.docuworks.binder": {
- "source": "iana"
- },
- "application/vnd.fujifilm.fb.docuworks.container": {
- "source": "iana"
- },
- "application/vnd.fujifilm.fb.jfi+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.fujitsu.oasys": {
- "source": "iana",
- "extensions": ["oas"]
- },
- "application/vnd.fujitsu.oasys2": {
- "source": "iana",
- "extensions": ["oa2"]
- },
- "application/vnd.fujitsu.oasys3": {
- "source": "iana",
- "extensions": ["oa3"]
- },
- "application/vnd.fujitsu.oasysgp": {
- "source": "iana",
- "extensions": ["fg5"]
- },
- "application/vnd.fujitsu.oasysprs": {
- "source": "iana",
- "extensions": ["bh2"]
- },
- "application/vnd.fujixerox.art-ex": {
- "source": "iana"
- },
- "application/vnd.fujixerox.art4": {
- "source": "iana"
- },
- "application/vnd.fujixerox.ddd": {
- "source": "iana",
- "extensions": ["ddd"]
- },
- "application/vnd.fujixerox.docuworks": {
- "source": "iana",
- "extensions": ["xdw"]
- },
- "application/vnd.fujixerox.docuworks.binder": {
- "source": "iana",
- "extensions": ["xbd"]
- },
- "application/vnd.fujixerox.docuworks.container": {
- "source": "iana"
- },
- "application/vnd.fujixerox.hbpl": {
- "source": "iana"
- },
- "application/vnd.fut-misnet": {
- "source": "iana"
- },
- "application/vnd.futoin+cbor": {
- "source": "iana"
- },
- "application/vnd.futoin+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.fuzzysheet": {
- "source": "iana",
- "extensions": ["fzs"]
- },
- "application/vnd.genomatix.tuxedo": {
- "source": "iana",
- "extensions": ["txd"]
- },
- "application/vnd.gentics.grd+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.geo+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.geocube+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.geogebra.file": {
- "source": "iana",
- "extensions": ["ggb"]
- },
- "application/vnd.geogebra.slides": {
- "source": "iana"
- },
- "application/vnd.geogebra.tool": {
- "source": "iana",
- "extensions": ["ggt"]
- },
- "application/vnd.geometry-explorer": {
- "source": "iana",
- "extensions": ["gex","gre"]
- },
- "application/vnd.geonext": {
- "source": "iana",
- "extensions": ["gxt"]
- },
- "application/vnd.geoplan": {
- "source": "iana",
- "extensions": ["g2w"]
- },
- "application/vnd.geospace": {
- "source": "iana",
- "extensions": ["g3w"]
- },
- "application/vnd.gerber": {
- "source": "iana"
- },
- "application/vnd.globalplatform.card-content-mgt": {
- "source": "iana"
- },
- "application/vnd.globalplatform.card-content-mgt-response": {
- "source": "iana"
- },
- "application/vnd.gmx": {
- "source": "iana",
- "extensions": ["gmx"]
- },
- "application/vnd.google-apps.document": {
- "compressible": false,
- "extensions": ["gdoc"]
- },
- "application/vnd.google-apps.presentation": {
- "compressible": false,
- "extensions": ["gslides"]
- },
- "application/vnd.google-apps.spreadsheet": {
- "compressible": false,
- "extensions": ["gsheet"]
- },
- "application/vnd.google-earth.kml+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["kml"]
- },
- "application/vnd.google-earth.kmz": {
- "source": "iana",
- "compressible": false,
- "extensions": ["kmz"]
- },
- "application/vnd.gov.sk.e-form+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.gov.sk.e-form+zip": {
- "source": "iana",
- "compressible": false
- },
- "application/vnd.gov.sk.xmldatacontainer+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.grafeq": {
- "source": "iana",
- "extensions": ["gqf","gqs"]
- },
- "application/vnd.gridmp": {
- "source": "iana"
- },
- "application/vnd.groove-account": {
- "source": "iana",
- "extensions": ["gac"]
- },
- "application/vnd.groove-help": {
- "source": "iana",
- "extensions": ["ghf"]
- },
- "application/vnd.groove-identity-message": {
- "source": "iana",
- "extensions": ["gim"]
- },
- "application/vnd.groove-injector": {
- "source": "iana",
- "extensions": ["grv"]
- },
- "application/vnd.groove-tool-message": {
- "source": "iana",
- "extensions": ["gtm"]
- },
- "application/vnd.groove-tool-template": {
- "source": "iana",
- "extensions": ["tpl"]
- },
- "application/vnd.groove-vcard": {
- "source": "iana",
- "extensions": ["vcg"]
- },
- "application/vnd.hal+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.hal+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["hal"]
- },
- "application/vnd.handheld-entertainment+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["zmm"]
- },
- "application/vnd.hbci": {
- "source": "iana",
- "extensions": ["hbci"]
- },
- "application/vnd.hc+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.hcl-bireports": {
- "source": "iana"
- },
- "application/vnd.hdt": {
- "source": "iana"
- },
- "application/vnd.heroku+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.hhe.lesson-player": {
- "source": "iana",
- "extensions": ["les"]
- },
- "application/vnd.hl7cda+xml": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true
- },
- "application/vnd.hl7v2+xml": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true
- },
- "application/vnd.hp-hpgl": {
- "source": "iana",
- "extensions": ["hpgl"]
- },
- "application/vnd.hp-hpid": {
- "source": "iana",
- "extensions": ["hpid"]
- },
- "application/vnd.hp-hps": {
- "source": "iana",
- "extensions": ["hps"]
- },
- "application/vnd.hp-jlyt": {
- "source": "iana",
- "extensions": ["jlt"]
- },
- "application/vnd.hp-pcl": {
- "source": "iana",
- "extensions": ["pcl"]
- },
- "application/vnd.hp-pclxl": {
- "source": "iana",
- "extensions": ["pclxl"]
- },
- "application/vnd.httphone": {
- "source": "iana"
- },
- "application/vnd.hydrostatix.sof-data": {
- "source": "iana",
- "extensions": ["sfd-hdstx"]
- },
- "application/vnd.hyper+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.hyper-item+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.hyperdrive+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.hzn-3d-crossword": {
- "source": "iana"
- },
- "application/vnd.ibm.afplinedata": {
- "source": "iana"
- },
- "application/vnd.ibm.electronic-media": {
- "source": "iana"
- },
- "application/vnd.ibm.minipay": {
- "source": "iana",
- "extensions": ["mpy"]
- },
- "application/vnd.ibm.modcap": {
- "source": "iana",
- "extensions": ["afp","listafp","list3820"]
- },
- "application/vnd.ibm.rights-management": {
- "source": "iana",
- "extensions": ["irm"]
- },
- "application/vnd.ibm.secure-container": {
- "source": "iana",
- "extensions": ["sc"]
- },
- "application/vnd.iccprofile": {
- "source": "iana",
- "extensions": ["icc","icm"]
- },
- "application/vnd.ieee.1905": {
- "source": "iana"
- },
- "application/vnd.igloader": {
- "source": "iana",
- "extensions": ["igl"]
- },
- "application/vnd.imagemeter.folder+zip": {
- "source": "iana",
- "compressible": false
- },
- "application/vnd.imagemeter.image+zip": {
- "source": "iana",
- "compressible": false
- },
- "application/vnd.immervision-ivp": {
- "source": "iana",
- "extensions": ["ivp"]
- },
- "application/vnd.immervision-ivu": {
- "source": "iana",
- "extensions": ["ivu"]
- },
- "application/vnd.ims.imsccv1p1": {
- "source": "iana"
- },
- "application/vnd.ims.imsccv1p2": {
- "source": "iana"
- },
- "application/vnd.ims.imsccv1p3": {
- "source": "iana"
- },
- "application/vnd.ims.lis.v2.result+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.ims.lti.v2.toolconsumerprofile+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.ims.lti.v2.toolproxy+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.ims.lti.v2.toolproxy.id+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.ims.lti.v2.toolsettings+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.ims.lti.v2.toolsettings.simple+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.informedcontrol.rms+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.informix-visionary": {
- "source": "iana"
- },
- "application/vnd.infotech.project": {
- "source": "iana"
- },
- "application/vnd.infotech.project+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.innopath.wamp.notification": {
- "source": "iana"
- },
- "application/vnd.insors.igm": {
- "source": "iana",
- "extensions": ["igm"]
- },
- "application/vnd.intercon.formnet": {
- "source": "iana",
- "extensions": ["xpw","xpx"]
- },
- "application/vnd.intergeo": {
- "source": "iana",
- "extensions": ["i2g"]
- },
- "application/vnd.intertrust.digibox": {
- "source": "iana"
- },
- "application/vnd.intertrust.nncp": {
- "source": "iana"
- },
- "application/vnd.intu.qbo": {
- "source": "iana",
- "extensions": ["qbo"]
- },
- "application/vnd.intu.qfx": {
- "source": "iana",
- "extensions": ["qfx"]
- },
- "application/vnd.iptc.g2.catalogitem+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.iptc.g2.conceptitem+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.iptc.g2.knowledgeitem+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.iptc.g2.newsitem+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.iptc.g2.newsmessage+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.iptc.g2.packageitem+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.iptc.g2.planningitem+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.ipunplugged.rcprofile": {
- "source": "iana",
- "extensions": ["rcprofile"]
- },
- "application/vnd.irepository.package+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["irp"]
- },
- "application/vnd.is-xpr": {
- "source": "iana",
- "extensions": ["xpr"]
- },
- "application/vnd.isac.fcs": {
- "source": "iana",
- "extensions": ["fcs"]
- },
- "application/vnd.iso11783-10+zip": {
- "source": "iana",
- "compressible": false
- },
- "application/vnd.jam": {
- "source": "iana",
- "extensions": ["jam"]
- },
- "application/vnd.japannet-directory-service": {
- "source": "iana"
- },
- "application/vnd.japannet-jpnstore-wakeup": {
- "source": "iana"
- },
- "application/vnd.japannet-payment-wakeup": {
- "source": "iana"
- },
- "application/vnd.japannet-registration": {
- "source": "iana"
- },
- "application/vnd.japannet-registration-wakeup": {
- "source": "iana"
- },
- "application/vnd.japannet-setstore-wakeup": {
- "source": "iana"
- },
- "application/vnd.japannet-verification": {
- "source": "iana"
- },
- "application/vnd.japannet-verification-wakeup": {
- "source": "iana"
- },
- "application/vnd.jcp.javame.midlet-rms": {
- "source": "iana",
- "extensions": ["rms"]
- },
- "application/vnd.jisp": {
- "source": "iana",
- "extensions": ["jisp"]
- },
- "application/vnd.joost.joda-archive": {
- "source": "iana",
- "extensions": ["joda"]
- },
- "application/vnd.jsk.isdn-ngn": {
- "source": "iana"
- },
- "application/vnd.kahootz": {
- "source": "iana",
- "extensions": ["ktz","ktr"]
- },
- "application/vnd.kde.karbon": {
- "source": "iana",
- "extensions": ["karbon"]
- },
- "application/vnd.kde.kchart": {
- "source": "iana",
- "extensions": ["chrt"]
- },
- "application/vnd.kde.kformula": {
- "source": "iana",
- "extensions": ["kfo"]
- },
- "application/vnd.kde.kivio": {
- "source": "iana",
- "extensions": ["flw"]
- },
- "application/vnd.kde.kontour": {
- "source": "iana",
- "extensions": ["kon"]
- },
- "application/vnd.kde.kpresenter": {
- "source": "iana",
- "extensions": ["kpr","kpt"]
- },
- "application/vnd.kde.kspread": {
- "source": "iana",
- "extensions": ["ksp"]
- },
- "application/vnd.kde.kword": {
- "source": "iana",
- "extensions": ["kwd","kwt"]
- },
- "application/vnd.kenameaapp": {
- "source": "iana",
- "extensions": ["htke"]
- },
- "application/vnd.kidspiration": {
- "source": "iana",
- "extensions": ["kia"]
- },
- "application/vnd.kinar": {
- "source": "iana",
- "extensions": ["kne","knp"]
- },
- "application/vnd.koan": {
- "source": "iana",
- "extensions": ["skp","skd","skt","skm"]
- },
- "application/vnd.kodak-descriptor": {
- "source": "iana",
- "extensions": ["sse"]
- },
- "application/vnd.las": {
- "source": "iana"
- },
- "application/vnd.las.las+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.las.las+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["lasxml"]
- },
- "application/vnd.laszip": {
- "source": "iana"
- },
- "application/vnd.leap+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.liberty-request+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.llamagraphics.life-balance.desktop": {
- "source": "iana",
- "extensions": ["lbd"]
- },
- "application/vnd.llamagraphics.life-balance.exchange+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["lbe"]
- },
- "application/vnd.logipipe.circuit+zip": {
- "source": "iana",
- "compressible": false
- },
- "application/vnd.loom": {
- "source": "iana"
- },
- "application/vnd.lotus-1-2-3": {
- "source": "iana",
- "extensions": ["123"]
- },
- "application/vnd.lotus-approach": {
- "source": "iana",
- "extensions": ["apr"]
- },
- "application/vnd.lotus-freelance": {
- "source": "iana",
- "extensions": ["pre"]
- },
- "application/vnd.lotus-notes": {
- "source": "iana",
- "extensions": ["nsf"]
- },
- "application/vnd.lotus-organizer": {
- "source": "iana",
- "extensions": ["org"]
- },
- "application/vnd.lotus-screencam": {
- "source": "iana",
- "extensions": ["scm"]
- },
- "application/vnd.lotus-wordpro": {
- "source": "iana",
- "extensions": ["lwp"]
- },
- "application/vnd.macports.portpkg": {
- "source": "iana",
- "extensions": ["portpkg"]
- },
- "application/vnd.mapbox-vector-tile": {
- "source": "iana",
- "extensions": ["mvt"]
- },
- "application/vnd.marlin.drm.actiontoken+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.marlin.drm.conftoken+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.marlin.drm.license+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.marlin.drm.mdcf": {
- "source": "iana"
- },
- "application/vnd.mason+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.maxar.archive.3tz+zip": {
- "source": "iana",
- "compressible": false
- },
- "application/vnd.maxmind.maxmind-db": {
- "source": "iana"
- },
- "application/vnd.mcd": {
- "source": "iana",
- "extensions": ["mcd"]
- },
- "application/vnd.medcalcdata": {
- "source": "iana",
- "extensions": ["mc1"]
- },
- "application/vnd.mediastation.cdkey": {
- "source": "iana",
- "extensions": ["cdkey"]
- },
- "application/vnd.meridian-slingshot": {
- "source": "iana"
- },
- "application/vnd.mfer": {
- "source": "iana",
- "extensions": ["mwf"]
- },
- "application/vnd.mfmp": {
- "source": "iana",
- "extensions": ["mfm"]
- },
- "application/vnd.micro+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.micrografx.flo": {
- "source": "iana",
- "extensions": ["flo"]
- },
- "application/vnd.micrografx.igx": {
- "source": "iana",
- "extensions": ["igx"]
- },
- "application/vnd.microsoft.portable-executable": {
- "source": "iana"
- },
- "application/vnd.microsoft.windows.thumbnail-cache": {
- "source": "iana"
- },
- "application/vnd.miele+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.mif": {
- "source": "iana",
- "extensions": ["mif"]
- },
- "application/vnd.minisoft-hp3000-save": {
- "source": "iana"
- },
- "application/vnd.mitsubishi.misty-guard.trustweb": {
- "source": "iana"
- },
- "application/vnd.mobius.daf": {
- "source": "iana",
- "extensions": ["daf"]
- },
- "application/vnd.mobius.dis": {
- "source": "iana",
- "extensions": ["dis"]
- },
- "application/vnd.mobius.mbk": {
- "source": "iana",
- "extensions": ["mbk"]
- },
- "application/vnd.mobius.mqy": {
- "source": "iana",
- "extensions": ["mqy"]
- },
- "application/vnd.mobius.msl": {
- "source": "iana",
- "extensions": ["msl"]
- },
- "application/vnd.mobius.plc": {
- "source": "iana",
- "extensions": ["plc"]
- },
- "application/vnd.mobius.txf": {
- "source": "iana",
- "extensions": ["txf"]
- },
- "application/vnd.mophun.application": {
- "source": "iana",
- "extensions": ["mpn"]
- },
- "application/vnd.mophun.certificate": {
- "source": "iana",
- "extensions": ["mpc"]
- },
- "application/vnd.motorola.flexsuite": {
- "source": "iana"
- },
- "application/vnd.motorola.flexsuite.adsi": {
- "source": "iana"
- },
- "application/vnd.motorola.flexsuite.fis": {
- "source": "iana"
- },
- "application/vnd.motorola.flexsuite.gotap": {
- "source": "iana"
- },
- "application/vnd.motorola.flexsuite.kmr": {
- "source": "iana"
- },
- "application/vnd.motorola.flexsuite.ttc": {
- "source": "iana"
- },
- "application/vnd.motorola.flexsuite.wem": {
- "source": "iana"
- },
- "application/vnd.motorola.iprm": {
- "source": "iana"
- },
- "application/vnd.mozilla.xul+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["xul"]
- },
- "application/vnd.ms-3mfdocument": {
- "source": "iana"
- },
- "application/vnd.ms-artgalry": {
- "source": "iana",
- "extensions": ["cil"]
- },
- "application/vnd.ms-asf": {
- "source": "iana"
- },
- "application/vnd.ms-cab-compressed": {
- "source": "iana",
- "extensions": ["cab"]
- },
- "application/vnd.ms-color.iccprofile": {
- "source": "apache"
- },
- "application/vnd.ms-excel": {
- "source": "iana",
- "compressible": false,
- "extensions": ["xls","xlm","xla","xlc","xlt","xlw"]
- },
- "application/vnd.ms-excel.addin.macroenabled.12": {
- "source": "iana",
- "extensions": ["xlam"]
- },
- "application/vnd.ms-excel.sheet.binary.macroenabled.12": {
- "source": "iana",
- "extensions": ["xlsb"]
- },
- "application/vnd.ms-excel.sheet.macroenabled.12": {
- "source": "iana",
- "extensions": ["xlsm"]
- },
- "application/vnd.ms-excel.template.macroenabled.12": {
- "source": "iana",
- "extensions": ["xltm"]
- },
- "application/vnd.ms-fontobject": {
- "source": "iana",
- "compressible": true,
- "extensions": ["eot"]
- },
- "application/vnd.ms-htmlhelp": {
- "source": "iana",
- "extensions": ["chm"]
- },
- "application/vnd.ms-ims": {
- "source": "iana",
- "extensions": ["ims"]
- },
- "application/vnd.ms-lrm": {
- "source": "iana",
- "extensions": ["lrm"]
- },
- "application/vnd.ms-office.activex+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.ms-officetheme": {
- "source": "iana",
- "extensions": ["thmx"]
- },
- "application/vnd.ms-opentype": {
- "source": "apache",
- "compressible": true
- },
- "application/vnd.ms-outlook": {
- "compressible": false,
- "extensions": ["msg"]
- },
- "application/vnd.ms-package.obfuscated-opentype": {
- "source": "apache"
- },
- "application/vnd.ms-pki.seccat": {
- "source": "apache",
- "extensions": ["cat"]
- },
- "application/vnd.ms-pki.stl": {
- "source": "apache",
- "extensions": ["stl"]
- },
- "application/vnd.ms-playready.initiator+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.ms-powerpoint": {
- "source": "iana",
- "compressible": false,
- "extensions": ["ppt","pps","pot"]
- },
- "application/vnd.ms-powerpoint.addin.macroenabled.12": {
- "source": "iana",
- "extensions": ["ppam"]
- },
- "application/vnd.ms-powerpoint.presentation.macroenabled.12": {
- "source": "iana",
- "extensions": ["pptm"]
- },
- "application/vnd.ms-powerpoint.slide.macroenabled.12": {
- "source": "iana",
- "extensions": ["sldm"]
- },
- "application/vnd.ms-powerpoint.slideshow.macroenabled.12": {
- "source": "iana",
- "extensions": ["ppsm"]
- },
- "application/vnd.ms-powerpoint.template.macroenabled.12": {
- "source": "iana",
- "extensions": ["potm"]
- },
- "application/vnd.ms-printdevicecapabilities+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.ms-printing.printticket+xml": {
- "source": "apache",
- "compressible": true
- },
- "application/vnd.ms-printschematicket+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.ms-project": {
- "source": "iana",
- "extensions": ["mpp","mpt"]
- },
- "application/vnd.ms-tnef": {
- "source": "iana"
- },
- "application/vnd.ms-windows.devicepairing": {
- "source": "iana"
- },
- "application/vnd.ms-windows.nwprinting.oob": {
- "source": "iana"
- },
- "application/vnd.ms-windows.printerpairing": {
- "source": "iana"
- },
- "application/vnd.ms-windows.wsd.oob": {
- "source": "iana"
- },
- "application/vnd.ms-wmdrm.lic-chlg-req": {
- "source": "iana"
- },
- "application/vnd.ms-wmdrm.lic-resp": {
- "source": "iana"
- },
- "application/vnd.ms-wmdrm.meter-chlg-req": {
- "source": "iana"
- },
- "application/vnd.ms-wmdrm.meter-resp": {
- "source": "iana"
- },
- "application/vnd.ms-word.document.macroenabled.12": {
- "source": "iana",
- "extensions": ["docm"]
- },
- "application/vnd.ms-word.template.macroenabled.12": {
- "source": "iana",
- "extensions": ["dotm"]
- },
- "application/vnd.ms-works": {
- "source": "iana",
- "extensions": ["wps","wks","wcm","wdb"]
- },
- "application/vnd.ms-wpl": {
- "source": "iana",
- "extensions": ["wpl"]
- },
- "application/vnd.ms-xpsdocument": {
- "source": "iana",
- "compressible": false,
- "extensions": ["xps"]
- },
- "application/vnd.msa-disk-image": {
- "source": "iana"
- },
- "application/vnd.mseq": {
- "source": "iana",
- "extensions": ["mseq"]
- },
- "application/vnd.msign": {
- "source": "iana"
- },
- "application/vnd.multiad.creator": {
- "source": "iana"
- },
- "application/vnd.multiad.creator.cif": {
- "source": "iana"
- },
- "application/vnd.music-niff": {
- "source": "iana"
- },
- "application/vnd.musician": {
- "source": "iana",
- "extensions": ["mus"]
- },
- "application/vnd.muvee.style": {
- "source": "iana",
- "extensions": ["msty"]
- },
- "application/vnd.mynfc": {
- "source": "iana",
- "extensions": ["taglet"]
- },
- "application/vnd.nacamar.ybrid+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.ncd.control": {
- "source": "iana"
- },
- "application/vnd.ncd.reference": {
- "source": "iana"
- },
- "application/vnd.nearst.inv+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.nebumind.line": {
- "source": "iana"
- },
- "application/vnd.nervana": {
- "source": "iana"
- },
- "application/vnd.netfpx": {
- "source": "iana"
- },
- "application/vnd.neurolanguage.nlu": {
- "source": "iana",
- "extensions": ["nlu"]
- },
- "application/vnd.nimn": {
- "source": "iana"
- },
- "application/vnd.nintendo.nitro.rom": {
- "source": "iana"
- },
- "application/vnd.nintendo.snes.rom": {
- "source": "iana"
- },
- "application/vnd.nitf": {
- "source": "iana",
- "extensions": ["ntf","nitf"]
- },
- "application/vnd.noblenet-directory": {
- "source": "iana",
- "extensions": ["nnd"]
- },
- "application/vnd.noblenet-sealer": {
- "source": "iana",
- "extensions": ["nns"]
- },
- "application/vnd.noblenet-web": {
- "source": "iana",
- "extensions": ["nnw"]
- },
- "application/vnd.nokia.catalogs": {
- "source": "iana"
- },
- "application/vnd.nokia.conml+wbxml": {
- "source": "iana"
- },
- "application/vnd.nokia.conml+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.nokia.iptv.config+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.nokia.isds-radio-presets": {
- "source": "iana"
- },
- "application/vnd.nokia.landmark+wbxml": {
- "source": "iana"
- },
- "application/vnd.nokia.landmark+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.nokia.landmarkcollection+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.nokia.n-gage.ac+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["ac"]
- },
- "application/vnd.nokia.n-gage.data": {
- "source": "iana",
- "extensions": ["ngdat"]
- },
- "application/vnd.nokia.n-gage.symbian.install": {
- "source": "iana",
- "extensions": ["n-gage"]
- },
- "application/vnd.nokia.ncd": {
- "source": "iana"
- },
- "application/vnd.nokia.pcd+wbxml": {
- "source": "iana"
- },
- "application/vnd.nokia.pcd+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.nokia.radio-preset": {
- "source": "iana",
- "extensions": ["rpst"]
- },
- "application/vnd.nokia.radio-presets": {
- "source": "iana",
- "extensions": ["rpss"]
- },
- "application/vnd.novadigm.edm": {
- "source": "iana",
- "extensions": ["edm"]
- },
- "application/vnd.novadigm.edx": {
- "source": "iana",
- "extensions": ["edx"]
- },
- "application/vnd.novadigm.ext": {
- "source": "iana",
- "extensions": ["ext"]
- },
- "application/vnd.ntt-local.content-share": {
- "source": "iana"
- },
- "application/vnd.ntt-local.file-transfer": {
- "source": "iana"
- },
- "application/vnd.ntt-local.ogw_remote-access": {
- "source": "iana"
- },
- "application/vnd.ntt-local.sip-ta_remote": {
- "source": "iana"
- },
- "application/vnd.ntt-local.sip-ta_tcp_stream": {
- "source": "iana"
- },
- "application/vnd.oasis.opendocument.chart": {
- "source": "iana",
- "extensions": ["odc"]
- },
- "application/vnd.oasis.opendocument.chart-template": {
- "source": "iana",
- "extensions": ["otc"]
- },
- "application/vnd.oasis.opendocument.database": {
- "source": "iana",
- "extensions": ["odb"]
- },
- "application/vnd.oasis.opendocument.formula": {
- "source": "iana",
- "extensions": ["odf"]
- },
- "application/vnd.oasis.opendocument.formula-template": {
- "source": "iana",
- "extensions": ["odft"]
- },
- "application/vnd.oasis.opendocument.graphics": {
- "source": "iana",
- "compressible": false,
- "extensions": ["odg"]
- },
- "application/vnd.oasis.opendocument.graphics-template": {
- "source": "iana",
- "extensions": ["otg"]
- },
- "application/vnd.oasis.opendocument.image": {
- "source": "iana",
- "extensions": ["odi"]
- },
- "application/vnd.oasis.opendocument.image-template": {
- "source": "iana",
- "extensions": ["oti"]
- },
- "application/vnd.oasis.opendocument.presentation": {
- "source": "iana",
- "compressible": false,
- "extensions": ["odp"]
- },
- "application/vnd.oasis.opendocument.presentation-template": {
- "source": "iana",
- "extensions": ["otp"]
- },
- "application/vnd.oasis.opendocument.spreadsheet": {
- "source": "iana",
- "compressible": false,
- "extensions": ["ods"]
- },
- "application/vnd.oasis.opendocument.spreadsheet-template": {
- "source": "iana",
- "extensions": ["ots"]
- },
- "application/vnd.oasis.opendocument.text": {
- "source": "iana",
- "compressible": false,
- "extensions": ["odt"]
- },
- "application/vnd.oasis.opendocument.text-master": {
- "source": "iana",
- "extensions": ["odm"]
- },
- "application/vnd.oasis.opendocument.text-template": {
- "source": "iana",
- "extensions": ["ott"]
- },
- "application/vnd.oasis.opendocument.text-web": {
- "source": "iana",
- "extensions": ["oth"]
- },
- "application/vnd.obn": {
- "source": "iana"
- },
- "application/vnd.ocf+cbor": {
- "source": "iana"
- },
- "application/vnd.oci.image.manifest.v1+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oftn.l10n+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oipf.contentaccessdownload+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oipf.contentaccessstreaming+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oipf.cspg-hexbinary": {
- "source": "iana"
- },
- "application/vnd.oipf.dae.svg+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oipf.dae.xhtml+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oipf.mippvcontrolmessage+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oipf.pae.gem": {
- "source": "iana"
- },
- "application/vnd.oipf.spdiscovery+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oipf.spdlist+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oipf.ueprofile+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oipf.userprofile+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.olpc-sugar": {
- "source": "iana",
- "extensions": ["xo"]
- },
- "application/vnd.oma-scws-config": {
- "source": "iana"
- },
- "application/vnd.oma-scws-http-request": {
- "source": "iana"
- },
- "application/vnd.oma-scws-http-response": {
- "source": "iana"
- },
- "application/vnd.oma.bcast.associated-procedure-parameter+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oma.bcast.drm-trigger+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oma.bcast.imd+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oma.bcast.ltkm": {
- "source": "iana"
- },
- "application/vnd.oma.bcast.notification+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oma.bcast.provisioningtrigger": {
- "source": "iana"
- },
- "application/vnd.oma.bcast.sgboot": {
- "source": "iana"
- },
- "application/vnd.oma.bcast.sgdd+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oma.bcast.sgdu": {
- "source": "iana"
- },
- "application/vnd.oma.bcast.simple-symbol-container": {
- "source": "iana"
- },
- "application/vnd.oma.bcast.smartcard-trigger+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oma.bcast.sprov+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oma.bcast.stkm": {
- "source": "iana"
- },
- "application/vnd.oma.cab-address-book+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oma.cab-feature-handler+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oma.cab-pcc+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oma.cab-subs-invite+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oma.cab-user-prefs+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oma.dcd": {
- "source": "iana"
- },
- "application/vnd.oma.dcdc": {
- "source": "iana"
- },
- "application/vnd.oma.dd2+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["dd2"]
- },
- "application/vnd.oma.drm.risd+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oma.group-usage-list+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oma.lwm2m+cbor": {
- "source": "iana"
- },
- "application/vnd.oma.lwm2m+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oma.lwm2m+tlv": {
- "source": "iana"
- },
- "application/vnd.oma.pal+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oma.poc.detailed-progress-report+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oma.poc.final-report+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oma.poc.groups+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oma.poc.invocation-descriptor+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oma.poc.optimized-progress-report+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oma.push": {
- "source": "iana"
- },
- "application/vnd.oma.scidm.messages+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oma.xcap-directory+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.omads-email+xml": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true
- },
- "application/vnd.omads-file+xml": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true
- },
- "application/vnd.omads-folder+xml": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true
- },
- "application/vnd.omaloc-supl-init": {
- "source": "iana"
- },
- "application/vnd.onepager": {
- "source": "iana"
- },
- "application/vnd.onepagertamp": {
- "source": "iana"
- },
- "application/vnd.onepagertamx": {
- "source": "iana"
- },
- "application/vnd.onepagertat": {
- "source": "iana"
- },
- "application/vnd.onepagertatp": {
- "source": "iana"
- },
- "application/vnd.onepagertatx": {
- "source": "iana"
- },
- "application/vnd.openblox.game+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["obgx"]
- },
- "application/vnd.openblox.game-binary": {
- "source": "iana"
- },
- "application/vnd.openeye.oeb": {
- "source": "iana"
- },
- "application/vnd.openofficeorg.extension": {
- "source": "apache",
- "extensions": ["oxt"]
- },
- "application/vnd.openstreetmap.data+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["osm"]
- },
- "application/vnd.opentimestamps.ots": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.custom-properties+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.drawing+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.extended-properties+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.presentationml.presentation": {
- "source": "iana",
- "compressible": false,
- "extensions": ["pptx"]
- },
- "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.presentationml.slide": {
- "source": "iana",
- "extensions": ["sldx"]
- },
- "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.presentationml.slideshow": {
- "source": "iana",
- "extensions": ["ppsx"]
- },
- "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.presentationml.template": {
- "source": "iana",
- "extensions": ["potx"]
- },
- "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
- "source": "iana",
- "compressible": false,
- "extensions": ["xlsx"]
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.template": {
- "source": "iana",
- "extensions": ["xltx"]
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.theme+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.themeoverride+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.vmldrawing": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
- "source": "iana",
- "compressible": false,
- "extensions": ["docx"]
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.template": {
- "source": "iana",
- "extensions": ["dotx"]
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-package.core-properties+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.openxmlformats-package.relationships+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oracle.resource+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.orange.indata": {
- "source": "iana"
- },
- "application/vnd.osa.netdeploy": {
- "source": "iana"
- },
- "application/vnd.osgeo.mapguide.package": {
- "source": "iana",
- "extensions": ["mgp"]
- },
- "application/vnd.osgi.bundle": {
- "source": "iana"
- },
- "application/vnd.osgi.dp": {
- "source": "iana",
- "extensions": ["dp"]
- },
- "application/vnd.osgi.subsystem": {
- "source": "iana",
- "extensions": ["esa"]
- },
- "application/vnd.otps.ct-kip+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oxli.countgraph": {
- "source": "iana"
- },
- "application/vnd.pagerduty+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.palm": {
- "source": "iana",
- "extensions": ["pdb","pqa","oprc"]
- },
- "application/vnd.panoply": {
- "source": "iana"
- },
- "application/vnd.paos.xml": {
- "source": "iana"
- },
- "application/vnd.patentdive": {
- "source": "iana"
- },
- "application/vnd.patientecommsdoc": {
- "source": "iana"
- },
- "application/vnd.pawaafile": {
- "source": "iana",
- "extensions": ["paw"]
- },
- "application/vnd.pcos": {
- "source": "iana"
- },
- "application/vnd.pg.format": {
- "source": "iana",
- "extensions": ["str"]
- },
- "application/vnd.pg.osasli": {
- "source": "iana",
- "extensions": ["ei6"]
- },
- "application/vnd.piaccess.application-licence": {
- "source": "iana"
- },
- "application/vnd.picsel": {
- "source": "iana",
- "extensions": ["efif"]
- },
- "application/vnd.pmi.widget": {
- "source": "iana",
- "extensions": ["wg"]
- },
- "application/vnd.poc.group-advertisement+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.pocketlearn": {
- "source": "iana",
- "extensions": ["plf"]
- },
- "application/vnd.powerbuilder6": {
- "source": "iana",
- "extensions": ["pbd"]
- },
- "application/vnd.powerbuilder6-s": {
- "source": "iana"
- },
- "application/vnd.powerbuilder7": {
- "source": "iana"
- },
- "application/vnd.powerbuilder7-s": {
- "source": "iana"
- },
- "application/vnd.powerbuilder75": {
- "source": "iana"
- },
- "application/vnd.powerbuilder75-s": {
- "source": "iana"
- },
- "application/vnd.preminet": {
- "source": "iana"
- },
- "application/vnd.previewsystems.box": {
- "source": "iana",
- "extensions": ["box"]
- },
- "application/vnd.proteus.magazine": {
- "source": "iana",
- "extensions": ["mgz"]
- },
- "application/vnd.psfs": {
- "source": "iana"
- },
- "application/vnd.publishare-delta-tree": {
- "source": "iana",
- "extensions": ["qps"]
- },
- "application/vnd.pvi.ptid1": {
- "source": "iana",
- "extensions": ["ptid"]
- },
- "application/vnd.pwg-multiplexed": {
- "source": "iana"
- },
- "application/vnd.pwg-xhtml-print+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.qualcomm.brew-app-res": {
- "source": "iana"
- },
- "application/vnd.quarantainenet": {
- "source": "iana"
- },
- "application/vnd.quark.quarkxpress": {
- "source": "iana",
- "extensions": ["qxd","qxt","qwd","qwt","qxl","qxb"]
- },
- "application/vnd.quobject-quoxdocument": {
- "source": "iana"
- },
- "application/vnd.radisys.moml+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.radisys.msml+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.radisys.msml-audit+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.radisys.msml-audit-conf+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.radisys.msml-audit-conn+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.radisys.msml-audit-dialog+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.radisys.msml-audit-stream+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.radisys.msml-conf+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.radisys.msml-dialog+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.radisys.msml-dialog-base+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.radisys.msml-dialog-fax-detect+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.radisys.msml-dialog-group+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.radisys.msml-dialog-speech+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.radisys.msml-dialog-transform+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.rainstor.data": {
- "source": "iana"
- },
- "application/vnd.rapid": {
- "source": "iana"
- },
- "application/vnd.rar": {
- "source": "iana",
- "extensions": ["rar"]
- },
- "application/vnd.realvnc.bed": {
- "source": "iana",
- "extensions": ["bed"]
- },
- "application/vnd.recordare.musicxml": {
- "source": "iana",
- "extensions": ["mxl"]
- },
- "application/vnd.recordare.musicxml+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["musicxml"]
- },
- "application/vnd.renlearn.rlprint": {
- "source": "iana"
- },
- "application/vnd.resilient.logic": {
- "source": "iana"
- },
- "application/vnd.restful+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.rig.cryptonote": {
- "source": "iana",
- "extensions": ["cryptonote"]
- },
- "application/vnd.rim.cod": {
- "source": "apache",
- "extensions": ["cod"]
- },
- "application/vnd.rn-realmedia": {
- "source": "apache",
- "extensions": ["rm"]
- },
- "application/vnd.rn-realmedia-vbr": {
- "source": "apache",
- "extensions": ["rmvb"]
- },
- "application/vnd.route66.link66+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["link66"]
- },
- "application/vnd.rs-274x": {
- "source": "iana"
- },
- "application/vnd.ruckus.download": {
- "source": "iana"
- },
- "application/vnd.s3sms": {
- "source": "iana"
- },
- "application/vnd.sailingtracker.track": {
- "source": "iana",
- "extensions": ["st"]
- },
- "application/vnd.sar": {
- "source": "iana"
- },
- "application/vnd.sbm.cid": {
- "source": "iana"
- },
- "application/vnd.sbm.mid2": {
- "source": "iana"
- },
- "application/vnd.scribus": {
- "source": "iana"
- },
- "application/vnd.sealed.3df": {
- "source": "iana"
- },
- "application/vnd.sealed.csf": {
- "source": "iana"
- },
- "application/vnd.sealed.doc": {
- "source": "iana"
- },
- "application/vnd.sealed.eml": {
- "source": "iana"
- },
- "application/vnd.sealed.mht": {
- "source": "iana"
- },
- "application/vnd.sealed.net": {
- "source": "iana"
- },
- "application/vnd.sealed.ppt": {
- "source": "iana"
- },
- "application/vnd.sealed.tiff": {
- "source": "iana"
- },
- "application/vnd.sealed.xls": {
- "source": "iana"
- },
- "application/vnd.sealedmedia.softseal.html": {
- "source": "iana"
- },
- "application/vnd.sealedmedia.softseal.pdf": {
- "source": "iana"
- },
- "application/vnd.seemail": {
- "source": "iana",
- "extensions": ["see"]
- },
- "application/vnd.seis+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.sema": {
- "source": "iana",
- "extensions": ["sema"]
- },
- "application/vnd.semd": {
- "source": "iana",
- "extensions": ["semd"]
- },
- "application/vnd.semf": {
- "source": "iana",
- "extensions": ["semf"]
- },
- "application/vnd.shade-save-file": {
- "source": "iana"
- },
- "application/vnd.shana.informed.formdata": {
- "source": "iana",
- "extensions": ["ifm"]
- },
- "application/vnd.shana.informed.formtemplate": {
- "source": "iana",
- "extensions": ["itp"]
- },
- "application/vnd.shana.informed.interchange": {
- "source": "iana",
- "extensions": ["iif"]
- },
- "application/vnd.shana.informed.package": {
- "source": "iana",
- "extensions": ["ipk"]
- },
- "application/vnd.shootproof+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.shopkick+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.shp": {
- "source": "iana"
- },
- "application/vnd.shx": {
- "source": "iana"
- },
- "application/vnd.sigrok.session": {
- "source": "iana"
- },
- "application/vnd.simtech-mindmapper": {
- "source": "iana",
- "extensions": ["twd","twds"]
- },
- "application/vnd.siren+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.smaf": {
- "source": "iana",
- "extensions": ["mmf"]
- },
- "application/vnd.smart.notebook": {
- "source": "iana"
- },
- "application/vnd.smart.teacher": {
- "source": "iana",
- "extensions": ["teacher"]
- },
- "application/vnd.snesdev-page-table": {
- "source": "iana"
- },
- "application/vnd.software602.filler.form+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["fo"]
- },
- "application/vnd.software602.filler.form-xml-zip": {
- "source": "iana"
- },
- "application/vnd.solent.sdkm+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["sdkm","sdkd"]
- },
- "application/vnd.spotfire.dxp": {
- "source": "iana",
- "extensions": ["dxp"]
- },
- "application/vnd.spotfire.sfs": {
- "source": "iana",
- "extensions": ["sfs"]
- },
- "application/vnd.sqlite3": {
- "source": "iana"
- },
- "application/vnd.sss-cod": {
- "source": "iana"
- },
- "application/vnd.sss-dtf": {
- "source": "iana"
- },
- "application/vnd.sss-ntf": {
- "source": "iana"
- },
- "application/vnd.stardivision.calc": {
- "source": "apache",
- "extensions": ["sdc"]
- },
- "application/vnd.stardivision.draw": {
- "source": "apache",
- "extensions": ["sda"]
- },
- "application/vnd.stardivision.impress": {
- "source": "apache",
- "extensions": ["sdd"]
- },
- "application/vnd.stardivision.math": {
- "source": "apache",
- "extensions": ["smf"]
- },
- "application/vnd.stardivision.writer": {
- "source": "apache",
- "extensions": ["sdw","vor"]
- },
- "application/vnd.stardivision.writer-global": {
- "source": "apache",
- "extensions": ["sgl"]
- },
- "application/vnd.stepmania.package": {
- "source": "iana",
- "extensions": ["smzip"]
- },
- "application/vnd.stepmania.stepchart": {
- "source": "iana",
- "extensions": ["sm"]
- },
- "application/vnd.street-stream": {
- "source": "iana"
- },
- "application/vnd.sun.wadl+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["wadl"]
- },
- "application/vnd.sun.xml.calc": {
- "source": "apache",
- "extensions": ["sxc"]
- },
- "application/vnd.sun.xml.calc.template": {
- "source": "apache",
- "extensions": ["stc"]
- },
- "application/vnd.sun.xml.draw": {
- "source": "apache",
- "extensions": ["sxd"]
- },
- "application/vnd.sun.xml.draw.template": {
- "source": "apache",
- "extensions": ["std"]
- },
- "application/vnd.sun.xml.impress": {
- "source": "apache",
- "extensions": ["sxi"]
- },
- "application/vnd.sun.xml.impress.template": {
- "source": "apache",
- "extensions": ["sti"]
- },
- "application/vnd.sun.xml.math": {
- "source": "apache",
- "extensions": ["sxm"]
- },
- "application/vnd.sun.xml.writer": {
- "source": "apache",
- "extensions": ["sxw"]
- },
- "application/vnd.sun.xml.writer.global": {
- "source": "apache",
- "extensions": ["sxg"]
- },
- "application/vnd.sun.xml.writer.template": {
- "source": "apache",
- "extensions": ["stw"]
- },
- "application/vnd.sus-calendar": {
- "source": "iana",
- "extensions": ["sus","susp"]
- },
- "application/vnd.svd": {
- "source": "iana",
- "extensions": ["svd"]
- },
- "application/vnd.swiftview-ics": {
- "source": "iana"
- },
- "application/vnd.sycle+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.syft+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.symbian.install": {
- "source": "apache",
- "extensions": ["sis","sisx"]
- },
- "application/vnd.syncml+xml": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true,
- "extensions": ["xsm"]
- },
- "application/vnd.syncml.dm+wbxml": {
- "source": "iana",
- "charset": "UTF-8",
- "extensions": ["bdm"]
- },
- "application/vnd.syncml.dm+xml": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true,
- "extensions": ["xdm"]
- },
- "application/vnd.syncml.dm.notification": {
- "source": "iana"
- },
- "application/vnd.syncml.dmddf+wbxml": {
- "source": "iana"
- },
- "application/vnd.syncml.dmddf+xml": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true,
- "extensions": ["ddf"]
- },
- "application/vnd.syncml.dmtnds+wbxml": {
- "source": "iana"
- },
- "application/vnd.syncml.dmtnds+xml": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true
- },
- "application/vnd.syncml.ds.notification": {
- "source": "iana"
- },
- "application/vnd.tableschema+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.tao.intent-module-archive": {
- "source": "iana",
- "extensions": ["tao"]
- },
- "application/vnd.tcpdump.pcap": {
- "source": "iana",
- "extensions": ["pcap","cap","dmp"]
- },
- "application/vnd.think-cell.ppttc+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.tmd.mediaflex.api+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.tml": {
- "source": "iana"
- },
- "application/vnd.tmobile-livetv": {
- "source": "iana",
- "extensions": ["tmo"]
- },
- "application/vnd.tri.onesource": {
- "source": "iana"
- },
- "application/vnd.trid.tpt": {
- "source": "iana",
- "extensions": ["tpt"]
- },
- "application/vnd.triscape.mxs": {
- "source": "iana",
- "extensions": ["mxs"]
- },
- "application/vnd.trueapp": {
- "source": "iana",
- "extensions": ["tra"]
- },
- "application/vnd.truedoc": {
- "source": "iana"
- },
- "application/vnd.ubisoft.webplayer": {
- "source": "iana"
- },
- "application/vnd.ufdl": {
- "source": "iana",
- "extensions": ["ufd","ufdl"]
- },
- "application/vnd.uiq.theme": {
- "source": "iana",
- "extensions": ["utz"]
- },
- "application/vnd.umajin": {
- "source": "iana",
- "extensions": ["umj"]
- },
- "application/vnd.unity": {
- "source": "iana",
- "extensions": ["unityweb"]
- },
- "application/vnd.uoml+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["uoml"]
- },
- "application/vnd.uplanet.alert": {
- "source": "iana"
- },
- "application/vnd.uplanet.alert-wbxml": {
- "source": "iana"
- },
- "application/vnd.uplanet.bearer-choice": {
- "source": "iana"
- },
- "application/vnd.uplanet.bearer-choice-wbxml": {
- "source": "iana"
- },
- "application/vnd.uplanet.cacheop": {
- "source": "iana"
- },
- "application/vnd.uplanet.cacheop-wbxml": {
- "source": "iana"
- },
- "application/vnd.uplanet.channel": {
- "source": "iana"
- },
- "application/vnd.uplanet.channel-wbxml": {
- "source": "iana"
- },
- "application/vnd.uplanet.list": {
- "source": "iana"
- },
- "application/vnd.uplanet.list-wbxml": {
- "source": "iana"
- },
- "application/vnd.uplanet.listcmd": {
- "source": "iana"
- },
- "application/vnd.uplanet.listcmd-wbxml": {
- "source": "iana"
- },
- "application/vnd.uplanet.signal": {
- "source": "iana"
- },
- "application/vnd.uri-map": {
- "source": "iana"
- },
- "application/vnd.valve.source.material": {
- "source": "iana"
- },
- "application/vnd.vcx": {
- "source": "iana",
- "extensions": ["vcx"]
- },
- "application/vnd.vd-study": {
- "source": "iana"
- },
- "application/vnd.vectorworks": {
- "source": "iana"
- },
- "application/vnd.vel+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.verimatrix.vcas": {
- "source": "iana"
- },
- "application/vnd.veritone.aion+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.veryant.thin": {
- "source": "iana"
- },
- "application/vnd.ves.encrypted": {
- "source": "iana"
- },
- "application/vnd.vidsoft.vidconference": {
- "source": "iana"
- },
- "application/vnd.visio": {
- "source": "iana",
- "extensions": ["vsd","vst","vss","vsw"]
- },
- "application/vnd.visionary": {
- "source": "iana",
- "extensions": ["vis"]
- },
- "application/vnd.vividence.scriptfile": {
- "source": "iana"
- },
- "application/vnd.vsf": {
- "source": "iana",
- "extensions": ["vsf"]
- },
- "application/vnd.wap.sic": {
- "source": "iana"
- },
- "application/vnd.wap.slc": {
- "source": "iana"
- },
- "application/vnd.wap.wbxml": {
- "source": "iana",
- "charset": "UTF-8",
- "extensions": ["wbxml"]
- },
- "application/vnd.wap.wmlc": {
- "source": "iana",
- "extensions": ["wmlc"]
- },
- "application/vnd.wap.wmlscriptc": {
- "source": "iana",
- "extensions": ["wmlsc"]
- },
- "application/vnd.webturbo": {
- "source": "iana",
- "extensions": ["wtb"]
- },
- "application/vnd.wfa.dpp": {
- "source": "iana"
- },
- "application/vnd.wfa.p2p": {
- "source": "iana"
- },
- "application/vnd.wfa.wsc": {
- "source": "iana"
- },
- "application/vnd.windows.devicepairing": {
- "source": "iana"
- },
- "application/vnd.wmc": {
- "source": "iana"
- },
- "application/vnd.wmf.bootstrap": {
- "source": "iana"
- },
- "application/vnd.wolfram.mathematica": {
- "source": "iana"
- },
- "application/vnd.wolfram.mathematica.package": {
- "source": "iana"
- },
- "application/vnd.wolfram.player": {
- "source": "iana",
- "extensions": ["nbp"]
- },
- "application/vnd.wordperfect": {
- "source": "iana",
- "extensions": ["wpd"]
- },
- "application/vnd.wqd": {
- "source": "iana",
- "extensions": ["wqd"]
- },
- "application/vnd.wrq-hp3000-labelled": {
- "source": "iana"
- },
- "application/vnd.wt.stf": {
- "source": "iana",
- "extensions": ["stf"]
- },
- "application/vnd.wv.csp+wbxml": {
- "source": "iana"
- },
- "application/vnd.wv.csp+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.wv.ssp+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.xacml+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.xara": {
- "source": "iana",
- "extensions": ["xar"]
- },
- "application/vnd.xfdl": {
- "source": "iana",
- "extensions": ["xfdl"]
- },
- "application/vnd.xfdl.webform": {
- "source": "iana"
- },
- "application/vnd.xmi+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.xmpie.cpkg": {
- "source": "iana"
- },
- "application/vnd.xmpie.dpkg": {
- "source": "iana"
- },
- "application/vnd.xmpie.plan": {
- "source": "iana"
- },
- "application/vnd.xmpie.ppkg": {
- "source": "iana"
- },
- "application/vnd.xmpie.xlim": {
- "source": "iana"
- },
- "application/vnd.yamaha.hv-dic": {
- "source": "iana",
- "extensions": ["hvd"]
- },
- "application/vnd.yamaha.hv-script": {
- "source": "iana",
- "extensions": ["hvs"]
- },
- "application/vnd.yamaha.hv-voice": {
- "source": "iana",
- "extensions": ["hvp"]
- },
- "application/vnd.yamaha.openscoreformat": {
- "source": "iana",
- "extensions": ["osf"]
- },
- "application/vnd.yamaha.openscoreformat.osfpvg+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["osfpvg"]
- },
- "application/vnd.yamaha.remote-setup": {
- "source": "iana"
- },
- "application/vnd.yamaha.smaf-audio": {
- "source": "iana",
- "extensions": ["saf"]
- },
- "application/vnd.yamaha.smaf-phrase": {
- "source": "iana",
- "extensions": ["spf"]
- },
- "application/vnd.yamaha.through-ngn": {
- "source": "iana"
- },
- "application/vnd.yamaha.tunnel-udpencap": {
- "source": "iana"
- },
- "application/vnd.yaoweme": {
- "source": "iana"
- },
- "application/vnd.yellowriver-custom-menu": {
- "source": "iana",
- "extensions": ["cmp"]
- },
- "application/vnd.youtube.yt": {
- "source": "iana"
- },
- "application/vnd.zul": {
- "source": "iana",
- "extensions": ["zir","zirz"]
- },
- "application/vnd.zzazz.deck+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["zaz"]
- },
- "application/voicexml+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["vxml"]
- },
- "application/voucher-cms+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vq-rtcpxr": {
- "source": "iana"
- },
- "application/wasm": {
- "source": "iana",
- "compressible": true,
- "extensions": ["wasm"]
- },
- "application/watcherinfo+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["wif"]
- },
- "application/webpush-options+json": {
- "source": "iana",
- "compressible": true
- },
- "application/whoispp-query": {
- "source": "iana"
- },
- "application/whoispp-response": {
- "source": "iana"
- },
- "application/widget": {
- "source": "iana",
- "extensions": ["wgt"]
- },
- "application/winhlp": {
- "source": "apache",
- "extensions": ["hlp"]
- },
- "application/wita": {
- "source": "iana"
- },
- "application/wordperfect5.1": {
- "source": "iana"
- },
- "application/wsdl+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["wsdl"]
- },
- "application/wspolicy+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["wspolicy"]
- },
- "application/x-7z-compressed": {
- "source": "apache",
- "compressible": false,
- "extensions": ["7z"]
- },
- "application/x-abiword": {
- "source": "apache",
- "extensions": ["abw"]
- },
- "application/x-ace-compressed": {
- "source": "apache",
- "extensions": ["ace"]
- },
- "application/x-amf": {
- "source": "apache"
- },
- "application/x-apple-diskimage": {
- "source": "apache",
- "extensions": ["dmg"]
- },
- "application/x-arj": {
- "compressible": false,
- "extensions": ["arj"]
- },
- "application/x-authorware-bin": {
- "source": "apache",
- "extensions": ["aab","x32","u32","vox"]
- },
- "application/x-authorware-map": {
- "source": "apache",
- "extensions": ["aam"]
- },
- "application/x-authorware-seg": {
- "source": "apache",
- "extensions": ["aas"]
- },
- "application/x-bcpio": {
- "source": "apache",
- "extensions": ["bcpio"]
- },
- "application/x-bdoc": {
- "compressible": false,
- "extensions": ["bdoc"]
- },
- "application/x-bittorrent": {
- "source": "apache",
- "extensions": ["torrent"]
- },
- "application/x-blorb": {
- "source": "apache",
- "extensions": ["blb","blorb"]
- },
- "application/x-bzip": {
- "source": "apache",
- "compressible": false,
- "extensions": ["bz"]
- },
- "application/x-bzip2": {
- "source": "apache",
- "compressible": false,
- "extensions": ["bz2","boz"]
- },
- "application/x-cbr": {
- "source": "apache",
- "extensions": ["cbr","cba","cbt","cbz","cb7"]
- },
- "application/x-cdlink": {
- "source": "apache",
- "extensions": ["vcd"]
- },
- "application/x-cfs-compressed": {
- "source": "apache",
- "extensions": ["cfs"]
- },
- "application/x-chat": {
- "source": "apache",
- "extensions": ["chat"]
- },
- "application/x-chess-pgn": {
- "source": "apache",
- "extensions": ["pgn"]
- },
- "application/x-chrome-extension": {
- "extensions": ["crx"]
- },
- "application/x-cocoa": {
- "source": "nginx",
- "extensions": ["cco"]
- },
- "application/x-compress": {
- "source": "apache"
- },
- "application/x-conference": {
- "source": "apache",
- "extensions": ["nsc"]
- },
- "application/x-cpio": {
- "source": "apache",
- "extensions": ["cpio"]
- },
- "application/x-csh": {
- "source": "apache",
- "extensions": ["csh"]
- },
- "application/x-deb": {
- "compressible": false
- },
- "application/x-debian-package": {
- "source": "apache",
- "extensions": ["deb","udeb"]
- },
- "application/x-dgc-compressed": {
- "source": "apache",
- "extensions": ["dgc"]
- },
- "application/x-director": {
- "source": "apache",
- "extensions": ["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]
- },
- "application/x-doom": {
- "source": "apache",
- "extensions": ["wad"]
- },
- "application/x-dtbncx+xml": {
- "source": "apache",
- "compressible": true,
- "extensions": ["ncx"]
- },
- "application/x-dtbook+xml": {
- "source": "apache",
- "compressible": true,
- "extensions": ["dtb"]
- },
- "application/x-dtbresource+xml": {
- "source": "apache",
- "compressible": true,
- "extensions": ["res"]
- },
- "application/x-dvi": {
- "source": "apache",
- "compressible": false,
- "extensions": ["dvi"]
- },
- "application/x-envoy": {
- "source": "apache",
- "extensions": ["evy"]
- },
- "application/x-eva": {
- "source": "apache",
- "extensions": ["eva"]
- },
- "application/x-font-bdf": {
- "source": "apache",
- "extensions": ["bdf"]
- },
- "application/x-font-dos": {
- "source": "apache"
- },
- "application/x-font-framemaker": {
- "source": "apache"
- },
- "application/x-font-ghostscript": {
- "source": "apache",
- "extensions": ["gsf"]
- },
- "application/x-font-libgrx": {
- "source": "apache"
- },
- "application/x-font-linux-psf": {
- "source": "apache",
- "extensions": ["psf"]
- },
- "application/x-font-pcf": {
- "source": "apache",
- "extensions": ["pcf"]
- },
- "application/x-font-snf": {
- "source": "apache",
- "extensions": ["snf"]
- },
- "application/x-font-speedo": {
- "source": "apache"
- },
- "application/x-font-sunos-news": {
- "source": "apache"
- },
- "application/x-font-type1": {
- "source": "apache",
- "extensions": ["pfa","pfb","pfm","afm"]
- },
- "application/x-font-vfont": {
- "source": "apache"
- },
- "application/x-freearc": {
- "source": "apache",
- "extensions": ["arc"]
- },
- "application/x-futuresplash": {
- "source": "apache",
- "extensions": ["spl"]
- },
- "application/x-gca-compressed": {
- "source": "apache",
- "extensions": ["gca"]
- },
- "application/x-glulx": {
- "source": "apache",
- "extensions": ["ulx"]
- },
- "application/x-gnumeric": {
- "source": "apache",
- "extensions": ["gnumeric"]
- },
- "application/x-gramps-xml": {
- "source": "apache",
- "extensions": ["gramps"]
- },
- "application/x-gtar": {
- "source": "apache",
- "extensions": ["gtar"]
- },
- "application/x-gzip": {
- "source": "apache"
- },
- "application/x-hdf": {
- "source": "apache",
- "extensions": ["hdf"]
- },
- "application/x-httpd-php": {
- "compressible": true,
- "extensions": ["php"]
- },
- "application/x-install-instructions": {
- "source": "apache",
- "extensions": ["install"]
- },
- "application/x-iso9660-image": {
- "source": "apache",
- "extensions": ["iso"]
- },
- "application/x-iwork-keynote-sffkey": {
- "extensions": ["key"]
- },
- "application/x-iwork-numbers-sffnumbers": {
- "extensions": ["numbers"]
- },
- "application/x-iwork-pages-sffpages": {
- "extensions": ["pages"]
- },
- "application/x-java-archive-diff": {
- "source": "nginx",
- "extensions": ["jardiff"]
- },
- "application/x-java-jnlp-file": {
- "source": "apache",
- "compressible": false,
- "extensions": ["jnlp"]
- },
- "application/x-javascript": {
- "compressible": true
- },
- "application/x-keepass2": {
- "extensions": ["kdbx"]
- },
- "application/x-latex": {
- "source": "apache",
- "compressible": false,
- "extensions": ["latex"]
- },
- "application/x-lua-bytecode": {
- "extensions": ["luac"]
- },
- "application/x-lzh-compressed": {
- "source": "apache",
- "extensions": ["lzh","lha"]
- },
- "application/x-makeself": {
- "source": "nginx",
- "extensions": ["run"]
- },
- "application/x-mie": {
- "source": "apache",
- "extensions": ["mie"]
- },
- "application/x-mobipocket-ebook": {
- "source": "apache",
- "extensions": ["prc","mobi"]
- },
- "application/x-mpegurl": {
- "compressible": false
- },
- "application/x-ms-application": {
- "source": "apache",
- "extensions": ["application"]
- },
- "application/x-ms-shortcut": {
- "source": "apache",
- "extensions": ["lnk"]
- },
- "application/x-ms-wmd": {
- "source": "apache",
- "extensions": ["wmd"]
- },
- "application/x-ms-wmz": {
- "source": "apache",
- "extensions": ["wmz"]
- },
- "application/x-ms-xbap": {
- "source": "apache",
- "extensions": ["xbap"]
- },
- "application/x-msaccess": {
- "source": "apache",
- "extensions": ["mdb"]
- },
- "application/x-msbinder": {
- "source": "apache",
- "extensions": ["obd"]
- },
- "application/x-mscardfile": {
- "source": "apache",
- "extensions": ["crd"]
- },
- "application/x-msclip": {
- "source": "apache",
- "extensions": ["clp"]
- },
- "application/x-msdos-program": {
- "extensions": ["exe"]
- },
- "application/x-msdownload": {
- "source": "apache",
- "extensions": ["exe","dll","com","bat","msi"]
- },
- "application/x-msmediaview": {
- "source": "apache",
- "extensions": ["mvb","m13","m14"]
- },
- "application/x-msmetafile": {
- "source": "apache",
- "extensions": ["wmf","wmz","emf","emz"]
- },
- "application/x-msmoney": {
- "source": "apache",
- "extensions": ["mny"]
- },
- "application/x-mspublisher": {
- "source": "apache",
- "extensions": ["pub"]
- },
- "application/x-msschedule": {
- "source": "apache",
- "extensions": ["scd"]
- },
- "application/x-msterminal": {
- "source": "apache",
- "extensions": ["trm"]
- },
- "application/x-mswrite": {
- "source": "apache",
- "extensions": ["wri"]
- },
- "application/x-netcdf": {
- "source": "apache",
- "extensions": ["nc","cdf"]
- },
- "application/x-ns-proxy-autoconfig": {
- "compressible": true,
- "extensions": ["pac"]
- },
- "application/x-nzb": {
- "source": "apache",
- "extensions": ["nzb"]
- },
- "application/x-perl": {
- "source": "nginx",
- "extensions": ["pl","pm"]
- },
- "application/x-pilot": {
- "source": "nginx",
- "extensions": ["prc","pdb"]
- },
- "application/x-pkcs12": {
- "source": "apache",
- "compressible": false,
- "extensions": ["p12","pfx"]
- },
- "application/x-pkcs7-certificates": {
- "source": "apache",
- "extensions": ["p7b","spc"]
- },
- "application/x-pkcs7-certreqresp": {
- "source": "apache",
- "extensions": ["p7r"]
- },
- "application/x-pki-message": {
- "source": "iana"
- },
- "application/x-rar-compressed": {
- "source": "apache",
- "compressible": false,
- "extensions": ["rar"]
- },
- "application/x-redhat-package-manager": {
- "source": "nginx",
- "extensions": ["rpm"]
- },
- "application/x-research-info-systems": {
- "source": "apache",
- "extensions": ["ris"]
- },
- "application/x-sea": {
- "source": "nginx",
- "extensions": ["sea"]
- },
- "application/x-sh": {
- "source": "apache",
- "compressible": true,
- "extensions": ["sh"]
- },
- "application/x-shar": {
- "source": "apache",
- "extensions": ["shar"]
- },
- "application/x-shockwave-flash": {
- "source": "apache",
- "compressible": false,
- "extensions": ["swf"]
- },
- "application/x-silverlight-app": {
- "source": "apache",
- "extensions": ["xap"]
- },
- "application/x-sql": {
- "source": "apache",
- "extensions": ["sql"]
- },
- "application/x-stuffit": {
- "source": "apache",
- "compressible": false,
- "extensions": ["sit"]
- },
- "application/x-stuffitx": {
- "source": "apache",
- "extensions": ["sitx"]
- },
- "application/x-subrip": {
- "source": "apache",
- "extensions": ["srt"]
- },
- "application/x-sv4cpio": {
- "source": "apache",
- "extensions": ["sv4cpio"]
- },
- "application/x-sv4crc": {
- "source": "apache",
- "extensions": ["sv4crc"]
- },
- "application/x-t3vm-image": {
- "source": "apache",
- "extensions": ["t3"]
- },
- "application/x-tads": {
- "source": "apache",
- "extensions": ["gam"]
- },
- "application/x-tar": {
- "source": "apache",
- "compressible": true,
- "extensions": ["tar"]
- },
- "application/x-tcl": {
- "source": "apache",
- "extensions": ["tcl","tk"]
- },
- "application/x-tex": {
- "source": "apache",
- "extensions": ["tex"]
- },
- "application/x-tex-tfm": {
- "source": "apache",
- "extensions": ["tfm"]
- },
- "application/x-texinfo": {
- "source": "apache",
- "extensions": ["texinfo","texi"]
- },
- "application/x-tgif": {
- "source": "apache",
- "extensions": ["obj"]
- },
- "application/x-ustar": {
- "source": "apache",
- "extensions": ["ustar"]
- },
- "application/x-virtualbox-hdd": {
- "compressible": true,
- "extensions": ["hdd"]
- },
- "application/x-virtualbox-ova": {
- "compressible": true,
- "extensions": ["ova"]
- },
- "application/x-virtualbox-ovf": {
- "compressible": true,
- "extensions": ["ovf"]
- },
- "application/x-virtualbox-vbox": {
- "compressible": true,
- "extensions": ["vbox"]
- },
- "application/x-virtualbox-vbox-extpack": {
- "compressible": false,
- "extensions": ["vbox-extpack"]
- },
- "application/x-virtualbox-vdi": {
- "compressible": true,
- "extensions": ["vdi"]
- },
- "application/x-virtualbox-vhd": {
- "compressible": true,
- "extensions": ["vhd"]
- },
- "application/x-virtualbox-vmdk": {
- "compressible": true,
- "extensions": ["vmdk"]
- },
- "application/x-wais-source": {
- "source": "apache",
- "extensions": ["src"]
- },
- "application/x-web-app-manifest+json": {
- "compressible": true,
- "extensions": ["webapp"]
- },
- "application/x-www-form-urlencoded": {
- "source": "iana",
- "compressible": true
- },
- "application/x-x509-ca-cert": {
- "source": "iana",
- "extensions": ["der","crt","pem"]
- },
- "application/x-x509-ca-ra-cert": {
- "source": "iana"
- },
- "application/x-x509-next-ca-cert": {
- "source": "iana"
- },
- "application/x-xfig": {
- "source": "apache",
- "extensions": ["fig"]
- },
- "application/x-xliff+xml": {
- "source": "apache",
- "compressible": true,
- "extensions": ["xlf"]
- },
- "application/x-xpinstall": {
- "source": "apache",
- "compressible": false,
- "extensions": ["xpi"]
- },
- "application/x-xz": {
- "source": "apache",
- "extensions": ["xz"]
- },
- "application/x-zmachine": {
- "source": "apache",
- "extensions": ["z1","z2","z3","z4","z5","z6","z7","z8"]
- },
- "application/x400-bp": {
- "source": "iana"
- },
- "application/xacml+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/xaml+xml": {
- "source": "apache",
- "compressible": true,
- "extensions": ["xaml"]
- },
- "application/xcap-att+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["xav"]
- },
- "application/xcap-caps+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["xca"]
- },
- "application/xcap-diff+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["xdf"]
- },
- "application/xcap-el+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["xel"]
- },
- "application/xcap-error+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/xcap-ns+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["xns"]
- },
- "application/xcon-conference-info+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/xcon-conference-info-diff+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/xenc+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["xenc"]
- },
- "application/xhtml+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["xhtml","xht"]
- },
- "application/xhtml-voice+xml": {
- "source": "apache",
- "compressible": true
- },
- "application/xliff+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["xlf"]
- },
- "application/xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["xml","xsl","xsd","rng"]
- },
- "application/xml-dtd": {
- "source": "iana",
- "compressible": true,
- "extensions": ["dtd"]
- },
- "application/xml-external-parsed-entity": {
- "source": "iana"
- },
- "application/xml-patch+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/xmpp+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/xop+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["xop"]
- },
- "application/xproc+xml": {
- "source": "apache",
- "compressible": true,
- "extensions": ["xpl"]
- },
- "application/xslt+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["xsl","xslt"]
- },
- "application/xspf+xml": {
- "source": "apache",
- "compressible": true,
- "extensions": ["xspf"]
- },
- "application/xv+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["mxml","xhvml","xvml","xvm"]
- },
- "application/yang": {
- "source": "iana",
- "extensions": ["yang"]
- },
- "application/yang-data+json": {
- "source": "iana",
- "compressible": true
- },
- "application/yang-data+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/yang-patch+json": {
- "source": "iana",
- "compressible": true
- },
- "application/yang-patch+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/yin+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["yin"]
- },
- "application/zip": {
- "source": "iana",
- "compressible": false,
- "extensions": ["zip"]
- },
- "application/zlib": {
- "source": "iana"
- },
- "application/zstd": {
- "source": "iana"
- },
- "audio/1d-interleaved-parityfec": {
- "source": "iana"
- },
- "audio/32kadpcm": {
- "source": "iana"
- },
- "audio/3gpp": {
- "source": "iana",
- "compressible": false,
- "extensions": ["3gpp"]
- },
- "audio/3gpp2": {
- "source": "iana"
- },
- "audio/aac": {
- "source": "iana"
- },
- "audio/ac3": {
- "source": "iana"
- },
- "audio/adpcm": {
- "source": "apache",
- "extensions": ["adp"]
- },
- "audio/amr": {
- "source": "iana",
- "extensions": ["amr"]
- },
- "audio/amr-wb": {
- "source": "iana"
- },
- "audio/amr-wb+": {
- "source": "iana"
- },
- "audio/aptx": {
- "source": "iana"
- },
- "audio/asc": {
- "source": "iana"
- },
- "audio/atrac-advanced-lossless": {
- "source": "iana"
- },
- "audio/atrac-x": {
- "source": "iana"
- },
- "audio/atrac3": {
- "source": "iana"
- },
- "audio/basic": {
- "source": "iana",
- "compressible": false,
- "extensions": ["au","snd"]
- },
- "audio/bv16": {
- "source": "iana"
- },
- "audio/bv32": {
- "source": "iana"
- },
- "audio/clearmode": {
- "source": "iana"
- },
- "audio/cn": {
- "source": "iana"
- },
- "audio/dat12": {
- "source": "iana"
- },
- "audio/dls": {
- "source": "iana"
- },
- "audio/dsr-es201108": {
- "source": "iana"
- },
- "audio/dsr-es202050": {
- "source": "iana"
- },
- "audio/dsr-es202211": {
- "source": "iana"
- },
- "audio/dsr-es202212": {
- "source": "iana"
- },
- "audio/dv": {
- "source": "iana"
- },
- "audio/dvi4": {
- "source": "iana"
- },
- "audio/eac3": {
- "source": "iana"
- },
- "audio/encaprtp": {
- "source": "iana"
- },
- "audio/evrc": {
- "source": "iana"
- },
- "audio/evrc-qcp": {
- "source": "iana"
- },
- "audio/evrc0": {
- "source": "iana"
- },
- "audio/evrc1": {
- "source": "iana"
- },
- "audio/evrcb": {
- "source": "iana"
- },
- "audio/evrcb0": {
- "source": "iana"
- },
- "audio/evrcb1": {
- "source": "iana"
- },
- "audio/evrcnw": {
- "source": "iana"
- },
- "audio/evrcnw0": {
- "source": "iana"
- },
- "audio/evrcnw1": {
- "source": "iana"
- },
- "audio/evrcwb": {
- "source": "iana"
- },
- "audio/evrcwb0": {
- "source": "iana"
- },
- "audio/evrcwb1": {
- "source": "iana"
- },
- "audio/evs": {
- "source": "iana"
- },
- "audio/flexfec": {
- "source": "iana"
- },
- "audio/fwdred": {
- "source": "iana"
- },
- "audio/g711-0": {
- "source": "iana"
- },
- "audio/g719": {
- "source": "iana"
- },
- "audio/g722": {
- "source": "iana"
- },
- "audio/g7221": {
- "source": "iana"
- },
- "audio/g723": {
- "source": "iana"
- },
- "audio/g726-16": {
- "source": "iana"
- },
- "audio/g726-24": {
- "source": "iana"
- },
- "audio/g726-32": {
- "source": "iana"
- },
- "audio/g726-40": {
- "source": "iana"
- },
- "audio/g728": {
- "source": "iana"
- },
- "audio/g729": {
- "source": "iana"
- },
- "audio/g7291": {
- "source": "iana"
- },
- "audio/g729d": {
- "source": "iana"
- },
- "audio/g729e": {
- "source": "iana"
- },
- "audio/gsm": {
- "source": "iana"
- },
- "audio/gsm-efr": {
- "source": "iana"
- },
- "audio/gsm-hr-08": {
- "source": "iana"
- },
- "audio/ilbc": {
- "source": "iana"
- },
- "audio/ip-mr_v2.5": {
- "source": "iana"
- },
- "audio/isac": {
- "source": "apache"
- },
- "audio/l16": {
- "source": "iana"
- },
- "audio/l20": {
- "source": "iana"
- },
- "audio/l24": {
- "source": "iana",
- "compressible": false
- },
- "audio/l8": {
- "source": "iana"
- },
- "audio/lpc": {
- "source": "iana"
- },
- "audio/melp": {
- "source": "iana"
- },
- "audio/melp1200": {
- "source": "iana"
- },
- "audio/melp2400": {
- "source": "iana"
- },
- "audio/melp600": {
- "source": "iana"
- },
- "audio/mhas": {
- "source": "iana"
- },
- "audio/midi": {
- "source": "apache",
- "extensions": ["mid","midi","kar","rmi"]
- },
- "audio/mobile-xmf": {
- "source": "iana",
- "extensions": ["mxmf"]
- },
- "audio/mp3": {
- "compressible": false,
- "extensions": ["mp3"]
- },
- "audio/mp4": {
- "source": "iana",
- "compressible": false,
- "extensions": ["m4a","mp4a"]
- },
- "audio/mp4a-latm": {
- "source": "iana"
- },
- "audio/mpa": {
- "source": "iana"
- },
- "audio/mpa-robust": {
- "source": "iana"
- },
- "audio/mpeg": {
- "source": "iana",
- "compressible": false,
- "extensions": ["mpga","mp2","mp2a","mp3","m2a","m3a"]
- },
- "audio/mpeg4-generic": {
- "source": "iana"
- },
- "audio/musepack": {
- "source": "apache"
- },
- "audio/ogg": {
- "source": "iana",
- "compressible": false,
- "extensions": ["oga","ogg","spx","opus"]
- },
- "audio/opus": {
- "source": "iana"
- },
- "audio/parityfec": {
- "source": "iana"
- },
- "audio/pcma": {
- "source": "iana"
- },
- "audio/pcma-wb": {
- "source": "iana"
- },
- "audio/pcmu": {
- "source": "iana"
- },
- "audio/pcmu-wb": {
- "source": "iana"
- },
- "audio/prs.sid": {
- "source": "iana"
- },
- "audio/qcelp": {
- "source": "iana"
- },
- "audio/raptorfec": {
- "source": "iana"
- },
- "audio/red": {
- "source": "iana"
- },
- "audio/rtp-enc-aescm128": {
- "source": "iana"
- },
- "audio/rtp-midi": {
- "source": "iana"
- },
- "audio/rtploopback": {
- "source": "iana"
- },
- "audio/rtx": {
- "source": "iana"
- },
- "audio/s3m": {
- "source": "apache",
- "extensions": ["s3m"]
- },
- "audio/scip": {
- "source": "iana"
- },
- "audio/silk": {
- "source": "apache",
- "extensions": ["sil"]
- },
- "audio/smv": {
- "source": "iana"
- },
- "audio/smv-qcp": {
- "source": "iana"
- },
- "audio/smv0": {
- "source": "iana"
- },
- "audio/sofa": {
- "source": "iana"
- },
- "audio/sp-midi": {
- "source": "iana"
- },
- "audio/speex": {
- "source": "iana"
- },
- "audio/t140c": {
- "source": "iana"
- },
- "audio/t38": {
- "source": "iana"
- },
- "audio/telephone-event": {
- "source": "iana"
- },
- "audio/tetra_acelp": {
- "source": "iana"
- },
- "audio/tetra_acelp_bb": {
- "source": "iana"
- },
- "audio/tone": {
- "source": "iana"
- },
- "audio/tsvcis": {
- "source": "iana"
- },
- "audio/uemclip": {
- "source": "iana"
- },
- "audio/ulpfec": {
- "source": "iana"
- },
- "audio/usac": {
- "source": "iana"
- },
- "audio/vdvi": {
- "source": "iana"
- },
- "audio/vmr-wb": {
- "source": "iana"
- },
- "audio/vnd.3gpp.iufp": {
- "source": "iana"
- },
- "audio/vnd.4sb": {
- "source": "iana"
- },
- "audio/vnd.audiokoz": {
- "source": "iana"
- },
- "audio/vnd.celp": {
- "source": "iana"
- },
- "audio/vnd.cisco.nse": {
- "source": "iana"
- },
- "audio/vnd.cmles.radio-events": {
- "source": "iana"
- },
- "audio/vnd.cns.anp1": {
- "source": "iana"
- },
- "audio/vnd.cns.inf1": {
- "source": "iana"
- },
- "audio/vnd.dece.audio": {
- "source": "iana",
- "extensions": ["uva","uvva"]
- },
- "audio/vnd.digital-winds": {
- "source": "iana",
- "extensions": ["eol"]
- },
- "audio/vnd.dlna.adts": {
- "source": "iana"
- },
- "audio/vnd.dolby.heaac.1": {
- "source": "iana"
- },
- "audio/vnd.dolby.heaac.2": {
- "source": "iana"
- },
- "audio/vnd.dolby.mlp": {
- "source": "iana"
- },
- "audio/vnd.dolby.mps": {
- "source": "iana"
- },
- "audio/vnd.dolby.pl2": {
- "source": "iana"
- },
- "audio/vnd.dolby.pl2x": {
- "source": "iana"
- },
- "audio/vnd.dolby.pl2z": {
- "source": "iana"
- },
- "audio/vnd.dolby.pulse.1": {
- "source": "iana"
- },
- "audio/vnd.dra": {
- "source": "iana",
- "extensions": ["dra"]
- },
- "audio/vnd.dts": {
- "source": "iana",
- "extensions": ["dts"]
- },
- "audio/vnd.dts.hd": {
- "source": "iana",
- "extensions": ["dtshd"]
- },
- "audio/vnd.dts.uhd": {
- "source": "iana"
- },
- "audio/vnd.dvb.file": {
- "source": "iana"
- },
- "audio/vnd.everad.plj": {
- "source": "iana"
- },
- "audio/vnd.hns.audio": {
- "source": "iana"
- },
- "audio/vnd.lucent.voice": {
- "source": "iana",
- "extensions": ["lvp"]
- },
- "audio/vnd.ms-playready.media.pya": {
- "source": "iana",
- "extensions": ["pya"]
- },
- "audio/vnd.nokia.mobile-xmf": {
- "source": "iana"
- },
- "audio/vnd.nortel.vbk": {
- "source": "iana"
- },
- "audio/vnd.nuera.ecelp4800": {
- "source": "iana",
- "extensions": ["ecelp4800"]
- },
- "audio/vnd.nuera.ecelp7470": {
- "source": "iana",
- "extensions": ["ecelp7470"]
- },
- "audio/vnd.nuera.ecelp9600": {
- "source": "iana",
- "extensions": ["ecelp9600"]
- },
- "audio/vnd.octel.sbc": {
- "source": "iana"
- },
- "audio/vnd.presonus.multitrack": {
- "source": "iana"
- },
- "audio/vnd.qcelp": {
- "source": "iana"
- },
- "audio/vnd.rhetorex.32kadpcm": {
- "source": "iana"
- },
- "audio/vnd.rip": {
- "source": "iana",
- "extensions": ["rip"]
- },
- "audio/vnd.rn-realaudio": {
- "compressible": false
- },
- "audio/vnd.sealedmedia.softseal.mpeg": {
- "source": "iana"
- },
- "audio/vnd.vmx.cvsd": {
- "source": "iana"
- },
- "audio/vnd.wave": {
- "compressible": false
- },
- "audio/vorbis": {
- "source": "iana",
- "compressible": false
- },
- "audio/vorbis-config": {
- "source": "iana"
- },
- "audio/wav": {
- "compressible": false,
- "extensions": ["wav"]
- },
- "audio/wave": {
- "compressible": false,
- "extensions": ["wav"]
- },
- "audio/webm": {
- "source": "apache",
- "compressible": false,
- "extensions": ["weba"]
- },
- "audio/x-aac": {
- "source": "apache",
- "compressible": false,
- "extensions": ["aac"]
- },
- "audio/x-aiff": {
- "source": "apache",
- "extensions": ["aif","aiff","aifc"]
- },
- "audio/x-caf": {
- "source": "apache",
- "compressible": false,
- "extensions": ["caf"]
- },
- "audio/x-flac": {
- "source": "apache",
- "extensions": ["flac"]
- },
- "audio/x-m4a": {
- "source": "nginx",
- "extensions": ["m4a"]
- },
- "audio/x-matroska": {
- "source": "apache",
- "extensions": ["mka"]
- },
- "audio/x-mpegurl": {
- "source": "apache",
- "extensions": ["m3u"]
- },
- "audio/x-ms-wax": {
- "source": "apache",
- "extensions": ["wax"]
- },
- "audio/x-ms-wma": {
- "source": "apache",
- "extensions": ["wma"]
- },
- "audio/x-pn-realaudio": {
- "source": "apache",
- "extensions": ["ram","ra"]
- },
- "audio/x-pn-realaudio-plugin": {
- "source": "apache",
- "extensions": ["rmp"]
- },
- "audio/x-realaudio": {
- "source": "nginx",
- "extensions": ["ra"]
- },
- "audio/x-tta": {
- "source": "apache"
- },
- "audio/x-wav": {
- "source": "apache",
- "extensions": ["wav"]
- },
- "audio/xm": {
- "source": "apache",
- "extensions": ["xm"]
- },
- "chemical/x-cdx": {
- "source": "apache",
- "extensions": ["cdx"]
- },
- "chemical/x-cif": {
- "source": "apache",
- "extensions": ["cif"]
- },
- "chemical/x-cmdf": {
- "source": "apache",
- "extensions": ["cmdf"]
- },
- "chemical/x-cml": {
- "source": "apache",
- "extensions": ["cml"]
- },
- "chemical/x-csml": {
- "source": "apache",
- "extensions": ["csml"]
- },
- "chemical/x-pdb": {
- "source": "apache"
- },
- "chemical/x-xyz": {
- "source": "apache",
- "extensions": ["xyz"]
- },
- "font/collection": {
- "source": "iana",
- "extensions": ["ttc"]
- },
- "font/otf": {
- "source": "iana",
- "compressible": true,
- "extensions": ["otf"]
- },
- "font/sfnt": {
- "source": "iana"
- },
- "font/ttf": {
- "source": "iana",
- "compressible": true,
- "extensions": ["ttf"]
- },
- "font/woff": {
- "source": "iana",
- "extensions": ["woff"]
- },
- "font/woff2": {
- "source": "iana",
- "extensions": ["woff2"]
- },
- "image/aces": {
- "source": "iana",
- "extensions": ["exr"]
- },
- "image/apng": {
- "compressible": false,
- "extensions": ["apng"]
- },
- "image/avci": {
- "source": "iana",
- "extensions": ["avci"]
- },
- "image/avcs": {
- "source": "iana",
- "extensions": ["avcs"]
- },
- "image/avif": {
- "source": "iana",
- "compressible": false,
- "extensions": ["avif"]
- },
- "image/bmp": {
- "source": "iana",
- "compressible": true,
- "extensions": ["bmp"]
- },
- "image/cgm": {
- "source": "iana",
- "extensions": ["cgm"]
- },
- "image/dicom-rle": {
- "source": "iana",
- "extensions": ["drle"]
- },
- "image/emf": {
- "source": "iana",
- "extensions": ["emf"]
- },
- "image/fits": {
- "source": "iana",
- "extensions": ["fits"]
- },
- "image/g3fax": {
- "source": "iana",
- "extensions": ["g3"]
- },
- "image/gif": {
- "source": "iana",
- "compressible": false,
- "extensions": ["gif"]
- },
- "image/heic": {
- "source": "iana",
- "extensions": ["heic"]
- },
- "image/heic-sequence": {
- "source": "iana",
- "extensions": ["heics"]
- },
- "image/heif": {
- "source": "iana",
- "extensions": ["heif"]
- },
- "image/heif-sequence": {
- "source": "iana",
- "extensions": ["heifs"]
- },
- "image/hej2k": {
- "source": "iana",
- "extensions": ["hej2"]
- },
- "image/hsj2": {
- "source": "iana",
- "extensions": ["hsj2"]
- },
- "image/ief": {
- "source": "iana",
- "extensions": ["ief"]
- },
- "image/jls": {
- "source": "iana",
- "extensions": ["jls"]
- },
- "image/jp2": {
- "source": "iana",
- "compressible": false,
- "extensions": ["jp2","jpg2"]
- },
- "image/jpeg": {
- "source": "iana",
- "compressible": false,
- "extensions": ["jpeg","jpg","jpe"]
- },
- "image/jph": {
- "source": "iana",
- "extensions": ["jph"]
- },
- "image/jphc": {
- "source": "iana",
- "extensions": ["jhc"]
- },
- "image/jpm": {
- "source": "iana",
- "compressible": false,
- "extensions": ["jpm"]
- },
- "image/jpx": {
- "source": "iana",
- "compressible": false,
- "extensions": ["jpx","jpf"]
- },
- "image/jxr": {
- "source": "iana",
- "extensions": ["jxr"]
- },
- "image/jxra": {
- "source": "iana",
- "extensions": ["jxra"]
- },
- "image/jxrs": {
- "source": "iana",
- "extensions": ["jxrs"]
- },
- "image/jxs": {
- "source": "iana",
- "extensions": ["jxs"]
- },
- "image/jxsc": {
- "source": "iana",
- "extensions": ["jxsc"]
- },
- "image/jxsi": {
- "source": "iana",
- "extensions": ["jxsi"]
- },
- "image/jxss": {
- "source": "iana",
- "extensions": ["jxss"]
- },
- "image/ktx": {
- "source": "iana",
- "extensions": ["ktx"]
- },
- "image/ktx2": {
- "source": "iana",
- "extensions": ["ktx2"]
- },
- "image/naplps": {
- "source": "iana"
- },
- "image/pjpeg": {
- "compressible": false
- },
- "image/png": {
- "source": "iana",
- "compressible": false,
- "extensions": ["png"]
- },
- "image/prs.btif": {
- "source": "iana",
- "extensions": ["btif"]
- },
- "image/prs.pti": {
- "source": "iana",
- "extensions": ["pti"]
- },
- "image/pwg-raster": {
- "source": "iana"
- },
- "image/sgi": {
- "source": "apache",
- "extensions": ["sgi"]
- },
- "image/svg+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["svg","svgz"]
- },
- "image/t38": {
- "source": "iana",
- "extensions": ["t38"]
- },
- "image/tiff": {
- "source": "iana",
- "compressible": false,
- "extensions": ["tif","tiff"]
- },
- "image/tiff-fx": {
- "source": "iana",
- "extensions": ["tfx"]
- },
- "image/vnd.adobe.photoshop": {
- "source": "iana",
- "compressible": true,
- "extensions": ["psd"]
- },
- "image/vnd.airzip.accelerator.azv": {
- "source": "iana",
- "extensions": ["azv"]
- },
- "image/vnd.cns.inf2": {
- "source": "iana"
- },
- "image/vnd.dece.graphic": {
- "source": "iana",
- "extensions": ["uvi","uvvi","uvg","uvvg"]
- },
- "image/vnd.djvu": {
- "source": "iana",
- "extensions": ["djvu","djv"]
- },
- "image/vnd.dvb.subtitle": {
- "source": "iana",
- "extensions": ["sub"]
- },
- "image/vnd.dwg": {
- "source": "iana",
- "extensions": ["dwg"]
- },
- "image/vnd.dxf": {
- "source": "iana",
- "extensions": ["dxf"]
- },
- "image/vnd.fastbidsheet": {
- "source": "iana",
- "extensions": ["fbs"]
- },
- "image/vnd.fpx": {
- "source": "iana",
- "extensions": ["fpx"]
- },
- "image/vnd.fst": {
- "source": "iana",
- "extensions": ["fst"]
- },
- "image/vnd.fujixerox.edmics-mmr": {
- "source": "iana",
- "extensions": ["mmr"]
- },
- "image/vnd.fujixerox.edmics-rlc": {
- "source": "iana",
- "extensions": ["rlc"]
- },
- "image/vnd.globalgraphics.pgb": {
- "source": "iana"
- },
- "image/vnd.microsoft.icon": {
- "source": "iana",
- "compressible": true,
- "extensions": ["ico"]
- },
- "image/vnd.mix": {
- "source": "iana"
- },
- "image/vnd.mozilla.apng": {
- "source": "iana"
- },
- "image/vnd.ms-dds": {
- "compressible": true,
- "extensions": ["dds"]
- },
- "image/vnd.ms-modi": {
- "source": "iana",
- "extensions": ["mdi"]
- },
- "image/vnd.ms-photo": {
- "source": "apache",
- "extensions": ["wdp"]
- },
- "image/vnd.net-fpx": {
- "source": "iana",
- "extensions": ["npx"]
- },
- "image/vnd.pco.b16": {
- "source": "iana",
- "extensions": ["b16"]
- },
- "image/vnd.radiance": {
- "source": "iana"
- },
- "image/vnd.sealed.png": {
- "source": "iana"
- },
- "image/vnd.sealedmedia.softseal.gif": {
- "source": "iana"
- },
- "image/vnd.sealedmedia.softseal.jpg": {
- "source": "iana"
- },
- "image/vnd.svf": {
- "source": "iana"
- },
- "image/vnd.tencent.tap": {
- "source": "iana",
- "extensions": ["tap"]
- },
- "image/vnd.valve.source.texture": {
- "source": "iana",
- "extensions": ["vtf"]
- },
- "image/vnd.wap.wbmp": {
- "source": "iana",
- "extensions": ["wbmp"]
- },
- "image/vnd.xiff": {
- "source": "iana",
- "extensions": ["xif"]
- },
- "image/vnd.zbrush.pcx": {
- "source": "iana",
- "extensions": ["pcx"]
- },
- "image/webp": {
- "source": "apache",
- "extensions": ["webp"]
- },
- "image/wmf": {
- "source": "iana",
- "extensions": ["wmf"]
- },
- "image/x-3ds": {
- "source": "apache",
- "extensions": ["3ds"]
- },
- "image/x-cmu-raster": {
- "source": "apache",
- "extensions": ["ras"]
- },
- "image/x-cmx": {
- "source": "apache",
- "extensions": ["cmx"]
- },
- "image/x-freehand": {
- "source": "apache",
- "extensions": ["fh","fhc","fh4","fh5","fh7"]
- },
- "image/x-icon": {
- "source": "apache",
- "compressible": true,
- "extensions": ["ico"]
- },
- "image/x-jng": {
- "source": "nginx",
- "extensions": ["jng"]
- },
- "image/x-mrsid-image": {
- "source": "apache",
- "extensions": ["sid"]
- },
- "image/x-ms-bmp": {
- "source": "nginx",
- "compressible": true,
- "extensions": ["bmp"]
- },
- "image/x-pcx": {
- "source": "apache",
- "extensions": ["pcx"]
- },
- "image/x-pict": {
- "source": "apache",
- "extensions": ["pic","pct"]
- },
- "image/x-portable-anymap": {
- "source": "apache",
- "extensions": ["pnm"]
- },
- "image/x-portable-bitmap": {
- "source": "apache",
- "extensions": ["pbm"]
- },
- "image/x-portable-graymap": {
- "source": "apache",
- "extensions": ["pgm"]
- },
- "image/x-portable-pixmap": {
- "source": "apache",
- "extensions": ["ppm"]
- },
- "image/x-rgb": {
- "source": "apache",
- "extensions": ["rgb"]
- },
- "image/x-tga": {
- "source": "apache",
- "extensions": ["tga"]
- },
- "image/x-xbitmap": {
- "source": "apache",
- "extensions": ["xbm"]
- },
- "image/x-xcf": {
- "compressible": false
- },
- "image/x-xpixmap": {
- "source": "apache",
- "extensions": ["xpm"]
- },
- "image/x-xwindowdump": {
- "source": "apache",
- "extensions": ["xwd"]
- },
- "message/cpim": {
- "source": "iana"
- },
- "message/delivery-status": {
- "source": "iana"
- },
- "message/disposition-notification": {
- "source": "iana",
- "extensions": [
- "disposition-notification"
- ]
- },
- "message/external-body": {
- "source": "iana"
- },
- "message/feedback-report": {
- "source": "iana"
- },
- "message/global": {
- "source": "iana",
- "extensions": ["u8msg"]
- },
- "message/global-delivery-status": {
- "source": "iana",
- "extensions": ["u8dsn"]
- },
- "message/global-disposition-notification": {
- "source": "iana",
- "extensions": ["u8mdn"]
- },
- "message/global-headers": {
- "source": "iana",
- "extensions": ["u8hdr"]
- },
- "message/http": {
- "source": "iana",
- "compressible": false
- },
- "message/imdn+xml": {
- "source": "iana",
- "compressible": true
- },
- "message/news": {
- "source": "iana"
- },
- "message/partial": {
- "source": "iana",
- "compressible": false
- },
- "message/rfc822": {
- "source": "iana",
- "compressible": true,
- "extensions": ["eml","mime"]
- },
- "message/s-http": {
- "source": "iana"
- },
- "message/sip": {
- "source": "iana"
- },
- "message/sipfrag": {
- "source": "iana"
- },
- "message/tracking-status": {
- "source": "iana"
- },
- "message/vnd.si.simp": {
- "source": "iana"
- },
- "message/vnd.wfa.wsc": {
- "source": "iana",
- "extensions": ["wsc"]
- },
- "model/3mf": {
- "source": "iana",
- "extensions": ["3mf"]
- },
- "model/e57": {
- "source": "iana"
- },
- "model/gltf+json": {
- "source": "iana",
- "compressible": true,
- "extensions": ["gltf"]
- },
- "model/gltf-binary": {
- "source": "iana",
- "compressible": true,
- "extensions": ["glb"]
- },
- "model/iges": {
- "source": "iana",
- "compressible": false,
- "extensions": ["igs","iges"]
- },
- "model/mesh": {
- "source": "iana",
- "compressible": false,
- "extensions": ["msh","mesh","silo"]
- },
- "model/mtl": {
- "source": "iana",
- "extensions": ["mtl"]
- },
- "model/obj": {
- "source": "iana",
- "extensions": ["obj"]
- },
- "model/step": {
- "source": "iana"
- },
- "model/step+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["stpx"]
- },
- "model/step+zip": {
- "source": "iana",
- "compressible": false,
- "extensions": ["stpz"]
- },
- "model/step-xml+zip": {
- "source": "iana",
- "compressible": false,
- "extensions": ["stpxz"]
- },
- "model/stl": {
- "source": "iana",
- "extensions": ["stl"]
- },
- "model/vnd.collada+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["dae"]
- },
- "model/vnd.dwf": {
- "source": "iana",
- "extensions": ["dwf"]
- },
- "model/vnd.flatland.3dml": {
- "source": "iana"
- },
- "model/vnd.gdl": {
- "source": "iana",
- "extensions": ["gdl"]
- },
- "model/vnd.gs-gdl": {
- "source": "apache"
- },
- "model/vnd.gs.gdl": {
- "source": "iana"
- },
- "model/vnd.gtw": {
- "source": "iana",
- "extensions": ["gtw"]
- },
- "model/vnd.moml+xml": {
- "source": "iana",
- "compressible": true
- },
- "model/vnd.mts": {
- "source": "iana",
- "extensions": ["mts"]
- },
- "model/vnd.opengex": {
- "source": "iana",
- "extensions": ["ogex"]
- },
- "model/vnd.parasolid.transmit.binary": {
- "source": "iana",
- "extensions": ["x_b"]
- },
- "model/vnd.parasolid.transmit.text": {
- "source": "iana",
- "extensions": ["x_t"]
- },
- "model/vnd.pytha.pyox": {
- "source": "iana"
- },
- "model/vnd.rosette.annotated-data-model": {
- "source": "iana"
- },
- "model/vnd.sap.vds": {
- "source": "iana",
- "extensions": ["vds"]
- },
- "model/vnd.usdz+zip": {
- "source": "iana",
- "compressible": false,
- "extensions": ["usdz"]
- },
- "model/vnd.valve.source.compiled-map": {
- "source": "iana",
- "extensions": ["bsp"]
- },
- "model/vnd.vtu": {
- "source": "iana",
- "extensions": ["vtu"]
- },
- "model/vrml": {
- "source": "iana",
- "compressible": false,
- "extensions": ["wrl","vrml"]
- },
- "model/x3d+binary": {
- "source": "apache",
- "compressible": false,
- "extensions": ["x3db","x3dbz"]
- },
- "model/x3d+fastinfoset": {
- "source": "iana",
- "extensions": ["x3db"]
- },
- "model/x3d+vrml": {
- "source": "apache",
- "compressible": false,
- "extensions": ["x3dv","x3dvz"]
- },
- "model/x3d+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["x3d","x3dz"]
- },
- "model/x3d-vrml": {
- "source": "iana",
- "extensions": ["x3dv"]
- },
- "multipart/alternative": {
- "source": "iana",
- "compressible": false
- },
- "multipart/appledouble": {
- "source": "iana"
- },
- "multipart/byteranges": {
- "source": "iana"
- },
- "multipart/digest": {
- "source": "iana"
- },
- "multipart/encrypted": {
- "source": "iana",
- "compressible": false
- },
- "multipart/form-data": {
- "source": "iana",
- "compressible": false
- },
- "multipart/header-set": {
- "source": "iana"
- },
- "multipart/mixed": {
- "source": "iana"
- },
- "multipart/multilingual": {
- "source": "iana"
- },
- "multipart/parallel": {
- "source": "iana"
- },
- "multipart/related": {
- "source": "iana",
- "compressible": false
- },
- "multipart/report": {
- "source": "iana"
- },
- "multipart/signed": {
- "source": "iana",
- "compressible": false
- },
- "multipart/vnd.bint.med-plus": {
- "source": "iana"
- },
- "multipart/voice-message": {
- "source": "iana"
- },
- "multipart/x-mixed-replace": {
- "source": "iana"
- },
- "text/1d-interleaved-parityfec": {
- "source": "iana"
- },
- "text/cache-manifest": {
- "source": "iana",
- "compressible": true,
- "extensions": ["appcache","manifest"]
- },
- "text/calendar": {
- "source": "iana",
- "extensions": ["ics","ifb"]
- },
- "text/calender": {
- "compressible": true
- },
- "text/cmd": {
- "compressible": true
- },
- "text/coffeescript": {
- "extensions": ["coffee","litcoffee"]
- },
- "text/cql": {
- "source": "iana"
- },
- "text/cql-expression": {
- "source": "iana"
- },
- "text/cql-identifier": {
- "source": "iana"
- },
- "text/css": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true,
- "extensions": ["css"]
- },
- "text/csv": {
- "source": "iana",
- "compressible": true,
- "extensions": ["csv"]
- },
- "text/csv-schema": {
- "source": "iana"
- },
- "text/directory": {
- "source": "iana"
- },
- "text/dns": {
- "source": "iana"
- },
- "text/ecmascript": {
- "source": "iana"
- },
- "text/encaprtp": {
- "source": "iana"
- },
- "text/enriched": {
- "source": "iana"
- },
- "text/fhirpath": {
- "source": "iana"
- },
- "text/flexfec": {
- "source": "iana"
- },
- "text/fwdred": {
- "source": "iana"
- },
- "text/gff3": {
- "source": "iana"
- },
- "text/grammar-ref-list": {
- "source": "iana"
- },
- "text/html": {
- "source": "iana",
- "compressible": true,
- "extensions": ["html","htm","shtml"]
- },
- "text/jade": {
- "extensions": ["jade"]
- },
- "text/javascript": {
- "source": "iana",
- "compressible": true
- },
- "text/jcr-cnd": {
- "source": "iana"
- },
- "text/jsx": {
- "compressible": true,
- "extensions": ["jsx"]
- },
- "text/less": {
- "compressible": true,
- "extensions": ["less"]
- },
- "text/markdown": {
- "source": "iana",
- "compressible": true,
- "extensions": ["markdown","md"]
- },
- "text/mathml": {
- "source": "nginx",
- "extensions": ["mml"]
- },
- "text/mdx": {
- "compressible": true,
- "extensions": ["mdx"]
- },
- "text/mizar": {
- "source": "iana"
- },
- "text/n3": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true,
- "extensions": ["n3"]
- },
- "text/parameters": {
- "source": "iana",
- "charset": "UTF-8"
- },
- "text/parityfec": {
- "source": "iana"
- },
- "text/plain": {
- "source": "iana",
- "compressible": true,
- "extensions": ["txt","text","conf","def","list","log","in","ini"]
- },
- "text/provenance-notation": {
- "source": "iana",
- "charset": "UTF-8"
- },
- "text/prs.fallenstein.rst": {
- "source": "iana"
- },
- "text/prs.lines.tag": {
- "source": "iana",
- "extensions": ["dsc"]
- },
- "text/prs.prop.logic": {
- "source": "iana"
- },
- "text/raptorfec": {
- "source": "iana"
- },
- "text/red": {
- "source": "iana"
- },
- "text/rfc822-headers": {
- "source": "iana"
- },
- "text/richtext": {
- "source": "iana",
- "compressible": true,
- "extensions": ["rtx"]
- },
- "text/rtf": {
- "source": "iana",
- "compressible": true,
- "extensions": ["rtf"]
- },
- "text/rtp-enc-aescm128": {
- "source": "iana"
- },
- "text/rtploopback": {
- "source": "iana"
- },
- "text/rtx": {
- "source": "iana"
- },
- "text/sgml": {
- "source": "iana",
- "extensions": ["sgml","sgm"]
- },
- "text/shaclc": {
- "source": "iana"
- },
- "text/shex": {
- "source": "iana",
- "extensions": ["shex"]
- },
- "text/slim": {
- "extensions": ["slim","slm"]
- },
- "text/spdx": {
- "source": "iana",
- "extensions": ["spdx"]
- },
- "text/strings": {
- "source": "iana"
- },
- "text/stylus": {
- "extensions": ["stylus","styl"]
- },
- "text/t140": {
- "source": "iana"
- },
- "text/tab-separated-values": {
- "source": "iana",
- "compressible": true,
- "extensions": ["tsv"]
- },
- "text/troff": {
- "source": "iana",
- "extensions": ["t","tr","roff","man","me","ms"]
- },
- "text/turtle": {
- "source": "iana",
- "charset": "UTF-8",
- "extensions": ["ttl"]
- },
- "text/ulpfec": {
- "source": "iana"
- },
- "text/uri-list": {
- "source": "iana",
- "compressible": true,
- "extensions": ["uri","uris","urls"]
- },
- "text/vcard": {
- "source": "iana",
- "compressible": true,
- "extensions": ["vcard"]
- },
- "text/vnd.a": {
- "source": "iana"
- },
- "text/vnd.abc": {
- "source": "iana"
- },
- "text/vnd.ascii-art": {
- "source": "iana"
- },
- "text/vnd.curl": {
- "source": "iana",
- "extensions": ["curl"]
- },
- "text/vnd.curl.dcurl": {
- "source": "apache",
- "extensions": ["dcurl"]
- },
- "text/vnd.curl.mcurl": {
- "source": "apache",
- "extensions": ["mcurl"]
- },
- "text/vnd.curl.scurl": {
- "source": "apache",
- "extensions": ["scurl"]
- },
- "text/vnd.debian.copyright": {
- "source": "iana",
- "charset": "UTF-8"
- },
- "text/vnd.dmclientscript": {
- "source": "iana"
- },
- "text/vnd.dvb.subtitle": {
- "source": "iana",
- "extensions": ["sub"]
- },
- "text/vnd.esmertec.theme-descriptor": {
- "source": "iana",
- "charset": "UTF-8"
- },
- "text/vnd.familysearch.gedcom": {
- "source": "iana",
- "extensions": ["ged"]
- },
- "text/vnd.ficlab.flt": {
- "source": "iana"
- },
- "text/vnd.fly": {
- "source": "iana",
- "extensions": ["fly"]
- },
- "text/vnd.fmi.flexstor": {
- "source": "iana",
- "extensions": ["flx"]
- },
- "text/vnd.gml": {
- "source": "iana"
- },
- "text/vnd.graphviz": {
- "source": "iana",
- "extensions": ["gv"]
- },
- "text/vnd.hans": {
- "source": "iana"
- },
- "text/vnd.hgl": {
- "source": "iana"
- },
- "text/vnd.in3d.3dml": {
- "source": "iana",
- "extensions": ["3dml"]
- },
- "text/vnd.in3d.spot": {
- "source": "iana",
- "extensions": ["spot"]
- },
- "text/vnd.iptc.newsml": {
- "source": "iana"
- },
- "text/vnd.iptc.nitf": {
- "source": "iana"
- },
- "text/vnd.latex-z": {
- "source": "iana"
- },
- "text/vnd.motorola.reflex": {
- "source": "iana"
- },
- "text/vnd.ms-mediapackage": {
- "source": "iana"
- },
- "text/vnd.net2phone.commcenter.command": {
- "source": "iana"
- },
- "text/vnd.radisys.msml-basic-layout": {
- "source": "iana"
- },
- "text/vnd.senx.warpscript": {
- "source": "iana"
- },
- "text/vnd.si.uricatalogue": {
- "source": "iana"
- },
- "text/vnd.sosi": {
- "source": "iana"
- },
- "text/vnd.sun.j2me.app-descriptor": {
- "source": "iana",
- "charset": "UTF-8",
- "extensions": ["jad"]
- },
- "text/vnd.trolltech.linguist": {
- "source": "iana",
- "charset": "UTF-8"
- },
- "text/vnd.wap.si": {
- "source": "iana"
- },
- "text/vnd.wap.sl": {
- "source": "iana"
- },
- "text/vnd.wap.wml": {
- "source": "iana",
- "extensions": ["wml"]
- },
- "text/vnd.wap.wmlscript": {
- "source": "iana",
- "extensions": ["wmls"]
- },
- "text/vtt": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true,
- "extensions": ["vtt"]
- },
- "text/x-asm": {
- "source": "apache",
- "extensions": ["s","asm"]
- },
- "text/x-c": {
- "source": "apache",
- "extensions": ["c","cc","cxx","cpp","h","hh","dic"]
- },
- "text/x-component": {
- "source": "nginx",
- "extensions": ["htc"]
- },
- "text/x-fortran": {
- "source": "apache",
- "extensions": ["f","for","f77","f90"]
- },
- "text/x-gwt-rpc": {
- "compressible": true
- },
- "text/x-handlebars-template": {
- "extensions": ["hbs"]
- },
- "text/x-java-source": {
- "source": "apache",
- "extensions": ["java"]
- },
- "text/x-jquery-tmpl": {
- "compressible": true
- },
- "text/x-lua": {
- "extensions": ["lua"]
- },
- "text/x-markdown": {
- "compressible": true,
- "extensions": ["mkd"]
- },
- "text/x-nfo": {
- "source": "apache",
- "extensions": ["nfo"]
- },
- "text/x-opml": {
- "source": "apache",
- "extensions": ["opml"]
- },
- "text/x-org": {
- "compressible": true,
- "extensions": ["org"]
- },
- "text/x-pascal": {
- "source": "apache",
- "extensions": ["p","pas"]
- },
- "text/x-processing": {
- "compressible": true,
- "extensions": ["pde"]
- },
- "text/x-sass": {
- "extensions": ["sass"]
- },
- "text/x-scss": {
- "extensions": ["scss"]
- },
- "text/x-setext": {
- "source": "apache",
- "extensions": ["etx"]
- },
- "text/x-sfv": {
- "source": "apache",
- "extensions": ["sfv"]
- },
- "text/x-suse-ymp": {
- "compressible": true,
- "extensions": ["ymp"]
- },
- "text/x-uuencode": {
- "source": "apache",
- "extensions": ["uu"]
- },
- "text/x-vcalendar": {
- "source": "apache",
- "extensions": ["vcs"]
- },
- "text/x-vcard": {
- "source": "apache",
- "extensions": ["vcf"]
- },
- "text/xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["xml"]
- },
- "text/xml-external-parsed-entity": {
- "source": "iana"
- },
- "text/yaml": {
- "compressible": true,
- "extensions": ["yaml","yml"]
- },
- "video/1d-interleaved-parityfec": {
- "source": "iana"
- },
- "video/3gpp": {
- "source": "iana",
- "extensions": ["3gp","3gpp"]
- },
- "video/3gpp-tt": {
- "source": "iana"
- },
- "video/3gpp2": {
- "source": "iana",
- "extensions": ["3g2"]
- },
- "video/av1": {
- "source": "iana"
- },
- "video/bmpeg": {
- "source": "iana"
- },
- "video/bt656": {
- "source": "iana"
- },
- "video/celb": {
- "source": "iana"
- },
- "video/dv": {
- "source": "iana"
- },
- "video/encaprtp": {
- "source": "iana"
- },
- "video/ffv1": {
- "source": "iana"
- },
- "video/flexfec": {
- "source": "iana"
- },
- "video/h261": {
- "source": "iana",
- "extensions": ["h261"]
- },
- "video/h263": {
- "source": "iana",
- "extensions": ["h263"]
- },
- "video/h263-1998": {
- "source": "iana"
- },
- "video/h263-2000": {
- "source": "iana"
- },
- "video/h264": {
- "source": "iana",
- "extensions": ["h264"]
- },
- "video/h264-rcdo": {
- "source": "iana"
- },
- "video/h264-svc": {
- "source": "iana"
- },
- "video/h265": {
- "source": "iana"
- },
- "video/iso.segment": {
- "source": "iana",
- "extensions": ["m4s"]
- },
- "video/jpeg": {
- "source": "iana",
- "extensions": ["jpgv"]
- },
- "video/jpeg2000": {
- "source": "iana"
- },
- "video/jpm": {
- "source": "apache",
- "extensions": ["jpm","jpgm"]
- },
- "video/jxsv": {
- "source": "iana"
- },
- "video/mj2": {
- "source": "iana",
- "extensions": ["mj2","mjp2"]
- },
- "video/mp1s": {
- "source": "iana"
- },
- "video/mp2p": {
- "source": "iana"
- },
- "video/mp2t": {
- "source": "iana",
- "extensions": ["ts"]
- },
- "video/mp4": {
- "source": "iana",
- "compressible": false,
- "extensions": ["mp4","mp4v","mpg4"]
- },
- "video/mp4v-es": {
- "source": "iana"
- },
- "video/mpeg": {
- "source": "iana",
- "compressible": false,
- "extensions": ["mpeg","mpg","mpe","m1v","m2v"]
- },
- "video/mpeg4-generic": {
- "source": "iana"
- },
- "video/mpv": {
- "source": "iana"
- },
- "video/nv": {
- "source": "iana"
- },
- "video/ogg": {
- "source": "iana",
- "compressible": false,
- "extensions": ["ogv"]
- },
- "video/parityfec": {
- "source": "iana"
- },
- "video/pointer": {
- "source": "iana"
- },
- "video/quicktime": {
- "source": "iana",
- "compressible": false,
- "extensions": ["qt","mov"]
- },
- "video/raptorfec": {
- "source": "iana"
- },
- "video/raw": {
- "source": "iana"
- },
- "video/rtp-enc-aescm128": {
- "source": "iana"
- },
- "video/rtploopback": {
- "source": "iana"
- },
- "video/rtx": {
- "source": "iana"
- },
- "video/scip": {
- "source": "iana"
- },
- "video/smpte291": {
- "source": "iana"
- },
- "video/smpte292m": {
- "source": "iana"
- },
- "video/ulpfec": {
- "source": "iana"
- },
- "video/vc1": {
- "source": "iana"
- },
- "video/vc2": {
- "source": "iana"
- },
- "video/vnd.cctv": {
- "source": "iana"
- },
- "video/vnd.dece.hd": {
- "source": "iana",
- "extensions": ["uvh","uvvh"]
- },
- "video/vnd.dece.mobile": {
- "source": "iana",
- "extensions": ["uvm","uvvm"]
- },
- "video/vnd.dece.mp4": {
- "source": "iana"
- },
- "video/vnd.dece.pd": {
- "source": "iana",
- "extensions": ["uvp","uvvp"]
- },
- "video/vnd.dece.sd": {
- "source": "iana",
- "extensions": ["uvs","uvvs"]
- },
- "video/vnd.dece.video": {
- "source": "iana",
- "extensions": ["uvv","uvvv"]
- },
- "video/vnd.directv.mpeg": {
- "source": "iana"
- },
- "video/vnd.directv.mpeg-tts": {
- "source": "iana"
- },
- "video/vnd.dlna.mpeg-tts": {
- "source": "iana"
- },
- "video/vnd.dvb.file": {
- "source": "iana",
- "extensions": ["dvb"]
- },
- "video/vnd.fvt": {
- "source": "iana",
- "extensions": ["fvt"]
- },
- "video/vnd.hns.video": {
- "source": "iana"
- },
- "video/vnd.iptvforum.1dparityfec-1010": {
- "source": "iana"
- },
- "video/vnd.iptvforum.1dparityfec-2005": {
- "source": "iana"
- },
- "video/vnd.iptvforum.2dparityfec-1010": {
- "source": "iana"
- },
- "video/vnd.iptvforum.2dparityfec-2005": {
- "source": "iana"
- },
- "video/vnd.iptvforum.ttsavc": {
- "source": "iana"
- },
- "video/vnd.iptvforum.ttsmpeg2": {
- "source": "iana"
- },
- "video/vnd.motorola.video": {
- "source": "iana"
- },
- "video/vnd.motorola.videop": {
- "source": "iana"
- },
- "video/vnd.mpegurl": {
- "source": "iana",
- "extensions": ["mxu","m4u"]
- },
- "video/vnd.ms-playready.media.pyv": {
- "source": "iana",
- "extensions": ["pyv"]
- },
- "video/vnd.nokia.interleaved-multimedia": {
- "source": "iana"
- },
- "video/vnd.nokia.mp4vr": {
- "source": "iana"
- },
- "video/vnd.nokia.videovoip": {
- "source": "iana"
- },
- "video/vnd.objectvideo": {
- "source": "iana"
- },
- "video/vnd.radgamettools.bink": {
- "source": "iana"
- },
- "video/vnd.radgamettools.smacker": {
- "source": "iana"
- },
- "video/vnd.sealed.mpeg1": {
- "source": "iana"
- },
- "video/vnd.sealed.mpeg4": {
- "source": "iana"
- },
- "video/vnd.sealed.swf": {
- "source": "iana"
- },
- "video/vnd.sealedmedia.softseal.mov": {
- "source": "iana"
- },
- "video/vnd.uvvu.mp4": {
- "source": "iana",
- "extensions": ["uvu","uvvu"]
- },
- "video/vnd.vivo": {
- "source": "iana",
- "extensions": ["viv"]
- },
- "video/vnd.youtube.yt": {
- "source": "iana"
- },
- "video/vp8": {
- "source": "iana"
- },
- "video/vp9": {
- "source": "iana"
- },
- "video/webm": {
- "source": "apache",
- "compressible": false,
- "extensions": ["webm"]
- },
- "video/x-f4v": {
- "source": "apache",
- "extensions": ["f4v"]
- },
- "video/x-fli": {
- "source": "apache",
- "extensions": ["fli"]
- },
- "video/x-flv": {
- "source": "apache",
- "compressible": false,
- "extensions": ["flv"]
- },
- "video/x-m4v": {
- "source": "apache",
- "extensions": ["m4v"]
- },
- "video/x-matroska": {
- "source": "apache",
- "compressible": false,
- "extensions": ["mkv","mk3d","mks"]
- },
- "video/x-mng": {
- "source": "apache",
- "extensions": ["mng"]
- },
- "video/x-ms-asf": {
- "source": "apache",
- "extensions": ["asf","asx"]
- },
- "video/x-ms-vob": {
- "source": "apache",
- "extensions": ["vob"]
- },
- "video/x-ms-wm": {
- "source": "apache",
- "extensions": ["wm"]
- },
- "video/x-ms-wmv": {
- "source": "apache",
- "compressible": false,
- "extensions": ["wmv"]
- },
- "video/x-ms-wmx": {
- "source": "apache",
- "extensions": ["wmx"]
- },
- "video/x-ms-wvx": {
- "source": "apache",
- "extensions": ["wvx"]
- },
- "video/x-msvideo": {
- "source": "apache",
- "extensions": ["avi"]
- },
- "video/x-sgi-movie": {
- "source": "apache",
- "extensions": ["movie"]
- },
- "video/x-smv": {
- "source": "apache",
- "extensions": ["smv"]
- },
- "x-conference/x-cooltalk": {
- "source": "apache",
- "extensions": ["ice"]
- },
- "x-shader/x-fragment": {
- "compressible": true
- },
- "x-shader/x-vertex": {
- "compressible": true
- }
-}
diff --git a/node_modules/mime-db/index.js b/node_modules/mime-db/index.js
deleted file mode 100644
index ec2be30..0000000
--- a/node_modules/mime-db/index.js
+++ /dev/null
@@ -1,12 +0,0 @@
-/*!
- * mime-db
- * Copyright(c) 2014 Jonathan Ong
- * Copyright(c) 2015-2022 Douglas Christopher Wilson
- * MIT Licensed
- */
-
-/**
- * Module exports.
- */
-
-module.exports = require('./db.json')
diff --git a/node_modules/mime-db/package.json b/node_modules/mime-db/package.json
deleted file mode 100644
index 32c14b8..0000000
--- a/node_modules/mime-db/package.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
- "name": "mime-db",
- "description": "Media Type Database",
- "version": "1.52.0",
- "contributors": [
- "Douglas Christopher Wilson ",
- "Jonathan Ong (http://jongleberry.com)",
- "Robert Kieffer (http://github.com/broofa)"
- ],
- "license": "MIT",
- "keywords": [
- "mime",
- "db",
- "type",
- "types",
- "database",
- "charset",
- "charsets"
- ],
- "repository": "jshttp/mime-db",
- "devDependencies": {
- "bluebird": "3.7.2",
- "co": "4.6.0",
- "cogent": "1.0.1",
- "csv-parse": "4.16.3",
- "eslint": "7.32.0",
- "eslint-config-standard": "15.0.1",
- "eslint-plugin-import": "2.25.4",
- "eslint-plugin-markdown": "2.2.1",
- "eslint-plugin-node": "11.1.0",
- "eslint-plugin-promise": "5.1.1",
- "eslint-plugin-standard": "4.1.0",
- "gnode": "0.1.2",
- "media-typer": "1.1.0",
- "mocha": "9.2.1",
- "nyc": "15.1.0",
- "raw-body": "2.5.0",
- "stream-to-array": "2.3.0"
- },
- "files": [
- "HISTORY.md",
- "LICENSE",
- "README.md",
- "db.json",
- "index.js"
- ],
- "engines": {
- "node": ">= 0.6"
- },
- "scripts": {
- "build": "node scripts/build",
- "fetch": "node scripts/fetch-apache && gnode scripts/fetch-iana && node scripts/fetch-nginx",
- "lint": "eslint .",
- "test": "mocha --reporter spec --bail --check-leaks test/",
- "test-ci": "nyc --reporter=lcov --reporter=text npm test",
- "test-cov": "nyc --reporter=html --reporter=text npm test",
- "update": "npm run fetch && npm run build",
- "version": "node scripts/version-history.js && git add HISTORY.md"
- }
-}
diff --git a/node_modules/mime-types/HISTORY.md b/node_modules/mime-types/HISTORY.md
deleted file mode 100644
index c5043b7..0000000
--- a/node_modules/mime-types/HISTORY.md
+++ /dev/null
@@ -1,397 +0,0 @@
-2.1.35 / 2022-03-12
-===================
-
- * deps: mime-db@1.52.0
- - Add extensions from IANA for more `image/*` types
- - Add extension `.asc` to `application/pgp-keys`
- - Add extensions to various XML types
- - Add new upstream MIME types
-
-2.1.34 / 2021-11-08
-===================
-
- * deps: mime-db@1.51.0
- - Add new upstream MIME types
-
-2.1.33 / 2021-10-01
-===================
-
- * deps: mime-db@1.50.0
- - Add deprecated iWorks mime types and extensions
- - Add new upstream MIME types
-
-2.1.32 / 2021-07-27
-===================
-
- * deps: mime-db@1.49.0
- - Add extension `.trig` to `application/trig`
- - Add new upstream MIME types
-
-2.1.31 / 2021-06-01
-===================
-
- * deps: mime-db@1.48.0
- - Add extension `.mvt` to `application/vnd.mapbox-vector-tile`
- - Add new upstream MIME types
-
-2.1.30 / 2021-04-02
-===================
-
- * deps: mime-db@1.47.0
- - Add extension `.amr` to `audio/amr`
- - Remove ambigious extensions from IANA for `application/*+xml` types
- - Update primary extension to `.es` for `application/ecmascript`
-
-2.1.29 / 2021-02-17
-===================
-
- * deps: mime-db@1.46.0
- - Add extension `.amr` to `audio/amr`
- - Add extension `.m4s` to `video/iso.segment`
- - Add extension `.opus` to `audio/ogg`
- - Add new upstream MIME types
-
-2.1.28 / 2021-01-01
-===================
-
- * deps: mime-db@1.45.0
- - Add `application/ubjson` with extension `.ubj`
- - Add `image/avif` with extension `.avif`
- - Add `image/ktx2` with extension `.ktx2`
- - Add extension `.dbf` to `application/vnd.dbf`
- - Add extension `.rar` to `application/vnd.rar`
- - Add extension `.td` to `application/urc-targetdesc+xml`
- - Add new upstream MIME types
- - Fix extension of `application/vnd.apple.keynote` to be `.key`
-
-2.1.27 / 2020-04-23
-===================
-
- * deps: mime-db@1.44.0
- - Add charsets from IANA
- - Add extension `.cjs` to `application/node`
- - Add new upstream MIME types
-
-2.1.26 / 2020-01-05
-===================
-
- * deps: mime-db@1.43.0
- - Add `application/x-keepass2` with extension `.kdbx`
- - Add extension `.mxmf` to `audio/mobile-xmf`
- - Add extensions from IANA for `application/*+xml` types
- - Add new upstream MIME types
-
-2.1.25 / 2019-11-12
-===================
-
- * deps: mime-db@1.42.0
- - Add new upstream MIME types
- - Add `application/toml` with extension `.toml`
- - Add `image/vnd.ms-dds` with extension `.dds`
-
-2.1.24 / 2019-04-20
-===================
-
- * deps: mime-db@1.40.0
- - Add extensions from IANA for `model/*` types
- - Add `text/mdx` with extension `.mdx`
-
-2.1.23 / 2019-04-17
-===================
-
- * deps: mime-db@~1.39.0
- - Add extensions `.siv` and `.sieve` to `application/sieve`
- - Add new upstream MIME types
-
-2.1.22 / 2019-02-14
-===================
-
- * deps: mime-db@~1.38.0
- - Add extension `.nq` to `application/n-quads`
- - Add extension `.nt` to `application/n-triples`
- - Add new upstream MIME types
-
-2.1.21 / 2018-10-19
-===================
-
- * deps: mime-db@~1.37.0
- - Add extensions to HEIC image types
- - Add new upstream MIME types
-
-2.1.20 / 2018-08-26
-===================
-
- * deps: mime-db@~1.36.0
- - Add Apple file extensions from IANA
- - Add extensions from IANA for `image/*` types
- - Add new upstream MIME types
-
-2.1.19 / 2018-07-17
-===================
-
- * deps: mime-db@~1.35.0
- - Add extension `.csl` to `application/vnd.citationstyles.style+xml`
- - Add extension `.es` to `application/ecmascript`
- - Add extension `.owl` to `application/rdf+xml`
- - Add new upstream MIME types
- - Add UTF-8 as default charset for `text/turtle`
-
-2.1.18 / 2018-02-16
-===================
-
- * deps: mime-db@~1.33.0
- - Add `application/raml+yaml` with extension `.raml`
- - Add `application/wasm` with extension `.wasm`
- - Add `text/shex` with extension `.shex`
- - Add extensions for JPEG-2000 images
- - Add extensions from IANA for `message/*` types
- - Add new upstream MIME types
- - Update font MIME types
- - Update `text/hjson` to registered `application/hjson`
-
-2.1.17 / 2017-09-01
-===================
-
- * deps: mime-db@~1.30.0
- - Add `application/vnd.ms-outlook`
- - Add `application/x-arj`
- - Add extension `.mjs` to `application/javascript`
- - Add glTF types and extensions
- - Add new upstream MIME types
- - Add `text/x-org`
- - Add VirtualBox MIME types
- - Fix `source` records for `video/*` types that are IANA
- - Update `font/opentype` to registered `font/otf`
-
-2.1.16 / 2017-07-24
-===================
-
- * deps: mime-db@~1.29.0
- - Add `application/fido.trusted-apps+json`
- - Add extension `.wadl` to `application/vnd.sun.wadl+xml`
- - Add extension `.gz` to `application/gzip`
- - Add new upstream MIME types
- - Update extensions `.md` and `.markdown` to be `text/markdown`
-
-2.1.15 / 2017-03-23
-===================
-
- * deps: mime-db@~1.27.0
- - Add new mime types
- - Add `image/apng`
-
-2.1.14 / 2017-01-14
-===================
-
- * deps: mime-db@~1.26.0
- - Add new mime types
-
-2.1.13 / 2016-11-18
-===================
-
- * deps: mime-db@~1.25.0
- - Add new mime types
-
-2.1.12 / 2016-09-18
-===================
-
- * deps: mime-db@~1.24.0
- - Add new mime types
- - Add `audio/mp3`
-
-2.1.11 / 2016-05-01
-===================
-
- * deps: mime-db@~1.23.0
- - Add new mime types
-
-2.1.10 / 2016-02-15
-===================
-
- * deps: mime-db@~1.22.0
- - Add new mime types
- - Fix extension of `application/dash+xml`
- - Update primary extension for `audio/mp4`
-
-2.1.9 / 2016-01-06
-==================
-
- * deps: mime-db@~1.21.0
- - Add new mime types
-
-2.1.8 / 2015-11-30
-==================
-
- * deps: mime-db@~1.20.0
- - Add new mime types
-
-2.1.7 / 2015-09-20
-==================
-
- * deps: mime-db@~1.19.0
- - Add new mime types
-
-2.1.6 / 2015-09-03
-==================
-
- * deps: mime-db@~1.18.0
- - Add new mime types
-
-2.1.5 / 2015-08-20
-==================
-
- * deps: mime-db@~1.17.0
- - Add new mime types
-
-2.1.4 / 2015-07-30
-==================
-
- * deps: mime-db@~1.16.0
- - Add new mime types
-
-2.1.3 / 2015-07-13
-==================
-
- * deps: mime-db@~1.15.0
- - Add new mime types
-
-2.1.2 / 2015-06-25
-==================
-
- * deps: mime-db@~1.14.0
- - Add new mime types
-
-2.1.1 / 2015-06-08
-==================
-
- * perf: fix deopt during mapping
-
-2.1.0 / 2015-06-07
-==================
-
- * Fix incorrectly treating extension-less file name as extension
- - i.e. `'path/to/json'` will no longer return `application/json`
- * Fix `.charset(type)` to accept parameters
- * Fix `.charset(type)` to match case-insensitive
- * Improve generation of extension to MIME mapping
- * Refactor internals for readability and no argument reassignment
- * Prefer `application/*` MIME types from the same source
- * Prefer any type over `application/octet-stream`
- * deps: mime-db@~1.13.0
- - Add nginx as a source
- - Add new mime types
-
-2.0.14 / 2015-06-06
-===================
-
- * deps: mime-db@~1.12.0
- - Add new mime types
-
-2.0.13 / 2015-05-31
-===================
-
- * deps: mime-db@~1.11.0
- - Add new mime types
-
-2.0.12 / 2015-05-19
-===================
-
- * deps: mime-db@~1.10.0
- - Add new mime types
-
-2.0.11 / 2015-05-05
-===================
-
- * deps: mime-db@~1.9.1
- - Add new mime types
-
-2.0.10 / 2015-03-13
-===================
-
- * deps: mime-db@~1.8.0
- - Add new mime types
-
-2.0.9 / 2015-02-09
-==================
-
- * deps: mime-db@~1.7.0
- - Add new mime types
- - Community extensions ownership transferred from `node-mime`
-
-2.0.8 / 2015-01-29
-==================
-
- * deps: mime-db@~1.6.0
- - Add new mime types
-
-2.0.7 / 2014-12-30
-==================
-
- * deps: mime-db@~1.5.0
- - Add new mime types
- - Fix various invalid MIME type entries
-
-2.0.6 / 2014-12-30
-==================
-
- * deps: mime-db@~1.4.0
- - Add new mime types
- - Fix various invalid MIME type entries
- - Remove example template MIME types
-
-2.0.5 / 2014-12-29
-==================
-
- * deps: mime-db@~1.3.1
- - Fix missing extensions
-
-2.0.4 / 2014-12-10
-==================
-
- * deps: mime-db@~1.3.0
- - Add new mime types
-
-2.0.3 / 2014-11-09
-==================
-
- * deps: mime-db@~1.2.0
- - Add new mime types
-
-2.0.2 / 2014-09-28
-==================
-
- * deps: mime-db@~1.1.0
- - Add new mime types
- - Update charsets
-
-2.0.1 / 2014-09-07
-==================
-
- * Support Node.js 0.6
-
-2.0.0 / 2014-09-02
-==================
-
- * Use `mime-db`
- * Remove `.define()`
-
-1.0.2 / 2014-08-04
-==================
-
- * Set charset=utf-8 for `text/javascript`
-
-1.0.1 / 2014-06-24
-==================
-
- * Add `text/jsx` type
-
-1.0.0 / 2014-05-12
-==================
-
- * Return `false` for unknown types
- * Set charset=utf-8 for `application/json`
-
-0.1.0 / 2014-05-02
-==================
-
- * Initial release
diff --git a/node_modules/mime-types/LICENSE b/node_modules/mime-types/LICENSE
deleted file mode 100644
index 0616607..0000000
--- a/node_modules/mime-types/LICENSE
+++ /dev/null
@@ -1,23 +0,0 @@
-(The MIT License)
-
-Copyright (c) 2014 Jonathan Ong
-Copyright (c) 2015 Douglas Christopher Wilson
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-'Software'), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/mime-types/README.md b/node_modules/mime-types/README.md
deleted file mode 100644
index 48d2fb4..0000000
--- a/node_modules/mime-types/README.md
+++ /dev/null
@@ -1,113 +0,0 @@
-# mime-types
-
-[![NPM Version][npm-version-image]][npm-url]
-[![NPM Downloads][npm-downloads-image]][npm-url]
-[![Node.js Version][node-version-image]][node-version-url]
-[![Build Status][ci-image]][ci-url]
-[![Test Coverage][coveralls-image]][coveralls-url]
-
-The ultimate javascript content-type utility.
-
-Similar to [the `mime@1.x` module](https://www.npmjs.com/package/mime), except:
-
-- __No fallbacks.__ Instead of naively returning the first available type,
- `mime-types` simply returns `false`, so do
- `var type = mime.lookup('unrecognized') || 'application/octet-stream'`.
-- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`.
-- No `.define()` functionality
-- Bug fixes for `.lookup(path)`
-
-Otherwise, the API is compatible with `mime` 1.x.
-
-## Install
-
-This is a [Node.js](https://nodejs.org/en/) module available through the
-[npm registry](https://www.npmjs.com/). Installation is done using the
-[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
-
-```sh
-$ npm install mime-types
-```
-
-## Adding Types
-
-All mime types are based on [mime-db](https://www.npmjs.com/package/mime-db),
-so open a PR there if you'd like to add mime types.
-
-## API
-
-```js
-var mime = require('mime-types')
-```
-
-All functions return `false` if input is invalid or not found.
-
-### mime.lookup(path)
-
-Lookup the content-type associated with a file.
-
-```js
-mime.lookup('json') // 'application/json'
-mime.lookup('.md') // 'text/markdown'
-mime.lookup('file.html') // 'text/html'
-mime.lookup('folder/file.js') // 'application/javascript'
-mime.lookup('folder/.htaccess') // false
-
-mime.lookup('cats') // false
-```
-
-### mime.contentType(type)
-
-Create a full content-type header given a content-type or extension.
-When given an extension, `mime.lookup` is used to get the matching
-content-type, otherwise the given content-type is used. Then if the
-content-type does not already have a `charset` parameter, `mime.charset`
-is used to get the default charset and add to the returned content-type.
-
-```js
-mime.contentType('markdown') // 'text/x-markdown; charset=utf-8'
-mime.contentType('file.json') // 'application/json; charset=utf-8'
-mime.contentType('text/html') // 'text/html; charset=utf-8'
-mime.contentType('text/html; charset=iso-8859-1') // 'text/html; charset=iso-8859-1'
-
-// from a full path
-mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8'
-```
-
-### mime.extension(type)
-
-Get the default extension for a content-type.
-
-```js
-mime.extension('application/octet-stream') // 'bin'
-```
-
-### mime.charset(type)
-
-Lookup the implied default charset of a content-type.
-
-```js
-mime.charset('text/markdown') // 'UTF-8'
-```
-
-### var type = mime.types[extension]
-
-A map of content-types by extension.
-
-### [extensions...] = mime.extensions[type]
-
-A map of extensions by content-type.
-
-## License
-
-[MIT](LICENSE)
-
-[ci-image]: https://badgen.net/github/checks/jshttp/mime-types/master?label=ci
-[ci-url]: https://github.com/jshttp/mime-types/actions/workflows/ci.yml
-[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-types/master
-[coveralls-url]: https://coveralls.io/r/jshttp/mime-types?branch=master
-[node-version-image]: https://badgen.net/npm/node/mime-types
-[node-version-url]: https://nodejs.org/en/download
-[npm-downloads-image]: https://badgen.net/npm/dm/mime-types
-[npm-url]: https://npmjs.org/package/mime-types
-[npm-version-image]: https://badgen.net/npm/v/mime-types
diff --git a/node_modules/mime-types/index.js b/node_modules/mime-types/index.js
deleted file mode 100644
index b9f34d5..0000000
--- a/node_modules/mime-types/index.js
+++ /dev/null
@@ -1,188 +0,0 @@
-/*!
- * mime-types
- * Copyright(c) 2014 Jonathan Ong
- * Copyright(c) 2015 Douglas Christopher Wilson
- * MIT Licensed
- */
-
-'use strict'
-
-/**
- * Module dependencies.
- * @private
- */
-
-var db = require('mime-db')
-var extname = require('path').extname
-
-/**
- * Module variables.
- * @private
- */
-
-var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/
-var TEXT_TYPE_REGEXP = /^text\//i
-
-/**
- * Module exports.
- * @public
- */
-
-exports.charset = charset
-exports.charsets = { lookup: charset }
-exports.contentType = contentType
-exports.extension = extension
-exports.extensions = Object.create(null)
-exports.lookup = lookup
-exports.types = Object.create(null)
-
-// Populate the extensions/types maps
-populateMaps(exports.extensions, exports.types)
-
-/**
- * Get the default charset for a MIME type.
- *
- * @param {string} type
- * @return {boolean|string}
- */
-
-function charset (type) {
- if (!type || typeof type !== 'string') {
- return false
- }
-
- // TODO: use media-typer
- var match = EXTRACT_TYPE_REGEXP.exec(type)
- var mime = match && db[match[1].toLowerCase()]
-
- if (mime && mime.charset) {
- return mime.charset
- }
-
- // default text/* to utf-8
- if (match && TEXT_TYPE_REGEXP.test(match[1])) {
- return 'UTF-8'
- }
-
- return false
-}
-
-/**
- * Create a full Content-Type header given a MIME type or extension.
- *
- * @param {string} str
- * @return {boolean|string}
- */
-
-function contentType (str) {
- // TODO: should this even be in this module?
- if (!str || typeof str !== 'string') {
- return false
- }
-
- var mime = str.indexOf('/') === -1
- ? exports.lookup(str)
- : str
-
- if (!mime) {
- return false
- }
-
- // TODO: use content-type or other module
- if (mime.indexOf('charset') === -1) {
- var charset = exports.charset(mime)
- if (charset) mime += '; charset=' + charset.toLowerCase()
- }
-
- return mime
-}
-
-/**
- * Get the default extension for a MIME type.
- *
- * @param {string} type
- * @return {boolean|string}
- */
-
-function extension (type) {
- if (!type || typeof type !== 'string') {
- return false
- }
-
- // TODO: use media-typer
- var match = EXTRACT_TYPE_REGEXP.exec(type)
-
- // get extensions
- var exts = match && exports.extensions[match[1].toLowerCase()]
-
- if (!exts || !exts.length) {
- return false
- }
-
- return exts[0]
-}
-
-/**
- * Lookup the MIME type for a file path/extension.
- *
- * @param {string} path
- * @return {boolean|string}
- */
-
-function lookup (path) {
- if (!path || typeof path !== 'string') {
- return false
- }
-
- // get the extension ("ext" or ".ext" or full path)
- var extension = extname('x.' + path)
- .toLowerCase()
- .substr(1)
-
- if (!extension) {
- return false
- }
-
- return exports.types[extension] || false
-}
-
-/**
- * Populate the extensions and types maps.
- * @private
- */
-
-function populateMaps (extensions, types) {
- // source preference (least -> most)
- var preference = ['nginx', 'apache', undefined, 'iana']
-
- Object.keys(db).forEach(function forEachMimeType (type) {
- var mime = db[type]
- var exts = mime.extensions
-
- if (!exts || !exts.length) {
- return
- }
-
- // mime -> extensions
- extensions[type] = exts
-
- // extension -> mime
- for (var i = 0; i < exts.length; i++) {
- var extension = exts[i]
-
- if (types[extension]) {
- var from = preference.indexOf(db[types[extension]].source)
- var to = preference.indexOf(mime.source)
-
- if (types[extension] !== 'application/octet-stream' &&
- (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {
- // skip the remapping
- continue
- }
- }
-
- // set the extension -> mime
- types[extension] = type
- }
- })
-}
diff --git a/node_modules/mime-types/package.json b/node_modules/mime-types/package.json
deleted file mode 100644
index bbef696..0000000
--- a/node_modules/mime-types/package.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "name": "mime-types",
- "description": "The ultimate javascript content-type utility.",
- "version": "2.1.35",
- "contributors": [
- "Douglas Christopher Wilson ",
- "Jeremiah Senkpiel (https://searchbeam.jit.su)",
- "Jonathan Ong (http://jongleberry.com)"
- ],
- "license": "MIT",
- "keywords": [
- "mime",
- "types"
- ],
- "repository": "jshttp/mime-types",
- "dependencies": {
- "mime-db": "1.52.0"
- },
- "devDependencies": {
- "eslint": "7.32.0",
- "eslint-config-standard": "14.1.1",
- "eslint-plugin-import": "2.25.4",
- "eslint-plugin-markdown": "2.2.1",
- "eslint-plugin-node": "11.1.0",
- "eslint-plugin-promise": "5.2.0",
- "eslint-plugin-standard": "4.1.0",
- "mocha": "9.2.2",
- "nyc": "15.1.0"
- },
- "files": [
- "HISTORY.md",
- "LICENSE",
- "index.js"
- ],
- "engines": {
- "node": ">= 0.6"
- },
- "scripts": {
- "lint": "eslint .",
- "test": "mocha --reporter spec test/test.js",
- "test-ci": "nyc --reporter=lcov --reporter=text npm test",
- "test-cov": "nyc --reporter=html --reporter=text npm test"
- }
-}
diff --git a/node_modules/mime/CHANGELOG.md b/node_modules/mime/CHANGELOG.md
deleted file mode 100644
index cdf9be5..0000000
--- a/node_modules/mime/CHANGELOG.md
+++ /dev/null
@@ -1,312 +0,0 @@
-# Changelog
-
-All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
-
-## [3.0.0](https://github.com/broofa/mime/compare/v2.6.0...v3.0.0) (2021-11-03)
-
-
-### ⚠ BREAKING CHANGES
-
-* drop support for node < 10.x
-
-### Bug Fixes
-
-* skypack.dev for direct browser import, fixes [#263](https://github.com/broofa/mime/issues/263) ([41db4c0](https://github.com/broofa/mime/commit/41db4c042ccf50ea7baf3d2160ea37dcca37998d))
-
-
-### update
-
-* drop support for node < 10.x ([8857363](https://github.com/broofa/mime/commit/8857363ae0446ed0229b17291cf4483cf801f0d0))
-
-## [2.6.0](https://github.com/broofa/mime/compare/v2.5.2...v2.6.0) (2021-11-02)
-
-
-### Features
-
-* mime-db@1.50.0 ([cef0cc4](https://github.com/broofa/mime/commit/cef0cc484ff6d05ff1e12b54ca3e8b856fbc14d8))
-
-### [2.5.2](https://github.com/broofa/mime/compare/v2.5.0...v2.5.2) (2021-02-17)
-
-
-### Bug Fixes
-
-* update to mime-db@1.46.0, fixes [#253](https://github.com/broofa/mime/issues/253) ([f10e6aa](https://github.com/broofa/mime/commit/f10e6aa62e1356de7e2491d7fb4374c8dac65800))
-
-## [2.5.0](https://github.com/broofa/mime/compare/v2.4.7...v2.5.0) (2021-01-16)
-
-
-### Features
-
-* improved CLI ([#244](https://github.com/broofa/mime/issues/244)) ([c8a8356](https://github.com/broofa/mime/commit/c8a8356e3b27f3ef46b64b89b428fdb547b14d5f))
-
-### [2.4.7](https://github.com/broofa/mime/compare/v2.4.6...v2.4.7) (2020-12-16)
-
-
-### Bug Fixes
-
-* update to latest mime-db ([43b09ef](https://github.com/broofa/mime/commit/43b09eff0233eacc449af2b1f99a19ba9e104a44))
-
-### [2.4.6](https://github.com/broofa/mime/compare/v2.4.5...v2.4.6) (2020-05-27)
-
-
-### Bug Fixes
-
-* add cli.js to package.json files ([#237](https://github.com/broofa/mime/issues/237)) ([6c070bc](https://github.com/broofa/mime/commit/6c070bc298fa12a48e2ed126fbb9de641a1e7ebc))
-
-### [2.4.5](https://github.com/broofa/mime/compare/v2.4.4...v2.4.5) (2020-05-01)
-
-
-### Bug Fixes
-
-* fix [#236](https://github.com/broofa/mime/issues/236) ([7f4ecd0](https://github.com/broofa/mime/commit/7f4ecd0d850ed22c9e3bfda2c11fc74e4dde12a7))
-* update to latest mime-db ([c5cb3f2](https://github.com/broofa/mime/commit/c5cb3f2ab8b07642a066efbde1142af1b90c927b))
-
-### [2.4.4](https://github.com/broofa/mime/compare/v2.4.3...v2.4.4) (2019-06-07)
-
-
-
-### [2.4.3](https://github.com/broofa/mime/compare/v2.4.2...v2.4.3) (2019-05-15)
-
-
-
-### [2.4.2](https://github.com/broofa/mime/compare/v2.4.1...v2.4.2) (2019-04-07)
-
-
-### Bug Fixes
-
-* don't use arrow function introduced in 2.4.1 ([2e00b5c](https://github.com/broofa/mime/commit/2e00b5c))
-
-
-
-### [2.4.1](https://github.com/broofa/mime/compare/v2.4.0...v2.4.1) (2019-04-03)
-
-
-### Bug Fixes
-
-* update MDN and mime-db types ([3e567a9](https://github.com/broofa/mime/commit/3e567a9))
-
-
-
-# [2.4.0](https://github.com/broofa/mime/compare/v2.3.1...v2.4.0) (2018-11-26)
-
-
-### Features
-
-* Bind exported methods ([9d2a7b8](https://github.com/broofa/mime/commit/9d2a7b8))
-* update to mime-db@1.37.0 ([49e6e41](https://github.com/broofa/mime/commit/49e6e41))
-
-
-
-### [2.3.1](https://github.com/broofa/mime/compare/v2.3.0...v2.3.1) (2018-04-11)
-
-
-### Bug Fixes
-
-* fix [#198](https://github.com/broofa/mime/issues/198) ([25ca180](https://github.com/broofa/mime/commit/25ca180))
-
-
-
-# [2.3.0](https://github.com/broofa/mime/compare/v2.2.2...v2.3.0) (2018-04-11)
-
-
-### Bug Fixes
-
-* fix [#192](https://github.com/broofa/mime/issues/192) ([5c35df6](https://github.com/broofa/mime/commit/5c35df6))
-
-
-### Features
-
-* add travis-ci testing ([d64160f](https://github.com/broofa/mime/commit/d64160f))
-
-
-
-### [2.2.2](https://github.com/broofa/mime/compare/v2.2.1...v2.2.2) (2018-03-30)
-
-
-### Bug Fixes
-
-* update types files to mime-db@1.32.0 ([85aac16](https://github.com/broofa/mime/commit/85aac16))
-
-
-### [2.2.1](https://github.com/broofa/mime/compare/v2.2.0...v2.2.1) (2018-03-30)
-
-
-### Bug Fixes
-
-* Retain type->extension mappings for non-default types. Fixes [#180](https://github.com/broofa/mime/issues/180) ([b5c83fb](https://github.com/broofa/mime/commit/b5c83fb))
-
-
-
-# [2.2.0](https://github.com/broofa/mime/compare/v2.1.0...v2.2.0) (2018-01-04)
-
-
-### Features
-
-* Retain type->extension mappings for non-default types. Fixes [#180](https://github.com/broofa/mime/issues/180) ([10f82ac](https://github.com/broofa/mime/commit/10f82ac))
-
-
-
-# [2.1.0](https://github.com/broofa/mime/compare/v2.0.5...v2.1.0) (2017-12-22)
-
-
-### Features
-
-* Upgrade to mime-db@1.32.0. Fixes [#185](https://github.com/broofa/mime/issues/185) ([3f775ba](https://github.com/broofa/mime/commit/3f775ba))
-
-
-
-### [2.0.5](https://github.com/broofa/mime/compare/v2.0.1...v2.0.5) (2017-12-22)
-
-
-### Bug Fixes
-
-* ES5 support (back to node v0.4) ([f14ccb6](https://github.com/broofa/mime/commit/f14ccb6))
-
-
-
-# Changelog
-
-### v2.0.4 (24/11/2017)
-- [**closed**] Switch to mime-score module for resolving extension contention issues. [#182](https://github.com/broofa/mime/issues/182)
-- [**closed**] Update mime-db to 1.31.0 in v1.x branch [#181](https://github.com/broofa/mime/issues/181)
-
----
-
-## v1.5.0 (22/11/2017)
-- [**closed**] need ES5 version ready in npm package [#179](https://github.com/broofa/mime/issues/179)
-- [**closed**] mime-db no trace of iWork - pages / numbers / etc. [#178](https://github.com/broofa/mime/issues/178)
-- [**closed**] How it works in brownser ? [#176](https://github.com/broofa/mime/issues/176)
-- [**closed**] Missing `./Mime` [#175](https://github.com/broofa/mime/issues/175)
-- [**closed**] Vulnerable Regular Expression [#167](https://github.com/broofa/mime/issues/167)
-
----
-
-### v2.0.3 (25/09/2017)
-*No changelog for this release.*
-
----
-
-### v1.4.1 (25/09/2017)
-- [**closed**] Issue when bundling with webpack [#172](https://github.com/broofa/mime/issues/172)
-
----
-
-### v2.0.2 (15/09/2017)
-- [**V2**] fs.readFileSync is not a function [#165](https://github.com/broofa/mime/issues/165)
-- [**closed**] The extension for video/quicktime should map to .mov, not .qt [#164](https://github.com/broofa/mime/issues/164)
-- [**V2**] [v2 Feedback request] Mime class API [#163](https://github.com/broofa/mime/issues/163)
-- [**V2**] [v2 Feedback request] Resolving conflicts over extensions [#162](https://github.com/broofa/mime/issues/162)
-- [**V2**] Allow callers to load module with official, full, or no defined types. [#161](https://github.com/broofa/mime/issues/161)
-- [**V2**] Use "facets" to resolve extension conflicts [#160](https://github.com/broofa/mime/issues/160)
-- [**V2**] Remove fs and path dependencies [#152](https://github.com/broofa/mime/issues/152)
-- [**V2**] Default content-type should not be application/octet-stream [#139](https://github.com/broofa/mime/issues/139)
-- [**V2**] reset mime-types [#124](https://github.com/broofa/mime/issues/124)
-- [**V2**] Extensionless paths should return null or false [#113](https://github.com/broofa/mime/issues/113)
-
----
-
-### v2.0.1 (14/09/2017)
-- [**closed**] Changelog for v2.0 does not mention breaking changes [#171](https://github.com/broofa/mime/issues/171)
-- [**closed**] MIME breaking with 'class' declaration as it is without 'use strict mode' [#170](https://github.com/broofa/mime/issues/170)
-
----
-
-## v2.0.0 (12/09/2017)
-- [**closed**] woff and woff2 [#168](https://github.com/broofa/mime/issues/168)
-
----
-
-## v1.4.0 (28/08/2017)
-- [**closed**] support for ac3 voc files [#159](https://github.com/broofa/mime/issues/159)
-- [**closed**] Help understanding change from application/xml to text/xml [#158](https://github.com/broofa/mime/issues/158)
-- [**closed**] no longer able to override mimetype [#157](https://github.com/broofa/mime/issues/157)
-- [**closed**] application/vnd.adobe.photoshop [#147](https://github.com/broofa/mime/issues/147)
-- [**closed**] Directories should appear as something other than application/octet-stream [#135](https://github.com/broofa/mime/issues/135)
-- [**closed**] requested features [#131](https://github.com/broofa/mime/issues/131)
-- [**closed**] Make types.json loading optional? [#129](https://github.com/broofa/mime/issues/129)
-- [**closed**] Cannot find module './types.json' [#120](https://github.com/broofa/mime/issues/120)
-- [**V2**] .wav files show up as "audio/x-wav" instead of "audio/x-wave" [#118](https://github.com/broofa/mime/issues/118)
-- [**closed**] Don't be a pain in the ass for node community [#108](https://github.com/broofa/mime/issues/108)
-- [**closed**] don't make default_type global [#78](https://github.com/broofa/mime/issues/78)
-- [**closed**] mime.extension() fails if the content-type is parameterized [#74](https://github.com/broofa/mime/issues/74)
-
----
-
-### v1.3.6 (11/05/2017)
-- [**closed**] .md should be text/markdown as of March 2016 [#154](https://github.com/broofa/mime/issues/154)
-- [**closed**] Error while installing mime [#153](https://github.com/broofa/mime/issues/153)
-- [**closed**] application/manifest+json [#149](https://github.com/broofa/mime/issues/149)
-- [**closed**] Dynamic adaptive streaming over HTTP (DASH) file extension typo [#141](https://github.com/broofa/mime/issues/141)
-- [**closed**] charsets image/png undefined [#140](https://github.com/broofa/mime/issues/140)
-- [**closed**] Mime-db dependency out of date [#130](https://github.com/broofa/mime/issues/130)
-- [**closed**] how to support plist? [#126](https://github.com/broofa/mime/issues/126)
-- [**closed**] how does .types file format look like? [#123](https://github.com/broofa/mime/issues/123)
-- [**closed**] Feature: support for expanding MIME patterns [#121](https://github.com/broofa/mime/issues/121)
-- [**closed**] DEBUG_MIME doesn't work [#117](https://github.com/broofa/mime/issues/117)
-
----
-
-### v1.3.4 (06/02/2015)
-*No changelog for this release.*
-
----
-
-### v1.3.3 (06/02/2015)
-*No changelog for this release.*
-
----
-
-### v1.3.1 (05/02/2015)
-- [**closed**] Consider adding support for Handlebars .hbs file ending [#111](https://github.com/broofa/mime/issues/111)
-- [**closed**] Consider adding support for hjson. [#110](https://github.com/broofa/mime/issues/110)
-- [**closed**] Add mime type for Opus audio files [#94](https://github.com/broofa/mime/issues/94)
-- [**closed**] Consider making the `Requesting New Types` information more visible [#77](https://github.com/broofa/mime/issues/77)
-
----
-
-## v1.3.0 (05/02/2015)
-- [**closed**] Add common name? [#114](https://github.com/broofa/mime/issues/114)
-- [**closed**] application/x-yaml [#104](https://github.com/broofa/mime/issues/104)
-- [**closed**] Add mime type for WOFF file format 2.0 [#102](https://github.com/broofa/mime/issues/102)
-- [**closed**] application/x-msi for .msi [#99](https://github.com/broofa/mime/issues/99)
-- [**closed**] Add mimetype for gettext translation files [#98](https://github.com/broofa/mime/issues/98)
-- [**closed**] collaborators [#88](https://github.com/broofa/mime/issues/88)
-- [**closed**] getting errot in installation of mime module...any1 can help? [#87](https://github.com/broofa/mime/issues/87)
-- [**closed**] should application/json's charset be utf8? [#86](https://github.com/broofa/mime/issues/86)
-- [**closed**] Add "license" and "licenses" to package.json [#81](https://github.com/broofa/mime/issues/81)
-- [**closed**] lookup with extension-less file on Windows returns wrong type [#68](https://github.com/broofa/mime/issues/68)
-
----
-
-### v1.2.11 (15/08/2013)
-- [**closed**] Update mime.types [#65](https://github.com/broofa/mime/issues/65)
-- [**closed**] Publish a new version [#63](https://github.com/broofa/mime/issues/63)
-- [**closed**] README should state upfront that "application/octet-stream" is default for unknown extension [#55](https://github.com/broofa/mime/issues/55)
-- [**closed**] Suggested improvement to the charset API [#52](https://github.com/broofa/mime/issues/52)
-
----
-
-### v1.2.10 (25/07/2013)
-- [**closed**] Mime type for woff files should be application/font-woff and not application/x-font-woff [#62](https://github.com/broofa/mime/issues/62)
-- [**closed**] node.types in conflict with mime.types [#51](https://github.com/broofa/mime/issues/51)
-
----
-
-### v1.2.9 (17/01/2013)
-- [**closed**] Please update "mime" NPM [#49](https://github.com/broofa/mime/issues/49)
-- [**closed**] Please add semicolon [#46](https://github.com/broofa/mime/issues/46)
-- [**closed**] parse full mime types [#43](https://github.com/broofa/mime/issues/43)
-
----
-
-### v1.2.8 (10/01/2013)
-- [**closed**] /js directory mime is application/javascript. Is it correct? [#47](https://github.com/broofa/mime/issues/47)
-- [**closed**] Add mime types for lua code. [#45](https://github.com/broofa/mime/issues/45)
-
----
-
-### v1.2.7 (19/10/2012)
-- [**closed**] cannot install 1.2.7 via npm [#41](https://github.com/broofa/mime/issues/41)
-- [**closed**] Transfer ownership to @broofa [#36](https://github.com/broofa/mime/issues/36)
-- [**closed**] it's wrong to set charset to UTF-8 for text [#30](https://github.com/broofa/mime/issues/30)
-- [**closed**] Allow multiple instances of MIME types container [#27](https://github.com/broofa/mime/issues/27)
diff --git a/node_modules/mime/LICENSE b/node_modules/mime/LICENSE
deleted file mode 100644
index d3f46f7..0000000
--- a/node_modules/mime/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2010 Benjamin Thomas, Robert Kieffer
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/node_modules/mime/README.md b/node_modules/mime/README.md
deleted file mode 100644
index fc816cb..0000000
--- a/node_modules/mime/README.md
+++ /dev/null
@@ -1,178 +0,0 @@
-
-# Mime
-
-A comprehensive, compact MIME type module.
-
-[](https://travis-ci.org/broofa/mime)
-
-## Install
-
-### NPM
-```
-npm install mime
-```
-
-### Browser
-
-It is recommended that you use a bundler such as
-[webpack](https://webpack.github.io/) or [browserify](http://browserify.org/) to
-package your code. However, browser-ready versions are available via
-skypack.dev as follows:
-```
-// Full version
-
-```
-
-```
-// "lite" version
-
-```
-
-## Quick Start
-
-For the full version (800+ MIME types, 1,000+ extensions):
-
-```javascript
-const mime = require('mime');
-
-mime.getType('txt'); // ⇨ 'text/plain'
-mime.getExtension('text/plain'); // ⇨ 'txt'
-```
-
-See [Mime API](#mime-api) below for API details.
-
-## Lite Version
-
-The "lite" version of this module omits vendor-specific (`*/vnd.*`) and
-experimental (`*/x-*`) types. It weighs in at ~2.5KB, compared to 8KB for the
-full version. To load the lite version:
-
-```javascript
-const mime = require('mime/lite');
-```
-
-## Mime .vs. mime-types .vs. mime-db modules
-
-For those of you wondering about the difference between these [popular] NPM modules,
-here's a brief rundown ...
-
-[`mime-db`](https://github.com/jshttp/mime-db) is "the source of
-truth" for MIME type information. It is not an API. Rather, it is a canonical
-dataset of mime type definitions pulled from IANA, Apache, NGINX, and custom mappings
-submitted by the Node.js community.
-
-[`mime-types`](https://github.com/jshttp/mime-types) is a thin
-wrapper around mime-db that provides an API drop-in compatible(ish) with `mime @ < v1.3.6` API.
-
-`mime` is, as of v2, a self-contained module bundled with a pre-optimized version
-of the `mime-db` dataset. It provides a simplified API with the following characteristics:
-
-* Intelligently resolved type conflicts (See [mime-score](https://github.com/broofa/mime-score) for details)
-* Method naming consistent with industry best-practices
-* Compact footprint. E.g. The minified+compressed sizes of the various modules:
-
-Module | Size
---- | ---
-`mime-db` | 18 KB
-`mime-types` | same as mime-db
-`mime` | 8 KB
-`mime/lite` | 2 KB
-
-## Mime API
-
-Both `require('mime')` and `require('mime/lite')` return instances of the MIME
-class, documented below.
-
-Note: Inputs to this API are case-insensitive. Outputs (returned values) will
-be lowercase.
-
-### new Mime(typeMap, ... more maps)
-
-Most users of this module will not need to create Mime instances directly.
-However if you would like to create custom mappings, you may do so as follows
-...
-
-```javascript
-// Require Mime class
-const Mime = require('mime/Mime');
-
-// Define mime type -> extensions map
-const typeMap = {
- 'text/abc': ['abc', 'alpha', 'bet'],
- 'text/def': ['leppard']
-};
-
-// Create and use Mime instance
-const myMime = new Mime(typeMap);
-myMime.getType('abc'); // ⇨ 'text/abc'
-myMime.getExtension('text/def'); // ⇨ 'leppard'
-```
-
-If more than one map argument is provided, each map is `define()`ed (see below), in order.
-
-### mime.getType(pathOrExtension)
-
-Get mime type for the given path or extension. E.g.
-
-```javascript
-mime.getType('js'); // ⇨ 'application/javascript'
-mime.getType('json'); // ⇨ 'application/json'
-
-mime.getType('txt'); // ⇨ 'text/plain'
-mime.getType('dir/text.txt'); // ⇨ 'text/plain'
-mime.getType('dir\\text.txt'); // ⇨ 'text/plain'
-mime.getType('.text.txt'); // ⇨ 'text/plain'
-mime.getType('.txt'); // ⇨ 'text/plain'
-```
-
-`null` is returned in cases where an extension is not detected or recognized
-
-```javascript
-mime.getType('foo/txt'); // ⇨ null
-mime.getType('bogus_type'); // ⇨ null
-```
-
-### mime.getExtension(type)
-Get extension for the given mime type. Charset options (often included in
-Content-Type headers) are ignored.
-
-```javascript
-mime.getExtension('text/plain'); // ⇨ 'txt'
-mime.getExtension('application/json'); // ⇨ 'json'
-mime.getExtension('text/html; charset=utf8'); // ⇨ 'html'
-```
-
-### mime.define(typeMap[, force = false])
-
-Define [more] type mappings.
-
-`typeMap` is a map of type -> extensions, as documented in `new Mime`, above.
-
-By default this method will throw an error if you try to map a type to an
-extension that is already assigned to another type. Passing `true` for the
-`force` argument will suppress this behavior (overriding any previous mapping).
-
-```javascript
-mime.define({'text/x-abc': ['abc', 'abcd']});
-
-mime.getType('abcd'); // ⇨ 'text/x-abc'
-mime.getExtension('text/x-abc') // ⇨ 'abc'
-```
-
-## Command Line
-
- mime [path_or_extension]
-
-E.g.
-
- > mime scripts/jquery.js
- application/javascript
-
-----
-Markdown generated from [src/README_js.md](src/README_js.md) by [](https://github.com/broofa/runmd)
\ No newline at end of file
diff --git a/node_modules/mime/cli.js b/node_modules/mime/cli.js
deleted file mode 100644
index ab70a49..0000000
--- a/node_modules/mime/cli.js
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/env node
-
-'use strict';
-
-process.title = 'mime';
-let mime = require('.');
-let pkg = require('./package.json');
-let args = process.argv.splice(2);
-
-if (args.includes('--version') || args.includes('-v') || args.includes('--v')) {
- console.log(pkg.version);
- process.exit(0);
-} else if (args.includes('--name') || args.includes('-n') || args.includes('--n')) {
- console.log(pkg.name);
- process.exit(0);
-} else if (args.includes('--help') || args.includes('-h') || args.includes('--h')) {
- console.log(pkg.name + ' - ' + pkg.description + '\n');
- console.log(`Usage:
-
- mime [flags] [path_or_extension]
-
- Flags:
- --help, -h Show this message
- --version, -v Display the version
- --name, -n Print the name of the program
-
- Note: the command will exit after it executes if a command is specified
- The path_or_extension is the path to the file or the extension of the file.
-
- Examples:
- mime --help
- mime --version
- mime --name
- mime -v
- mime src/log.js
- mime new.py
- mime foo.sh
- `);
- process.exit(0);
-}
-
-let file = args[0];
-let type = mime.getType(file);
-
-process.stdout.write(type + '\n');
-
diff --git a/node_modules/mime/mime.js b/node_modules/mime/mime.js
deleted file mode 100644
index 969a66e..0000000
--- a/node_modules/mime/mime.js
+++ /dev/null
@@ -1,97 +0,0 @@
-'use strict';
-
-/**
- * @param typeMap [Object] Map of MIME type -> Array[extensions]
- * @param ...
- */
-function Mime() {
- this._types = Object.create(null);
- this._extensions = Object.create(null);
-
- for (let i = 0; i < arguments.length; i++) {
- this.define(arguments[i]);
- }
-
- this.define = this.define.bind(this);
- this.getType = this.getType.bind(this);
- this.getExtension = this.getExtension.bind(this);
-}
-
-/**
- * Define mimetype -> extension mappings. Each key is a mime-type that maps
- * to an array of extensions associated with the type. The first extension is
- * used as the default extension for the type.
- *
- * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']});
- *
- * If a type declares an extension that has already been defined, an error will
- * be thrown. To suppress this error and force the extension to be associated
- * with the new type, pass `force`=true. Alternatively, you may prefix the
- * extension with "*" to map the type to extension, without mapping the
- * extension to the type.
- *
- * e.g. mime.define({'audio/wav', ['wav']}, {'audio/x-wav', ['*wav']});
- *
- *
- * @param map (Object) type definitions
- * @param force (Boolean) if true, force overriding of existing definitions
- */
-Mime.prototype.define = function(typeMap, force) {
- for (let type in typeMap) {
- let extensions = typeMap[type].map(function(t) {
- return t.toLowerCase();
- });
- type = type.toLowerCase();
-
- for (let i = 0; i < extensions.length; i++) {
- const ext = extensions[i];
-
- // '*' prefix = not the preferred type for this extension. So fixup the
- // extension, and skip it.
- if (ext[0] === '*') {
- continue;
- }
-
- if (!force && (ext in this._types)) {
- throw new Error(
- 'Attempt to change mapping for "' + ext +
- '" extension from "' + this._types[ext] + '" to "' + type +
- '". Pass `force=true` to allow this, otherwise remove "' + ext +
- '" from the list of extensions for "' + type + '".'
- );
- }
-
- this._types[ext] = type;
- }
-
- // Use first extension as default
- if (force || !this._extensions[type]) {
- const ext = extensions[0];
- this._extensions[type] = (ext[0] !== '*') ? ext : ext.substr(1);
- }
- }
-};
-
-/**
- * Lookup a mime type based on extension
- */
-Mime.prototype.getType = function(path) {
- path = String(path);
- let last = path.replace(/^.*[/\\]/, '').toLowerCase();
- let ext = last.replace(/^.*\./, '').toLowerCase();
-
- let hasPath = last.length < path.length;
- let hasDot = ext.length < last.length - 1;
-
- return (hasDot || !hasPath) && this._types[ext] || null;
-};
-
-/**
- * Return file extension associated with a mime type
- */
-Mime.prototype.getExtension = function(type) {
- type = /^\s*([^;\s]*)/.test(type) && RegExp.$1;
- return type && this._extensions[type.toLowerCase()] || null;
-};
-
-module.exports = Mime;
diff --git a/node_modules/mime/package.json b/node_modules/mime/package.json
deleted file mode 100644
index 84f5132..0000000
--- a/node_modules/mime/package.json
+++ /dev/null
@@ -1,52 +0,0 @@
-{
- "author": {
- "name": "Robert Kieffer",
- "url": "http://github.com/broofa",
- "email": "robert@broofa.com"
- },
- "engines": {
- "node": ">=10.0.0"
- },
- "bin": {
- "mime": "cli.js"
- },
- "contributors": [],
- "description": "A comprehensive library for mime-type mapping",
- "license": "MIT",
- "dependencies": {},
- "devDependencies": {
- "benchmark": "*",
- "chalk": "4.1.2",
- "eslint": "8.1.0",
- "mime-db": "1.50.0",
- "mime-score": "1.2.0",
- "mime-types": "2.1.33",
- "mocha": "9.1.3",
- "runmd": "*",
- "standard-version": "9.3.2"
- },
- "files": [
- "index.js",
- "lite.js",
- "Mime.js",
- "cli.js",
- "/types"
- ],
- "scripts": {
- "prepare": "node src/build.js && runmd --output README.md src/README_js.md",
- "release": "standard-version",
- "benchmark": "node src/benchmark.js",
- "md": "runmd --watch --output README.md src/README_js.md",
- "test": "mocha src/test.js"
- },
- "keywords": [
- "util",
- "mime"
- ],
- "name": "mime",
- "repository": {
- "url": "https://github.com/broofa/mime",
- "type": "git"
- },
- "version": "3.0.0"
-}
diff --git a/node_modules/mkdirp-classic/LICENSE b/node_modules/mkdirp-classic/LICENSE
deleted file mode 100644
index f6b3a0d..0000000
--- a/node_modules/mkdirp-classic/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2020 James Halliday (mail@substack.net) and Mathias Buus
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/node_modules/mkdirp-classic/README.md b/node_modules/mkdirp-classic/README.md
deleted file mode 100644
index be5ac93..0000000
--- a/node_modules/mkdirp-classic/README.md
+++ /dev/null
@@ -1,18 +0,0 @@
-# mkdirp-classic
-
-Just a non-deprecated mirror of [mkdirp 0.5.2](https://github.com/substack/node-mkdirp/tree/0.5.1)
-for use in modules where we depend on the non promise interface.
-
-```
-npm install mkdirp-classic
-```
-
-## Usage
-
-``` js
-// See the above link
-```
-
-## License
-
-MIT
diff --git a/node_modules/mkdirp-classic/index.js b/node_modules/mkdirp-classic/index.js
deleted file mode 100644
index 6ce241b..0000000
--- a/node_modules/mkdirp-classic/index.js
+++ /dev/null
@@ -1,98 +0,0 @@
-var path = require('path');
-var fs = require('fs');
-var _0777 = parseInt('0777', 8);
-
-module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
-
-function mkdirP (p, opts, f, made) {
- if (typeof opts === 'function') {
- f = opts;
- opts = {};
- }
- else if (!opts || typeof opts !== 'object') {
- opts = { mode: opts };
- }
-
- var mode = opts.mode;
- var xfs = opts.fs || fs;
-
- if (mode === undefined) {
- mode = _0777 & (~process.umask());
- }
- if (!made) made = null;
-
- var cb = f || function () {};
- p = path.resolve(p);
-
- xfs.mkdir(p, mode, function (er) {
- if (!er) {
- made = made || p;
- return cb(null, made);
- }
- switch (er.code) {
- case 'ENOENT':
- mkdirP(path.dirname(p), opts, function (er, made) {
- if (er) cb(er, made);
- else mkdirP(p, opts, cb, made);
- });
- break;
-
- // In the case of any other error, just see if there's a dir
- // there already. If so, then hooray! If not, then something
- // is borked.
- default:
- xfs.stat(p, function (er2, stat) {
- // if the stat fails, then that's super weird.
- // let the original error be the failure reason.
- if (er2 || !stat.isDirectory()) cb(er, made)
- else cb(null, made);
- });
- break;
- }
- });
-}
-
-mkdirP.sync = function sync (p, opts, made) {
- if (!opts || typeof opts !== 'object') {
- opts = { mode: opts };
- }
-
- var mode = opts.mode;
- var xfs = opts.fs || fs;
-
- if (mode === undefined) {
- mode = _0777 & (~process.umask());
- }
- if (!made) made = null;
-
- p = path.resolve(p);
-
- try {
- xfs.mkdirSync(p, mode);
- made = made || p;
- }
- catch (err0) {
- switch (err0.code) {
- case 'ENOENT' :
- made = sync(path.dirname(p), opts, made);
- sync(p, opts, made);
- break;
-
- // In the case of any other error, just see if there's a dir
- // there already. If so, then hooray! If not, then something
- // is borked.
- default:
- var stat;
- try {
- stat = xfs.statSync(p);
- }
- catch (err1) {
- throw err0;
- }
- if (!stat.isDirectory()) throw err0;
- break;
- }
- }
-
- return made;
-};
diff --git a/node_modules/mkdirp-classic/package.json b/node_modules/mkdirp-classic/package.json
deleted file mode 100644
index c8b5407..0000000
--- a/node_modules/mkdirp-classic/package.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "name": "mkdirp-classic",
- "version": "0.5.3",
- "description": "Mirror of mkdirp 0.5.2",
- "main": "index.js",
- "dependencies": {},
- "devDependencies": {},
- "repository": {
- "type": "git",
- "url": "https://github.com/mafintosh/mkdirp-classic.git"
- },
- "author": "Mathias Buus (@mafintosh)",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/mafintosh/mkdirp-classic/issues"
- },
- "homepage": "https://github.com/mafintosh/mkdirp-classic"
-}
diff --git a/node_modules/ms/index.js b/node_modules/ms/index.js
deleted file mode 100644
index ea734fb..0000000
--- a/node_modules/ms/index.js
+++ /dev/null
@@ -1,162 +0,0 @@
-/**
- * Helpers.
- */
-
-var s = 1000;
-var m = s * 60;
-var h = m * 60;
-var d = h * 24;
-var w = d * 7;
-var y = d * 365.25;
-
-/**
- * Parse or format the given `val`.
- *
- * Options:
- *
- * - `long` verbose formatting [false]
- *
- * @param {String|Number} val
- * @param {Object} [options]
- * @throws {Error} throw an error if val is not a non-empty string or a number
- * @return {String|Number}
- * @api public
- */
-
-module.exports = function (val, options) {
- options = options || {};
- var type = typeof val;
- if (type === 'string' && val.length > 0) {
- return parse(val);
- } else if (type === 'number' && isFinite(val)) {
- return options.long ? fmtLong(val) : fmtShort(val);
- }
- throw new Error(
- 'val is not a non-empty string or a valid number. val=' +
- JSON.stringify(val)
- );
-};
-
-/**
- * Parse the given `str` and return milliseconds.
- *
- * @param {String} str
- * @return {Number}
- * @api private
- */
-
-function parse(str) {
- str = String(str);
- if (str.length > 100) {
- return;
- }
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
- str
- );
- if (!match) {
- return;
- }
- var n = parseFloat(match[1]);
- var type = (match[2] || 'ms').toLowerCase();
- switch (type) {
- case 'years':
- case 'year':
- case 'yrs':
- case 'yr':
- case 'y':
- return n * y;
- case 'weeks':
- case 'week':
- case 'w':
- return n * w;
- case 'days':
- case 'day':
- case 'd':
- return n * d;
- case 'hours':
- case 'hour':
- case 'hrs':
- case 'hr':
- case 'h':
- return n * h;
- case 'minutes':
- case 'minute':
- case 'mins':
- case 'min':
- case 'm':
- return n * m;
- case 'seconds':
- case 'second':
- case 'secs':
- case 'sec':
- case 's':
- return n * s;
- case 'milliseconds':
- case 'millisecond':
- case 'msecs':
- case 'msec':
- case 'ms':
- return n;
- default:
- return undefined;
- }
-}
-
-/**
- * Short format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
-
-function fmtShort(ms) {
- var msAbs = Math.abs(ms);
- if (msAbs >= d) {
- return Math.round(ms / d) + 'd';
- }
- if (msAbs >= h) {
- return Math.round(ms / h) + 'h';
- }
- if (msAbs >= m) {
- return Math.round(ms / m) + 'm';
- }
- if (msAbs >= s) {
- return Math.round(ms / s) + 's';
- }
- return ms + 'ms';
-}
-
-/**
- * Long format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
-
-function fmtLong(ms) {
- var msAbs = Math.abs(ms);
- if (msAbs >= d) {
- return plural(ms, msAbs, d, 'day');
- }
- if (msAbs >= h) {
- return plural(ms, msAbs, h, 'hour');
- }
- if (msAbs >= m) {
- return plural(ms, msAbs, m, 'minute');
- }
- if (msAbs >= s) {
- return plural(ms, msAbs, s, 'second');
- }
- return ms + ' ms';
-}
-
-/**
- * Pluralization helper.
- */
-
-function plural(ms, msAbs, n, name) {
- var isPlural = msAbs >= n * 1.5;
- return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
-}
diff --git a/node_modules/ms/license.md b/node_modules/ms/license.md
deleted file mode 100644
index fa5d39b..0000000
--- a/node_modules/ms/license.md
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2020 Vercel, Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/node_modules/ms/package.json b/node_modules/ms/package.json
deleted file mode 100644
index 4997189..0000000
--- a/node_modules/ms/package.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "name": "ms",
- "version": "2.1.3",
- "description": "Tiny millisecond conversion utility",
- "repository": "vercel/ms",
- "main": "./index",
- "files": [
- "index.js"
- ],
- "scripts": {
- "precommit": "lint-staged",
- "lint": "eslint lib/* bin/*",
- "test": "mocha tests.js"
- },
- "eslintConfig": {
- "extends": "eslint:recommended",
- "env": {
- "node": true,
- "es6": true
- }
- },
- "lint-staged": {
- "*.js": [
- "npm run lint",
- "prettier --single-quote --write",
- "git add"
- ]
- },
- "license": "MIT",
- "devDependencies": {
- "eslint": "4.18.2",
- "expect.js": "0.3.1",
- "husky": "0.14.3",
- "lint-staged": "5.0.0",
- "mocha": "4.0.1",
- "prettier": "2.0.5"
- }
-}
diff --git a/node_modules/ms/readme.md b/node_modules/ms/readme.md
deleted file mode 100644
index 0fc1abb..0000000
--- a/node_modules/ms/readme.md
+++ /dev/null
@@ -1,59 +0,0 @@
-# ms
-
-
-
-Use this package to easily convert various time formats to milliseconds.
-
-## Examples
-
-```js
-ms('2 days') // 172800000
-ms('1d') // 86400000
-ms('10h') // 36000000
-ms('2.5 hrs') // 9000000
-ms('2h') // 7200000
-ms('1m') // 60000
-ms('5s') // 5000
-ms('1y') // 31557600000
-ms('100') // 100
-ms('-3 days') // -259200000
-ms('-1h') // -3600000
-ms('-200') // -200
-```
-
-### Convert from Milliseconds
-
-```js
-ms(60000) // "1m"
-ms(2 * 60000) // "2m"
-ms(-3 * 60000) // "-3m"
-ms(ms('10 hours')) // "10h"
-```
-
-### Time Format Written-Out
-
-```js
-ms(60000, { long: true }) // "1 minute"
-ms(2 * 60000, { long: true }) // "2 minutes"
-ms(-3 * 60000, { long: true }) // "-3 minutes"
-ms(ms('10 hours'), { long: true }) // "10 hours"
-```
-
-## Features
-
-- Works both in [Node.js](https://nodejs.org) and in the browser
-- If a number is supplied to `ms`, a string with a unit is returned
-- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`)
-- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned
-
-## Related Packages
-
-- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time.
-
-## Caught a Bug?
-
-1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
-2. Link the package to the global module directory: `npm link`
-3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms!
-
-As always, you can run the tests using: `npm test`
diff --git a/node_modules/node-fetch/LICENSE.md b/node_modules/node-fetch/LICENSE.md
deleted file mode 100644
index 660ffec..0000000
--- a/node_modules/node-fetch/LICENSE.md
+++ /dev/null
@@ -1,22 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2016 David Frank
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
diff --git a/node_modules/node-fetch/README.md b/node_modules/node-fetch/README.md
deleted file mode 100644
index 55f09b7..0000000
--- a/node_modules/node-fetch/README.md
+++ /dev/null
@@ -1,634 +0,0 @@
-node-fetch
-==========
-
-[![npm version][npm-image]][npm-url]
-[![build status][travis-image]][travis-url]
-[![coverage status][codecov-image]][codecov-url]
-[![install size][install-size-image]][install-size-url]
-[![Discord][discord-image]][discord-url]
-
-A light-weight module that brings `window.fetch` to Node.js
-
-(We are looking for [v2 maintainers and collaborators](https://github.com/bitinn/node-fetch/issues/567))
-
-[![Backers][opencollective-image]][opencollective-url]
-
-
-
-- [Motivation](#motivation)
-- [Features](#features)
-- [Difference from client-side fetch](#difference-from-client-side-fetch)
-- [Installation](#installation)
-- [Loading and configuring the module](#loading-and-configuring-the-module)
-- [Common Usage](#common-usage)
- - [Plain text or HTML](#plain-text-or-html)
- - [JSON](#json)
- - [Simple Post](#simple-post)
- - [Post with JSON](#post-with-json)
- - [Post with form parameters](#post-with-form-parameters)
- - [Handling exceptions](#handling-exceptions)
- - [Handling client and server errors](#handling-client-and-server-errors)
-- [Advanced Usage](#advanced-usage)
- - [Streams](#streams)
- - [Buffer](#buffer)
- - [Accessing Headers and other Meta data](#accessing-headers-and-other-meta-data)
- - [Extract Set-Cookie Header](#extract-set-cookie-header)
- - [Post data using a file stream](#post-data-using-a-file-stream)
- - [Post with form-data (detect multipart)](#post-with-form-data-detect-multipart)
- - [Request cancellation with AbortSignal](#request-cancellation-with-abortsignal)
-- [API](#api)
- - [fetch(url[, options])](#fetchurl-options)
- - [Options](#options)
- - [Class: Request](#class-request)
- - [Class: Response](#class-response)
- - [Class: Headers](#class-headers)
- - [Interface: Body](#interface-body)
- - [Class: FetchError](#class-fetcherror)
-- [License](#license)
-- [Acknowledgement](#acknowledgement)
-
-
-
-## Motivation
-
-Instead of implementing `XMLHttpRequest` in Node.js to run browser-specific [Fetch polyfill](https://github.com/github/fetch), why not go from native `http` to `fetch` API directly? Hence, `node-fetch`, minimal code for a `window.fetch` compatible API on Node.js runtime.
-
-See Matt Andrews' [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch) or Leonardo Quixada's [cross-fetch](https://github.com/lquixada/cross-fetch) for isomorphic usage (exports `node-fetch` for server-side, `whatwg-fetch` for client-side).
-
-## Features
-
-- Stay consistent with `window.fetch` API.
-- Make conscious trade-off when following [WHATWG fetch spec][whatwg-fetch] and [stream spec](https://streams.spec.whatwg.org/) implementation details, document known differences.
-- Use native promise but allow substituting it with [insert your favorite promise library].
-- Use native Node streams for body on both request and response.
-- Decode content encoding (gzip/deflate) properly and convert string output (such as `res.text()` and `res.json()`) to UTF-8 automatically.
-- Useful extensions such as timeout, redirect limit, response size limit, [explicit errors](ERROR-HANDLING.md) for troubleshooting.
-
-## Difference from client-side fetch
-
-- See [Known Differences](LIMITS.md) for details.
-- If you happen to use a missing feature that `window.fetch` offers, feel free to open an issue.
-- Pull requests are welcomed too!
-
-## Installation
-
-Current stable release (`2.x`)
-
-```sh
-$ npm install node-fetch
-```
-
-## Loading and configuring the module
-We suggest you load the module via `require` until the stabilization of ES modules in node:
-```js
-const fetch = require('node-fetch');
-```
-
-If you are using a Promise library other than native, set it through `fetch.Promise`:
-```js
-const Bluebird = require('bluebird');
-
-fetch.Promise = Bluebird;
-```
-
-## Common Usage
-
-NOTE: The documentation below is up-to-date with `2.x` releases; see the [`1.x` readme](https://github.com/bitinn/node-fetch/blob/1.x/README.md), [changelog](https://github.com/bitinn/node-fetch/blob/1.x/CHANGELOG.md) and [2.x upgrade guide](UPGRADE-GUIDE.md) for the differences.
-
-#### Plain text or HTML
-```js
-fetch('https://github.com/')
- .then(res => res.text())
- .then(body => console.log(body));
-```
-
-#### JSON
-
-```js
-
-fetch('https://api.github.com/users/github')
- .then(res => res.json())
- .then(json => console.log(json));
-```
-
-#### Simple Post
-```js
-fetch('https://httpbin.org/post', { method: 'POST', body: 'a=1' })
- .then(res => res.json()) // expecting a json response
- .then(json => console.log(json));
-```
-
-#### Post with JSON
-
-```js
-const body = { a: 1 };
-
-fetch('https://httpbin.org/post', {
- method: 'post',
- body: JSON.stringify(body),
- headers: { 'Content-Type': 'application/json' },
- })
- .then(res => res.json())
- .then(json => console.log(json));
-```
-
-#### Post with form parameters
-`URLSearchParams` is available in Node.js as of v7.5.0. See [official documentation](https://nodejs.org/api/url.html#url_class_urlsearchparams) for more usage methods.
-
-NOTE: The `Content-Type` header is only set automatically to `x-www-form-urlencoded` when an instance of `URLSearchParams` is given as such:
-
-```js
-const { URLSearchParams } = require('url');
-
-const params = new URLSearchParams();
-params.append('a', 1);
-
-fetch('https://httpbin.org/post', { method: 'POST', body: params })
- .then(res => res.json())
- .then(json => console.log(json));
-```
-
-#### Handling exceptions
-NOTE: 3xx-5xx responses are *NOT* exceptions and should be handled in `then()`; see the next section for more information.
-
-Adding a catch to the fetch promise chain will catch *all* exceptions, such as errors originating from node core libraries, network errors and operational errors, which are instances of FetchError. See the [error handling document](ERROR-HANDLING.md) for more details.
-
-```js
-fetch('https://domain.invalid/')
- .catch(err => console.error(err));
-```
-
-#### Handling client and server errors
-It is common to create a helper function to check that the response contains no client (4xx) or server (5xx) error responses:
-
-```js
-function checkStatus(res) {
- if (res.ok) { // res.status >= 200 && res.status < 300
- return res;
- } else {
- throw MyCustomError(res.statusText);
- }
-}
-
-fetch('https://httpbin.org/status/400')
- .then(checkStatus)
- .then(res => console.log('will not get here...'))
-```
-
-## Advanced Usage
-
-#### Streams
-The "Node.js way" is to use streams when possible:
-
-```js
-fetch('https://assets-cdn.github.com/images/modules/logos_page/Octocat.png')
- .then(res => {
- const dest = fs.createWriteStream('./octocat.png');
- res.body.pipe(dest);
- });
-```
-
-In Node.js 14 you can also use async iterators to read `body`; however, be careful to catch
-errors -- the longer a response runs, the more likely it is to encounter an error.
-
-```js
-const fetch = require('node-fetch');
-const response = await fetch('https://httpbin.org/stream/3');
-try {
- for await (const chunk of response.body) {
- console.dir(JSON.parse(chunk.toString()));
- }
-} catch (err) {
- console.error(err.stack);
-}
-```
-
-In Node.js 12 you can also use async iterators to read `body`; however, async iterators with streams
-did not mature until Node.js 14, so you need to do some extra work to ensure you handle errors
-directly from the stream and wait on it response to fully close.
-
-```js
-const fetch = require('node-fetch');
-const read = async body => {
- let error;
- body.on('error', err => {
- error = err;
- });
- for await (const chunk of body) {
- console.dir(JSON.parse(chunk.toString()));
- }
- return new Promise((resolve, reject) => {
- body.on('close', () => {
- error ? reject(error) : resolve();
- });
- });
-};
-try {
- const response = await fetch('https://httpbin.org/stream/3');
- await read(response.body);
-} catch (err) {
- console.error(err.stack);
-}
-```
-
-#### Buffer
-If you prefer to cache binary data in full, use buffer(). (NOTE: `buffer()` is a `node-fetch`-only API)
-
-```js
-const fileType = require('file-type');
-
-fetch('https://assets-cdn.github.com/images/modules/logos_page/Octocat.png')
- .then(res => res.buffer())
- .then(buffer => fileType(buffer))
- .then(type => { /* ... */ });
-```
-
-#### Accessing Headers and other Meta data
-```js
-fetch('https://github.com/')
- .then(res => {
- console.log(res.ok);
- console.log(res.status);
- console.log(res.statusText);
- console.log(res.headers.raw());
- console.log(res.headers.get('content-type'));
- });
-```
-
-#### Extract Set-Cookie Header
-
-Unlike browsers, you can access raw `Set-Cookie` headers manually using `Headers.raw()`. This is a `node-fetch` only API.
-
-```js
-fetch(url).then(res => {
- // returns an array of values, instead of a string of comma-separated values
- console.log(res.headers.raw()['set-cookie']);
-});
-```
-
-#### Post data using a file stream
-
-```js
-const { createReadStream } = require('fs');
-
-const stream = createReadStream('input.txt');
-
-fetch('https://httpbin.org/post', { method: 'POST', body: stream })
- .then(res => res.json())
- .then(json => console.log(json));
-```
-
-#### Post with form-data (detect multipart)
-
-```js
-const FormData = require('form-data');
-
-const form = new FormData();
-form.append('a', 1);
-
-fetch('https://httpbin.org/post', { method: 'POST', body: form })
- .then(res => res.json())
- .then(json => console.log(json));
-
-// OR, using custom headers
-// NOTE: getHeaders() is non-standard API
-
-const form = new FormData();
-form.append('a', 1);
-
-const options = {
- method: 'POST',
- body: form,
- headers: form.getHeaders()
-}
-
-fetch('https://httpbin.org/post', options)
- .then(res => res.json())
- .then(json => console.log(json));
-```
-
-#### Request cancellation with AbortSignal
-
-> NOTE: You may cancel streamed requests only on Node >= v8.0.0
-
-You may cancel requests with `AbortController`. A suggested implementation is [`abort-controller`](https://www.npmjs.com/package/abort-controller).
-
-An example of timing out a request after 150ms could be achieved as the following:
-
-```js
-import AbortController from 'abort-controller';
-
-const controller = new AbortController();
-const timeout = setTimeout(
- () => { controller.abort(); },
- 150,
-);
-
-fetch(url, { signal: controller.signal })
- .then(res => res.json())
- .then(
- data => {
- useData(data)
- },
- err => {
- if (err.name === 'AbortError') {
- // request was aborted
- }
- },
- )
- .finally(() => {
- clearTimeout(timeout);
- });
-```
-
-See [test cases](https://github.com/bitinn/node-fetch/blob/master/test/test.js) for more examples.
-
-
-## API
-
-### fetch(url[, options])
-
-- `url` A string representing the URL for fetching
-- `options` [Options](#fetch-options) for the HTTP(S) request
-- Returns: Promise<[Response](#class-response)>
-
-Perform an HTTP(S) fetch.
-
-`url` should be an absolute url, such as `https://example.com/`. A path-relative URL (`/file/under/root`) or protocol-relative URL (`//can-be-http-or-https.com/`) will result in a rejected `Promise`.
-
-
-### Options
-
-The default values are shown after each option key.
-
-```js
-{
- // These properties are part of the Fetch Standard
- method: 'GET',
- headers: {}, // request headers. format is the identical to that accepted by the Headers constructor (see below)
- body: null, // request body. can be null, a string, a Buffer, a Blob, or a Node.js Readable stream
- redirect: 'follow', // set to `manual` to extract redirect headers, `error` to reject redirect
- signal: null, // pass an instance of AbortSignal to optionally abort requests
-
- // The following properties are node-fetch extensions
- follow: 20, // maximum redirect count. 0 to not follow redirect
- timeout: 0, // req/res timeout in ms, it resets on redirect. 0 to disable (OS limit applies). Signal is recommended instead.
- compress: true, // support gzip/deflate content encoding. false to disable
- size: 0, // maximum response body size in bytes. 0 to disable
- agent: null // http(s).Agent instance or function that returns an instance (see below)
-}
-```
-
-##### Default Headers
-
-If no values are set, the following request headers will be sent automatically:
-
-Header | Value
-------------------- | --------------------------------------------------------
-`Accept-Encoding` | `gzip,deflate` _(when `options.compress === true`)_
-`Accept` | `*/*`
-`Content-Length` | _(automatically calculated, if possible)_
-`Transfer-Encoding` | `chunked` _(when `req.body` is a stream)_
-`User-Agent` | `node-fetch/1.0 (+https://github.com/bitinn/node-fetch)`
-
-Note: when `body` is a `Stream`, `Content-Length` is not set automatically.
-
-##### Custom Agent
-
-The `agent` option allows you to specify networking related options which are out of the scope of Fetch, including and not limited to the following:
-
-- Support self-signed certificate
-- Use only IPv4 or IPv6
-- Custom DNS Lookup
-
-See [`http.Agent`](https://nodejs.org/api/http.html#http_new_agent_options) for more information.
-
-If no agent is specified, the default agent provided by Node.js is used. Note that [this changed in Node.js 19](https://github.com/nodejs/node/blob/4267b92604ad78584244488e7f7508a690cb80d0/lib/_http_agent.js#L564) to have `keepalive` true by default. If you wish to enable `keepalive` in an earlier version of Node.js, you can override the agent as per the following code sample.
-
-In addition, the `agent` option accepts a function that returns `http`(s)`.Agent` instance given current [URL](https://nodejs.org/api/url.html), this is useful during a redirection chain across HTTP and HTTPS protocol.
-
-```js
-const httpAgent = new http.Agent({
- keepAlive: true
-});
-const httpsAgent = new https.Agent({
- keepAlive: true
-});
-
-const options = {
- agent: function (_parsedURL) {
- if (_parsedURL.protocol == 'http:') {
- return httpAgent;
- } else {
- return httpsAgent;
- }
- }
-}
-```
-
-
-### Class: Request
-
-An HTTP(S) request containing information about URL, method, headers, and the body. This class implements the [Body](#iface-body) interface.
-
-Due to the nature of Node.js, the following properties are not implemented at this moment:
-
-- `type`
-- `destination`
-- `referrer`
-- `referrerPolicy`
-- `mode`
-- `credentials`
-- `cache`
-- `integrity`
-- `keepalive`
-
-The following node-fetch extension properties are provided:
-
-- `follow`
-- `compress`
-- `counter`
-- `agent`
-
-See [options](#fetch-options) for exact meaning of these extensions.
-
-#### new Request(input[, options])
-
-*(spec-compliant)*
-
-- `input` A string representing a URL, or another `Request` (which will be cloned)
-- `options` [Options][#fetch-options] for the HTTP(S) request
-
-Constructs a new `Request` object. The constructor is identical to that in the [browser](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request).
-
-In most cases, directly `fetch(url, options)` is simpler than creating a `Request` object.
-
-
-### Class: Response
-
-An HTTP(S) response. This class implements the [Body](#iface-body) interface.
-
-The following properties are not implemented in node-fetch at this moment:
-
-- `Response.error()`
-- `Response.redirect()`
-- `type`
-- `trailer`
-
-#### new Response([body[, options]])
-
-*(spec-compliant)*
-
-- `body` A `String` or [`Readable` stream][node-readable]
-- `options` A [`ResponseInit`][response-init] options dictionary
-
-Constructs a new `Response` object. The constructor is identical to that in the [browser](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response).
-
-Because Node.js does not implement service workers (for which this class was designed), one rarely has to construct a `Response` directly.
-
-#### response.ok
-
-*(spec-compliant)*
-
-Convenience property representing if the request ended normally. Will evaluate to true if the response status was greater than or equal to 200 but smaller than 300.
-
-#### response.redirected
-
-*(spec-compliant)*
-
-Convenience property representing if the request has been redirected at least once. Will evaluate to true if the internal redirect counter is greater than 0.
-
-
-### Class: Headers
-
-This class allows manipulating and iterating over a set of HTTP headers. All methods specified in the [Fetch Standard][whatwg-fetch] are implemented.
-
-#### new Headers([init])
-
-*(spec-compliant)*
-
-- `init` Optional argument to pre-fill the `Headers` object
-
-Construct a new `Headers` object. `init` can be either `null`, a `Headers` object, an key-value map object or any iterable object.
-
-```js
-// Example adapted from https://fetch.spec.whatwg.org/#example-headers-class
-
-const meta = {
- 'Content-Type': 'text/xml',
- 'Breaking-Bad': '<3'
-};
-const headers = new Headers(meta);
-
-// The above is equivalent to
-const meta = [
- [ 'Content-Type', 'text/xml' ],
- [ 'Breaking-Bad', '<3' ]
-];
-const headers = new Headers(meta);
-
-// You can in fact use any iterable objects, like a Map or even another Headers
-const meta = new Map();
-meta.set('Content-Type', 'text/xml');
-meta.set('Breaking-Bad', '<3');
-const headers = new Headers(meta);
-const copyOfHeaders = new Headers(headers);
-```
-
-
-### Interface: Body
-
-`Body` is an abstract interface with methods that are applicable to both `Request` and `Response` classes.
-
-The following methods are not yet implemented in node-fetch at this moment:
-
-- `formData()`
-
-#### body.body
-
-*(deviation from spec)*
-
-* Node.js [`Readable` stream][node-readable]
-
-Data are encapsulated in the `Body` object. Note that while the [Fetch Standard][whatwg-fetch] requires the property to always be a WHATWG `ReadableStream`, in node-fetch it is a Node.js [`Readable` stream][node-readable].
-
-#### body.bodyUsed
-
-*(spec-compliant)*
-
-* `Boolean`
-
-A boolean property for if this body has been consumed. Per the specs, a consumed body cannot be used again.
-
-#### body.arrayBuffer()
-#### body.blob()
-#### body.json()
-#### body.text()
-
-*(spec-compliant)*
-
-* Returns: Promise
-
-Consume the body and return a promise that will resolve to one of these formats.
-
-#### body.buffer()
-
-*(node-fetch extension)*
-
-* Returns: Promise<Buffer>
-
-Consume the body and return a promise that will resolve to a Buffer.
-
-#### body.textConverted()
-
-*(node-fetch extension)*
-
-* Returns: Promise<String>
-
-Identical to `body.text()`, except instead of always converting to UTF-8, encoding sniffing will be performed and text converted to UTF-8 if possible.
-
-(This API requires an optional dependency of the npm package [encoding](https://www.npmjs.com/package/encoding), which you need to install manually. `webpack` users may see [a warning message](https://github.com/bitinn/node-fetch/issues/412#issuecomment-379007792) due to this optional dependency.)
-
-
-### Class: FetchError
-
-*(node-fetch extension)*
-
-An operational error in the fetching process. See [ERROR-HANDLING.md][] for more info.
-
-
-### Class: AbortError
-
-*(node-fetch extension)*
-
-An Error thrown when the request is aborted in response to an `AbortSignal`'s `abort` event. It has a `name` property of `AbortError`. See [ERROR-HANDLING.MD][] for more info.
-
-## Acknowledgement
-
-Thanks to [github/fetch](https://github.com/github/fetch) for providing a solid implementation reference.
-
-`node-fetch` v1 was maintained by [@bitinn](https://github.com/bitinn); v2 was maintained by [@TimothyGu](https://github.com/timothygu), [@bitinn](https://github.com/bitinn) and [@jimmywarting](https://github.com/jimmywarting); v2 readme is written by [@jkantr](https://github.com/jkantr).
-
-## License
-
-MIT
-
-[npm-image]: https://flat.badgen.net/npm/v/node-fetch
-[npm-url]: https://www.npmjs.com/package/node-fetch
-[travis-image]: https://flat.badgen.net/travis/bitinn/node-fetch
-[travis-url]: https://travis-ci.org/bitinn/node-fetch
-[codecov-image]: https://flat.badgen.net/codecov/c/github/bitinn/node-fetch/master
-[codecov-url]: https://codecov.io/gh/bitinn/node-fetch
-[install-size-image]: https://flat.badgen.net/packagephobia/install/node-fetch
-[install-size-url]: https://packagephobia.now.sh/result?p=node-fetch
-[discord-image]: https://img.shields.io/discord/619915844268326952?color=%237289DA&label=Discord&style=flat-square
-[discord-url]: https://discord.gg/Zxbndcm
-[opencollective-image]: https://opencollective.com/node-fetch/backers.svg
-[opencollective-url]: https://opencollective.com/node-fetch
-[whatwg-fetch]: https://fetch.spec.whatwg.org/
-[response-init]: https://fetch.spec.whatwg.org/#responseinit
-[node-readable]: https://nodejs.org/api/stream.html#stream_readable_streams
-[mdn-headers]: https://developer.mozilla.org/en-US/docs/Web/API/Headers
-[LIMITS.md]: https://github.com/bitinn/node-fetch/blob/master/LIMITS.md
-[ERROR-HANDLING.md]: https://github.com/bitinn/node-fetch/blob/master/ERROR-HANDLING.md
-[UPGRADE-GUIDE.md]: https://github.com/bitinn/node-fetch/blob/master/UPGRADE-GUIDE.md
diff --git a/node_modules/node-fetch/browser.js b/node_modules/node-fetch/browser.js
deleted file mode 100644
index ee86265..0000000
--- a/node_modules/node-fetch/browser.js
+++ /dev/null
@@ -1,25 +0,0 @@
-"use strict";
-
-// ref: https://github.com/tc39/proposal-global
-var getGlobal = function () {
- // the only reliable means to get the global object is
- // `Function('return this')()`
- // However, this causes CSP violations in Chrome apps.
- if (typeof self !== 'undefined') { return self; }
- if (typeof window !== 'undefined') { return window; }
- if (typeof global !== 'undefined') { return global; }
- throw new Error('unable to locate global object');
-}
-
-var globalObject = getGlobal();
-
-module.exports = exports = globalObject.fetch;
-
-// Needed for TypeScript and Webpack.
-if (globalObject.fetch) {
- exports.default = globalObject.fetch.bind(globalObject);
-}
-
-exports.Headers = globalObject.Headers;
-exports.Request = globalObject.Request;
-exports.Response = globalObject.Response;
diff --git a/node_modules/node-fetch/lib/index.es.js b/node_modules/node-fetch/lib/index.es.js
deleted file mode 100644
index aae9799..0000000
--- a/node_modules/node-fetch/lib/index.es.js
+++ /dev/null
@@ -1,1777 +0,0 @@
-process.emitWarning("The .es.js file is deprecated. Use .mjs instead.");
-
-import Stream from 'stream';
-import http from 'http';
-import Url from 'url';
-import whatwgUrl from 'whatwg-url';
-import https from 'https';
-import zlib from 'zlib';
-
-// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
-
-// fix for "Readable" isn't a named export issue
-const Readable = Stream.Readable;
-
-const BUFFER = Symbol('buffer');
-const TYPE = Symbol('type');
-
-class Blob {
- constructor() {
- this[TYPE] = '';
-
- const blobParts = arguments[0];
- const options = arguments[1];
-
- const buffers = [];
- let size = 0;
-
- if (blobParts) {
- const a = blobParts;
- const length = Number(a.length);
- for (let i = 0; i < length; i++) {
- const element = a[i];
- let buffer;
- if (element instanceof Buffer) {
- buffer = element;
- } else if (ArrayBuffer.isView(element)) {
- buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
- } else if (element instanceof ArrayBuffer) {
- buffer = Buffer.from(element);
- } else if (element instanceof Blob) {
- buffer = element[BUFFER];
- } else {
- buffer = Buffer.from(typeof element === 'string' ? element : String(element));
- }
- size += buffer.length;
- buffers.push(buffer);
- }
- }
-
- this[BUFFER] = Buffer.concat(buffers);
-
- let type = options && options.type !== undefined && String(options.type).toLowerCase();
- if (type && !/[^\u0020-\u007E]/.test(type)) {
- this[TYPE] = type;
- }
- }
- get size() {
- return this[BUFFER].length;
- }
- get type() {
- return this[TYPE];
- }
- text() {
- return Promise.resolve(this[BUFFER].toString());
- }
- arrayBuffer() {
- const buf = this[BUFFER];
- const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
- return Promise.resolve(ab);
- }
- stream() {
- const readable = new Readable();
- readable._read = function () {};
- readable.push(this[BUFFER]);
- readable.push(null);
- return readable;
- }
- toString() {
- return '[object Blob]';
- }
- slice() {
- const size = this.size;
-
- const start = arguments[0];
- const end = arguments[1];
- let relativeStart, relativeEnd;
- if (start === undefined) {
- relativeStart = 0;
- } else if (start < 0) {
- relativeStart = Math.max(size + start, 0);
- } else {
- relativeStart = Math.min(start, size);
- }
- if (end === undefined) {
- relativeEnd = size;
- } else if (end < 0) {
- relativeEnd = Math.max(size + end, 0);
- } else {
- relativeEnd = Math.min(end, size);
- }
- const span = Math.max(relativeEnd - relativeStart, 0);
-
- const buffer = this[BUFFER];
- const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
- const blob = new Blob([], { type: arguments[2] });
- blob[BUFFER] = slicedBuffer;
- return blob;
- }
-}
-
-Object.defineProperties(Blob.prototype, {
- size: { enumerable: true },
- type: { enumerable: true },
- slice: { enumerable: true }
-});
-
-Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
- value: 'Blob',
- writable: false,
- enumerable: false,
- configurable: true
-});
-
-/**
- * fetch-error.js
- *
- * FetchError interface for operational errors
- */
-
-/**
- * Create FetchError instance
- *
- * @param String message Error message for human
- * @param String type Error type for machine
- * @param String systemError For Node.js system error
- * @return FetchError
- */
-function FetchError(message, type, systemError) {
- Error.call(this, message);
-
- this.message = message;
- this.type = type;
-
- // when err.type is `system`, err.code contains system error code
- if (systemError) {
- this.code = this.errno = systemError.code;
- }
-
- // hide custom error implementation details from end-users
- Error.captureStackTrace(this, this.constructor);
-}
-
-FetchError.prototype = Object.create(Error.prototype);
-FetchError.prototype.constructor = FetchError;
-FetchError.prototype.name = 'FetchError';
-
-let convert;
-try {
- convert = require('encoding').convert;
-} catch (e) {}
-
-const INTERNALS = Symbol('Body internals');
-
-// fix an issue where "PassThrough" isn't a named export for node <10
-const PassThrough = Stream.PassThrough;
-
-/**
- * Body mixin
- *
- * Ref: https://fetch.spec.whatwg.org/#body
- *
- * @param Stream body Readable stream
- * @param Object opts Response options
- * @return Void
- */
-function Body(body) {
- var _this = this;
-
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
- _ref$size = _ref.size;
-
- let size = _ref$size === undefined ? 0 : _ref$size;
- var _ref$timeout = _ref.timeout;
- let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
-
- if (body == null) {
- // body is undefined or null
- body = null;
- } else if (isURLSearchParams(body)) {
- // body is a URLSearchParams
- body = Buffer.from(body.toString());
- } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
- // body is ArrayBuffer
- body = Buffer.from(body);
- } else if (ArrayBuffer.isView(body)) {
- // body is ArrayBufferView
- body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
- } else if (body instanceof Stream) ; else {
- // none of the above
- // coerce to string then buffer
- body = Buffer.from(String(body));
- }
- this[INTERNALS] = {
- body,
- disturbed: false,
- error: null
- };
- this.size = size;
- this.timeout = timeout;
-
- if (body instanceof Stream) {
- body.on('error', function (err) {
- const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
- _this[INTERNALS].error = error;
- });
- }
-}
-
-Body.prototype = {
- get body() {
- return this[INTERNALS].body;
- },
-
- get bodyUsed() {
- return this[INTERNALS].disturbed;
- },
-
- /**
- * Decode response as ArrayBuffer
- *
- * @return Promise
- */
- arrayBuffer() {
- return consumeBody.call(this).then(function (buf) {
- return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
- });
- },
-
- /**
- * Return raw response as Blob
- *
- * @return Promise
- */
- blob() {
- let ct = this.headers && this.headers.get('content-type') || '';
- return consumeBody.call(this).then(function (buf) {
- return Object.assign(
- // Prevent copying
- new Blob([], {
- type: ct.toLowerCase()
- }), {
- [BUFFER]: buf
- });
- });
- },
-
- /**
- * Decode response as json
- *
- * @return Promise
- */
- json() {
- var _this2 = this;
-
- return consumeBody.call(this).then(function (buffer) {
- try {
- return JSON.parse(buffer.toString());
- } catch (err) {
- return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
- }
- });
- },
-
- /**
- * Decode response as text
- *
- * @return Promise
- */
- text() {
- return consumeBody.call(this).then(function (buffer) {
- return buffer.toString();
- });
- },
-
- /**
- * Decode response as buffer (non-spec api)
- *
- * @return Promise
- */
- buffer() {
- return consumeBody.call(this);
- },
-
- /**
- * Decode response as text, while automatically detecting the encoding and
- * trying to decode to UTF-8 (non-spec api)
- *
- * @return Promise
- */
- textConverted() {
- var _this3 = this;
-
- return consumeBody.call(this).then(function (buffer) {
- return convertBody(buffer, _this3.headers);
- });
- }
-};
-
-// In browsers, all properties are enumerable.
-Object.defineProperties(Body.prototype, {
- body: { enumerable: true },
- bodyUsed: { enumerable: true },
- arrayBuffer: { enumerable: true },
- blob: { enumerable: true },
- json: { enumerable: true },
- text: { enumerable: true }
-});
-
-Body.mixIn = function (proto) {
- for (const name of Object.getOwnPropertyNames(Body.prototype)) {
- // istanbul ignore else: future proof
- if (!(name in proto)) {
- const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
- Object.defineProperty(proto, name, desc);
- }
- }
-};
-
-/**
- * Consume and convert an entire Body to a Buffer.
- *
- * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
- *
- * @return Promise
- */
-function consumeBody() {
- var _this4 = this;
-
- if (this[INTERNALS].disturbed) {
- return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
- }
-
- this[INTERNALS].disturbed = true;
-
- if (this[INTERNALS].error) {
- return Body.Promise.reject(this[INTERNALS].error);
- }
-
- let body = this.body;
-
- // body is null
- if (body === null) {
- return Body.Promise.resolve(Buffer.alloc(0));
- }
-
- // body is blob
- if (isBlob(body)) {
- body = body.stream();
- }
-
- // body is buffer
- if (Buffer.isBuffer(body)) {
- return Body.Promise.resolve(body);
- }
-
- // istanbul ignore if: should never happen
- if (!(body instanceof Stream)) {
- return Body.Promise.resolve(Buffer.alloc(0));
- }
-
- // body is stream
- // get ready to actually consume the body
- let accum = [];
- let accumBytes = 0;
- let abort = false;
-
- return new Body.Promise(function (resolve, reject) {
- let resTimeout;
-
- // allow timeout on slow response body
- if (_this4.timeout) {
- resTimeout = setTimeout(function () {
- abort = true;
- reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
- }, _this4.timeout);
- }
-
- // handle stream errors
- body.on('error', function (err) {
- if (err.name === 'AbortError') {
- // if the request was aborted, reject with this Error
- abort = true;
- reject(err);
- } else {
- // other errors, such as incorrect content-encoding
- reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
- }
- });
-
- body.on('data', function (chunk) {
- if (abort || chunk === null) {
- return;
- }
-
- if (_this4.size && accumBytes + chunk.length > _this4.size) {
- abort = true;
- reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
- return;
- }
-
- accumBytes += chunk.length;
- accum.push(chunk);
- });
-
- body.on('end', function () {
- if (abort) {
- return;
- }
-
- clearTimeout(resTimeout);
-
- try {
- resolve(Buffer.concat(accum, accumBytes));
- } catch (err) {
- // handle streams that have accumulated too much data (issue #414)
- reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
- }
- });
- });
-}
-
-/**
- * Detect buffer encoding and convert to target encoding
- * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
- *
- * @param Buffer buffer Incoming buffer
- * @param String encoding Target encoding
- * @return String
- */
-function convertBody(buffer, headers) {
- if (typeof convert !== 'function') {
- throw new Error('The package `encoding` must be installed to use the textConverted() function');
- }
-
- const ct = headers.get('content-type');
- let charset = 'utf-8';
- let res, str;
-
- // header
- if (ct) {
- res = /charset=([^;]*)/i.exec(ct);
- }
-
- // no charset in content type, peek at response body for at most 1024 bytes
- str = buffer.slice(0, 1024).toString();
-
- // html5
- if (!res && str) {
- res = / 0 && arguments[0] !== undefined ? arguments[0] : undefined;
-
- this[MAP] = Object.create(null);
-
- if (init instanceof Headers) {
- const rawHeaders = init.raw();
- const headerNames = Object.keys(rawHeaders);
-
- for (const headerName of headerNames) {
- for (const value of rawHeaders[headerName]) {
- this.append(headerName, value);
- }
- }
-
- return;
- }
-
- // We don't worry about converting prop to ByteString here as append()
- // will handle it.
- if (init == null) ; else if (typeof init === 'object') {
- const method = init[Symbol.iterator];
- if (method != null) {
- if (typeof method !== 'function') {
- throw new TypeError('Header pairs must be iterable');
- }
-
- // sequence>
- // Note: per spec we have to first exhaust the lists then process them
- const pairs = [];
- for (const pair of init) {
- if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
- throw new TypeError('Each header pair must be iterable');
- }
- pairs.push(Array.from(pair));
- }
-
- for (const pair of pairs) {
- if (pair.length !== 2) {
- throw new TypeError('Each header pair must be a name/value tuple');
- }
- this.append(pair[0], pair[1]);
- }
- } else {
- // record
- for (const key of Object.keys(init)) {
- const value = init[key];
- this.append(key, value);
- }
- }
- } else {
- throw new TypeError('Provided initializer must be an object');
- }
- }
-
- /**
- * Return combined header value given name
- *
- * @param String name Header name
- * @return Mixed
- */
- get(name) {
- name = `${name}`;
- validateName(name);
- const key = find(this[MAP], name);
- if (key === undefined) {
- return null;
- }
-
- return this[MAP][key].join(', ');
- }
-
- /**
- * Iterate over all headers
- *
- * @param Function callback Executed for each item with parameters (value, name, thisArg)
- * @param Boolean thisArg `this` context for callback function
- * @return Void
- */
- forEach(callback) {
- let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
-
- let pairs = getHeaders(this);
- let i = 0;
- while (i < pairs.length) {
- var _pairs$i = pairs[i];
- const name = _pairs$i[0],
- value = _pairs$i[1];
-
- callback.call(thisArg, value, name, this);
- pairs = getHeaders(this);
- i++;
- }
- }
-
- /**
- * Overwrite header values given name
- *
- * @param String name Header name
- * @param String value Header value
- * @return Void
- */
- set(name, value) {
- name = `${name}`;
- value = `${value}`;
- validateName(name);
- validateValue(value);
- const key = find(this[MAP], name);
- this[MAP][key !== undefined ? key : name] = [value];
- }
-
- /**
- * Append a value onto existing header
- *
- * @param String name Header name
- * @param String value Header value
- * @return Void
- */
- append(name, value) {
- name = `${name}`;
- value = `${value}`;
- validateName(name);
- validateValue(value);
- const key = find(this[MAP], name);
- if (key !== undefined) {
- this[MAP][key].push(value);
- } else {
- this[MAP][name] = [value];
- }
- }
-
- /**
- * Check for header name existence
- *
- * @param String name Header name
- * @return Boolean
- */
- has(name) {
- name = `${name}`;
- validateName(name);
- return find(this[MAP], name) !== undefined;
- }
-
- /**
- * Delete all header values given name
- *
- * @param String name Header name
- * @return Void
- */
- delete(name) {
- name = `${name}`;
- validateName(name);
- const key = find(this[MAP], name);
- if (key !== undefined) {
- delete this[MAP][key];
- }
- }
-
- /**
- * Return raw headers (non-spec api)
- *
- * @return Object
- */
- raw() {
- return this[MAP];
- }
-
- /**
- * Get an iterator on keys.
- *
- * @return Iterator
- */
- keys() {
- return createHeadersIterator(this, 'key');
- }
-
- /**
- * Get an iterator on values.
- *
- * @return Iterator
- */
- values() {
- return createHeadersIterator(this, 'value');
- }
-
- /**
- * Get an iterator on entries.
- *
- * This is the default iterator of the Headers object.
- *
- * @return Iterator
- */
- [Symbol.iterator]() {
- return createHeadersIterator(this, 'key+value');
- }
-}
-Headers.prototype.entries = Headers.prototype[Symbol.iterator];
-
-Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
- value: 'Headers',
- writable: false,
- enumerable: false,
- configurable: true
-});
-
-Object.defineProperties(Headers.prototype, {
- get: { enumerable: true },
- forEach: { enumerable: true },
- set: { enumerable: true },
- append: { enumerable: true },
- has: { enumerable: true },
- delete: { enumerable: true },
- keys: { enumerable: true },
- values: { enumerable: true },
- entries: { enumerable: true }
-});
-
-function getHeaders(headers) {
- let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
-
- const keys = Object.keys(headers[MAP]).sort();
- return keys.map(kind === 'key' ? function (k) {
- return k.toLowerCase();
- } : kind === 'value' ? function (k) {
- return headers[MAP][k].join(', ');
- } : function (k) {
- return [k.toLowerCase(), headers[MAP][k].join(', ')];
- });
-}
-
-const INTERNAL = Symbol('internal');
-
-function createHeadersIterator(target, kind) {
- const iterator = Object.create(HeadersIteratorPrototype);
- iterator[INTERNAL] = {
- target,
- kind,
- index: 0
- };
- return iterator;
-}
-
-const HeadersIteratorPrototype = Object.setPrototypeOf({
- next() {
- // istanbul ignore if
- if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
- throw new TypeError('Value of `this` is not a HeadersIterator');
- }
-
- var _INTERNAL = this[INTERNAL];
- const target = _INTERNAL.target,
- kind = _INTERNAL.kind,
- index = _INTERNAL.index;
-
- const values = getHeaders(target, kind);
- const len = values.length;
- if (index >= len) {
- return {
- value: undefined,
- done: true
- };
- }
-
- this[INTERNAL].index = index + 1;
-
- return {
- value: values[index],
- done: false
- };
- }
-}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
-
-Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
- value: 'HeadersIterator',
- writable: false,
- enumerable: false,
- configurable: true
-});
-
-/**
- * Export the Headers object in a form that Node.js can consume.
- *
- * @param Headers headers
- * @return Object
- */
-function exportNodeCompatibleHeaders(headers) {
- const obj = Object.assign({ __proto__: null }, headers[MAP]);
-
- // http.request() only supports string as Host header. This hack makes
- // specifying custom Host header possible.
- const hostHeaderKey = find(headers[MAP], 'Host');
- if (hostHeaderKey !== undefined) {
- obj[hostHeaderKey] = obj[hostHeaderKey][0];
- }
-
- return obj;
-}
-
-/**
- * Create a Headers object from an object of headers, ignoring those that do
- * not conform to HTTP grammar productions.
- *
- * @param Object obj Object of headers
- * @return Headers
- */
-function createHeadersLenient(obj) {
- const headers = new Headers();
- for (const name of Object.keys(obj)) {
- if (invalidTokenRegex.test(name)) {
- continue;
- }
- if (Array.isArray(obj[name])) {
- for (const val of obj[name]) {
- if (invalidHeaderCharRegex.test(val)) {
- continue;
- }
- if (headers[MAP][name] === undefined) {
- headers[MAP][name] = [val];
- } else {
- headers[MAP][name].push(val);
- }
- }
- } else if (!invalidHeaderCharRegex.test(obj[name])) {
- headers[MAP][name] = [obj[name]];
- }
- }
- return headers;
-}
-
-const INTERNALS$1 = Symbol('Response internals');
-
-// fix an issue where "STATUS_CODES" aren't a named export for node <10
-const STATUS_CODES = http.STATUS_CODES;
-
-/**
- * Response class
- *
- * @param Stream body Readable stream
- * @param Object opts Response options
- * @return Void
- */
-class Response {
- constructor() {
- let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
- let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
-
- Body.call(this, body, opts);
-
- const status = opts.status || 200;
- const headers = new Headers(opts.headers);
-
- if (body != null && !headers.has('Content-Type')) {
- const contentType = extractContentType(body);
- if (contentType) {
- headers.append('Content-Type', contentType);
- }
- }
-
- this[INTERNALS$1] = {
- url: opts.url,
- status,
- statusText: opts.statusText || STATUS_CODES[status],
- headers,
- counter: opts.counter
- };
- }
-
- get url() {
- return this[INTERNALS$1].url || '';
- }
-
- get status() {
- return this[INTERNALS$1].status;
- }
-
- /**
- * Convenience property representing if the request ended normally
- */
- get ok() {
- return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
- }
-
- get redirected() {
- return this[INTERNALS$1].counter > 0;
- }
-
- get statusText() {
- return this[INTERNALS$1].statusText;
- }
-
- get headers() {
- return this[INTERNALS$1].headers;
- }
-
- /**
- * Clone this response
- *
- * @return Response
- */
- clone() {
- return new Response(clone(this), {
- url: this.url,
- status: this.status,
- statusText: this.statusText,
- headers: this.headers,
- ok: this.ok,
- redirected: this.redirected
- });
- }
-}
-
-Body.mixIn(Response.prototype);
-
-Object.defineProperties(Response.prototype, {
- url: { enumerable: true },
- status: { enumerable: true },
- ok: { enumerable: true },
- redirected: { enumerable: true },
- statusText: { enumerable: true },
- headers: { enumerable: true },
- clone: { enumerable: true }
-});
-
-Object.defineProperty(Response.prototype, Symbol.toStringTag, {
- value: 'Response',
- writable: false,
- enumerable: false,
- configurable: true
-});
-
-const INTERNALS$2 = Symbol('Request internals');
-const URL = Url.URL || whatwgUrl.URL;
-
-// fix an issue where "format", "parse" aren't a named export for node <10
-const parse_url = Url.parse;
-const format_url = Url.format;
-
-/**
- * Wrapper around `new URL` to handle arbitrary URLs
- *
- * @param {string} urlStr
- * @return {void}
- */
-function parseURL(urlStr) {
- /*
- Check whether the URL is absolute or not
- Scheme: https://tools.ietf.org/html/rfc3986#section-3.1
- Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3
- */
- if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) {
- urlStr = new URL(urlStr).toString();
- }
-
- // Fallback to old implementation for arbitrary URLs
- return parse_url(urlStr);
-}
-
-const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
-
-/**
- * Check if a value is an instance of Request.
- *
- * @param Mixed input
- * @return Boolean
- */
-function isRequest(input) {
- return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
-}
-
-function isAbortSignal(signal) {
- const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
- return !!(proto && proto.constructor.name === 'AbortSignal');
-}
-
-/**
- * Request class
- *
- * @param Mixed input Url or Request instance
- * @param Object init Custom options
- * @return Void
- */
-class Request {
- constructor(input) {
- let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
-
- let parsedURL;
-
- // normalize input
- if (!isRequest(input)) {
- if (input && input.href) {
- // in order to support Node.js' Url objects; though WHATWG's URL objects
- // will fall into this branch also (since their `toString()` will return
- // `href` property anyway)
- parsedURL = parseURL(input.href);
- } else {
- // coerce input to a string before attempting to parse
- parsedURL = parseURL(`${input}`);
- }
- input = {};
- } else {
- parsedURL = parseURL(input.url);
- }
-
- let method = init.method || input.method || 'GET';
- method = method.toUpperCase();
-
- if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
- throw new TypeError('Request with GET/HEAD method cannot have body');
- }
-
- let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
-
- Body.call(this, inputBody, {
- timeout: init.timeout || input.timeout || 0,
- size: init.size || input.size || 0
- });
-
- const headers = new Headers(init.headers || input.headers || {});
-
- if (inputBody != null && !headers.has('Content-Type')) {
- const contentType = extractContentType(inputBody);
- if (contentType) {
- headers.append('Content-Type', contentType);
- }
- }
-
- let signal = isRequest(input) ? input.signal : null;
- if ('signal' in init) signal = init.signal;
-
- if (signal != null && !isAbortSignal(signal)) {
- throw new TypeError('Expected signal to be an instanceof AbortSignal');
- }
-
- this[INTERNALS$2] = {
- method,
- redirect: init.redirect || input.redirect || 'follow',
- headers,
- parsedURL,
- signal
- };
-
- // node-fetch-only options
- this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
- this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
- this.counter = init.counter || input.counter || 0;
- this.agent = init.agent || input.agent;
- }
-
- get method() {
- return this[INTERNALS$2].method;
- }
-
- get url() {
- return format_url(this[INTERNALS$2].parsedURL);
- }
-
- get headers() {
- return this[INTERNALS$2].headers;
- }
-
- get redirect() {
- return this[INTERNALS$2].redirect;
- }
-
- get signal() {
- return this[INTERNALS$2].signal;
- }
-
- /**
- * Clone this request
- *
- * @return Request
- */
- clone() {
- return new Request(this);
- }
-}
-
-Body.mixIn(Request.prototype);
-
-Object.defineProperty(Request.prototype, Symbol.toStringTag, {
- value: 'Request',
- writable: false,
- enumerable: false,
- configurable: true
-});
-
-Object.defineProperties(Request.prototype, {
- method: { enumerable: true },
- url: { enumerable: true },
- headers: { enumerable: true },
- redirect: { enumerable: true },
- clone: { enumerable: true },
- signal: { enumerable: true }
-});
-
-/**
- * Convert a Request to Node.js http request options.
- *
- * @param Request A Request instance
- * @return Object The options object to be passed to http.request
- */
-function getNodeRequestOptions(request) {
- const parsedURL = request[INTERNALS$2].parsedURL;
- const headers = new Headers(request[INTERNALS$2].headers);
-
- // fetch step 1.3
- if (!headers.has('Accept')) {
- headers.set('Accept', '*/*');
- }
-
- // Basic fetch
- if (!parsedURL.protocol || !parsedURL.hostname) {
- throw new TypeError('Only absolute URLs are supported');
- }
-
- if (!/^https?:$/.test(parsedURL.protocol)) {
- throw new TypeError('Only HTTP(S) protocols are supported');
- }
-
- if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
- throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
- }
-
- // HTTP-network-or-cache fetch steps 2.4-2.7
- let contentLengthValue = null;
- if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
- contentLengthValue = '0';
- }
- if (request.body != null) {
- const totalBytes = getTotalBytes(request);
- if (typeof totalBytes === 'number') {
- contentLengthValue = String(totalBytes);
- }
- }
- if (contentLengthValue) {
- headers.set('Content-Length', contentLengthValue);
- }
-
- // HTTP-network-or-cache fetch step 2.11
- if (!headers.has('User-Agent')) {
- headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
- }
-
- // HTTP-network-or-cache fetch step 2.15
- if (request.compress && !headers.has('Accept-Encoding')) {
- headers.set('Accept-Encoding', 'gzip,deflate');
- }
-
- let agent = request.agent;
- if (typeof agent === 'function') {
- agent = agent(parsedURL);
- }
-
- // HTTP-network fetch step 4.2
- // chunked encoding is handled by Node.js
-
- return Object.assign({}, parsedURL, {
- method: request.method,
- headers: exportNodeCompatibleHeaders(headers),
- agent
- });
-}
-
-/**
- * abort-error.js
- *
- * AbortError interface for cancelled requests
- */
-
-/**
- * Create AbortError instance
- *
- * @param String message Error message for human
- * @return AbortError
- */
-function AbortError(message) {
- Error.call(this, message);
-
- this.type = 'aborted';
- this.message = message;
-
- // hide custom error implementation details from end-users
- Error.captureStackTrace(this, this.constructor);
-}
-
-AbortError.prototype = Object.create(Error.prototype);
-AbortError.prototype.constructor = AbortError;
-AbortError.prototype.name = 'AbortError';
-
-const URL$1 = Url.URL || whatwgUrl.URL;
-
-// fix an issue where "PassThrough", "resolve" aren't a named export for node <10
-const PassThrough$1 = Stream.PassThrough;
-
-const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {
- const orig = new URL$1(original).hostname;
- const dest = new URL$1(destination).hostname;
-
- return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);
-};
-
-/**
- * isSameProtocol reports whether the two provided URLs use the same protocol.
- *
- * Both domains must already be in canonical form.
- * @param {string|URL} original
- * @param {string|URL} destination
- */
-const isSameProtocol = function isSameProtocol(destination, original) {
- const orig = new URL$1(original).protocol;
- const dest = new URL$1(destination).protocol;
-
- return orig === dest;
-};
-
-/**
- * Fetch function
- *
- * @param Mixed url Absolute url or Request instance
- * @param Object opts Fetch options
- * @return Promise
- */
-function fetch(url, opts) {
-
- // allow custom promise
- if (!fetch.Promise) {
- throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
- }
-
- Body.Promise = fetch.Promise;
-
- // wrap http.request into fetch
- return new fetch.Promise(function (resolve, reject) {
- // build request object
- const request = new Request(url, opts);
- const options = getNodeRequestOptions(request);
-
- const send = (options.protocol === 'https:' ? https : http).request;
- const signal = request.signal;
-
- let response = null;
-
- const abort = function abort() {
- let error = new AbortError('The user aborted a request.');
- reject(error);
- if (request.body && request.body instanceof Stream.Readable) {
- destroyStream(request.body, error);
- }
- if (!response || !response.body) return;
- response.body.emit('error', error);
- };
-
- if (signal && signal.aborted) {
- abort();
- return;
- }
-
- const abortAndFinalize = function abortAndFinalize() {
- abort();
- finalize();
- };
-
- // send request
- const req = send(options);
- let reqTimeout;
-
- if (signal) {
- signal.addEventListener('abort', abortAndFinalize);
- }
-
- function finalize() {
- req.abort();
- if (signal) signal.removeEventListener('abort', abortAndFinalize);
- clearTimeout(reqTimeout);
- }
-
- if (request.timeout) {
- req.once('socket', function (socket) {
- reqTimeout = setTimeout(function () {
- reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
- finalize();
- }, request.timeout);
- });
- }
-
- req.on('error', function (err) {
- reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
-
- if (response && response.body) {
- destroyStream(response.body, err);
- }
-
- finalize();
- });
-
- fixResponseChunkedTransferBadEnding(req, function (err) {
- if (signal && signal.aborted) {
- return;
- }
-
- if (response && response.body) {
- destroyStream(response.body, err);
- }
- });
-
- /* c8 ignore next 18 */
- if (parseInt(process.version.substring(1)) < 14) {
- // Before Node.js 14, pipeline() does not fully support async iterators and does not always
- // properly handle when the socket close/end events are out of order.
- req.on('socket', function (s) {
- s.addListener('close', function (hadError) {
- // if a data listener is still present we didn't end cleanly
- const hasDataListener = s.listenerCount('data') > 0;
-
- // if end happened before close but the socket didn't emit an error, do it now
- if (response && hasDataListener && !hadError && !(signal && signal.aborted)) {
- const err = new Error('Premature close');
- err.code = 'ERR_STREAM_PREMATURE_CLOSE';
- response.body.emit('error', err);
- }
- });
- });
- }
-
- req.on('response', function (res) {
- clearTimeout(reqTimeout);
-
- const headers = createHeadersLenient(res.headers);
-
- // HTTP fetch step 5
- if (fetch.isRedirect(res.statusCode)) {
- // HTTP fetch step 5.2
- const location = headers.get('Location');
-
- // HTTP fetch step 5.3
- let locationURL = null;
- try {
- locationURL = location === null ? null : new URL$1(location, request.url).toString();
- } catch (err) {
- // error here can only be invalid URL in Location: header
- // do not throw when options.redirect == manual
- // let the user extract the errorneous redirect URL
- if (request.redirect !== 'manual') {
- reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));
- finalize();
- return;
- }
- }
-
- // HTTP fetch step 5.5
- switch (request.redirect) {
- case 'error':
- reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));
- finalize();
- return;
- case 'manual':
- // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
- if (locationURL !== null) {
- // handle corrupted header
- try {
- headers.set('Location', locationURL);
- } catch (err) {
- // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
- reject(err);
- }
- }
- break;
- case 'follow':
- // HTTP-redirect fetch step 2
- if (locationURL === null) {
- break;
- }
-
- // HTTP-redirect fetch step 5
- if (request.counter >= request.follow) {
- reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
- finalize();
- return;
- }
-
- // HTTP-redirect fetch step 6 (counter increment)
- // Create a new Request object.
- const requestOpts = {
- headers: new Headers(request.headers),
- follow: request.follow,
- counter: request.counter + 1,
- agent: request.agent,
- compress: request.compress,
- method: request.method,
- body: request.body,
- signal: request.signal,
- timeout: request.timeout,
- size: request.size
- };
-
- if (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) {
- for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {
- requestOpts.headers.delete(name);
- }
- }
-
- // HTTP-redirect fetch step 9
- if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
- reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
- finalize();
- return;
- }
-
- // HTTP-redirect fetch step 11
- if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
- requestOpts.method = 'GET';
- requestOpts.body = undefined;
- requestOpts.headers.delete('content-length');
- }
-
- // HTTP-redirect fetch step 15
- resolve(fetch(new Request(locationURL, requestOpts)));
- finalize();
- return;
- }
- }
-
- // prepare response
- res.once('end', function () {
- if (signal) signal.removeEventListener('abort', abortAndFinalize);
- });
- let body = res.pipe(new PassThrough$1());
-
- const response_options = {
- url: request.url,
- status: res.statusCode,
- statusText: res.statusMessage,
- headers: headers,
- size: request.size,
- timeout: request.timeout,
- counter: request.counter
- };
-
- // HTTP-network fetch step 12.1.1.3
- const codings = headers.get('Content-Encoding');
-
- // HTTP-network fetch step 12.1.1.4: handle content codings
-
- // in following scenarios we ignore compression support
- // 1. compression support is disabled
- // 2. HEAD request
- // 3. no Content-Encoding header
- // 4. no content response (204)
- // 5. content not modified response (304)
- if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
- response = new Response(body, response_options);
- resolve(response);
- return;
- }
-
- // For Node v6+
- // Be less strict when decoding compressed responses, since sometimes
- // servers send slightly invalid responses that are still accepted
- // by common browsers.
- // Always using Z_SYNC_FLUSH is what cURL does.
- const zlibOptions = {
- flush: zlib.Z_SYNC_FLUSH,
- finishFlush: zlib.Z_SYNC_FLUSH
- };
-
- // for gzip
- if (codings == 'gzip' || codings == 'x-gzip') {
- body = body.pipe(zlib.createGunzip(zlibOptions));
- response = new Response(body, response_options);
- resolve(response);
- return;
- }
-
- // for deflate
- if (codings == 'deflate' || codings == 'x-deflate') {
- // handle the infamous raw deflate response from old servers
- // a hack for old IIS and Apache servers
- const raw = res.pipe(new PassThrough$1());
- raw.once('data', function (chunk) {
- // see http://stackoverflow.com/questions/37519828
- if ((chunk[0] & 0x0F) === 0x08) {
- body = body.pipe(zlib.createInflate());
- } else {
- body = body.pipe(zlib.createInflateRaw());
- }
- response = new Response(body, response_options);
- resolve(response);
- });
- raw.on('end', function () {
- // some old IIS servers return zero-length OK deflate responses, so 'data' is never emitted.
- if (!response) {
- response = new Response(body, response_options);
- resolve(response);
- }
- });
- return;
- }
-
- // for br
- if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
- body = body.pipe(zlib.createBrotliDecompress());
- response = new Response(body, response_options);
- resolve(response);
- return;
- }
-
- // otherwise, use response as-is
- response = new Response(body, response_options);
- resolve(response);
- });
-
- writeToStream(req, request);
- });
-}
-function fixResponseChunkedTransferBadEnding(request, errorCallback) {
- let socket;
-
- request.on('socket', function (s) {
- socket = s;
- });
-
- request.on('response', function (response) {
- const headers = response.headers;
-
- if (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) {
- response.once('close', function (hadError) {
- // tests for socket presence, as in some situations the
- // the 'socket' event is not triggered for the request
- // (happens in deno), avoids `TypeError`
- // if a data listener is still present we didn't end cleanly
- const hasDataListener = socket && socket.listenerCount('data') > 0;
-
- if (hasDataListener && !hadError) {
- const err = new Error('Premature close');
- err.code = 'ERR_STREAM_PREMATURE_CLOSE';
- errorCallback(err);
- }
- });
- }
- });
-}
-
-function destroyStream(stream, err) {
- if (stream.destroy) {
- stream.destroy(err);
- } else {
- // node < 8
- stream.emit('error', err);
- stream.end();
- }
-}
-
-/**
- * Redirect code matching
- *
- * @param Number code Status code
- * @return Boolean
- */
-fetch.isRedirect = function (code) {
- return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
-};
-
-// expose Promise
-fetch.Promise = global.Promise;
-
-export default fetch;
-export { Headers, Request, Response, FetchError, AbortError };
diff --git a/node_modules/node-fetch/lib/index.js b/node_modules/node-fetch/lib/index.js
deleted file mode 100644
index 567ff5d..0000000
--- a/node_modules/node-fetch/lib/index.js
+++ /dev/null
@@ -1,1787 +0,0 @@
-'use strict';
-
-Object.defineProperty(exports, '__esModule', { value: true });
-
-function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
-
-var Stream = _interopDefault(require('stream'));
-var http = _interopDefault(require('http'));
-var Url = _interopDefault(require('url'));
-var whatwgUrl = _interopDefault(require('whatwg-url'));
-var https = _interopDefault(require('https'));
-var zlib = _interopDefault(require('zlib'));
-
-// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
-
-// fix for "Readable" isn't a named export issue
-const Readable = Stream.Readable;
-
-const BUFFER = Symbol('buffer');
-const TYPE = Symbol('type');
-
-class Blob {
- constructor() {
- this[TYPE] = '';
-
- const blobParts = arguments[0];
- const options = arguments[1];
-
- const buffers = [];
- let size = 0;
-
- if (blobParts) {
- const a = blobParts;
- const length = Number(a.length);
- for (let i = 0; i < length; i++) {
- const element = a[i];
- let buffer;
- if (element instanceof Buffer) {
- buffer = element;
- } else if (ArrayBuffer.isView(element)) {
- buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
- } else if (element instanceof ArrayBuffer) {
- buffer = Buffer.from(element);
- } else if (element instanceof Blob) {
- buffer = element[BUFFER];
- } else {
- buffer = Buffer.from(typeof element === 'string' ? element : String(element));
- }
- size += buffer.length;
- buffers.push(buffer);
- }
- }
-
- this[BUFFER] = Buffer.concat(buffers);
-
- let type = options && options.type !== undefined && String(options.type).toLowerCase();
- if (type && !/[^\u0020-\u007E]/.test(type)) {
- this[TYPE] = type;
- }
- }
- get size() {
- return this[BUFFER].length;
- }
- get type() {
- return this[TYPE];
- }
- text() {
- return Promise.resolve(this[BUFFER].toString());
- }
- arrayBuffer() {
- const buf = this[BUFFER];
- const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
- return Promise.resolve(ab);
- }
- stream() {
- const readable = new Readable();
- readable._read = function () {};
- readable.push(this[BUFFER]);
- readable.push(null);
- return readable;
- }
- toString() {
- return '[object Blob]';
- }
- slice() {
- const size = this.size;
-
- const start = arguments[0];
- const end = arguments[1];
- let relativeStart, relativeEnd;
- if (start === undefined) {
- relativeStart = 0;
- } else if (start < 0) {
- relativeStart = Math.max(size + start, 0);
- } else {
- relativeStart = Math.min(start, size);
- }
- if (end === undefined) {
- relativeEnd = size;
- } else if (end < 0) {
- relativeEnd = Math.max(size + end, 0);
- } else {
- relativeEnd = Math.min(end, size);
- }
- const span = Math.max(relativeEnd - relativeStart, 0);
-
- const buffer = this[BUFFER];
- const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
- const blob = new Blob([], { type: arguments[2] });
- blob[BUFFER] = slicedBuffer;
- return blob;
- }
-}
-
-Object.defineProperties(Blob.prototype, {
- size: { enumerable: true },
- type: { enumerable: true },
- slice: { enumerable: true }
-});
-
-Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
- value: 'Blob',
- writable: false,
- enumerable: false,
- configurable: true
-});
-
-/**
- * fetch-error.js
- *
- * FetchError interface for operational errors
- */
-
-/**
- * Create FetchError instance
- *
- * @param String message Error message for human
- * @param String type Error type for machine
- * @param String systemError For Node.js system error
- * @return FetchError
- */
-function FetchError(message, type, systemError) {
- Error.call(this, message);
-
- this.message = message;
- this.type = type;
-
- // when err.type is `system`, err.code contains system error code
- if (systemError) {
- this.code = this.errno = systemError.code;
- }
-
- // hide custom error implementation details from end-users
- Error.captureStackTrace(this, this.constructor);
-}
-
-FetchError.prototype = Object.create(Error.prototype);
-FetchError.prototype.constructor = FetchError;
-FetchError.prototype.name = 'FetchError';
-
-let convert;
-try {
- convert = require('encoding').convert;
-} catch (e) {}
-
-const INTERNALS = Symbol('Body internals');
-
-// fix an issue where "PassThrough" isn't a named export for node <10
-const PassThrough = Stream.PassThrough;
-
-/**
- * Body mixin
- *
- * Ref: https://fetch.spec.whatwg.org/#body
- *
- * @param Stream body Readable stream
- * @param Object opts Response options
- * @return Void
- */
-function Body(body) {
- var _this = this;
-
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
- _ref$size = _ref.size;
-
- let size = _ref$size === undefined ? 0 : _ref$size;
- var _ref$timeout = _ref.timeout;
- let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
-
- if (body == null) {
- // body is undefined or null
- body = null;
- } else if (isURLSearchParams(body)) {
- // body is a URLSearchParams
- body = Buffer.from(body.toString());
- } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
- // body is ArrayBuffer
- body = Buffer.from(body);
- } else if (ArrayBuffer.isView(body)) {
- // body is ArrayBufferView
- body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
- } else if (body instanceof Stream) ; else {
- // none of the above
- // coerce to string then buffer
- body = Buffer.from(String(body));
- }
- this[INTERNALS] = {
- body,
- disturbed: false,
- error: null
- };
- this.size = size;
- this.timeout = timeout;
-
- if (body instanceof Stream) {
- body.on('error', function (err) {
- const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
- _this[INTERNALS].error = error;
- });
- }
-}
-
-Body.prototype = {
- get body() {
- return this[INTERNALS].body;
- },
-
- get bodyUsed() {
- return this[INTERNALS].disturbed;
- },
-
- /**
- * Decode response as ArrayBuffer
- *
- * @return Promise
- */
- arrayBuffer() {
- return consumeBody.call(this).then(function (buf) {
- return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
- });
- },
-
- /**
- * Return raw response as Blob
- *
- * @return Promise
- */
- blob() {
- let ct = this.headers && this.headers.get('content-type') || '';
- return consumeBody.call(this).then(function (buf) {
- return Object.assign(
- // Prevent copying
- new Blob([], {
- type: ct.toLowerCase()
- }), {
- [BUFFER]: buf
- });
- });
- },
-
- /**
- * Decode response as json
- *
- * @return Promise
- */
- json() {
- var _this2 = this;
-
- return consumeBody.call(this).then(function (buffer) {
- try {
- return JSON.parse(buffer.toString());
- } catch (err) {
- return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
- }
- });
- },
-
- /**
- * Decode response as text
- *
- * @return Promise
- */
- text() {
- return consumeBody.call(this).then(function (buffer) {
- return buffer.toString();
- });
- },
-
- /**
- * Decode response as buffer (non-spec api)
- *
- * @return Promise
- */
- buffer() {
- return consumeBody.call(this);
- },
-
- /**
- * Decode response as text, while automatically detecting the encoding and
- * trying to decode to UTF-8 (non-spec api)
- *
- * @return Promise
- */
- textConverted() {
- var _this3 = this;
-
- return consumeBody.call(this).then(function (buffer) {
- return convertBody(buffer, _this3.headers);
- });
- }
-};
-
-// In browsers, all properties are enumerable.
-Object.defineProperties(Body.prototype, {
- body: { enumerable: true },
- bodyUsed: { enumerable: true },
- arrayBuffer: { enumerable: true },
- blob: { enumerable: true },
- json: { enumerable: true },
- text: { enumerable: true }
-});
-
-Body.mixIn = function (proto) {
- for (const name of Object.getOwnPropertyNames(Body.prototype)) {
- // istanbul ignore else: future proof
- if (!(name in proto)) {
- const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
- Object.defineProperty(proto, name, desc);
- }
- }
-};
-
-/**
- * Consume and convert an entire Body to a Buffer.
- *
- * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
- *
- * @return Promise
- */
-function consumeBody() {
- var _this4 = this;
-
- if (this[INTERNALS].disturbed) {
- return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
- }
-
- this[INTERNALS].disturbed = true;
-
- if (this[INTERNALS].error) {
- return Body.Promise.reject(this[INTERNALS].error);
- }
-
- let body = this.body;
-
- // body is null
- if (body === null) {
- return Body.Promise.resolve(Buffer.alloc(0));
- }
-
- // body is blob
- if (isBlob(body)) {
- body = body.stream();
- }
-
- // body is buffer
- if (Buffer.isBuffer(body)) {
- return Body.Promise.resolve(body);
- }
-
- // istanbul ignore if: should never happen
- if (!(body instanceof Stream)) {
- return Body.Promise.resolve(Buffer.alloc(0));
- }
-
- // body is stream
- // get ready to actually consume the body
- let accum = [];
- let accumBytes = 0;
- let abort = false;
-
- return new Body.Promise(function (resolve, reject) {
- let resTimeout;
-
- // allow timeout on slow response body
- if (_this4.timeout) {
- resTimeout = setTimeout(function () {
- abort = true;
- reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
- }, _this4.timeout);
- }
-
- // handle stream errors
- body.on('error', function (err) {
- if (err.name === 'AbortError') {
- // if the request was aborted, reject with this Error
- abort = true;
- reject(err);
- } else {
- // other errors, such as incorrect content-encoding
- reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
- }
- });
-
- body.on('data', function (chunk) {
- if (abort || chunk === null) {
- return;
- }
-
- if (_this4.size && accumBytes + chunk.length > _this4.size) {
- abort = true;
- reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
- return;
- }
-
- accumBytes += chunk.length;
- accum.push(chunk);
- });
-
- body.on('end', function () {
- if (abort) {
- return;
- }
-
- clearTimeout(resTimeout);
-
- try {
- resolve(Buffer.concat(accum, accumBytes));
- } catch (err) {
- // handle streams that have accumulated too much data (issue #414)
- reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
- }
- });
- });
-}
-
-/**
- * Detect buffer encoding and convert to target encoding
- * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
- *
- * @param Buffer buffer Incoming buffer
- * @param String encoding Target encoding
- * @return String
- */
-function convertBody(buffer, headers) {
- if (typeof convert !== 'function') {
- throw new Error('The package `encoding` must be installed to use the textConverted() function');
- }
-
- const ct = headers.get('content-type');
- let charset = 'utf-8';
- let res, str;
-
- // header
- if (ct) {
- res = /charset=([^;]*)/i.exec(ct);
- }
-
- // no charset in content type, peek at response body for at most 1024 bytes
- str = buffer.slice(0, 1024).toString();
-
- // html5
- if (!res && str) {
- res = / 0 && arguments[0] !== undefined ? arguments[0] : undefined;
-
- this[MAP] = Object.create(null);
-
- if (init instanceof Headers) {
- const rawHeaders = init.raw();
- const headerNames = Object.keys(rawHeaders);
-
- for (const headerName of headerNames) {
- for (const value of rawHeaders[headerName]) {
- this.append(headerName, value);
- }
- }
-
- return;
- }
-
- // We don't worry about converting prop to ByteString here as append()
- // will handle it.
- if (init == null) ; else if (typeof init === 'object') {
- const method = init[Symbol.iterator];
- if (method != null) {
- if (typeof method !== 'function') {
- throw new TypeError('Header pairs must be iterable');
- }
-
- // sequence>
- // Note: per spec we have to first exhaust the lists then process them
- const pairs = [];
- for (const pair of init) {
- if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
- throw new TypeError('Each header pair must be iterable');
- }
- pairs.push(Array.from(pair));
- }
-
- for (const pair of pairs) {
- if (pair.length !== 2) {
- throw new TypeError('Each header pair must be a name/value tuple');
- }
- this.append(pair[0], pair[1]);
- }
- } else {
- // record
- for (const key of Object.keys(init)) {
- const value = init[key];
- this.append(key, value);
- }
- }
- } else {
- throw new TypeError('Provided initializer must be an object');
- }
- }
-
- /**
- * Return combined header value given name
- *
- * @param String name Header name
- * @return Mixed
- */
- get(name) {
- name = `${name}`;
- validateName(name);
- const key = find(this[MAP], name);
- if (key === undefined) {
- return null;
- }
-
- return this[MAP][key].join(', ');
- }
-
- /**
- * Iterate over all headers
- *
- * @param Function callback Executed for each item with parameters (value, name, thisArg)
- * @param Boolean thisArg `this` context for callback function
- * @return Void
- */
- forEach(callback) {
- let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
-
- let pairs = getHeaders(this);
- let i = 0;
- while (i < pairs.length) {
- var _pairs$i = pairs[i];
- const name = _pairs$i[0],
- value = _pairs$i[1];
-
- callback.call(thisArg, value, name, this);
- pairs = getHeaders(this);
- i++;
- }
- }
-
- /**
- * Overwrite header values given name
- *
- * @param String name Header name
- * @param String value Header value
- * @return Void
- */
- set(name, value) {
- name = `${name}`;
- value = `${value}`;
- validateName(name);
- validateValue(value);
- const key = find(this[MAP], name);
- this[MAP][key !== undefined ? key : name] = [value];
- }
-
- /**
- * Append a value onto existing header
- *
- * @param String name Header name
- * @param String value Header value
- * @return Void
- */
- append(name, value) {
- name = `${name}`;
- value = `${value}`;
- validateName(name);
- validateValue(value);
- const key = find(this[MAP], name);
- if (key !== undefined) {
- this[MAP][key].push(value);
- } else {
- this[MAP][name] = [value];
- }
- }
-
- /**
- * Check for header name existence
- *
- * @param String name Header name
- * @return Boolean
- */
- has(name) {
- name = `${name}`;
- validateName(name);
- return find(this[MAP], name) !== undefined;
- }
-
- /**
- * Delete all header values given name
- *
- * @param String name Header name
- * @return Void
- */
- delete(name) {
- name = `${name}`;
- validateName(name);
- const key = find(this[MAP], name);
- if (key !== undefined) {
- delete this[MAP][key];
- }
- }
-
- /**
- * Return raw headers (non-spec api)
- *
- * @return Object
- */
- raw() {
- return this[MAP];
- }
-
- /**
- * Get an iterator on keys.
- *
- * @return Iterator
- */
- keys() {
- return createHeadersIterator(this, 'key');
- }
-
- /**
- * Get an iterator on values.
- *
- * @return Iterator
- */
- values() {
- return createHeadersIterator(this, 'value');
- }
-
- /**
- * Get an iterator on entries.
- *
- * This is the default iterator of the Headers object.
- *
- * @return Iterator
- */
- [Symbol.iterator]() {
- return createHeadersIterator(this, 'key+value');
- }
-}
-Headers.prototype.entries = Headers.prototype[Symbol.iterator];
-
-Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
- value: 'Headers',
- writable: false,
- enumerable: false,
- configurable: true
-});
-
-Object.defineProperties(Headers.prototype, {
- get: { enumerable: true },
- forEach: { enumerable: true },
- set: { enumerable: true },
- append: { enumerable: true },
- has: { enumerable: true },
- delete: { enumerable: true },
- keys: { enumerable: true },
- values: { enumerable: true },
- entries: { enumerable: true }
-});
-
-function getHeaders(headers) {
- let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
-
- const keys = Object.keys(headers[MAP]).sort();
- return keys.map(kind === 'key' ? function (k) {
- return k.toLowerCase();
- } : kind === 'value' ? function (k) {
- return headers[MAP][k].join(', ');
- } : function (k) {
- return [k.toLowerCase(), headers[MAP][k].join(', ')];
- });
-}
-
-const INTERNAL = Symbol('internal');
-
-function createHeadersIterator(target, kind) {
- const iterator = Object.create(HeadersIteratorPrototype);
- iterator[INTERNAL] = {
- target,
- kind,
- index: 0
- };
- return iterator;
-}
-
-const HeadersIteratorPrototype = Object.setPrototypeOf({
- next() {
- // istanbul ignore if
- if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
- throw new TypeError('Value of `this` is not a HeadersIterator');
- }
-
- var _INTERNAL = this[INTERNAL];
- const target = _INTERNAL.target,
- kind = _INTERNAL.kind,
- index = _INTERNAL.index;
-
- const values = getHeaders(target, kind);
- const len = values.length;
- if (index >= len) {
- return {
- value: undefined,
- done: true
- };
- }
-
- this[INTERNAL].index = index + 1;
-
- return {
- value: values[index],
- done: false
- };
- }
-}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
-
-Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
- value: 'HeadersIterator',
- writable: false,
- enumerable: false,
- configurable: true
-});
-
-/**
- * Export the Headers object in a form that Node.js can consume.
- *
- * @param Headers headers
- * @return Object
- */
-function exportNodeCompatibleHeaders(headers) {
- const obj = Object.assign({ __proto__: null }, headers[MAP]);
-
- // http.request() only supports string as Host header. This hack makes
- // specifying custom Host header possible.
- const hostHeaderKey = find(headers[MAP], 'Host');
- if (hostHeaderKey !== undefined) {
- obj[hostHeaderKey] = obj[hostHeaderKey][0];
- }
-
- return obj;
-}
-
-/**
- * Create a Headers object from an object of headers, ignoring those that do
- * not conform to HTTP grammar productions.
- *
- * @param Object obj Object of headers
- * @return Headers
- */
-function createHeadersLenient(obj) {
- const headers = new Headers();
- for (const name of Object.keys(obj)) {
- if (invalidTokenRegex.test(name)) {
- continue;
- }
- if (Array.isArray(obj[name])) {
- for (const val of obj[name]) {
- if (invalidHeaderCharRegex.test(val)) {
- continue;
- }
- if (headers[MAP][name] === undefined) {
- headers[MAP][name] = [val];
- } else {
- headers[MAP][name].push(val);
- }
- }
- } else if (!invalidHeaderCharRegex.test(obj[name])) {
- headers[MAP][name] = [obj[name]];
- }
- }
- return headers;
-}
-
-const INTERNALS$1 = Symbol('Response internals');
-
-// fix an issue where "STATUS_CODES" aren't a named export for node <10
-const STATUS_CODES = http.STATUS_CODES;
-
-/**
- * Response class
- *
- * @param Stream body Readable stream
- * @param Object opts Response options
- * @return Void
- */
-class Response {
- constructor() {
- let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
- let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
-
- Body.call(this, body, opts);
-
- const status = opts.status || 200;
- const headers = new Headers(opts.headers);
-
- if (body != null && !headers.has('Content-Type')) {
- const contentType = extractContentType(body);
- if (contentType) {
- headers.append('Content-Type', contentType);
- }
- }
-
- this[INTERNALS$1] = {
- url: opts.url,
- status,
- statusText: opts.statusText || STATUS_CODES[status],
- headers,
- counter: opts.counter
- };
- }
-
- get url() {
- return this[INTERNALS$1].url || '';
- }
-
- get status() {
- return this[INTERNALS$1].status;
- }
-
- /**
- * Convenience property representing if the request ended normally
- */
- get ok() {
- return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
- }
-
- get redirected() {
- return this[INTERNALS$1].counter > 0;
- }
-
- get statusText() {
- return this[INTERNALS$1].statusText;
- }
-
- get headers() {
- return this[INTERNALS$1].headers;
- }
-
- /**
- * Clone this response
- *
- * @return Response
- */
- clone() {
- return new Response(clone(this), {
- url: this.url,
- status: this.status,
- statusText: this.statusText,
- headers: this.headers,
- ok: this.ok,
- redirected: this.redirected
- });
- }
-}
-
-Body.mixIn(Response.prototype);
-
-Object.defineProperties(Response.prototype, {
- url: { enumerable: true },
- status: { enumerable: true },
- ok: { enumerable: true },
- redirected: { enumerable: true },
- statusText: { enumerable: true },
- headers: { enumerable: true },
- clone: { enumerable: true }
-});
-
-Object.defineProperty(Response.prototype, Symbol.toStringTag, {
- value: 'Response',
- writable: false,
- enumerable: false,
- configurable: true
-});
-
-const INTERNALS$2 = Symbol('Request internals');
-const URL = Url.URL || whatwgUrl.URL;
-
-// fix an issue where "format", "parse" aren't a named export for node <10
-const parse_url = Url.parse;
-const format_url = Url.format;
-
-/**
- * Wrapper around `new URL` to handle arbitrary URLs
- *
- * @param {string} urlStr
- * @return {void}
- */
-function parseURL(urlStr) {
- /*
- Check whether the URL is absolute or not
- Scheme: https://tools.ietf.org/html/rfc3986#section-3.1
- Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3
- */
- if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) {
- urlStr = new URL(urlStr).toString();
- }
-
- // Fallback to old implementation for arbitrary URLs
- return parse_url(urlStr);
-}
-
-const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
-
-/**
- * Check if a value is an instance of Request.
- *
- * @param Mixed input
- * @return Boolean
- */
-function isRequest(input) {
- return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
-}
-
-function isAbortSignal(signal) {
- const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
- return !!(proto && proto.constructor.name === 'AbortSignal');
-}
-
-/**
- * Request class
- *
- * @param Mixed input Url or Request instance
- * @param Object init Custom options
- * @return Void
- */
-class Request {
- constructor(input) {
- let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
-
- let parsedURL;
-
- // normalize input
- if (!isRequest(input)) {
- if (input && input.href) {
- // in order to support Node.js' Url objects; though WHATWG's URL objects
- // will fall into this branch also (since their `toString()` will return
- // `href` property anyway)
- parsedURL = parseURL(input.href);
- } else {
- // coerce input to a string before attempting to parse
- parsedURL = parseURL(`${input}`);
- }
- input = {};
- } else {
- parsedURL = parseURL(input.url);
- }
-
- let method = init.method || input.method || 'GET';
- method = method.toUpperCase();
-
- if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
- throw new TypeError('Request with GET/HEAD method cannot have body');
- }
-
- let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
-
- Body.call(this, inputBody, {
- timeout: init.timeout || input.timeout || 0,
- size: init.size || input.size || 0
- });
-
- const headers = new Headers(init.headers || input.headers || {});
-
- if (inputBody != null && !headers.has('Content-Type')) {
- const contentType = extractContentType(inputBody);
- if (contentType) {
- headers.append('Content-Type', contentType);
- }
- }
-
- let signal = isRequest(input) ? input.signal : null;
- if ('signal' in init) signal = init.signal;
-
- if (signal != null && !isAbortSignal(signal)) {
- throw new TypeError('Expected signal to be an instanceof AbortSignal');
- }
-
- this[INTERNALS$2] = {
- method,
- redirect: init.redirect || input.redirect || 'follow',
- headers,
- parsedURL,
- signal
- };
-
- // node-fetch-only options
- this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
- this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
- this.counter = init.counter || input.counter || 0;
- this.agent = init.agent || input.agent;
- }
-
- get method() {
- return this[INTERNALS$2].method;
- }
-
- get url() {
- return format_url(this[INTERNALS$2].parsedURL);
- }
-
- get headers() {
- return this[INTERNALS$2].headers;
- }
-
- get redirect() {
- return this[INTERNALS$2].redirect;
- }
-
- get signal() {
- return this[INTERNALS$2].signal;
- }
-
- /**
- * Clone this request
- *
- * @return Request
- */
- clone() {
- return new Request(this);
- }
-}
-
-Body.mixIn(Request.prototype);
-
-Object.defineProperty(Request.prototype, Symbol.toStringTag, {
- value: 'Request',
- writable: false,
- enumerable: false,
- configurable: true
-});
-
-Object.defineProperties(Request.prototype, {
- method: { enumerable: true },
- url: { enumerable: true },
- headers: { enumerable: true },
- redirect: { enumerable: true },
- clone: { enumerable: true },
- signal: { enumerable: true }
-});
-
-/**
- * Convert a Request to Node.js http request options.
- *
- * @param Request A Request instance
- * @return Object The options object to be passed to http.request
- */
-function getNodeRequestOptions(request) {
- const parsedURL = request[INTERNALS$2].parsedURL;
- const headers = new Headers(request[INTERNALS$2].headers);
-
- // fetch step 1.3
- if (!headers.has('Accept')) {
- headers.set('Accept', '*/*');
- }
-
- // Basic fetch
- if (!parsedURL.protocol || !parsedURL.hostname) {
- throw new TypeError('Only absolute URLs are supported');
- }
-
- if (!/^https?:$/.test(parsedURL.protocol)) {
- throw new TypeError('Only HTTP(S) protocols are supported');
- }
-
- if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
- throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
- }
-
- // HTTP-network-or-cache fetch steps 2.4-2.7
- let contentLengthValue = null;
- if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
- contentLengthValue = '0';
- }
- if (request.body != null) {
- const totalBytes = getTotalBytes(request);
- if (typeof totalBytes === 'number') {
- contentLengthValue = String(totalBytes);
- }
- }
- if (contentLengthValue) {
- headers.set('Content-Length', contentLengthValue);
- }
-
- // HTTP-network-or-cache fetch step 2.11
- if (!headers.has('User-Agent')) {
- headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
- }
-
- // HTTP-network-or-cache fetch step 2.15
- if (request.compress && !headers.has('Accept-Encoding')) {
- headers.set('Accept-Encoding', 'gzip,deflate');
- }
-
- let agent = request.agent;
- if (typeof agent === 'function') {
- agent = agent(parsedURL);
- }
-
- // HTTP-network fetch step 4.2
- // chunked encoding is handled by Node.js
-
- return Object.assign({}, parsedURL, {
- method: request.method,
- headers: exportNodeCompatibleHeaders(headers),
- agent
- });
-}
-
-/**
- * abort-error.js
- *
- * AbortError interface for cancelled requests
- */
-
-/**
- * Create AbortError instance
- *
- * @param String message Error message for human
- * @return AbortError
- */
-function AbortError(message) {
- Error.call(this, message);
-
- this.type = 'aborted';
- this.message = message;
-
- // hide custom error implementation details from end-users
- Error.captureStackTrace(this, this.constructor);
-}
-
-AbortError.prototype = Object.create(Error.prototype);
-AbortError.prototype.constructor = AbortError;
-AbortError.prototype.name = 'AbortError';
-
-const URL$1 = Url.URL || whatwgUrl.URL;
-
-// fix an issue where "PassThrough", "resolve" aren't a named export for node <10
-const PassThrough$1 = Stream.PassThrough;
-
-const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {
- const orig = new URL$1(original).hostname;
- const dest = new URL$1(destination).hostname;
-
- return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);
-};
-
-/**
- * isSameProtocol reports whether the two provided URLs use the same protocol.
- *
- * Both domains must already be in canonical form.
- * @param {string|URL} original
- * @param {string|URL} destination
- */
-const isSameProtocol = function isSameProtocol(destination, original) {
- const orig = new URL$1(original).protocol;
- const dest = new URL$1(destination).protocol;
-
- return orig === dest;
-};
-
-/**
- * Fetch function
- *
- * @param Mixed url Absolute url or Request instance
- * @param Object opts Fetch options
- * @return Promise
- */
-function fetch(url, opts) {
-
- // allow custom promise
- if (!fetch.Promise) {
- throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
- }
-
- Body.Promise = fetch.Promise;
-
- // wrap http.request into fetch
- return new fetch.Promise(function (resolve, reject) {
- // build request object
- const request = new Request(url, opts);
- const options = getNodeRequestOptions(request);
-
- const send = (options.protocol === 'https:' ? https : http).request;
- const signal = request.signal;
-
- let response = null;
-
- const abort = function abort() {
- let error = new AbortError('The user aborted a request.');
- reject(error);
- if (request.body && request.body instanceof Stream.Readable) {
- destroyStream(request.body, error);
- }
- if (!response || !response.body) return;
- response.body.emit('error', error);
- };
-
- if (signal && signal.aborted) {
- abort();
- return;
- }
-
- const abortAndFinalize = function abortAndFinalize() {
- abort();
- finalize();
- };
-
- // send request
- const req = send(options);
- let reqTimeout;
-
- if (signal) {
- signal.addEventListener('abort', abortAndFinalize);
- }
-
- function finalize() {
- req.abort();
- if (signal) signal.removeEventListener('abort', abortAndFinalize);
- clearTimeout(reqTimeout);
- }
-
- if (request.timeout) {
- req.once('socket', function (socket) {
- reqTimeout = setTimeout(function () {
- reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
- finalize();
- }, request.timeout);
- });
- }
-
- req.on('error', function (err) {
- reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
-
- if (response && response.body) {
- destroyStream(response.body, err);
- }
-
- finalize();
- });
-
- fixResponseChunkedTransferBadEnding(req, function (err) {
- if (signal && signal.aborted) {
- return;
- }
-
- if (response && response.body) {
- destroyStream(response.body, err);
- }
- });
-
- /* c8 ignore next 18 */
- if (parseInt(process.version.substring(1)) < 14) {
- // Before Node.js 14, pipeline() does not fully support async iterators and does not always
- // properly handle when the socket close/end events are out of order.
- req.on('socket', function (s) {
- s.addListener('close', function (hadError) {
- // if a data listener is still present we didn't end cleanly
- const hasDataListener = s.listenerCount('data') > 0;
-
- // if end happened before close but the socket didn't emit an error, do it now
- if (response && hasDataListener && !hadError && !(signal && signal.aborted)) {
- const err = new Error('Premature close');
- err.code = 'ERR_STREAM_PREMATURE_CLOSE';
- response.body.emit('error', err);
- }
- });
- });
- }
-
- req.on('response', function (res) {
- clearTimeout(reqTimeout);
-
- const headers = createHeadersLenient(res.headers);
-
- // HTTP fetch step 5
- if (fetch.isRedirect(res.statusCode)) {
- // HTTP fetch step 5.2
- const location = headers.get('Location');
-
- // HTTP fetch step 5.3
- let locationURL = null;
- try {
- locationURL = location === null ? null : new URL$1(location, request.url).toString();
- } catch (err) {
- // error here can only be invalid URL in Location: header
- // do not throw when options.redirect == manual
- // let the user extract the errorneous redirect URL
- if (request.redirect !== 'manual') {
- reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));
- finalize();
- return;
- }
- }
-
- // HTTP fetch step 5.5
- switch (request.redirect) {
- case 'error':
- reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));
- finalize();
- return;
- case 'manual':
- // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
- if (locationURL !== null) {
- // handle corrupted header
- try {
- headers.set('Location', locationURL);
- } catch (err) {
- // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
- reject(err);
- }
- }
- break;
- case 'follow':
- // HTTP-redirect fetch step 2
- if (locationURL === null) {
- break;
- }
-
- // HTTP-redirect fetch step 5
- if (request.counter >= request.follow) {
- reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
- finalize();
- return;
- }
-
- // HTTP-redirect fetch step 6 (counter increment)
- // Create a new Request object.
- const requestOpts = {
- headers: new Headers(request.headers),
- follow: request.follow,
- counter: request.counter + 1,
- agent: request.agent,
- compress: request.compress,
- method: request.method,
- body: request.body,
- signal: request.signal,
- timeout: request.timeout,
- size: request.size
- };
-
- if (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) {
- for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {
- requestOpts.headers.delete(name);
- }
- }
-
- // HTTP-redirect fetch step 9
- if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
- reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
- finalize();
- return;
- }
-
- // HTTP-redirect fetch step 11
- if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
- requestOpts.method = 'GET';
- requestOpts.body = undefined;
- requestOpts.headers.delete('content-length');
- }
-
- // HTTP-redirect fetch step 15
- resolve(fetch(new Request(locationURL, requestOpts)));
- finalize();
- return;
- }
- }
-
- // prepare response
- res.once('end', function () {
- if (signal) signal.removeEventListener('abort', abortAndFinalize);
- });
- let body = res.pipe(new PassThrough$1());
-
- const response_options = {
- url: request.url,
- status: res.statusCode,
- statusText: res.statusMessage,
- headers: headers,
- size: request.size,
- timeout: request.timeout,
- counter: request.counter
- };
-
- // HTTP-network fetch step 12.1.1.3
- const codings = headers.get('Content-Encoding');
-
- // HTTP-network fetch step 12.1.1.4: handle content codings
-
- // in following scenarios we ignore compression support
- // 1. compression support is disabled
- // 2. HEAD request
- // 3. no Content-Encoding header
- // 4. no content response (204)
- // 5. content not modified response (304)
- if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
- response = new Response(body, response_options);
- resolve(response);
- return;
- }
-
- // For Node v6+
- // Be less strict when decoding compressed responses, since sometimes
- // servers send slightly invalid responses that are still accepted
- // by common browsers.
- // Always using Z_SYNC_FLUSH is what cURL does.
- const zlibOptions = {
- flush: zlib.Z_SYNC_FLUSH,
- finishFlush: zlib.Z_SYNC_FLUSH
- };
-
- // for gzip
- if (codings == 'gzip' || codings == 'x-gzip') {
- body = body.pipe(zlib.createGunzip(zlibOptions));
- response = new Response(body, response_options);
- resolve(response);
- return;
- }
-
- // for deflate
- if (codings == 'deflate' || codings == 'x-deflate') {
- // handle the infamous raw deflate response from old servers
- // a hack for old IIS and Apache servers
- const raw = res.pipe(new PassThrough$1());
- raw.once('data', function (chunk) {
- // see http://stackoverflow.com/questions/37519828
- if ((chunk[0] & 0x0F) === 0x08) {
- body = body.pipe(zlib.createInflate());
- } else {
- body = body.pipe(zlib.createInflateRaw());
- }
- response = new Response(body, response_options);
- resolve(response);
- });
- raw.on('end', function () {
- // some old IIS servers return zero-length OK deflate responses, so 'data' is never emitted.
- if (!response) {
- response = new Response(body, response_options);
- resolve(response);
- }
- });
- return;
- }
-
- // for br
- if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
- body = body.pipe(zlib.createBrotliDecompress());
- response = new Response(body, response_options);
- resolve(response);
- return;
- }
-
- // otherwise, use response as-is
- response = new Response(body, response_options);
- resolve(response);
- });
-
- writeToStream(req, request);
- });
-}
-function fixResponseChunkedTransferBadEnding(request, errorCallback) {
- let socket;
-
- request.on('socket', function (s) {
- socket = s;
- });
-
- request.on('response', function (response) {
- const headers = response.headers;
-
- if (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) {
- response.once('close', function (hadError) {
- // tests for socket presence, as in some situations the
- // the 'socket' event is not triggered for the request
- // (happens in deno), avoids `TypeError`
- // if a data listener is still present we didn't end cleanly
- const hasDataListener = socket && socket.listenerCount('data') > 0;
-
- if (hasDataListener && !hadError) {
- const err = new Error('Premature close');
- err.code = 'ERR_STREAM_PREMATURE_CLOSE';
- errorCallback(err);
- }
- });
- }
- });
-}
-
-function destroyStream(stream, err) {
- if (stream.destroy) {
- stream.destroy(err);
- } else {
- // node < 8
- stream.emit('error', err);
- stream.end();
- }
-}
-
-/**
- * Redirect code matching
- *
- * @param Number code Status code
- * @return Boolean
- */
-fetch.isRedirect = function (code) {
- return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
-};
-
-// expose Promise
-fetch.Promise = global.Promise;
-
-module.exports = exports = fetch;
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.default = exports;
-exports.Headers = Headers;
-exports.Request = Request;
-exports.Response = Response;
-exports.FetchError = FetchError;
-exports.AbortError = AbortError;
diff --git a/node_modules/node-fetch/lib/index.mjs b/node_modules/node-fetch/lib/index.mjs
deleted file mode 100644
index 2863dd9..0000000
--- a/node_modules/node-fetch/lib/index.mjs
+++ /dev/null
@@ -1,1775 +0,0 @@
-import Stream from 'stream';
-import http from 'http';
-import Url from 'url';
-import whatwgUrl from 'whatwg-url';
-import https from 'https';
-import zlib from 'zlib';
-
-// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
-
-// fix for "Readable" isn't a named export issue
-const Readable = Stream.Readable;
-
-const BUFFER = Symbol('buffer');
-const TYPE = Symbol('type');
-
-class Blob {
- constructor() {
- this[TYPE] = '';
-
- const blobParts = arguments[0];
- const options = arguments[1];
-
- const buffers = [];
- let size = 0;
-
- if (blobParts) {
- const a = blobParts;
- const length = Number(a.length);
- for (let i = 0; i < length; i++) {
- const element = a[i];
- let buffer;
- if (element instanceof Buffer) {
- buffer = element;
- } else if (ArrayBuffer.isView(element)) {
- buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
- } else if (element instanceof ArrayBuffer) {
- buffer = Buffer.from(element);
- } else if (element instanceof Blob) {
- buffer = element[BUFFER];
- } else {
- buffer = Buffer.from(typeof element === 'string' ? element : String(element));
- }
- size += buffer.length;
- buffers.push(buffer);
- }
- }
-
- this[BUFFER] = Buffer.concat(buffers);
-
- let type = options && options.type !== undefined && String(options.type).toLowerCase();
- if (type && !/[^\u0020-\u007E]/.test(type)) {
- this[TYPE] = type;
- }
- }
- get size() {
- return this[BUFFER].length;
- }
- get type() {
- return this[TYPE];
- }
- text() {
- return Promise.resolve(this[BUFFER].toString());
- }
- arrayBuffer() {
- const buf = this[BUFFER];
- const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
- return Promise.resolve(ab);
- }
- stream() {
- const readable = new Readable();
- readable._read = function () {};
- readable.push(this[BUFFER]);
- readable.push(null);
- return readable;
- }
- toString() {
- return '[object Blob]';
- }
- slice() {
- const size = this.size;
-
- const start = arguments[0];
- const end = arguments[1];
- let relativeStart, relativeEnd;
- if (start === undefined) {
- relativeStart = 0;
- } else if (start < 0) {
- relativeStart = Math.max(size + start, 0);
- } else {
- relativeStart = Math.min(start, size);
- }
- if (end === undefined) {
- relativeEnd = size;
- } else if (end < 0) {
- relativeEnd = Math.max(size + end, 0);
- } else {
- relativeEnd = Math.min(end, size);
- }
- const span = Math.max(relativeEnd - relativeStart, 0);
-
- const buffer = this[BUFFER];
- const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
- const blob = new Blob([], { type: arguments[2] });
- blob[BUFFER] = slicedBuffer;
- return blob;
- }
-}
-
-Object.defineProperties(Blob.prototype, {
- size: { enumerable: true },
- type: { enumerable: true },
- slice: { enumerable: true }
-});
-
-Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
- value: 'Blob',
- writable: false,
- enumerable: false,
- configurable: true
-});
-
-/**
- * fetch-error.js
- *
- * FetchError interface for operational errors
- */
-
-/**
- * Create FetchError instance
- *
- * @param String message Error message for human
- * @param String type Error type for machine
- * @param String systemError For Node.js system error
- * @return FetchError
- */
-function FetchError(message, type, systemError) {
- Error.call(this, message);
-
- this.message = message;
- this.type = type;
-
- // when err.type is `system`, err.code contains system error code
- if (systemError) {
- this.code = this.errno = systemError.code;
- }
-
- // hide custom error implementation details from end-users
- Error.captureStackTrace(this, this.constructor);
-}
-
-FetchError.prototype = Object.create(Error.prototype);
-FetchError.prototype.constructor = FetchError;
-FetchError.prototype.name = 'FetchError';
-
-let convert;
-try {
- convert = require('encoding').convert;
-} catch (e) {}
-
-const INTERNALS = Symbol('Body internals');
-
-// fix an issue where "PassThrough" isn't a named export for node <10
-const PassThrough = Stream.PassThrough;
-
-/**
- * Body mixin
- *
- * Ref: https://fetch.spec.whatwg.org/#body
- *
- * @param Stream body Readable stream
- * @param Object opts Response options
- * @return Void
- */
-function Body(body) {
- var _this = this;
-
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
- _ref$size = _ref.size;
-
- let size = _ref$size === undefined ? 0 : _ref$size;
- var _ref$timeout = _ref.timeout;
- let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
-
- if (body == null) {
- // body is undefined or null
- body = null;
- } else if (isURLSearchParams(body)) {
- // body is a URLSearchParams
- body = Buffer.from(body.toString());
- } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
- // body is ArrayBuffer
- body = Buffer.from(body);
- } else if (ArrayBuffer.isView(body)) {
- // body is ArrayBufferView
- body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
- } else if (body instanceof Stream) ; else {
- // none of the above
- // coerce to string then buffer
- body = Buffer.from(String(body));
- }
- this[INTERNALS] = {
- body,
- disturbed: false,
- error: null
- };
- this.size = size;
- this.timeout = timeout;
-
- if (body instanceof Stream) {
- body.on('error', function (err) {
- const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
- _this[INTERNALS].error = error;
- });
- }
-}
-
-Body.prototype = {
- get body() {
- return this[INTERNALS].body;
- },
-
- get bodyUsed() {
- return this[INTERNALS].disturbed;
- },
-
- /**
- * Decode response as ArrayBuffer
- *
- * @return Promise
- */
- arrayBuffer() {
- return consumeBody.call(this).then(function (buf) {
- return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
- });
- },
-
- /**
- * Return raw response as Blob
- *
- * @return Promise
- */
- blob() {
- let ct = this.headers && this.headers.get('content-type') || '';
- return consumeBody.call(this).then(function (buf) {
- return Object.assign(
- // Prevent copying
- new Blob([], {
- type: ct.toLowerCase()
- }), {
- [BUFFER]: buf
- });
- });
- },
-
- /**
- * Decode response as json
- *
- * @return Promise
- */
- json() {
- var _this2 = this;
-
- return consumeBody.call(this).then(function (buffer) {
- try {
- return JSON.parse(buffer.toString());
- } catch (err) {
- return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
- }
- });
- },
-
- /**
- * Decode response as text
- *
- * @return Promise
- */
- text() {
- return consumeBody.call(this).then(function (buffer) {
- return buffer.toString();
- });
- },
-
- /**
- * Decode response as buffer (non-spec api)
- *
- * @return Promise
- */
- buffer() {
- return consumeBody.call(this);
- },
-
- /**
- * Decode response as text, while automatically detecting the encoding and
- * trying to decode to UTF-8 (non-spec api)
- *
- * @return Promise
- */
- textConverted() {
- var _this3 = this;
-
- return consumeBody.call(this).then(function (buffer) {
- return convertBody(buffer, _this3.headers);
- });
- }
-};
-
-// In browsers, all properties are enumerable.
-Object.defineProperties(Body.prototype, {
- body: { enumerable: true },
- bodyUsed: { enumerable: true },
- arrayBuffer: { enumerable: true },
- blob: { enumerable: true },
- json: { enumerable: true },
- text: { enumerable: true }
-});
-
-Body.mixIn = function (proto) {
- for (const name of Object.getOwnPropertyNames(Body.prototype)) {
- // istanbul ignore else: future proof
- if (!(name in proto)) {
- const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
- Object.defineProperty(proto, name, desc);
- }
- }
-};
-
-/**
- * Consume and convert an entire Body to a Buffer.
- *
- * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
- *
- * @return Promise
- */
-function consumeBody() {
- var _this4 = this;
-
- if (this[INTERNALS].disturbed) {
- return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
- }
-
- this[INTERNALS].disturbed = true;
-
- if (this[INTERNALS].error) {
- return Body.Promise.reject(this[INTERNALS].error);
- }
-
- let body = this.body;
-
- // body is null
- if (body === null) {
- return Body.Promise.resolve(Buffer.alloc(0));
- }
-
- // body is blob
- if (isBlob(body)) {
- body = body.stream();
- }
-
- // body is buffer
- if (Buffer.isBuffer(body)) {
- return Body.Promise.resolve(body);
- }
-
- // istanbul ignore if: should never happen
- if (!(body instanceof Stream)) {
- return Body.Promise.resolve(Buffer.alloc(0));
- }
-
- // body is stream
- // get ready to actually consume the body
- let accum = [];
- let accumBytes = 0;
- let abort = false;
-
- return new Body.Promise(function (resolve, reject) {
- let resTimeout;
-
- // allow timeout on slow response body
- if (_this4.timeout) {
- resTimeout = setTimeout(function () {
- abort = true;
- reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
- }, _this4.timeout);
- }
-
- // handle stream errors
- body.on('error', function (err) {
- if (err.name === 'AbortError') {
- // if the request was aborted, reject with this Error
- abort = true;
- reject(err);
- } else {
- // other errors, such as incorrect content-encoding
- reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
- }
- });
-
- body.on('data', function (chunk) {
- if (abort || chunk === null) {
- return;
- }
-
- if (_this4.size && accumBytes + chunk.length > _this4.size) {
- abort = true;
- reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
- return;
- }
-
- accumBytes += chunk.length;
- accum.push(chunk);
- });
-
- body.on('end', function () {
- if (abort) {
- return;
- }
-
- clearTimeout(resTimeout);
-
- try {
- resolve(Buffer.concat(accum, accumBytes));
- } catch (err) {
- // handle streams that have accumulated too much data (issue #414)
- reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
- }
- });
- });
-}
-
-/**
- * Detect buffer encoding and convert to target encoding
- * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
- *
- * @param Buffer buffer Incoming buffer
- * @param String encoding Target encoding
- * @return String
- */
-function convertBody(buffer, headers) {
- if (typeof convert !== 'function') {
- throw new Error('The package `encoding` must be installed to use the textConverted() function');
- }
-
- const ct = headers.get('content-type');
- let charset = 'utf-8';
- let res, str;
-
- // header
- if (ct) {
- res = /charset=([^;]*)/i.exec(ct);
- }
-
- // no charset in content type, peek at response body for at most 1024 bytes
- str = buffer.slice(0, 1024).toString();
-
- // html5
- if (!res && str) {
- res = / 0 && arguments[0] !== undefined ? arguments[0] : undefined;
-
- this[MAP] = Object.create(null);
-
- if (init instanceof Headers) {
- const rawHeaders = init.raw();
- const headerNames = Object.keys(rawHeaders);
-
- for (const headerName of headerNames) {
- for (const value of rawHeaders[headerName]) {
- this.append(headerName, value);
- }
- }
-
- return;
- }
-
- // We don't worry about converting prop to ByteString here as append()
- // will handle it.
- if (init == null) ; else if (typeof init === 'object') {
- const method = init[Symbol.iterator];
- if (method != null) {
- if (typeof method !== 'function') {
- throw new TypeError('Header pairs must be iterable');
- }
-
- // sequence>
- // Note: per spec we have to first exhaust the lists then process them
- const pairs = [];
- for (const pair of init) {
- if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
- throw new TypeError('Each header pair must be iterable');
- }
- pairs.push(Array.from(pair));
- }
-
- for (const pair of pairs) {
- if (pair.length !== 2) {
- throw new TypeError('Each header pair must be a name/value tuple');
- }
- this.append(pair[0], pair[1]);
- }
- } else {
- // record
- for (const key of Object.keys(init)) {
- const value = init[key];
- this.append(key, value);
- }
- }
- } else {
- throw new TypeError('Provided initializer must be an object');
- }
- }
-
- /**
- * Return combined header value given name
- *
- * @param String name Header name
- * @return Mixed
- */
- get(name) {
- name = `${name}`;
- validateName(name);
- const key = find(this[MAP], name);
- if (key === undefined) {
- return null;
- }
-
- return this[MAP][key].join(', ');
- }
-
- /**
- * Iterate over all headers
- *
- * @param Function callback Executed for each item with parameters (value, name, thisArg)
- * @param Boolean thisArg `this` context for callback function
- * @return Void
- */
- forEach(callback) {
- let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
-
- let pairs = getHeaders(this);
- let i = 0;
- while (i < pairs.length) {
- var _pairs$i = pairs[i];
- const name = _pairs$i[0],
- value = _pairs$i[1];
-
- callback.call(thisArg, value, name, this);
- pairs = getHeaders(this);
- i++;
- }
- }
-
- /**
- * Overwrite header values given name
- *
- * @param String name Header name
- * @param String value Header value
- * @return Void
- */
- set(name, value) {
- name = `${name}`;
- value = `${value}`;
- validateName(name);
- validateValue(value);
- const key = find(this[MAP], name);
- this[MAP][key !== undefined ? key : name] = [value];
- }
-
- /**
- * Append a value onto existing header
- *
- * @param String name Header name
- * @param String value Header value
- * @return Void
- */
- append(name, value) {
- name = `${name}`;
- value = `${value}`;
- validateName(name);
- validateValue(value);
- const key = find(this[MAP], name);
- if (key !== undefined) {
- this[MAP][key].push(value);
- } else {
- this[MAP][name] = [value];
- }
- }
-
- /**
- * Check for header name existence
- *
- * @param String name Header name
- * @return Boolean
- */
- has(name) {
- name = `${name}`;
- validateName(name);
- return find(this[MAP], name) !== undefined;
- }
-
- /**
- * Delete all header values given name
- *
- * @param String name Header name
- * @return Void
- */
- delete(name) {
- name = `${name}`;
- validateName(name);
- const key = find(this[MAP], name);
- if (key !== undefined) {
- delete this[MAP][key];
- }
- }
-
- /**
- * Return raw headers (non-spec api)
- *
- * @return Object
- */
- raw() {
- return this[MAP];
- }
-
- /**
- * Get an iterator on keys.
- *
- * @return Iterator
- */
- keys() {
- return createHeadersIterator(this, 'key');
- }
-
- /**
- * Get an iterator on values.
- *
- * @return Iterator
- */
- values() {
- return createHeadersIterator(this, 'value');
- }
-
- /**
- * Get an iterator on entries.
- *
- * This is the default iterator of the Headers object.
- *
- * @return Iterator
- */
- [Symbol.iterator]() {
- return createHeadersIterator(this, 'key+value');
- }
-}
-Headers.prototype.entries = Headers.prototype[Symbol.iterator];
-
-Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
- value: 'Headers',
- writable: false,
- enumerable: false,
- configurable: true
-});
-
-Object.defineProperties(Headers.prototype, {
- get: { enumerable: true },
- forEach: { enumerable: true },
- set: { enumerable: true },
- append: { enumerable: true },
- has: { enumerable: true },
- delete: { enumerable: true },
- keys: { enumerable: true },
- values: { enumerable: true },
- entries: { enumerable: true }
-});
-
-function getHeaders(headers) {
- let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
-
- const keys = Object.keys(headers[MAP]).sort();
- return keys.map(kind === 'key' ? function (k) {
- return k.toLowerCase();
- } : kind === 'value' ? function (k) {
- return headers[MAP][k].join(', ');
- } : function (k) {
- return [k.toLowerCase(), headers[MAP][k].join(', ')];
- });
-}
-
-const INTERNAL = Symbol('internal');
-
-function createHeadersIterator(target, kind) {
- const iterator = Object.create(HeadersIteratorPrototype);
- iterator[INTERNAL] = {
- target,
- kind,
- index: 0
- };
- return iterator;
-}
-
-const HeadersIteratorPrototype = Object.setPrototypeOf({
- next() {
- // istanbul ignore if
- if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
- throw new TypeError('Value of `this` is not a HeadersIterator');
- }
-
- var _INTERNAL = this[INTERNAL];
- const target = _INTERNAL.target,
- kind = _INTERNAL.kind,
- index = _INTERNAL.index;
-
- const values = getHeaders(target, kind);
- const len = values.length;
- if (index >= len) {
- return {
- value: undefined,
- done: true
- };
- }
-
- this[INTERNAL].index = index + 1;
-
- return {
- value: values[index],
- done: false
- };
- }
-}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
-
-Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
- value: 'HeadersIterator',
- writable: false,
- enumerable: false,
- configurable: true
-});
-
-/**
- * Export the Headers object in a form that Node.js can consume.
- *
- * @param Headers headers
- * @return Object
- */
-function exportNodeCompatibleHeaders(headers) {
- const obj = Object.assign({ __proto__: null }, headers[MAP]);
-
- // http.request() only supports string as Host header. This hack makes
- // specifying custom Host header possible.
- const hostHeaderKey = find(headers[MAP], 'Host');
- if (hostHeaderKey !== undefined) {
- obj[hostHeaderKey] = obj[hostHeaderKey][0];
- }
-
- return obj;
-}
-
-/**
- * Create a Headers object from an object of headers, ignoring those that do
- * not conform to HTTP grammar productions.
- *
- * @param Object obj Object of headers
- * @return Headers
- */
-function createHeadersLenient(obj) {
- const headers = new Headers();
- for (const name of Object.keys(obj)) {
- if (invalidTokenRegex.test(name)) {
- continue;
- }
- if (Array.isArray(obj[name])) {
- for (const val of obj[name]) {
- if (invalidHeaderCharRegex.test(val)) {
- continue;
- }
- if (headers[MAP][name] === undefined) {
- headers[MAP][name] = [val];
- } else {
- headers[MAP][name].push(val);
- }
- }
- } else if (!invalidHeaderCharRegex.test(obj[name])) {
- headers[MAP][name] = [obj[name]];
- }
- }
- return headers;
-}
-
-const INTERNALS$1 = Symbol('Response internals');
-
-// fix an issue where "STATUS_CODES" aren't a named export for node <10
-const STATUS_CODES = http.STATUS_CODES;
-
-/**
- * Response class
- *
- * @param Stream body Readable stream
- * @param Object opts Response options
- * @return Void
- */
-class Response {
- constructor() {
- let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
- let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
-
- Body.call(this, body, opts);
-
- const status = opts.status || 200;
- const headers = new Headers(opts.headers);
-
- if (body != null && !headers.has('Content-Type')) {
- const contentType = extractContentType(body);
- if (contentType) {
- headers.append('Content-Type', contentType);
- }
- }
-
- this[INTERNALS$1] = {
- url: opts.url,
- status,
- statusText: opts.statusText || STATUS_CODES[status],
- headers,
- counter: opts.counter
- };
- }
-
- get url() {
- return this[INTERNALS$1].url || '';
- }
-
- get status() {
- return this[INTERNALS$1].status;
- }
-
- /**
- * Convenience property representing if the request ended normally
- */
- get ok() {
- return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
- }
-
- get redirected() {
- return this[INTERNALS$1].counter > 0;
- }
-
- get statusText() {
- return this[INTERNALS$1].statusText;
- }
-
- get headers() {
- return this[INTERNALS$1].headers;
- }
-
- /**
- * Clone this response
- *
- * @return Response
- */
- clone() {
- return new Response(clone(this), {
- url: this.url,
- status: this.status,
- statusText: this.statusText,
- headers: this.headers,
- ok: this.ok,
- redirected: this.redirected
- });
- }
-}
-
-Body.mixIn(Response.prototype);
-
-Object.defineProperties(Response.prototype, {
- url: { enumerable: true },
- status: { enumerable: true },
- ok: { enumerable: true },
- redirected: { enumerable: true },
- statusText: { enumerable: true },
- headers: { enumerable: true },
- clone: { enumerable: true }
-});
-
-Object.defineProperty(Response.prototype, Symbol.toStringTag, {
- value: 'Response',
- writable: false,
- enumerable: false,
- configurable: true
-});
-
-const INTERNALS$2 = Symbol('Request internals');
-const URL = Url.URL || whatwgUrl.URL;
-
-// fix an issue where "format", "parse" aren't a named export for node <10
-const parse_url = Url.parse;
-const format_url = Url.format;
-
-/**
- * Wrapper around `new URL` to handle arbitrary URLs
- *
- * @param {string} urlStr
- * @return {void}
- */
-function parseURL(urlStr) {
- /*
- Check whether the URL is absolute or not
- Scheme: https://tools.ietf.org/html/rfc3986#section-3.1
- Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3
- */
- if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) {
- urlStr = new URL(urlStr).toString();
- }
-
- // Fallback to old implementation for arbitrary URLs
- return parse_url(urlStr);
-}
-
-const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
-
-/**
- * Check if a value is an instance of Request.
- *
- * @param Mixed input
- * @return Boolean
- */
-function isRequest(input) {
- return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
-}
-
-function isAbortSignal(signal) {
- const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
- return !!(proto && proto.constructor.name === 'AbortSignal');
-}
-
-/**
- * Request class
- *
- * @param Mixed input Url or Request instance
- * @param Object init Custom options
- * @return Void
- */
-class Request {
- constructor(input) {
- let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
-
- let parsedURL;
-
- // normalize input
- if (!isRequest(input)) {
- if (input && input.href) {
- // in order to support Node.js' Url objects; though WHATWG's URL objects
- // will fall into this branch also (since their `toString()` will return
- // `href` property anyway)
- parsedURL = parseURL(input.href);
- } else {
- // coerce input to a string before attempting to parse
- parsedURL = parseURL(`${input}`);
- }
- input = {};
- } else {
- parsedURL = parseURL(input.url);
- }
-
- let method = init.method || input.method || 'GET';
- method = method.toUpperCase();
-
- if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
- throw new TypeError('Request with GET/HEAD method cannot have body');
- }
-
- let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
-
- Body.call(this, inputBody, {
- timeout: init.timeout || input.timeout || 0,
- size: init.size || input.size || 0
- });
-
- const headers = new Headers(init.headers || input.headers || {});
-
- if (inputBody != null && !headers.has('Content-Type')) {
- const contentType = extractContentType(inputBody);
- if (contentType) {
- headers.append('Content-Type', contentType);
- }
- }
-
- let signal = isRequest(input) ? input.signal : null;
- if ('signal' in init) signal = init.signal;
-
- if (signal != null && !isAbortSignal(signal)) {
- throw new TypeError('Expected signal to be an instanceof AbortSignal');
- }
-
- this[INTERNALS$2] = {
- method,
- redirect: init.redirect || input.redirect || 'follow',
- headers,
- parsedURL,
- signal
- };
-
- // node-fetch-only options
- this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
- this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
- this.counter = init.counter || input.counter || 0;
- this.agent = init.agent || input.agent;
- }
-
- get method() {
- return this[INTERNALS$2].method;
- }
-
- get url() {
- return format_url(this[INTERNALS$2].parsedURL);
- }
-
- get headers() {
- return this[INTERNALS$2].headers;
- }
-
- get redirect() {
- return this[INTERNALS$2].redirect;
- }
-
- get signal() {
- return this[INTERNALS$2].signal;
- }
-
- /**
- * Clone this request
- *
- * @return Request
- */
- clone() {
- return new Request(this);
- }
-}
-
-Body.mixIn(Request.prototype);
-
-Object.defineProperty(Request.prototype, Symbol.toStringTag, {
- value: 'Request',
- writable: false,
- enumerable: false,
- configurable: true
-});
-
-Object.defineProperties(Request.prototype, {
- method: { enumerable: true },
- url: { enumerable: true },
- headers: { enumerable: true },
- redirect: { enumerable: true },
- clone: { enumerable: true },
- signal: { enumerable: true }
-});
-
-/**
- * Convert a Request to Node.js http request options.
- *
- * @param Request A Request instance
- * @return Object The options object to be passed to http.request
- */
-function getNodeRequestOptions(request) {
- const parsedURL = request[INTERNALS$2].parsedURL;
- const headers = new Headers(request[INTERNALS$2].headers);
-
- // fetch step 1.3
- if (!headers.has('Accept')) {
- headers.set('Accept', '*/*');
- }
-
- // Basic fetch
- if (!parsedURL.protocol || !parsedURL.hostname) {
- throw new TypeError('Only absolute URLs are supported');
- }
-
- if (!/^https?:$/.test(parsedURL.protocol)) {
- throw new TypeError('Only HTTP(S) protocols are supported');
- }
-
- if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
- throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
- }
-
- // HTTP-network-or-cache fetch steps 2.4-2.7
- let contentLengthValue = null;
- if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
- contentLengthValue = '0';
- }
- if (request.body != null) {
- const totalBytes = getTotalBytes(request);
- if (typeof totalBytes === 'number') {
- contentLengthValue = String(totalBytes);
- }
- }
- if (contentLengthValue) {
- headers.set('Content-Length', contentLengthValue);
- }
-
- // HTTP-network-or-cache fetch step 2.11
- if (!headers.has('User-Agent')) {
- headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
- }
-
- // HTTP-network-or-cache fetch step 2.15
- if (request.compress && !headers.has('Accept-Encoding')) {
- headers.set('Accept-Encoding', 'gzip,deflate');
- }
-
- let agent = request.agent;
- if (typeof agent === 'function') {
- agent = agent(parsedURL);
- }
-
- // HTTP-network fetch step 4.2
- // chunked encoding is handled by Node.js
-
- return Object.assign({}, parsedURL, {
- method: request.method,
- headers: exportNodeCompatibleHeaders(headers),
- agent
- });
-}
-
-/**
- * abort-error.js
- *
- * AbortError interface for cancelled requests
- */
-
-/**
- * Create AbortError instance
- *
- * @param String message Error message for human
- * @return AbortError
- */
-function AbortError(message) {
- Error.call(this, message);
-
- this.type = 'aborted';
- this.message = message;
-
- // hide custom error implementation details from end-users
- Error.captureStackTrace(this, this.constructor);
-}
-
-AbortError.prototype = Object.create(Error.prototype);
-AbortError.prototype.constructor = AbortError;
-AbortError.prototype.name = 'AbortError';
-
-const URL$1 = Url.URL || whatwgUrl.URL;
-
-// fix an issue where "PassThrough", "resolve" aren't a named export for node <10
-const PassThrough$1 = Stream.PassThrough;
-
-const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {
- const orig = new URL$1(original).hostname;
- const dest = new URL$1(destination).hostname;
-
- return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);
-};
-
-/**
- * isSameProtocol reports whether the two provided URLs use the same protocol.
- *
- * Both domains must already be in canonical form.
- * @param {string|URL} original
- * @param {string|URL} destination
- */
-const isSameProtocol = function isSameProtocol(destination, original) {
- const orig = new URL$1(original).protocol;
- const dest = new URL$1(destination).protocol;
-
- return orig === dest;
-};
-
-/**
- * Fetch function
- *
- * @param Mixed url Absolute url or Request instance
- * @param Object opts Fetch options
- * @return Promise
- */
-function fetch(url, opts) {
-
- // allow custom promise
- if (!fetch.Promise) {
- throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
- }
-
- Body.Promise = fetch.Promise;
-
- // wrap http.request into fetch
- return new fetch.Promise(function (resolve, reject) {
- // build request object
- const request = new Request(url, opts);
- const options = getNodeRequestOptions(request);
-
- const send = (options.protocol === 'https:' ? https : http).request;
- const signal = request.signal;
-
- let response = null;
-
- const abort = function abort() {
- let error = new AbortError('The user aborted a request.');
- reject(error);
- if (request.body && request.body instanceof Stream.Readable) {
- destroyStream(request.body, error);
- }
- if (!response || !response.body) return;
- response.body.emit('error', error);
- };
-
- if (signal && signal.aborted) {
- abort();
- return;
- }
-
- const abortAndFinalize = function abortAndFinalize() {
- abort();
- finalize();
- };
-
- // send request
- const req = send(options);
- let reqTimeout;
-
- if (signal) {
- signal.addEventListener('abort', abortAndFinalize);
- }
-
- function finalize() {
- req.abort();
- if (signal) signal.removeEventListener('abort', abortAndFinalize);
- clearTimeout(reqTimeout);
- }
-
- if (request.timeout) {
- req.once('socket', function (socket) {
- reqTimeout = setTimeout(function () {
- reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
- finalize();
- }, request.timeout);
- });
- }
-
- req.on('error', function (err) {
- reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
-
- if (response && response.body) {
- destroyStream(response.body, err);
- }
-
- finalize();
- });
-
- fixResponseChunkedTransferBadEnding(req, function (err) {
- if (signal && signal.aborted) {
- return;
- }
-
- if (response && response.body) {
- destroyStream(response.body, err);
- }
- });
-
- /* c8 ignore next 18 */
- if (parseInt(process.version.substring(1)) < 14) {
- // Before Node.js 14, pipeline() does not fully support async iterators and does not always
- // properly handle when the socket close/end events are out of order.
- req.on('socket', function (s) {
- s.addListener('close', function (hadError) {
- // if a data listener is still present we didn't end cleanly
- const hasDataListener = s.listenerCount('data') > 0;
-
- // if end happened before close but the socket didn't emit an error, do it now
- if (response && hasDataListener && !hadError && !(signal && signal.aborted)) {
- const err = new Error('Premature close');
- err.code = 'ERR_STREAM_PREMATURE_CLOSE';
- response.body.emit('error', err);
- }
- });
- });
- }
-
- req.on('response', function (res) {
- clearTimeout(reqTimeout);
-
- const headers = createHeadersLenient(res.headers);
-
- // HTTP fetch step 5
- if (fetch.isRedirect(res.statusCode)) {
- // HTTP fetch step 5.2
- const location = headers.get('Location');
-
- // HTTP fetch step 5.3
- let locationURL = null;
- try {
- locationURL = location === null ? null : new URL$1(location, request.url).toString();
- } catch (err) {
- // error here can only be invalid URL in Location: header
- // do not throw when options.redirect == manual
- // let the user extract the errorneous redirect URL
- if (request.redirect !== 'manual') {
- reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));
- finalize();
- return;
- }
- }
-
- // HTTP fetch step 5.5
- switch (request.redirect) {
- case 'error':
- reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));
- finalize();
- return;
- case 'manual':
- // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
- if (locationURL !== null) {
- // handle corrupted header
- try {
- headers.set('Location', locationURL);
- } catch (err) {
- // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
- reject(err);
- }
- }
- break;
- case 'follow':
- // HTTP-redirect fetch step 2
- if (locationURL === null) {
- break;
- }
-
- // HTTP-redirect fetch step 5
- if (request.counter >= request.follow) {
- reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
- finalize();
- return;
- }
-
- // HTTP-redirect fetch step 6 (counter increment)
- // Create a new Request object.
- const requestOpts = {
- headers: new Headers(request.headers),
- follow: request.follow,
- counter: request.counter + 1,
- agent: request.agent,
- compress: request.compress,
- method: request.method,
- body: request.body,
- signal: request.signal,
- timeout: request.timeout,
- size: request.size
- };
-
- if (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) {
- for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {
- requestOpts.headers.delete(name);
- }
- }
-
- // HTTP-redirect fetch step 9
- if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
- reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
- finalize();
- return;
- }
-
- // HTTP-redirect fetch step 11
- if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
- requestOpts.method = 'GET';
- requestOpts.body = undefined;
- requestOpts.headers.delete('content-length');
- }
-
- // HTTP-redirect fetch step 15
- resolve(fetch(new Request(locationURL, requestOpts)));
- finalize();
- return;
- }
- }
-
- // prepare response
- res.once('end', function () {
- if (signal) signal.removeEventListener('abort', abortAndFinalize);
- });
- let body = res.pipe(new PassThrough$1());
-
- const response_options = {
- url: request.url,
- status: res.statusCode,
- statusText: res.statusMessage,
- headers: headers,
- size: request.size,
- timeout: request.timeout,
- counter: request.counter
- };
-
- // HTTP-network fetch step 12.1.1.3
- const codings = headers.get('Content-Encoding');
-
- // HTTP-network fetch step 12.1.1.4: handle content codings
-
- // in following scenarios we ignore compression support
- // 1. compression support is disabled
- // 2. HEAD request
- // 3. no Content-Encoding header
- // 4. no content response (204)
- // 5. content not modified response (304)
- if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
- response = new Response(body, response_options);
- resolve(response);
- return;
- }
-
- // For Node v6+
- // Be less strict when decoding compressed responses, since sometimes
- // servers send slightly invalid responses that are still accepted
- // by common browsers.
- // Always using Z_SYNC_FLUSH is what cURL does.
- const zlibOptions = {
- flush: zlib.Z_SYNC_FLUSH,
- finishFlush: zlib.Z_SYNC_FLUSH
- };
-
- // for gzip
- if (codings == 'gzip' || codings == 'x-gzip') {
- body = body.pipe(zlib.createGunzip(zlibOptions));
- response = new Response(body, response_options);
- resolve(response);
- return;
- }
-
- // for deflate
- if (codings == 'deflate' || codings == 'x-deflate') {
- // handle the infamous raw deflate response from old servers
- // a hack for old IIS and Apache servers
- const raw = res.pipe(new PassThrough$1());
- raw.once('data', function (chunk) {
- // see http://stackoverflow.com/questions/37519828
- if ((chunk[0] & 0x0F) === 0x08) {
- body = body.pipe(zlib.createInflate());
- } else {
- body = body.pipe(zlib.createInflateRaw());
- }
- response = new Response(body, response_options);
- resolve(response);
- });
- raw.on('end', function () {
- // some old IIS servers return zero-length OK deflate responses, so 'data' is never emitted.
- if (!response) {
- response = new Response(body, response_options);
- resolve(response);
- }
- });
- return;
- }
-
- // for br
- if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
- body = body.pipe(zlib.createBrotliDecompress());
- response = new Response(body, response_options);
- resolve(response);
- return;
- }
-
- // otherwise, use response as-is
- response = new Response(body, response_options);
- resolve(response);
- });
-
- writeToStream(req, request);
- });
-}
-function fixResponseChunkedTransferBadEnding(request, errorCallback) {
- let socket;
-
- request.on('socket', function (s) {
- socket = s;
- });
-
- request.on('response', function (response) {
- const headers = response.headers;
-
- if (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) {
- response.once('close', function (hadError) {
- // tests for socket presence, as in some situations the
- // the 'socket' event is not triggered for the request
- // (happens in deno), avoids `TypeError`
- // if a data listener is still present we didn't end cleanly
- const hasDataListener = socket && socket.listenerCount('data') > 0;
-
- if (hasDataListener && !hadError) {
- const err = new Error('Premature close');
- err.code = 'ERR_STREAM_PREMATURE_CLOSE';
- errorCallback(err);
- }
- });
- }
- });
-}
-
-function destroyStream(stream, err) {
- if (stream.destroy) {
- stream.destroy(err);
- } else {
- // node < 8
- stream.emit('error', err);
- stream.end();
- }
-}
-
-/**
- * Redirect code matching
- *
- * @param Number code Status code
- * @return Boolean
- */
-fetch.isRedirect = function (code) {
- return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
-};
-
-// expose Promise
-fetch.Promise = global.Promise;
-
-export default fetch;
-export { Headers, Request, Response, FetchError, AbortError };
diff --git a/node_modules/node-fetch/package.json b/node_modules/node-fetch/package.json
deleted file mode 100644
index e0be176..0000000
--- a/node_modules/node-fetch/package.json
+++ /dev/null
@@ -1,89 +0,0 @@
-{
- "name": "node-fetch",
- "version": "2.7.0",
- "description": "A light-weight module that brings window.fetch to node.js",
- "main": "lib/index.js",
- "browser": "./browser.js",
- "module": "lib/index.mjs",
- "files": [
- "lib/index.js",
- "lib/index.mjs",
- "lib/index.es.js",
- "browser.js"
- ],
- "engines": {
- "node": "4.x || >=6.0.0"
- },
- "scripts": {
- "build": "cross-env BABEL_ENV=rollup rollup -c",
- "prepare": "npm run build",
- "test": "cross-env BABEL_ENV=test mocha --require babel-register --throw-deprecation test/test.js",
- "report": "cross-env BABEL_ENV=coverage nyc --reporter lcov --reporter text mocha -R spec test/test.js",
- "coverage": "cross-env BABEL_ENV=coverage nyc --reporter json --reporter text mocha -R spec test/test.js && codecov -f coverage/coverage-final.json"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/bitinn/node-fetch.git"
- },
- "keywords": [
- "fetch",
- "http",
- "promise"
- ],
- "author": "David Frank",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/bitinn/node-fetch/issues"
- },
- "homepage": "https://github.com/bitinn/node-fetch",
- "dependencies": {
- "whatwg-url": "^5.0.0"
- },
- "peerDependencies": {
- "encoding": "^0.1.0"
- },
- "peerDependenciesMeta": {
- "encoding": {
- "optional": true
- }
- },
- "devDependencies": {
- "@ungap/url-search-params": "^0.1.2",
- "abort-controller": "^1.1.0",
- "abortcontroller-polyfill": "^1.3.0",
- "babel-core": "^6.26.3",
- "babel-plugin-istanbul": "^4.1.6",
- "babel-plugin-transform-async-generator-functions": "^6.24.1",
- "babel-polyfill": "^6.26.0",
- "babel-preset-env": "1.4.0",
- "babel-register": "^6.16.3",
- "chai": "^3.5.0",
- "chai-as-promised": "^7.1.1",
- "chai-iterator": "^1.1.1",
- "chai-string": "~1.3.0",
- "codecov": "3.3.0",
- "cross-env": "^5.2.0",
- "form-data": "^2.3.3",
- "is-builtin-module": "^1.0.0",
- "mocha": "^5.0.0",
- "nyc": "11.9.0",
- "parted": "^0.1.1",
- "promise": "^8.0.3",
- "resumer": "0.0.0",
- "rollup": "^0.63.4",
- "rollup-plugin-babel": "^3.0.7",
- "string-to-arraybuffer": "^1.0.2",
- "teeny-request": "3.7.0"
- },
- "release": {
- "branches": [
- "+([0-9]).x",
- "main",
- "next",
- {
- "name": "beta",
- "prerelease": true
- }
- ]
- }
-}
diff --git a/node_modules/once/LICENSE b/node_modules/once/LICENSE
deleted file mode 100644
index 19129e3..0000000
--- a/node_modules/once/LICENSE
+++ /dev/null
@@ -1,15 +0,0 @@
-The ISC License
-
-Copyright (c) Isaac Z. Schlueter and Contributors
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
-IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/once/README.md b/node_modules/once/README.md
deleted file mode 100644
index 1f1ffca..0000000
--- a/node_modules/once/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-# once
-
-Only call a function once.
-
-## usage
-
-```javascript
-var once = require('once')
-
-function load (file, cb) {
- cb = once(cb)
- loader.load('file')
- loader.once('load', cb)
- loader.once('error', cb)
-}
-```
-
-Or add to the Function.prototype in a responsible way:
-
-```javascript
-// only has to be done once
-require('once').proto()
-
-function load (file, cb) {
- cb = cb.once()
- loader.load('file')
- loader.once('load', cb)
- loader.once('error', cb)
-}
-```
-
-Ironically, the prototype feature makes this module twice as
-complicated as necessary.
-
-To check whether you function has been called, use `fn.called`. Once the
-function is called for the first time the return value of the original
-function is saved in `fn.value` and subsequent calls will continue to
-return this value.
-
-```javascript
-var once = require('once')
-
-function load (cb) {
- cb = once(cb)
- var stream = createStream()
- stream.once('data', cb)
- stream.once('end', function () {
- if (!cb.called) cb(new Error('not found'))
- })
-}
-```
-
-## `once.strict(func)`
-
-Throw an error if the function is called twice.
-
-Some functions are expected to be called only once. Using `once` for them would
-potentially hide logical errors.
-
-In the example below, the `greet` function has to call the callback only once:
-
-```javascript
-function greet (name, cb) {
- // return is missing from the if statement
- // when no name is passed, the callback is called twice
- if (!name) cb('Hello anonymous')
- cb('Hello ' + name)
-}
-
-function log (msg) {
- console.log(msg)
-}
-
-// this will print 'Hello anonymous' but the logical error will be missed
-greet(null, once(msg))
-
-// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time
-greet(null, once.strict(msg))
-```
diff --git a/node_modules/once/once.js b/node_modules/once/once.js
deleted file mode 100644
index 2354067..0000000
--- a/node_modules/once/once.js
+++ /dev/null
@@ -1,42 +0,0 @@
-var wrappy = require('wrappy')
-module.exports = wrappy(once)
-module.exports.strict = wrappy(onceStrict)
-
-once.proto = once(function () {
- Object.defineProperty(Function.prototype, 'once', {
- value: function () {
- return once(this)
- },
- configurable: true
- })
-
- Object.defineProperty(Function.prototype, 'onceStrict', {
- value: function () {
- return onceStrict(this)
- },
- configurable: true
- })
-})
-
-function once (fn) {
- var f = function () {
- if (f.called) return f.value
- f.called = true
- return f.value = fn.apply(this, arguments)
- }
- f.called = false
- return f
-}
-
-function onceStrict (fn) {
- var f = function () {
- if (f.called)
- throw new Error(f.onceError)
- f.called = true
- return f.value = fn.apply(this, arguments)
- }
- var name = fn.name || 'Function wrapped with `once`'
- f.onceError = name + " shouldn't be called more than once"
- f.called = false
- return f
-}
diff --git a/node_modules/once/package.json b/node_modules/once/package.json
deleted file mode 100644
index 16815b2..0000000
--- a/node_modules/once/package.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "name": "once",
- "version": "1.4.0",
- "description": "Run a function exactly one time",
- "main": "once.js",
- "directories": {
- "test": "test"
- },
- "dependencies": {
- "wrappy": "1"
- },
- "devDependencies": {
- "tap": "^7.0.1"
- },
- "scripts": {
- "test": "tap test/*.js"
- },
- "files": [
- "once.js"
- ],
- "repository": {
- "type": "git",
- "url": "git://github.com/isaacs/once"
- },
- "keywords": [
- "once",
- "function",
- "one",
- "single"
- ],
- "author": "Isaac Z. Schlueter (http://blog.izs.me/)",
- "license": "ISC"
-}
diff --git a/node_modules/pump/.travis.yml b/node_modules/pump/.travis.yml
deleted file mode 100644
index 17f9433..0000000
--- a/node_modules/pump/.travis.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-language: node_js
-node_js:
- - "0.10"
-
-script: "npm test"
diff --git a/node_modules/pump/LICENSE b/node_modules/pump/LICENSE
deleted file mode 100644
index 757562e..0000000
--- a/node_modules/pump/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Mathias Buus
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/pump/README.md b/node_modules/pump/README.md
deleted file mode 100644
index 5dcd8a5..0000000
--- a/node_modules/pump/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-# pump
-
-pump is a small node module that pipes streams together and destroys all of them if one of them closes.
-
-```
-npm install pump
-```
-
-[](http://travis-ci.org/mafintosh/pump)
-
-## What problem does it solve?
-
-When using standard `source.pipe(dest)` source will _not_ be destroyed if dest emits close or an error.
-You are also not able to provide a callback to tell when then pipe has finished.
-
-pump does these two things for you
-
-## Usage
-
-Simply pass the streams you want to pipe together to pump and add an optional callback
-
-``` js
-var pump = require('pump')
-var fs = require('fs')
-
-var source = fs.createReadStream('/dev/random')
-var dest = fs.createWriteStream('/dev/null')
-
-pump(source, dest, function(err) {
- console.log('pipe finished', err)
-})
-
-setTimeout(function() {
- dest.destroy() // when dest is closed pump will destroy source
-}, 1000)
-```
-
-You can use pump to pipe more than two streams together as well
-
-``` js
-var transform = someTransformStream()
-
-pump(source, transform, anotherTransform, dest, function(err) {
- console.log('pipe finished', err)
-})
-```
-
-If `source`, `transform`, `anotherTransform` or `dest` closes all of them will be destroyed.
-
-Similarly to `stream.pipe()`, `pump()` returns the last stream passed in, so you can do:
-
-```
-return pump(s1, s2) // returns s2
-```
-
-Note that `pump` attaches error handlers to the streams to do internal error handling, so if `s2` emits an
-error in the above scenario, it will not trigger a `proccess.on('uncaughtException')` if you do not listen for it.
-
-If you want to return a stream that combines *both* s1 and s2 to a single stream use
-[pumpify](https://github.com/mafintosh/pumpify) instead.
-
-## License
-
-MIT
-
-## Related
-
-`pump` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one.
-
-## For enterprise
-
-Available as part of the Tidelift Subscription.
-
-The maintainers of pump and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-pump?utm_source=npm-pump&utm_medium=referral&utm_campaign=enterprise)
diff --git a/node_modules/pump/index.js b/node_modules/pump/index.js
deleted file mode 100644
index ce95e3e..0000000
--- a/node_modules/pump/index.js
+++ /dev/null
@@ -1,86 +0,0 @@
-var once = require('once')
-var eos = require('end-of-stream')
-var fs
-
-try {
- fs = require('fs') // we only need fs to get the ReadStream and WriteStream prototypes
-} catch (e) {}
-
-var noop = function () {}
-var ancient = /^v?\.0/.test(process.version)
-
-var isFn = function (fn) {
- return typeof fn === 'function'
-}
-
-var isFS = function (stream) {
- if (!ancient) return false // newer node version do not need to care about fs is a special way
- if (!fs) return false // browser
- return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
-}
-
-var isRequest = function (stream) {
- return stream.setHeader && isFn(stream.abort)
-}
-
-var destroyer = function (stream, reading, writing, callback) {
- callback = once(callback)
-
- var closed = false
- stream.on('close', function () {
- closed = true
- })
-
- eos(stream, {readable: reading, writable: writing}, function (err) {
- if (err) return callback(err)
- closed = true
- callback()
- })
-
- var destroyed = false
- return function (err) {
- if (closed) return
- if (destroyed) return
- destroyed = true
-
- if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
- if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
-
- if (isFn(stream.destroy)) return stream.destroy()
-
- callback(err || new Error('stream was destroyed'))
- }
-}
-
-var call = function (fn) {
- fn()
-}
-
-var pipe = function (from, to) {
- return from.pipe(to)
-}
-
-var pump = function () {
- var streams = Array.prototype.slice.call(arguments)
- var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
-
- if (Array.isArray(streams[0])) streams = streams[0]
- if (streams.length < 2) throw new Error('pump requires two streams per minimum')
-
- var error
- var destroys = streams.map(function (stream, i) {
- var reading = i < streams.length - 1
- var writing = i > 0
- return destroyer(stream, reading, writing, function (err) {
- if (!error) error = err
- if (err) destroys.forEach(call)
- if (reading) return
- destroys.forEach(call)
- callback(error)
- })
- })
-
- return streams.reduce(pipe)
-}
-
-module.exports = pump
diff --git a/node_modules/pump/package.json b/node_modules/pump/package.json
deleted file mode 100644
index ba588fb..0000000
--- a/node_modules/pump/package.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "pump",
- "version": "3.0.2",
- "repository": "git://github.com/mafintosh/pump.git",
- "license": "MIT",
- "description": "pipe streams together and close all of them if one of them closes",
- "browser": {
- "fs": false
- },
- "keywords": [
- "streams",
- "pipe",
- "destroy",
- "callback"
- ],
- "author": "Mathias Buus Madsen ",
- "dependencies": {
- "end-of-stream": "^1.1.0",
- "once": "^1.3.1"
- },
- "scripts": {
- "test": "node test-browser.js && node test-node.js"
- }
-}
diff --git a/node_modules/pump/test-browser.js b/node_modules/pump/test-browser.js
deleted file mode 100644
index 9a06c8a..0000000
--- a/node_modules/pump/test-browser.js
+++ /dev/null
@@ -1,66 +0,0 @@
-var stream = require('stream')
-var pump = require('./index')
-
-var rs = new stream.Readable()
-var ws = new stream.Writable()
-
-rs._read = function (size) {
- this.push(Buffer(size).fill('abc'))
-}
-
-ws._write = function (chunk, encoding, cb) {
- setTimeout(function () {
- cb()
- }, 100)
-}
-
-var toHex = function () {
- var reverse = new (require('stream').Transform)()
-
- reverse._transform = function (chunk, enc, callback) {
- reverse.push(chunk.toString('hex'))
- callback()
- }
-
- return reverse
-}
-
-var wsClosed = false
-var rsClosed = false
-var callbackCalled = false
-
-var check = function () {
- if (wsClosed && rsClosed && callbackCalled) {
- console.log('test-browser.js passes')
- clearTimeout(timeout)
- }
-}
-
-ws.on('finish', function () {
- wsClosed = true
- check()
-})
-
-rs.on('end', function () {
- rsClosed = true
- check()
-})
-
-var res = pump(rs, toHex(), toHex(), toHex(), ws, function () {
- callbackCalled = true
- check()
-})
-
-if (res !== ws) {
- throw new Error('should return last stream')
-}
-
-setTimeout(function () {
- rs.push(null)
- rs.emit('close')
-}, 1000)
-
-var timeout = setTimeout(function () {
- check()
- throw new Error('timeout')
-}, 5000)
diff --git a/node_modules/pump/test-node.js b/node_modules/pump/test-node.js
deleted file mode 100644
index 561251a..0000000
--- a/node_modules/pump/test-node.js
+++ /dev/null
@@ -1,53 +0,0 @@
-var pump = require('./index')
-
-var rs = require('fs').createReadStream('/dev/random')
-var ws = require('fs').createWriteStream('/dev/null')
-
-var toHex = function () {
- var reverse = new (require('stream').Transform)()
-
- reverse._transform = function (chunk, enc, callback) {
- reverse.push(chunk.toString('hex'))
- callback()
- }
-
- return reverse
-}
-
-var wsClosed = false
-var rsClosed = false
-var callbackCalled = false
-
-var check = function () {
- if (wsClosed && rsClosed && callbackCalled) {
- console.log('test-node.js passes')
- clearTimeout(timeout)
- }
-}
-
-ws.on('close', function () {
- wsClosed = true
- check()
-})
-
-rs.on('close', function () {
- rsClosed = true
- check()
-})
-
-var res = pump(rs, toHex(), toHex(), toHex(), ws, function () {
- callbackCalled = true
- check()
-})
-
-if (res !== ws) {
- throw new Error('should return last stream')
-}
-
-setTimeout(function () {
- rs.destroy()
-}, 1000)
-
-var timeout = setTimeout(function () {
- throw new Error('timeout')
-}, 5000)
diff --git a/node_modules/readable-stream/CONTRIBUTING.md b/node_modules/readable-stream/CONTRIBUTING.md
deleted file mode 100644
index f478d58..0000000
--- a/node_modules/readable-stream/CONTRIBUTING.md
+++ /dev/null
@@ -1,38 +0,0 @@
-# Developer's Certificate of Origin 1.1
-
-By making a contribution to this project, I certify that:
-
-* (a) The contribution was created in whole or in part by me and I
- have the right to submit it under the open source license
- indicated in the file; or
-
-* (b) The contribution is based upon previous work that, to the best
- of my knowledge, is covered under an appropriate open source
- license and I have the right under that license to submit that
- work with modifications, whether created in whole or in part
- by me, under the same open source license (unless I am
- permitted to submit under a different license), as indicated
- in the file; or
-
-* (c) The contribution was provided directly to me by some other
- person who certified (a), (b) or (c) and I have not modified
- it.
-
-* (d) I understand and agree that this project and the contribution
- are public and that a record of the contribution (including all
- personal information I submit with it, including my sign-off) is
- maintained indefinitely and may be redistributed consistent with
- this project or the open source license(s) involved.
-
-## Moderation Policy
-
-The [Node.js Moderation Policy] applies to this WG.
-
-## Code of Conduct
-
-The [Node.js Code of Conduct][] applies to this WG.
-
-[Node.js Code of Conduct]:
-https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md
-[Node.js Moderation Policy]:
-https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md
diff --git a/node_modules/readable-stream/GOVERNANCE.md b/node_modules/readable-stream/GOVERNANCE.md
deleted file mode 100644
index 16ffb93..0000000
--- a/node_modules/readable-stream/GOVERNANCE.md
+++ /dev/null
@@ -1,136 +0,0 @@
-### Streams Working Group
-
-The Node.js Streams is jointly governed by a Working Group
-(WG)
-that is responsible for high-level guidance of the project.
-
-The WG has final authority over this project including:
-
-* Technical direction
-* Project governance and process (including this policy)
-* Contribution policy
-* GitHub repository hosting
-* Conduct guidelines
-* Maintaining the list of additional Collaborators
-
-For the current list of WG members, see the project
-[README.md](./README.md#current-project-team-members).
-
-### Collaborators
-
-The readable-stream GitHub repository is
-maintained by the WG and additional Collaborators who are added by the
-WG on an ongoing basis.
-
-Individuals making significant and valuable contributions are made
-Collaborators and given commit-access to the project. These
-individuals are identified by the WG and their addition as
-Collaborators is discussed during the WG meeting.
-
-_Note:_ If you make a significant contribution and are not considered
-for commit-access log an issue or contact a WG member directly and it
-will be brought up in the next WG meeting.
-
-Modifications of the contents of the readable-stream repository are
-made on
-a collaborative basis. Anybody with a GitHub account may propose a
-modification via pull request and it will be considered by the project
-Collaborators. All pull requests must be reviewed and accepted by a
-Collaborator with sufficient expertise who is able to take full
-responsibility for the change. In the case of pull requests proposed
-by an existing Collaborator, an additional Collaborator is required
-for sign-off. Consensus should be sought if additional Collaborators
-participate and there is disagreement around a particular
-modification. See _Consensus Seeking Process_ below for further detail
-on the consensus model used for governance.
-
-Collaborators may opt to elevate significant or controversial
-modifications, or modifications that have not found consensus to the
-WG for discussion by assigning the ***WG-agenda*** tag to a pull
-request or issue. The WG should serve as the final arbiter where
-required.
-
-For the current list of Collaborators, see the project
-[README.md](./README.md#members).
-
-### WG Membership
-
-WG seats are not time-limited. There is no fixed size of the WG.
-However, the expected target is between 6 and 12, to ensure adequate
-coverage of important areas of expertise, balanced with the ability to
-make decisions efficiently.
-
-There is no specific set of requirements or qualifications for WG
-membership beyond these rules.
-
-The WG may add additional members to the WG by unanimous consensus.
-
-A WG member may be removed from the WG by voluntary resignation, or by
-unanimous consensus of all other WG members.
-
-Changes to WG membership should be posted in the agenda, and may be
-suggested as any other agenda item (see "WG Meetings" below).
-
-If an addition or removal is proposed during a meeting, and the full
-WG is not in attendance to participate, then the addition or removal
-is added to the agenda for the subsequent meeting. This is to ensure
-that all members are given the opportunity to participate in all
-membership decisions. If a WG member is unable to attend a meeting
-where a planned membership decision is being made, then their consent
-is assumed.
-
-No more than 1/3 of the WG members may be affiliated with the same
-employer. If removal or resignation of a WG member, or a change of
-employment by a WG member, creates a situation where more than 1/3 of
-the WG membership shares an employer, then the situation must be
-immediately remedied by the resignation or removal of one or more WG
-members affiliated with the over-represented employer(s).
-
-### WG Meetings
-
-The WG meets occasionally on a Google Hangout On Air. A designated moderator
-approved by the WG runs the meeting. Each meeting should be
-published to YouTube.
-
-Items are added to the WG agenda that are considered contentious or
-are modifications of governance, contribution policy, WG membership,
-or release process.
-
-The intention of the agenda is not to approve or review all patches;
-that should happen continuously on GitHub and be handled by the larger
-group of Collaborators.
-
-Any community member or contributor can ask that something be added to
-the next meeting's agenda by logging a GitHub Issue. Any Collaborator,
-WG member or the moderator can add the item to the agenda by adding
-the ***WG-agenda*** tag to the issue.
-
-Prior to each WG meeting the moderator will share the Agenda with
-members of the WG. WG members can add any items they like to the
-agenda at the beginning of each meeting. The moderator and the WG
-cannot veto or remove items.
-
-The WG may invite persons or representatives from certain projects to
-participate in a non-voting capacity.
-
-The moderator is responsible for summarizing the discussion of each
-agenda item and sends it as a pull request after the meeting.
-
-### Consensus Seeking Process
-
-The WG follows a
-[Consensus
-Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making)
-decision-making model.
-
-When an agenda item has appeared to reach a consensus the moderator
-will ask "Does anyone object?" as a final call for dissent from the
-consensus.
-
-If an agenda item cannot reach a consensus a WG member can call for
-either a closing vote or a vote to table the issue to the next
-meeting. The call for a vote must be seconded by a majority of the WG
-or else the discussion will continue. Simple majority wins.
-
-Note that changes to WG membership require a majority consensus. See
-"WG Membership" above.
diff --git a/node_modules/readable-stream/LICENSE b/node_modules/readable-stream/LICENSE
deleted file mode 100644
index 2873b3b..0000000
--- a/node_modules/readable-stream/LICENSE
+++ /dev/null
@@ -1,47 +0,0 @@
-Node.js is licensed for use as follows:
-
-"""
-Copyright Node.js contributors. All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.
-"""
-
-This license applies to parts of Node.js originating from the
-https://github.com/joyent/node repository:
-
-"""
-Copyright Joyent, Inc. and other Node contributors. All rights reserved.
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.
-"""
diff --git a/node_modules/readable-stream/README.md b/node_modules/readable-stream/README.md
deleted file mode 100644
index 19117c1..0000000
--- a/node_modules/readable-stream/README.md
+++ /dev/null
@@ -1,106 +0,0 @@
-# readable-stream
-
-***Node.js core streams for userland*** [](https://travis-ci.com/nodejs/readable-stream)
-
-
-[](https://nodei.co/npm/readable-stream/)
-[](https://nodei.co/npm/readable-stream/)
-
-
-[](https://saucelabs.com/u/readabe-stream)
-
-```bash
-npm install --save readable-stream
-```
-
-This package is a mirror of the streams implementations in Node.js.
-
-Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v10.18.1/docs/api/stream.html).
-
-If you want to guarantee a stable streams base, regardless of what version of
-Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).
-
-As of version 2.0.0 **readable-stream** uses semantic versioning.
-
-## Version 3.x.x
-
-v3.x.x of `readable-stream` is a cut from Node 10. This version supports Node 6, 8, and 10, as well as evergreen browsers, IE 11 and latest Safari. The breaking changes introduced by v3 are composed by the combined breaking changes in [Node v9](https://nodejs.org/en/blog/release/v9.0.0/) and [Node v10](https://nodejs.org/en/blog/release/v10.0.0/), as follows:
-
-1. Error codes: https://github.com/nodejs/node/pull/13310,
- https://github.com/nodejs/node/pull/13291,
- https://github.com/nodejs/node/pull/16589,
- https://github.com/nodejs/node/pull/15042,
- https://github.com/nodejs/node/pull/15665,
- https://github.com/nodejs/readable-stream/pull/344
-2. 'readable' have precedence over flowing
- https://github.com/nodejs/node/pull/18994
-3. make virtual methods errors consistent
- https://github.com/nodejs/node/pull/18813
-4. updated streams error handling
- https://github.com/nodejs/node/pull/18438
-5. writable.end should return this.
- https://github.com/nodejs/node/pull/18780
-6. readable continues to read when push('')
- https://github.com/nodejs/node/pull/18211
-7. add custom inspect to BufferList
- https://github.com/nodejs/node/pull/17907
-8. always defer 'readable' with nextTick
- https://github.com/nodejs/node/pull/17979
-
-## Version 2.x.x
-v2.x.x of `readable-stream` is a cut of the stream module from Node 8 (there have been no semver-major changes from Node 4 to 8). This version supports all Node.js versions from 0.8, as well as evergreen browsers and IE 10 & 11.
-
-### Big Thanks
-
-Cross-browser Testing Platform and Open Source <3 Provided by [Sauce Labs][sauce]
-
-# Usage
-
-You can swap your `require('stream')` with `require('readable-stream')`
-without any changes, if you are just using one of the main classes and
-functions.
-
-```js
-const {
- Readable,
- Writable,
- Transform,
- Duplex,
- pipeline,
- finished
-} = require('readable-stream')
-````
-
-Note that `require('stream')` will return `Stream`, while
-`require('readable-stream')` will return `Readable`. We discourage using
-whatever is exported directly, but rather use one of the properties as
-shown in the example above.
-
-# Streams Working Group
-
-`readable-stream` is maintained by the Streams Working Group, which
-oversees the development and maintenance of the Streams API within
-Node.js. The responsibilities of the Streams Working Group include:
-
-* Addressing stream issues on the Node.js issue tracker.
-* Authoring and editing stream documentation within the Node.js project.
-* Reviewing changes to stream subclasses within the Node.js project.
-* Redirecting changes to streams from the Node.js project to this
- project.
-* Assisting in the implementation of stream providers within Node.js.
-* Recommending versions of `readable-stream` to be included in Node.js.
-* Messaging about the future of streams to give the community advance
- notice of changes.
-
-
-## Team Members
-
-* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com>
- - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242
-* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com>
-* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com>
- - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E
-* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com>
-* **Yoshua Wyuts** ([@yoshuawuyts](https://github.com/yoshuawuyts)) <yoshuawuyts@gmail.com>
-
-[sauce]: https://saucelabs.com
diff --git a/node_modules/readable-stream/errors-browser.js b/node_modules/readable-stream/errors-browser.js
deleted file mode 100644
index fb8e73e..0000000
--- a/node_modules/readable-stream/errors-browser.js
+++ /dev/null
@@ -1,127 +0,0 @@
-'use strict';
-
-function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
-
-var codes = {};
-
-function createErrorType(code, message, Base) {
- if (!Base) {
- Base = Error;
- }
-
- function getMessage(arg1, arg2, arg3) {
- if (typeof message === 'string') {
- return message;
- } else {
- return message(arg1, arg2, arg3);
- }
- }
-
- var NodeError =
- /*#__PURE__*/
- function (_Base) {
- _inheritsLoose(NodeError, _Base);
-
- function NodeError(arg1, arg2, arg3) {
- return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;
- }
-
- return NodeError;
- }(Base);
-
- NodeError.prototype.name = Base.name;
- NodeError.prototype.code = code;
- codes[code] = NodeError;
-} // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js
-
-
-function oneOf(expected, thing) {
- if (Array.isArray(expected)) {
- var len = expected.length;
- expected = expected.map(function (i) {
- return String(i);
- });
-
- if (len > 2) {
- return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1];
- } else if (len === 2) {
- return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]);
- } else {
- return "of ".concat(thing, " ").concat(expected[0]);
- }
- } else {
- return "of ".concat(thing, " ").concat(String(expected));
- }
-} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
-
-
-function startsWith(str, search, pos) {
- return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
-} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith
-
-
-function endsWith(str, search, this_len) {
- if (this_len === undefined || this_len > str.length) {
- this_len = str.length;
- }
-
- return str.substring(this_len - search.length, this_len) === search;
-} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes
-
-
-function includes(str, search, start) {
- if (typeof start !== 'number') {
- start = 0;
- }
-
- if (start + search.length > str.length) {
- return false;
- } else {
- return str.indexOf(search, start) !== -1;
- }
-}
-
-createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) {
- return 'The value "' + value + '" is invalid for option "' + name + '"';
-}, TypeError);
-createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {
- // determiner: 'must be' or 'must not be'
- var determiner;
-
- if (typeof expected === 'string' && startsWith(expected, 'not ')) {
- determiner = 'must not be';
- expected = expected.replace(/^not /, '');
- } else {
- determiner = 'must be';
- }
-
- var msg;
-
- if (endsWith(name, ' argument')) {
- // For cases like 'first argument'
- msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type'));
- } else {
- var type = includes(name, '.') ? 'property' : 'argument';
- msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type'));
- }
-
- msg += ". Received type ".concat(typeof actual);
- return msg;
-}, TypeError);
-createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF');
-createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) {
- return 'The ' + name + ' method is not implemented';
-});
-createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close');
-createErrorType('ERR_STREAM_DESTROYED', function (name) {
- return 'Cannot call ' + name + ' after a stream was destroyed';
-});
-createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times');
-createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable');
-createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end');
-createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError);
-createErrorType('ERR_UNKNOWN_ENCODING', function (arg) {
- return 'Unknown encoding: ' + arg;
-}, TypeError);
-createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event');
-module.exports.codes = codes;
diff --git a/node_modules/readable-stream/errors.js b/node_modules/readable-stream/errors.js
deleted file mode 100644
index 8471526..0000000
--- a/node_modules/readable-stream/errors.js
+++ /dev/null
@@ -1,116 +0,0 @@
-'use strict';
-
-const codes = {};
-
-function createErrorType(code, message, Base) {
- if (!Base) {
- Base = Error
- }
-
- function getMessage (arg1, arg2, arg3) {
- if (typeof message === 'string') {
- return message
- } else {
- return message(arg1, arg2, arg3)
- }
- }
-
- class NodeError extends Base {
- constructor (arg1, arg2, arg3) {
- super(getMessage(arg1, arg2, arg3));
- }
- }
-
- NodeError.prototype.name = Base.name;
- NodeError.prototype.code = code;
-
- codes[code] = NodeError;
-}
-
-// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js
-function oneOf(expected, thing) {
- if (Array.isArray(expected)) {
- const len = expected.length;
- expected = expected.map((i) => String(i));
- if (len > 2) {
- return `one of ${thing} ${expected.slice(0, len - 1).join(', ')}, or ` +
- expected[len - 1];
- } else if (len === 2) {
- return `one of ${thing} ${expected[0]} or ${expected[1]}`;
- } else {
- return `of ${thing} ${expected[0]}`;
- }
- } else {
- return `of ${thing} ${String(expected)}`;
- }
-}
-
-// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
-function startsWith(str, search, pos) {
- return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
-}
-
-// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith
-function endsWith(str, search, this_len) {
- if (this_len === undefined || this_len > str.length) {
- this_len = str.length;
- }
- return str.substring(this_len - search.length, this_len) === search;
-}
-
-// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes
-function includes(str, search, start) {
- if (typeof start !== 'number') {
- start = 0;
- }
-
- if (start + search.length > str.length) {
- return false;
- } else {
- return str.indexOf(search, start) !== -1;
- }
-}
-
-createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) {
- return 'The value "' + value + '" is invalid for option "' + name + '"'
-}, TypeError);
-createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {
- // determiner: 'must be' or 'must not be'
- let determiner;
- if (typeof expected === 'string' && startsWith(expected, 'not ')) {
- determiner = 'must not be';
- expected = expected.replace(/^not /, '');
- } else {
- determiner = 'must be';
- }
-
- let msg;
- if (endsWith(name, ' argument')) {
- // For cases like 'first argument'
- msg = `The ${name} ${determiner} ${oneOf(expected, 'type')}`;
- } else {
- const type = includes(name, '.') ? 'property' : 'argument';
- msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, 'type')}`;
- }
-
- msg += `. Received type ${typeof actual}`;
- return msg;
-}, TypeError);
-createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF');
-createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) {
- return 'The ' + name + ' method is not implemented'
-});
-createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close');
-createErrorType('ERR_STREAM_DESTROYED', function (name) {
- return 'Cannot call ' + name + ' after a stream was destroyed';
-});
-createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times');
-createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable');
-createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end');
-createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError);
-createErrorType('ERR_UNKNOWN_ENCODING', function (arg) {
- return 'Unknown encoding: ' + arg
-}, TypeError);
-createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event');
-
-module.exports.codes = codes;
diff --git a/node_modules/readable-stream/experimentalWarning.js b/node_modules/readable-stream/experimentalWarning.js
deleted file mode 100644
index 78e8414..0000000
--- a/node_modules/readable-stream/experimentalWarning.js
+++ /dev/null
@@ -1,17 +0,0 @@
-'use strict'
-
-var experimentalWarnings = new Set();
-
-function emitExperimentalWarning(feature) {
- if (experimentalWarnings.has(feature)) return;
- var msg = feature + ' is an experimental feature. This feature could ' +
- 'change at any time';
- experimentalWarnings.add(feature);
- process.emitWarning(msg, 'ExperimentalWarning');
-}
-
-function noop() {}
-
-module.exports.emitExperimentalWarning = process.emitWarning
- ? emitExperimentalWarning
- : noop;
diff --git a/node_modules/readable-stream/lib/_stream_duplex.js b/node_modules/readable-stream/lib/_stream_duplex.js
deleted file mode 100644
index 19abfa6..0000000
--- a/node_modules/readable-stream/lib/_stream_duplex.js
+++ /dev/null
@@ -1,126 +0,0 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-// a duplex stream is just a stream that is both readable and writable.
-// Since JS doesn't have multiple prototypal inheritance, this class
-// prototypally inherits from Readable, and then parasitically from
-// Writable.
-
-'use strict';
-
-/**/
-var objectKeys = Object.keys || function (obj) {
- var keys = [];
- for (var key in obj) keys.push(key);
- return keys;
-};
-/**/
-
-module.exports = Duplex;
-var Readable = require('./_stream_readable');
-var Writable = require('./_stream_writable');
-require('inherits')(Duplex, Readable);
-{
- // Allow the keys array to be GC'ed.
- var keys = objectKeys(Writable.prototype);
- for (var v = 0; v < keys.length; v++) {
- var method = keys[v];
- if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
- }
-}
-function Duplex(options) {
- if (!(this instanceof Duplex)) return new Duplex(options);
- Readable.call(this, options);
- Writable.call(this, options);
- this.allowHalfOpen = true;
- if (options) {
- if (options.readable === false) this.readable = false;
- if (options.writable === false) this.writable = false;
- if (options.allowHalfOpen === false) {
- this.allowHalfOpen = false;
- this.once('end', onend);
- }
- }
-}
-Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState.highWaterMark;
- }
-});
-Object.defineProperty(Duplex.prototype, 'writableBuffer', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState && this._writableState.getBuffer();
- }
-});
-Object.defineProperty(Duplex.prototype, 'writableLength', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState.length;
- }
-});
-
-// the no-half-open enforcer
-function onend() {
- // If the writable side ended, then we're ok.
- if (this._writableState.ended) return;
-
- // no more data can be written.
- // But allow more writes to happen in this tick.
- process.nextTick(onEndNT, this);
-}
-function onEndNT(self) {
- self.end();
-}
-Object.defineProperty(Duplex.prototype, 'destroyed', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- if (this._readableState === undefined || this._writableState === undefined) {
- return false;
- }
- return this._readableState.destroyed && this._writableState.destroyed;
- },
- set: function set(value) {
- // we ignore the value if the stream
- // has not been initialized yet
- if (this._readableState === undefined || this._writableState === undefined) {
- return;
- }
-
- // backward compatibility, the user is explicitly
- // managing destroyed
- this._readableState.destroyed = value;
- this._writableState.destroyed = value;
- }
-});
\ No newline at end of file
diff --git a/node_modules/readable-stream/lib/_stream_passthrough.js b/node_modules/readable-stream/lib/_stream_passthrough.js
deleted file mode 100644
index 24a6bdd..0000000
--- a/node_modules/readable-stream/lib/_stream_passthrough.js
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-// a passthrough stream.
-// basically just the most minimal sort of Transform stream.
-// Every written chunk gets output as-is.
-
-'use strict';
-
-module.exports = PassThrough;
-var Transform = require('./_stream_transform');
-require('inherits')(PassThrough, Transform);
-function PassThrough(options) {
- if (!(this instanceof PassThrough)) return new PassThrough(options);
- Transform.call(this, options);
-}
-PassThrough.prototype._transform = function (chunk, encoding, cb) {
- cb(null, chunk);
-};
\ No newline at end of file
diff --git a/node_modules/readable-stream/lib/_stream_readable.js b/node_modules/readable-stream/lib/_stream_readable.js
deleted file mode 100644
index df1f608..0000000
--- a/node_modules/readable-stream/lib/_stream_readable.js
+++ /dev/null
@@ -1,1027 +0,0 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-'use strict';
-
-module.exports = Readable;
-
-/**/
-var Duplex;
-/**/
-
-Readable.ReadableState = ReadableState;
-
-/**/
-var EE = require('events').EventEmitter;
-var EElistenerCount = function EElistenerCount(emitter, type) {
- return emitter.listeners(type).length;
-};
-/**/
-
-/**/
-var Stream = require('./internal/streams/stream');
-/**/
-
-var Buffer = require('buffer').Buffer;
-var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};
-function _uint8ArrayToBuffer(chunk) {
- return Buffer.from(chunk);
-}
-function _isUint8Array(obj) {
- return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
-}
-
-/**/
-var debugUtil = require('util');
-var debug;
-if (debugUtil && debugUtil.debuglog) {
- debug = debugUtil.debuglog('stream');
-} else {
- debug = function debug() {};
-}
-/**/
-
-var BufferList = require('./internal/streams/buffer_list');
-var destroyImpl = require('./internal/streams/destroy');
-var _require = require('./internal/streams/state'),
- getHighWaterMark = _require.getHighWaterMark;
-var _require$codes = require('../errors').codes,
- ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
- ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF,
- ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
- ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;
-
-// Lazy loaded to improve the startup performance.
-var StringDecoder;
-var createReadableStreamAsyncIterator;
-var from;
-require('inherits')(Readable, Stream);
-var errorOrDestroy = destroyImpl.errorOrDestroy;
-var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
-function prependListener(emitter, event, fn) {
- // Sadly this is not cacheable as some libraries bundle their own
- // event emitter implementation with them.
- if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
-
- // This is a hack to make sure that our error handler is attached before any
- // userland ones. NEVER DO THIS. This is here only because this code needs
- // to continue to work with older versions of Node.js that do not include
- // the prependListener() method. The goal is to eventually remove this hack.
- if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
-}
-function ReadableState(options, stream, isDuplex) {
- Duplex = Duplex || require('./_stream_duplex');
- options = options || {};
-
- // Duplex streams are both readable and writable, but share
- // the same options object.
- // However, some cases require setting options to different
- // values for the readable and the writable sides of the duplex stream.
- // These options can be provided separately as readableXXX and writableXXX.
- if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex;
-
- // object stream flag. Used to make read(n) ignore n and to
- // make all the buffer merging and length checks go away
- this.objectMode = !!options.objectMode;
- if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
-
- // the point at which it stops calling _read() to fill the buffer
- // Note: 0 is a valid value, means "don't call _read preemptively ever"
- this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex);
-
- // A linked list is used to store data chunks instead of an array because the
- // linked list can remove elements from the beginning faster than
- // array.shift()
- this.buffer = new BufferList();
- this.length = 0;
- this.pipes = null;
- this.pipesCount = 0;
- this.flowing = null;
- this.ended = false;
- this.endEmitted = false;
- this.reading = false;
-
- // a flag to be able to tell if the event 'readable'/'data' is emitted
- // immediately, or on a later tick. We set this to true at first, because
- // any actions that shouldn't happen until "later" should generally also
- // not happen before the first read call.
- this.sync = true;
-
- // whenever we return null, then we set a flag to say
- // that we're awaiting a 'readable' event emission.
- this.needReadable = false;
- this.emittedReadable = false;
- this.readableListening = false;
- this.resumeScheduled = false;
- this.paused = true;
-
- // Should close be emitted on destroy. Defaults to true.
- this.emitClose = options.emitClose !== false;
-
- // Should .destroy() be called after 'end' (and potentially 'finish')
- this.autoDestroy = !!options.autoDestroy;
-
- // has it been destroyed
- this.destroyed = false;
-
- // Crypto is kind of old and crusty. Historically, its default string
- // encoding is 'binary' so we have to make this configurable.
- // Everything else in the universe uses 'utf8', though.
- this.defaultEncoding = options.defaultEncoding || 'utf8';
-
- // the number of writers that are awaiting a drain event in .pipe()s
- this.awaitDrain = 0;
-
- // if true, a maybeReadMore has been scheduled
- this.readingMore = false;
- this.decoder = null;
- this.encoding = null;
- if (options.encoding) {
- if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
- this.decoder = new StringDecoder(options.encoding);
- this.encoding = options.encoding;
- }
-}
-function Readable(options) {
- Duplex = Duplex || require('./_stream_duplex');
- if (!(this instanceof Readable)) return new Readable(options);
-
- // Checking for a Stream.Duplex instance is faster here instead of inside
- // the ReadableState constructor, at least with V8 6.5
- var isDuplex = this instanceof Duplex;
- this._readableState = new ReadableState(options, this, isDuplex);
-
- // legacy
- this.readable = true;
- if (options) {
- if (typeof options.read === 'function') this._read = options.read;
- if (typeof options.destroy === 'function') this._destroy = options.destroy;
- }
- Stream.call(this);
-}
-Object.defineProperty(Readable.prototype, 'destroyed', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- if (this._readableState === undefined) {
- return false;
- }
- return this._readableState.destroyed;
- },
- set: function set(value) {
- // we ignore the value if the stream
- // has not been initialized yet
- if (!this._readableState) {
- return;
- }
-
- // backward compatibility, the user is explicitly
- // managing destroyed
- this._readableState.destroyed = value;
- }
-});
-Readable.prototype.destroy = destroyImpl.destroy;
-Readable.prototype._undestroy = destroyImpl.undestroy;
-Readable.prototype._destroy = function (err, cb) {
- cb(err);
-};
-
-// Manually shove something into the read() buffer.
-// This returns true if the highWaterMark has not been hit yet,
-// similar to how Writable.write() returns true if you should
-// write() some more.
-Readable.prototype.push = function (chunk, encoding) {
- var state = this._readableState;
- var skipChunkCheck;
- if (!state.objectMode) {
- if (typeof chunk === 'string') {
- encoding = encoding || state.defaultEncoding;
- if (encoding !== state.encoding) {
- chunk = Buffer.from(chunk, encoding);
- encoding = '';
- }
- skipChunkCheck = true;
- }
- } else {
- skipChunkCheck = true;
- }
- return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
-};
-
-// Unshift should *always* be something directly out of read()
-Readable.prototype.unshift = function (chunk) {
- return readableAddChunk(this, chunk, null, true, false);
-};
-function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
- debug('readableAddChunk', chunk);
- var state = stream._readableState;
- if (chunk === null) {
- state.reading = false;
- onEofChunk(stream, state);
- } else {
- var er;
- if (!skipChunkCheck) er = chunkInvalid(state, chunk);
- if (er) {
- errorOrDestroy(stream, er);
- } else if (state.objectMode || chunk && chunk.length > 0) {
- if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
- chunk = _uint8ArrayToBuffer(chunk);
- }
- if (addToFront) {
- if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true);
- } else if (state.ended) {
- errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());
- } else if (state.destroyed) {
- return false;
- } else {
- state.reading = false;
- if (state.decoder && !encoding) {
- chunk = state.decoder.write(chunk);
- if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
- } else {
- addChunk(stream, state, chunk, false);
- }
- }
- } else if (!addToFront) {
- state.reading = false;
- maybeReadMore(stream, state);
- }
- }
-
- // We can push more data if we are below the highWaterMark.
- // Also, if we have no data yet, we can stand some more bytes.
- // This is to work around cases where hwm=0, such as the repl.
- return !state.ended && (state.length < state.highWaterMark || state.length === 0);
-}
-function addChunk(stream, state, chunk, addToFront) {
- if (state.flowing && state.length === 0 && !state.sync) {
- state.awaitDrain = 0;
- stream.emit('data', chunk);
- } else {
- // update the buffer info.
- state.length += state.objectMode ? 1 : chunk.length;
- if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
- if (state.needReadable) emitReadable(stream);
- }
- maybeReadMore(stream, state);
-}
-function chunkInvalid(state, chunk) {
- var er;
- if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
- er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk);
- }
- return er;
-}
-Readable.prototype.isPaused = function () {
- return this._readableState.flowing === false;
-};
-
-// backwards compatibility.
-Readable.prototype.setEncoding = function (enc) {
- if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
- var decoder = new StringDecoder(enc);
- this._readableState.decoder = decoder;
- // If setEncoding(null), decoder.encoding equals utf8
- this._readableState.encoding = this._readableState.decoder.encoding;
-
- // Iterate over current buffer to convert already stored Buffers:
- var p = this._readableState.buffer.head;
- var content = '';
- while (p !== null) {
- content += decoder.write(p.data);
- p = p.next;
- }
- this._readableState.buffer.clear();
- if (content !== '') this._readableState.buffer.push(content);
- this._readableState.length = content.length;
- return this;
-};
-
-// Don't raise the hwm > 1GB
-var MAX_HWM = 0x40000000;
-function computeNewHighWaterMark(n) {
- if (n >= MAX_HWM) {
- // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE.
- n = MAX_HWM;
- } else {
- // Get the next highest power of 2 to prevent increasing hwm excessively in
- // tiny amounts
- n--;
- n |= n >>> 1;
- n |= n >>> 2;
- n |= n >>> 4;
- n |= n >>> 8;
- n |= n >>> 16;
- n++;
- }
- return n;
-}
-
-// This function is designed to be inlinable, so please take care when making
-// changes to the function body.
-function howMuchToRead(n, state) {
- if (n <= 0 || state.length === 0 && state.ended) return 0;
- if (state.objectMode) return 1;
- if (n !== n) {
- // Only flow one buffer at a time
- if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
- }
- // If we're asking for more than the current hwm, then raise the hwm.
- if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
- if (n <= state.length) return n;
- // Don't have enough
- if (!state.ended) {
- state.needReadable = true;
- return 0;
- }
- return state.length;
-}
-
-// you can override either this method, or the async _read(n) below.
-Readable.prototype.read = function (n) {
- debug('read', n);
- n = parseInt(n, 10);
- var state = this._readableState;
- var nOrig = n;
- if (n !== 0) state.emittedReadable = false;
-
- // if we're doing read(0) to trigger a readable event, but we
- // already have a bunch of data in the buffer, then just trigger
- // the 'readable' event and move on.
- if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {
- debug('read: emitReadable', state.length, state.ended);
- if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
- return null;
- }
- n = howMuchToRead(n, state);
-
- // if we've ended, and we're now clear, then finish it up.
- if (n === 0 && state.ended) {
- if (state.length === 0) endReadable(this);
- return null;
- }
-
- // All the actual chunk generation logic needs to be
- // *below* the call to _read. The reason is that in certain
- // synthetic stream cases, such as passthrough streams, _read
- // may be a completely synchronous operation which may change
- // the state of the read buffer, providing enough data when
- // before there was *not* enough.
- //
- // So, the steps are:
- // 1. Figure out what the state of things will be after we do
- // a read from the buffer.
- //
- // 2. If that resulting state will trigger a _read, then call _read.
- // Note that this may be asynchronous, or synchronous. Yes, it is
- // deeply ugly to write APIs this way, but that still doesn't mean
- // that the Readable class should behave improperly, as streams are
- // designed to be sync/async agnostic.
- // Take note if the _read call is sync or async (ie, if the read call
- // has returned yet), so that we know whether or not it's safe to emit
- // 'readable' etc.
- //
- // 3. Actually pull the requested chunks out of the buffer and return.
-
- // if we need a readable event, then we need to do some reading.
- var doRead = state.needReadable;
- debug('need readable', doRead);
-
- // if we currently have less than the highWaterMark, then also read some
- if (state.length === 0 || state.length - n < state.highWaterMark) {
- doRead = true;
- debug('length less than watermark', doRead);
- }
-
- // however, if we've ended, then there's no point, and if we're already
- // reading, then it's unnecessary.
- if (state.ended || state.reading) {
- doRead = false;
- debug('reading or ended', doRead);
- } else if (doRead) {
- debug('do read');
- state.reading = true;
- state.sync = true;
- // if the length is currently zero, then we *need* a readable event.
- if (state.length === 0) state.needReadable = true;
- // call internal read method
- this._read(state.highWaterMark);
- state.sync = false;
- // If _read pushed data synchronously, then `reading` will be false,
- // and we need to re-evaluate how much data we can return to the user.
- if (!state.reading) n = howMuchToRead(nOrig, state);
- }
- var ret;
- if (n > 0) ret = fromList(n, state);else ret = null;
- if (ret === null) {
- state.needReadable = state.length <= state.highWaterMark;
- n = 0;
- } else {
- state.length -= n;
- state.awaitDrain = 0;
- }
- if (state.length === 0) {
- // If we have nothing in the buffer, then we want to know
- // as soon as we *do* get something into the buffer.
- if (!state.ended) state.needReadable = true;
-
- // If we tried to read() past the EOF, then emit end on the next tick.
- if (nOrig !== n && state.ended) endReadable(this);
- }
- if (ret !== null) this.emit('data', ret);
- return ret;
-};
-function onEofChunk(stream, state) {
- debug('onEofChunk');
- if (state.ended) return;
- if (state.decoder) {
- var chunk = state.decoder.end();
- if (chunk && chunk.length) {
- state.buffer.push(chunk);
- state.length += state.objectMode ? 1 : chunk.length;
- }
- }
- state.ended = true;
- if (state.sync) {
- // if we are sync, wait until next tick to emit the data.
- // Otherwise we risk emitting data in the flow()
- // the readable code triggers during a read() call
- emitReadable(stream);
- } else {
- // emit 'readable' now to make sure it gets picked up.
- state.needReadable = false;
- if (!state.emittedReadable) {
- state.emittedReadable = true;
- emitReadable_(stream);
- }
- }
-}
-
-// Don't emit readable right away in sync mode, because this can trigger
-// another read() call => stack overflow. This way, it might trigger
-// a nextTick recursion warning, but that's not so bad.
-function emitReadable(stream) {
- var state = stream._readableState;
- debug('emitReadable', state.needReadable, state.emittedReadable);
- state.needReadable = false;
- if (!state.emittedReadable) {
- debug('emitReadable', state.flowing);
- state.emittedReadable = true;
- process.nextTick(emitReadable_, stream);
- }
-}
-function emitReadable_(stream) {
- var state = stream._readableState;
- debug('emitReadable_', state.destroyed, state.length, state.ended);
- if (!state.destroyed && (state.length || state.ended)) {
- stream.emit('readable');
- state.emittedReadable = false;
- }
-
- // The stream needs another readable event if
- // 1. It is not flowing, as the flow mechanism will take
- // care of it.
- // 2. It is not ended.
- // 3. It is below the highWaterMark, so we can schedule
- // another readable later.
- state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;
- flow(stream);
-}
-
-// at this point, the user has presumably seen the 'readable' event,
-// and called read() to consume some data. that may have triggered
-// in turn another _read(n) call, in which case reading = true if
-// it's in progress.
-// However, if we're not ended, or reading, and the length < hwm,
-// then go ahead and try to read some more preemptively.
-function maybeReadMore(stream, state) {
- if (!state.readingMore) {
- state.readingMore = true;
- process.nextTick(maybeReadMore_, stream, state);
- }
-}
-function maybeReadMore_(stream, state) {
- // Attempt to read more data if we should.
- //
- // The conditions for reading more data are (one of):
- // - Not enough data buffered (state.length < state.highWaterMark). The loop
- // is responsible for filling the buffer with enough data if such data
- // is available. If highWaterMark is 0 and we are not in the flowing mode
- // we should _not_ attempt to buffer any extra data. We'll get more data
- // when the stream consumer calls read() instead.
- // - No data in the buffer, and the stream is in flowing mode. In this mode
- // the loop below is responsible for ensuring read() is called. Failing to
- // call read here would abort the flow and there's no other mechanism for
- // continuing the flow if the stream consumer has just subscribed to the
- // 'data' event.
- //
- // In addition to the above conditions to keep reading data, the following
- // conditions prevent the data from being read:
- // - The stream has ended (state.ended).
- // - There is already a pending 'read' operation (state.reading). This is a
- // case where the the stream has called the implementation defined _read()
- // method, but they are processing the call asynchronously and have _not_
- // called push() with new data. In this case we skip performing more
- // read()s. The execution ends in this method again after the _read() ends
- // up calling push() with more data.
- while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {
- var len = state.length;
- debug('maybeReadMore read 0');
- stream.read(0);
- if (len === state.length)
- // didn't get any data, stop spinning.
- break;
- }
- state.readingMore = false;
-}
-
-// abstract method. to be overridden in specific implementation classes.
-// call cb(er, data) where data is <= n in length.
-// for virtual (non-string, non-buffer) streams, "length" is somewhat
-// arbitrary, and perhaps not very meaningful.
-Readable.prototype._read = function (n) {
- errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()'));
-};
-Readable.prototype.pipe = function (dest, pipeOpts) {
- var src = this;
- var state = this._readableState;
- switch (state.pipesCount) {
- case 0:
- state.pipes = dest;
- break;
- case 1:
- state.pipes = [state.pipes, dest];
- break;
- default:
- state.pipes.push(dest);
- break;
- }
- state.pipesCount += 1;
- debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
- var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
- var endFn = doEnd ? onend : unpipe;
- if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn);
- dest.on('unpipe', onunpipe);
- function onunpipe(readable, unpipeInfo) {
- debug('onunpipe');
- if (readable === src) {
- if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
- unpipeInfo.hasUnpiped = true;
- cleanup();
- }
- }
- }
- function onend() {
- debug('onend');
- dest.end();
- }
-
- // when the dest drains, it reduces the awaitDrain counter
- // on the source. This would be more elegant with a .once()
- // handler in flow(), but adding and removing repeatedly is
- // too slow.
- var ondrain = pipeOnDrain(src);
- dest.on('drain', ondrain);
- var cleanedUp = false;
- function cleanup() {
- debug('cleanup');
- // cleanup event handlers once the pipe is broken
- dest.removeListener('close', onclose);
- dest.removeListener('finish', onfinish);
- dest.removeListener('drain', ondrain);
- dest.removeListener('error', onerror);
- dest.removeListener('unpipe', onunpipe);
- src.removeListener('end', onend);
- src.removeListener('end', unpipe);
- src.removeListener('data', ondata);
- cleanedUp = true;
-
- // if the reader is waiting for a drain event from this
- // specific writer, then it would cause it to never start
- // flowing again.
- // So, if this is awaiting a drain, then we just call it now.
- // If we don't know, then assume that we are waiting for one.
- if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
- }
- src.on('data', ondata);
- function ondata(chunk) {
- debug('ondata');
- var ret = dest.write(chunk);
- debug('dest.write', ret);
- if (ret === false) {
- // If the user unpiped during `dest.write()`, it is possible
- // to get stuck in a permanently paused state if that write
- // also returned false.
- // => Check whether `dest` is still a piping destination.
- if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
- debug('false write response, pause', state.awaitDrain);
- state.awaitDrain++;
- }
- src.pause();
- }
- }
-
- // if the dest has an error, then stop piping into it.
- // however, don't suppress the throwing behavior for this.
- function onerror(er) {
- debug('onerror', er);
- unpipe();
- dest.removeListener('error', onerror);
- if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);
- }
-
- // Make sure our error handler is attached before userland ones.
- prependListener(dest, 'error', onerror);
-
- // Both close and finish should trigger unpipe, but only once.
- function onclose() {
- dest.removeListener('finish', onfinish);
- unpipe();
- }
- dest.once('close', onclose);
- function onfinish() {
- debug('onfinish');
- dest.removeListener('close', onclose);
- unpipe();
- }
- dest.once('finish', onfinish);
- function unpipe() {
- debug('unpipe');
- src.unpipe(dest);
- }
-
- // tell the dest that it's being piped to
- dest.emit('pipe', src);
-
- // start the flow if it hasn't been started already.
- if (!state.flowing) {
- debug('pipe resume');
- src.resume();
- }
- return dest;
-};
-function pipeOnDrain(src) {
- return function pipeOnDrainFunctionResult() {
- var state = src._readableState;
- debug('pipeOnDrain', state.awaitDrain);
- if (state.awaitDrain) state.awaitDrain--;
- if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
- state.flowing = true;
- flow(src);
- }
- };
-}
-Readable.prototype.unpipe = function (dest) {
- var state = this._readableState;
- var unpipeInfo = {
- hasUnpiped: false
- };
-
- // if we're not piping anywhere, then do nothing.
- if (state.pipesCount === 0) return this;
-
- // just one destination. most common case.
- if (state.pipesCount === 1) {
- // passed in one, but it's not the right one.
- if (dest && dest !== state.pipes) return this;
- if (!dest) dest = state.pipes;
-
- // got a match.
- state.pipes = null;
- state.pipesCount = 0;
- state.flowing = false;
- if (dest) dest.emit('unpipe', this, unpipeInfo);
- return this;
- }
-
- // slow case. multiple pipe destinations.
-
- if (!dest) {
- // remove all.
- var dests = state.pipes;
- var len = state.pipesCount;
- state.pipes = null;
- state.pipesCount = 0;
- state.flowing = false;
- for (var i = 0; i < len; i++) dests[i].emit('unpipe', this, {
- hasUnpiped: false
- });
- return this;
- }
-
- // try to find the right one.
- var index = indexOf(state.pipes, dest);
- if (index === -1) return this;
- state.pipes.splice(index, 1);
- state.pipesCount -= 1;
- if (state.pipesCount === 1) state.pipes = state.pipes[0];
- dest.emit('unpipe', this, unpipeInfo);
- return this;
-};
-
-// set up data events if they are asked for
-// Ensure readable listeners eventually get something
-Readable.prototype.on = function (ev, fn) {
- var res = Stream.prototype.on.call(this, ev, fn);
- var state = this._readableState;
- if (ev === 'data') {
- // update readableListening so that resume() may be a no-op
- // a few lines down. This is needed to support once('readable').
- state.readableListening = this.listenerCount('readable') > 0;
-
- // Try start flowing on next tick if stream isn't explicitly paused
- if (state.flowing !== false) this.resume();
- } else if (ev === 'readable') {
- if (!state.endEmitted && !state.readableListening) {
- state.readableListening = state.needReadable = true;
- state.flowing = false;
- state.emittedReadable = false;
- debug('on readable', state.length, state.reading);
- if (state.length) {
- emitReadable(this);
- } else if (!state.reading) {
- process.nextTick(nReadingNextTick, this);
- }
- }
- }
- return res;
-};
-Readable.prototype.addListener = Readable.prototype.on;
-Readable.prototype.removeListener = function (ev, fn) {
- var res = Stream.prototype.removeListener.call(this, ev, fn);
- if (ev === 'readable') {
- // We need to check if there is someone still listening to
- // readable and reset the state. However this needs to happen
- // after readable has been emitted but before I/O (nextTick) to
- // support once('readable', fn) cycles. This means that calling
- // resume within the same tick will have no
- // effect.
- process.nextTick(updateReadableListening, this);
- }
- return res;
-};
-Readable.prototype.removeAllListeners = function (ev) {
- var res = Stream.prototype.removeAllListeners.apply(this, arguments);
- if (ev === 'readable' || ev === undefined) {
- // We need to check if there is someone still listening to
- // readable and reset the state. However this needs to happen
- // after readable has been emitted but before I/O (nextTick) to
- // support once('readable', fn) cycles. This means that calling
- // resume within the same tick will have no
- // effect.
- process.nextTick(updateReadableListening, this);
- }
- return res;
-};
-function updateReadableListening(self) {
- var state = self._readableState;
- state.readableListening = self.listenerCount('readable') > 0;
- if (state.resumeScheduled && !state.paused) {
- // flowing needs to be set to true now, otherwise
- // the upcoming resume will not flow.
- state.flowing = true;
-
- // crude way to check if we should resume
- } else if (self.listenerCount('data') > 0) {
- self.resume();
- }
-}
-function nReadingNextTick(self) {
- debug('readable nexttick read 0');
- self.read(0);
-}
-
-// pause() and resume() are remnants of the legacy readable stream API
-// If the user uses them, then switch into old mode.
-Readable.prototype.resume = function () {
- var state = this._readableState;
- if (!state.flowing) {
- debug('resume');
- // we flow only if there is no one listening
- // for readable, but we still have to call
- // resume()
- state.flowing = !state.readableListening;
- resume(this, state);
- }
- state.paused = false;
- return this;
-};
-function resume(stream, state) {
- if (!state.resumeScheduled) {
- state.resumeScheduled = true;
- process.nextTick(resume_, stream, state);
- }
-}
-function resume_(stream, state) {
- debug('resume', state.reading);
- if (!state.reading) {
- stream.read(0);
- }
- state.resumeScheduled = false;
- stream.emit('resume');
- flow(stream);
- if (state.flowing && !state.reading) stream.read(0);
-}
-Readable.prototype.pause = function () {
- debug('call pause flowing=%j', this._readableState.flowing);
- if (this._readableState.flowing !== false) {
- debug('pause');
- this._readableState.flowing = false;
- this.emit('pause');
- }
- this._readableState.paused = true;
- return this;
-};
-function flow(stream) {
- var state = stream._readableState;
- debug('flow', state.flowing);
- while (state.flowing && stream.read() !== null);
-}
-
-// wrap an old-style stream as the async data source.
-// This is *not* part of the readable stream interface.
-// It is an ugly unfortunate mess of history.
-Readable.prototype.wrap = function (stream) {
- var _this = this;
- var state = this._readableState;
- var paused = false;
- stream.on('end', function () {
- debug('wrapped end');
- if (state.decoder && !state.ended) {
- var chunk = state.decoder.end();
- if (chunk && chunk.length) _this.push(chunk);
- }
- _this.push(null);
- });
- stream.on('data', function (chunk) {
- debug('wrapped data');
- if (state.decoder) chunk = state.decoder.write(chunk);
-
- // don't skip over falsy values in objectMode
- if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
- var ret = _this.push(chunk);
- if (!ret) {
- paused = true;
- stream.pause();
- }
- });
-
- // proxy all the other methods.
- // important when wrapping filters and duplexes.
- for (var i in stream) {
- if (this[i] === undefined && typeof stream[i] === 'function') {
- this[i] = function methodWrap(method) {
- return function methodWrapReturnFunction() {
- return stream[method].apply(stream, arguments);
- };
- }(i);
- }
- }
-
- // proxy certain important events.
- for (var n = 0; n < kProxyEvents.length; n++) {
- stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
- }
-
- // when we try to consume some more bytes, simply unpause the
- // underlying stream.
- this._read = function (n) {
- debug('wrapped _read', n);
- if (paused) {
- paused = false;
- stream.resume();
- }
- };
- return this;
-};
-if (typeof Symbol === 'function') {
- Readable.prototype[Symbol.asyncIterator] = function () {
- if (createReadableStreamAsyncIterator === undefined) {
- createReadableStreamAsyncIterator = require('./internal/streams/async_iterator');
- }
- return createReadableStreamAsyncIterator(this);
- };
-}
-Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._readableState.highWaterMark;
- }
-});
-Object.defineProperty(Readable.prototype, 'readableBuffer', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._readableState && this._readableState.buffer;
- }
-});
-Object.defineProperty(Readable.prototype, 'readableFlowing', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._readableState.flowing;
- },
- set: function set(state) {
- if (this._readableState) {
- this._readableState.flowing = state;
- }
- }
-});
-
-// exposed for testing purposes only.
-Readable._fromList = fromList;
-Object.defineProperty(Readable.prototype, 'readableLength', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._readableState.length;
- }
-});
-
-// Pluck off n bytes from an array of buffers.
-// Length is the combined lengths of all the buffers in the list.
-// This function is designed to be inlinable, so please take care when making
-// changes to the function body.
-function fromList(n, state) {
- // nothing buffered
- if (state.length === 0) return null;
- var ret;
- if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
- // read it all, truncate the list
- if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length);
- state.buffer.clear();
- } else {
- // read part of list
- ret = state.buffer.consume(n, state.decoder);
- }
- return ret;
-}
-function endReadable(stream) {
- var state = stream._readableState;
- debug('endReadable', state.endEmitted);
- if (!state.endEmitted) {
- state.ended = true;
- process.nextTick(endReadableNT, state, stream);
- }
-}
-function endReadableNT(state, stream) {
- debug('endReadableNT', state.endEmitted, state.length);
-
- // Check that we didn't get one last unshift.
- if (!state.endEmitted && state.length === 0) {
- state.endEmitted = true;
- stream.readable = false;
- stream.emit('end');
- if (state.autoDestroy) {
- // In case of duplex streams we need a way to detect
- // if the writable side is ready for autoDestroy as well
- var wState = stream._writableState;
- if (!wState || wState.autoDestroy && wState.finished) {
- stream.destroy();
- }
- }
- }
-}
-if (typeof Symbol === 'function') {
- Readable.from = function (iterable, opts) {
- if (from === undefined) {
- from = require('./internal/streams/from');
- }
- return from(Readable, iterable, opts);
- };
-}
-function indexOf(xs, x) {
- for (var i = 0, l = xs.length; i < l; i++) {
- if (xs[i] === x) return i;
- }
- return -1;
-}
\ No newline at end of file
diff --git a/node_modules/readable-stream/lib/_stream_transform.js b/node_modules/readable-stream/lib/_stream_transform.js
deleted file mode 100644
index 1ccb715..0000000
--- a/node_modules/readable-stream/lib/_stream_transform.js
+++ /dev/null
@@ -1,190 +0,0 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-// a transform stream is a readable/writable stream where you do
-// something with the data. Sometimes it's called a "filter",
-// but that's not a great name for it, since that implies a thing where
-// some bits pass through, and others are simply ignored. (That would
-// be a valid example of a transform, of course.)
-//
-// While the output is causally related to the input, it's not a
-// necessarily symmetric or synchronous transformation. For example,
-// a zlib stream might take multiple plain-text writes(), and then
-// emit a single compressed chunk some time in the future.
-//
-// Here's how this works:
-//
-// The Transform stream has all the aspects of the readable and writable
-// stream classes. When you write(chunk), that calls _write(chunk,cb)
-// internally, and returns false if there's a lot of pending writes
-// buffered up. When you call read(), that calls _read(n) until
-// there's enough pending readable data buffered up.
-//
-// In a transform stream, the written data is placed in a buffer. When
-// _read(n) is called, it transforms the queued up data, calling the
-// buffered _write cb's as it consumes chunks. If consuming a single
-// written chunk would result in multiple output chunks, then the first
-// outputted bit calls the readcb, and subsequent chunks just go into
-// the read buffer, and will cause it to emit 'readable' if necessary.
-//
-// This way, back-pressure is actually determined by the reading side,
-// since _read has to be called to start processing a new chunk. However,
-// a pathological inflate type of transform can cause excessive buffering
-// here. For example, imagine a stream where every byte of input is
-// interpreted as an integer from 0-255, and then results in that many
-// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
-// 1kb of data being output. In this case, you could write a very small
-// amount of input, and end up with a very large amount of output. In
-// such a pathological inflating mechanism, there'd be no way to tell
-// the system to stop doing the transform. A single 4MB write could
-// cause the system to run out of memory.
-//
-// However, even in such a pathological case, only a single written chunk
-// would be consumed, and then the rest would wait (un-transformed) until
-// the results of the previous transformed chunk were consumed.
-
-'use strict';
-
-module.exports = Transform;
-var _require$codes = require('../errors').codes,
- ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
- ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
- ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING,
- ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
-var Duplex = require('./_stream_duplex');
-require('inherits')(Transform, Duplex);
-function afterTransform(er, data) {
- var ts = this._transformState;
- ts.transforming = false;
- var cb = ts.writecb;
- if (cb === null) {
- return this.emit('error', new ERR_MULTIPLE_CALLBACK());
- }
- ts.writechunk = null;
- ts.writecb = null;
- if (data != null)
- // single equals check for both `null` and `undefined`
- this.push(data);
- cb(er);
- var rs = this._readableState;
- rs.reading = false;
- if (rs.needReadable || rs.length < rs.highWaterMark) {
- this._read(rs.highWaterMark);
- }
-}
-function Transform(options) {
- if (!(this instanceof Transform)) return new Transform(options);
- Duplex.call(this, options);
- this._transformState = {
- afterTransform: afterTransform.bind(this),
- needTransform: false,
- transforming: false,
- writecb: null,
- writechunk: null,
- writeencoding: null
- };
-
- // start out asking for a readable event once data is transformed.
- this._readableState.needReadable = true;
-
- // we have implemented the _read method, and done the other things
- // that Readable wants before the first _read call, so unset the
- // sync guard flag.
- this._readableState.sync = false;
- if (options) {
- if (typeof options.transform === 'function') this._transform = options.transform;
- if (typeof options.flush === 'function') this._flush = options.flush;
- }
-
- // When the writable side finishes, then flush out anything remaining.
- this.on('prefinish', prefinish);
-}
-function prefinish() {
- var _this = this;
- if (typeof this._flush === 'function' && !this._readableState.destroyed) {
- this._flush(function (er, data) {
- done(_this, er, data);
- });
- } else {
- done(this, null, null);
- }
-}
-Transform.prototype.push = function (chunk, encoding) {
- this._transformState.needTransform = false;
- return Duplex.prototype.push.call(this, chunk, encoding);
-};
-
-// This is the part where you do stuff!
-// override this function in implementation classes.
-// 'chunk' is an input chunk.
-//
-// Call `push(newChunk)` to pass along transformed output
-// to the readable side. You may call 'push' zero or more times.
-//
-// Call `cb(err)` when you are done with this chunk. If you pass
-// an error, then that'll put the hurt on the whole operation. If you
-// never call cb(), then you'll never get another chunk.
-Transform.prototype._transform = function (chunk, encoding, cb) {
- cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()'));
-};
-Transform.prototype._write = function (chunk, encoding, cb) {
- var ts = this._transformState;
- ts.writecb = cb;
- ts.writechunk = chunk;
- ts.writeencoding = encoding;
- if (!ts.transforming) {
- var rs = this._readableState;
- if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
- }
-};
-
-// Doesn't matter what the args are here.
-// _transform does all the work.
-// That we got here means that the readable side wants more data.
-Transform.prototype._read = function (n) {
- var ts = this._transformState;
- if (ts.writechunk !== null && !ts.transforming) {
- ts.transforming = true;
- this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
- } else {
- // mark that we need a transform, so that any data that comes in
- // will get processed, now that we've asked for it.
- ts.needTransform = true;
- }
-};
-Transform.prototype._destroy = function (err, cb) {
- Duplex.prototype._destroy.call(this, err, function (err2) {
- cb(err2);
- });
-};
-function done(stream, er, data) {
- if (er) return stream.emit('error', er);
- if (data != null)
- // single equals check for both `null` and `undefined`
- stream.push(data);
-
- // TODO(BridgeAR): Write a test for these two error cases
- // if there's nothing in the write buffer, then that means
- // that nothing more will ever be provided
- if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();
- if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();
- return stream.push(null);
-}
\ No newline at end of file
diff --git a/node_modules/readable-stream/lib/_stream_writable.js b/node_modules/readable-stream/lib/_stream_writable.js
deleted file mode 100644
index 292415e..0000000
--- a/node_modules/readable-stream/lib/_stream_writable.js
+++ /dev/null
@@ -1,641 +0,0 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-// A bit simpler than readable streams.
-// Implement an async ._write(chunk, encoding, cb), and it'll handle all
-// the drain event emission and buffering.
-
-'use strict';
-
-module.exports = Writable;
-
-/* */
-function WriteReq(chunk, encoding, cb) {
- this.chunk = chunk;
- this.encoding = encoding;
- this.callback = cb;
- this.next = null;
-}
-
-// It seems a linked list but it is not
-// there will be only 2 of these for each stream
-function CorkedRequest(state) {
- var _this = this;
- this.next = null;
- this.entry = null;
- this.finish = function () {
- onCorkedFinish(_this, state);
- };
-}
-/* */
-
-/**/
-var Duplex;
-/**/
-
-Writable.WritableState = WritableState;
-
-/**/
-var internalUtil = {
- deprecate: require('util-deprecate')
-};
-/**/
-
-/**/
-var Stream = require('./internal/streams/stream');
-/**/
-
-var Buffer = require('buffer').Buffer;
-var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};
-function _uint8ArrayToBuffer(chunk) {
- return Buffer.from(chunk);
-}
-function _isUint8Array(obj) {
- return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
-}
-var destroyImpl = require('./internal/streams/destroy');
-var _require = require('./internal/streams/state'),
- getHighWaterMark = _require.getHighWaterMark;
-var _require$codes = require('../errors').codes,
- ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
- ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
- ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
- ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE,
- ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED,
- ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES,
- ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END,
- ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
-var errorOrDestroy = destroyImpl.errorOrDestroy;
-require('inherits')(Writable, Stream);
-function nop() {}
-function WritableState(options, stream, isDuplex) {
- Duplex = Duplex || require('./_stream_duplex');
- options = options || {};
-
- // Duplex streams are both readable and writable, but share
- // the same options object.
- // However, some cases require setting options to different
- // values for the readable and the writable sides of the duplex stream,
- // e.g. options.readableObjectMode vs. options.writableObjectMode, etc.
- if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex;
-
- // object stream flag to indicate whether or not this stream
- // contains buffers or objects.
- this.objectMode = !!options.objectMode;
- if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
-
- // the point at which write() starts returning false
- // Note: 0 is a valid value, means that we always return false if
- // the entire buffer is not flushed immediately on write()
- this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex);
-
- // if _final has been called
- this.finalCalled = false;
-
- // drain event flag.
- this.needDrain = false;
- // at the start of calling end()
- this.ending = false;
- // when end() has been called, and returned
- this.ended = false;
- // when 'finish' is emitted
- this.finished = false;
-
- // has it been destroyed
- this.destroyed = false;
-
- // should we decode strings into buffers before passing to _write?
- // this is here so that some node-core streams can optimize string
- // handling at a lower level.
- var noDecode = options.decodeStrings === false;
- this.decodeStrings = !noDecode;
-
- // Crypto is kind of old and crusty. Historically, its default string
- // encoding is 'binary' so we have to make this configurable.
- // Everything else in the universe uses 'utf8', though.
- this.defaultEncoding = options.defaultEncoding || 'utf8';
-
- // not an actual buffer we keep track of, but a measurement
- // of how much we're waiting to get pushed to some underlying
- // socket or file.
- this.length = 0;
-
- // a flag to see when we're in the middle of a write.
- this.writing = false;
-
- // when true all writes will be buffered until .uncork() call
- this.corked = 0;
-
- // a flag to be able to tell if the onwrite cb is called immediately,
- // or on a later tick. We set this to true at first, because any
- // actions that shouldn't happen until "later" should generally also
- // not happen before the first write call.
- this.sync = true;
-
- // a flag to know if we're processing previously buffered items, which
- // may call the _write() callback in the same tick, so that we don't
- // end up in an overlapped onwrite situation.
- this.bufferProcessing = false;
-
- // the callback that's passed to _write(chunk,cb)
- this.onwrite = function (er) {
- onwrite(stream, er);
- };
-
- // the callback that the user supplies to write(chunk,encoding,cb)
- this.writecb = null;
-
- // the amount that is being written when _write is called.
- this.writelen = 0;
- this.bufferedRequest = null;
- this.lastBufferedRequest = null;
-
- // number of pending user-supplied write callbacks
- // this must be 0 before 'finish' can be emitted
- this.pendingcb = 0;
-
- // emit prefinish if the only thing we're waiting for is _write cbs
- // This is relevant for synchronous Transform streams
- this.prefinished = false;
-
- // True if the error was already emitted and should not be thrown again
- this.errorEmitted = false;
-
- // Should close be emitted on destroy. Defaults to true.
- this.emitClose = options.emitClose !== false;
-
- // Should .destroy() be called after 'finish' (and potentially 'end')
- this.autoDestroy = !!options.autoDestroy;
-
- // count buffered requests
- this.bufferedRequestCount = 0;
-
- // allocate the first CorkedRequest, there is always
- // one allocated and free to use, and we maintain at most two
- this.corkedRequestsFree = new CorkedRequest(this);
-}
-WritableState.prototype.getBuffer = function getBuffer() {
- var current = this.bufferedRequest;
- var out = [];
- while (current) {
- out.push(current);
- current = current.next;
- }
- return out;
-};
-(function () {
- try {
- Object.defineProperty(WritableState.prototype, 'buffer', {
- get: internalUtil.deprecate(function writableStateBufferGetter() {
- return this.getBuffer();
- }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
- });
- } catch (_) {}
-})();
-
-// Test _writableState for inheritance to account for Duplex streams,
-// whose prototype chain only points to Readable.
-var realHasInstance;
-if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
- realHasInstance = Function.prototype[Symbol.hasInstance];
- Object.defineProperty(Writable, Symbol.hasInstance, {
- value: function value(object) {
- if (realHasInstance.call(this, object)) return true;
- if (this !== Writable) return false;
- return object && object._writableState instanceof WritableState;
- }
- });
-} else {
- realHasInstance = function realHasInstance(object) {
- return object instanceof this;
- };
-}
-function Writable(options) {
- Duplex = Duplex || require('./_stream_duplex');
-
- // Writable ctor is applied to Duplexes, too.
- // `realHasInstance` is necessary because using plain `instanceof`
- // would return false, as no `_writableState` property is attached.
-
- // Trying to use the custom `instanceof` for Writable here will also break the
- // Node.js LazyTransform implementation, which has a non-trivial getter for
- // `_writableState` that would lead to infinite recursion.
-
- // Checking for a Stream.Duplex instance is faster here instead of inside
- // the WritableState constructor, at least with V8 6.5
- var isDuplex = this instanceof Duplex;
- if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options);
- this._writableState = new WritableState(options, this, isDuplex);
-
- // legacy.
- this.writable = true;
- if (options) {
- if (typeof options.write === 'function') this._write = options.write;
- if (typeof options.writev === 'function') this._writev = options.writev;
- if (typeof options.destroy === 'function') this._destroy = options.destroy;
- if (typeof options.final === 'function') this._final = options.final;
- }
- Stream.call(this);
-}
-
-// Otherwise people can pipe Writable streams, which is just wrong.
-Writable.prototype.pipe = function () {
- errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());
-};
-function writeAfterEnd(stream, cb) {
- var er = new ERR_STREAM_WRITE_AFTER_END();
- // TODO: defer error events consistently everywhere, not just the cb
- errorOrDestroy(stream, er);
- process.nextTick(cb, er);
-}
-
-// Checks that a user-supplied chunk is valid, especially for the particular
-// mode the stream is in. Currently this means that `null` is never accepted
-// and undefined/non-string values are only allowed in object mode.
-function validChunk(stream, state, chunk, cb) {
- var er;
- if (chunk === null) {
- er = new ERR_STREAM_NULL_VALUES();
- } else if (typeof chunk !== 'string' && !state.objectMode) {
- er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk);
- }
- if (er) {
- errorOrDestroy(stream, er);
- process.nextTick(cb, er);
- return false;
- }
- return true;
-}
-Writable.prototype.write = function (chunk, encoding, cb) {
- var state = this._writableState;
- var ret = false;
- var isBuf = !state.objectMode && _isUint8Array(chunk);
- if (isBuf && !Buffer.isBuffer(chunk)) {
- chunk = _uint8ArrayToBuffer(chunk);
- }
- if (typeof encoding === 'function') {
- cb = encoding;
- encoding = null;
- }
- if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
- if (typeof cb !== 'function') cb = nop;
- if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
- state.pendingcb++;
- ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
- }
- return ret;
-};
-Writable.prototype.cork = function () {
- this._writableState.corked++;
-};
-Writable.prototype.uncork = function () {
- var state = this._writableState;
- if (state.corked) {
- state.corked--;
- if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
- }
-};
-Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
- // node::ParseEncoding() requires lower case.
- if (typeof encoding === 'string') encoding = encoding.toLowerCase();
- if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding);
- this._writableState.defaultEncoding = encoding;
- return this;
-};
-Object.defineProperty(Writable.prototype, 'writableBuffer', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState && this._writableState.getBuffer();
- }
-});
-function decodeChunk(state, chunk, encoding) {
- if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
- chunk = Buffer.from(chunk, encoding);
- }
- return chunk;
-}
-Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState.highWaterMark;
- }
-});
-
-// if we're already writing something, then just put this
-// in the queue, and wait our turn. Otherwise, call _write
-// If we return false, then we need a drain event, so set that flag.
-function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
- if (!isBuf) {
- var newChunk = decodeChunk(state, chunk, encoding);
- if (chunk !== newChunk) {
- isBuf = true;
- encoding = 'buffer';
- chunk = newChunk;
- }
- }
- var len = state.objectMode ? 1 : chunk.length;
- state.length += len;
- var ret = state.length < state.highWaterMark;
- // we must ensure that previous needDrain will not be reset to false.
- if (!ret) state.needDrain = true;
- if (state.writing || state.corked) {
- var last = state.lastBufferedRequest;
- state.lastBufferedRequest = {
- chunk: chunk,
- encoding: encoding,
- isBuf: isBuf,
- callback: cb,
- next: null
- };
- if (last) {
- last.next = state.lastBufferedRequest;
- } else {
- state.bufferedRequest = state.lastBufferedRequest;
- }
- state.bufferedRequestCount += 1;
- } else {
- doWrite(stream, state, false, len, chunk, encoding, cb);
- }
- return ret;
-}
-function doWrite(stream, state, writev, len, chunk, encoding, cb) {
- state.writelen = len;
- state.writecb = cb;
- state.writing = true;
- state.sync = true;
- if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
- state.sync = false;
-}
-function onwriteError(stream, state, sync, er, cb) {
- --state.pendingcb;
- if (sync) {
- // defer the callback if we are being called synchronously
- // to avoid piling up things on the stack
- process.nextTick(cb, er);
- // this can emit finish, and it will always happen
- // after error
- process.nextTick(finishMaybe, stream, state);
- stream._writableState.errorEmitted = true;
- errorOrDestroy(stream, er);
- } else {
- // the caller expect this to happen before if
- // it is async
- cb(er);
- stream._writableState.errorEmitted = true;
- errorOrDestroy(stream, er);
- // this can emit finish, but finish must
- // always follow error
- finishMaybe(stream, state);
- }
-}
-function onwriteStateUpdate(state) {
- state.writing = false;
- state.writecb = null;
- state.length -= state.writelen;
- state.writelen = 0;
-}
-function onwrite(stream, er) {
- var state = stream._writableState;
- var sync = state.sync;
- var cb = state.writecb;
- if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK();
- onwriteStateUpdate(state);
- if (er) onwriteError(stream, state, sync, er, cb);else {
- // Check if we're actually ready to finish, but don't emit yet
- var finished = needFinish(state) || stream.destroyed;
- if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
- clearBuffer(stream, state);
- }
- if (sync) {
- process.nextTick(afterWrite, stream, state, finished, cb);
- } else {
- afterWrite(stream, state, finished, cb);
- }
- }
-}
-function afterWrite(stream, state, finished, cb) {
- if (!finished) onwriteDrain(stream, state);
- state.pendingcb--;
- cb();
- finishMaybe(stream, state);
-}
-
-// Must force callback to be called on nextTick, so that we don't
-// emit 'drain' before the write() consumer gets the 'false' return
-// value, and has a chance to attach a 'drain' listener.
-function onwriteDrain(stream, state) {
- if (state.length === 0 && state.needDrain) {
- state.needDrain = false;
- stream.emit('drain');
- }
-}
-
-// if there's something in the buffer waiting, then process it
-function clearBuffer(stream, state) {
- state.bufferProcessing = true;
- var entry = state.bufferedRequest;
- if (stream._writev && entry && entry.next) {
- // Fast case, write everything using _writev()
- var l = state.bufferedRequestCount;
- var buffer = new Array(l);
- var holder = state.corkedRequestsFree;
- holder.entry = entry;
- var count = 0;
- var allBuffers = true;
- while (entry) {
- buffer[count] = entry;
- if (!entry.isBuf) allBuffers = false;
- entry = entry.next;
- count += 1;
- }
- buffer.allBuffers = allBuffers;
- doWrite(stream, state, true, state.length, buffer, '', holder.finish);
-
- // doWrite is almost always async, defer these to save a bit of time
- // as the hot path ends with doWrite
- state.pendingcb++;
- state.lastBufferedRequest = null;
- if (holder.next) {
- state.corkedRequestsFree = holder.next;
- holder.next = null;
- } else {
- state.corkedRequestsFree = new CorkedRequest(state);
- }
- state.bufferedRequestCount = 0;
- } else {
- // Slow case, write chunks one-by-one
- while (entry) {
- var chunk = entry.chunk;
- var encoding = entry.encoding;
- var cb = entry.callback;
- var len = state.objectMode ? 1 : chunk.length;
- doWrite(stream, state, false, len, chunk, encoding, cb);
- entry = entry.next;
- state.bufferedRequestCount--;
- // if we didn't call the onwrite immediately, then
- // it means that we need to wait until it does.
- // also, that means that the chunk and cb are currently
- // being processed, so move the buffer counter past them.
- if (state.writing) {
- break;
- }
- }
- if (entry === null) state.lastBufferedRequest = null;
- }
- state.bufferedRequest = entry;
- state.bufferProcessing = false;
-}
-Writable.prototype._write = function (chunk, encoding, cb) {
- cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()'));
-};
-Writable.prototype._writev = null;
-Writable.prototype.end = function (chunk, encoding, cb) {
- var state = this._writableState;
- if (typeof chunk === 'function') {
- cb = chunk;
- chunk = null;
- encoding = null;
- } else if (typeof encoding === 'function') {
- cb = encoding;
- encoding = null;
- }
- if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
-
- // .end() fully uncorks
- if (state.corked) {
- state.corked = 1;
- this.uncork();
- }
-
- // ignore unnecessary end() calls.
- if (!state.ending) endWritable(this, state, cb);
- return this;
-};
-Object.defineProperty(Writable.prototype, 'writableLength', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- return this._writableState.length;
- }
-});
-function needFinish(state) {
- return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
-}
-function callFinal(stream, state) {
- stream._final(function (err) {
- state.pendingcb--;
- if (err) {
- errorOrDestroy(stream, err);
- }
- state.prefinished = true;
- stream.emit('prefinish');
- finishMaybe(stream, state);
- });
-}
-function prefinish(stream, state) {
- if (!state.prefinished && !state.finalCalled) {
- if (typeof stream._final === 'function' && !state.destroyed) {
- state.pendingcb++;
- state.finalCalled = true;
- process.nextTick(callFinal, stream, state);
- } else {
- state.prefinished = true;
- stream.emit('prefinish');
- }
- }
-}
-function finishMaybe(stream, state) {
- var need = needFinish(state);
- if (need) {
- prefinish(stream, state);
- if (state.pendingcb === 0) {
- state.finished = true;
- stream.emit('finish');
- if (state.autoDestroy) {
- // In case of duplex streams we need a way to detect
- // if the readable side is ready for autoDestroy as well
- var rState = stream._readableState;
- if (!rState || rState.autoDestroy && rState.endEmitted) {
- stream.destroy();
- }
- }
- }
- }
- return need;
-}
-function endWritable(stream, state, cb) {
- state.ending = true;
- finishMaybe(stream, state);
- if (cb) {
- if (state.finished) process.nextTick(cb);else stream.once('finish', cb);
- }
- state.ended = true;
- stream.writable = false;
-}
-function onCorkedFinish(corkReq, state, err) {
- var entry = corkReq.entry;
- corkReq.entry = null;
- while (entry) {
- var cb = entry.callback;
- state.pendingcb--;
- cb(err);
- entry = entry.next;
- }
-
- // reuse the free corkReq.
- state.corkedRequestsFree.next = corkReq;
-}
-Object.defineProperty(Writable.prototype, 'destroyed', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function get() {
- if (this._writableState === undefined) {
- return false;
- }
- return this._writableState.destroyed;
- },
- set: function set(value) {
- // we ignore the value if the stream
- // has not been initialized yet
- if (!this._writableState) {
- return;
- }
-
- // backward compatibility, the user is explicitly
- // managing destroyed
- this._writableState.destroyed = value;
- }
-});
-Writable.prototype.destroy = destroyImpl.destroy;
-Writable.prototype._undestroy = destroyImpl.undestroy;
-Writable.prototype._destroy = function (err, cb) {
- cb(err);
-};
\ No newline at end of file
diff --git a/node_modules/readable-stream/lib/internal/streams/async_iterator.js b/node_modules/readable-stream/lib/internal/streams/async_iterator.js
deleted file mode 100644
index 742c5a4..0000000
--- a/node_modules/readable-stream/lib/internal/streams/async_iterator.js
+++ /dev/null
@@ -1,180 +0,0 @@
-'use strict';
-
-var _Object$setPrototypeO;
-function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
-function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
-var finished = require('./end-of-stream');
-var kLastResolve = Symbol('lastResolve');
-var kLastReject = Symbol('lastReject');
-var kError = Symbol('error');
-var kEnded = Symbol('ended');
-var kLastPromise = Symbol('lastPromise');
-var kHandlePromise = Symbol('handlePromise');
-var kStream = Symbol('stream');
-function createIterResult(value, done) {
- return {
- value: value,
- done: done
- };
-}
-function readAndResolve(iter) {
- var resolve = iter[kLastResolve];
- if (resolve !== null) {
- var data = iter[kStream].read();
- // we defer if data is null
- // we can be expecting either 'end' or
- // 'error'
- if (data !== null) {
- iter[kLastPromise] = null;
- iter[kLastResolve] = null;
- iter[kLastReject] = null;
- resolve(createIterResult(data, false));
- }
- }
-}
-function onReadable(iter) {
- // we wait for the next tick, because it might
- // emit an error with process.nextTick
- process.nextTick(readAndResolve, iter);
-}
-function wrapForNext(lastPromise, iter) {
- return function (resolve, reject) {
- lastPromise.then(function () {
- if (iter[kEnded]) {
- resolve(createIterResult(undefined, true));
- return;
- }
- iter[kHandlePromise](resolve, reject);
- }, reject);
- };
-}
-var AsyncIteratorPrototype = Object.getPrototypeOf(function () {});
-var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = {
- get stream() {
- return this[kStream];
- },
- next: function next() {
- var _this = this;
- // if we have detected an error in the meanwhile
- // reject straight away
- var error = this[kError];
- if (error !== null) {
- return Promise.reject(error);
- }
- if (this[kEnded]) {
- return Promise.resolve(createIterResult(undefined, true));
- }
- if (this[kStream].destroyed) {
- // We need to defer via nextTick because if .destroy(err) is
- // called, the error will be emitted via nextTick, and
- // we cannot guarantee that there is no error lingering around
- // waiting to be emitted.
- return new Promise(function (resolve, reject) {
- process.nextTick(function () {
- if (_this[kError]) {
- reject(_this[kError]);
- } else {
- resolve(createIterResult(undefined, true));
- }
- });
- });
- }
-
- // if we have multiple next() calls
- // we will wait for the previous Promise to finish
- // this logic is optimized to support for await loops,
- // where next() is only called once at a time
- var lastPromise = this[kLastPromise];
- var promise;
- if (lastPromise) {
- promise = new Promise(wrapForNext(lastPromise, this));
- } else {
- // fast path needed to support multiple this.push()
- // without triggering the next() queue
- var data = this[kStream].read();
- if (data !== null) {
- return Promise.resolve(createIterResult(data, false));
- }
- promise = new Promise(this[kHandlePromise]);
- }
- this[kLastPromise] = promise;
- return promise;
- }
-}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () {
- return this;
-}), _defineProperty(_Object$setPrototypeO, "return", function _return() {
- var _this2 = this;
- // destroy(err, cb) is a private API
- // we can guarantee we have that here, because we control the
- // Readable class this is attached to
- return new Promise(function (resolve, reject) {
- _this2[kStream].destroy(null, function (err) {
- if (err) {
- reject(err);
- return;
- }
- resolve(createIterResult(undefined, true));
- });
- });
-}), _Object$setPrototypeO), AsyncIteratorPrototype);
-var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) {
- var _Object$create;
- var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, {
- value: stream,
- writable: true
- }), _defineProperty(_Object$create, kLastResolve, {
- value: null,
- writable: true
- }), _defineProperty(_Object$create, kLastReject, {
- value: null,
- writable: true
- }), _defineProperty(_Object$create, kError, {
- value: null,
- writable: true
- }), _defineProperty(_Object$create, kEnded, {
- value: stream._readableState.endEmitted,
- writable: true
- }), _defineProperty(_Object$create, kHandlePromise, {
- value: function value(resolve, reject) {
- var data = iterator[kStream].read();
- if (data) {
- iterator[kLastPromise] = null;
- iterator[kLastResolve] = null;
- iterator[kLastReject] = null;
- resolve(createIterResult(data, false));
- } else {
- iterator[kLastResolve] = resolve;
- iterator[kLastReject] = reject;
- }
- },
- writable: true
- }), _Object$create));
- iterator[kLastPromise] = null;
- finished(stream, function (err) {
- if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') {
- var reject = iterator[kLastReject];
- // reject if we are waiting for data in the Promise
- // returned by next() and store the error
- if (reject !== null) {
- iterator[kLastPromise] = null;
- iterator[kLastResolve] = null;
- iterator[kLastReject] = null;
- reject(err);
- }
- iterator[kError] = err;
- return;
- }
- var resolve = iterator[kLastResolve];
- if (resolve !== null) {
- iterator[kLastPromise] = null;
- iterator[kLastResolve] = null;
- iterator[kLastReject] = null;
- resolve(createIterResult(undefined, true));
- }
- iterator[kEnded] = true;
- });
- stream.on('readable', onReadable.bind(null, iterator));
- return iterator;
-};
-module.exports = createReadableStreamAsyncIterator;
\ No newline at end of file
diff --git a/node_modules/readable-stream/lib/internal/streams/buffer_list.js b/node_modules/readable-stream/lib/internal/streams/buffer_list.js
deleted file mode 100644
index 69bda49..0000000
--- a/node_modules/readable-stream/lib/internal/streams/buffer_list.js
+++ /dev/null
@@ -1,183 +0,0 @@
-'use strict';
-
-function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
-function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
-function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
-function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
-function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
-function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
-var _require = require('buffer'),
- Buffer = _require.Buffer;
-var _require2 = require('util'),
- inspect = _require2.inspect;
-var custom = inspect && inspect.custom || 'inspect';
-function copyBuffer(src, target, offset) {
- Buffer.prototype.copy.call(src, target, offset);
-}
-module.exports = /*#__PURE__*/function () {
- function BufferList() {
- _classCallCheck(this, BufferList);
- this.head = null;
- this.tail = null;
- this.length = 0;
- }
- _createClass(BufferList, [{
- key: "push",
- value: function push(v) {
- var entry = {
- data: v,
- next: null
- };
- if (this.length > 0) this.tail.next = entry;else this.head = entry;
- this.tail = entry;
- ++this.length;
- }
- }, {
- key: "unshift",
- value: function unshift(v) {
- var entry = {
- data: v,
- next: this.head
- };
- if (this.length === 0) this.tail = entry;
- this.head = entry;
- ++this.length;
- }
- }, {
- key: "shift",
- value: function shift() {
- if (this.length === 0) return;
- var ret = this.head.data;
- if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
- --this.length;
- return ret;
- }
- }, {
- key: "clear",
- value: function clear() {
- this.head = this.tail = null;
- this.length = 0;
- }
- }, {
- key: "join",
- value: function join(s) {
- if (this.length === 0) return '';
- var p = this.head;
- var ret = '' + p.data;
- while (p = p.next) ret += s + p.data;
- return ret;
- }
- }, {
- key: "concat",
- value: function concat(n) {
- if (this.length === 0) return Buffer.alloc(0);
- var ret = Buffer.allocUnsafe(n >>> 0);
- var p = this.head;
- var i = 0;
- while (p) {
- copyBuffer(p.data, ret, i);
- i += p.data.length;
- p = p.next;
- }
- return ret;
- }
-
- // Consumes a specified amount of bytes or characters from the buffered data.
- }, {
- key: "consume",
- value: function consume(n, hasStrings) {
- var ret;
- if (n < this.head.data.length) {
- // `slice` is the same for buffers and strings.
- ret = this.head.data.slice(0, n);
- this.head.data = this.head.data.slice(n);
- } else if (n === this.head.data.length) {
- // First chunk is a perfect match.
- ret = this.shift();
- } else {
- // Result spans more than one buffer.
- ret = hasStrings ? this._getString(n) : this._getBuffer(n);
- }
- return ret;
- }
- }, {
- key: "first",
- value: function first() {
- return this.head.data;
- }
-
- // Consumes a specified amount of characters from the buffered data.
- }, {
- key: "_getString",
- value: function _getString(n) {
- var p = this.head;
- var c = 1;
- var ret = p.data;
- n -= ret.length;
- while (p = p.next) {
- var str = p.data;
- var nb = n > str.length ? str.length : n;
- if (nb === str.length) ret += str;else ret += str.slice(0, n);
- n -= nb;
- if (n === 0) {
- if (nb === str.length) {
- ++c;
- if (p.next) this.head = p.next;else this.head = this.tail = null;
- } else {
- this.head = p;
- p.data = str.slice(nb);
- }
- break;
- }
- ++c;
- }
- this.length -= c;
- return ret;
- }
-
- // Consumes a specified amount of bytes from the buffered data.
- }, {
- key: "_getBuffer",
- value: function _getBuffer(n) {
- var ret = Buffer.allocUnsafe(n);
- var p = this.head;
- var c = 1;
- p.data.copy(ret);
- n -= p.data.length;
- while (p = p.next) {
- var buf = p.data;
- var nb = n > buf.length ? buf.length : n;
- buf.copy(ret, ret.length - n, 0, nb);
- n -= nb;
- if (n === 0) {
- if (nb === buf.length) {
- ++c;
- if (p.next) this.head = p.next;else this.head = this.tail = null;
- } else {
- this.head = p;
- p.data = buf.slice(nb);
- }
- break;
- }
- ++c;
- }
- this.length -= c;
- return ret;
- }
-
- // Make sure the linked list only shows the minimal necessary information.
- }, {
- key: custom,
- value: function value(_, options) {
- return inspect(this, _objectSpread(_objectSpread({}, options), {}, {
- // Only inspect one level.
- depth: 0,
- // It should not recurse.
- customInspect: false
- }));
- }
- }]);
- return BufferList;
-}();
\ No newline at end of file
diff --git a/node_modules/readable-stream/lib/internal/streams/destroy.js b/node_modules/readable-stream/lib/internal/streams/destroy.js
deleted file mode 100644
index 31a17c4..0000000
--- a/node_modules/readable-stream/lib/internal/streams/destroy.js
+++ /dev/null
@@ -1,96 +0,0 @@
-'use strict';
-
-// undocumented cb() API, needed for core, not for public API
-function destroy(err, cb) {
- var _this = this;
- var readableDestroyed = this._readableState && this._readableState.destroyed;
- var writableDestroyed = this._writableState && this._writableState.destroyed;
- if (readableDestroyed || writableDestroyed) {
- if (cb) {
- cb(err);
- } else if (err) {
- if (!this._writableState) {
- process.nextTick(emitErrorNT, this, err);
- } else if (!this._writableState.errorEmitted) {
- this._writableState.errorEmitted = true;
- process.nextTick(emitErrorNT, this, err);
- }
- }
- return this;
- }
-
- // we set destroyed to true before firing error callbacks in order
- // to make it re-entrance safe in case destroy() is called within callbacks
-
- if (this._readableState) {
- this._readableState.destroyed = true;
- }
-
- // if this is a duplex stream mark the writable part as destroyed as well
- if (this._writableState) {
- this._writableState.destroyed = true;
- }
- this._destroy(err || null, function (err) {
- if (!cb && err) {
- if (!_this._writableState) {
- process.nextTick(emitErrorAndCloseNT, _this, err);
- } else if (!_this._writableState.errorEmitted) {
- _this._writableState.errorEmitted = true;
- process.nextTick(emitErrorAndCloseNT, _this, err);
- } else {
- process.nextTick(emitCloseNT, _this);
- }
- } else if (cb) {
- process.nextTick(emitCloseNT, _this);
- cb(err);
- } else {
- process.nextTick(emitCloseNT, _this);
- }
- });
- return this;
-}
-function emitErrorAndCloseNT(self, err) {
- emitErrorNT(self, err);
- emitCloseNT(self);
-}
-function emitCloseNT(self) {
- if (self._writableState && !self._writableState.emitClose) return;
- if (self._readableState && !self._readableState.emitClose) return;
- self.emit('close');
-}
-function undestroy() {
- if (this._readableState) {
- this._readableState.destroyed = false;
- this._readableState.reading = false;
- this._readableState.ended = false;
- this._readableState.endEmitted = false;
- }
- if (this._writableState) {
- this._writableState.destroyed = false;
- this._writableState.ended = false;
- this._writableState.ending = false;
- this._writableState.finalCalled = false;
- this._writableState.prefinished = false;
- this._writableState.finished = false;
- this._writableState.errorEmitted = false;
- }
-}
-function emitErrorNT(self, err) {
- self.emit('error', err);
-}
-function errorOrDestroy(stream, err) {
- // We have tests that rely on errors being emitted
- // in the same tick, so changing this is semver major.
- // For now when you opt-in to autoDestroy we allow
- // the error to be emitted nextTick. In a future
- // semver major update we should change the default to this.
-
- var rState = stream._readableState;
- var wState = stream._writableState;
- if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err);
-}
-module.exports = {
- destroy: destroy,
- undestroy: undestroy,
- errorOrDestroy: errorOrDestroy
-};
\ No newline at end of file
diff --git a/node_modules/readable-stream/lib/internal/streams/end-of-stream.js b/node_modules/readable-stream/lib/internal/streams/end-of-stream.js
deleted file mode 100644
index 59c671b..0000000
--- a/node_modules/readable-stream/lib/internal/streams/end-of-stream.js
+++ /dev/null
@@ -1,86 +0,0 @@
-// Ported from https://github.com/mafintosh/end-of-stream with
-// permission from the author, Mathias Buus (@mafintosh).
-
-'use strict';
-
-var ERR_STREAM_PREMATURE_CLOSE = require('../../../errors').codes.ERR_STREAM_PREMATURE_CLOSE;
-function once(callback) {
- var called = false;
- return function () {
- if (called) return;
- called = true;
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- callback.apply(this, args);
- };
-}
-function noop() {}
-function isRequest(stream) {
- return stream.setHeader && typeof stream.abort === 'function';
-}
-function eos(stream, opts, callback) {
- if (typeof opts === 'function') return eos(stream, null, opts);
- if (!opts) opts = {};
- callback = once(callback || noop);
- var readable = opts.readable || opts.readable !== false && stream.readable;
- var writable = opts.writable || opts.writable !== false && stream.writable;
- var onlegacyfinish = function onlegacyfinish() {
- if (!stream.writable) onfinish();
- };
- var writableEnded = stream._writableState && stream._writableState.finished;
- var onfinish = function onfinish() {
- writable = false;
- writableEnded = true;
- if (!readable) callback.call(stream);
- };
- var readableEnded = stream._readableState && stream._readableState.endEmitted;
- var onend = function onend() {
- readable = false;
- readableEnded = true;
- if (!writable) callback.call(stream);
- };
- var onerror = function onerror(err) {
- callback.call(stream, err);
- };
- var onclose = function onclose() {
- var err;
- if (readable && !readableEnded) {
- if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
- return callback.call(stream, err);
- }
- if (writable && !writableEnded) {
- if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
- return callback.call(stream, err);
- }
- };
- var onrequest = function onrequest() {
- stream.req.on('finish', onfinish);
- };
- if (isRequest(stream)) {
- stream.on('complete', onfinish);
- stream.on('abort', onclose);
- if (stream.req) onrequest();else stream.on('request', onrequest);
- } else if (writable && !stream._writableState) {
- // legacy streams
- stream.on('end', onlegacyfinish);
- stream.on('close', onlegacyfinish);
- }
- stream.on('end', onend);
- stream.on('finish', onfinish);
- if (opts.error !== false) stream.on('error', onerror);
- stream.on('close', onclose);
- return function () {
- stream.removeListener('complete', onfinish);
- stream.removeListener('abort', onclose);
- stream.removeListener('request', onrequest);
- if (stream.req) stream.req.removeListener('finish', onfinish);
- stream.removeListener('end', onlegacyfinish);
- stream.removeListener('close', onlegacyfinish);
- stream.removeListener('finish', onfinish);
- stream.removeListener('end', onend);
- stream.removeListener('error', onerror);
- stream.removeListener('close', onclose);
- };
-}
-module.exports = eos;
\ No newline at end of file
diff --git a/node_modules/readable-stream/lib/internal/streams/from-browser.js b/node_modules/readable-stream/lib/internal/streams/from-browser.js
deleted file mode 100644
index a4ce56f..0000000
--- a/node_modules/readable-stream/lib/internal/streams/from-browser.js
+++ /dev/null
@@ -1,3 +0,0 @@
-module.exports = function () {
- throw new Error('Readable.from is not available in the browser')
-};
diff --git a/node_modules/readable-stream/lib/internal/streams/from.js b/node_modules/readable-stream/lib/internal/streams/from.js
deleted file mode 100644
index 0a34ee9..0000000
--- a/node_modules/readable-stream/lib/internal/streams/from.js
+++ /dev/null
@@ -1,52 +0,0 @@
-'use strict';
-
-function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
-function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
-function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
-function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
-function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
-function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
-var ERR_INVALID_ARG_TYPE = require('../../../errors').codes.ERR_INVALID_ARG_TYPE;
-function from(Readable, iterable, opts) {
- var iterator;
- if (iterable && typeof iterable.next === 'function') {
- iterator = iterable;
- } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();else throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable);
- var readable = new Readable(_objectSpread({
- objectMode: true
- }, opts));
- // Reading boolean to protect against _read
- // being called before last iteration completion.
- var reading = false;
- readable._read = function () {
- if (!reading) {
- reading = true;
- next();
- }
- };
- function next() {
- return _next2.apply(this, arguments);
- }
- function _next2() {
- _next2 = _asyncToGenerator(function* () {
- try {
- var _yield$iterator$next = yield iterator.next(),
- value = _yield$iterator$next.value,
- done = _yield$iterator$next.done;
- if (done) {
- readable.push(null);
- } else if (readable.push(yield value)) {
- next();
- } else {
- reading = false;
- }
- } catch (err) {
- readable.destroy(err);
- }
- });
- return _next2.apply(this, arguments);
- }
- return readable;
-}
-module.exports = from;
diff --git a/node_modules/readable-stream/lib/internal/streams/pipeline.js b/node_modules/readable-stream/lib/internal/streams/pipeline.js
deleted file mode 100644
index e6f3924..0000000
--- a/node_modules/readable-stream/lib/internal/streams/pipeline.js
+++ /dev/null
@@ -1,86 +0,0 @@
-// Ported from https://github.com/mafintosh/pump with
-// permission from the author, Mathias Buus (@mafintosh).
-
-'use strict';
-
-var eos;
-function once(callback) {
- var called = false;
- return function () {
- if (called) return;
- called = true;
- callback.apply(void 0, arguments);
- };
-}
-var _require$codes = require('../../../errors').codes,
- ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS,
- ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
-function noop(err) {
- // Rethrow the error if it exists to avoid swallowing it
- if (err) throw err;
-}
-function isRequest(stream) {
- return stream.setHeader && typeof stream.abort === 'function';
-}
-function destroyer(stream, reading, writing, callback) {
- callback = once(callback);
- var closed = false;
- stream.on('close', function () {
- closed = true;
- });
- if (eos === undefined) eos = require('./end-of-stream');
- eos(stream, {
- readable: reading,
- writable: writing
- }, function (err) {
- if (err) return callback(err);
- closed = true;
- callback();
- });
- var destroyed = false;
- return function (err) {
- if (closed) return;
- if (destroyed) return;
- destroyed = true;
-
- // request.destroy just do .end - .abort is what we want
- if (isRequest(stream)) return stream.abort();
- if (typeof stream.destroy === 'function') return stream.destroy();
- callback(err || new ERR_STREAM_DESTROYED('pipe'));
- };
-}
-function call(fn) {
- fn();
-}
-function pipe(from, to) {
- return from.pipe(to);
-}
-function popCallback(streams) {
- if (!streams.length) return noop;
- if (typeof streams[streams.length - 1] !== 'function') return noop;
- return streams.pop();
-}
-function pipeline() {
- for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
- streams[_key] = arguments[_key];
- }
- var callback = popCallback(streams);
- if (Array.isArray(streams[0])) streams = streams[0];
- if (streams.length < 2) {
- throw new ERR_MISSING_ARGS('streams');
- }
- var error;
- var destroys = streams.map(function (stream, i) {
- var reading = i < streams.length - 1;
- var writing = i > 0;
- return destroyer(stream, reading, writing, function (err) {
- if (!error) error = err;
- if (err) destroys.forEach(call);
- if (reading) return;
- destroys.forEach(call);
- callback(error);
- });
- });
- return streams.reduce(pipe);
-}
-module.exports = pipeline;
\ No newline at end of file
diff --git a/node_modules/readable-stream/lib/internal/streams/state.js b/node_modules/readable-stream/lib/internal/streams/state.js
deleted file mode 100644
index 3fbf892..0000000
--- a/node_modules/readable-stream/lib/internal/streams/state.js
+++ /dev/null
@@ -1,22 +0,0 @@
-'use strict';
-
-var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE;
-function highWaterMarkFrom(options, isDuplex, duplexKey) {
- return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
-}
-function getHighWaterMark(state, options, duplexKey, isDuplex) {
- var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
- if (hwm != null) {
- if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
- var name = isDuplex ? duplexKey : 'highWaterMark';
- throw new ERR_INVALID_OPT_VALUE(name, hwm);
- }
- return Math.floor(hwm);
- }
-
- // Default value
- return state.objectMode ? 16 : 16 * 1024;
-}
-module.exports = {
- getHighWaterMark: getHighWaterMark
-};
\ No newline at end of file
diff --git a/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/node_modules/readable-stream/lib/internal/streams/stream-browser.js
deleted file mode 100644
index 9332a3f..0000000
--- a/node_modules/readable-stream/lib/internal/streams/stream-browser.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('events').EventEmitter;
diff --git a/node_modules/readable-stream/lib/internal/streams/stream.js b/node_modules/readable-stream/lib/internal/streams/stream.js
deleted file mode 100644
index ce2ad5b..0000000
--- a/node_modules/readable-stream/lib/internal/streams/stream.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('stream');
diff --git a/node_modules/readable-stream/package.json b/node_modules/readable-stream/package.json
deleted file mode 100644
index ade59e7..0000000
--- a/node_modules/readable-stream/package.json
+++ /dev/null
@@ -1,68 +0,0 @@
-{
- "name": "readable-stream",
- "version": "3.6.2",
- "description": "Streams3, a user-land copy of the stream library from Node.js",
- "main": "readable.js",
- "engines": {
- "node": ">= 6"
- },
- "dependencies": {
- "inherits": "^2.0.3",
- "string_decoder": "^1.1.1",
- "util-deprecate": "^1.0.1"
- },
- "devDependencies": {
- "@babel/cli": "^7.2.0",
- "@babel/core": "^7.2.0",
- "@babel/polyfill": "^7.0.0",
- "@babel/preset-env": "^7.2.0",
- "airtap": "0.0.9",
- "assert": "^1.4.0",
- "bl": "^2.0.0",
- "deep-strict-equal": "^0.2.0",
- "events.once": "^2.0.2",
- "glob": "^7.1.2",
- "gunzip-maybe": "^1.4.1",
- "hyperquest": "^2.1.3",
- "lolex": "^2.6.0",
- "nyc": "^11.0.0",
- "pump": "^3.0.0",
- "rimraf": "^2.6.2",
- "tap": "^12.0.0",
- "tape": "^4.9.0",
- "tar-fs": "^1.16.2",
- "util-promisify": "^2.1.0"
- },
- "scripts": {
- "test": "tap -J --no-esm test/parallel/*.js test/ours/*.js",
- "ci": "TAP=1 tap --no-esm test/parallel/*.js test/ours/*.js | tee test.tap",
- "test-browsers": "airtap --sauce-connect --loopback airtap.local -- test/browser.js",
- "test-browser-local": "airtap --open --local -- test/browser.js",
- "cover": "nyc npm test",
- "report": "nyc report --reporter=lcov",
- "update-browser-errors": "babel -o errors-browser.js errors.js"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/nodejs/readable-stream"
- },
- "keywords": [
- "readable",
- "stream",
- "pipe"
- ],
- "browser": {
- "util": false,
- "worker_threads": false,
- "./errors": "./errors-browser.js",
- "./readable.js": "./readable-browser.js",
- "./lib/internal/streams/from.js": "./lib/internal/streams/from-browser.js",
- "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js"
- },
- "nyc": {
- "include": [
- "lib/**.js"
- ]
- },
- "license": "MIT"
-}
diff --git a/node_modules/readable-stream/readable-browser.js b/node_modules/readable-stream/readable-browser.js
deleted file mode 100644
index adbf60d..0000000
--- a/node_modules/readable-stream/readable-browser.js
+++ /dev/null
@@ -1,9 +0,0 @@
-exports = module.exports = require('./lib/_stream_readable.js');
-exports.Stream = exports;
-exports.Readable = exports;
-exports.Writable = require('./lib/_stream_writable.js');
-exports.Duplex = require('./lib/_stream_duplex.js');
-exports.Transform = require('./lib/_stream_transform.js');
-exports.PassThrough = require('./lib/_stream_passthrough.js');
-exports.finished = require('./lib/internal/streams/end-of-stream.js');
-exports.pipeline = require('./lib/internal/streams/pipeline.js');
diff --git a/node_modules/readable-stream/readable.js b/node_modules/readable-stream/readable.js
deleted file mode 100644
index 9e0ca12..0000000
--- a/node_modules/readable-stream/readable.js
+++ /dev/null
@@ -1,16 +0,0 @@
-var Stream = require('stream');
-if (process.env.READABLE_STREAM === 'disable' && Stream) {
- module.exports = Stream.Readable;
- Object.assign(module.exports, Stream);
- module.exports.Stream = Stream;
-} else {
- exports = module.exports = require('./lib/_stream_readable.js');
- exports.Stream = Stream || exports;
- exports.Readable = exports;
- exports.Writable = require('./lib/_stream_writable.js');
- exports.Duplex = require('./lib/_stream_duplex.js');
- exports.Transform = require('./lib/_stream_transform.js');
- exports.PassThrough = require('./lib/_stream_passthrough.js');
- exports.finished = require('./lib/internal/streams/end-of-stream.js');
- exports.pipeline = require('./lib/internal/streams/pipeline.js');
-}
diff --git a/node_modules/safe-buffer/LICENSE b/node_modules/safe-buffer/LICENSE
deleted file mode 100644
index 0c068ce..0000000
--- a/node_modules/safe-buffer/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Feross Aboukhadijeh
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/node_modules/safe-buffer/README.md b/node_modules/safe-buffer/README.md
deleted file mode 100644
index e9a81af..0000000
--- a/node_modules/safe-buffer/README.md
+++ /dev/null
@@ -1,584 +0,0 @@
-# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
-
-[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg
-[travis-url]: https://travis-ci.org/feross/safe-buffer
-[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg
-[npm-url]: https://npmjs.org/package/safe-buffer
-[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg
-[downloads-url]: https://npmjs.org/package/safe-buffer
-[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
-[standard-url]: https://standardjs.com
-
-#### Safer Node.js Buffer API
-
-**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`,
-`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.**
-
-**Uses the built-in implementation when available.**
-
-## install
-
-```
-npm install safe-buffer
-```
-
-## usage
-
-The goal of this package is to provide a safe replacement for the node.js `Buffer`.
-
-It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to
-the top of your node.js modules:
-
-```js
-var Buffer = require('safe-buffer').Buffer
-
-// Existing buffer code will continue to work without issues:
-
-new Buffer('hey', 'utf8')
-new Buffer([1, 2, 3], 'utf8')
-new Buffer(obj)
-new Buffer(16) // create an uninitialized buffer (potentially unsafe)
-
-// But you can use these new explicit APIs to make clear what you want:
-
-Buffer.from('hey', 'utf8') // convert from many types to a Buffer
-Buffer.alloc(16) // create a zero-filled buffer (safe)
-Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe)
-```
-
-## api
-
-### Class Method: Buffer.from(array)
-
-
-* `array` {Array}
-
-Allocates a new `Buffer` using an `array` of octets.
-
-```js
-const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]);
- // creates a new Buffer containing ASCII bytes
- // ['b','u','f','f','e','r']
-```
-
-A `TypeError` will be thrown if `array` is not an `Array`.
-
-### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]])
-
-
-* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or
- a `new ArrayBuffer()`
-* `byteOffset` {Number} Default: `0`
-* `length` {Number} Default: `arrayBuffer.length - byteOffset`
-
-When passed a reference to the `.buffer` property of a `TypedArray` instance,
-the newly created `Buffer` will share the same allocated memory as the
-TypedArray.
-
-```js
-const arr = new Uint16Array(2);
-arr[0] = 5000;
-arr[1] = 4000;
-
-const buf = Buffer.from(arr.buffer); // shares the memory with arr;
-
-console.log(buf);
- // Prints:
-
-// changing the TypedArray changes the Buffer also
-arr[1] = 6000;
-
-console.log(buf);
- // Prints:
-```
-
-The optional `byteOffset` and `length` arguments specify a memory range within
-the `arrayBuffer` that will be shared by the `Buffer`.
-
-```js
-const ab = new ArrayBuffer(10);
-const buf = Buffer.from(ab, 0, 2);
-console.log(buf.length);
- // Prints: 2
-```
-
-A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`.
-
-### Class Method: Buffer.from(buffer)
-
-
-* `buffer` {Buffer}
-
-Copies the passed `buffer` data onto a new `Buffer` instance.
-
-```js
-const buf1 = Buffer.from('buffer');
-const buf2 = Buffer.from(buf1);
-
-buf1[0] = 0x61;
-console.log(buf1.toString());
- // 'auffer'
-console.log(buf2.toString());
- // 'buffer' (copy is not changed)
-```
-
-A `TypeError` will be thrown if `buffer` is not a `Buffer`.
-
-### Class Method: Buffer.from(str[, encoding])
-
-
-* `str` {String} String to encode.
-* `encoding` {String} Encoding to use, Default: `'utf8'`
-
-Creates a new `Buffer` containing the given JavaScript string `str`. If
-provided, the `encoding` parameter identifies the character encoding.
-If not provided, `encoding` defaults to `'utf8'`.
-
-```js
-const buf1 = Buffer.from('this is a tést');
-console.log(buf1.toString());
- // prints: this is a tést
-console.log(buf1.toString('ascii'));
- // prints: this is a tC)st
-
-const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex');
-console.log(buf2.toString());
- // prints: this is a tést
-```
-
-A `TypeError` will be thrown if `str` is not a string.
-
-### Class Method: Buffer.alloc(size[, fill[, encoding]])
-
-
-* `size` {Number}
-* `fill` {Value} Default: `undefined`
-* `encoding` {String} Default: `utf8`
-
-Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the
-`Buffer` will be *zero-filled*.
-
-```js
-const buf = Buffer.alloc(5);
-console.log(buf);
- //
-```
-
-The `size` must be less than or equal to the value of
-`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is
-`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will
-be created if a `size` less than or equal to 0 is specified.
-
-If `fill` is specified, the allocated `Buffer` will be initialized by calling
-`buf.fill(fill)`. See [`buf.fill()`][] for more information.
-
-```js
-const buf = Buffer.alloc(5, 'a');
-console.log(buf);
- //
-```
-
-If both `fill` and `encoding` are specified, the allocated `Buffer` will be
-initialized by calling `buf.fill(fill, encoding)`. For example:
-
-```js
-const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
-console.log(buf);
- //
-```
-
-Calling `Buffer.alloc(size)` can be significantly slower than the alternative
-`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance
-contents will *never contain sensitive data*.
-
-A `TypeError` will be thrown if `size` is not a number.
-
-### Class Method: Buffer.allocUnsafe(size)
-
-
-* `size` {Number}
-
-Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must
-be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit
-architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is
-thrown. A zero-length Buffer will be created if a `size` less than or equal to
-0 is specified.
-
-The underlying memory for `Buffer` instances created in this way is *not
-initialized*. The contents of the newly created `Buffer` are unknown and
-*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such
-`Buffer` instances to zeroes.
-
-```js
-const buf = Buffer.allocUnsafe(5);
-console.log(buf);
- //
- // (octets will be different, every time)
-buf.fill(0);
-console.log(buf);
- //
-```
-
-A `TypeError` will be thrown if `size` is not a number.
-
-Note that the `Buffer` module pre-allocates an internal `Buffer` instance of
-size `Buffer.poolSize` that is used as a pool for the fast allocation of new
-`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated
-`new Buffer(size)` constructor) only when `size` is less than or equal to
-`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default
-value of `Buffer.poolSize` is `8192` but can be modified.
-
-Use of this pre-allocated internal memory pool is a key difference between
-calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
-Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer
-pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal
-Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The
-difference is subtle but can be important when an application requires the
-additional performance that `Buffer.allocUnsafe(size)` provides.
-
-### Class Method: Buffer.allocUnsafeSlow(size)
-
-
-* `size` {Number}
-
-Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The
-`size` must be less than or equal to the value of
-`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is
-`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will
-be created if a `size` less than or equal to 0 is specified.
-
-The underlying memory for `Buffer` instances created in this way is *not
-initialized*. The contents of the newly created `Buffer` are unknown and
-*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such
-`Buffer` instances to zeroes.
-
-When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
-allocations under 4KB are, by default, sliced from a single pre-allocated
-`Buffer`. This allows applications to avoid the garbage collection overhead of
-creating many individually allocated Buffers. This approach improves both
-performance and memory usage by eliminating the need to track and cleanup as
-many `Persistent` objects.
-
-However, in the case where a developer may need to retain a small chunk of
-memory from a pool for an indeterminate amount of time, it may be appropriate
-to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then
-copy out the relevant bits.
-
-```js
-// need to keep around a few small chunks of memory
-const store = [];
-
-socket.on('readable', () => {
- const data = socket.read();
- // allocate for retained data
- const sb = Buffer.allocUnsafeSlow(10);
- // copy the data into the new allocation
- data.copy(sb, 0, 0, 10);
- store.push(sb);
-});
-```
-
-Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after*
-a developer has observed undue memory retention in their applications.
-
-A `TypeError` will be thrown if `size` is not a number.
-
-### All the Rest
-
-The rest of the `Buffer` API is exactly the same as in node.js.
-[See the docs](https://nodejs.org/api/buffer.html).
-
-
-## Related links
-
-- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660)
-- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4)
-
-## Why is `Buffer` unsafe?
-
-Today, the node.js `Buffer` constructor is overloaded to handle many different argument
-types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.),
-`ArrayBuffer`, and also `Number`.
-
-The API is optimized for convenience: you can throw any type at it, and it will try to do
-what you want.
-
-Because the Buffer constructor is so powerful, you often see code like this:
-
-```js
-// Convert UTF-8 strings to hex
-function toHex (str) {
- return new Buffer(str).toString('hex')
-}
-```
-
-***But what happens if `toHex` is called with a `Number` argument?***
-
-### Remote Memory Disclosure
-
-If an attacker can make your program call the `Buffer` constructor with a `Number`
-argument, then they can make it allocate uninitialized memory from the node.js process.
-This could potentially disclose TLS private keys, user data, or database passwords.
-
-When the `Buffer` constructor is passed a `Number` argument, it returns an
-**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like
-this, you **MUST** overwrite the contents before returning it to the user.
-
-From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size):
-
-> `new Buffer(size)`
->
-> - `size` Number
->
-> The underlying memory for `Buffer` instances created in this way is not initialized.
-> **The contents of a newly created `Buffer` are unknown and could contain sensitive
-> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes.
-
-(Emphasis our own.)
-
-Whenever the programmer intended to create an uninitialized `Buffer` you often see code
-like this:
-
-```js
-var buf = new Buffer(16)
-
-// Immediately overwrite the uninitialized buffer with data from another buffer
-for (var i = 0; i < buf.length; i++) {
- buf[i] = otherBuf[i]
-}
-```
-
-
-### Would this ever be a problem in real code?
-
-Yes. It's surprisingly common to forget to check the type of your variables in a
-dynamically-typed language like JavaScript.
-
-Usually the consequences of assuming the wrong type is that your program crashes with an
-uncaught exception. But the failure mode for forgetting to check the type of arguments to
-the `Buffer` constructor is more catastrophic.
-
-Here's an example of a vulnerable service that takes a JSON payload and converts it to
-hex:
-
-```js
-// Take a JSON payload {str: "some string"} and convert it to hex
-var server = http.createServer(function (req, res) {
- var data = ''
- req.setEncoding('utf8')
- req.on('data', function (chunk) {
- data += chunk
- })
- req.on('end', function () {
- var body = JSON.parse(data)
- res.end(new Buffer(body.str).toString('hex'))
- })
-})
-
-server.listen(8080)
-```
-
-In this example, an http client just has to send:
-
-```json
-{
- "str": 1000
-}
-```
-
-and it will get back 1,000 bytes of uninitialized memory from the server.
-
-This is a very serious bug. It's similar in severity to the
-[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process
-memory by remote attackers.
-
-
-### Which real-world packages were vulnerable?
-
-#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht)
-
-[Mathias Buus](https://github.com/mafintosh) and I
-([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages,
-[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow
-anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get
-them to reveal 20 bytes at a time of uninitialized memory from the node.js process.
-
-Here's
-[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8)
-that fixed it. We released a new fixed version, created a
-[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all
-vulnerable versions on npm so users will get a warning to upgrade to a newer version.
-
-#### [`ws`](https://www.npmjs.com/package/ws)
-
-That got us wondering if there were other vulnerable packages. Sure enough, within a short
-period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the
-most popular WebSocket implementation in node.js.
-
-If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as
-expected, then uninitialized server memory would be disclosed to the remote peer.
-
-These were the vulnerable methods:
-
-```js
-socket.send(number)
-socket.ping(number)
-socket.pong(number)
-```
-
-Here's a vulnerable socket server with some echo functionality:
-
-```js
-server.on('connection', function (socket) {
- socket.on('message', function (message) {
- message = JSON.parse(message)
- if (message.type === 'echo') {
- socket.send(message.data) // send back the user's message
- }
- })
-})
-```
-
-`socket.send(number)` called on the server, will disclose server memory.
-
-Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue
-was fixed, with a more detailed explanation. Props to
-[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the
-[Node Security Project disclosure](https://nodesecurity.io/advisories/67).
-
-
-### What's the solution?
-
-It's important that node.js offers a fast way to get memory otherwise performance-critical
-applications would needlessly get a lot slower.
-
-But we need a better way to *signal our intent* as programmers. **When we want
-uninitialized memory, we should request it explicitly.**
-
-Sensitive functionality should not be packed into a developer-friendly API that loosely
-accepts many different types. This type of API encourages the lazy practice of passing
-variables in without checking the type very carefully.
-
-#### A new API: `Buffer.allocUnsafe(number)`
-
-The functionality of creating buffers with uninitialized memory should be part of another
-API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that
-frequently gets user input of all sorts of different types passed into it.
-
-```js
-var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory!
-
-// Immediately overwrite the uninitialized buffer with data from another buffer
-for (var i = 0; i < buf.length; i++) {
- buf[i] = otherBuf[i]
-}
-```
-
-
-### How do we fix node.js core?
-
-We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as
-`semver-major`) which defends against one case:
-
-```js
-var str = 16
-new Buffer(str, 'utf8')
-```
-
-In this situation, it's implied that the programmer intended the first argument to be a
-string, since they passed an encoding as a second argument. Today, node.js will allocate
-uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not
-what the programmer intended.
-
-But this is only a partial solution, since if the programmer does `new Buffer(variable)`
-(without an `encoding` parameter) there's no way to know what they intended. If `variable`
-is sometimes a number, then uninitialized memory will sometimes be returned.
-
-### What's the real long-term fix?
-
-We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when
-we need uninitialized memory. But that would break 1000s of packages.
-
-~~We believe the best solution is to:~~
-
-~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~
-
-~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~
-
-#### Update
-
-We now support adding three new APIs:
-
-- `Buffer.from(value)` - convert from any type to a buffer
-- `Buffer.alloc(size)` - create a zero-filled buffer
-- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size
-
-This solves the core problem that affected `ws` and `bittorrent-dht` which is
-`Buffer(variable)` getting tricked into taking a number argument.
-
-This way, existing code continues working and the impact on the npm ecosystem will be
-minimal. Over time, npm maintainers can migrate performance-critical code to use
-`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`.
-
-
-### Conclusion
-
-We think there's a serious design issue with the `Buffer` API as it exists today. It
-promotes insecure software by putting high-risk functionality into a convenient API
-with friendly "developer ergonomics".
-
-This wasn't merely a theoretical exercise because we found the issue in some of the
-most popular npm packages.
-
-Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of
-`buffer`.
-
-```js
-var Buffer = require('safe-buffer').Buffer
-```
-
-Eventually, we hope that node.js core can switch to this new, safer behavior. We believe
-the impact on the ecosystem would be minimal since it's not a breaking change.
-Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while
-older, insecure packages would magically become safe from this attack vector.
-
-
-## links
-
-- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514)
-- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67)
-- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68)
-
-
-## credit
-
-The original issues in `bittorrent-dht`
-([disclosure](https://nodesecurity.io/advisories/68)) and
-`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by
-[Mathias Buus](https://github.com/mafintosh) and
-[Feross Aboukhadijeh](http://feross.org/).
-
-Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues
-and for his work running the [Node Security Project](https://nodesecurity.io/).
-
-Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and
-auditing the code.
-
-
-## license
-
-MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org)
diff --git a/node_modules/safe-buffer/index.d.ts b/node_modules/safe-buffer/index.d.ts
deleted file mode 100644
index e9fed80..0000000
--- a/node_modules/safe-buffer/index.d.ts
+++ /dev/null
@@ -1,187 +0,0 @@
-declare module "safe-buffer" {
- export class Buffer {
- length: number
- write(string: string, offset?: number, length?: number, encoding?: string): number;
- toString(encoding?: string, start?: number, end?: number): string;
- toJSON(): { type: 'Buffer', data: any[] };
- equals(otherBuffer: Buffer): boolean;
- compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
- copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
- slice(start?: number, end?: number): Buffer;
- writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
- writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
- writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
- writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
- readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
- readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
- readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
- readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
- readUInt8(offset: number, noAssert?: boolean): number;
- readUInt16LE(offset: number, noAssert?: boolean): number;
- readUInt16BE(offset: number, noAssert?: boolean): number;
- readUInt32LE(offset: number, noAssert?: boolean): number;
- readUInt32BE(offset: number, noAssert?: boolean): number;
- readInt8(offset: number, noAssert?: boolean): number;
- readInt16LE(offset: number, noAssert?: boolean): number;
- readInt16BE(offset: number, noAssert?: boolean): number;
- readInt32LE(offset: number, noAssert?: boolean): number;
- readInt32BE(offset: number, noAssert?: boolean): number;
- readFloatLE(offset: number, noAssert?: boolean): number;
- readFloatBE(offset: number, noAssert?: boolean): number;
- readDoubleLE(offset: number, noAssert?: boolean): number;
- readDoubleBE(offset: number, noAssert?: boolean): number;
- swap16(): Buffer;
- swap32(): Buffer;
- swap64(): Buffer;
- writeUInt8(value: number, offset: number, noAssert?: boolean): number;
- writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;
- writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;
- writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;
- writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;
- writeInt8(value: number, offset: number, noAssert?: boolean): number;
- writeInt16LE(value: number, offset: number, noAssert?: boolean): number;
- writeInt16BE(value: number, offset: number, noAssert?: boolean): number;
- writeInt32LE(value: number, offset: number, noAssert?: boolean): number;
- writeInt32BE(value: number, offset: number, noAssert?: boolean): number;
- writeFloatLE(value: number, offset: number, noAssert?: boolean): number;
- writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
- writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
- writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
- fill(value: any, offset?: number, end?: number): this;
- indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
- lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
- includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean;
-
- /**
- * Allocates a new buffer containing the given {str}.
- *
- * @param str String to store in buffer.
- * @param encoding encoding to use, optional. Default is 'utf8'
- */
- constructor (str: string, encoding?: string);
- /**
- * Allocates a new buffer of {size} octets.
- *
- * @param size count of octets to allocate.
- */
- constructor (size: number);
- /**
- * Allocates a new buffer containing the given {array} of octets.
- *
- * @param array The octets to store.
- */
- constructor (array: Uint8Array);
- /**
- * Produces a Buffer backed by the same allocated memory as
- * the given {ArrayBuffer}.
- *
- *
- * @param arrayBuffer The ArrayBuffer with which to share memory.
- */
- constructor (arrayBuffer: ArrayBuffer);
- /**
- * Allocates a new buffer containing the given {array} of octets.
- *
- * @param array The octets to store.
- */
- constructor (array: any[]);
- /**
- * Copies the passed {buffer} data onto a new {Buffer} instance.
- *
- * @param buffer The buffer to copy.
- */
- constructor (buffer: Buffer);
- prototype: Buffer;
- /**
- * Allocates a new Buffer using an {array} of octets.
- *
- * @param array
- */
- static from(array: any[]): Buffer;
- /**
- * When passed a reference to the .buffer property of a TypedArray instance,
- * the newly created Buffer will share the same allocated memory as the TypedArray.
- * The optional {byteOffset} and {length} arguments specify a memory range
- * within the {arrayBuffer} that will be shared by the Buffer.
- *
- * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()
- * @param byteOffset
- * @param length
- */
- static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
- /**
- * Copies the passed {buffer} data onto a new Buffer instance.
- *
- * @param buffer
- */
- static from(buffer: Buffer): Buffer;
- /**
- * Creates a new Buffer containing the given JavaScript string {str}.
- * If provided, the {encoding} parameter identifies the character encoding.
- * If not provided, {encoding} defaults to 'utf8'.
- *
- * @param str
- */
- static from(str: string, encoding?: string): Buffer;
- /**
- * Returns true if {obj} is a Buffer
- *
- * @param obj object to test.
- */
- static isBuffer(obj: any): obj is Buffer;
- /**
- * Returns true if {encoding} is a valid encoding argument.
- * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
- *
- * @param encoding string to test.
- */
- static isEncoding(encoding: string): boolean;
- /**
- * Gives the actual byte length of a string. encoding defaults to 'utf8'.
- * This is not the same as String.prototype.length since that returns the number of characters in a string.
- *
- * @param string string to test.
- * @param encoding encoding used to evaluate (defaults to 'utf8')
- */
- static byteLength(string: string, encoding?: string): number;
- /**
- * Returns a buffer which is the result of concatenating all the buffers in the list together.
- *
- * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
- * If the list has exactly one item, then the first item of the list is returned.
- * If the list has more than one item, then a new Buffer is created.
- *
- * @param list An array of Buffer objects to concatenate
- * @param totalLength Total length of the buffers when concatenated.
- * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
- */
- static concat(list: Buffer[], totalLength?: number): Buffer;
- /**
- * The same as buf1.compare(buf2).
- */
- static compare(buf1: Buffer, buf2: Buffer): number;
- /**
- * Allocates a new buffer of {size} octets.
- *
- * @param size count of octets to allocate.
- * @param fill if specified, buffer will be initialized by calling buf.fill(fill).
- * If parameter is omitted, buffer will be filled with zeros.
- * @param encoding encoding used for call to buf.fill while initalizing
- */
- static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer;
- /**
- * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
- * of the newly created Buffer are unknown and may contain sensitive data.
- *
- * @param size count of octets to allocate
- */
- static allocUnsafe(size: number): Buffer;
- /**
- * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
- * of the newly created Buffer are unknown and may contain sensitive data.
- *
- * @param size count of octets to allocate
- */
- static allocUnsafeSlow(size: number): Buffer;
- }
-}
\ No newline at end of file
diff --git a/node_modules/safe-buffer/index.js b/node_modules/safe-buffer/index.js
deleted file mode 100644
index f8d3ec9..0000000
--- a/node_modules/safe-buffer/index.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/*! safe-buffer. MIT License. Feross Aboukhadijeh */
-/* eslint-disable node/no-deprecated-api */
-var buffer = require('buffer')
-var Buffer = buffer.Buffer
-
-// alternative to using Object.keys for old browsers
-function copyProps (src, dst) {
- for (var key in src) {
- dst[key] = src[key]
- }
-}
-if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
- module.exports = buffer
-} else {
- // Copy properties from require('buffer')
- copyProps(buffer, exports)
- exports.Buffer = SafeBuffer
-}
-
-function SafeBuffer (arg, encodingOrOffset, length) {
- return Buffer(arg, encodingOrOffset, length)
-}
-
-SafeBuffer.prototype = Object.create(Buffer.prototype)
-
-// Copy static methods from Buffer
-copyProps(Buffer, SafeBuffer)
-
-SafeBuffer.from = function (arg, encodingOrOffset, length) {
- if (typeof arg === 'number') {
- throw new TypeError('Argument must not be a number')
- }
- return Buffer(arg, encodingOrOffset, length)
-}
-
-SafeBuffer.alloc = function (size, fill, encoding) {
- if (typeof size !== 'number') {
- throw new TypeError('Argument must be a number')
- }
- var buf = Buffer(size)
- if (fill !== undefined) {
- if (typeof encoding === 'string') {
- buf.fill(fill, encoding)
- } else {
- buf.fill(fill)
- }
- } else {
- buf.fill(0)
- }
- return buf
-}
-
-SafeBuffer.allocUnsafe = function (size) {
- if (typeof size !== 'number') {
- throw new TypeError('Argument must be a number')
- }
- return Buffer(size)
-}
-
-SafeBuffer.allocUnsafeSlow = function (size) {
- if (typeof size !== 'number') {
- throw new TypeError('Argument must be a number')
- }
- return buffer.SlowBuffer(size)
-}
diff --git a/node_modules/safe-buffer/package.json b/node_modules/safe-buffer/package.json
deleted file mode 100644
index f2869e2..0000000
--- a/node_modules/safe-buffer/package.json
+++ /dev/null
@@ -1,51 +0,0 @@
-{
- "name": "safe-buffer",
- "description": "Safer Node.js Buffer API",
- "version": "5.2.1",
- "author": {
- "name": "Feross Aboukhadijeh",
- "email": "feross@feross.org",
- "url": "https://feross.org"
- },
- "bugs": {
- "url": "https://github.com/feross/safe-buffer/issues"
- },
- "devDependencies": {
- "standard": "*",
- "tape": "^5.0.0"
- },
- "homepage": "https://github.com/feross/safe-buffer",
- "keywords": [
- "buffer",
- "buffer allocate",
- "node security",
- "safe",
- "safe-buffer",
- "security",
- "uninitialized"
- ],
- "license": "MIT",
- "main": "index.js",
- "types": "index.d.ts",
- "repository": {
- "type": "git",
- "url": "git://github.com/feross/safe-buffer.git"
- },
- "scripts": {
- "test": "standard && tape test/*.js"
- },
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ]
-}
diff --git a/node_modules/safer-buffer/LICENSE b/node_modules/safer-buffer/LICENSE
deleted file mode 100644
index 4fe9e6f..0000000
--- a/node_modules/safer-buffer/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2018 Nikita Skovoroda
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/node_modules/safer-buffer/Porting-Buffer.md b/node_modules/safer-buffer/Porting-Buffer.md
deleted file mode 100644
index 68d86ba..0000000
--- a/node_modules/safer-buffer/Porting-Buffer.md
+++ /dev/null
@@ -1,268 +0,0 @@
-# Porting to the Buffer.from/Buffer.alloc API
-
-
-## Overview
-
-- [Variant 1: Drop support for Node.js ≤ 4.4.x and 5.0.0 — 5.9.x.](#variant-1) (*recommended*)
-- [Variant 2: Use a polyfill](#variant-2)
-- [Variant 3: manual detection, with safeguards](#variant-3)
-
-### Finding problematic bits of code using grep
-
-Just run `grep -nrE '[^a-zA-Z](Slow)?Buffer\s*\(' --exclude-dir node_modules`.
-
-It will find all the potentially unsafe places in your own code (with some considerably unlikely
-exceptions).
-
-### Finding problematic bits of code using Node.js 8
-
-If you’re using Node.js ≥ 8.0.0 (which is recommended), Node.js exposes multiple options that help with finding the relevant pieces of code:
-
-- `--trace-warnings` will make Node.js show a stack trace for this warning and other warnings that are printed by Node.js.
-- `--trace-deprecation` does the same thing, but only for deprecation warnings.
-- `--pending-deprecation` will show more types of deprecation warnings. In particular, it will show the `Buffer()` deprecation warning, even on Node.js 8.
-
-You can set these flags using an environment variable:
-
-```console
-$ export NODE_OPTIONS='--trace-warnings --pending-deprecation'
-$ cat example.js
-'use strict';
-const foo = new Buffer('foo');
-$ node example.js
-(node:7147) [DEP0005] DeprecationWarning: The Buffer() and new Buffer() constructors are not recommended for use due to security and usability concerns. Please use the new Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() construction methods instead.
- at showFlaggedDeprecation (buffer.js:127:13)
- at new Buffer (buffer.js:148:3)
- at Object. (/path/to/example.js:2:13)
- [... more stack trace lines ...]
-```
-
-### Finding problematic bits of code using linters
-
-Eslint rules [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor)
-or
-[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md)
-also find calls to deprecated `Buffer()` API. Those rules are included in some pre-sets.
-
-There is a drawback, though, that it doesn't always
-[work correctly](https://github.com/chalker/safer-buffer#why-not-safe-buffer) when `Buffer` is
-overriden e.g. with a polyfill, so recommended is a combination of this and some other method
-described above.
-
-
-## Variant 1: Drop support for Node.js ≤ 4.4.x and 5.0.0 — 5.9.x.
-
-This is the recommended solution nowadays that would imply only minimal overhead.
-
-The Node.js 5.x release line has been unsupported since July 2016, and the Node.js 4.x release line reaches its End of Life in April 2018 (→ [Schedule](https://github.com/nodejs/Release#release-schedule)). This means that these versions of Node.js will *not* receive any updates, even in case of security issues, so using these release lines should be avoided, if at all possible.
-
-What you would do in this case is to convert all `new Buffer()` or `Buffer()` calls to use `Buffer.alloc()` or `Buffer.from()`, in the following way:
-
-- For `new Buffer(number)`, replace it with `Buffer.alloc(number)`.
-- For `new Buffer(string)` (or `new Buffer(string, encoding)`), replace it with `Buffer.from(string)` (or `Buffer.from(string, encoding)`).
-- For all other combinations of arguments (these are much rarer), also replace `new Buffer(...arguments)` with `Buffer.from(...arguments)`.
-
-Note that `Buffer.alloc()` is also _faster_ on the current Node.js versions than
-`new Buffer(size).fill(0)`, which is what you would otherwise need to ensure zero-filling.
-
-Enabling eslint rule [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor)
-or
-[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md)
-is recommended to avoid accidential unsafe Buffer API usage.
-
-There is also a [JSCodeshift codemod](https://github.com/joyeecheung/node-dep-codemod#dep005)
-for automatically migrating Buffer constructors to `Buffer.alloc()` or `Buffer.from()`.
-Note that it currently only works with cases where the arguments are literals or where the
-constructor is invoked with two arguments.
-
-_If you currently support those older Node.js versions and dropping them would be a semver-major change
-for you, or if you support older branches of your packages, consider using [Variant 2](#variant-2)
-or [Variant 3](#variant-3) on older branches, so people using those older branches will also receive
-the fix. That way, you will eradicate potential issues caused by unguarded Buffer API usage and
-your users will not observe a runtime deprecation warning when running your code on Node.js 10._
-
-
-## Variant 2: Use a polyfill
-
-Utilize [safer-buffer](https://www.npmjs.com/package/safer-buffer) as a polyfill to support older
-Node.js versions.
-
-You would take exacly the same steps as in [Variant 1](#variant-1), but with a polyfill
-`const Buffer = require('safer-buffer').Buffer` in all files where you use the new `Buffer` api.
-
-Make sure that you do not use old `new Buffer` API — in any files where the line above is added,
-using old `new Buffer()` API will _throw_. It will be easy to notice that in CI, though.
-
-Alternatively, you could use [buffer-from](https://www.npmjs.com/package/buffer-from) and/or
-[buffer-alloc](https://www.npmjs.com/package/buffer-alloc) [ponyfills](https://ponyfill.com/) —
-those are great, the only downsides being 4 deps in the tree and slightly more code changes to
-migrate off them (as you would be using e.g. `Buffer.from` under a different name). If you need only
-`Buffer.from` polyfilled — `buffer-from` alone which comes with no extra dependencies.
-
-_Alternatively, you could use [safe-buffer](https://www.npmjs.com/package/safe-buffer) — it also
-provides a polyfill, but takes a different approach which has
-[it's drawbacks](https://github.com/chalker/safer-buffer#why-not-safe-buffer). It will allow you
-to also use the older `new Buffer()` API in your code, though — but that's arguably a benefit, as
-it is problematic, can cause issues in your code, and will start emitting runtime deprecation
-warnings starting with Node.js 10._
-
-Note that in either case, it is important that you also remove all calls to the old Buffer
-API manually — just throwing in `safe-buffer` doesn't fix the problem by itself, it just provides
-a polyfill for the new API. I have seen people doing that mistake.
-
-Enabling eslint rule [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor)
-or
-[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md)
-is recommended.
-
-_Don't forget to drop the polyfill usage once you drop support for Node.js < 4.5.0._
-
-
-## Variant 3 — manual detection, with safeguards
-
-This is useful if you create Buffer instances in only a few places (e.g. one), or you have your own
-wrapper around them.
-
-### Buffer(0)
-
-This special case for creating empty buffers can be safely replaced with `Buffer.concat([])`, which
-returns the same result all the way down to Node.js 0.8.x.
-
-### Buffer(notNumber)
-
-Before:
-
-```js
-var buf = new Buffer(notNumber, encoding);
-```
-
-After:
-
-```js
-var buf;
-if (Buffer.from && Buffer.from !== Uint8Array.from) {
- buf = Buffer.from(notNumber, encoding);
-} else {
- if (typeof notNumber === 'number')
- throw new Error('The "size" argument must be of type number.');
- buf = new Buffer(notNumber, encoding);
-}
-```
-
-`encoding` is optional.
-
-Note that the `typeof notNumber` before `new Buffer` is required (for cases when `notNumber` argument is not
-hard-coded) and _is not caused by the deprecation of Buffer constructor_ — it's exactly _why_ the
-Buffer constructor is deprecated. Ecosystem packages lacking this type-check caused numereous
-security issues — situations when unsanitized user input could end up in the `Buffer(arg)` create
-problems ranging from DoS to leaking sensitive information to the attacker from the process memory.
-
-When `notNumber` argument is hardcoded (e.g. literal `"abc"` or `[0,1,2]`), the `typeof` check can
-be omitted.
-
-Also note that using TypeScript does not fix this problem for you — when libs written in
-`TypeScript` are used from JS, or when user input ends up there — it behaves exactly as pure JS, as
-all type checks are translation-time only and are not present in the actual JS code which TS
-compiles to.
-
-### Buffer(number)
-
-For Node.js 0.10.x (and below) support:
-
-```js
-var buf;
-if (Buffer.alloc) {
- buf = Buffer.alloc(number);
-} else {
- buf = new Buffer(number);
- buf.fill(0);
-}
-```
-
-Otherwise (Node.js ≥ 0.12.x):
-
-```js
-const buf = Buffer.alloc ? Buffer.alloc(number) : new Buffer(number).fill(0);
-```
-
-## Regarding Buffer.allocUnsafe
-
-Be extra cautious when using `Buffer.allocUnsafe`:
- * Don't use it if you don't have a good reason to
- * e.g. you probably won't ever see a performance difference for small buffers, in fact, those
- might be even faster with `Buffer.alloc()`,
- * if your code is not in the hot code path — you also probably won't notice a difference,
- * keep in mind that zero-filling minimizes the potential risks.
- * If you use it, make sure that you never return the buffer in a partially-filled state,
- * if you are writing to it sequentially — always truncate it to the actuall written length
-
-Errors in handling buffers allocated with `Buffer.allocUnsafe` could result in various issues,
-ranged from undefined behaviour of your code to sensitive data (user input, passwords, certs)
-leaking to the remote attacker.
-
-_Note that the same applies to `new Buffer` usage without zero-filling, depending on the Node.js
-version (and lacking type checks also adds DoS to the list of potential problems)._
-
-
-## FAQ
-
-
-### What is wrong with the `Buffer` constructor?
-
-The `Buffer` constructor could be used to create a buffer in many different ways:
-
-- `new Buffer(42)` creates a `Buffer` of 42 bytes. Before Node.js 8, this buffer contained
- *arbitrary memory* for performance reasons, which could include anything ranging from
- program source code to passwords and encryption keys.
-- `new Buffer('abc')` creates a `Buffer` that contains the UTF-8-encoded version of
- the string `'abc'`. A second argument could specify another encoding: For example,
- `new Buffer(string, 'base64')` could be used to convert a Base64 string into the original
- sequence of bytes that it represents.
-- There are several other combinations of arguments.
-
-This meant that, in code like `var buffer = new Buffer(foo);`, *it is not possible to tell
-what exactly the contents of the generated buffer are* without knowing the type of `foo`.
-
-Sometimes, the value of `foo` comes from an external source. For example, this function
-could be exposed as a service on a web server, converting a UTF-8 string into its Base64 form:
-
-```
-function stringToBase64(req, res) {
- // The request body should have the format of `{ string: 'foobar' }`
- const rawBytes = new Buffer(req.body.string)
- const encoded = rawBytes.toString('base64')
- res.end({ encoded: encoded })
-}
-```
-
-Note that this code does *not* validate the type of `req.body.string`:
-
-- `req.body.string` is expected to be a string. If this is the case, all goes well.
-- `req.body.string` is controlled by the client that sends the request.
-- If `req.body.string` is the *number* `50`, the `rawBytes` would be 50 bytes:
- - Before Node.js 8, the content would be uninitialized
- - After Node.js 8, the content would be `50` bytes with the value `0`
-
-Because of the missing type check, an attacker could intentionally send a number
-as part of the request. Using this, they can either:
-
-- Read uninitialized memory. This **will** leak passwords, encryption keys and other
- kinds of sensitive information. (Information leak)
-- Force the program to allocate a large amount of memory. For example, when specifying
- `500000000` as the input value, each request will allocate 500MB of memory.
- This can be used to either exhaust the memory available of a program completely
- and make it crash, or slow it down significantly. (Denial of Service)
-
-Both of these scenarios are considered serious security issues in a real-world
-web server context.
-
-when using `Buffer.from(req.body.string)` instead, passing a number will always
-throw an exception instead, giving a controlled behaviour that can always be
-handled by the program.
-
-
-### The `Buffer()` constructor has been deprecated for a while. Is this really an issue?
-
-Surveys of code in the `npm` ecosystem have shown that the `Buffer()` constructor is still
-widely used. This includes new code, and overall usage of such code has actually been
-*increasing*.
diff --git a/node_modules/safer-buffer/Readme.md b/node_modules/safer-buffer/Readme.md
deleted file mode 100644
index 14b0822..0000000
--- a/node_modules/safer-buffer/Readme.md
+++ /dev/null
@@ -1,156 +0,0 @@
-# safer-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![javascript style guide][standard-image]][standard-url] [![Security Responsible Disclosure][secuirty-image]][secuirty-url]
-
-[travis-image]: https://travis-ci.org/ChALkeR/safer-buffer.svg?branch=master
-[travis-url]: https://travis-ci.org/ChALkeR/safer-buffer
-[npm-image]: https://img.shields.io/npm/v/safer-buffer.svg
-[npm-url]: https://npmjs.org/package/safer-buffer
-[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
-[standard-url]: https://standardjs.com
-[secuirty-image]: https://img.shields.io/badge/Security-Responsible%20Disclosure-green.svg
-[secuirty-url]: https://github.com/nodejs/security-wg/blob/master/processes/responsible_disclosure_template.md
-
-Modern Buffer API polyfill without footguns, working on Node.js from 0.8 to current.
-
-## How to use?
-
-First, port all `Buffer()` and `new Buffer()` calls to `Buffer.alloc()` and `Buffer.from()` API.
-
-Then, to achieve compatibility with outdated Node.js versions (`<4.5.0` and 5.x `<5.9.0`), use
-`const Buffer = require('safer-buffer').Buffer` in all files where you make calls to the new
-Buffer API. _Use `var` instead of `const` if you need that for your Node.js version range support._
-
-Also, see the
-[porting Buffer](https://github.com/ChALkeR/safer-buffer/blob/master/Porting-Buffer.md) guide.
-
-## Do I need it?
-
-Hopefully, not — dropping support for outdated Node.js versions should be fine nowdays, and that
-is the recommended path forward. You _do_ need to port to the `Buffer.alloc()` and `Buffer.from()`
-though.
-
-See the [porting guide](https://github.com/ChALkeR/safer-buffer/blob/master/Porting-Buffer.md)
-for a better description.
-
-## Why not [safe-buffer](https://npmjs.com/safe-buffer)?
-
-_In short: while `safe-buffer` serves as a polyfill for the new API, it allows old API usage and
-itself contains footguns._
-
-`safe-buffer` could be used safely to get the new API while still keeping support for older
-Node.js versions (like this module), but while analyzing ecosystem usage of the old Buffer API
-I found out that `safe-buffer` is itself causing problems in some cases.
-
-For example, consider the following snippet:
-
-```console
-$ cat example.unsafe.js
-console.log(Buffer(20))
-$ ./node-v6.13.0-linux-x64/bin/node example.unsafe.js
-
-$ standard example.unsafe.js
-standard: Use JavaScript Standard Style (https://standardjs.com)
- /home/chalker/repo/safer-buffer/example.unsafe.js:2:13: 'Buffer()' was deprecated since v6. Use 'Buffer.alloc()' or 'Buffer.from()' (use 'https://www.npmjs.com/package/safe-buffer' for '<4.5.0') instead.
-```
-
-This is allocates and writes to console an uninitialized chunk of memory.
-[standard](https://www.npmjs.com/package/standard) linter (among others) catch that and warn people
-to avoid using unsafe API.
-
-Let's now throw in `safe-buffer`!
-
-```console
-$ cat example.safe-buffer.js
-const Buffer = require('safe-buffer').Buffer
-console.log(Buffer(20))
-$ standard example.safe-buffer.js
-$ ./node-v6.13.0-linux-x64/bin/node example.safe-buffer.js
-
-```
-
-See the problem? Adding in `safe-buffer` _magically removes the lint warning_, but the behavior
-remains identiсal to what we had before, and when launched on Node.js 6.x LTS — this dumps out
-chunks of uninitialized memory.
-_And this code will still emit runtime warnings on Node.js 10.x and above._
-
-That was done by design. I first considered changing `safe-buffer`, prohibiting old API usage or
-emitting warnings on it, but that significantly diverges from `safe-buffer` design. After some
-discussion, it was decided to move my approach into a separate package, and _this is that separate
-package_.
-
-This footgun is not imaginary — I observed top-downloaded packages doing that kind of thing,
-«fixing» the lint warning by blindly including `safe-buffer` without any actual changes.
-
-Also in some cases, even if the API _was_ migrated to use of safe Buffer API — a random pull request
-can bring unsafe Buffer API usage back to the codebase by adding new calls — and that could go
-unnoticed even if you have a linter prohibiting that (becase of the reason stated above), and even
-pass CI. _I also observed that being done in popular packages._
-
-Some examples:
- * [webdriverio](https://github.com/webdriverio/webdriverio/commit/05cbd3167c12e4930f09ef7cf93b127ba4effae4#diff-124380949022817b90b622871837d56cR31)
- (a module with 548 759 downloads/month),
- * [websocket-stream](https://github.com/maxogden/websocket-stream/commit/c9312bd24d08271687d76da0fe3c83493871cf61)
- (218 288 d/m, fix in [maxogden/websocket-stream#142](https://github.com/maxogden/websocket-stream/pull/142)),
- * [node-serialport](https://github.com/node-serialport/node-serialport/commit/e8d9d2b16c664224920ce1c895199b1ce2def48c)
- (113 138 d/m, fix in [node-serialport/node-serialport#1510](https://github.com/node-serialport/node-serialport/pull/1510)),
- * [karma](https://github.com/karma-runner/karma/commit/3d94b8cf18c695104ca195334dc75ff054c74eec)
- (3 973 193 d/m, fix in [karma-runner/karma#2947](https://github.com/karma-runner/karma/pull/2947)),
- * [spdy-transport](https://github.com/spdy-http2/spdy-transport/commit/5375ac33f4a62a4f65bcfc2827447d42a5dbe8b1)
- (5 970 727 d/m, fix in [spdy-http2/spdy-transport#53](https://github.com/spdy-http2/spdy-transport/pull/53)).
- * And there are a lot more over the ecosystem.
-
-I filed a PR at
-[mysticatea/eslint-plugin-node#110](https://github.com/mysticatea/eslint-plugin-node/pull/110) to
-partially fix that (for cases when that lint rule is used), but it is a semver-major change for
-linter rules and presets, so it would take significant time for that to reach actual setups.
-_It also hasn't been released yet (2018-03-20)._
-
-Also, `safer-buffer` discourages the usage of `.allocUnsafe()`, which is often done by a mistake.
-It still supports it with an explicit concern barier, by placing it under
-`require('safer-buffer/dangereous')`.
-
-## But isn't throwing bad?
-
-Not really. It's an error that could be noticed and fixed early, instead of causing havoc later like
-unguarded `new Buffer()` calls that end up receiving user input can do.
-
-This package affects only the files where `var Buffer = require('safer-buffer').Buffer` was done, so
-it is really simple to keep track of things and make sure that you don't mix old API usage with that.
-Also, CI should hint anything that you might have missed.
-
-New commits, if tested, won't land new usage of unsafe Buffer API this way.
-_Node.js 10.x also deals with that by printing a runtime depecation warning._
-
-### Would it affect third-party modules?
-
-No, unless you explicitly do an awful thing like monkey-patching or overriding the built-in `Buffer`.
-Don't do that.
-
-### But I don't want throwing…
-
-That is also fine!
-
-Also, it could be better in some cases when you don't comprehensive enough test coverage.
-
-In that case — just don't override `Buffer` and use
-`var SaferBuffer = require('safer-buffer').Buffer` instead.
-
-That way, everything using `Buffer` natively would still work, but there would be two drawbacks:
-
-* `Buffer.from`/`Buffer.alloc` won't be polyfilled — use `SaferBuffer.from` and
- `SaferBuffer.alloc` instead.
-* You are still open to accidentally using the insecure deprecated API — use a linter to catch that.
-
-Note that using a linter to catch accidential `Buffer` constructor usage in this case is strongly
-recommended. `Buffer` is not overriden in this usecase, so linters won't get confused.
-
-## «Without footguns»?
-
-Well, it is still possible to do _some_ things with `Buffer` API, e.g. accessing `.buffer` property
-on older versions and duping things from there. You shouldn't do that in your code, probabably.
-
-The intention is to remove the most significant footguns that affect lots of packages in the
-ecosystem, and to do it in the proper way.
-
-Also, this package doesn't protect against security issues affecting some Node.js versions, so for
-usage in your own production code, it is still recommended to update to a Node.js version
-[supported by upstream](https://github.com/nodejs/release#release-schedule).
diff --git a/node_modules/safer-buffer/dangerous.js b/node_modules/safer-buffer/dangerous.js
deleted file mode 100644
index ca41fdc..0000000
--- a/node_modules/safer-buffer/dangerous.js
+++ /dev/null
@@ -1,58 +0,0 @@
-/* eslint-disable node/no-deprecated-api */
-
-'use strict'
-
-var buffer = require('buffer')
-var Buffer = buffer.Buffer
-var safer = require('./safer.js')
-var Safer = safer.Buffer
-
-var dangerous = {}
-
-var key
-
-for (key in safer) {
- if (!safer.hasOwnProperty(key)) continue
- dangerous[key] = safer[key]
-}
-
-var Dangereous = dangerous.Buffer = {}
-
-// Copy Safer API
-for (key in Safer) {
- if (!Safer.hasOwnProperty(key)) continue
- Dangereous[key] = Safer[key]
-}
-
-// Copy those missing unsafe methods, if they are present
-for (key in Buffer) {
- if (!Buffer.hasOwnProperty(key)) continue
- if (Dangereous.hasOwnProperty(key)) continue
- Dangereous[key] = Buffer[key]
-}
-
-if (!Dangereous.allocUnsafe) {
- Dangereous.allocUnsafe = function (size) {
- if (typeof size !== 'number') {
- throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size)
- }
- if (size < 0 || size >= 2 * (1 << 30)) {
- throw new RangeError('The value "' + size + '" is invalid for option "size"')
- }
- return Buffer(size)
- }
-}
-
-if (!Dangereous.allocUnsafeSlow) {
- Dangereous.allocUnsafeSlow = function (size) {
- if (typeof size !== 'number') {
- throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size)
- }
- if (size < 0 || size >= 2 * (1 << 30)) {
- throw new RangeError('The value "' + size + '" is invalid for option "size"')
- }
- return buffer.SlowBuffer(size)
- }
-}
-
-module.exports = dangerous
diff --git a/node_modules/safer-buffer/package.json b/node_modules/safer-buffer/package.json
deleted file mode 100644
index d452b04..0000000
--- a/node_modules/safer-buffer/package.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "name": "safer-buffer",
- "version": "2.1.2",
- "description": "Modern Buffer API polyfill without footguns",
- "main": "safer.js",
- "scripts": {
- "browserify-test": "browserify --external tape tests.js > browserify-tests.js && tape browserify-tests.js",
- "test": "standard && tape tests.js"
- },
- "author": {
- "name": "Nikita Skovoroda",
- "email": "chalkerx@gmail.com",
- "url": "https://github.com/ChALkeR"
- },
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/ChALkeR/safer-buffer.git"
- },
- "bugs": {
- "url": "https://github.com/ChALkeR/safer-buffer/issues"
- },
- "devDependencies": {
- "standard": "^11.0.1",
- "tape": "^4.9.0"
- },
- "files": [
- "Porting-Buffer.md",
- "Readme.md",
- "tests.js",
- "dangerous.js",
- "safer.js"
- ]
-}
diff --git a/node_modules/safer-buffer/safer.js b/node_modules/safer-buffer/safer.js
deleted file mode 100644
index 37c7e1a..0000000
--- a/node_modules/safer-buffer/safer.js
+++ /dev/null
@@ -1,77 +0,0 @@
-/* eslint-disable node/no-deprecated-api */
-
-'use strict'
-
-var buffer = require('buffer')
-var Buffer = buffer.Buffer
-
-var safer = {}
-
-var key
-
-for (key in buffer) {
- if (!buffer.hasOwnProperty(key)) continue
- if (key === 'SlowBuffer' || key === 'Buffer') continue
- safer[key] = buffer[key]
-}
-
-var Safer = safer.Buffer = {}
-for (key in Buffer) {
- if (!Buffer.hasOwnProperty(key)) continue
- if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue
- Safer[key] = Buffer[key]
-}
-
-safer.Buffer.prototype = Buffer.prototype
-
-if (!Safer.from || Safer.from === Uint8Array.from) {
- Safer.from = function (value, encodingOrOffset, length) {
- if (typeof value === 'number') {
- throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value)
- }
- if (value && typeof value.length === 'undefined') {
- throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value)
- }
- return Buffer(value, encodingOrOffset, length)
- }
-}
-
-if (!Safer.alloc) {
- Safer.alloc = function (size, fill, encoding) {
- if (typeof size !== 'number') {
- throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size)
- }
- if (size < 0 || size >= 2 * (1 << 30)) {
- throw new RangeError('The value "' + size + '" is invalid for option "size"')
- }
- var buf = Buffer(size)
- if (!fill || fill.length === 0) {
- buf.fill(0)
- } else if (typeof encoding === 'string') {
- buf.fill(fill, encoding)
- } else {
- buf.fill(fill)
- }
- return buf
- }
-}
-
-if (!safer.kStringMaxLength) {
- try {
- safer.kStringMaxLength = process.binding('buffer').kStringMaxLength
- } catch (e) {
- // we can't determine kStringMaxLength in environments where process.binding
- // is unsupported, so let's not set it
- }
-}
-
-if (!safer.constants) {
- safer.constants = {
- MAX_LENGTH: safer.kMaxLength
- }
- if (safer.kStringMaxLength) {
- safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength
- }
-}
-
-module.exports = safer
diff --git a/node_modules/safer-buffer/tests.js b/node_modules/safer-buffer/tests.js
deleted file mode 100644
index 7ed2777..0000000
--- a/node_modules/safer-buffer/tests.js
+++ /dev/null
@@ -1,406 +0,0 @@
-/* eslint-disable node/no-deprecated-api */
-
-'use strict'
-
-var test = require('tape')
-
-var buffer = require('buffer')
-
-var index = require('./')
-var safer = require('./safer')
-var dangerous = require('./dangerous')
-
-/* Inheritance tests */
-
-test('Default is Safer', function (t) {
- t.equal(index, safer)
- t.notEqual(safer, dangerous)
- t.notEqual(index, dangerous)
- t.end()
-})
-
-test('Is not a function', function (t) {
- [index, safer, dangerous].forEach(function (impl) {
- t.equal(typeof impl, 'object')
- t.equal(typeof impl.Buffer, 'object')
- });
- [buffer].forEach(function (impl) {
- t.equal(typeof impl, 'object')
- t.equal(typeof impl.Buffer, 'function')
- })
- t.end()
-})
-
-test('Constructor throws', function (t) {
- [index, safer, dangerous].forEach(function (impl) {
- t.throws(function () { impl.Buffer() })
- t.throws(function () { impl.Buffer(0) })
- t.throws(function () { impl.Buffer('a') })
- t.throws(function () { impl.Buffer('a', 'utf-8') })
- t.throws(function () { return new impl.Buffer() })
- t.throws(function () { return new impl.Buffer(0) })
- t.throws(function () { return new impl.Buffer('a') })
- t.throws(function () { return new impl.Buffer('a', 'utf-8') })
- })
- t.end()
-})
-
-test('Safe methods exist', function (t) {
- [index, safer, dangerous].forEach(function (impl) {
- t.equal(typeof impl.Buffer.alloc, 'function', 'alloc')
- t.equal(typeof impl.Buffer.from, 'function', 'from')
- })
- t.end()
-})
-
-test('Unsafe methods exist only in Dangerous', function (t) {
- [index, safer].forEach(function (impl) {
- t.equal(typeof impl.Buffer.allocUnsafe, 'undefined')
- t.equal(typeof impl.Buffer.allocUnsafeSlow, 'undefined')
- });
- [dangerous].forEach(function (impl) {
- t.equal(typeof impl.Buffer.allocUnsafe, 'function')
- t.equal(typeof impl.Buffer.allocUnsafeSlow, 'function')
- })
- t.end()
-})
-
-test('Generic methods/properties are defined and equal', function (t) {
- ['poolSize', 'isBuffer', 'concat', 'byteLength'].forEach(function (method) {
- [index, safer, dangerous].forEach(function (impl) {
- t.equal(impl.Buffer[method], buffer.Buffer[method], method)
- t.notEqual(typeof impl.Buffer[method], 'undefined', method)
- })
- })
- t.end()
-})
-
-test('Built-in buffer static methods/properties are inherited', function (t) {
- Object.keys(buffer).forEach(function (method) {
- if (method === 'SlowBuffer' || method === 'Buffer') return;
- [index, safer, dangerous].forEach(function (impl) {
- t.equal(impl[method], buffer[method], method)
- t.notEqual(typeof impl[method], 'undefined', method)
- })
- })
- t.end()
-})
-
-test('Built-in Buffer static methods/properties are inherited', function (t) {
- Object.keys(buffer.Buffer).forEach(function (method) {
- if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return;
- [index, safer, dangerous].forEach(function (impl) {
- t.equal(impl.Buffer[method], buffer.Buffer[method], method)
- t.notEqual(typeof impl.Buffer[method], 'undefined', method)
- })
- })
- t.end()
-})
-
-test('.prototype property of Buffer is inherited', function (t) {
- [index, safer, dangerous].forEach(function (impl) {
- t.equal(impl.Buffer.prototype, buffer.Buffer.prototype, 'prototype')
- t.notEqual(typeof impl.Buffer.prototype, 'undefined', 'prototype')
- })
- t.end()
-})
-
-test('All Safer methods are present in Dangerous', function (t) {
- Object.keys(safer).forEach(function (method) {
- if (method === 'Buffer') return;
- [index, safer, dangerous].forEach(function (impl) {
- t.equal(impl[method], safer[method], method)
- if (method !== 'kStringMaxLength') {
- t.notEqual(typeof impl[method], 'undefined', method)
- }
- })
- })
- Object.keys(safer.Buffer).forEach(function (method) {
- [index, safer, dangerous].forEach(function (impl) {
- t.equal(impl.Buffer[method], safer.Buffer[method], method)
- t.notEqual(typeof impl.Buffer[method], 'undefined', method)
- })
- })
- t.end()
-})
-
-test('Safe methods from Dangerous methods are present in Safer', function (t) {
- Object.keys(dangerous).forEach(function (method) {
- if (method === 'Buffer') return;
- [index, safer, dangerous].forEach(function (impl) {
- t.equal(impl[method], dangerous[method], method)
- if (method !== 'kStringMaxLength') {
- t.notEqual(typeof impl[method], 'undefined', method)
- }
- })
- })
- Object.keys(dangerous.Buffer).forEach(function (method) {
- if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return;
- [index, safer, dangerous].forEach(function (impl) {
- t.equal(impl.Buffer[method], dangerous.Buffer[method], method)
- t.notEqual(typeof impl.Buffer[method], 'undefined', method)
- })
- })
- t.end()
-})
-
-/* Behaviour tests */
-
-test('Methods return Buffers', function (t) {
- [index, safer, dangerous].forEach(function (impl) {
- t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0)))
- t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 10)))
- t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 'a')))
- t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10)))
- t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10, 'x')))
- t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(9, 'ab')))
- t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('')))
- t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string')))
- t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string', 'utf-8')))
- t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64')))
- t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([0, 42, 3])))
- t.ok(buffer.Buffer.isBuffer(impl.Buffer.from(new Uint8Array([0, 42, 3]))))
- t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([])))
- });
- ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) {
- t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](0)))
- t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](10)))
- })
- t.end()
-})
-
-test('Constructor is buffer.Buffer', function (t) {
- [index, safer, dangerous].forEach(function (impl) {
- t.equal(impl.Buffer.alloc(0).constructor, buffer.Buffer)
- t.equal(impl.Buffer.alloc(0, 10).constructor, buffer.Buffer)
- t.equal(impl.Buffer.alloc(0, 'a').constructor, buffer.Buffer)
- t.equal(impl.Buffer.alloc(10).constructor, buffer.Buffer)
- t.equal(impl.Buffer.alloc(10, 'x').constructor, buffer.Buffer)
- t.equal(impl.Buffer.alloc(9, 'ab').constructor, buffer.Buffer)
- t.equal(impl.Buffer.from('').constructor, buffer.Buffer)
- t.equal(impl.Buffer.from('string').constructor, buffer.Buffer)
- t.equal(impl.Buffer.from('string', 'utf-8').constructor, buffer.Buffer)
- t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').constructor, buffer.Buffer)
- t.equal(impl.Buffer.from([0, 42, 3]).constructor, buffer.Buffer)
- t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).constructor, buffer.Buffer)
- t.equal(impl.Buffer.from([]).constructor, buffer.Buffer)
- });
- [0, 10, 100].forEach(function (arg) {
- t.equal(dangerous.Buffer.allocUnsafe(arg).constructor, buffer.Buffer)
- t.equal(dangerous.Buffer.allocUnsafeSlow(arg).constructor, buffer.SlowBuffer(0).constructor)
- })
- t.end()
-})
-
-test('Invalid calls throw', function (t) {
- [index, safer, dangerous].forEach(function (impl) {
- t.throws(function () { impl.Buffer.from(0) })
- t.throws(function () { impl.Buffer.from(10) })
- t.throws(function () { impl.Buffer.from(10, 'utf-8') })
- t.throws(function () { impl.Buffer.from('string', 'invalid encoding') })
- t.throws(function () { impl.Buffer.from(-10) })
- t.throws(function () { impl.Buffer.from(1e90) })
- t.throws(function () { impl.Buffer.from(Infinity) })
- t.throws(function () { impl.Buffer.from(-Infinity) })
- t.throws(function () { impl.Buffer.from(NaN) })
- t.throws(function () { impl.Buffer.from(null) })
- t.throws(function () { impl.Buffer.from(undefined) })
- t.throws(function () { impl.Buffer.from() })
- t.throws(function () { impl.Buffer.from({}) })
- t.throws(function () { impl.Buffer.alloc('') })
- t.throws(function () { impl.Buffer.alloc('string') })
- t.throws(function () { impl.Buffer.alloc('string', 'utf-8') })
- t.throws(function () { impl.Buffer.alloc('b25ldHdvdGhyZWU=', 'base64') })
- t.throws(function () { impl.Buffer.alloc(-10) })
- t.throws(function () { impl.Buffer.alloc(1e90) })
- t.throws(function () { impl.Buffer.alloc(2 * (1 << 30)) })
- t.throws(function () { impl.Buffer.alloc(Infinity) })
- t.throws(function () { impl.Buffer.alloc(-Infinity) })
- t.throws(function () { impl.Buffer.alloc(null) })
- t.throws(function () { impl.Buffer.alloc(undefined) })
- t.throws(function () { impl.Buffer.alloc() })
- t.throws(function () { impl.Buffer.alloc([]) })
- t.throws(function () { impl.Buffer.alloc([0, 42, 3]) })
- t.throws(function () { impl.Buffer.alloc({}) })
- });
- ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) {
- t.throws(function () { dangerous.Buffer[method]('') })
- t.throws(function () { dangerous.Buffer[method]('string') })
- t.throws(function () { dangerous.Buffer[method]('string', 'utf-8') })
- t.throws(function () { dangerous.Buffer[method](2 * (1 << 30)) })
- t.throws(function () { dangerous.Buffer[method](Infinity) })
- if (dangerous.Buffer[method] === buffer.Buffer.allocUnsafe) {
- t.skip('Skipping, older impl of allocUnsafe coerced negative sizes to 0')
- } else {
- t.throws(function () { dangerous.Buffer[method](-10) })
- t.throws(function () { dangerous.Buffer[method](-1e90) })
- t.throws(function () { dangerous.Buffer[method](-Infinity) })
- }
- t.throws(function () { dangerous.Buffer[method](null) })
- t.throws(function () { dangerous.Buffer[method](undefined) })
- t.throws(function () { dangerous.Buffer[method]() })
- t.throws(function () { dangerous.Buffer[method]([]) })
- t.throws(function () { dangerous.Buffer[method]([0, 42, 3]) })
- t.throws(function () { dangerous.Buffer[method]({}) })
- })
- t.end()
-})
-
-test('Buffers have appropriate lengths', function (t) {
- [index, safer, dangerous].forEach(function (impl) {
- t.equal(impl.Buffer.alloc(0).length, 0)
- t.equal(impl.Buffer.alloc(10).length, 10)
- t.equal(impl.Buffer.from('').length, 0)
- t.equal(impl.Buffer.from('string').length, 6)
- t.equal(impl.Buffer.from('string', 'utf-8').length, 6)
- t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').length, 11)
- t.equal(impl.Buffer.from([0, 42, 3]).length, 3)
- t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).length, 3)
- t.equal(impl.Buffer.from([]).length, 0)
- });
- ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) {
- t.equal(dangerous.Buffer[method](0).length, 0)
- t.equal(dangerous.Buffer[method](10).length, 10)
- })
- t.end()
-})
-
-test('Buffers have appropriate lengths (2)', function (t) {
- t.equal(index.Buffer.alloc, safer.Buffer.alloc)
- t.equal(index.Buffer.alloc, dangerous.Buffer.alloc)
- var ok = true;
- [ safer.Buffer.alloc,
- dangerous.Buffer.allocUnsafe,
- dangerous.Buffer.allocUnsafeSlow
- ].forEach(function (method) {
- for (var i = 0; i < 1e2; i++) {
- var length = Math.round(Math.random() * 1e5)
- var buf = method(length)
- if (!buffer.Buffer.isBuffer(buf)) ok = false
- if (buf.length !== length) ok = false
- }
- })
- t.ok(ok)
- t.end()
-})
-
-test('.alloc(size) is zero-filled and has correct length', function (t) {
- t.equal(index.Buffer.alloc, safer.Buffer.alloc)
- t.equal(index.Buffer.alloc, dangerous.Buffer.alloc)
- var ok = true
- for (var i = 0; i < 1e2; i++) {
- var length = Math.round(Math.random() * 2e6)
- var buf = index.Buffer.alloc(length)
- if (!buffer.Buffer.isBuffer(buf)) ok = false
- if (buf.length !== length) ok = false
- var j
- for (j = 0; j < length; j++) {
- if (buf[j] !== 0) ok = false
- }
- buf.fill(1)
- for (j = 0; j < length; j++) {
- if (buf[j] !== 1) ok = false
- }
- }
- t.ok(ok)
- t.end()
-})
-
-test('.allocUnsafe / .allocUnsafeSlow are fillable and have correct lengths', function (t) {
- ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) {
- var ok = true
- for (var i = 0; i < 1e2; i++) {
- var length = Math.round(Math.random() * 2e6)
- var buf = dangerous.Buffer[method](length)
- if (!buffer.Buffer.isBuffer(buf)) ok = false
- if (buf.length !== length) ok = false
- buf.fill(0, 0, length)
- var j
- for (j = 0; j < length; j++) {
- if (buf[j] !== 0) ok = false
- }
- buf.fill(1, 0, length)
- for (j = 0; j < length; j++) {
- if (buf[j] !== 1) ok = false
- }
- }
- t.ok(ok, method)
- })
- t.end()
-})
-
-test('.alloc(size, fill) is `fill`-filled', function (t) {
- t.equal(index.Buffer.alloc, safer.Buffer.alloc)
- t.equal(index.Buffer.alloc, dangerous.Buffer.alloc)
- var ok = true
- for (var i = 0; i < 1e2; i++) {
- var length = Math.round(Math.random() * 2e6)
- var fill = Math.round(Math.random() * 255)
- var buf = index.Buffer.alloc(length, fill)
- if (!buffer.Buffer.isBuffer(buf)) ok = false
- if (buf.length !== length) ok = false
- for (var j = 0; j < length; j++) {
- if (buf[j] !== fill) ok = false
- }
- }
- t.ok(ok)
- t.end()
-})
-
-test('.alloc(size, fill) is `fill`-filled', function (t) {
- t.equal(index.Buffer.alloc, safer.Buffer.alloc)
- t.equal(index.Buffer.alloc, dangerous.Buffer.alloc)
- var ok = true
- for (var i = 0; i < 1e2; i++) {
- var length = Math.round(Math.random() * 2e6)
- var fill = Math.round(Math.random() * 255)
- var buf = index.Buffer.alloc(length, fill)
- if (!buffer.Buffer.isBuffer(buf)) ok = false
- if (buf.length !== length) ok = false
- for (var j = 0; j < length; j++) {
- if (buf[j] !== fill) ok = false
- }
- }
- t.ok(ok)
- t.deepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 97))
- t.notDeepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 98))
-
- var tmp = new buffer.Buffer(2)
- tmp.fill('ok')
- if (tmp[1] === tmp[0]) {
- // Outdated Node.js
- t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('ooooo'))
- } else {
- t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('okoko'))
- }
- t.notDeepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('kokok'))
-
- t.end()
-})
-
-test('safer.Buffer.from returns results same as Buffer constructor', function (t) {
- [index, safer, dangerous].forEach(function (impl) {
- t.deepEqual(impl.Buffer.from(''), new buffer.Buffer(''))
- t.deepEqual(impl.Buffer.from('string'), new buffer.Buffer('string'))
- t.deepEqual(impl.Buffer.from('string', 'utf-8'), new buffer.Buffer('string', 'utf-8'))
- t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), new buffer.Buffer('b25ldHdvdGhyZWU=', 'base64'))
- t.deepEqual(impl.Buffer.from([0, 42, 3]), new buffer.Buffer([0, 42, 3]))
- t.deepEqual(impl.Buffer.from(new Uint8Array([0, 42, 3])), new buffer.Buffer(new Uint8Array([0, 42, 3])))
- t.deepEqual(impl.Buffer.from([]), new buffer.Buffer([]))
- })
- t.end()
-})
-
-test('safer.Buffer.from returns consistent results', function (t) {
- [index, safer, dangerous].forEach(function (impl) {
- t.deepEqual(impl.Buffer.from(''), impl.Buffer.alloc(0))
- t.deepEqual(impl.Buffer.from([]), impl.Buffer.alloc(0))
- t.deepEqual(impl.Buffer.from(new Uint8Array([])), impl.Buffer.alloc(0))
- t.deepEqual(impl.Buffer.from('string', 'utf-8'), impl.Buffer.from('string'))
- t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from([115, 116, 114, 105, 110, 103]))
- t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from(impl.Buffer.from('string')))
- t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), impl.Buffer.from('onetwothree'))
- t.notDeepEqual(impl.Buffer.from('b25ldHdvdGhyZWU='), impl.Buffer.from('onetwothree'))
- })
- t.end()
-})
diff --git a/node_modules/split-ca/.gitlab-ci.yml b/node_modules/split-ca/.gitlab-ci.yml
deleted file mode 100644
index ef31627..0000000
--- a/node_modules/split-ca/.gitlab-ci.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-image: node:latest
-
-stages:
- - build
- - test
-
-job1:
- stage: build
- script:
- - npm install
- tags:
- - npm
-
-job2:
- stage: test
- script:
- - npm test
- tags:
- - npm
diff --git a/node_modules/split-ca/.npmignore b/node_modules/split-ca/.npmignore
deleted file mode 100644
index 3c3629e..0000000
--- a/node_modules/split-ca/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
diff --git a/node_modules/split-ca/Makefile b/node_modules/split-ca/Makefile
deleted file mode 100644
index 412fd54..0000000
--- a/node_modules/split-ca/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-test:
- @./node_modules/.bin/mocha
-
-.PHONY: test
diff --git a/node_modules/split-ca/README.md b/node_modules/split-ca/README.md
deleted file mode 100644
index 89a3d4c..0000000
--- a/node_modules/split-ca/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-# split-ca
-
-Simple node.js module to split a single certificate authority chain file (bundle, ca-bundle, ca-chain, etc.) into an array, as expected by the node.js tls api
-
-## Installation
-
-`npm install split-ca`
-
-## Usage
-
-Usage will depend on your server module of choice, but most https modules require an options hash with `ca`, `key`, and `cert`. Simply give split-ca the filepath of your bundle file.
-
-```js
-var https = require('https');
-var fs = require('fs');
-
-var splitca = require('split-ca');
-
-var options = {
- ca: splitca("path/to/ca_bundle_file"),
- key:fs.readFileSync("path/to/server_key_file"),
- cert:fs.readFileSync("path/to/server_cert_file"),
- requestCert: true,
- rejectUnauthorized: true
-};
-
-https.createServer(options, function (req, res) {
- res.writeHead(200);
- res.end("hello world\n");
-}).listen(8000);
-```
-
-## Args
-
-`split-ca('filepath','split-string','encoding')`
-
-#### `filepath`
-
-A standard node path to your object. An error is thrown if the file cannot be parsed, is not formatted properly.
-
-#### `split-string`
-
-Optional. Defaults to `"\n"`, can be replaced with anything.
-
-#### `encoding`
-
-Optional. Defaults to `"utf-8"`, can be replaced with anything accepted by node's `fs` module.
-
-## Credits
-
-Thanks to [Benjie Gillam](https://twitter.com/Benjie) for the [blog post and sample code](http://www.benjiegillam.com/2012/06/node-dot-js-ssl-certificate-chain/) that was unashamedly ripped for this module.
diff --git a/node_modules/split-ca/index.js b/node_modules/split-ca/index.js
deleted file mode 100644
index 25f21d5..0000000
--- a/node_modules/split-ca/index.js
+++ /dev/null
@@ -1,27 +0,0 @@
-var fs = require('fs');
-
-module.exports = function (filepath, split, encoding) {
- split = typeof split !== 'undefined' ? split : "\n";
- encoding = typeof encoding !== 'undefined' ? encoding : "utf8";
-
- var ca = [];
- var chain = fs.readFileSync(filepath, encoding);
- if(chain.indexOf("-END CERTIFICATE-") < 0 || chain.indexOf("-BEGIN CERTIFICATE-") < 0){
- throw Error("File does not contain 'BEGIN CERTIFICATE' or 'END CERTIFICATE'");
- }
- chain = chain.split(split);
- var cert = [];
- var _i, _len;
- for (_i = 0, _len = chain.length; _i < _len; _i++) {
- var line = chain[_i];
- if (!(line.length !== 0)) {
- continue;
- }
- cert.push(line);
- if (line.match(/-END CERTIFICATE-/)) {
- ca.push(cert.join(split));
- cert = [];
- }
- }
- return ca;
-}
diff --git a/node_modules/split-ca/package.json b/node_modules/split-ca/package.json
deleted file mode 100644
index 2769095..0000000
--- a/node_modules/split-ca/package.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "name": "split-ca",
- "version": "1.0.1",
- "description": "Simple module to split a single certificate authority chain file (aka: bundle, ca-bundle, ca-chain, etc.) into an array, as expected by the node.js tls api.",
- "main": "index.js",
- "scripts": {
- "test": "make test"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/bushong1/split-ca.git"
- },
- "keywords": [
- "nodejs",
- "ca",
- "chain",
- "ssl",
- "tls",
- "https",
- "certificate",
- "authority",
- "bundle",
- "ca-bundle",
- "ca-chain",
- "split",
- "server"
- ],
- "author": "Charles Bushong",
- "license": "ISC",
- "bugs": {
- "url": "https://github.com/bushong1/split-ca/issues"
- },
- "homepage": "https://github.com/bushong1/split-ca",
- "devDependencies": {
- "chai": "^1.10.0",
- "mocha": "^2.1.0"
- }
-}
diff --git a/node_modules/split-ca/test/certs/empty.ca b/node_modules/split-ca/test/certs/empty.ca
deleted file mode 100644
index e69de29..0000000
diff --git a/node_modules/split-ca/test/certs/garbage.ca b/node_modules/split-ca/test/certs/garbage.ca
deleted file mode 100644
index 2245618..0000000
--- a/node_modules/split-ca/test/certs/garbage.ca
+++ /dev/null
@@ -1,16 +0,0 @@
-MIIGzDCCBLSgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBpjELMAkGA1UEBhMCVVMx
-DjAMBgNVBAgTBVRleGFzMRQwEgYDVQQHEwtTYW4gQW50b25pbzEaMBgGA1UEChMR
-R2xvYmFsU0NBUEUsIEluYy4xFDASBgNVBAsTC0VuZ2luZWVyaW5nMRUwEwYDVQQD
-EwxtaWtlLXJvb3QtY2ExKDAmBgkqhkiG9w0BCQEWGW1oYW1iaWRnZUBnbG9iYWxz
-Y2FwZS5jb20wHhcNMTAxMTE4MjEyMzA4WhcNMTUxMTE3MjEyMzA4WjCBmDELMAkG
-A1UEBhMCVVMxDjAMBgNVBAgTBVRleGFzMRowGAYDVQQKExFHbG9iYWxTQ0FQRSwg
-SW5jLjEUMBIGA1UECxMLRW5naW5lZXJpbmcxHTAbBgNVBAMTFG1pa2UtaW50ZXJt
-ZWRpYXRlLWNhMSgwJgYJKoZIhvcNAQkBFhltaGFtYmlkZ2VAZ2xvYmFsc2NhcGUu
-Y29tMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAsF+vlQfZnssDsqFx
-IXCGHST1jiTHJGGHiiwc9Qb1NPDbyvcdNXvcfkdyYjd8VlYyo3/jnj6xx3PxzJhG
-NmnBGJ0I7h/RFJaG7nmGfeWUHCLsVjGfQeEjC++d6zzE3unPOiLVIhv9abD6kISa
-hLdltOBcT19mqg1yG4Q4XExjeYmSYGFiDIdv+WwwUssTyPdppaaWcsjNaFcmuopU
-RfmcfULPFwvFN6LsgvSTYwYe9l8421fA5c+WiR1JomjGuJT/0sITpzQRCenWi0S0
-WZuftT61+fU0/OxINhgO4yK6C1eOoaxmoEG2oVm2o4Bjy9ceYN2UqdRGt8t/23/h
-Wog3vEwdoHqghrjeiGWWs98qfzINKokiMd7APcxdkZ1SzyvOEWht4V3/XedleiMx
-8WGjbVtRg/k4Hgf2TGwxcw==
diff --git a/node_modules/split-ca/test/certs/split0.ca b/node_modules/split-ca/test/certs/split0.ca
deleted file mode 100644
index 8af9ee2..0000000
--- a/node_modules/split-ca/test/certs/split0.ca
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIGzDCCBLSgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBpjELMAkGA1UEBhMCVVMx
-DjAMBgNVBAgTBVRleGFzMRQwEgYDVQQHEwtTYW4gQW50b25pbzEaMBgGA1UEChMR
-R2xvYmFsU0NBUEUsIEluYy4xFDASBgNVBAsTC0VuZ2luZWVyaW5nMRUwEwYDVQQD
-EwxtaWtlLXJvb3QtY2ExKDAmBgkqhkiG9w0BCQEWGW1oYW1iaWRnZUBnbG9iYWxz
-Y2FwZS5jb20wHhcNMTAxMTE4MjEyMzA4WhcNMTUxMTE3MjEyMzA4WjCBmDELMAkG
-A1UEBhMCVVMxDjAMBgNVBAgTBVRleGFzMRowGAYDVQQKExFHbG9iYWxTQ0FQRSwg
-SW5jLjEUMBIGA1UECxMLRW5naW5lZXJpbmcxHTAbBgNVBAMTFG1pa2UtaW50ZXJt
-ZWRpYXRlLWNhMSgwJgYJKoZIhvcNAQkBFhltaGFtYmlkZ2VAZ2xvYmFsc2NhcGUu
-Y29tMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAsF+vlQfZnssDsqFx
-IXCGHST1jiTHJGGHiiwc9Qb1NPDbyvcdNXvcfkdyYjd8VlYyo3/jnj6xx3PxzJhG
-NmnBGJ0I7h/RFJaG7nmGfeWUHCLsVjGfQeEjC++d6zzE3unPOiLVIhv9abD6kISa
-hLdltOBcT19mqg1yG4Q4XExjeYmSYGFiDIdv+WwwUssTyPdppaaWcsjNaFcmuopU
-RfmcfULPFwvFN6LsgvSTYwYe9l8421fA5c+WiR1JomjGuJT/0sITpzQRCenWi0S0
-WZuftT61+fU0/OxINhgO4yK6C1eOoaxmoEG2oVm2o4Bjy9ceYN2UqdRGt8t/23/h
-Wog3vEwdoHqghrjeiGWWs98qfzINKokiMd7APcxdkZ1SzyvOEWht4V3/XedleiMx
-8WGjbVtRg/k4Hgf2TGwxcw==
------END CERTIFICATE-----
diff --git a/node_modules/split-ca/test/certs/split1.ca b/node_modules/split-ca/test/certs/split1.ca
deleted file mode 100644
index b679411..0000000
--- a/node_modules/split-ca/test/certs/split1.ca
+++ /dev/null
@@ -1,13 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIG4jCCBMqgAwIBAgIJAJjguYVnU08GMA0GCSqGSIb3DQEBBQUAMIGmMQswCQYD
-VQQGEwJVUzEOMAwGA1UECBMFVGV4YXMxFDASBgNVBAcTC1NhbiBBbnRvbmlvMRow
-GAYDVQQKExFHbG9iYWxTQ0FQRSwgSW5jLjEUMBIGA1UECxMLRW5naW5lZXJpbmcx
-FTATBgNVBAMTDG1pa2Utcm9vdC1jYTEoMCYGCSqGSIb3DQEJARYZbWhhbWJpZGdl
-QGdsb2JhbHNjYXBlLmNvbTAeFw0xMDExMTgyMTE5NDdaFw0xNTExMTcyMTE5NDda
-MIGmMQswCQYDVQQGEwJVUzEOMAwGA1UECBMFVGV4YXMxFDASBgNVBAcTC1NhbiBB
-bnRvbmlvMRowGAYDVQQKExFHbG9iYWxTQ0FQRSwgSW5jLjEUMBIGA1UECxMLRW5n
-aW5lZXJpbmcxFTATBgNVBAMTDG1pa2Utcm9vdC1jYTEoMCYGCSqGSIb3DQEJARYZ
-bWhhbWJpZGdlQGdsb2JhbHNjYXBlLmNvbTCCAiIwDQYJKoZIhvcNAQEBBQADggIP
-xYK3mO1034kBdDxmVoBeEwfjWWPyC/uyFGwCNZCzoAQGMxNAnj33NBiCLHJRo1Z5
-BxirSSMxOT4LEkmkOhuTyKB0TJZf+8wP8pK5BsO3xjO+uM1K3LY=
------END CERTIFICATE-----
diff --git a/node_modules/split-ca/test/certs/test-chain.bundle b/node_modules/split-ca/test/certs/test-chain.bundle
deleted file mode 100644
index 31d0f88..0000000
--- a/node_modules/split-ca/test/certs/test-chain.bundle
+++ /dev/null
@@ -1,31 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIGzDCCBLSgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBpjELMAkGA1UEBhMCVVMx
-DjAMBgNVBAgTBVRleGFzMRQwEgYDVQQHEwtTYW4gQW50b25pbzEaMBgGA1UEChMR
-R2xvYmFsU0NBUEUsIEluYy4xFDASBgNVBAsTC0VuZ2luZWVyaW5nMRUwEwYDVQQD
-EwxtaWtlLXJvb3QtY2ExKDAmBgkqhkiG9w0BCQEWGW1oYW1iaWRnZUBnbG9iYWxz
-Y2FwZS5jb20wHhcNMTAxMTE4MjEyMzA4WhcNMTUxMTE3MjEyMzA4WjCBmDELMAkG
-A1UEBhMCVVMxDjAMBgNVBAgTBVRleGFzMRowGAYDVQQKExFHbG9iYWxTQ0FQRSwg
-SW5jLjEUMBIGA1UECxMLRW5naW5lZXJpbmcxHTAbBgNVBAMTFG1pa2UtaW50ZXJt
-ZWRpYXRlLWNhMSgwJgYJKoZIhvcNAQkBFhltaGFtYmlkZ2VAZ2xvYmFsc2NhcGUu
-Y29tMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAsF+vlQfZnssDsqFx
-IXCGHST1jiTHJGGHiiwc9Qb1NPDbyvcdNXvcfkdyYjd8VlYyo3/jnj6xx3PxzJhG
-NmnBGJ0I7h/RFJaG7nmGfeWUHCLsVjGfQeEjC++d6zzE3unPOiLVIhv9abD6kISa
-hLdltOBcT19mqg1yG4Q4XExjeYmSYGFiDIdv+WwwUssTyPdppaaWcsjNaFcmuopU
-RfmcfULPFwvFN6LsgvSTYwYe9l8421fA5c+WiR1JomjGuJT/0sITpzQRCenWi0S0
-WZuftT61+fU0/OxINhgO4yK6C1eOoaxmoEG2oVm2o4Bjy9ceYN2UqdRGt8t/23/h
-Wog3vEwdoHqghrjeiGWWs98qfzINKokiMd7APcxdkZ1SzyvOEWht4V3/XedleiMx
-8WGjbVtRg/k4Hgf2TGwxcw==
------END CERTIFICATE-----
------BEGIN CERTIFICATE-----
-MIIG4jCCBMqgAwIBAgIJAJjguYVnU08GMA0GCSqGSIb3DQEBBQUAMIGmMQswCQYD
-VQQGEwJVUzEOMAwGA1UECBMFVGV4YXMxFDASBgNVBAcTC1NhbiBBbnRvbmlvMRow
-GAYDVQQKExFHbG9iYWxTQ0FQRSwgSW5jLjEUMBIGA1UECxMLRW5naW5lZXJpbmcx
-FTATBgNVBAMTDG1pa2Utcm9vdC1jYTEoMCYGCSqGSIb3DQEJARYZbWhhbWJpZGdl
-QGdsb2JhbHNjYXBlLmNvbTAeFw0xMDExMTgyMTE5NDdaFw0xNTExMTcyMTE5NDda
-MIGmMQswCQYDVQQGEwJVUzEOMAwGA1UECBMFVGV4YXMxFDASBgNVBAcTC1NhbiBB
-bnRvbmlvMRowGAYDVQQKExFHbG9iYWxTQ0FQRSwgSW5jLjEUMBIGA1UECxMLRW5n
-aW5lZXJpbmcxFTATBgNVBAMTDG1pa2Utcm9vdC1jYTEoMCYGCSqGSIb3DQEJARYZ
-bWhhbWJpZGdlQGdsb2JhbHNjYXBlLmNvbTCCAiIwDQYJKoZIhvcNAQEBBQADggIP
-xYK3mO1034kBdDxmVoBeEwfjWWPyC/uyFGwCNZCzoAQGMxNAnj33NBiCLHJRo1Z5
-BxirSSMxOT4LEkmkOhuTyKB0TJZf+8wP8pK5BsO3xjO+uM1K3LY=
------END CERTIFICATE-----
diff --git a/node_modules/split-ca/test/certs/unreadable.ca/.npmignore b/node_modules/split-ca/test/certs/unreadable.ca/.npmignore
deleted file mode 100644
index f935021..0000000
--- a/node_modules/split-ca/test/certs/unreadable.ca/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-!.gitignore
diff --git a/node_modules/split-ca/test/splitCa.test.js b/node_modules/split-ca/test/splitCa.test.js
deleted file mode 100644
index 8e899cd..0000000
--- a/node_modules/split-ca/test/splitCa.test.js
+++ /dev/null
@@ -1,45 +0,0 @@
-var expect = require("chai").expect;
-var fs = require("fs");
-var split_ca = require("../index.js");
-
-describe('split', function(){
- var emptyFile = "test/certs/empty.ca";
- var missingFile = "test/certs/missing.ca";
- var unreadableFile = "test/certs/unreadable.ca";
- var garbageFile = "test/certs/garbage.ca";
- var ca0file = "test/certs/split0.ca";
- var ca1file = "test/certs/split1.ca";
- var caBundleFile = "test/certs/test-chain.bundle";
- var ca0 = fs.readFileSync(ca0file,"utf8").toString().replace(/\n$/, '');
- var ca1 = fs.readFileSync(ca1file,"utf8").toString().replace(/\n$/, '');
- describe('multiple ca chain', function(){
- it('should return an array of CA chain strings', function(){
- var split = split_ca(caBundleFile);
- expect(split).to.be.an("array");
- expect(split).to.have.members([ca0, ca1]);
- });
- });
- describe('single ca chain', function(){
- it('should return an array of one CA string', function(){
- var split = split_ca(ca1file);
- expect(split).to.be.an("array");
- expect(split).to.have.members([ca1]);
- expect(split).to.not.have.members([ca0]);
- });
- });
- describe('empty file', function(){
- it('should throw a bad file error', function(){
- expect(function(){split_ca(emptyFile)}).to.throw(Error);
- });
- });
- describe('directory instead of file', function(){
- it('should throw a bad file error', function(){
- expect(function(){split_ca(unreadableFile)}).to.throw(Error);
- });
- });
- describe('garbage file', function(){
- it('should throw a bad file error', function(){
- expect(function(){ split_ca(garbageFile)}).to.throw(Error);
- });
- });
-});
diff --git a/node_modules/ssh2/LICENSE b/node_modules/ssh2/LICENSE
deleted file mode 100644
index 290762e..0000000
--- a/node_modules/ssh2/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright Brian White. All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/ssh2/README.md b/node_modules/ssh2/README.md
deleted file mode 100644
index d0e6f7f..0000000
--- a/node_modules/ssh2/README.md
+++ /dev/null
@@ -1,1529 +0,0 @@
-# Description
-
-SSH2 client and server modules written in pure JavaScript for [node.js](http://nodejs.org/).
-
-Development/testing is done against OpenSSH (8.7 currently).
-
-Changes (breaking or otherwise) in v1.0.0 can be found [here](https://github.com/mscdex/ssh2/issues/935).
-
-# Table of Contents
-
-* [Requirements](#requirements)
-* [Installation](#installation)
-* [Client Examples](#client-examples)
- * [Execute 'uptime' on a server](#execute-uptime-on-a-server)
- * [Start an interactive shell session](#start-an-interactive-shell-session)
- * [Send a raw HTTP request to port 80 on the server](#send-a-raw-http-request-to-port-80-on-the-server)
- * [Forward local connections to port 8000 on the server to us](#forward-local-connections-to-port-8000-on-the-server-to-us)
- * [Get a directory listing via SFTP](#get-a-directory-listing-via-sftp)
- * [Connection hopping](#connection-hopping)
- * [Forward remote X11 connections](#forward-remote-x11-connections)
- * [Dynamic (1:1) port forwarding using a SOCKSv5 proxy (using `socksv5`)](#dynamic-11-port-forwarding-using-a-socksv5-proxy-using-socksv5)
- * [Make HTTP(S) connections easily using a custom http(s).Agent](#make-https-connections-easily-using-a-custom-httpsagent)
- * [Invoke an arbitrary subsystem (e.g. netconf)](#invoke-an-arbitrary-subsystem)
-* [Server Examples](#server-examples)
- * [Password and public key authentication and non-interactive (exec) command execution](#password-and-public-key-authentication-and-non-interactive-exec-command-execution)
- * [SFTP-only server](#sftp-only-server)
-* [Other Examples](#other-examples)
- * [Generate an SSH key](#generate-an-ssh-key)
-* [API](#api)
- * [Client](#client)
- * [Client events](#client-events)
- * [Client methods](#client-methods)
- * [Server](#server)
- * [Server events](#server-events)
- * [Server methods](#server-methods)
- * [Connection events](#connection-events)
- * [Connection methods](#connection-methods)
- * [Session events](#session-events)
- * [Channel](#channel)
- * [Pseudo-TTY settings](#pseudo-tty-settings)
- * [Terminal modes](#terminal-modes)
- * [HTTPAgent](#httpagent)
- * [HTTPAgent methods](#httpagent-methods)
- * [HTTPSAgent](#httpsagent)
- * [HTTPSAgent methods](#httpsagent-methods)
- * [Utilities](#utilities)
-
-## Requirements
-
-* [node.js](http://nodejs.org/) -- v10.16.0 or newer
- * node v12.0.0 or newer for Ed25519 key support
-* (Optional) [`cpu-features`](https://github.com/mscdex/cpu-features) is set as an optional package dependency (you do not need to install it explicitly/separately from `ssh2`) that will be automatically built and used if possible. See the project's documentation for its own requirements.
- * This addon is currently used to help generate an optimal default cipher list
-
-## Installation
-
- npm install ssh2
-
-## Client Examples
-
-### Execute 'uptime' on a server
-
-```js
-const { readFileSync } = require('fs');
-
-const { Client } = require('ssh2');
-
-const conn = new Client();
-conn.on('ready', () => {
- console.log('Client :: ready');
- conn.exec('uptime', (err, stream) => {
- if (err) throw err;
- stream.on('close', (code, signal) => {
- console.log('Stream :: close :: code: ' + code + ', signal: ' + signal);
- conn.end();
- }).on('data', (data) => {
- console.log('STDOUT: ' + data);
- }).stderr.on('data', (data) => {
- console.log('STDERR: ' + data);
- });
- });
-}).connect({
- host: '192.168.100.100',
- port: 22,
- username: 'frylock',
- privateKey: readFileSync('/path/to/my/key')
-});
-
-// example output:
-// Client :: ready
-// STDOUT: 17:41:15 up 22 days, 18:09, 1 user, load average: 0.00, 0.01, 0.05
-//
-// Stream :: exit :: code: 0, signal: undefined
-// Stream :: close
-```
-
-### Start an interactive shell session
-
-```js
-const { readFileSync } = require('fs');
-
-const { Client } = require('ssh2');
-
-const conn = new Client();
-conn.on('ready', () => {
- console.log('Client :: ready');
- conn.shell((err, stream) => {
- if (err) throw err;
- stream.on('close', () => {
- console.log('Stream :: close');
- conn.end();
- }).on('data', (data) => {
- console.log('OUTPUT: ' + data);
- });
- stream.end('ls -l\nexit\n');
- });
-}).connect({
- host: '192.168.100.100',
- port: 22,
- username: 'frylock',
- privateKey: readFileSync('/path/to/my/key')
-});
-
-// example output:
-// Client :: ready
-// STDOUT: Last login: Sun Jun 15 09:37:21 2014 from 192.168.100.100
-//
-// STDOUT: ls -l
-// exit
-//
-// STDOUT: frylock@athf:~$ ls -l
-//
-// STDOUT: total 8
-//
-// STDOUT: drwxr-xr-x 2 frylock frylock 4096 Nov 18 2012 mydir
-//
-// STDOUT: -rw-r--r-- 1 frylock frylock 25 Apr 11 2013 test.txt
-//
-// STDOUT: frylock@athf:~$ exit
-//
-// STDOUT: logout
-//
-// Stream :: close
-```
-
-### Send a raw HTTP request to port 80 on the server
-
-```js
-const { Client } = require('ssh2');
-
-const conn = new Client();
-conn.on('ready', () => {
- console.log('Client :: ready');
- conn.forwardOut('192.168.100.102', 8000, '127.0.0.1', 80, (err, stream) => {
- if (err) throw err;
- stream.on('close', () => {
- console.log('TCP :: CLOSED');
- conn.end();
- }).on('data', (data) => {
- console.log('TCP :: DATA: ' + data);
- }).end([
- 'HEAD / HTTP/1.1',
- 'User-Agent: curl/7.27.0',
- 'Host: 127.0.0.1',
- 'Accept: */*',
- 'Connection: close',
- '',
- ''
- ].join('\r\n'));
- });
-}).connect({
- host: '192.168.100.100',
- port: 22,
- username: 'frylock',
- password: 'nodejsrules'
-});
-
-// example output:
-// Client :: ready
-// TCP :: DATA: HTTP/1.1 200 OK
-// Date: Thu, 15 Nov 2012 13:52:58 GMT
-// Server: Apache/2.2.22 (Ubuntu)
-// X-Powered-By: PHP/5.4.6-1ubuntu1
-// Last-Modified: Thu, 01 Jan 1970 00:00:00 GMT
-// Content-Encoding: gzip
-// Vary: Accept-Encoding
-// Connection: close
-// Content-Type: text/html; charset=UTF-8
-//
-//
-// TCP :: CLOSED
-```
-
-### Forward local connections to port 8000 on the server to us
-
-```js
-const { Client } = require('ssh2');
-
-const conn = new Client();
-conn.on('ready', () => {
- console.log('Client :: ready');
- conn.forwardIn('127.0.0.1', 8000, (err) => {
- if (err) throw err;
- console.log('Listening for connections on server on port 8000!');
- });
-}).on('tcp connection', (info, accept, reject) => {
- console.log('TCP :: INCOMING CONNECTION:');
- console.dir(info);
- accept().on('close', () => {
- console.log('TCP :: CLOSED');
- }).on('data', (data) => {
- console.log('TCP :: DATA: ' + data);
- }).end([
- 'HTTP/1.1 404 Not Found',
- 'Date: Thu, 15 Nov 2012 02:07:58 GMT',
- 'Server: ForwardedConnection',
- 'Content-Length: 0',
- 'Connection: close',
- '',
- ''
- ].join('\r\n'));
-}).connect({
- host: '192.168.100.100',
- port: 22,
- username: 'frylock',
- password: 'nodejsrules'
-});
-
-// example output:
-// Client :: ready
-// Listening for connections on server on port 8000!
-// (.... then from another terminal on the server: `curl -I http://127.0.0.1:8000`)
-// TCP :: INCOMING CONNECTION: { destIP: '127.0.0.1',
-// destPort: 8000,
-// srcIP: '127.0.0.1',
-// srcPort: 41969 }
-// TCP DATA: HEAD / HTTP/1.1
-// User-Agent: curl/7.27.0
-// Host: 127.0.0.1:8000
-// Accept: */*
-//
-//
-// TCP :: CLOSED
-```
-
-### Get a directory listing via SFTP
-
-```js
-const { Client } = require('ssh2');
-
-const conn = new Client();
-conn.on('ready', () => {
- console.log('Client :: ready');
- conn.sftp((err, sftp) => {
- if (err) throw err;
- sftp.readdir('foo', (err, list) => {
- if (err) throw err;
- console.dir(list);
- conn.end();
- });
- });
-}).connect({
- host: '192.168.100.100',
- port: 22,
- username: 'frylock',
- password: 'nodejsrules'
-});
-
-// example output:
-// Client :: ready
-// [ { filename: 'test.txt',
-// longname: '-rw-r--r-- 1 frylock frylock 12 Nov 18 11:05 test.txt',
-// attrs:
-// { size: 12,
-// uid: 1000,
-// gid: 1000,
-// mode: 33188,
-// atime: 1353254750,
-// mtime: 1353254744 } },
-// { filename: 'mydir',
-// longname: 'drwxr-xr-x 2 frylock frylock 4096 Nov 18 15:03 mydir',
-// attrs:
-// { size: 1048576,
-// uid: 1000,
-// gid: 1000,
-// mode: 16877,
-// atime: 1353269007,
-// mtime: 1353269007 } } ]
-```
-
-### Connection hopping
-
-```js
-const { Client } = require('ssh2');
-
-const conn1 = new Client();
-const conn2 = new Client();
-
-// Checks uptime on 10.1.1.40 via 192.168.1.1
-
-conn1.on('ready', () => {
- console.log('FIRST :: connection ready');
- // Alternatively, you could use something like netcat or socat with exec()
- // instead of forwardOut(), depending on what the server allows
- conn1.forwardOut('127.0.0.1', 12345, '10.1.1.40', 22, (err, stream) => {
- if (err) {
- console.log('FIRST :: forwardOut error: ' + err);
- return conn1.end();
- }
- conn2.connect({
- sock: stream,
- username: 'user2',
- password: 'password2',
- });
- });
-}).connect({
- host: '192.168.1.1',
- username: 'user1',
- password: 'password1',
-});
-
-conn2.on('ready', () => {
- // This connection is the one to 10.1.1.40
-
- console.log('SECOND :: connection ready');
- conn2.exec('uptime', (err, stream) => {
- if (err) {
- console.log('SECOND :: exec error: ' + err);
- return conn1.end();
- }
- stream.on('close', () => {
- conn1.end(); // close parent (and this) connection
- }).on('data', (data) => {
- console.log(data.toString());
- });
- });
-});
-```
-
-### Forward remote X11 connections
-
-```js
-const { Socket } = require('net');
-
-const { Client } = require('ssh2');
-
-const conn = new Client();
-
-conn.on('x11', (info, accept, reject) => {
- const xserversock = new net.Socket();
- xserversock.on('connect', () => {
- const xclientsock = accept();
- xclientsock.pipe(xserversock).pipe(xclientsock);
- });
- // connects to localhost:0.0
- xserversock.connect(6000, 'localhost');
-});
-
-conn.on('ready', () => {
- conn.exec('xeyes', { x11: true }, (err, stream) => {
- if (err) throw err;
- let code = 0;
- stream.on('close', () => {
- if (code !== 0)
- console.log('Do you have X11 forwarding enabled on your SSH server?');
- conn.end();
- }).on('exit', (exitcode) => {
- code = exitcode;
- });
- });
-}).connect({
- host: '192.168.1.1',
- username: 'foo',
- password: 'bar'
-});
-```
-
-### Dynamic (1:1) port forwarding using a SOCKSv5 proxy (using [socksv5](https://github.com/mscdex/socksv5))
-
-```js
-const socks = require('socksv5');
-const { Client } = require('ssh2');
-
-const sshConfig = {
- host: '192.168.100.1',
- port: 22,
- username: 'nodejs',
- password: 'rules'
-};
-
-socks.createServer((info, accept, deny) => {
- // NOTE: you could just use one ssh2 client connection for all forwards, but
- // you could run into server-imposed limits if you have too many forwards open
- // at any given time
- const conn = new Client();
- conn.on('ready', () => {
- conn.forwardOut(info.srcAddr,
- info.srcPort,
- info.dstAddr,
- info.dstPort,
- (err, stream) => {
- if (err) {
- conn.end();
- return deny();
- }
-
- const clientSocket = accept(true);
- if (clientSocket) {
- stream.pipe(clientSocket).pipe(stream).on('close', () => {
- conn.end();
- });
- } else {
- conn.end();
- }
- });
- }).on('error', (err) => {
- deny();
- }).connect(sshConfig);
-}).listen(1080, 'localhost', () => {
- console.log('SOCKSv5 proxy server started on port 1080');
-}).useAuth(socks.auth.None());
-
-// test with cURL:
-// curl -i --socks5 localhost:1080 google.com
-```
-
-### Make HTTP(S) connections easily using a custom http(s).Agent
-
-```js
-const http = require('http');
-
-const { Client, HTTPAgent, HTTPSAgent } = require('ssh2');
-
-const sshConfig = {
- host: '192.168.100.1',
- port: 22,
- username: 'nodejs',
- password: 'rules'
-};
-
-// Use `HTTPSAgent` instead for an HTTPS request
-const agent = new HTTPAgent(sshConfig);
-http.get({
- host: '192.168.200.1',
- agent,
- headers: { Connection: 'close' }
-}, (res) => {
- console.log(res.statusCode);
- console.dir(res.headers);
- res.resume();
-});
-```
-
-
-### Invoke an arbitrary subsystem
-
-```js
-const { Client } = require('ssh2');
-
-const xmlhello = `
-
-
-
- urn:ietf:params:netconf:base:1.0
-
- ]]>]]>`;
-
-const conn = new Client();
-
-conn.on('ready', () => {
- console.log('Client :: ready');
- conn.subsys('netconf', (err, stream) => {
- if (err) throw err;
- stream.on('data', (data) => {
- console.log(data);
- }).write(xmlhello);
- });
-}).connect({
- host: '1.2.3.4',
- port: 22,
- username: 'blargh',
- password: 'honk'
-});
-```
-
-## Server Examples
-
-### Password and public key authentication and non-interactive (exec) command execution
-
-```js
-const { timingSafeEqual } = require('crypto');
-const { readFileSync } = require('fs');
-const { inspect } = require('util');
-
-const { utils: { parseKey }, Server } = require('ssh2');
-
-const allowedUser = Buffer.from('foo');
-const allowedPassword = Buffer.from('bar');
-const allowedPubKey = parseKey(readFileSync('foo.pub'));
-
-function checkValue(input, allowed) {
- const autoReject = (input.length !== allowed.length);
- if (autoReject) {
- // Prevent leaking length information by always making a comparison with the
- // same input when lengths don't match what we expect ...
- allowed = input;
- }
- const isMatch = timingSafeEqual(input, allowed);
- return (!autoReject && isMatch);
-}
-
-new Server({
- hostKeys: [readFileSync('host.key')]
-}, (client) => {
- console.log('Client connected!');
-
- client.on('authentication', (ctx) => {
- let allowed = true;
- if (!checkValue(Buffer.from(ctx.username), allowedUser))
- allowed = false;
-
- switch (ctx.method) {
- case 'password':
- if (!checkValue(Buffer.from(ctx.password), allowedPassword))
- return ctx.reject();
- break;
- case 'publickey':
- if (ctx.key.algo !== allowedPubKey.type
- || !checkValue(ctx.key.data, allowedPubKey.getPublicSSH())
- || (ctx.signature && allowedPubKey.verify(ctx.blob, ctx.signature, ctx.hashAlgo) !== true)) {
- return ctx.reject();
- }
- break;
- default:
- return ctx.reject();
- }
-
- if (allowed)
- ctx.accept();
- else
- ctx.reject();
- }).on('ready', () => {
- console.log('Client authenticated!');
-
- client.on('session', (accept, reject) => {
- const session = accept();
- session.once('exec', (accept, reject, info) => {
- console.log('Client wants to execute: ' + inspect(info.command));
- const stream = accept();
- stream.stderr.write('Oh no, the dreaded errors!\n');
- stream.write('Just kidding about the errors!\n');
- stream.exit(0);
- stream.end();
- });
- });
- }).on('close', () => {
- console.log('Client disconnected');
- });
-}).listen(0, '127.0.0.1', function() {
- console.log('Listening on port ' + this.address().port);
-});
-```
-
-### SFTP-only server
-
-```js
-const { timingSafeEqual } = require('crypto');
-const { readFileSync } = require('fs');
-const { inspect } = require('util');
-
-const {
- Server,
- sftp: {
- OPEN_MODE,
- STATUS_CODE,
- },
-} = require('ssh2');
-
-const allowedUser = Buffer.from('foo');
-const allowedPassword = Buffer.from('bar');
-
-function checkValue(input, allowed) {
- const autoReject = (input.length !== allowed.length);
- if (autoReject) {
- // Prevent leaking length information by always making a comparison with the
- // same input when lengths don't match what we expect ...
- allowed = input;
- }
- const isMatch = timingSafeEqual(input, allowed);
- return (!autoReject && isMatch);
-}
-
-// This simple SFTP server implements file uploading where the contents get
-// ignored ...
-
-new ssh2.Server({
- hostKeys: [readFileSync('host.key')]
-}, (client) => {
- console.log('Client connected!');
-
- client.on('authentication', (ctx) => {
- let allowed = true;
- if (!checkValue(Buffer.from(ctx.username), allowedUser))
- allowed = false;
-
- switch (ctx.method) {
- case 'password':
- if (!checkValue(Buffer.from(ctx.password), allowedPassword))
- return ctx.reject();
- break;
- default:
- return ctx.reject();
- }
-
- if (allowed)
- ctx.accept();
- else
- ctx.reject();
- }).on('ready', () => {
- console.log('Client authenticated!');
-
- client.on('session', (accept, reject) => {
- const session = accept();
- session.on('sftp', (accept, reject) => {
- console.log('Client SFTP session');
- const openFiles = new Map();
- let handleCount = 0;
- const sftp = accept();
- sftp.on('OPEN', (reqid, filename, flags, attrs) => {
- // Only allow opening /tmp/foo.txt for writing
- if (filename !== '/tmp/foo.txt' || !(flags & OPEN_MODE.WRITE))
- return sftp.status(reqid, STATUS_CODE.FAILURE);
-
- // Create a fake handle to return to the client, this could easily
- // be a real file descriptor number for example if actually opening
- // a file on disk
- const handle = Buffer.alloc(4);
- openFiles.set(handleCount, true);
- handle.writeUInt32BE(handleCount++, 0);
-
- console.log('Opening file for write')
- sftp.handle(reqid, handle);
- }).on('WRITE', (reqid, handle, offset, data) => {
- if (handle.length !== 4
- || !openFiles.has(handle.readUInt32BE(0))) {
- return sftp.status(reqid, STATUS_CODE.FAILURE);
- }
-
- // Fake the write operation
- sftp.status(reqid, STATUS_CODE.OK);
-
- console.log('Write to file at offset ${offset}: ${inspect(data)}');
- }).on('CLOSE', (reqid, handle) => {
- let fnum;
- if (handle.length !== 4
- || !openFiles.has(fnum = handle.readUInt32BE(0))) {
- return sftp.status(reqid, STATUS_CODE.FAILURE);
- }
-
- console.log('Closing file');
- openFiles.delete(fnum);
-
- sftp.status(reqid, STATUS_CODE.OK);
- });
- });
- });
- }).on('close', () => {
- console.log('Client disconnected');
- });
-}).listen(0, '127.0.0.1', function() {
- console.log('Listening on port ' + this.address().port);
-});
-```
-
-## Other Examples
-
-### Generate an SSH key
-
-```js
-const { utils: { generateKeyPair, generateKeyPairSync } } = require('ssh2');
-
-// Generate unencrypted ED25519 SSH key synchronously
-let keys = generateKeyPairSync('ed25519');
-// ... use `keys.public` and `keys.private`
-
-// Generate unencrypted ECDSA SSH key synchronously with a comment set
-keys = generateKeyPairSync('ecdsa', { bits: 256, comment: 'node.js rules!' });
-// ... use `keys.public` and `keys.private`
-
-// Generate encrypted RSA SSH key asynchronously
-generateKeyPair(
- 'rsa',
- { bits: 2048, passphrase: 'foobarbaz', cipher: 'aes256-cbc' },
- (err, keys) => {
- if (err) throw err;
- // ... use `keys.public` and `keys.private`
- }
-);
-```
-
-You can find more examples in the `examples` directory of this repository.
-
-## API
-
-`require('ssh2').Client` is the **_Client_** constructor.
-
-`require('ssh2').Server` is the **_Server_** constructor.
-
-`require('ssh2').utils` is an object containing some useful [utilities](#utilities).
-
-`require('ssh2').HTTPAgent` is an [`http.Agent`](https://nodejs.org/docs/latest/api/http.html#http_class_http_agent) constructor.
-
-`require('ssh2').HTTPSAgent` is an [`https.Agent`](https://nodejs.org/docs/latest/api/https.html#https_class_https_agent) constructor. Its API is the same as `HTTPAgent` except it's for HTTPS connections.
-
-### Agent-related
-
-`require('ssh2').AgentProtocol` is a Duplex stream [class](#agentprotocol) that aids in communicating over the OpenSSH agent protocol.
-
-`require('ssh2').BaseAgent` is a base [class](#baseagent) for creating custom authentication agents.
-
-`require('ssh2').createAgent` is a helper [function](#createagent) that creates a new agent instance using the same logic as the `agent` configuration option: if the platform is Windows and it's the value "pageant", it creates a `PageantAgent`, otherwise if it's not a path to a Windows pipe it creates a `CygwinAgent`. In all other cases, it creates an `OpenSSHAgent`.
-
-`require('ssh2').CygwinAgent` is an agent [class](#cygwinagent) implementation that communicates with agents in a Cygwin environment.
-
-`require('ssh2').OpenSSHAgent` is an agent [class](#opensshagent) implementation that communicates with OpenSSH agents over a UNIX socket.
-
-`require('ssh2').PageantAgent` is an agent [class](#pageantagent) implementation that communicates with Pageant agent processes.
-
-### Client
-
-#### Client events
-
-* **banner**(< _string_ >message, < _string_ >language) - A notice was sent by the server upon connection.
-
-* **change password**(< _string_ >prompt, < _function_ >done) - If using password-based user authentication, the server has requested that the user's password be changed. Call `done` with the new password.
-
-* **close**() - The socket was closed.
-
-* **end**() - The socket was disconnected.
-
-* **error**(< _Error_ >err) - An error occurred. A 'level' property indicates 'client-socket' for socket-level errors and 'client-ssh' for SSH disconnection messages. In the case of 'client-ssh' messages, there may be a 'description' property that provides more detail.
-
-* **handshake**(< _object_ >negotiated) - Emitted when a handshake has completed (either initial or rekey). `negotiated` contains the negotiated details of the handshake and is of the form:
-
-```js
- // In this particular case `mac` is empty because there is no separate MAC
- // because it's integrated into AES in GCM mode
- { kex: 'ecdh-sha2-nistp256',
- srvHostKey: 'rsa-sha2-512',
- cs: { // Client to server algorithms
- cipher: 'aes128-gcm',
- mac: '',
- compress: 'none',
- lang: ''
- },
- sc: { // Server to client algorithms
- cipher: 'aes128-gcm',
- mac: '',
- compress: 'none',
- lang: ''
- }
- }
-```
-
-* **hostkeys**(< _array_ >keys) - Emitted when the server announces its available host keys. `keys` is the list of parsed (using [`parseKey()`](#utilities)) host public keys.
-
-* **keyboard-interactive**(< _string_ >name, < _string_ >instructions, < _string_ >instructionsLang, < _array_ >prompts, < _function_ >finish) - The server is asking for replies to the given `prompts` for keyboard-interactive user authentication. `name` is generally what you'd use as a window title (for GUI apps). `prompts` is an array of `{ prompt: 'Password: ', echo: false }` style objects (here `echo` indicates whether user input should be displayed on the screen). The answers for all prompts must be provided as an array of strings and passed to `finish` when you are ready to continue. Note: It's possible for the server to come back and ask more questions.
-
-* **ready**() - Authentication was successful.
-
-* **rekey**() - Emitted when a rekeying operation has completed (either client or server-initiated).
-
-* **tcp connection**(< _object_ >details, < _function_ >accept, < _function_ >reject) - An incoming forwarded TCP connection is being requested. Calling `accept` accepts the connection and returns a `Channel` object. Calling `reject` rejects the connection and no further action is needed. `details` contains:
-
- * **destIP** - _string_ - The remote IP the connection was received on (given in earlier call to `forwardIn()`).
-
- * **destPort** - _integer_ - The remote port the connection was received on (given in earlier call to `forwardIn()`).
-
- * **srcIP** - _string_ - The originating IP of the connection.
-
- * **srcPort** - _integer_ - The originating port of the connection.
-
-* **unix connection**(< _object_ >details, < _function_ >accept, < _function_ >reject) - An incoming forwarded UNIX socket connection is being requested. Calling `accept` accepts the connection and returns a `Channel` object. Calling `reject` rejects the connection and no further action is needed. `details` contains:
-
- * **socketPath** - _string_ - The originating UNIX socket path of the connection.
-
-* **x11**(< _object_ >details, < _function_ >accept, < _function_ >reject) - An incoming X11 connection is being requested. Calling `accept` accepts the connection and returns a `Channel` object. Calling `reject` rejects the connection and no further action is needed. `details` contains:
-
- * **srcIP** - _string_ - The originating IP of the connection.
-
- * **srcPort** - _integer_ - The originating port of the connection.
-
-#### Client methods
-
-* **(constructor)**() - Creates and returns a new Client instance.
-
-* **connect**(< _object_ >config) - _(void)_ - Attempts a connection to a server using the information given in `config`:
-
- * **agent** - _string_ - Path to ssh-agent's UNIX socket for ssh-agent-based user authentication. **Windows users: set to 'pageant' for authenticating with Pageant or (actual) path to a cygwin "UNIX socket."** **Default:** (none)
-
- * **agentForward** - _boolean_ - Set to `true` to use OpenSSH agent forwarding (`auth-agent@openssh.com`) for the life of the connection. `agent` must also be set to use this feature. **Default:** `false`
-
- * **algorithms** - _object_ - This option allows you to explicitly override the default transport layer algorithms used for the connection. The value for each category must either be an array of valid algorithm names to set an exact list (with the most preferable first) or an object containing `append`, `prepend`, and/or `remove` properties that each contain an _array_ of algorithm names or RegExps to match to adjust default lists for each category. Valid keys:
-
- * **cipher** - _mixed_ - Ciphers.
- * Default list (in order from most to least preferable):
- * `chacha20-poly1305@openssh.com` (priority of chacha20-poly1305 may vary depending upon CPU and/or optional binding availability)
- * `aes128-gcm`
- * `aes128-gcm@openssh.com`
- * `aes256-gcm`
- * `aes256-gcm@openssh.com`
- * `aes128-ctr`
- * `aes192-ctr`
- * `aes256-ctr`
- * Other supported names:
- * `3des-cbc`
- * `aes256-cbc`
- * `aes192-cbc`
- * `aes128-cbc`
- * `arcfour256`
- * `arcfour128`
- * `arcfour`
- * `blowfish-cbc`
- * `cast128-cbc`
-
- * **compress** - _mixed_ - Compression algorithms.
- * Default list (in order from most to least preferable):
- * `none`
- * `zlib@openssh.com`
- * `zlib`
- * Other supported names:
-
- * **hmac** - _mixed_ - (H)MAC algorithms.
- * Default list (in order from most to least preferable):
- * `hmac-sha2-256-etm@openssh.com`
- * `hmac-sha2-512-etm@openssh.com`
- * `hmac-sha1-etm@openssh.com`
- * `hmac-sha2-256`
- * `hmac-sha2-512`
- * `hmac-sha1`
- * Other supported names:
- * `hmac-md5`
- * `hmac-sha2-256-96`
- * `hmac-sha2-512-96`
- * `hmac-ripemd160`
- * `hmac-sha1-96`
- * `hmac-md5-96`
-
- * **kex** - _mixed_ - Key exchange algorithms.
- * Default list (in order from most to least preferable):
- * `curve25519-sha256` (node v14.0.0+)
- * `curve25519-sha256@libssh.org` (node v14.0.0+)
- * `ecdh-sha2-nistp256`
- * `ecdh-sha2-nistp384`
- * `ecdh-sha2-nistp521`
- * `diffie-hellman-group-exchange-sha256`
- * `diffie-hellman-group14-sha256`
- * `diffie-hellman-group15-sha512`
- * `diffie-hellman-group16-sha512`
- * `diffie-hellman-group17-sha512`
- * `diffie-hellman-group18-sha512`
- * Other supported names:
- * `diffie-hellman-group-exchange-sha1`
- * `diffie-hellman-group14-sha1`
- * `diffie-hellman-group1-sha1`
-
- * **serverHostKey** - _mixed_ - Server host key formats.
- * Default list (in order from most to least preferable):
- * `ssh-ed25519` (node v12.0.0+)
- * `ecdsa-sha2-nistp256`
- * `ecdsa-sha2-nistp384`
- * `ecdsa-sha2-nistp521`
- * `rsa-sha2-512`
- * `rsa-sha2-256`
- * `ssh-rsa`
- * Other supported names:
- * `ssh-dss`
-
- * **authHandler** - _mixed_ - Must be an array of objects as described below, an array of strings containing valid authentication method names (username and credentials are pulled from the object passed to `connect()`), or a function with parameters `(methodsLeft, partialSuccess, callback)` where `methodsLeft` and `partialSuccess` are `null` on the first authentication attempt, otherwise are an array and boolean respectively. Return or call `callback()` with either the name of the authentication method or an object containing the method name along with method-specific details to try next (return/pass `false` to signal no more methods to try). Valid method names are: `'none', 'password', 'publickey', 'agent', 'keyboard-interactive', 'hostbased'`. **Default:** function that follows a set method order: None -> Password -> Private Key -> Agent (-> keyboard-interactive if `tryKeyboard` is `true`) -> Hostbased
-
- * When returning or calling `callback()` with an object, it can take one of the following forms:
-
- ```js
- {
- type: 'none',
- username: 'foo',
- }
- ```
-
- ```js
- {
- type: 'password'
- username: 'foo',
- password: 'bar',
- }
- ```
-
- ```js
- {
- type: 'publickey'
- username: 'foo',
- // Can be a string, Buffer, or parsed key containing a private key
- key: ...,
- // `passphrase` only required for encrypted keys
- passphrase: ...,
- }
- ```
-
- ```js
- {
- type: 'hostbased'
- username: 'foo',
- localHostname: 'baz',
- localUsername: 'quux',
- // Can be a string, Buffer, or parsed key containing a private key
- key: ...,
- // `passphrase` only required for encrypted keys
- passphrase: ...,
- }
- ```
-
- ```js
- {
- type: 'agent'
- username: 'foo',
- // Can be a string that is interpreted exactly like the `agent`
- // connection config option or can be a custom agent
- // object/instance that extends and implements `BaseAgent`
- agent: ...,
- }
- ```
-
- ```js
- {
- type: 'keyboard-interactive'
- username: 'foo',
- // This works exactly the same way as a 'keyboard-interactive'
- // Client event handler
- prompt: (name, instructions, instructionsLang, prompts, finish) => {
- // ...
- },
- }
- ```
-
- * **debug** - _function_ - Set this to a function that receives a single string argument to get detailed (local) debug information. **Default:** (none)
-
- * **forceIPv4** - _boolean_ - Only connect via resolved IPv4 address for `host`. **Default:** `false`
-
- * **forceIPv6** - _boolean_ - Only connect via resolved IPv6 address for `host`. **Default:** `false`
-
- * **host** - _string_ - Hostname or IP address of the server. **Default:** `'localhost'`
-
- * **hostHash** - _string_ - Any valid hash algorithm supported by node. The host's key is hashed using this algorithm and passed to the **hostVerifier** function as a hex string. **Default:** (none)
-
- * **hostVerifier** - _function_ - Function with parameters `(key[, callback])` for verifying host keys, where `key` is either a hex _string_ of the hash of the key if `hostHash` was set, otherwise it is the raw host key in _Buffer_ form. Use `utils.parseKey()` to get the host key type. Return `true` to continue with the handshake or `false` to reject and disconnect, or call `callback()` with `true` or `false` if you need to perform asynchronous verification. **Default:** (auto-accept if `hostVerifier` is not set)
-
- * **keepaliveCountMax** - _integer_ - How many consecutive, unanswered SSH-level keepalive packets that can be sent to the server before disconnection (similar to OpenSSH's ServerAliveCountMax config option). **Default:** `3`
-
- * **keepaliveInterval** - _integer_ - How often (in milliseconds) to send SSH-level keepalive packets to the server (in a similar way as OpenSSH's ServerAliveInterval config option). Set to 0 to disable. **Default:** `0`
-
- * **localAddress** - _string_ - IP address of the network interface to use to connect to the server. **Default:** (none -- determined by OS)
-
- * **localHostname** - _string_ - Along with **localUsername** and **privateKey**, set this to a non-empty string for hostbased user authentication. **Default:** (none)
-
- * **localPort** - _string_ - The local port number to connect from. **Default:** (none -- determined by OS)
-
- * **localUsername** - _string_ - Along with **localHostname** and **privateKey**, set this to a non-empty string for hostbased user authentication. **Default:** (none)
-
- * **passphrase** - _string_ - For an encrypted `privateKey`, this is the passphrase used to decrypt it. **Default:** (none)
-
- * **password** - _string_ - Password for password-based user authentication. **Default:** (none)
-
- * **port** - _integer_ - Port number of the server. **Default:** `22`
-
- * **privateKey** - _mixed_ - _Buffer_ or _string_ that contains a private key for either key-based or hostbased user authentication (OpenSSH format). **Default:** (none)
-
- * **readyTimeout** - _integer_ - How long (in milliseconds) to wait for the SSH handshake to complete. **Default:** `20000`
-
- * **sock** - _ReadableStream_ - A _ReadableStream_ to use for communicating with the server instead of creating and using a new TCP connection (useful for connection hopping).
-
- * **strictVendor** - _boolean_ - Performs a strict server vendor check before sending vendor-specific requests, etc. (e.g. check for OpenSSH server when using `openssh_noMoreSessions()`) **Default:** `true`
-
- * **tryKeyboard** - _boolean_ - Try keyboard-interactive user authentication if primary user authentication method fails. If you set this to `true`, you need to handle the `keyboard-interactive` event. **Default:** `false`
-
- * **username** - _string_ - Username for authentication. **Default:** (none)
-
-* **end**() - _(void)_ - Disconnects the socket.
-
-* **exec**(< _string_ >command[, < _object_ >options], < _function_ >callback) - _(void)_ - Executes `command` on the server. `callback` has 2 parameters: < _Error_ >err, < _Channel_ >stream. Valid `options` properties are:
-
- * **env** - _object_ - An environment to use for the execution of the command.
-
- * **pty** - _mixed_ - Set to `true` to allocate a pseudo-tty with defaults, or an object containing specific pseudo-tty settings (see 'Pseudo-TTY settings'). Setting up a pseudo-tty can be useful when working with remote processes that expect input from an actual terminal (e.g. sudo's password prompt).
-
- * **x11** - _mixed_ - Set to `true` to use defaults below, set to a number to specify a specific screen number, or an object with the following valid properties:
-
- * **cookie** - _mixed_ - The authentication cookie. Can be a hex _string_ or a _Buffer_ containing the raw cookie value (which will be converted to a hex string). **Default:** (random 16 byte value)
-
- * **protocol** - _string_ - The authentication protocol name. **Default:** `'MIT-MAGIC-COOKIE-1'`
-
- * **screen** - _number_ - Screen number to use **Default:** `0`
-
- * **single** - _boolean_ - Allow just a single connection? **Default:** `false`
-
-* **forwardIn**(< _string_ >remoteAddr, < _integer_ >remotePort, < _function_ >callback) - _(void)_ - Bind to `remoteAddr` on `remotePort` on the server and forward incoming TCP connections. `callback` has 2 parameters: < _Error_ >err, < _integer_ >port (`port` is the assigned port number if `remotePort` was 0). Here are some special values for `remoteAddr` and their associated binding behaviors:
-
- * '' - Connections are to be accepted on all protocol families supported by the server.
-
- * '0.0.0.0' - Listen on all IPv4 addresses.
-
- * '::' - Listen on all IPv6 addresses.
-
- * 'localhost' - Listen on all protocol families supported by the server on loopback addresses only.
-
- * '127.0.0.1' and '::1' - Listen on the loopback interfaces for IPv4 and IPv6, respectively.
-
-* **forwardOut**(< _string_ >srcIP, < _integer_ >srcPort, < _string_ >dstIP, < _integer_ >dstPort, < _function_ >callback) - _(void)_ - Open a connection with `srcIP` and `srcPort` as the originating address and port and `dstIP` and `dstPort` as the remote destination address and port. `callback` has 2 parameters: < _Error_ >err, < _Channel_ >stream.
-
-* **openssh_forwardInStreamLocal**(< _string_ >socketPath, < _function_ >callback) - _(void)_ - OpenSSH extension that binds to a UNIX domain socket at `socketPath` on the server and forwards incoming connections. `callback` has 1 parameter: < _Error_ >err.
-
-* **openssh_forwardOutStreamLocal**(< _string_ >socketPath, < _function_ >callback) - _(void)_ - OpenSSH extension that opens a connection to a UNIX domain socket at `socketPath` on the server. `callback` has 2 parameters: < _Error_ >err, < _Channel_ >stream.
-
-* **openssh_noMoreSessions**(< _function_ >callback) - _(void)_ - OpenSSH extension that sends a request to reject any new sessions (e.g. exec, shell, sftp, subsys) for this connection. `callback` has 1 parameter: < _Error_ >err.
-
-* **openssh_unforwardInStreamLocal**(< _string_ >socketPath, < _function_ >callback) - _(void)_ - OpenSSH extension that unbinds from a UNIX domain socket at `socketPath` on the server and stops forwarding incoming connections. `callback` has 1 parameter: < _Error_ >err.
-
-* **rekey**([< _function_ >callback]) - _(void)_ - Initiates a rekey with the server. If `callback` is supplied, it is added as a one-time handler for the `rekey` event.
-
-* **setNoDelay**([< _boolean_ >noDelay]) - _Client_ - Calls [`setNoDelay()`](https://nodejs.org/docs/latest/api/net.html#socketsetnodelaynodelay) on the underlying socket. Disabling Nagle's algorithm improves latency at the expense of lower throughput.
-
-* **sftp**(< _function_ >callback) - _(void)_ - Starts an SFTP session. `callback` has 2 parameters: < _Error_ >err, < _SFTP_ >sftp. For methods available on `sftp`, see the [`SFTP` client documentation](https://github.com/mscdex/ssh2/blob/master/SFTP.md).
-
-* **shell**([[< _mixed_ >window,] < _object_ >options]< _function_ >callback) - _(void)_ - Starts an interactive shell session on the server, with an optional `window` object containing pseudo-tty settings (see 'Pseudo-TTY settings'). If `window === false`, then no pseudo-tty is allocated. `options` supports the `x11` and `env` options as described in `exec()`. `callback` has 2 parameters: < _Error_ >err, < _Channel_ >stream.
-
-* **subsys**(< _string_ >subsystem, < _function_ >callback) - _(void)_ - Invokes `subsystem` on the server. `callback` has 2 parameters: < _Error_ >err, < _Channel_ >stream.
-
-* **unforwardIn**(< _string_ >remoteAddr, < _integer_ >remotePort, < _function_ >callback) - _(void)_ - Unbind from `remoteAddr` on `remotePort` on the server and stop forwarding incoming TCP connections. Until `callback` is called, more connections may still come in. `callback` has 1 parameter: < _Error_ >err.
-
-### Server
-
-#### Server events
-
-* **connection**(< _Connection_ >client, < _object_ >info) - A new client has connected. `info` contains the following properties:
-
- * **family** - _string_ - The `remoteFamily` of the connection.
-
- * **header** - _object_ - Information about the client's header:
-
- * **identRaw** - _string_ - The raw client identification string.
-
- * **versions** - _object_ - Various version information:
-
- * **protocol** - _string_ - The SSH protocol version (always `1.99` or `2.0`).
-
- * **software** - _string_ - The software name and version of the client.
-
- * **comments** - _string_ - Any text that comes after the software name/version.
-
- Example: the identification string `SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2` would be parsed as:
-
- ```js
- {
- identRaw: 'SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2',
- version: {
- protocol: '2.0',
- software: 'OpenSSH_6.6.1p1'
- },
- comments: 'Ubuntu-2ubuntu2'
- }
- ```
-
- * **ip** - _string_ - The `remoteAddress` of the connection.
-
- * **port** - _integer_ - The `remotePort` of the connection.
-
-#### Server methods
-
-* **(constructor)**(< _object_ >config[, < _function_ >connectionListener]) - Creates and returns a new Server instance. Server instances also have the same methods/properties/events as [`net.Server`](http://nodejs.org/docs/latest/api/net.html#net_class_net_server). `connectionListener` if supplied, is added as a `connection` listener. Valid `config` properties:
-
- * **algorithms** - _object_ - This option allows you to explicitly override the default transport layer algorithms used for incoming client connections. Each value must be an array of valid algorithms for that category. The order of the algorithms in the arrays are important, with the most favorable being first. For a list of valid and default algorithm names, please review the documentation for the version of `ssh2` used by this module. Valid keys:
-
- * **cipher** - _array_ - Ciphers.
-
- * **compress** - _array_ - Compression algorithms.
-
- * **hmac** - _array_ - (H)MAC algorithms.
-
- * **kex** - _array_ - Key exchange algorithms.
-
- * **serverHostKey** - _array_ - Server host key formats.
-
- * **banner** - _string_ - A message that is sent to clients once, right before authentication begins. **Default:** (none)
-
- * **debug** - _function_ - Set this to a function that receives a single string argument to get detailed (local) debug information. **Default:** (none)
-
- * **greeting** - _string_ - A message that is sent to clients immediately upon connection, before handshaking begins. **Note:** Most clients usually ignore this. **Default:** (none)
-
- * **highWaterMark** - _integer_ - This is the `highWaterMark` to use for the parser stream. **Default:** `32 * 1024`
-
- * **hostKeys** - _array_ - An array of either Buffers/strings that contain host private keys or objects in the format of `{ key: , passphrase: }` for encrypted private keys. (**Required**) **Default:** (none)
-
- * **ident** - _string_ - A custom server software name/version identifier. **Default:** `'ssh2js' + moduleVersion + 'srv'`
-
-* **injectSocket**(< _DuplexStream_ >socket) - Injects a bidirectional stream as though it were a TCP socket connection. Additionally, `socket` should include `net.Socket`-like properties to ensure the best compatibility (e.g. `socket.remoteAddress`, `socket.remotePort`, `socket.remoteFamily`).
-
-#### Connection events
-
-* **authentication**(< _AuthContext_ >ctx) - The client has requested authentication. `ctx.username` contains the client username, `ctx.method` contains the requested authentication method, and `ctx.accept()` and `ctx.reject([< Array >authMethodsLeft[, < Boolean >isPartialSuccess]])` are used to accept or reject the authentication request respectively. `'abort'` is emitted if the client aborts the authentication request. Other properties/methods available on `ctx` depends on the `ctx.method` of authentication the client has requested:
-
- * `hostbased`:
-
- * **blob** - _Buffer_ - This contains the data to be verified that is passed to (along with the signature) `key.verify()` where `key` is a public key parsed with [`parseKey()`](#utilities).
-
- * **key** - _object_ - Contains information about the public key sent by the client:
-
- * **algo** - _string_ - The name of the key algorithm (e.g. `ssh-rsa`).
-
- * **data** - _Buffer_ - The actual key data.
-
- * **localHostname** - _string_ - The local hostname provided by the client.
-
- * **localUsername** - _string_ - The local username provided by the client.
-
- * **signature** - _Buffer_ - This contains a signature to be verified that is passed to (along with the blob) `key.verify()` where `key` is a public key parsed with [`parseKey()`](#utilities).
-
- * **hashAlgo** - _mixed_ - This is either `undefined` or a _string_ containing an explicit hash algorithm to be used during verification (passed to `key.verify()`).
-
- * `keyboard-interactive`:
-
- * **prompt**(< _array_ >prompts[, < _string_ >title[, < _string_ >instructions]], < _function_ >callback) - _(void)_ - Send prompts to the client. `prompts` is an array of `{ prompt: 'Prompt text', echo: true }` objects (`prompt` being the prompt text and `echo` indicating whether the client's response to the prompt should be echoed to their display). `callback` is called with `(responses)`, where `responses` is an array of string responses matching up to the `prompts`.
-
- * **submethods** - _array_ - A list of preferred authentication "sub-methods" sent by the client. This may be used to determine what (if any) prompts to send to the client.
-
- * `password`:
-
- * **password** - _string_ - This is the password sent by the client.
-
- * **requestChange**(< _string_ >prompt, < _function_ >callback) - _(void)_ - Sends a password change request to the client. `callback` is called with `(newPassword)`, where `newPassword` is the new password supplied by the client. You may accept, reject, or prompt for another password change after `callback` is called.
-
- * `publickey`:
-
- * **blob** - _mixed_ - If the value is `undefined`, the client is only checking the validity of the `key`. If the value is a _Buffer_, then this contains the data to be verified that is passed to (along with the signature) `key.verify()` where `key` is a public key parsed with [`parseKey()`](#utilities).
-
- * **key** - _object_ - Contains information about the public key sent by the client:
-
- * **algo** - _string_ - The name of the key algorithm (e.g. `ssh-rsa`).
-
- * **data** - _Buffer_ - The actual key data.
-
- * **signature** - _mixed_ - If the value is `undefined`, the client is only checking the validity of the `key`. If the value is a _Buffer_, then this contains a signature to be verified that is passed to (along with the blob) `key.verify()` where `key` is a public key parsed with [`parseKey()`](#utilities).
-
- * **hashAlgo** - _mixed_ - This is either `undefined` or a _string_ containing an explicit hash algorithm to be used during verification (passed to `key.verify()`).
-
-* **close**() - The client socket was closed.
-
-* **end**() - The client socket disconnected.
-
-* **error**(< _Error_ >err) - An error occurred.
-
-* **handshake**(< _object_ >negotiated) - Emitted when a handshake has completed (either initial or rekey). `negotiated` contains the negotiated details of the handshake and is of the form:
-
-```js
- // In this particular case `mac` is empty because there is no separate MAC
- // because it's integrated into AES in GCM mode
- { kex: 'ecdh-sha2-nistp256',
- srvHostKey: 'rsa-sha2-512',
- cs: { // Client to server algorithms
- cipher: 'aes128-gcm',
- mac: '',
- compress: 'none',
- lang: ''
- },
- sc: { // Server to client algorithms
- cipher: 'aes128-gcm',
- mac: '',
- compress: 'none',
- lang: ''
- }
- }
-```
-
-* **openssh.streamlocal**(< _function_ >accept, < _function_ >reject, < _object_ >info) - Emitted when the client has requested a connection to a UNIX domain socket. `accept()` returns a new _Channel_ instance representing the connection. `info` contains:
-
- * **socketPath** - _string_ - Destination socket path of outgoing connection.
-
-* **ready**() - Emitted when the client has been successfully authenticated.
-
-* **rekey**() - Emitted when a rekeying operation has completed (either client or server-initiated).
-
-* **request**(< _mixed_ >accept, < _mixed_ >reject, < _string_ >name, < _object_ >info) - Emitted when the client has sent a global request for `name` (e.g. `tcpip-forward` or `cancel-tcpip-forward`). `accept` and `reject` are functions if the client requested a response. If `bindPort === 0`, you should pass the chosen port to `accept()` so that the client will know what port was bound. `info` contains additional details about the request:
-
- * `cancel-tcpip-forward` and `tcpip-forward`:
-
- * **bindAddr** - _string_ - The IP address to start/stop binding to.
-
- * **bindPort** - _integer_ - The port to start/stop binding to.
-
- * `cancel-streamlocal-forward@openssh.com` and `streamlocal-forward@openssh.com`:
-
- * **socketPath** - _string_ - The socket path to start/stop binding to.
-
-* **session**(< _function_ >accept, < _function_ >reject) - Emitted when the client has requested a new session. Sessions are used to start interactive shells, execute commands, request X11 forwarding, etc. `accept()` returns a new _Session_ instance.
-
-* **tcpip**(< _function_ >accept, < _function_ >reject, < _object_ >info) - Emitted when the client has requested an outbound (TCP) connection. `accept()` returns a new _Channel_ instance representing the connection. `info` contains:
-
- * **destIP** - _string_ - Destination IP address of outgoing connection.
-
- * **destPort** - _string_ - Destination port of outgoing connection.
-
- * **srcIP** - _string_ - Source IP address of outgoing connection.
-
- * **srcPort** - _string_ - Source port of outgoing connection.
-
-#### Connection methods
-
-* **end**() - _(void)_ - Closes the client connection.
-
-* **forwardOut**(< _string_ >boundAddr, < _integer_ >boundPort, < _string_ >remoteAddr, < _integer_ >remotePort, < _function_ >callback) - _(void)_ - Alert the client of an incoming TCP connection on `boundAddr` on port `boundPort` from `remoteAddr` on port `remotePort`. `callback` has 2 parameters: < _Error_ >err, < _Channel_ >stream.
-
-* **openssh_forwardOutStreamLocal**(< _string_ >socketPath, < _function_ >callback) - _(void)_ - Alert the client of an incoming UNIX domain socket connection on `socketPath`. `callback` has 2 parameters: < _Error_ >err, < _Channel_ >stream.
-
-* **rekey**([< _function_ >callback]) - _(void)_ - Initiates a rekey with the client. If `callback` is supplied, it is added as a one-time handler for the `rekey` event.
-
-* **setNoDelay**([< _boolean_ >noDelay]) - _Connection_ - Calls [`setNoDelay()`](https://nodejs.org/docs/latest/api/net.html#socketsetnodelaynodelay) on the underlying socket. Disabling Nagle's algorithm improves latency at the expense of lower throughput.
-
-* **x11**(< _string_ >originAddr, < _integer_ >originPort, < _function_ >callback) - _(void)_ - Alert the client of an incoming X11 client connection from `originAddr` on port `originPort`. `callback` has 2 parameters: < _Error_ >err, < _Channel_ >stream.
-
-#### Session events
-
-* **auth-agent**(< _mixed_ >accept, < _mixed_ >reject) - The client has requested incoming ssh-agent requests be forwarded to them. `accept` and `reject` are functions if the client requested a response.
-
-* **close**() - The session was closed.
-
-* **env**(< _mixed_ >accept, < _mixed_ >reject, < _object_ >info) - The client requested an environment variable to be set for this session. `accept` and `reject` are functions if the client requested a response. `info` has these properties:
-
- * **key** - _string_ - The environment variable's name.
-
- * **value** - _string_ - The environment variable's value.
-
-* **exec**(< _mixed_ >accept, < _mixed_ >reject, < _object_ >info) - The client has requested execution of a command string. `accept` and `reject` are functions if the client requested a response. `accept()` returns a _Channel_ for the command execution. `info` has these properties:
-
- * **command** - _string_ - The command line to be executed.
-
-* **pty**(< _mixed_ >accept, < _mixed_ >reject, < _object_ >info) - The client requested allocation of a pseudo-TTY for this session. `accept` and `reject` are functions if the client requested a response. `info` has these properties:
-
- * **term** - _string_ - The terminal type for the pseudo-TTY.
-
- * **cols** - _integer_ - The number of columns for the pseudo-TTY.
-
- * **height** - _integer_ - The height of the pseudo-TTY in pixels.
-
- * **modes** - _object_ - Contains the requested terminal modes of the pseudo-TTY keyed on the mode name with the value being the mode argument. (See the table at the end for valid names).
-
- * **rows** - _integer_ - The number of rows for the pseudo-TTY.
-
- * **width** - _integer_ - The width of the pseudo-TTY in pixels.
-
-* **sftp**(< _mixed_ >accept, < _mixed_ >reject) - The client has requested the SFTP subsystem. `accept` and `reject` are functions if the client requested a response. `accept()` returns an _SFTP_ instance in server mode (see the [`SFTP` documentation](https://github.com/mscdex/ssh2/blob/master/SFTP.md) for details). `info` has these properties:
-
-* **shell**(< _mixed_ >accept, < _mixed_ >reject) - The client has requested an interactive shell. `accept` and `reject` are functions if the client requested a response. `accept()` returns a _Channel_ for the interactive shell.
-
-* **signal**(< _mixed_ >accept, < _mixed_ >reject, < _object_ >info) - The client has sent a signal. `accept` and `reject` are functions if the client requested a response. `info` has these properties:
-
- * **name** - _string_ - The signal name (e.g. `SIGUSR1`).
-
-* **subsystem**(< _mixed_ >accept, < _mixed_ >reject, < _object_ >info) - The client has requested an arbitrary subsystem. `accept` and `reject` are functions if the client requested a response. `accept()` returns a _Channel_ for the subsystem. `info` has these properties:
-
- * **name** - _string_ - The name of the subsystem.
-
-* **window-change**(< _mixed_ >accept, < _mixed_ >reject, < _object_ >info) - The client reported a change in window dimensions during this session. `accept` and `reject` are functions if the client requested a response. `info` has these properties:
-
- * **cols** - _integer_ - The new number of columns for the client window.
-
- * **height** - _integer_ - The new height of the client window in pixels.
-
- * **rows** - _integer_ - The new number of rows for the client window.
-
- * **width** - _integer_ - The new width of the client window in pixels.
-
-* **x11**(< _mixed_ >accept, < _mixed_ >reject, < _object_ >info) - The client requested X11 forwarding. `accept` and `reject` are functions if the client requested a response. `info` has these properties:
-
- * **cookie** - _string_ - The X11 authentication cookie encoded in hexadecimal.
-
- * **protocol** - _string_ - The name of the X11 authentication method used (e.g. `MIT-MAGIC-COOKIE-1`).
-
- * **screen** - _integer_ - The screen number to forward X11 connections for.
-
- * **single** - _boolean_ - `true` if only a single connection should be forwarded.
-
-### Channel
-
-This is a normal **streams2** Duplex Stream (used both by clients and servers), with the following changes:
-
-* A boolean property `allowHalfOpen` exists and behaves similarly to the property of the same name for `net.Socket`. When the stream's end() is called, if `allowHalfOpen` is `true`, only EOF will be sent (the server can still send data if they have not already sent EOF). The default value for this property is `true`.
-
-* A `close` event is emitted once the channel is completely closed on both the client and server.
-
-* Client-specific:
-
- * For exec():
-
- * An `exit` event *may* (the SSH2 spec says it is optional) be emitted when the process finishes. If the process finished normally, the process's return value is passed to the `exit` callback. If the process was interrupted by a signal, the following are passed to the `exit` callback: null, < _string_ >signalName, < _boolean_ >didCoreDump, < _string_ >description.
-
- * If there was an `exit` event, the `close` event will be passed the same arguments for convenience.
-
- * A `stderr` property contains a Readable stream that represents output from stderr.
-
- * For exec() and shell():
-
- * The readable side represents stdout and the writable side represents stdin.
-
- * **setWindow**(< _integer_ >rows, < _integer_ >cols, < _integer_ >height, < _integer_ >width) - _(void)_ - Lets the server know that the local terminal window has been resized. The meaning of these arguments are described in the 'Pseudo-TTY settings' section.
-
- * **signal**(< _string_ >signalName) - _(void)_ - Sends a POSIX signal to the current process on the server. Valid signal names are: 'ABRT', 'ALRM', 'FPE', 'HUP', 'ILL', 'INT', 'KILL', 'PIPE', 'QUIT', 'SEGV', 'TERM', 'USR1', and 'USR2'. Some server implementations may ignore this request if they do not support signals. Note: If you are trying to send SIGINT and you find `signal()` doesn't work, try writing `'\x03'` to the Channel stream instead.
-
-
-* Server-specific:
-
- * For exec-enabled channel instances there is an additional method available that may be called right before you close the channel. It has two different signatures:
-
- * **exit**(< _integer_ >exitCode) - _(void)_ - Sends an exit status code to the client.
-
- * **exit**(< _string_ >signalName[, < _boolean_ >coreDumped[, < _string_ >errorMsg]]) - _(void)_ - Sends an exit status code to the client.
-
- * For exec and shell-enabled channel instances, `channel.stderr` is a writable stream.
-
-### Pseudo-TTY settings
-
-* **cols** - < _integer_ > - Number of columns. **Default:** `80`
-
-* **height** - < _integer_ > - Height in pixels. **Default:** `480`
-
-* **modes** - < _object_ > - An object containing [Terminal Modes](#terminal-modes) as keys, with each value set to each mode argument. **Default:** `null`
-
-* **rows** - < _integer_ > - Number of rows. **Default:** `24`
-
-* **term** - < _string_ > - The value to use for $TERM. **Default:** `'vt100'`
-
-* **width** - < _integer_ > - Width in pixels. **Default:** `640`
-
-`rows` and `cols` override `width` and `height` when `rows` and `cols` are non-zero.
-
-Pixel dimensions refer to the drawable area of the window.
-
-Zero dimension parameters are ignored.
-
-### Terminal modes
-
-Name | Description
--------------- | ------------
-CS7 | 7 bit mode.
-CS8 | 8 bit mode.
-ECHOCTL | Echo control characters as ^(Char).
-ECHO | Enable echoing.
-ECHOE | Visually erase chars.
-ECHOKE | Visual erase for line kill.
-ECHOK | Kill character discards current line.
-ECHONL | Echo NL even if ECHO is off.
-ICANON | Canonicalize input lines.
-ICRNL | Map CR to NL on input.
-IEXTEN | Enable extensions.
-IGNCR | Ignore CR on input.
-IGNPAR | The ignore parity flag. The parameter SHOULD be 0 if this flag is FALSE, and 1 if it is TRUE.
-IMAXBEL | Ring bell on input queue full.
-INLCR | Map NL into CR on input.
-INPCK | Enable checking of parity errors.
-ISIG | Enable signals INTR, QUIT, [D]SUSP.
-ISTRIP | Strip 8th bit off characters.
-IUCLC | Translate uppercase characters to lowercase.
-IXANY | Any char will restart after stop.
-IXOFF | Enable input flow control.
-IXON | Enable output flow control.
-NOFLSH | Don't flush after interrupt.
-OCRNL | Translate carriage return to newline (output).
-OLCUC | Convert lowercase to uppercase.
-ONLCR | Map NL to CR-NL.
-ONLRET | Newline performs a carriage return (output).
-ONOCR | Translate newline to carriage return-newline (output).
-OPOST | Enable output processing.
-PARENB | Parity enable.
-PARMRK | Mark parity and framing errors.
-PARODD | Odd parity, else even.
-PENDIN | Retype pending input.
-TOSTOP | Stop background jobs from output.
-TTY_OP_ISPEED | Specifies the input baud rate in bits per second.
-TTY_OP_OSPEED | Specifies the output baud rate in bits per second.
-VDISCARD | Toggles the flushing of terminal output.
-VDSUSP | Another suspend character.
-VEOF | End-of-file character (sends EOF from the terminal).
-VEOL2 | Additional end-of-line character.
-VEOL | End-of-line character in addition to carriage return and/or linefeed.
-VERASE | Erase the character to left of the cursor.
-VFLUSH | Character to flush output.
-VINTR | Interrupt character; 255 if none. Similarly for the other characters. Not all of these characters are supported on all systems.
-VKILL | Kill the current input line.
-VLNEXT | Enter the next character typed literally, even if it is a special character
-VQUIT | The quit character (sends SIGQUIT signal on POSIX systems).
-VREPRINT | Reprints the current input line.
-VSTART | Continues paused output (normally control-Q).
-VSTATUS | Prints system status line (load, command, pid, etc).
-VSTOP | Pauses output (normally control-S).
-VSUSP | Suspends the current program.
-VSWTCH | Switch to a different shell layer.
-VWERASE | Erases a word left of cursor.
-XCASE | Enable input and output of uppercase characters by preceding their lowercase equivalents with "\".
-
-### HTTPAgent
-
-#### HTTPAgent methods
-
-* **(constructor)**(< _object_ >sshConfig[, < _object_ >agentConfig]) - Creates and returns a new `http.Agent` instance used to tunnel an HTTP connection over SSH. `sshConfig` is what is passed to `client.connect()` and `agentOptions` is passed to the `http.Agent` constructor.
-
-### HTTPSAgent
-
-#### HTTPSAgent methods
-
-* **(constructor)**(< _object_ >sshConfig[, < _object_ >agentConfig]) - Creates and returns a new `https.Agent` instance used to tunnel an HTTP connection over SSH. `sshConfig` is what is passed to `client.connect()` and `agentOptions` is passed to the `https.Agent` constructor.
-
-### Utilities
-
-* **generateKeyPair**(< _string_ >keyType[, < _object_ >options], < _function_ >callback) - _(void)_ - Generates an SSH key pair of the given type. `keyType` may be one of `'rsa'`, `'ecdsa'`, or `'ed25519'` (node.js v12+). `callback` has the signature `(err, keys)` where `keys` is an _object_ containing `private` and `public` properties containing the generated SSH keys. `options` may contain:
-
- * **bits** - _integer_ - For ECDSA and RSA keys, this is the key strength. For ECDSA, this is restricted to `256`, `384`, or `521`. **Default:** (none)
-
- * **cipher** - _string_ - The (SSH, not OpenSSL) cipher to use to encrypt the key. **Default:** (none)
-
- * **comment** - _string_ - A comment to include in the private and public keys. **Default:** `''`
-
- * **format** - _string_ - The SSH key format to use. Currently only `'new'` is supported, which represents the current OpenSSH key formats. **Default:** `'new'`
-
- * **passphrase** - _mixed_ - The desired passphrase for encrypting the key. This can either be a string or _Buffer_. **Default:** (none)
-
- * **rounds** - _integer_ - For `'new'`-formatted SSH keys, this is the number of bcrypt rounds to use when generating cipher parameters for encrypted keys. **Default:** `16`
-
-* **generateKeyPairSync**(< _string_ >keyType[, < _object_ >options]) - _object_ - Generates an SSH key pair of the given type. This is a synchronous version of `generateKeyPair()`.
-
-* **parseKey**(< _mixed_ >keyData[, < _string_ >passphrase]) - _mixed_ - Parses a private/public key in OpenSSH, RFC4716, or PPK format. For encrypted private keys, the key will be decrypted with the given `passphrase`. `keyData` can be a _Buffer_ or _string_ value containing the key contents. The returned value will be an array of objects (currently in the case of modern OpenSSH keys) or an object with these properties and methods:
-
- * **comment** - _string_ - The comment for the key
-
- * **equals**(< _mixed_ >otherKey) - _boolean_ - This returns `true` if `otherKey` (a parsed or parseable key) is the same as this key. This method does not compare the keys' comments
-
- * **getPrivatePEM**() - _string_ - This returns the PEM version of a private key
-
- * **getPublicPEM**() - _string_ - This returns the PEM version of a public key (for either public key or derived from a private key)
-
- * **getPublicSSH**() - _string_ - This returns the SSH version of a public key (for either public key or derived from a private key)
-
- * **isPrivateKey**() - _boolean_ - This returns `true` if the key is a private key or not
-
- * **sign**(< _mixed_ >data) - _mixed_ - This signs the given `data` using this key and returns a _Buffer_ containing the signature on success. On failure, an _Error_ will be returned. `data` can be anything accepted by node's [`sign.update()`](https://nodejs.org/docs/latest/api/crypto.html#crypto_sign_update_data_inputencoding).
-
- * **type** - _string_ - The full key type (e.g. `'ssh-rsa'`)
-
- * **verify**(< _mixed_ >data, < _Buffer_ >signature) - _mixed_ - This verifies a `signature` of the given `data` using this key and returns `true` if the signature could be verified. On failure, either `false` will be returned or an _Error_ will be returned upon a more critical failure. `data` can be anything accepted by node's [`verify.update()`](https://nodejs.org/docs/latest/api/crypto.html#crypto_verify_update_data_inputencoding).
-
-* **sftp.OPEN_MODE** - [`OPEN_MODE`](https://github.com/mscdex/ssh2/blob/master/SFTP.md#useful-standalone-data-structures)
-
-* **sftp.STATUS_CODE** - [`STATUS_CODE`](https://github.com/mscdex/ssh2/blob/master/SFTP.md#useful-standalone-data-structures)
-
-* **sftp.flagsToString** - [`flagsToString()`](https://github.com/mscdex/ssh2/blob/master/SFTP.md#useful-standalone-methods)
-
-* **sftp.stringToFlags** - [`stringToFlags()`](https://github.com/mscdex/ssh2/blob/master/SFTP.md#useful-standalone-methods)
-
-### AgentProtocol
-
-#### AgentProtocol events
-
-* **identities**(< _opaque_ >request) - **(Server mode only)** The client has requested a list of public keys stored in the agent. Use `failureReply()` or `getIdentitiesReply()` to reply appropriately.
-
-* **sign**(< _opaque_ >request, < _mixed_ >pubKey, < _Buffer_ >data, < _object_ >options) - **(Server mode only)** The client has requested `data` to be signed using the key identified by `pubKey`. Use `failureReply()` or `signReply()` to reply appropriately. `options` may contain any of:
-
- * **hash** - _string_ - The explicitly desired hash to use when computing the signature. Currently if set, this may be either `'sha256'` or `'sha512'` for RSA keys.
-
-#### AgentProtocol methods
-
-* **(constructor)**(< _boolean_ >isClient) - Creates and returns a new AgentProtocol instance. `isClient` determines whether the instance operates in client or server mode.
-
-* **failureReply**(< _opaque_ >request) - _(void)_ - **(Server mode only)** Replies to the given `request` with a failure response.
-
-* **getIdentities**(< _function_ >callback) - _(void)_ - **(Client mode only)** Requests a list of public keys from the agent. `callback` is passed `(err, keys)` where `keys` is a possible array of public keys for authentication.
-
-* **getIdentitiesReply**(< _opaque_ >request, < _array_ >keys) - _(void)_ - **(Server mode only)** Responds to a identities list `request` with the given array of keys in `keys`.
-
-* **sign**(< _mixed_ >pubKey, < _Buffer_ >data, < _object_ >options, < _function_ >callback) - _(void)_ - **(Client mode only)** Requests that the agent sign `data` using the key identified by `pubKey`. `pubKey` can be any parsed (using `utils.parseKey()`) or parseable key value. `callback` is passed `(err, signature)` where `signature` is a possible _Buffer_ containing the signature for the `data`. `options` may contain any of:
-
- * **hash** - _string_ - The explicitly desired hash to use when computing the signature. Currently if set, this may be either `'sha256'` or `'sha512'` for RSA keys.
-
-* **signReply**(< _opaque_ >request, < _Buffer_ >signature) - _(void)_ - **(Server mode only)** Responds to a sign `request` with the given signature in `signature`.
-
-### BaseAgent
-
-In order to create a custom agent, your class *must*:
-
- * Extend `BaseAgent`
- * Call `super()` in its constructor
- * Implement *at least* the following methods:
-
-* **getIdentities**(< _function_ >callback) - _(void)_ - Passes `(err, keys)` to `callback` where `keys` is a possible array of public keys for authentication.
-
-* **sign**(< _mixed_ >pubKey, < _Buffer_ >data, < _object_ >options, < _function_ >callback) - _(void)_ - Signs `data` using the key identified by `pubKey`. `pubKey` can be any parsed (using `utils.parseKey()`) or parseable key value. `callback` should be passed `(err, signature)` where `signature` is a possible _Buffer_ containing the signature for the `data`. `options` may contain any of:
-
- * **hash** - _string_ - The explicitly desired hash to use when computing the signature. Currently if set, this may be either `'sha256'` or `'sha512'` for RSA keys.
-
-Additionally your class may implement the following method in order to support agent forwarding on the client:
-
-* **getStream**(< _function_ >callback) - _(void)_ - Passes `(err, stream)` to `callback` where `stream` is a possible Duplex stream to be used to communicate with your agent. You will probably want to utilize `AgentProtocol` as agent forwarding is an OpenSSH feature, so the `stream` needs to be able to transmit/receive OpenSSH agent protocol packets.
-
-### createAgent
-
-* **createAgent**(< _string_ >agentValue) - _(Agent)_ - Creates and returns a new agent instance using the same logic as the `Client`'s `agent` configuration option: if the platform is Windows and it's the value "pageant", it creates a `PageantAgent`, otherwise if it's not a path to a Windows pipe it creates a `CygwinAgent`. In all other cases, it creates an `OpenSSHAgent`.
-
-### CygwinAgent
-
-#### CygwinAgent methods
-
-* **(constructor)**(< _string_ >socketPath) - Communicates with an agent listening at `socketPath` in a Cygwin environment.
-
-### OpenSSHAgent
-
-#### OpenSSHAgent methods
-
-* **(constructor)**(< _string_ >socketPath) - Communicates with an OpenSSH agent listening on the UNIX socket at `socketPath`.
-
-### PageantAgent
-
-#### PageantAgent methods
-
-* **(constructor)**() - Creates a new agent instance for communicating with a running Pageant agent process.
diff --git a/node_modules/ssh2/examples/server-chat.js b/node_modules/ssh2/examples/server-chat.js
deleted file mode 100644
index a82a955..0000000
--- a/node_modules/ssh2/examples/server-chat.js
+++ /dev/null
@@ -1,238 +0,0 @@
-// **BEFORE RUNNING THIS SCRIPT:**
-// 1. The server portion is best run on non-Windows systems because they have
-// terminfo databases which are needed to properly work with different
-// terminal types of client connections
-// 2. Install `blessed`: `npm install blessed`
-// 3. Create a server host key in this same directory and name it `host.key`
-'use strict';
-
-const { readFileSync } = require('fs');
-
-const blessed = require('blessed');
-const { Server } = require('ssh2');
-
-const RE_SPECIAL =
-// eslint-disable-next-line no-control-regex
- /[\x00-\x1F\x7F]+|(?:\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K])/g;
-const MAX_MSG_LEN = 128;
-const MAX_NAME_LEN = 10;
-const PROMPT_NAME = `Enter a nickname to use (max ${MAX_NAME_LEN} chars): `;
-
-const users = [];
-
-function formatMessage(msg, output) {
- output.parseTags = true;
- msg = output._parseTags(msg);
- output.parseTags = false;
- return msg;
-}
-
-function userBroadcast(msg, source) {
- const sourceMsg = `> ${msg}`;
- const name = `{cyan-fg}{bold}${source.name}{/}`;
- msg = `: ${msg}`;
- for (const user of users) {
- const output = user.output;
- if (source === user)
- output.add(sourceMsg);
- else
- output.add(formatMessage(name, output) + msg);
- }
-}
-
-function localMessage(msg, source) {
- const output = source.output;
- output.add(formatMessage(msg, output));
-}
-
-function noop(v) {}
-
-new Server({
- hostKeys: [readFileSync('host.key')],
-}, (client) => {
- let stream;
- let name;
-
- client.on('authentication', (ctx) => {
- let nick = ctx.username;
- let prompt = PROMPT_NAME;
- let lowered;
-
- // Try to use username as nickname
- if (nick.length > 0 && nick.length <= MAX_NAME_LEN) {
- lowered = nick.toLowerCase();
- let ok = true;
- for (const user of users) {
- if (user.name.toLowerCase() === lowered) {
- ok = false;
- prompt = `That nickname is already in use.\n${PROMPT_NAME}`;
- break;
- }
- }
- if (ok) {
- name = nick;
- return ctx.accept();
- }
- } else if (nick.length === 0) {
- prompt = 'A nickname is required.\n' + PROMPT_NAME;
- } else {
- prompt = 'That nickname is too long.\n' + PROMPT_NAME;
- }
-
- if (ctx.method !== 'keyboard-interactive')
- return ctx.reject(['keyboard-interactive']);
-
- ctx.prompt(prompt, function retryPrompt(answers) {
- if (answers.length === 0)
- return ctx.reject(['keyboard-interactive']);
- nick = answers[0];
- if (nick.length > MAX_NAME_LEN) {
- return ctx.prompt(`That nickname is too long.\n${PROMPT_NAME}`,
- retryPrompt);
- } else if (nick.length === 0) {
- return ctx.prompt(`A nickname is required.\n${PROMPT_NAME}`,
- retryPrompt);
- }
- lowered = nick.toLowerCase();
- for (const user of users) {
- if (user.name.toLowerCase() === lowered) {
- return ctx.prompt(`That nickname is already in use.\n${PROMPT_NAME}`,
- retryPrompt);
- }
- }
- name = nick;
- ctx.accept();
- });
- }).on('ready', () => {
- let rows;
- let cols;
- let term;
- client.once('session', (accept, reject) => {
- accept().once('pty', (accept, reject, info) => {
- rows = info.rows;
- cols = info.cols;
- term = info.term;
- accept && accept();
- }).on('window-change', (accept, reject, info) => {
- rows = info.rows;
- cols = info.cols;
- if (stream) {
- stream.rows = rows;
- stream.columns = cols;
- stream.emit('resize');
- }
- accept && accept();
- }).once('shell', (accept, reject) => {
- stream = accept();
- users.push(stream);
-
- stream.name = name;
- stream.rows = rows || 24;
- stream.columns = cols || 80;
- stream.isTTY = true;
- stream.setRawMode = noop;
- stream.on('error', noop);
-
- const screen = new blessed.screen({
- autoPadding: true,
- smartCSR: true,
- program: new blessed.program({
- input: stream,
- output: stream
- }),
- terminal: term || 'ansi'
- });
-
- screen.title = 'SSH Chatting as ' + name;
- // Disable local echo
- screen.program.attr('invisible', true);
-
- const output = stream.output = new blessed.log({
- screen: screen,
- top: 0,
- left: 0,
- width: '100%',
- bottom: 2,
- scrollOnInput: true
- });
- screen.append(output);
-
- screen.append(new blessed.box({
- screen: screen,
- height: 1,
- bottom: 1,
- left: 0,
- width: '100%',
- type: 'line',
- ch: '='
- }));
-
- const input = new blessed.textbox({
- screen: screen,
- bottom: 0,
- height: 1,
- width: '100%',
- inputOnFocus: true
- });
- screen.append(input);
-
- input.focus();
-
- // Local greetings
- localMessage('{blue-bg}{white-fg}{bold}Welcome to SSH Chat!{/}\n'
- + 'There are {bold}'
- + (users.length - 1)
- + '{/} other user(s) connected.\n'
- + 'Type /quit or /exit to exit the chat.',
- stream);
-
- // Let everyone else know that this user just joined
- for (const user of users) {
- const output = user.output;
- if (user === stream)
- continue;
- output.add(formatMessage('{green-fg}*** {bold}', output)
- + name
- + formatMessage('{/bold} has joined the chat{/}', output));
- }
-
- screen.render();
- // XXX This fake resize event is needed for some terminals in order to
- // have everything display correctly
- screen.program.emit('resize');
-
- // Read a line of input from the user
- input.on('submit', (line) => {
- input.clearValue();
- screen.render();
- if (!input.focused)
- input.focus();
- line = line.replace(RE_SPECIAL, '').trim();
- if (line.length > MAX_MSG_LEN)
- line = line.substring(0, MAX_MSG_LEN);
- if (line.length > 0) {
- if (line === '/quit' || line === '/exit')
- stream.end();
- else
- userBroadcast(line, stream);
- }
- });
- });
- });
- }).on('close', () => {
- if (stream !== undefined) {
- users.splice(users.indexOf(stream), 1);
- // Let everyone else know that this user just left
- for (const user of users) {
- const output = user.output;
- output.add(formatMessage('{magenta-fg}*** {bold}', output)
- + name
- + formatMessage('{/bold} has left the chat{/}', output));
- }
- }
- }).on('error', (err) => {
- // Ignore errors
- });
-}).listen(0, function() {
- console.log('Listening on port ' + this.address().port);
-});
diff --git a/node_modules/ssh2/examples/sftp-server-download-only.js b/node_modules/ssh2/examples/sftp-server-download-only.js
deleted file mode 100644
index d4ae4c5..0000000
--- a/node_modules/ssh2/examples/sftp-server-download-only.js
+++ /dev/null
@@ -1,134 +0,0 @@
-'use strict';
-
-const { timingSafeEqual } = require('crypto');
-const { constants, readFileSync } = require('fs');
-
-const { Server, sftp: { OPEN_MODE, STATUS_CODE } } = require('ssh2');
-
-const allowedUser = Buffer.from('foo');
-const allowedPassword = Buffer.from('bar');
-
-function checkValue(input, allowed) {
- const autoReject = (input.length !== allowed.length);
- if (autoReject) {
- // Prevent leaking length information by always making a comparison with the
- // same input when lengths don't match what we expect ...
- allowed = input;
- }
- const isMatch = timingSafeEqual(input, allowed);
- return (!autoReject && isMatch);
-}
-
-new Server({
- hostKeys: [readFileSync('host.key')]
-}, (client) => {
- console.log('Client connected!');
-
- client.on('authentication', (ctx) => {
- let allowed = true;
- if (!checkValue(Buffer.from(ctx.username), allowedUser))
- allowed = false;
-
- switch (ctx.method) {
- case 'password':
- if (!checkValue(Buffer.from(ctx.password), allowedPassword))
- return ctx.reject();
- break;
- default:
- return ctx.reject();
- }
-
- if (allowed)
- ctx.accept();
- else
- ctx.reject();
- }).on('ready', () => {
- console.log('Client authenticated!');
-
- client.on('session', (accept, reject) => {
- const session = accept();
- session.on('sftp', (accept, reject) => {
- console.log('Client SFTP session');
-
- const openFiles = new Map();
- let handleCount = 0;
- const sftp = accept();
- sftp.on('OPEN', (reqid, filename, flags, attrs) => {
- // Only allow opening /tmp/foo.txt for writing
- if (filename !== '/tmp/foo.txt' || !(flags & OPEN_MODE.READ))
- return sftp.status(reqid, STATUS_CODE.FAILURE);
-
- // Create a fake handle to return to the client, this could easily
- // be a real file descriptor number for example if actually opening
- // the file on the disk
- const handle = Buffer.alloc(4);
- openFiles.set(handleCount, { read: false });
- handle.writeUInt32BE(handleCount++, 0, true);
-
- console.log('Opening file for read');
- sftp.handle(reqid, handle);
- }).on('READ', (reqid, handle, offset, length) => {
- let fnum;
- if (handle.length !== 4
- || !openFiles.has(fnum = handle.readUInt32BE(0, true))) {
- return sftp.status(reqid, STATUS_CODE.FAILURE);
- }
-
- // Fake the read
- const state = openFiles.get(fnum);
- if (state.read) {
- sftp.status(reqid, STATUS_CODE.EOF);
- } else {
- state.read = true;
-
- console.log(
- 'Read from file at offset %d, length %d', offset, length
- );
- sftp.data(reqid, 'bar');
- }
- }).on('CLOSE', (reqid, handle) => {
- let fnum;
- if (handle.length !== 4
- || !openFiles.has(fnum = handle.readUInt32BE(0))) {
- return sftp.status(reqid, STATUS_CODE.FAILURE);
- }
-
- openFiles.delete(fnum);
-
- console.log('Closing file');
- sftp.status(reqid, STATUS_CODE.OK);
- }).on('REALPATH', function(reqid, path) {
- const name = [{
- filename: '/tmp/foo.txt',
- longname: '-rwxrwxrwx 1 foo foo 3 Dec 8 2009 foo.txt',
- attrs: {}
- }];
- sftp.name(reqid, name);
- }).on('STAT', onSTAT)
- .on('LSTAT', onSTAT);
-
- function onSTAT(reqid, path) {
- if (path !== '/tmp/foo.txt')
- return sftp.status(reqid, STATUS_CODE.FAILURE);
-
- let mode = constants.S_IFREG; // Regular file
- mode |= constants.S_IRWXU; // Read, write, execute for user
- mode |= constants.S_IRWXG; // Read, write, execute for group
- mode |= constants.S_IRWXO; // Read, write, execute for other
- sftp.attrs(reqid, {
- mode: mode,
- uid: 0,
- gid: 0,
- size: 3,
- atime: Date.now(),
- mtime: Date.now(),
- });
- }
- });
- });
- }).on('close', () => {
- console.log('Client disconnected');
- });
-}).listen(0, '127.0.0.1', function() {
- console.log(`Listening on port ${this.address().port}`);
-});
diff --git a/node_modules/ssh2/lib/Channel.js b/node_modules/ssh2/lib/Channel.js
deleted file mode 100644
index 0120779..0000000
--- a/node_modules/ssh2/lib/Channel.js
+++ /dev/null
@@ -1,295 +0,0 @@
-'use strict';
-
-const {
- Duplex: DuplexStream,
- Readable: ReadableStream,
- Writable: WritableStream,
-} = require('stream');
-
-const {
- CHANNEL_EXTENDED_DATATYPE: { STDERR },
-} = require('./protocol/constants.js');
-const { bufferSlice } = require('./protocol/utils.js');
-
-const PACKET_SIZE = 32 * 1024;
-const MAX_WINDOW = 2 * 1024 * 1024;
-const WINDOW_THRESHOLD = MAX_WINDOW / 2;
-
-class ClientStderr extends ReadableStream {
- constructor(channel, streamOpts) {
- super(streamOpts);
-
- this._channel = channel;
- }
- _read(n) {
- if (this._channel._waitChanDrain) {
- this._channel._waitChanDrain = false;
- if (this._channel.incoming.window <= WINDOW_THRESHOLD)
- windowAdjust(this._channel);
- }
- }
-}
-
-class ServerStderr extends WritableStream {
- constructor(channel) {
- super({ highWaterMark: MAX_WINDOW });
-
- this._channel = channel;
- }
-
- _write(data, encoding, cb) {
- const channel = this._channel;
- const protocol = channel._client._protocol;
- const outgoing = channel.outgoing;
- const packetSize = outgoing.packetSize;
- const id = outgoing.id;
- let window = outgoing.window;
- const len = data.length;
- let p = 0;
-
- if (outgoing.state !== 'open')
- return;
-
- while (len - p > 0 && window > 0) {
- let sliceLen = len - p;
- if (sliceLen > window)
- sliceLen = window;
- if (sliceLen > packetSize)
- sliceLen = packetSize;
-
- if (p === 0 && sliceLen === len)
- protocol.channelExtData(id, data, STDERR);
- else
- protocol.channelExtData(id, bufferSlice(data, p, p + sliceLen), STDERR);
-
- p += sliceLen;
- window -= sliceLen;
- }
-
- outgoing.window = window;
-
- if (len - p > 0) {
- if (window === 0)
- channel._waitWindow = true;
- if (p > 0)
- channel._chunkErr = bufferSlice(data, p, len);
- else
- channel._chunkErr = data;
- channel._chunkcbErr = cb;
- return;
- }
-
- cb();
- }
-}
-
-class Channel extends DuplexStream {
- constructor(client, info, opts) {
- const streamOpts = {
- highWaterMark: MAX_WINDOW,
- allowHalfOpen: (!opts || (opts && opts.allowHalfOpen !== false)),
- emitClose: false,
- };
- super(streamOpts);
- this.allowHalfOpen = streamOpts.allowHalfOpen;
-
- const server = !!(opts && opts.server);
-
- this.server = server;
- this.type = info.type;
- this.subtype = undefined;
-
- /*
- incoming and outgoing contain these properties:
- {
- id: undefined,
- window: undefined,
- packetSize: undefined,
- state: 'closed'
- }
- */
- this.incoming = info.incoming;
- this.outgoing = info.outgoing;
- this._callbacks = [];
-
- this._client = client;
- this._hasX11 = false;
- this._exit = {
- code: undefined,
- signal: undefined,
- dump: undefined,
- desc: undefined,
- };
-
- this.stdin = this.stdout = this;
-
- if (server)
- this.stderr = new ServerStderr(this);
- else
- this.stderr = new ClientStderr(this, streamOpts);
-
- // Outgoing data
- this._waitWindow = false; // SSH-level backpressure
-
- // Incoming data
- this._waitChanDrain = false; // Channel Readable side backpressure
-
- this._chunk = undefined;
- this._chunkcb = undefined;
- this._chunkErr = undefined;
- this._chunkcbErr = undefined;
-
- this.on('finish', onFinish)
- .on('prefinish', onFinish); // For node v0.11+
-
- this.on('end', onEnd).on('close', onEnd);
- }
-
- _read(n) {
- if (this._waitChanDrain) {
- this._waitChanDrain = false;
- if (this.incoming.window <= WINDOW_THRESHOLD)
- windowAdjust(this);
- }
- }
-
- _write(data, encoding, cb) {
- const protocol = this._client._protocol;
- const outgoing = this.outgoing;
- const packetSize = outgoing.packetSize;
- const id = outgoing.id;
- let window = outgoing.window;
- const len = data.length;
- let p = 0;
-
- if (outgoing.state !== 'open')
- return;
-
- while (len - p > 0 && window > 0) {
- let sliceLen = len - p;
- if (sliceLen > window)
- sliceLen = window;
- if (sliceLen > packetSize)
- sliceLen = packetSize;
-
- if (p === 0 && sliceLen === len)
- protocol.channelData(id, data);
- else
- protocol.channelData(id, bufferSlice(data, p, p + sliceLen));
-
- p += sliceLen;
- window -= sliceLen;
- }
-
- outgoing.window = window;
-
- if (len - p > 0) {
- if (window === 0)
- this._waitWindow = true;
- if (p > 0)
- this._chunk = bufferSlice(data, p, len);
- else
- this._chunk = data;
- this._chunkcb = cb;
- return;
- }
-
- cb();
- }
-
- eof() {
- if (this.outgoing.state === 'open') {
- this.outgoing.state = 'eof';
- this._client._protocol.channelEOF(this.outgoing.id);
- }
- }
-
- close() {
- if (this.outgoing.state === 'open' || this.outgoing.state === 'eof') {
- this.outgoing.state = 'closing';
- this._client._protocol.channelClose(this.outgoing.id);
- }
- }
-
- destroy() {
- this.end();
- this.close();
- return this;
- }
-
- // Session type-specific methods =============================================
- setWindow(rows, cols, height, width) {
- if (this.server)
- throw new Error('Client-only method called in server mode');
-
- if (this.type === 'session'
- && (this.subtype === 'shell' || this.subtype === 'exec')
- && this.writable
- && this.outgoing.state === 'open') {
- this._client._protocol.windowChange(this.outgoing.id,
- rows,
- cols,
- height,
- width);
- }
- }
-
- signal(signalName) {
- if (this.server)
- throw new Error('Client-only method called in server mode');
-
- if (this.type === 'session'
- && this.writable
- && this.outgoing.state === 'open') {
- this._client._protocol.signal(this.outgoing.id, signalName);
- }
- }
-
- exit(statusOrSignal, coreDumped, msg) {
- if (!this.server)
- throw new Error('Server-only method called in client mode');
-
- if (this.type === 'session'
- && this.writable
- && this.outgoing.state === 'open') {
- if (typeof statusOrSignal === 'number') {
- this._client._protocol.exitStatus(this.outgoing.id, statusOrSignal);
- } else {
- this._client._protocol.exitSignal(this.outgoing.id,
- statusOrSignal,
- coreDumped,
- msg);
- }
- }
- }
-
-}
-
-function onFinish() {
- this.eof();
- if (this.server || !this.allowHalfOpen)
- this.close();
- this.writable = false;
-}
-
-function onEnd() {
- this.readable = false;
-}
-
-function windowAdjust(self) {
- if (self.outgoing.state === 'closed')
- return;
- const amt = MAX_WINDOW - self.incoming.window;
- if (amt <= 0)
- return;
- self.incoming.window += amt;
- self._client._protocol.channelWindowAdjust(self.outgoing.id, amt);
-}
-
-module.exports = {
- Channel,
- MAX_WINDOW,
- PACKET_SIZE,
- windowAdjust,
- WINDOW_THRESHOLD,
-};
diff --git a/node_modules/ssh2/lib/agent.js b/node_modules/ssh2/lib/agent.js
deleted file mode 100644
index bb495d1..0000000
--- a/node_modules/ssh2/lib/agent.js
+++ /dev/null
@@ -1,1123 +0,0 @@
-'use strict';
-
-const { Socket } = require('net');
-const { Duplex } = require('stream');
-const { resolve } = require('path');
-const { readFile } = require('fs');
-const { execFile, spawn } = require('child_process');
-
-const { isParsedKey, parseKey } = require('./protocol/keyParser.js');
-
-const {
- makeBufferParser,
- readUInt32BE,
- writeUInt32BE,
- writeUInt32LE,
-} = require('./protocol/utils.js');
-
-function once(cb) {
- let called = false;
- return (...args) => {
- if (called)
- return;
- called = true;
- cb(...args);
- };
-}
-
-function concat(buf1, buf2) {
- const combined = Buffer.allocUnsafe(buf1.length + buf2.length);
- buf1.copy(combined, 0);
- buf2.copy(combined, buf1.length);
- return combined;
-}
-
-function noop() {}
-
-const EMPTY_BUF = Buffer.alloc(0);
-
-const binaryParser = makeBufferParser();
-
-class BaseAgent {
- getIdentities(cb) {
- cb(new Error('Missing getIdentities() implementation'));
- }
- sign(pubKey, data, options, cb) {
- if (typeof options === 'function')
- cb = options;
- cb(new Error('Missing sign() implementation'));
- }
-}
-
-class OpenSSHAgent extends BaseAgent {
- constructor(socketPath) {
- super();
- this.socketPath = socketPath;
- }
-
- getStream(cb) {
- cb = once(cb);
- const sock = new Socket();
- sock.on('connect', () => {
- cb(null, sock);
- });
- sock.on('close', onFail)
- .on('end', onFail)
- .on('error', onFail);
- sock.connect(this.socketPath);
-
- function onFail() {
- try {
- sock.destroy();
- } catch {}
-
- cb(new Error('Failed to connect to agent'));
- }
- }
-
- getIdentities(cb) {
- cb = once(cb);
- this.getStream((err, stream) => {
- function onFail(err) {
- if (stream) {
- try {
- stream.destroy();
- } catch {}
- }
- if (!err)
- err = new Error('Failed to retrieve identities from agent');
- cb(err);
- }
-
- if (err)
- return onFail(err);
-
- const protocol = new AgentProtocol(true);
- protocol.on('error', onFail);
- protocol.pipe(stream).pipe(protocol);
-
- stream.on('close', onFail)
- .on('end', onFail)
- .on('error', onFail);
-
- protocol.getIdentities((err, keys) => {
- if (err)
- return onFail(err);
- try {
- stream.destroy();
- } catch {}
- cb(null, keys);
- });
- });
- }
-
- sign(pubKey, data, options, cb) {
- if (typeof options === 'function') {
- cb = options;
- options = undefined;
- } else if (typeof options !== 'object' || options === null) {
- options = undefined;
- }
-
- cb = once(cb);
- this.getStream((err, stream) => {
- function onFail(err) {
- if (stream) {
- try {
- stream.destroy();
- } catch {}
- }
- if (!err)
- err = new Error('Failed to sign data with agent');
- cb(err);
- }
-
- if (err)
- return onFail(err);
-
- const protocol = new AgentProtocol(true);
- protocol.on('error', onFail);
- protocol.pipe(stream).pipe(protocol);
-
- stream.on('close', onFail)
- .on('end', onFail)
- .on('error', onFail);
-
- protocol.sign(pubKey, data, options, (err, sig) => {
- if (err)
- return onFail(err);
-
- try {
- stream.destroy();
- } catch {}
-
- cb(null, sig);
- });
- });
- }
-}
-
-const PageantAgent = (() => {
- const RET_ERR_BADARGS = 10;
- const RET_ERR_UNAVAILABLE = 11;
- const RET_ERR_NOMAP = 12;
- const RET_ERR_BINSTDIN = 13;
- const RET_ERR_BINSTDOUT = 14;
- const RET_ERR_BADLEN = 15;
-
- const EXEPATH = resolve(__dirname, '..', 'util/pagent.exe');
- const ERROR = {
- [RET_ERR_BADARGS]: new Error('Invalid pagent.exe arguments'),
- [RET_ERR_UNAVAILABLE]: new Error('Pageant is not running'),
- [RET_ERR_NOMAP]: new Error('pagent.exe could not create an mmap'),
- [RET_ERR_BINSTDIN]: new Error('pagent.exe could not set mode for stdin'),
- [RET_ERR_BINSTDOUT]: new Error('pagent.exe could not set mode for stdout'),
- [RET_ERR_BADLEN]:
- new Error('pagent.exe did not get expected input payload'),
- };
-
- function destroy(stream) {
- stream.buffer = null;
- if (stream.proc) {
- stream.proc.kill();
- stream.proc = undefined;
- }
- }
-
- class PageantSocket extends Duplex {
- constructor() {
- super();
- this.proc = undefined;
- this.buffer = null;
- }
- _read(n) {}
- _write(data, encoding, cb) {
- if (this.buffer === null) {
- this.buffer = data;
- } else {
- const newBuffer = Buffer.allocUnsafe(this.buffer.length + data.length);
- this.buffer.copy(newBuffer, 0);
- data.copy(newBuffer, this.buffer.length);
- this.buffer = newBuffer;
- }
- // Wait for at least all length bytes
- if (this.buffer.length < 4)
- return cb();
-
- const len = readUInt32BE(this.buffer, 0);
- // Make sure we have a full message before querying pageant
- if ((this.buffer.length - 4) < len)
- return cb();
-
- data = this.buffer.slice(0, 4 + len);
- if (this.buffer.length > (4 + len))
- return cb(new Error('Unexpected multiple agent requests'));
- this.buffer = null;
-
- let error;
- const proc = this.proc = spawn(EXEPATH, [ data.length ]);
- proc.stdout.on('data', (data) => {
- this.push(data);
- });
- proc.on('error', (err) => {
- error = err;
- cb(error);
- });
- proc.on('close', (code) => {
- this.proc = undefined;
- if (!error) {
- if (error = ERROR[code])
- return cb(error);
- cb();
- }
- });
- proc.stdin.end(data);
- }
- _final(cb) {
- destroy(this);
- cb();
- }
- _destroy(err, cb) {
- destroy(this);
- cb();
- }
- }
-
- return class PageantAgent extends OpenSSHAgent {
- getStream(cb) {
- cb(null, new PageantSocket());
- }
- };
-})();
-
-const CygwinAgent = (() => {
- const RE_CYGWIN_SOCK = /^!(\d+) s ([A-Z0-9]{8}-[A-Z0-9]{8}-[A-Z0-9]{8}-[A-Z0-9]{8})/;
-
- return class CygwinAgent extends OpenSSHAgent {
- getStream(cb) {
- cb = once(cb);
-
- // The cygwin ssh-agent connection process looks like this:
- // 1. Read the "socket" as a file to get the underlying TCP port and a
- // special "secret" that must be sent to the TCP server.
- // 2. Connect to the server listening on localhost at the TCP port.
- // 3. Send the "secret" to the server.
- // 4. The server sends back the same "secret".
- // 5. Send three 32-bit integer values of zero. This is ordinarily the
- // pid, uid, and gid of this process, but cygwin will actually
- // send us the correct values as a response.
- // 6. The server sends back the pid, uid, gid.
- // 7. Disconnect.
- // 8. Repeat steps 2-6, except send the received pid, uid, and gid in
- // step 5 instead of zeroes.
- // 9. Connection is ready to be used.
-
- let socketPath = this.socketPath;
- let triedCygpath = false;
- readFile(socketPath, function readCygsocket(err, data) {
- if (err) {
- if (triedCygpath)
- return cb(new Error('Invalid cygwin unix socket path'));
-
- // Try using `cygpath` to convert a possible *nix-style path to the
- // real Windows path before giving up ...
- execFile('cygpath', ['-w', socketPath], (err, stdout, stderr) => {
- if (err || stdout.length === 0)
- return cb(new Error('Invalid cygwin unix socket path'));
-
- triedCygpath = true;
- socketPath = stdout.toString().replace(/[\r\n]/g, '');
- readFile(socketPath, readCygsocket);
- });
- return;
- }
-
- const m = RE_CYGWIN_SOCK.exec(data.toString('ascii'));
- if (!m)
- return cb(new Error('Malformed cygwin unix socket file'));
-
- let state;
- let bc = 0;
- let isRetrying = false;
- const inBuf = [];
- let sock;
-
- // Use 0 for pid, uid, and gid to ensure we get an error and also
- // a valid uid and gid from cygwin so that we don't have to figure it
- // out ourselves
- let credsBuf = Buffer.alloc(12);
-
- // Parse cygwin unix socket file contents
- const port = parseInt(m[1], 10);
- const secret = m[2].replace(/-/g, '');
- const secretBuf = Buffer.allocUnsafe(16);
- for (let i = 0, j = 0; j < 32; ++i, j += 2)
- secretBuf[i] = parseInt(secret.substring(j, j + 2), 16);
-
- // Convert to host order (always LE for Windows)
- for (let i = 0; i < 16; i += 4)
- writeUInt32LE(secretBuf, readUInt32BE(secretBuf, i), i);
-
- tryConnect();
-
- function _onconnect() {
- bc = 0;
- state = 'secret';
- sock.write(secretBuf);
- }
-
- function _ondata(data) {
- bc += data.length;
-
- if (state === 'secret') {
- // The secret we sent is echoed back to us by cygwin, not sure of
- // the reason for that, but we ignore it nonetheless ...
- if (bc === 16) {
- bc = 0;
- state = 'creds';
- sock.write(credsBuf);
- }
- return;
- }
-
- if (state === 'creds') {
- // If this is the first attempt, make sure to gather the valid
- // uid and gid for our next attempt
- if (!isRetrying)
- inBuf.push(data);
-
- if (bc === 12) {
- sock.removeListener('connect', _onconnect);
- sock.removeListener('data', _ondata);
- sock.removeListener('error', onFail);
- sock.removeListener('end', onFail);
- sock.removeListener('close', onFail);
-
- if (isRetrying)
- return cb(null, sock);
-
- isRetrying = true;
- credsBuf = Buffer.concat(inBuf);
- writeUInt32LE(credsBuf, process.pid, 0);
- sock.on('error', () => {});
- sock.destroy();
-
- tryConnect();
- }
- }
- }
-
- function onFail() {
- cb(new Error('Problem negotiating cygwin unix socket security'));
- }
-
- function tryConnect() {
- sock = new Socket();
- sock.on('connect', _onconnect);
- sock.on('data', _ondata);
- sock.on('error', onFail);
- sock.on('end', onFail);
- sock.on('close', onFail);
- sock.connect(port);
- }
- });
- }
- };
-})();
-
-// Format of `//./pipe/ANYTHING`, with forward slashes and backward slashes
-// being interchangeable
-const WINDOWS_PIPE_REGEX = /^[/\\][/\\]\.[/\\]pipe[/\\].+/;
-function createAgent(path) {
- if (process.platform === 'win32' && !WINDOWS_PIPE_REGEX.test(path)) {
- return (path === 'pageant'
- ? new PageantAgent()
- : new CygwinAgent(path));
- }
- return new OpenSSHAgent(path);
-}
-
-const AgentProtocol = (() => {
- // Client->Server messages
- const SSH_AGENTC_REQUEST_IDENTITIES = 11;
- const SSH_AGENTC_SIGN_REQUEST = 13;
- // const SSH_AGENTC_ADD_IDENTITY = 17;
- // const SSH_AGENTC_REMOVE_IDENTITY = 18;
- // const SSH_AGENTC_REMOVE_ALL_IDENTITIES = 19;
- // const SSH_AGENTC_ADD_SMARTCARD_KEY = 20;
- // const SSH_AGENTC_REMOVE_SMARTCARD_KEY = 21;
- // const SSH_AGENTC_LOCK = 22;
- // const SSH_AGENTC_UNLOCK = 23;
- // const SSH_AGENTC_ADD_ID_CONSTRAINED = 25;
- // const SSH_AGENTC_ADD_SMARTCARD_KEY_CONSTRAINED = 26;
- // const SSH_AGENTC_EXTENSION = 27;
- // Server->Client messages
- const SSH_AGENT_FAILURE = 5;
- // const SSH_AGENT_SUCCESS = 6;
- const SSH_AGENT_IDENTITIES_ANSWER = 12;
- const SSH_AGENT_SIGN_RESPONSE = 14;
- // const SSH_AGENT_EXTENSION_FAILURE = 28;
-
- // const SSH_AGENT_CONSTRAIN_LIFETIME = 1;
- // const SSH_AGENT_CONSTRAIN_CONFIRM = 2;
- // const SSH_AGENT_CONSTRAIN_EXTENSION = 255;
-
- const SSH_AGENT_RSA_SHA2_256 = (1 << 1);
- const SSH_AGENT_RSA_SHA2_512 = (1 << 2);
-
- const ROLE_CLIENT = 0;
- const ROLE_SERVER = 1;
-
- // Ensures that responses get sent back in the same order the requests were
- // received
- function processResponses(protocol) {
- let ret;
- while (protocol[SYM_REQS].length) {
- const nextResponse = protocol[SYM_REQS][0][SYM_RESP];
- if (nextResponse === undefined)
- break;
-
- protocol[SYM_REQS].shift();
- ret = protocol.push(nextResponse);
- }
- return ret;
- }
-
- const SYM_TYPE = Symbol('Inbound Request Type');
- const SYM_RESP = Symbol('Inbound Request Response');
- const SYM_CTX = Symbol('Inbound Request Context');
- class AgentInboundRequest {
- constructor(type, ctx) {
- this[SYM_TYPE] = type;
- this[SYM_RESP] = undefined;
- this[SYM_CTX] = ctx;
- }
- hasResponded() {
- return (this[SYM_RESP] !== undefined);
- }
- getType() {
- return this[SYM_TYPE];
- }
- getContext() {
- return this[SYM_CTX];
- }
- }
- function respond(protocol, req, data) {
- req[SYM_RESP] = data;
- return processResponses(protocol);
- }
-
- function cleanup(protocol) {
- protocol[SYM_BUFFER] = null;
- if (protocol[SYM_MODE] === ROLE_CLIENT) {
- const reqs = protocol[SYM_REQS];
- if (reqs && reqs.length) {
- protocol[SYM_REQS] = [];
- for (const req of reqs)
- req.cb(new Error('No reply from server'));
- }
- }
-
- // Node streams hackery to make streams do the "right thing"
- try {
- protocol.end();
- } catch {}
- setImmediate(() => {
- if (!protocol[SYM_ENDED])
- protocol.emit('end');
- if (!protocol[SYM_CLOSED])
- protocol.emit('close');
- });
- }
-
- function onClose() {
- this[SYM_CLOSED] = true;
- }
-
- function onEnd() {
- this[SYM_ENDED] = true;
- }
-
- const SYM_REQS = Symbol('Requests');
- const SYM_MODE = Symbol('Agent Protocol Role');
- const SYM_BUFFER = Symbol('Agent Protocol Buffer');
- const SYM_MSGLEN = Symbol('Agent Protocol Current Message Length');
- const SYM_CLOSED = Symbol('Agent Protocol Closed');
- const SYM_ENDED = Symbol('Agent Protocol Ended');
- // Implementation based on:
- // https://tools.ietf.org/html/draft-miller-ssh-agent-04
- return class AgentProtocol extends Duplex {
- /*
- Notes:
- - `constraint` type consists of:
- byte constraint_type
- byte[] constraint_data
- where `constraint_type` is one of:
- * SSH_AGENT_CONSTRAIN_LIFETIME
- - `constraint_data` consists of:
- uint32 seconds
- * SSH_AGENT_CONSTRAIN_CONFIRM
- - `constraint_data` N/A
- * SSH_AGENT_CONSTRAIN_EXTENSION
- - `constraint_data` consists of:
- string extension name
- byte[] extension-specific details
- */
-
- constructor(isClient) {
- super({ autoDestroy: true, emitClose: false });
- this[SYM_MODE] = (isClient ? ROLE_CLIENT : ROLE_SERVER);
- this[SYM_REQS] = [];
- this[SYM_BUFFER] = null;
- this[SYM_MSGLEN] = -1;
- this.once('end', onEnd);
- this.once('close', onClose);
- }
-
- _read(n) {}
-
- _write(data, encoding, cb) {
- /*
- Messages are of the format:
- uint32 message length
- byte message type
- byte[message length - 1] message contents
- */
- if (this[SYM_BUFFER] === null)
- this[SYM_BUFFER] = data;
- else
- this[SYM_BUFFER] = concat(this[SYM_BUFFER], data);
-
- let buffer = this[SYM_BUFFER];
- let bufferLen = buffer.length;
-
- let p = 0;
- while (p < bufferLen) {
- // Wait for length + type
- if (bufferLen < 5)
- break;
-
- if (this[SYM_MSGLEN] === -1)
- this[SYM_MSGLEN] = readUInt32BE(buffer, p);
-
- // Check if we have the entire message
- if (bufferLen < (4 + this[SYM_MSGLEN]))
- break;
-
- const msgType = buffer[p += 4];
- ++p;
-
- if (this[SYM_MODE] === ROLE_CLIENT) {
- if (this[SYM_REQS].length === 0)
- return cb(new Error('Received unexpected message from server'));
-
- const req = this[SYM_REQS].shift();
-
- switch (msgType) {
- case SSH_AGENT_FAILURE:
- req.cb(new Error('Agent responded with failure'));
- break;
- case SSH_AGENT_IDENTITIES_ANSWER: {
- if (req.type !== SSH_AGENTC_REQUEST_IDENTITIES)
- return cb(new Error('Agent responded with wrong message type'));
-
- /*
- byte SSH_AGENT_IDENTITIES_ANSWER
- uint32 nkeys
-
- where `nkeys` is 0 or more of:
- string key blob
- string comment
- */
-
- binaryParser.init(buffer, p);
-
- const numKeys = binaryParser.readUInt32BE();
-
- if (numKeys === undefined) {
- binaryParser.clear();
- return cb(new Error('Malformed agent response'));
- }
-
- const keys = [];
- for (let i = 0; i < numKeys; ++i) {
- let pubKey = binaryParser.readString();
- if (pubKey === undefined) {
- binaryParser.clear();
- return cb(new Error('Malformed agent response'));
- }
-
- const comment = binaryParser.readString(true);
- if (comment === undefined) {
- binaryParser.clear();
- return cb(new Error('Malformed agent response'));
- }
-
- pubKey = parseKey(pubKey);
- // We continue parsing the packet if we encounter an error
- // in case the error is due to the key being an unsupported
- // type
- if (pubKey instanceof Error)
- continue;
-
- pubKey.comment = pubKey.comment || comment;
-
- keys.push(pubKey);
- }
- p = binaryParser.pos();
- binaryParser.clear();
-
- req.cb(null, keys);
- break;
- }
- case SSH_AGENT_SIGN_RESPONSE: {
- if (req.type !== SSH_AGENTC_SIGN_REQUEST)
- return cb(new Error('Agent responded with wrong message type'));
-
- /*
- byte SSH_AGENT_SIGN_RESPONSE
- string signature
- */
-
- binaryParser.init(buffer, p);
- let signature = binaryParser.readString();
- p = binaryParser.pos();
- binaryParser.clear();
-
- if (signature === undefined)
- return cb(new Error('Malformed agent response'));
-
- // We strip the algorithm from OpenSSH's output and assume it's
- // using the algorithm we specified. This makes it easier on
- // custom Agent implementations so they don't have to construct
- // the correct binary format for a (OpenSSH-style) signature.
-
- // TODO: verify signature type based on key and options used
- // during initial sign request
- binaryParser.init(signature, 0);
- binaryParser.readString(true);
- signature = binaryParser.readString();
- binaryParser.clear();
-
- if (signature === undefined)
- return cb(new Error('Malformed OpenSSH signature format'));
-
- req.cb(null, signature);
- break;
- }
- default:
- return cb(
- new Error('Agent responded with unsupported message type')
- );
- }
- } else {
- switch (msgType) {
- case SSH_AGENTC_REQUEST_IDENTITIES: {
- const req = new AgentInboundRequest(msgType);
- this[SYM_REQS].push(req);
- /*
- byte SSH_AGENTC_REQUEST_IDENTITIES
- */
- this.emit('identities', req);
- break;
- }
- case SSH_AGENTC_SIGN_REQUEST: {
- /*
- byte SSH_AGENTC_SIGN_REQUEST
- string key_blob
- string data
- uint32 flags
- */
- binaryParser.init(buffer, p);
- let pubKey = binaryParser.readString();
- const data = binaryParser.readString();
- const flagsVal = binaryParser.readUInt32BE();
- p = binaryParser.pos();
- binaryParser.clear();
- if (flagsVal === undefined) {
- const req = new AgentInboundRequest(msgType);
- this[SYM_REQS].push(req);
- return this.failureReply(req);
- }
-
- pubKey = parseKey(pubKey);
- if (pubKey instanceof Error) {
- const req = new AgentInboundRequest(msgType);
- this[SYM_REQS].push(req);
- return this.failureReply(req);
- }
-
- const flags = {
- hash: undefined,
- };
- let ctx;
- if (pubKey.type === 'ssh-rsa') {
- if (flagsVal & SSH_AGENT_RSA_SHA2_256) {
- ctx = 'rsa-sha2-256';
- flags.hash = 'sha256';
- } else if (flagsVal & SSH_AGENT_RSA_SHA2_512) {
- ctx = 'rsa-sha2-512';
- flags.hash = 'sha512';
- }
- }
- if (ctx === undefined)
- ctx = pubKey.type;
-
- const req = new AgentInboundRequest(msgType, ctx);
- this[SYM_REQS].push(req);
-
- this.emit('sign', req, pubKey, data, flags);
- break;
- }
- default: {
- const req = new AgentInboundRequest(msgType);
- this[SYM_REQS].push(req);
- this.failureReply(req);
- }
- }
- }
-
- // Get ready for next message
- this[SYM_MSGLEN] = -1;
- if (p === bufferLen) {
- // Nothing left to process for now
- this[SYM_BUFFER] = null;
- break;
- } else {
- this[SYM_BUFFER] = buffer = buffer.slice(p);
- bufferLen = buffer.length;
- p = 0;
- }
- }
-
- cb();
- }
-
- _destroy(err, cb) {
- cleanup(this);
- cb();
- }
-
- _final(cb) {
- cleanup(this);
- cb();
- }
-
- // Client->Server messages =================================================
- sign(pubKey, data, options, cb) {
- if (this[SYM_MODE] !== ROLE_CLIENT)
- throw new Error('Client-only method called with server role');
-
- if (typeof options === 'function') {
- cb = options;
- options = undefined;
- } else if (typeof options !== 'object' || options === null) {
- options = undefined;
- }
-
- let flags = 0;
-
- pubKey = parseKey(pubKey);
- if (pubKey instanceof Error)
- throw new Error('Invalid public key argument');
-
- if (pubKey.type === 'ssh-rsa' && options) {
- switch (options.hash) {
- case 'sha256':
- flags = SSH_AGENT_RSA_SHA2_256;
- break;
- case 'sha512':
- flags = SSH_AGENT_RSA_SHA2_512;
- break;
- }
- }
- pubKey = pubKey.getPublicSSH();
-
- /*
- byte SSH_AGENTC_SIGN_REQUEST
- string key_blob
- string data
- uint32 flags
- */
- const type = SSH_AGENTC_SIGN_REQUEST;
- const keyLen = pubKey.length;
- const dataLen = data.length;
- let p = 0;
- const buf = Buffer.allocUnsafe(4 + 1 + 4 + keyLen + 4 + dataLen + 4);
-
- writeUInt32BE(buf, buf.length - 4, p);
-
- buf[p += 4] = type;
-
- writeUInt32BE(buf, keyLen, ++p);
- pubKey.copy(buf, p += 4);
-
- writeUInt32BE(buf, dataLen, p += keyLen);
- data.copy(buf, p += 4);
-
- writeUInt32BE(buf, flags, p += dataLen);
-
- if (typeof cb !== 'function')
- cb = noop;
-
- this[SYM_REQS].push({ type, cb });
-
- return this.push(buf);
- }
- getIdentities(cb) {
- if (this[SYM_MODE] !== ROLE_CLIENT)
- throw new Error('Client-only method called with server role');
-
- /*
- byte SSH_AGENTC_REQUEST_IDENTITIES
- */
- const type = SSH_AGENTC_REQUEST_IDENTITIES;
-
- let p = 0;
- const buf = Buffer.allocUnsafe(4 + 1);
-
- writeUInt32BE(buf, buf.length - 4, p);
-
- buf[p += 4] = type;
-
- if (typeof cb !== 'function')
- cb = noop;
-
- this[SYM_REQS].push({ type, cb });
-
- return this.push(buf);
- }
-
- // Server->Client messages =================================================
- failureReply(req) {
- if (this[SYM_MODE] !== ROLE_SERVER)
- throw new Error('Server-only method called with client role');
-
- if (!(req instanceof AgentInboundRequest))
- throw new Error('Wrong request argument');
-
- if (req.hasResponded())
- return true;
-
- let p = 0;
- const buf = Buffer.allocUnsafe(4 + 1);
-
- writeUInt32BE(buf, buf.length - 4, p);
-
- buf[p += 4] = SSH_AGENT_FAILURE;
-
- return respond(this, req, buf);
- }
- getIdentitiesReply(req, keys) {
- if (this[SYM_MODE] !== ROLE_SERVER)
- throw new Error('Server-only method called with client role');
-
- if (!(req instanceof AgentInboundRequest))
- throw new Error('Wrong request argument');
-
- if (req.hasResponded())
- return true;
-
- /*
- byte SSH_AGENT_IDENTITIES_ANSWER
- uint32 nkeys
-
- where `nkeys` is 0 or more of:
- string key blob
- string comment
- */
-
- if (req.getType() !== SSH_AGENTC_REQUEST_IDENTITIES)
- throw new Error('Invalid response to request');
-
- if (!Array.isArray(keys))
- throw new Error('Keys argument must be an array');
-
- let totalKeysLen = 4; // Include `nkeys` size
-
- const newKeys = [];
- for (let i = 0; i < keys.length; ++i) {
- const entry = keys[i];
- if (typeof entry !== 'object' || entry === null)
- throw new Error(`Invalid key entry: ${entry}`);
-
- let pubKey;
- let comment;
- if (isParsedKey(entry)) {
- pubKey = entry;
- } else if (isParsedKey(entry.pubKey)) {
- pubKey = entry.pubKey;
- } else {
- if (typeof entry.pubKey !== 'object' || entry.pubKey === null)
- continue;
- ({ pubKey, comment } = entry.pubKey);
- pubKey = parseKey(pubKey);
- if (pubKey instanceof Error)
- continue; // TODO: add debug output
- }
- comment = pubKey.comment || comment;
- pubKey = pubKey.getPublicSSH();
-
- totalKeysLen += 4 + pubKey.length;
-
- if (comment && typeof comment === 'string')
- comment = Buffer.from(comment);
- else if (!Buffer.isBuffer(comment))
- comment = EMPTY_BUF;
-
- totalKeysLen += 4 + comment.length;
-
- newKeys.push({ pubKey, comment });
- }
-
- let p = 0;
- const buf = Buffer.allocUnsafe(4 + 1 + totalKeysLen);
-
- writeUInt32BE(buf, buf.length - 4, p);
-
- buf[p += 4] = SSH_AGENT_IDENTITIES_ANSWER;
-
- writeUInt32BE(buf, newKeys.length, ++p);
- p += 4;
- for (let i = 0; i < newKeys.length; ++i) {
- const { pubKey, comment } = newKeys[i];
-
- writeUInt32BE(buf, pubKey.length, p);
- pubKey.copy(buf, p += 4);
-
- writeUInt32BE(buf, comment.length, p += pubKey.length);
- p += 4;
- if (comment.length) {
- comment.copy(buf, p);
- p += comment.length;
- }
- }
-
- return respond(this, req, buf);
- }
- signReply(req, signature) {
- if (this[SYM_MODE] !== ROLE_SERVER)
- throw new Error('Server-only method called with client role');
-
- if (!(req instanceof AgentInboundRequest))
- throw new Error('Wrong request argument');
-
- if (req.hasResponded())
- return true;
-
- /*
- byte SSH_AGENT_SIGN_RESPONSE
- string signature
- */
-
- if (req.getType() !== SSH_AGENTC_SIGN_REQUEST)
- throw new Error('Invalid response to request');
-
- if (!Buffer.isBuffer(signature))
- throw new Error('Signature argument must be a Buffer');
-
- if (signature.length === 0)
- throw new Error('Signature argument must be non-empty');
-
- /*
- OpenSSH agent signatures are encoded as:
-
- string signature format identifier (as specified by the
- public key/certificate format)
- byte[n] signature blob in format specific encoding.
- - This is actually a `string` for: rsa, dss, ecdsa, and ed25519
- types
- */
-
- let p = 0;
- const sigFormat = req.getContext();
- const sigFormatLen = Buffer.byteLength(sigFormat);
- const buf = Buffer.allocUnsafe(
- 4 + 1 + 4 + 4 + sigFormatLen + 4 + signature.length
- );
-
- writeUInt32BE(buf, buf.length - 4, p);
-
- buf[p += 4] = SSH_AGENT_SIGN_RESPONSE;
-
- writeUInt32BE(buf, 4 + sigFormatLen + 4 + signature.length, ++p);
- writeUInt32BE(buf, sigFormatLen, p += 4);
- buf.utf8Write(sigFormat, p += 4, sigFormatLen);
- writeUInt32BE(buf, signature.length, p += sigFormatLen);
- signature.copy(buf, p += 4);
-
- return respond(this, req, buf);
- }
- };
-})();
-
-const SYM_AGENT = Symbol('Agent');
-const SYM_AGENT_KEYS = Symbol('Agent Keys');
-const SYM_AGENT_KEYS_IDX = Symbol('Agent Keys Index');
-const SYM_AGENT_CBS = Symbol('Agent Init Callbacks');
-class AgentContext {
- constructor(agent) {
- if (typeof agent === 'string')
- agent = createAgent(agent);
- else if (!isAgent(agent))
- throw new Error('Invalid agent argument');
- this[SYM_AGENT] = agent;
- this[SYM_AGENT_KEYS] = null;
- this[SYM_AGENT_KEYS_IDX] = -1;
- this[SYM_AGENT_CBS] = null;
- }
- init(cb) {
- if (typeof cb !== 'function')
- cb = noop;
-
- if (this[SYM_AGENT_KEYS] === null) {
- if (this[SYM_AGENT_CBS] === null) {
- this[SYM_AGENT_CBS] = [cb];
-
- const doCbs = (...args) => {
- process.nextTick(() => {
- const cbs = this[SYM_AGENT_CBS];
- this[SYM_AGENT_CBS] = null;
- for (const cb of cbs)
- cb(...args);
- });
- };
-
- this[SYM_AGENT].getIdentities(once((err, keys) => {
- if (err)
- return doCbs(err);
-
- if (!Array.isArray(keys)) {
- return doCbs(new Error(
- 'Agent implementation failed to provide keys'
- ));
- }
-
- const newKeys = [];
- for (let key of keys) {
- key = parseKey(key);
- if (key instanceof Error) {
- // TODO: add debug output
- continue;
- }
- newKeys.push(key);
- }
-
- this[SYM_AGENT_KEYS] = newKeys;
- this[SYM_AGENT_KEYS_IDX] = -1;
- doCbs();
- }));
- } else {
- this[SYM_AGENT_CBS].push(cb);
- }
- } else {
- process.nextTick(cb);
- }
- }
- nextKey() {
- if (this[SYM_AGENT_KEYS] === null
- || ++this[SYM_AGENT_KEYS_IDX] >= this[SYM_AGENT_KEYS].length) {
- return false;
- }
-
- return this[SYM_AGENT_KEYS][this[SYM_AGENT_KEYS_IDX]];
- }
- currentKey() {
- if (this[SYM_AGENT_KEYS] === null
- || this[SYM_AGENT_KEYS_IDX] >= this[SYM_AGENT_KEYS].length) {
- return null;
- }
-
- return this[SYM_AGENT_KEYS][this[SYM_AGENT_KEYS_IDX]];
- }
- pos() {
- if (this[SYM_AGENT_KEYS] === null
- || this[SYM_AGENT_KEYS_IDX] >= this[SYM_AGENT_KEYS].length) {
- return -1;
- }
-
- return this[SYM_AGENT_KEYS_IDX];
- }
- reset() {
- this[SYM_AGENT_KEYS_IDX] = -1;
- }
-
- sign(...args) {
- this[SYM_AGENT].sign(...args);
- }
-}
-
-function isAgent(val) {
- return (val instanceof BaseAgent);
-}
-
-module.exports = {
- AgentContext,
- AgentProtocol,
- BaseAgent,
- createAgent,
- CygwinAgent,
- isAgent,
- OpenSSHAgent,
- PageantAgent,
-};
diff --git a/node_modules/ssh2/lib/client.js b/node_modules/ssh2/lib/client.js
deleted file mode 100644
index aa94ace..0000000
--- a/node_modules/ssh2/lib/client.js
+++ /dev/null
@@ -1,2141 +0,0 @@
-// TODO:
-// * add `.connected` or similar property to allow immediate connection
-// status checking
-// * add/improve debug output during user authentication phase
-'use strict';
-
-const {
- createHash,
- getHashes,
- randomFillSync,
-} = require('crypto');
-const { Socket } = require('net');
-const { lookup: dnsLookup } = require('dns');
-const EventEmitter = require('events');
-const HASHES = getHashes();
-
-const {
- COMPAT,
- CHANNEL_EXTENDED_DATATYPE: { STDERR },
- CHANNEL_OPEN_FAILURE,
- DEFAULT_CIPHER,
- DEFAULT_COMPRESSION,
- DEFAULT_KEX,
- DEFAULT_MAC,
- DEFAULT_SERVER_HOST_KEY,
- DISCONNECT_REASON,
- DISCONNECT_REASON_BY_VALUE,
- SUPPORTED_CIPHER,
- SUPPORTED_COMPRESSION,
- SUPPORTED_KEX,
- SUPPORTED_MAC,
- SUPPORTED_SERVER_HOST_KEY,
-} = require('./protocol/constants.js');
-const { init: cryptoInit } = require('./protocol/crypto.js');
-const Protocol = require('./protocol/Protocol.js');
-const { parseKey } = require('./protocol/keyParser.js');
-const { SFTP } = require('./protocol/SFTP.js');
-const {
- bufferCopy,
- makeBufferParser,
- makeError,
- readUInt32BE,
- sigSSHToASN1,
- writeUInt32BE,
-} = require('./protocol/utils.js');
-
-const { AgentContext, createAgent, isAgent } = require('./agent.js');
-const {
- Channel,
- MAX_WINDOW,
- PACKET_SIZE,
- windowAdjust,
- WINDOW_THRESHOLD,
-} = require('./Channel.js');
-const {
- ChannelManager,
- generateAlgorithmList,
- isWritable,
- onChannelOpenFailure,
- onCHANNEL_CLOSE,
-} = require('./utils.js');
-
-const bufferParser = makeBufferParser();
-const sigParser = makeBufferParser();
-const RE_OPENSSH = /^OpenSSH_(?:(?![0-4])\d)|(?:\d{2,})/;
-const noop = (err) => {};
-
-class Client extends EventEmitter {
- constructor() {
- super();
-
- this.config = {
- host: undefined,
- port: undefined,
- localAddress: undefined,
- localPort: undefined,
- forceIPv4: undefined,
- forceIPv6: undefined,
- keepaliveCountMax: undefined,
- keepaliveInterval: undefined,
- readyTimeout: undefined,
- ident: undefined,
-
- username: undefined,
- password: undefined,
- privateKey: undefined,
- tryKeyboard: undefined,
- agent: undefined,
- allowAgentFwd: undefined,
- authHandler: undefined,
-
- hostHashAlgo: undefined,
- hostHashCb: undefined,
- strictVendor: undefined,
- debug: undefined
- };
-
- this._agent = undefined;
- this._readyTimeout = undefined;
- this._chanMgr = undefined;
- this._callbacks = undefined;
- this._forwarding = undefined;
- this._forwardingUnix = undefined;
- this._acceptX11 = undefined;
- this._agentFwdEnabled = undefined;
- this._remoteVer = undefined;
-
- this._protocol = undefined;
- this._sock = undefined;
- this._resetKA = undefined;
- }
-
- connect(cfg) {
- if (this._sock && isWritable(this._sock)) {
- this.once('close', () => {
- this.connect(cfg);
- });
- this.end();
- return this;
- }
-
- this.config.host = cfg.hostname || cfg.host || 'localhost';
- this.config.port = cfg.port || 22;
- this.config.localAddress = (typeof cfg.localAddress === 'string'
- ? cfg.localAddress
- : undefined);
- this.config.localPort = (typeof cfg.localPort === 'string'
- || typeof cfg.localPort === 'number'
- ? cfg.localPort
- : undefined);
- this.config.forceIPv4 = cfg.forceIPv4 || false;
- this.config.forceIPv6 = cfg.forceIPv6 || false;
- this.config.keepaliveCountMax = (typeof cfg.keepaliveCountMax === 'number'
- && cfg.keepaliveCountMax >= 0
- ? cfg.keepaliveCountMax
- : 3);
- this.config.keepaliveInterval = (typeof cfg.keepaliveInterval === 'number'
- && cfg.keepaliveInterval > 0
- ? cfg.keepaliveInterval
- : 0);
- this.config.readyTimeout = (typeof cfg.readyTimeout === 'number'
- && cfg.readyTimeout >= 0
- ? cfg.readyTimeout
- : 20000);
- this.config.ident = (typeof cfg.ident === 'string'
- || Buffer.isBuffer(cfg.ident)
- ? cfg.ident
- : undefined);
-
- const algorithms = {
- kex: undefined,
- serverHostKey: undefined,
- cs: {
- cipher: undefined,
- mac: undefined,
- compress: undefined,
- lang: [],
- },
- sc: undefined,
- };
- let allOfferDefaults = true;
- if (typeof cfg.algorithms === 'object' && cfg.algorithms !== null) {
- algorithms.kex = generateAlgorithmList(cfg.algorithms.kex,
- DEFAULT_KEX,
- SUPPORTED_KEX);
- if (algorithms.kex !== DEFAULT_KEX)
- allOfferDefaults = false;
-
- algorithms.serverHostKey =
- generateAlgorithmList(cfg.algorithms.serverHostKey,
- DEFAULT_SERVER_HOST_KEY,
- SUPPORTED_SERVER_HOST_KEY);
- if (algorithms.serverHostKey !== DEFAULT_SERVER_HOST_KEY)
- allOfferDefaults = false;
-
- algorithms.cs.cipher = generateAlgorithmList(cfg.algorithms.cipher,
- DEFAULT_CIPHER,
- SUPPORTED_CIPHER);
- if (algorithms.cs.cipher !== DEFAULT_CIPHER)
- allOfferDefaults = false;
-
- algorithms.cs.mac = generateAlgorithmList(cfg.algorithms.hmac,
- DEFAULT_MAC,
- SUPPORTED_MAC);
- if (algorithms.cs.mac !== DEFAULT_MAC)
- allOfferDefaults = false;
-
- algorithms.cs.compress = generateAlgorithmList(cfg.algorithms.compress,
- DEFAULT_COMPRESSION,
- SUPPORTED_COMPRESSION);
- if (algorithms.cs.compress !== DEFAULT_COMPRESSION)
- allOfferDefaults = false;
-
- if (!allOfferDefaults)
- algorithms.sc = algorithms.cs;
- }
-
- if (typeof cfg.username === 'string')
- this.config.username = cfg.username;
- else if (typeof cfg.user === 'string')
- this.config.username = cfg.user;
- else
- throw new Error('Invalid username');
-
- this.config.password = (typeof cfg.password === 'string'
- ? cfg.password
- : undefined);
- this.config.privateKey = (typeof cfg.privateKey === 'string'
- || Buffer.isBuffer(cfg.privateKey)
- ? cfg.privateKey
- : undefined);
- this.config.localHostname = (typeof cfg.localHostname === 'string'
- ? cfg.localHostname
- : undefined);
- this.config.localUsername = (typeof cfg.localUsername === 'string'
- ? cfg.localUsername
- : undefined);
- this.config.tryKeyboard = (cfg.tryKeyboard === true);
- if (typeof cfg.agent === 'string' && cfg.agent.length)
- this.config.agent = createAgent(cfg.agent);
- else if (isAgent(cfg.agent))
- this.config.agent = cfg.agent;
- else
- this.config.agent = undefined;
- this.config.allowAgentFwd = (cfg.agentForward === true
- && this.config.agent !== undefined);
- let authHandler = this.config.authHandler = (
- typeof cfg.authHandler === 'function'
- || Array.isArray(cfg.authHandler)
- ? cfg.authHandler
- : undefined
- );
-
- this.config.strictVendor = (typeof cfg.strictVendor === 'boolean'
- ? cfg.strictVendor
- : true);
-
- const debug = this.config.debug = (typeof cfg.debug === 'function'
- ? cfg.debug
- : undefined);
-
- if (cfg.agentForward === true && !this.config.allowAgentFwd) {
- throw new Error(
- 'You must set a valid agent path to allow agent forwarding'
- );
- }
-
- let callbacks = this._callbacks = [];
- this._chanMgr = new ChannelManager(this);
- this._forwarding = {};
- this._forwardingUnix = {};
- this._acceptX11 = 0;
- this._agentFwdEnabled = false;
- this._agent = (this.config.agent ? this.config.agent : undefined);
- this._remoteVer = undefined;
- let privateKey;
-
- if (this.config.privateKey) {
- privateKey = parseKey(this.config.privateKey, cfg.passphrase);
- if (privateKey instanceof Error)
- throw new Error(`Cannot parse privateKey: ${privateKey.message}`);
- if (Array.isArray(privateKey)) {
- // OpenSSH's newer format only stores 1 key for now
- privateKey = privateKey[0];
- }
- if (privateKey.getPrivatePEM() === null) {
- throw new Error(
- 'privateKey value does not contain a (valid) private key'
- );
- }
- }
-
- let hostVerifier;
- if (typeof cfg.hostVerifier === 'function') {
- const hashCb = cfg.hostVerifier;
- let hashAlgo;
- if (HASHES.indexOf(cfg.hostHash) !== -1) {
- // Default to old behavior of hashing on user's behalf
- hashAlgo = cfg.hostHash;
- }
- hostVerifier = (key, verify) => {
- if (hashAlgo)
- key = createHash(hashAlgo).update(key).digest('hex');
- const ret = hashCb(key, verify);
- if (ret !== undefined)
- verify(ret);
- };
- }
-
- const sock = this._sock = (cfg.sock || new Socket());
- let ready = false;
- let sawHeader = false;
- if (this._protocol)
- this._protocol.cleanup();
- const DEBUG_HANDLER = (!debug ? undefined : (p, display, msg) => {
- debug(`Debug output from server: ${JSON.stringify(msg)}`);
- });
- let serverSigAlgs;
- const proto = this._protocol = new Protocol({
- ident: this.config.ident,
- offer: (allOfferDefaults ? undefined : algorithms),
- onWrite: (data) => {
- if (isWritable(sock))
- sock.write(data);
- },
- onError: (err) => {
- if (err.level === 'handshake')
- clearTimeout(this._readyTimeout);
- if (!proto._destruct)
- sock.removeAllListeners('data');
- this.emit('error', err);
- try {
- sock.end();
- } catch {}
- },
- onHeader: (header) => {
- sawHeader = true;
- this._remoteVer = header.versions.software;
- if (header.greeting)
- this.emit('greeting', header.greeting);
- },
- onHandshakeComplete: (negotiated) => {
- this.emit('handshake', negotiated);
- if (!ready) {
- ready = true;
- proto.service('ssh-userauth');
- }
- },
- debug,
- hostVerifier,
- messageHandlers: {
- DEBUG: DEBUG_HANDLER,
- DISCONNECT: (p, reason, desc) => {
- if (reason !== DISCONNECT_REASON.BY_APPLICATION) {
- if (!desc) {
- desc = DISCONNECT_REASON_BY_VALUE[reason];
- if (desc === undefined)
- desc = `Unexpected disconnection reason: ${reason}`;
- }
- const err = new Error(desc);
- err.code = reason;
- this.emit('error', err);
- }
- sock.end();
- },
- SERVICE_ACCEPT: (p, name) => {
- if (name === 'ssh-userauth')
- tryNextAuth();
- },
- EXT_INFO: (p, exts) => {
- if (serverSigAlgs === undefined) {
- for (const ext of exts) {
- if (ext.name === 'server-sig-algs') {
- serverSigAlgs = ext.algs;
- return;
- }
- }
- serverSigAlgs = null;
- }
- },
- USERAUTH_BANNER: (p, msg) => {
- this.emit('banner', msg);
- },
- USERAUTH_SUCCESS: (p) => {
- // Start keepalive mechanism
- resetKA();
-
- clearTimeout(this._readyTimeout);
-
- this.emit('ready');
- },
- USERAUTH_FAILURE: (p, authMethods, partialSuccess) => {
- // For key-based authentication, check if we should retry the current
- // key with a different algorithm first
- if (curAuth.keyAlgos) {
- const oldKeyAlgo = curAuth.keyAlgos[0][0];
- if (debug)
- debug(`Client: ${curAuth.type} (${oldKeyAlgo}) auth failed`);
- curAuth.keyAlgos.shift();
- if (curAuth.keyAlgos.length) {
- const [keyAlgo, hashAlgo] = curAuth.keyAlgos[0];
- switch (curAuth.type) {
- case 'agent':
- proto.authPK(
- curAuth.username,
- curAuth.agentCtx.currentKey(),
- keyAlgo
- );
- return;
- case 'publickey':
- proto.authPK(curAuth.username, curAuth.key, keyAlgo);
- return;
- case 'hostbased':
- proto.authHostbased(curAuth.username,
- curAuth.key,
- curAuth.localHostname,
- curAuth.localUsername,
- keyAlgo,
- (buf, cb) => {
- const signature = curAuth.key.sign(buf, hashAlgo);
- if (signature instanceof Error) {
- signature.message =
- `Error while signing with key: ${signature.message}`;
- signature.level = 'client-authentication';
- this.emit('error', signature);
- return tryNextAuth();
- }
-
- cb(signature);
- });
- return;
- }
- } else {
- curAuth.keyAlgos = undefined;
- }
- }
-
- if (curAuth.type === 'agent') {
- const pos = curAuth.agentCtx.pos();
- debug && debug(`Client: Agent key #${pos + 1} failed`);
- return tryNextAgentKey();
- }
-
- debug && debug(`Client: ${curAuth.type} auth failed`);
-
- curPartial = partialSuccess;
- curAuthsLeft = authMethods;
- tryNextAuth();
- },
- USERAUTH_PASSWD_CHANGEREQ: (p, prompt) => {
- if (curAuth.type === 'password') {
- // TODO: support a `changePrompt()` on `curAuth` that defaults to
- // emitting 'change password' as before
- this.emit('change password', prompt, (newPassword) => {
- proto.authPassword(
- this.config.username,
- this.config.password,
- newPassword
- );
- });
- }
- },
- USERAUTH_PK_OK: (p) => {
- let keyAlgo;
- let hashAlgo;
- if (curAuth.keyAlgos)
- [keyAlgo, hashAlgo] = curAuth.keyAlgos[0];
- if (curAuth.type === 'agent') {
- const key = curAuth.agentCtx.currentKey();
- proto.authPK(curAuth.username, key, keyAlgo, (buf, cb) => {
- const opts = { hash: hashAlgo };
- curAuth.agentCtx.sign(key, buf, opts, (err, signed) => {
- if (err) {
- err.level = 'agent';
- this.emit('error', err);
- } else {
- return cb(signed);
- }
-
- tryNextAgentKey();
- });
- });
- } else if (curAuth.type === 'publickey') {
- proto.authPK(curAuth.username, curAuth.key, keyAlgo, (buf, cb) => {
- const signature = curAuth.key.sign(buf, hashAlgo);
- if (signature instanceof Error) {
- signature.message =
- `Error signing data with key: ${signature.message}`;
- signature.level = 'client-authentication';
- this.emit('error', signature);
- return tryNextAuth();
- }
- cb(signature);
- });
- }
- },
- USERAUTH_INFO_REQUEST: (p, name, instructions, prompts) => {
- if (curAuth.type === 'keyboard-interactive') {
- const nprompts = (Array.isArray(prompts) ? prompts.length : 0);
- if (nprompts === 0) {
- debug && debug(
- 'Client: Sending automatic USERAUTH_INFO_RESPONSE'
- );
- proto.authInfoRes();
- return;
- }
- // We sent a keyboard-interactive user authentication request and
- // now the server is sending us the prompts we need to present to
- // the user
- curAuth.prompt(
- name,
- instructions,
- '',
- prompts,
- (answers) => {
- proto.authInfoRes(answers);
- }
- );
- }
- },
- REQUEST_SUCCESS: (p, data) => {
- if (callbacks.length)
- callbacks.shift()(false, data);
- },
- REQUEST_FAILURE: (p) => {
- if (callbacks.length)
- callbacks.shift()(true);
- },
- GLOBAL_REQUEST: (p, name, wantReply, data) => {
- switch (name) {
- case 'hostkeys-00@openssh.com':
- // Automatically verify keys before passing to end user
- hostKeysProve(this, data, (err, keys) => {
- if (err)
- return;
- this.emit('hostkeys', keys);
- });
- if (wantReply)
- proto.requestSuccess();
- break;
- default:
- // Auto-reject all other global requests, this can be especially
- // useful if the server is sending us dummy keepalive global
- // requests
- if (wantReply)
- proto.requestFailure();
- }
- },
- CHANNEL_OPEN: (p, info) => {
- // Handle incoming requests from server, typically a forwarded TCP or
- // X11 connection
- onCHANNEL_OPEN(this, info);
- },
- CHANNEL_OPEN_CONFIRMATION: (p, info) => {
- const channel = this._chanMgr.get(info.recipient);
- if (typeof channel !== 'function')
- return;
-
- const isSFTP = (channel.type === 'sftp');
- const type = (isSFTP ? 'session' : channel.type);
- const chanInfo = {
- type,
- incoming: {
- id: info.recipient,
- window: MAX_WINDOW,
- packetSize: PACKET_SIZE,
- state: 'open'
- },
- outgoing: {
- id: info.sender,
- window: info.window,
- packetSize: info.packetSize,
- state: 'open'
- }
- };
- const instance = (
- isSFTP
- ? new SFTP(this, chanInfo, { debug })
- : new Channel(this, chanInfo)
- );
- this._chanMgr.update(info.recipient, instance);
- channel(undefined, instance);
- },
- CHANNEL_OPEN_FAILURE: (p, recipient, reason, description) => {
- const channel = this._chanMgr.get(recipient);
- if (typeof channel !== 'function')
- return;
-
- const info = { reason, description };
- onChannelOpenFailure(this, recipient, info, channel);
- },
- CHANNEL_DATA: (p, recipient, data) => {
- const channel = this._chanMgr.get(recipient);
- if (typeof channel !== 'object' || channel === null)
- return;
-
- // The remote party should not be sending us data if there is no
- // window space available ...
- // TODO: raise error on data with not enough window?
- if (channel.incoming.window === 0)
- return;
-
- channel.incoming.window -= data.length;
-
- if (channel.push(data) === false) {
- channel._waitChanDrain = true;
- return;
- }
-
- if (channel.incoming.window <= WINDOW_THRESHOLD)
- windowAdjust(channel);
- },
- CHANNEL_EXTENDED_DATA: (p, recipient, data, type) => {
- if (type !== STDERR)
- return;
-
- const channel = this._chanMgr.get(recipient);
- if (typeof channel !== 'object' || channel === null)
- return;
-
- // The remote party should not be sending us data if there is no
- // window space available ...
- // TODO: raise error on data with not enough window?
- if (channel.incoming.window === 0)
- return;
-
- channel.incoming.window -= data.length;
-
- if (!channel.stderr.push(data)) {
- channel._waitChanDrain = true;
- return;
- }
-
- if (channel.incoming.window <= WINDOW_THRESHOLD)
- windowAdjust(channel);
- },
- CHANNEL_WINDOW_ADJUST: (p, recipient, amount) => {
- const channel = this._chanMgr.get(recipient);
- if (typeof channel !== 'object' || channel === null)
- return;
-
- // The other side is allowing us to send `amount` more bytes of data
- channel.outgoing.window += amount;
-
- if (channel._waitWindow) {
- channel._waitWindow = false;
-
- if (channel._chunk) {
- channel._write(channel._chunk, null, channel._chunkcb);
- } else if (channel._chunkcb) {
- channel._chunkcb();
- } else if (channel._chunkErr) {
- channel.stderr._write(channel._chunkErr,
- null,
- channel._chunkcbErr);
- } else if (channel._chunkcbErr) {
- channel._chunkcbErr();
- }
- }
- },
- CHANNEL_SUCCESS: (p, recipient) => {
- const channel = this._chanMgr.get(recipient);
- if (typeof channel !== 'object' || channel === null)
- return;
-
- this._resetKA();
-
- if (channel._callbacks.length)
- channel._callbacks.shift()(false);
- },
- CHANNEL_FAILURE: (p, recipient) => {
- const channel = this._chanMgr.get(recipient);
- if (typeof channel !== 'object' || channel === null)
- return;
-
- this._resetKA();
-
- if (channel._callbacks.length)
- channel._callbacks.shift()(true);
- },
- CHANNEL_REQUEST: (p, recipient, type, wantReply, data) => {
- const channel = this._chanMgr.get(recipient);
- if (typeof channel !== 'object' || channel === null)
- return;
-
- const exit = channel._exit;
- if (exit.code !== undefined)
- return;
- switch (type) {
- case 'exit-status':
- channel.emit('exit', exit.code = data);
- return;
- case 'exit-signal':
- channel.emit('exit',
- exit.code = null,
- exit.signal = `SIG${data.signal}`,
- exit.dump = data.coreDumped,
- exit.desc = data.errorMessage);
- return;
- }
-
- // Keepalive request? OpenSSH will send one as a channel request if
- // there is a channel open
-
- if (wantReply)
- p.channelFailure(channel.outgoing.id);
- },
- CHANNEL_EOF: (p, recipient) => {
- const channel = this._chanMgr.get(recipient);
- if (typeof channel !== 'object' || channel === null)
- return;
-
- if (channel.incoming.state !== 'open')
- return;
- channel.incoming.state = 'eof';
-
- if (channel.readable)
- channel.push(null);
- if (channel.stderr.readable)
- channel.stderr.push(null);
- },
- CHANNEL_CLOSE: (p, recipient) => {
- onCHANNEL_CLOSE(this, recipient, this._chanMgr.get(recipient));
- },
- },
- });
-
- sock.pause();
-
- // TODO: check keepalive implementation
- // Keepalive-related
- const kainterval = this.config.keepaliveInterval;
- const kacountmax = this.config.keepaliveCountMax;
- let kacount = 0;
- let katimer;
- const sendKA = () => {
- if (++kacount > kacountmax) {
- clearInterval(katimer);
- if (sock.readable) {
- const err = new Error('Keepalive timeout');
- err.level = 'client-timeout';
- this.emit('error', err);
- sock.destroy();
- }
- return;
- }
- if (isWritable(sock)) {
- // Append dummy callback to keep correct callback order
- callbacks.push(resetKA);
- proto.ping();
- } else {
- clearInterval(katimer);
- }
- };
- function resetKA() {
- if (kainterval > 0) {
- kacount = 0;
- clearInterval(katimer);
- if (isWritable(sock))
- katimer = setInterval(sendKA, kainterval);
- }
- }
- this._resetKA = resetKA;
-
- const onDone = (() => {
- let called = false;
- return () => {
- if (called)
- return;
- called = true;
- if (wasConnected && !sawHeader) {
- const err =
- makeError('Connection lost before handshake', 'protocol', true);
- this.emit('error', err);
- }
- };
- })();
- const onConnect = (() => {
- let called = false;
- return () => {
- if (called)
- return;
- called = true;
-
- wasConnected = true;
- debug && debug('Socket connected');
- this.emit('connect');
-
- cryptoInit.then(() => {
- proto.start();
- sock.on('data', (data) => {
- try {
- proto.parse(data, 0, data.length);
- } catch (ex) {
- this.emit('error', ex);
- try {
- if (isWritable(sock))
- sock.end();
- } catch {}
- }
- });
-
- // Drain stderr if we are connection hopping using an exec stream
- if (sock.stderr && typeof sock.stderr.resume === 'function')
- sock.stderr.resume();
-
- sock.resume();
- }).catch((err) => {
- this.emit('error', err);
- try {
- if (isWritable(sock))
- sock.end();
- } catch {}
- });
- };
- })();
- let wasConnected = false;
- sock.on('connect', onConnect)
- .on('timeout', () => {
- this.emit('timeout');
- }).on('error', (err) => {
- debug && debug(`Socket error: ${err.message}`);
- clearTimeout(this._readyTimeout);
- err.level = 'client-socket';
- this.emit('error', err);
- }).on('end', () => {
- debug && debug('Socket ended');
- onDone();
- proto.cleanup();
- clearTimeout(this._readyTimeout);
- clearInterval(katimer);
- this.emit('end');
- }).on('close', () => {
- debug && debug('Socket closed');
- onDone();
- proto.cleanup();
- clearTimeout(this._readyTimeout);
- clearInterval(katimer);
- this.emit('close');
-
- // Notify outstanding channel requests of disconnection ...
- const callbacks_ = callbacks;
- callbacks = this._callbacks = [];
- const err = new Error('No response from server');
- for (let i = 0; i < callbacks_.length; ++i)
- callbacks_[i](err);
-
- // Simulate error for any channels waiting to be opened
- this._chanMgr.cleanup(err);
- });
-
- // Begin authentication handling ===========================================
- let curAuth;
- let curPartial = null;
- let curAuthsLeft = null;
- const authsAllowed = ['none'];
- if (this.config.password !== undefined)
- authsAllowed.push('password');
- if (privateKey !== undefined)
- authsAllowed.push('publickey');
- if (this._agent !== undefined)
- authsAllowed.push('agent');
- if (this.config.tryKeyboard)
- authsAllowed.push('keyboard-interactive');
- if (privateKey !== undefined
- && this.config.localHostname !== undefined
- && this.config.localUsername !== undefined) {
- authsAllowed.push('hostbased');
- }
-
- if (Array.isArray(authHandler))
- authHandler = makeSimpleAuthHandler(authHandler);
- else if (typeof authHandler !== 'function')
- authHandler = makeSimpleAuthHandler(authsAllowed);
-
- let hasSentAuth = false;
- const doNextAuth = (nextAuth) => {
- if (hasSentAuth)
- return;
- hasSentAuth = true;
-
- if (nextAuth === false) {
- const err = new Error('All configured authentication methods failed');
- err.level = 'client-authentication';
- this.emit('error', err);
- this.end();
- return;
- }
-
- if (typeof nextAuth === 'string') {
- // Remain backwards compatible with original `authHandler()` usage,
- // which only supported passing names of next method to try using data
- // from the `connect()` config object
-
- const type = nextAuth;
- if (authsAllowed.indexOf(type) === -1)
- return skipAuth(`Authentication method not allowed: ${type}`);
-
- const username = this.config.username;
- switch (type) {
- case 'password':
- nextAuth = { type, username, password: this.config.password };
- break;
- case 'publickey':
- nextAuth = { type, username, key: privateKey };
- break;
- case 'hostbased':
- nextAuth = {
- type,
- username,
- key: privateKey,
- localHostname: this.config.localHostname,
- localUsername: this.config.localUsername,
- };
- break;
- case 'agent':
- nextAuth = {
- type,
- username,
- agentCtx: new AgentContext(this._agent),
- };
- break;
- case 'keyboard-interactive':
- nextAuth = {
- type,
- username,
- prompt: (...args) => this.emit('keyboard-interactive', ...args),
- };
- break;
- case 'none':
- nextAuth = { type, username };
- break;
- default:
- return skipAuth(
- `Skipping unsupported authentication method: ${nextAuth}`
- );
- }
- } else if (typeof nextAuth !== 'object' || nextAuth === null) {
- return skipAuth(
- `Skipping invalid authentication attempt: ${nextAuth}`
- );
- } else {
- const username = nextAuth.username;
- if (typeof username !== 'string') {
- return skipAuth(
- `Skipping invalid authentication attempt: ${nextAuth}`
- );
- }
- const type = nextAuth.type;
- switch (type) {
- case 'password': {
- const { password } = nextAuth;
- if (typeof password !== 'string' && !Buffer.isBuffer(password))
- return skipAuth('Skipping invalid password auth attempt');
- nextAuth = { type, username, password };
- break;
- }
- case 'publickey': {
- const key = parseKey(nextAuth.key, nextAuth.passphrase);
- if (key instanceof Error)
- return skipAuth('Skipping invalid key auth attempt');
- if (!key.isPrivateKey())
- return skipAuth('Skipping non-private key');
- nextAuth = { type, username, key };
- break;
- }
- case 'hostbased': {
- const { localHostname, localUsername } = nextAuth;
- const key = parseKey(nextAuth.key, nextAuth.passphrase);
- if (key instanceof Error
- || typeof localHostname !== 'string'
- || typeof localUsername !== 'string') {
- return skipAuth('Skipping invalid hostbased auth attempt');
- }
- if (!key.isPrivateKey())
- return skipAuth('Skipping non-private key');
- nextAuth = { type, username, key, localHostname, localUsername };
- break;
- }
- case 'agent': {
- let agent = nextAuth.agent;
- if (typeof agent === 'string' && agent.length) {
- agent = createAgent(agent);
- } else if (!isAgent(agent)) {
- return skipAuth(
- `Skipping invalid agent: ${nextAuth.agent}`
- );
- }
- nextAuth = { type, username, agentCtx: new AgentContext(agent) };
- break;
- }
- case 'keyboard-interactive': {
- const { prompt } = nextAuth;
- if (typeof prompt !== 'function') {
- return skipAuth(
- 'Skipping invalid keyboard-interactive auth attempt'
- );
- }
- nextAuth = { type, username, prompt };
- break;
- }
- case 'none':
- nextAuth = { type, username };
- break;
- default:
- return skipAuth(
- `Skipping unsupported authentication method: ${nextAuth}`
- );
- }
- }
- curAuth = nextAuth;
-
- // Begin authentication method's process
- try {
- const username = curAuth.username;
- switch (curAuth.type) {
- case 'password':
- proto.authPassword(username, curAuth.password);
- break;
- case 'publickey': {
- let keyAlgo;
- curAuth.keyAlgos = getKeyAlgos(this, curAuth.key, serverSigAlgs);
- if (curAuth.keyAlgos) {
- if (curAuth.keyAlgos.length) {
- keyAlgo = curAuth.keyAlgos[0][0];
- } else {
- return skipAuth(
- 'Skipping key authentication (no mutual hash algorithm)'
- );
- }
- }
- proto.authPK(username, curAuth.key, keyAlgo);
- break;
- }
- case 'hostbased': {
- let keyAlgo;
- let hashAlgo;
- curAuth.keyAlgos = getKeyAlgos(this, curAuth.key, serverSigAlgs);
- if (curAuth.keyAlgos) {
- if (curAuth.keyAlgos.length) {
- [keyAlgo, hashAlgo] = curAuth.keyAlgos[0];
- } else {
- return skipAuth(
- 'Skipping hostbased authentication (no mutual hash algorithm)'
- );
- }
- }
-
- proto.authHostbased(username,
- curAuth.key,
- curAuth.localHostname,
- curAuth.localUsername,
- keyAlgo,
- (buf, cb) => {
- const signature = curAuth.key.sign(buf, hashAlgo);
- if (signature instanceof Error) {
- signature.message =
- `Error while signing with key: ${signature.message}`;
- signature.level = 'client-authentication';
- this.emit('error', signature);
- return tryNextAuth();
- }
-
- cb(signature);
- });
- break;
- }
- case 'agent':
- curAuth.agentCtx.init((err) => {
- if (err) {
- err.level = 'agent';
- this.emit('error', err);
- return tryNextAuth();
- }
- tryNextAgentKey();
- });
- break;
- case 'keyboard-interactive':
- proto.authKeyboard(username);
- break;
- case 'none':
- proto.authNone(username);
- break;
- }
- } finally {
- hasSentAuth = false;
- }
- };
-
- function skipAuth(msg) {
- debug && debug(msg);
- process.nextTick(tryNextAuth);
- }
-
- function tryNextAuth() {
- hasSentAuth = false;
- const auth = authHandler(curAuthsLeft, curPartial, doNextAuth);
- if (hasSentAuth || auth === undefined)
- return;
- doNextAuth(auth);
- }
-
- const tryNextAgentKey = () => {
- if (curAuth.type === 'agent') {
- const key = curAuth.agentCtx.nextKey();
- if (key === false) {
- debug && debug('Agent: No more keys left to try');
- debug && debug('Client: agent auth failed');
- tryNextAuth();
- } else {
- const pos = curAuth.agentCtx.pos();
- let keyAlgo;
- curAuth.keyAlgos = getKeyAlgos(this, key, serverSigAlgs);
- if (curAuth.keyAlgos) {
- if (curAuth.keyAlgos.length) {
- keyAlgo = curAuth.keyAlgos[0][0];
- } else {
- debug && debug(
- `Agent: Skipping key #${pos + 1} (no mutual hash algorithm)`
- );
- tryNextAgentKey();
- return;
- }
- }
- debug && debug(`Agent: Trying key #${pos + 1}`);
- proto.authPK(curAuth.username, key, keyAlgo);
- }
- }
- };
-
- const startTimeout = () => {
- if (this.config.readyTimeout > 0) {
- this._readyTimeout = setTimeout(() => {
- const err = new Error('Timed out while waiting for handshake');
- err.level = 'client-timeout';
- this.emit('error', err);
- sock.destroy();
- }, this.config.readyTimeout);
- }
- };
-
- if (!cfg.sock) {
- let host = this.config.host;
- const forceIPv4 = this.config.forceIPv4;
- const forceIPv6 = this.config.forceIPv6;
-
- debug && debug(`Client: Trying ${host} on port ${this.config.port} ...`);
-
- const doConnect = () => {
- startTimeout();
- sock.connect({
- host,
- port: this.config.port,
- localAddress: this.config.localAddress,
- localPort: this.config.localPort
- });
- sock.setMaxListeners(0);
- sock.setTimeout(typeof cfg.timeout === 'number' ? cfg.timeout : 0);
- };
-
- if ((!forceIPv4 && !forceIPv6) || (forceIPv4 && forceIPv6)) {
- doConnect();
- } else {
- dnsLookup(host, (forceIPv4 ? 4 : 6), (err, address, family) => {
- if (err) {
- const type = (forceIPv4 ? 'IPv4' : 'IPv6');
- const error = new Error(
- `Error while looking up ${type} address for '${host}': ${err}`
- );
- clearTimeout(this._readyTimeout);
- error.level = 'client-dns';
- this.emit('error', error);
- this.emit('close');
- return;
- }
- host = address;
- doConnect();
- });
- }
- } else {
- // Custom socket passed in
- startTimeout();
- if (typeof sock.connecting === 'boolean') {
- // net.Socket
-
- if (!sock.connecting) {
- // Already connected
- onConnect();
- }
- } else {
- // Assume socket/stream is already "connected"
- onConnect();
- }
- }
-
- return this;
- }
-
- end() {
- if (this._sock && isWritable(this._sock)) {
- this._protocol.disconnect(DISCONNECT_REASON.BY_APPLICATION);
- this._sock.end();
- }
- return this;
- }
-
- destroy() {
- this._sock && isWritable(this._sock) && this._sock.destroy();
- return this;
- }
-
- exec(cmd, opts, cb) {
- if (!this._sock || !isWritable(this._sock))
- throw new Error('Not connected');
-
- if (typeof opts === 'function') {
- cb = opts;
- opts = {};
- }
-
- const extraOpts = { allowHalfOpen: (opts.allowHalfOpen !== false) };
-
- openChannel(this, 'session', extraOpts, (err, chan) => {
- if (err) {
- cb(err);
- return;
- }
-
- const todo = [];
-
- function reqCb(err) {
- if (err) {
- chan.close();
- cb(err);
- return;
- }
- if (todo.length)
- todo.shift()();
- }
-
- if (this.config.allowAgentFwd === true
- || (opts
- && opts.agentForward === true
- && this._agent !== undefined)) {
- todo.push(() => reqAgentFwd(chan, reqCb));
- }
-
- if (typeof opts === 'object' && opts !== null) {
- if (typeof opts.env === 'object' && opts.env !== null)
- reqEnv(chan, opts.env);
- if ((typeof opts.pty === 'object' && opts.pty !== null)
- || opts.pty === true) {
- todo.push(() => reqPty(chan, opts.pty, reqCb));
- }
- if ((typeof opts.x11 === 'object' && opts.x11 !== null)
- || opts.x11 === 'number'
- || opts.x11 === true) {
- todo.push(() => reqX11(chan, opts.x11, reqCb));
- }
- }
-
- todo.push(() => reqExec(chan, cmd, opts, cb));
- todo.shift()();
- });
-
- return this;
- }
-
- shell(wndopts, opts, cb) {
- if (!this._sock || !isWritable(this._sock))
- throw new Error('Not connected');
-
- if (typeof wndopts === 'function') {
- cb = wndopts;
- wndopts = opts = undefined;
- } else if (typeof opts === 'function') {
- cb = opts;
- opts = undefined;
- }
- if (wndopts && (wndopts.x11 !== undefined || wndopts.env !== undefined)) {
- opts = wndopts;
- wndopts = undefined;
- }
-
- openChannel(this, 'session', (err, chan) => {
- if (err) {
- cb(err);
- return;
- }
-
- const todo = [];
-
- function reqCb(err) {
- if (err) {
- chan.close();
- cb(err);
- return;
- }
- if (todo.length)
- todo.shift()();
- }
-
- if (this.config.allowAgentFwd === true
- || (opts
- && opts.agentForward === true
- && this._agent !== undefined)) {
- todo.push(() => reqAgentFwd(chan, reqCb));
- }
-
- if (wndopts !== false)
- todo.push(() => reqPty(chan, wndopts, reqCb));
-
- if (typeof opts === 'object' && opts !== null) {
- if (typeof opts.env === 'object' && opts.env !== null)
- reqEnv(chan, opts.env);
- if ((typeof opts.x11 === 'object' && opts.x11 !== null)
- || opts.x11 === 'number'
- || opts.x11 === true) {
- todo.push(() => reqX11(chan, opts.x11, reqCb));
- }
- }
-
- todo.push(() => reqShell(chan, cb));
- todo.shift()();
- });
-
- return this;
- }
-
- subsys(name, cb) {
- if (!this._sock || !isWritable(this._sock))
- throw new Error('Not connected');
-
- openChannel(this, 'session', (err, chan) => {
- if (err) {
- cb(err);
- return;
- }
-
- reqSubsystem(chan, name, (err, stream) => {
- if (err) {
- cb(err);
- return;
- }
-
- cb(undefined, stream);
- });
- });
-
- return this;
- }
-
- forwardIn(bindAddr, bindPort, cb) {
- if (!this._sock || !isWritable(this._sock))
- throw new Error('Not connected');
-
- // Send a request for the server to start forwarding TCP connections to us
- // on a particular address and port
-
- const wantReply = (typeof cb === 'function');
-
- if (wantReply) {
- this._callbacks.push((had_err, data) => {
- if (had_err) {
- cb(had_err !== true
- ? had_err
- : new Error(`Unable to bind to ${bindAddr}:${bindPort}`));
- return;
- }
-
- let realPort = bindPort;
- if (bindPort === 0 && data && data.length >= 4) {
- realPort = readUInt32BE(data, 0);
- if (!(this._protocol._compatFlags & COMPAT.DYN_RPORT_BUG))
- bindPort = realPort;
- }
-
- this._forwarding[`${bindAddr}:${bindPort}`] = realPort;
-
- cb(undefined, realPort);
- });
- }
-
- this._protocol.tcpipForward(bindAddr, bindPort, wantReply);
-
- return this;
- }
-
- unforwardIn(bindAddr, bindPort, cb) {
- if (!this._sock || !isWritable(this._sock))
- throw new Error('Not connected');
-
- // Send a request to stop forwarding us new connections for a particular
- // address and port
-
- const wantReply = (typeof cb === 'function');
-
- if (wantReply) {
- this._callbacks.push((had_err) => {
- if (had_err) {
- cb(had_err !== true
- ? had_err
- : new Error(`Unable to unbind from ${bindAddr}:${bindPort}`));
- return;
- }
-
- delete this._forwarding[`${bindAddr}:${bindPort}`];
-
- cb();
- });
- }
-
- this._protocol.cancelTcpipForward(bindAddr, bindPort, wantReply);
-
- return this;
- }
-
- forwardOut(srcIP, srcPort, dstIP, dstPort, cb) {
- if (!this._sock || !isWritable(this._sock))
- throw new Error('Not connected');
-
- // Send a request to forward a TCP connection to the server
-
- const cfg = {
- srcIP: srcIP,
- srcPort: srcPort,
- dstIP: dstIP,
- dstPort: dstPort
- };
-
- if (typeof cb !== 'function')
- cb = noop;
-
- openChannel(this, 'direct-tcpip', cfg, cb);
-
- return this;
- }
-
- openssh_noMoreSessions(cb) {
- if (!this._sock || !isWritable(this._sock))
- throw new Error('Not connected');
-
- const wantReply = (typeof cb === 'function');
-
- if (!this.config.strictVendor
- || (this.config.strictVendor && RE_OPENSSH.test(this._remoteVer))) {
- if (wantReply) {
- this._callbacks.push((had_err) => {
- if (had_err) {
- cb(had_err !== true
- ? had_err
- : new Error('Unable to disable future sessions'));
- return;
- }
-
- cb();
- });
- }
-
- this._protocol.openssh_noMoreSessions(wantReply);
- return this;
- }
-
- if (!wantReply)
- return this;
-
- process.nextTick(
- cb,
- new Error(
- 'strictVendor enabled and server is not OpenSSH or compatible version'
- )
- );
-
- return this;
- }
-
- openssh_forwardInStreamLocal(socketPath, cb) {
- if (!this._sock || !isWritable(this._sock))
- throw new Error('Not connected');
-
- const wantReply = (typeof cb === 'function');
-
- if (!this.config.strictVendor
- || (this.config.strictVendor && RE_OPENSSH.test(this._remoteVer))) {
- if (wantReply) {
- this._callbacks.push((had_err) => {
- if (had_err) {
- cb(had_err !== true
- ? had_err
- : new Error(`Unable to bind to ${socketPath}`));
- return;
- }
- this._forwardingUnix[socketPath] = true;
- cb();
- });
- }
-
- this._protocol.openssh_streamLocalForward(socketPath, wantReply);
- return this;
- }
-
- if (!wantReply)
- return this;
-
- process.nextTick(
- cb,
- new Error(
- 'strictVendor enabled and server is not OpenSSH or compatible version'
- )
- );
-
- return this;
- }
-
- openssh_unforwardInStreamLocal(socketPath, cb) {
- if (!this._sock || !isWritable(this._sock))
- throw new Error('Not connected');
-
- const wantReply = (typeof cb === 'function');
-
- if (!this.config.strictVendor
- || (this.config.strictVendor && RE_OPENSSH.test(this._remoteVer))) {
- if (wantReply) {
- this._callbacks.push((had_err) => {
- if (had_err) {
- cb(had_err !== true
- ? had_err
- : new Error(`Unable to unbind from ${socketPath}`));
- return;
- }
- delete this._forwardingUnix[socketPath];
- cb();
- });
- }
-
- this._protocol.openssh_cancelStreamLocalForward(socketPath, wantReply);
- return this;
- }
-
- if (!wantReply)
- return this;
-
- process.nextTick(
- cb,
- new Error(
- 'strictVendor enabled and server is not OpenSSH or compatible version'
- )
- );
-
- return this;
- }
-
- openssh_forwardOutStreamLocal(socketPath, cb) {
- if (!this._sock || !isWritable(this._sock))
- throw new Error('Not connected');
-
- if (typeof cb !== 'function')
- cb = noop;
-
- if (!this.config.strictVendor
- || (this.config.strictVendor && RE_OPENSSH.test(this._remoteVer))) {
- openChannel(this, 'direct-streamlocal@openssh.com', { socketPath }, cb);
- return this;
- }
- process.nextTick(
- cb,
- new Error(
- 'strictVendor enabled and server is not OpenSSH or compatible version'
- )
- );
-
- return this;
- }
-
- sftp(cb) {
- if (!this._sock || !isWritable(this._sock))
- throw new Error('Not connected');
-
- openChannel(this, 'sftp', (err, sftp) => {
- if (err) {
- cb(err);
- return;
- }
-
- reqSubsystem(sftp, 'sftp', (err, sftp_) => {
- if (err) {
- cb(err);
- return;
- }
-
- function removeListeners() {
- sftp.removeListener('ready', onReady);
- sftp.removeListener('error', onError);
- sftp.removeListener('exit', onExit);
- sftp.removeListener('close', onExit);
- }
-
- function onReady() {
- // TODO: do not remove exit/close in case remote end closes the
- // channel abruptly and we need to notify outstanding callbacks
- removeListeners();
- cb(undefined, sftp);
- }
-
- function onError(err) {
- removeListeners();
- cb(err);
- }
-
- function onExit(code, signal) {
- removeListeners();
- let msg;
- if (typeof code === 'number')
- msg = `Received exit code ${code} while establishing SFTP session`;
- else if (signal !== undefined)
- msg = `Received signal ${signal} while establishing SFTP session`;
- else
- msg = 'Received unexpected SFTP session termination';
- const err = new Error(msg);
- err.code = code;
- err.signal = signal;
- cb(err);
- }
-
- sftp.on('ready', onReady)
- .on('error', onError)
- .on('exit', onExit)
- .on('close', onExit);
-
- sftp._init();
- });
- });
-
- return this;
- }
-
- setNoDelay(noDelay) {
- if (this._sock && typeof this._sock.setNoDelay === 'function')
- this._sock.setNoDelay(noDelay);
-
- return this;
- }
-}
-
-function openChannel(self, type, opts, cb) {
- // Ask the server to open a channel for some purpose
- // (e.g. session (sftp, exec, shell), or forwarding a TCP connection
- const initWindow = MAX_WINDOW;
- const maxPacket = PACKET_SIZE;
-
- if (typeof opts === 'function') {
- cb = opts;
- opts = {};
- }
-
- const wrapper = (err, stream) => {
- cb(err, stream);
- };
- wrapper.type = type;
-
- const localChan = self._chanMgr.add(wrapper);
-
- if (localChan === -1) {
- cb(new Error('No free channels available'));
- return;
- }
-
- switch (type) {
- case 'session':
- case 'sftp':
- self._protocol.session(localChan, initWindow, maxPacket);
- break;
- case 'direct-tcpip':
- self._protocol.directTcpip(localChan, initWindow, maxPacket, opts);
- break;
- case 'direct-streamlocal@openssh.com':
- self._protocol.openssh_directStreamLocal(
- localChan, initWindow, maxPacket, opts
- );
- break;
- default:
- throw new Error(`Unsupported channel type: ${type}`);
- }
-}
-
-function reqX11(chan, screen, cb) {
- // Asks server to start sending us X11 connections
- const cfg = {
- single: false,
- protocol: 'MIT-MAGIC-COOKIE-1',
- cookie: undefined,
- screen: 0
- };
-
- if (typeof screen === 'function') {
- cb = screen;
- } else if (typeof screen === 'object' && screen !== null) {
- if (typeof screen.single === 'boolean')
- cfg.single = screen.single;
- if (typeof screen.screen === 'number')
- cfg.screen = screen.screen;
- if (typeof screen.protocol === 'string')
- cfg.protocol = screen.protocol;
- if (typeof screen.cookie === 'string')
- cfg.cookie = screen.cookie;
- else if (Buffer.isBuffer(screen.cookie))
- cfg.cookie = screen.cookie.hexSlice(0, screen.cookie.length);
- }
- if (cfg.cookie === undefined)
- cfg.cookie = randomCookie();
-
- const wantReply = (typeof cb === 'function');
-
- if (chan.outgoing.state !== 'open') {
- if (wantReply)
- cb(new Error('Channel is not open'));
- return;
- }
-
- if (wantReply) {
- chan._callbacks.push((had_err) => {
- if (had_err) {
- cb(had_err !== true ? had_err : new Error('Unable to request X11'));
- return;
- }
-
- chan._hasX11 = true;
- ++chan._client._acceptX11;
- chan.once('close', () => {
- if (chan._client._acceptX11)
- --chan._client._acceptX11;
- });
-
- cb();
- });
- }
-
- chan._client._protocol.x11Forward(chan.outgoing.id, cfg, wantReply);
-}
-
-function reqPty(chan, opts, cb) {
- let rows = 24;
- let cols = 80;
- let width = 640;
- let height = 480;
- let term = 'vt100';
- let modes = null;
-
- if (typeof opts === 'function') {
- cb = opts;
- } else if (typeof opts === 'object' && opts !== null) {
- if (typeof opts.rows === 'number')
- rows = opts.rows;
- if (typeof opts.cols === 'number')
- cols = opts.cols;
- if (typeof opts.width === 'number')
- width = opts.width;
- if (typeof opts.height === 'number')
- height = opts.height;
- if (typeof opts.term === 'string')
- term = opts.term;
- if (typeof opts.modes === 'object')
- modes = opts.modes;
- }
-
- const wantReply = (typeof cb === 'function');
-
- if (chan.outgoing.state !== 'open') {
- if (wantReply)
- cb(new Error('Channel is not open'));
- return;
- }
-
- if (wantReply) {
- chan._callbacks.push((had_err) => {
- if (had_err) {
- cb(had_err !== true
- ? had_err
- : new Error('Unable to request a pseudo-terminal'));
- return;
- }
- cb();
- });
- }
-
- chan._client._protocol.pty(chan.outgoing.id,
- rows,
- cols,
- height,
- width,
- term,
- modes,
- wantReply);
-}
-
-function reqAgentFwd(chan, cb) {
- const wantReply = (typeof cb === 'function');
-
- if (chan.outgoing.state !== 'open') {
- wantReply && cb(new Error('Channel is not open'));
- return;
- }
- if (chan._client._agentFwdEnabled) {
- wantReply && cb(false);
- return;
- }
-
- chan._client._agentFwdEnabled = true;
-
- chan._callbacks.push((had_err) => {
- if (had_err) {
- chan._client._agentFwdEnabled = false;
- if (wantReply) {
- cb(had_err !== true
- ? had_err
- : new Error('Unable to request agent forwarding'));
- }
- return;
- }
-
- if (wantReply)
- cb();
- });
-
- chan._client._protocol.openssh_agentForward(chan.outgoing.id, true);
-}
-
-function reqShell(chan, cb) {
- if (chan.outgoing.state !== 'open') {
- cb(new Error('Channel is not open'));
- return;
- }
-
- chan._callbacks.push((had_err) => {
- if (had_err) {
- cb(had_err !== true ? had_err : new Error('Unable to open shell'));
- return;
- }
- chan.subtype = 'shell';
- cb(undefined, chan);
- });
-
- chan._client._protocol.shell(chan.outgoing.id, true);
-}
-
-function reqExec(chan, cmd, opts, cb) {
- if (chan.outgoing.state !== 'open') {
- cb(new Error('Channel is not open'));
- return;
- }
-
- chan._callbacks.push((had_err) => {
- if (had_err) {
- cb(had_err !== true ? had_err : new Error('Unable to exec'));
- return;
- }
- chan.subtype = 'exec';
- chan.allowHalfOpen = (opts.allowHalfOpen !== false);
- cb(undefined, chan);
- });
-
- chan._client._protocol.exec(chan.outgoing.id, cmd, true);
-}
-
-function reqEnv(chan, env) {
- if (chan.outgoing.state !== 'open')
- return;
-
- const keys = Object.keys(env || {});
-
- for (let i = 0; i < keys.length; ++i) {
- const key = keys[i];
- const val = env[key];
- chan._client._protocol.env(chan.outgoing.id, key, val, false);
- }
-}
-
-function reqSubsystem(chan, name, cb) {
- if (chan.outgoing.state !== 'open') {
- cb(new Error('Channel is not open'));
- return;
- }
-
- chan._callbacks.push((had_err) => {
- if (had_err) {
- cb(had_err !== true
- ? had_err
- : new Error(`Unable to start subsystem: ${name}`));
- return;
- }
- chan.subtype = 'subsystem';
- cb(undefined, chan);
- });
-
- chan._client._protocol.subsystem(chan.outgoing.id, name, true);
-}
-
-// TODO: inline implementation into single call site
-function onCHANNEL_OPEN(self, info) {
- // The server is trying to open a channel with us, this is usually when
- // we asked the server to forward us connections on some port and now they
- // are asking us to accept/deny an incoming connection on their side
-
- let localChan = -1;
- let reason;
-
- const accept = () => {
- const chanInfo = {
- type: info.type,
- incoming: {
- id: localChan,
- window: MAX_WINDOW,
- packetSize: PACKET_SIZE,
- state: 'open'
- },
- outgoing: {
- id: info.sender,
- window: info.window,
- packetSize: info.packetSize,
- state: 'open'
- }
- };
- const stream = new Channel(self, chanInfo);
- self._chanMgr.update(localChan, stream);
-
- self._protocol.channelOpenConfirm(info.sender,
- localChan,
- MAX_WINDOW,
- PACKET_SIZE);
- return stream;
- };
- const reject = () => {
- if (reason === undefined) {
- if (localChan === -1)
- reason = CHANNEL_OPEN_FAILURE.RESOURCE_SHORTAGE;
- else
- reason = CHANNEL_OPEN_FAILURE.CONNECT_FAILED;
- }
-
- if (localChan !== -1)
- self._chanMgr.remove(localChan);
-
- self._protocol.channelOpenFail(info.sender, reason, '');
- };
- const reserveChannel = () => {
- localChan = self._chanMgr.add();
-
- if (localChan === -1) {
- reason = CHANNEL_OPEN_FAILURE.RESOURCE_SHORTAGE;
- if (self.config.debug) {
- self.config.debug(
- 'Client: Automatic rejection of incoming channel open: '
- + 'no channels available'
- );
- }
- }
-
- return (localChan !== -1);
- };
-
- const data = info.data;
- switch (info.type) {
- case 'forwarded-tcpip': {
- const val = self._forwarding[`${data.destIP}:${data.destPort}`];
- if (val !== undefined && reserveChannel()) {
- if (data.destPort === 0)
- data.destPort = val;
- self.emit('tcp connection', data, accept, reject);
- return;
- }
- break;
- }
- case 'forwarded-streamlocal@openssh.com':
- if (self._forwardingUnix[data.socketPath] !== undefined
- && reserveChannel()) {
- self.emit('unix connection', data, accept, reject);
- return;
- }
- break;
- case 'auth-agent@openssh.com':
- if (self._agentFwdEnabled
- && typeof self._agent.getStream === 'function'
- && reserveChannel()) {
- self._agent.getStream((err, stream) => {
- if (err)
- return reject();
-
- const upstream = accept();
- upstream.pipe(stream).pipe(upstream);
- });
- return;
- }
- break;
- case 'x11':
- if (self._acceptX11 !== 0 && reserveChannel()) {
- self.emit('x11', data, accept, reject);
- return;
- }
- break;
- default:
- // Automatically reject any unsupported channel open requests
- reason = CHANNEL_OPEN_FAILURE.UNKNOWN_CHANNEL_TYPE;
- if (self.config.debug) {
- self.config.debug(
- 'Client: Automatic rejection of unsupported incoming channel open '
- + `type: ${info.type}`
- );
- }
- }
-
- if (reason === undefined) {
- reason = CHANNEL_OPEN_FAILURE.ADMINISTRATIVELY_PROHIBITED;
- if (self.config.debug) {
- self.config.debug(
- 'Client: Automatic rejection of unexpected incoming channel open for: '
- + info.type
- );
- }
- }
-
- reject();
-}
-
-const randomCookie = (() => {
- const buffer = Buffer.allocUnsafe(16);
- return () => {
- randomFillSync(buffer, 0, 16);
- return buffer.hexSlice(0, 16);
- };
-})();
-
-function makeSimpleAuthHandler(authList) {
- if (!Array.isArray(authList))
- throw new Error('authList must be an array');
-
- let a = 0;
- return (authsLeft, partialSuccess, cb) => {
- if (a === authList.length)
- return false;
- return authList[a++];
- };
-}
-
-function hostKeysProve(client, keys_, cb) {
- if (!client._sock || !isWritable(client._sock))
- return;
-
- if (typeof cb !== 'function')
- cb = noop;
-
- if (!Array.isArray(keys_))
- throw new TypeError('Invalid keys argument type');
-
- const keys = [];
- for (const key of keys_) {
- const parsed = parseKey(key);
- if (parsed instanceof Error)
- throw parsed;
- keys.push(parsed);
- }
-
- if (!client.config.strictVendor
- || (client.config.strictVendor && RE_OPENSSH.test(client._remoteVer))) {
- client._callbacks.push((had_err, data) => {
- if (had_err) {
- cb(had_err !== true
- ? had_err
- : new Error('Server failed to prove supplied keys'));
- return;
- }
-
- // TODO: move all of this parsing/verifying logic out of the client?
- const ret = [];
- let keyIdx = 0;
- bufferParser.init(data, 0);
- while (bufferParser.avail()) {
- if (keyIdx === keys.length)
- break;
- const key = keys[keyIdx++];
- const keyPublic = key.getPublicSSH();
-
- const sigEntry = bufferParser.readString();
- sigParser.init(sigEntry, 0);
- const type = sigParser.readString(true);
- let value = sigParser.readString();
-
- let algo;
- if (type !== key.type) {
- if (key.type === 'ssh-rsa') {
- switch (type) {
- case 'rsa-sha2-256':
- algo = 'sha256';
- break;
- case 'rsa-sha2-512':
- algo = 'sha512';
- break;
- default:
- continue;
- }
- } else {
- continue;
- }
- }
-
- const sessionID = client._protocol._kex.sessionID;
- const verifyData = Buffer.allocUnsafe(
- 4 + 29 + 4 + sessionID.length + 4 + keyPublic.length
- );
- let p = 0;
- writeUInt32BE(verifyData, 29, p);
- verifyData.utf8Write('hostkeys-prove-00@openssh.com', p += 4, 29);
- writeUInt32BE(verifyData, sessionID.length, p += 29);
- bufferCopy(sessionID, verifyData, 0, sessionID.length, p += 4);
- writeUInt32BE(verifyData, keyPublic.length, p += sessionID.length);
- bufferCopy(keyPublic, verifyData, 0, keyPublic.length, p += 4);
-
- if (!(value = sigSSHToASN1(value, type)))
- continue;
- if (key.verify(verifyData, value, algo) === true)
- ret.push(key);
- }
- sigParser.clear();
- bufferParser.clear();
-
- cb(null, ret);
- });
-
- client._protocol.openssh_hostKeysProve(keys);
- return;
- }
-
- process.nextTick(
- cb,
- new Error(
- 'strictVendor enabled and server is not OpenSSH or compatible version'
- )
- );
-}
-
-function getKeyAlgos(client, key, serverSigAlgs) {
- switch (key.type) {
- case 'ssh-rsa':
- if (client._protocol._compatFlags & COMPAT.IMPLY_RSA_SHA2_SIGALGS) {
- if (!Array.isArray(serverSigAlgs))
- serverSigAlgs = ['rsa-sha2-256', 'rsa-sha2-512'];
- else
- serverSigAlgs = ['rsa-sha2-256', 'rsa-sha2-512', ...serverSigAlgs];
- }
- if (Array.isArray(serverSigAlgs)) {
- if (serverSigAlgs.indexOf('rsa-sha2-256') !== -1)
- return [['rsa-sha2-256', 'sha256']];
- if (serverSigAlgs.indexOf('rsa-sha2-512') !== -1)
- return [['rsa-sha2-512', 'sha512']];
- if (serverSigAlgs.indexOf('ssh-rsa') === -1)
- return [];
- }
- return [['ssh-rsa', 'sha1']];
- }
-}
-
-module.exports = Client;
diff --git a/node_modules/ssh2/lib/http-agents.js b/node_modules/ssh2/lib/http-agents.js
deleted file mode 100644
index 770a0e6..0000000
--- a/node_modules/ssh2/lib/http-agents.js
+++ /dev/null
@@ -1,84 +0,0 @@
-'use strict';
-
-const { Agent: HttpAgent } = require('http');
-const { Agent: HttpsAgent } = require('https');
-const { connect: tlsConnect } = require('tls');
-
-let Client;
-
-for (const ctor of [HttpAgent, HttpsAgent]) {
- class SSHAgent extends ctor {
- constructor(connectCfg, agentOptions) {
- super(agentOptions);
-
- this._connectCfg = connectCfg;
- this._defaultSrcIP = (agentOptions && agentOptions.srcIP) || 'localhost';
- }
-
- createConnection(options, cb) {
- const srcIP = (options && options.localAddress) || this._defaultSrcIP;
- const srcPort = (options && options.localPort) || 0;
- const dstIP = options.host;
- const dstPort = options.port;
-
- if (Client === undefined)
- Client = require('./client.js');
-
- const client = new Client();
- let triedForward = false;
- client.on('ready', () => {
- client.forwardOut(srcIP, srcPort, dstIP, dstPort, (err, stream) => {
- triedForward = true;
- if (err) {
- client.end();
- return cb(err);
- }
- stream.once('close', () => client.end());
- cb(null, decorateStream(stream, ctor, options));
- });
- }).on('error', cb).on('close', () => {
- if (!triedForward)
- cb(new Error('Unexpected connection close'));
- }).connect(this._connectCfg);
- }
- }
-
- exports[ctor === HttpAgent ? 'SSHTTPAgent' : 'SSHTTPSAgent'] = SSHAgent;
-}
-
-function noop() {}
-
-function decorateStream(stream, ctor, options) {
- if (ctor === HttpAgent) {
- // HTTP
- stream.setKeepAlive = noop;
- stream.setNoDelay = noop;
- stream.setTimeout = noop;
- stream.ref = noop;
- stream.unref = noop;
- stream.destroySoon = stream.destroy;
- return stream;
- }
-
- // HTTPS
- options.socket = stream;
- const wrapped = tlsConnect(options);
-
- // This is a workaround for a regression in node v12.16.3+
- // https://github.com/nodejs/node/issues/35904
- const onClose = (() => {
- let called = false;
- return () => {
- if (called)
- return;
- called = true;
- if (stream.isPaused())
- stream.resume();
- };
- })();
- // 'end' listener is needed because 'close' is not emitted in some scenarios
- // in node v12.x for some unknown reason
- wrapped.on('end', onClose).on('close', onClose);
-
- return wrapped;
-}
diff --git a/node_modules/ssh2/lib/server.js b/node_modules/ssh2/lib/server.js
deleted file mode 100644
index 306d658..0000000
--- a/node_modules/ssh2/lib/server.js
+++ /dev/null
@@ -1,1380 +0,0 @@
-// TODO:
-// * convert listenerCount() usage to emit() return value checking?
-// * emit error when connection severed early (e.g. before handshake)
-// * add '.connected' or similar property to connection objects to allow
-// immediate connection status checking
-'use strict';
-
-const { Server: netServer } = require('net');
-const EventEmitter = require('events');
-const { listenerCount } = EventEmitter;
-
-const {
- CHANNEL_OPEN_FAILURE,
- DEFAULT_CIPHER,
- DEFAULT_COMPRESSION,
- DEFAULT_KEX,
- DEFAULT_MAC,
- DEFAULT_SERVER_HOST_KEY,
- DISCONNECT_REASON,
- DISCONNECT_REASON_BY_VALUE,
- SUPPORTED_CIPHER,
- SUPPORTED_COMPRESSION,
- SUPPORTED_KEX,
- SUPPORTED_MAC,
- SUPPORTED_SERVER_HOST_KEY,
-} = require('./protocol/constants.js');
-const { init: cryptoInit } = require('./protocol/crypto.js');
-const { KexInit } = require('./protocol/kex.js');
-const { parseKey } = require('./protocol/keyParser.js');
-const Protocol = require('./protocol/Protocol.js');
-const { SFTP } = require('./protocol/SFTP.js');
-const { writeUInt32BE } = require('./protocol/utils.js');
-
-const {
- Channel,
- MAX_WINDOW,
- PACKET_SIZE,
- windowAdjust,
- WINDOW_THRESHOLD,
-} = require('./Channel.js');
-
-const {
- ChannelManager,
- generateAlgorithmList,
- isWritable,
- onChannelOpenFailure,
- onCHANNEL_CLOSE,
-} = require('./utils.js');
-
-const MAX_PENDING_AUTHS = 10;
-
-class AuthContext extends EventEmitter {
- constructor(protocol, username, service, method, cb) {
- super();
-
- this.username = this.user = username;
- this.service = service;
- this.method = method;
- this._initialResponse = false;
- this._finalResponse = false;
- this._multistep = false;
- this._cbfinal = (allowed, methodsLeft, isPartial) => {
- if (!this._finalResponse) {
- this._finalResponse = true;
- cb(this, allowed, methodsLeft, isPartial);
- }
- };
- this._protocol = protocol;
- }
-
- accept() {
- this._cleanup && this._cleanup();
- this._initialResponse = true;
- this._cbfinal(true);
- }
- reject(methodsLeft, isPartial) {
- this._cleanup && this._cleanup();
- this._initialResponse = true;
- this._cbfinal(false, methodsLeft, isPartial);
- }
-}
-
-
-class KeyboardAuthContext extends AuthContext {
- constructor(protocol, username, service, method, submethods, cb) {
- super(protocol, username, service, method, cb);
-
- this._multistep = true;
-
- this._cb = undefined;
- this._onInfoResponse = (responses) => {
- const callback = this._cb;
- if (callback) {
- this._cb = undefined;
- callback(responses);
- }
- };
- this.submethods = submethods;
- this.on('abort', () => {
- this._cb && this._cb(new Error('Authentication request aborted'));
- });
- }
-
- prompt(prompts, title, instructions, cb) {
- if (!Array.isArray(prompts))
- prompts = [ prompts ];
-
- if (typeof title === 'function') {
- cb = title;
- title = instructions = undefined;
- } else if (typeof instructions === 'function') {
- cb = instructions;
- instructions = undefined;
- } else if (typeof cb !== 'function') {
- cb = undefined;
- }
-
- for (let i = 0; i < prompts.length; ++i) {
- if (typeof prompts[i] === 'string') {
- prompts[i] = {
- prompt: prompts[i],
- echo: true
- };
- }
- }
-
- this._cb = cb;
- this._initialResponse = true;
-
- this._protocol.authInfoReq(title, instructions, prompts);
- }
-}
-
-class PKAuthContext extends AuthContext {
- constructor(protocol, username, service, method, pkInfo, cb) {
- super(protocol, username, service, method, cb);
-
- this.key = { algo: pkInfo.keyAlgo, data: pkInfo.key };
- this.hashAlgo = pkInfo.hashAlgo;
- this.signature = pkInfo.signature;
- this.blob = pkInfo.blob;
- }
-
- accept() {
- if (!this.signature) {
- this._initialResponse = true;
- this._protocol.authPKOK(this.key.algo, this.key.data);
- } else {
- AuthContext.prototype.accept.call(this);
- }
- }
-}
-
-class HostbasedAuthContext extends AuthContext {
- constructor(protocol, username, service, method, pkInfo, cb) {
- super(protocol, username, service, method, cb);
-
- this.key = { algo: pkInfo.keyAlgo, data: pkInfo.key };
- this.hashAlgo = pkInfo.hashAlgo;
- this.signature = pkInfo.signature;
- this.blob = pkInfo.blob;
- this.localHostname = pkInfo.localHostname;
- this.localUsername = pkInfo.localUsername;
- }
-}
-
-class PwdAuthContext extends AuthContext {
- constructor(protocol, username, service, method, password, cb) {
- super(protocol, username, service, method, cb);
-
- this.password = password;
- this._changeCb = undefined;
- }
-
- requestChange(prompt, cb) {
- if (this._changeCb)
- throw new Error('Change request already in progress');
- if (typeof prompt !== 'string')
- throw new Error('prompt argument must be a string');
- if (typeof cb !== 'function')
- throw new Error('Callback argument must be a function');
- this._changeCb = cb;
- this._protocol.authPasswdChg(prompt);
- }
-}
-
-
-class Session extends EventEmitter {
- constructor(client, info, localChan) {
- super();
-
- this.type = 'session';
- this.subtype = undefined;
- this.server = true;
- this._ending = false;
- this._channel = undefined;
- this._chanInfo = {
- type: 'session',
- incoming: {
- id: localChan,
- window: MAX_WINDOW,
- packetSize: PACKET_SIZE,
- state: 'open'
- },
- outgoing: {
- id: info.sender,
- window: info.window,
- packetSize: info.packetSize,
- state: 'open'
- }
- };
- }
-}
-
-
-class Server extends EventEmitter {
- constructor(cfg, listener) {
- super();
-
- if (typeof cfg !== 'object' || cfg === null)
- throw new Error('Missing configuration object');
-
- const hostKeys = Object.create(null);
- const hostKeyAlgoOrder = [];
-
- const hostKeys_ = cfg.hostKeys;
- if (!Array.isArray(hostKeys_))
- throw new Error('hostKeys must be an array');
-
- const cfgAlgos = (
- typeof cfg.algorithms === 'object' && cfg.algorithms !== null
- ? cfg.algorithms
- : {}
- );
-
- const hostKeyAlgos = generateAlgorithmList(
- cfgAlgos.serverHostKey,
- DEFAULT_SERVER_HOST_KEY,
- SUPPORTED_SERVER_HOST_KEY
- );
- for (let i = 0; i < hostKeys_.length; ++i) {
- let privateKey;
- if (Buffer.isBuffer(hostKeys_[i]) || typeof hostKeys_[i] === 'string')
- privateKey = parseKey(hostKeys_[i]);
- else
- privateKey = parseKey(hostKeys_[i].key, hostKeys_[i].passphrase);
-
- if (privateKey instanceof Error)
- throw new Error(`Cannot parse privateKey: ${privateKey.message}`);
-
- if (Array.isArray(privateKey)) {
- // OpenSSH's newer format only stores 1 key for now
- privateKey = privateKey[0];
- }
-
- if (privateKey.getPrivatePEM() === null)
- throw new Error('privateKey value contains an invalid private key');
-
- // Discard key if we already found a key of the same type
- if (hostKeyAlgoOrder.includes(privateKey.type))
- continue;
-
- if (privateKey.type === 'ssh-rsa') {
- // SSH supports multiple signature hashing algorithms for RSA, so we add
- // the algorithms in the desired order
- let sha1Pos = hostKeyAlgos.indexOf('ssh-rsa');
- const sha256Pos = hostKeyAlgos.indexOf('rsa-sha2-256');
- const sha512Pos = hostKeyAlgos.indexOf('rsa-sha2-512');
- if (sha1Pos === -1) {
- // Fall back to giving SHA1 the lowest priority
- sha1Pos = Infinity;
- }
- [sha1Pos, sha256Pos, sha512Pos].sort(compareNumbers).forEach((pos) => {
- if (pos === -1)
- return;
-
- let type;
- switch (pos) {
- case sha1Pos: type = 'ssh-rsa'; break;
- case sha256Pos: type = 'rsa-sha2-256'; break;
- case sha512Pos: type = 'rsa-sha2-512'; break;
- default: return;
- }
-
- // Store same RSA key under each hash algorithm name for convenience
- hostKeys[type] = privateKey;
-
- hostKeyAlgoOrder.push(type);
- });
- } else {
- hostKeys[privateKey.type] = privateKey;
- hostKeyAlgoOrder.push(privateKey.type);
- }
- }
-
- const algorithms = {
- kex: generateAlgorithmList(
- cfgAlgos.kex,
- DEFAULT_KEX,
- SUPPORTED_KEX
- ).concat(['kex-strict-s-v00@openssh.com']),
- serverHostKey: hostKeyAlgoOrder,
- cs: {
- cipher: generateAlgorithmList(
- cfgAlgos.cipher,
- DEFAULT_CIPHER,
- SUPPORTED_CIPHER
- ),
- mac: generateAlgorithmList(cfgAlgos.hmac, DEFAULT_MAC, SUPPORTED_MAC),
- compress: generateAlgorithmList(
- cfgAlgos.compress,
- DEFAULT_COMPRESSION,
- SUPPORTED_COMPRESSION
- ),
- lang: [],
- },
- sc: undefined,
- };
- algorithms.sc = algorithms.cs;
-
- if (typeof listener === 'function')
- this.on('connection', listener);
-
- const origDebug = (typeof cfg.debug === 'function' ? cfg.debug : undefined);
- const ident = (cfg.ident ? Buffer.from(cfg.ident) : undefined);
- const offer = new KexInit(algorithms);
-
- this._srv = new netServer((socket) => {
- if (this._connections >= this.maxConnections) {
- socket.destroy();
- return;
- }
- ++this._connections;
- socket.once('close', () => {
- --this._connections;
- });
-
- let debug;
- if (origDebug) {
- // Prepend debug output with a unique identifier in case there are
- // multiple clients connected at the same time
- const debugPrefix = `[${process.hrtime().join('.')}] `;
- debug = (msg) => {
- origDebug(`${debugPrefix}${msg}`);
- };
- }
-
- // eslint-disable-next-line no-use-before-define
- new Client(socket, hostKeys, ident, offer, debug, this, cfg);
- }).on('error', (err) => {
- this.emit('error', err);
- }).on('listening', () => {
- this.emit('listening');
- }).on('close', () => {
- this.emit('close');
- });
- this._connections = 0;
- this.maxConnections = Infinity;
- }
-
- injectSocket(socket) {
- this._srv.emit('connection', socket);
- }
-
- listen(...args) {
- this._srv.listen(...args);
- return this;
- }
-
- address() {
- return this._srv.address();
- }
-
- getConnections(cb) {
- this._srv.getConnections(cb);
- return this;
- }
-
- close(cb) {
- this._srv.close(cb);
- return this;
- }
-
- ref() {
- this._srv.ref();
- return this;
- }
-
- unref() {
- this._srv.unref();
- return this;
- }
-}
-Server.KEEPALIVE_CLIENT_INTERVAL = 15000;
-Server.KEEPALIVE_CLIENT_COUNT_MAX = 3;
-
-
-class Client extends EventEmitter {
- constructor(socket, hostKeys, ident, offer, debug, server, srvCfg) {
- super();
-
- let exchanges = 0;
- let acceptedAuthSvc = false;
- let pendingAuths = [];
- let authCtx;
- let kaTimer;
- let onPacket;
- const unsentGlobalRequestsReplies = [];
- this._sock = socket;
- this._chanMgr = new ChannelManager(this);
- this._debug = debug;
- this.noMoreSessions = false;
- this.authenticated = false;
-
- // Silence pre-header errors
- function onClientPreHeaderError(err) {}
- this.on('error', onClientPreHeaderError);
-
- const DEBUG_HANDLER = (!debug ? undefined : (p, display, msg) => {
- debug(`Debug output from client: ${JSON.stringify(msg)}`);
- });
-
- const kaIntvl = (
- typeof srvCfg.keepaliveInterval === 'number'
- && isFinite(srvCfg.keepaliveInterval)
- && srvCfg.keepaliveInterval > 0
- ? srvCfg.keepaliveInterval
- : (
- typeof Server.KEEPALIVE_CLIENT_INTERVAL === 'number'
- && isFinite(Server.KEEPALIVE_CLIENT_INTERVAL)
- && Server.KEEPALIVE_CLIENT_INTERVAL > 0
- ? Server.KEEPALIVE_CLIENT_INTERVAL
- : -1
- )
- );
- const kaCountMax = (
- typeof srvCfg.keepaliveCountMax === 'number'
- && isFinite(srvCfg.keepaliveCountMax)
- && srvCfg.keepaliveCountMax >= 0
- ? srvCfg.keepaliveCountMax
- : (
- typeof Server.KEEPALIVE_CLIENT_COUNT_MAX === 'number'
- && isFinite(Server.KEEPALIVE_CLIENT_COUNT_MAX)
- && Server.KEEPALIVE_CLIENT_COUNT_MAX >= 0
- ? Server.KEEPALIVE_CLIENT_COUNT_MAX
- : -1
- )
- );
- let kaCurCount = 0;
- if (kaIntvl !== -1 && kaCountMax !== -1) {
- this.once('ready', () => {
- const onClose = () => {
- clearInterval(kaTimer);
- };
- this.on('close', onClose).on('end', onClose);
- kaTimer = setInterval(() => {
- if (++kaCurCount > kaCountMax) {
- clearInterval(kaTimer);
- const err = new Error('Keepalive timeout');
- err.level = 'client-timeout';
- this.emit('error', err);
- this.end();
- } else {
- // XXX: if the server ever starts sending real global requests to
- // the client, we will need to add a dummy callback here to
- // keep the correct reply order
- proto.ping();
- }
- }, kaIntvl);
- });
- // TODO: re-verify keepalive behavior with OpenSSH
- onPacket = () => {
- kaTimer && kaTimer.refresh();
- kaCurCount = 0;
- };
- }
-
- const proto = this._protocol = new Protocol({
- server: true,
- hostKeys,
- ident,
- offer,
- onPacket,
- greeting: srvCfg.greeting,
- banner: srvCfg.banner,
- onWrite: (data) => {
- if (isWritable(socket))
- socket.write(data);
- },
- onError: (err) => {
- if (!proto._destruct)
- socket.removeAllListeners('data');
- this.emit('error', err);
- try {
- socket.end();
- } catch {}
- },
- onHeader: (header) => {
- this.removeListener('error', onClientPreHeaderError);
-
- const info = {
- ip: socket.remoteAddress,
- family: socket.remoteFamily,
- port: socket.remotePort,
- header,
- };
- if (!server.emit('connection', this, info)) {
- // auto reject
- proto.disconnect(DISCONNECT_REASON.BY_APPLICATION);
- socket.end();
- return;
- }
-
- if (header.greeting)
- this.emit('greeting', header.greeting);
- },
- onHandshakeComplete: (negotiated) => {
- if (++exchanges > 1)
- this.emit('rekey');
- this.emit('handshake', negotiated);
- },
- debug,
- messageHandlers: {
- DEBUG: DEBUG_HANDLER,
- DISCONNECT: (p, reason, desc) => {
- if (reason !== DISCONNECT_REASON.BY_APPLICATION) {
- if (!desc) {
- desc = DISCONNECT_REASON_BY_VALUE[reason];
- if (desc === undefined)
- desc = `Unexpected disconnection reason: ${reason}`;
- }
- const err = new Error(desc);
- err.code = reason;
- this.emit('error', err);
- }
- socket.end();
- },
- CHANNEL_OPEN: (p, info) => {
- // Handle incoming requests from client
-
- // Do early reject in some cases to prevent wasteful channel
- // allocation
- if ((info.type === 'session' && this.noMoreSessions)
- || !this.authenticated) {
- const reasonCode = CHANNEL_OPEN_FAILURE.ADMINISTRATIVELY_PROHIBITED;
- return proto.channelOpenFail(info.sender, reasonCode);
- }
-
- let localChan = -1;
- let reason;
- let replied = false;
-
- let accept;
- const reject = () => {
- if (replied)
- return;
- replied = true;
-
- if (reason === undefined) {
- if (localChan === -1)
- reason = CHANNEL_OPEN_FAILURE.RESOURCE_SHORTAGE;
- else
- reason = CHANNEL_OPEN_FAILURE.CONNECT_FAILED;
- }
-
- if (localChan !== -1)
- this._chanMgr.remove(localChan);
- proto.channelOpenFail(info.sender, reason, '');
- };
- const reserveChannel = () => {
- localChan = this._chanMgr.add();
-
- if (localChan === -1) {
- reason = CHANNEL_OPEN_FAILURE.RESOURCE_SHORTAGE;
- if (debug) {
- debug('Automatic rejection of incoming channel open: '
- + 'no channels available');
- }
- }
-
- return (localChan !== -1);
- };
-
- const data = info.data;
- switch (info.type) {
- case 'session':
- if (listenerCount(this, 'session') && reserveChannel()) {
- accept = () => {
- if (replied)
- return;
- replied = true;
-
- const instance = new Session(this, info, localChan);
- this._chanMgr.update(localChan, instance);
-
- proto.channelOpenConfirm(info.sender,
- localChan,
- MAX_WINDOW,
- PACKET_SIZE);
-
- return instance;
- };
-
- this.emit('session', accept, reject);
- return;
- }
- break;
- case 'direct-tcpip':
- if (listenerCount(this, 'tcpip') && reserveChannel()) {
- accept = () => {
- if (replied)
- return;
- replied = true;
-
- const chanInfo = {
- type: undefined,
- incoming: {
- id: localChan,
- window: MAX_WINDOW,
- packetSize: PACKET_SIZE,
- state: 'open'
- },
- outgoing: {
- id: info.sender,
- window: info.window,
- packetSize: info.packetSize,
- state: 'open'
- }
- };
-
- const stream = new Channel(this, chanInfo, { server: true });
- this._chanMgr.update(localChan, stream);
-
- proto.channelOpenConfirm(info.sender,
- localChan,
- MAX_WINDOW,
- PACKET_SIZE);
-
- return stream;
- };
-
- this.emit('tcpip', accept, reject, data);
- return;
- }
- break;
- case 'direct-streamlocal@openssh.com':
- if (listenerCount(this, 'openssh.streamlocal')
- && reserveChannel()) {
- accept = () => {
- if (replied)
- return;
- replied = true;
-
- const chanInfo = {
- type: undefined,
- incoming: {
- id: localChan,
- window: MAX_WINDOW,
- packetSize: PACKET_SIZE,
- state: 'open'
- },
- outgoing: {
- id: info.sender,
- window: info.window,
- packetSize: info.packetSize,
- state: 'open'
- }
- };
-
- const stream = new Channel(this, chanInfo, { server: true });
- this._chanMgr.update(localChan, stream);
-
- proto.channelOpenConfirm(info.sender,
- localChan,
- MAX_WINDOW,
- PACKET_SIZE);
-
- return stream;
- };
-
- this.emit('openssh.streamlocal', accept, reject, data);
- return;
- }
- break;
- default:
- // Automatically reject any unsupported channel open requests
- reason = CHANNEL_OPEN_FAILURE.UNKNOWN_CHANNEL_TYPE;
- if (debug) {
- debug('Automatic rejection of unsupported incoming channel open'
- + ` type: ${info.type}`);
- }
- }
-
- if (reason === undefined) {
- reason = CHANNEL_OPEN_FAILURE.ADMINISTRATIVELY_PROHIBITED;
- if (debug) {
- debug('Automatic rejection of unexpected incoming channel open'
- + ` for: ${info.type}`);
- }
- }
-
- reject();
- },
- CHANNEL_OPEN_CONFIRMATION: (p, info) => {
- const channel = this._chanMgr.get(info.recipient);
- if (typeof channel !== 'function')
- return;
-
- const chanInfo = {
- type: channel.type,
- incoming: {
- id: info.recipient,
- window: MAX_WINDOW,
- packetSize: PACKET_SIZE,
- state: 'open'
- },
- outgoing: {
- id: info.sender,
- window: info.window,
- packetSize: info.packetSize,
- state: 'open'
- }
- };
-
- const instance = new Channel(this, chanInfo, { server: true });
- this._chanMgr.update(info.recipient, instance);
- channel(undefined, instance);
- },
- CHANNEL_OPEN_FAILURE: (p, recipient, reason, description) => {
- const channel = this._chanMgr.get(recipient);
- if (typeof channel !== 'function')
- return;
-
- const info = { reason, description };
- onChannelOpenFailure(this, recipient, info, channel);
- },
- CHANNEL_DATA: (p, recipient, data) => {
- let channel = this._chanMgr.get(recipient);
- if (typeof channel !== 'object' || channel === null)
- return;
-
- if (channel.constructor === Session) {
- channel = channel._channel;
- if (!channel)
- return;
- }
-
- // The remote party should not be sending us data if there is no
- // window space available ...
- // TODO: raise error on data with not enough window?
- if (channel.incoming.window === 0)
- return;
-
- channel.incoming.window -= data.length;
-
- if (channel.push(data) === false) {
- channel._waitChanDrain = true;
- return;
- }
-
- if (channel.incoming.window <= WINDOW_THRESHOLD)
- windowAdjust(channel);
- },
- CHANNEL_EXTENDED_DATA: (p, recipient, data, type) => {
- // NOOP -- should not be sent by client
- },
- CHANNEL_WINDOW_ADJUST: (p, recipient, amount) => {
- let channel = this._chanMgr.get(recipient);
- if (typeof channel !== 'object' || channel === null)
- return;
-
- if (channel.constructor === Session) {
- channel = channel._channel;
- if (!channel)
- return;
- }
-
- // The other side is allowing us to send `amount` more bytes of data
- channel.outgoing.window += amount;
-
- if (channel._waitWindow) {
- channel._waitWindow = false;
-
- if (channel._chunk) {
- channel._write(channel._chunk, null, channel._chunkcb);
- } else if (channel._chunkcb) {
- channel._chunkcb();
- } else if (channel._chunkErr) {
- channel.stderr._write(channel._chunkErr,
- null,
- channel._chunkcbErr);
- } else if (channel._chunkcbErr) {
- channel._chunkcbErr();
- }
- }
- },
- CHANNEL_SUCCESS: (p, recipient) => {
- let channel = this._chanMgr.get(recipient);
- if (typeof channel !== 'object' || channel === null)
- return;
-
- if (channel.constructor === Session) {
- channel = channel._channel;
- if (!channel)
- return;
- }
-
- if (channel._callbacks.length)
- channel._callbacks.shift()(false);
- },
- CHANNEL_FAILURE: (p, recipient) => {
- let channel = this._chanMgr.get(recipient);
- if (typeof channel !== 'object' || channel === null)
- return;
-
- if (channel.constructor === Session) {
- channel = channel._channel;
- if (!channel)
- return;
- }
-
- if (channel._callbacks.length)
- channel._callbacks.shift()(true);
- },
- CHANNEL_REQUEST: (p, recipient, type, wantReply, data) => {
- const session = this._chanMgr.get(recipient);
- if (typeof session !== 'object' || session === null)
- return;
-
- let replied = false;
- let accept;
- let reject;
-
- if (session.constructor !== Session) {
- // normal Channel instance
- if (wantReply)
- proto.channelFailure(session.outgoing.id);
- return;
- }
-
- if (wantReply) {
- // "real session" requests will have custom accept behaviors
- if (type !== 'shell'
- && type !== 'exec'
- && type !== 'subsystem') {
- accept = () => {
- if (replied || session._ending || session._channel)
- return;
- replied = true;
-
- proto.channelSuccess(session._chanInfo.outgoing.id);
- };
- }
-
- reject = () => {
- if (replied || session._ending || session._channel)
- return;
- replied = true;
-
- proto.channelFailure(session._chanInfo.outgoing.id);
- };
- }
-
- if (session._ending) {
- reject && reject();
- return;
- }
-
- switch (type) {
- // "pre-real session start" requests
- case 'env':
- if (listenerCount(session, 'env')) {
- session.emit('env', accept, reject, {
- key: data.name,
- val: data.value
- });
- return;
- }
- break;
- case 'pty-req':
- if (listenerCount(session, 'pty')) {
- session.emit('pty', accept, reject, data);
- return;
- }
- break;
- case 'window-change':
- if (listenerCount(session, 'window-change'))
- session.emit('window-change', accept, reject, data);
- else
- reject && reject();
- break;
- case 'x11-req':
- if (listenerCount(session, 'x11')) {
- session.emit('x11', accept, reject, data);
- return;
- }
- break;
- // "post-real session start" requests
- case 'signal':
- if (listenerCount(session, 'signal')) {
- session.emit('signal', accept, reject, {
- name: data
- });
- return;
- }
- break;
- // XXX: is `auth-agent-req@openssh.com` really "post-real session
- // start"?
- case 'auth-agent-req@openssh.com':
- if (listenerCount(session, 'auth-agent')) {
- session.emit('auth-agent', accept, reject);
- return;
- }
- break;
- // "real session start" requests
- case 'shell':
- if (listenerCount(session, 'shell')) {
- accept = () => {
- if (replied || session._ending || session._channel)
- return;
- replied = true;
-
- if (wantReply)
- proto.channelSuccess(session._chanInfo.outgoing.id);
-
- const channel = new Channel(
- this, session._chanInfo, { server: true }
- );
-
- channel.subtype = session.subtype = type;
- session._channel = channel;
-
- return channel;
- };
-
- session.emit('shell', accept, reject);
- return;
- }
- break;
- case 'exec':
- if (listenerCount(session, 'exec')) {
- accept = () => {
- if (replied || session._ending || session._channel)
- return;
- replied = true;
-
- if (wantReply)
- proto.channelSuccess(session._chanInfo.outgoing.id);
-
- const channel = new Channel(
- this, session._chanInfo, { server: true }
- );
-
- channel.subtype = session.subtype = type;
- session._channel = channel;
-
- return channel;
- };
-
- session.emit('exec', accept, reject, {
- command: data
- });
- return;
- }
- break;
- case 'subsystem': {
- let useSFTP = (data === 'sftp');
- accept = () => {
- if (replied || session._ending || session._channel)
- return;
- replied = true;
-
- if (wantReply)
- proto.channelSuccess(session._chanInfo.outgoing.id);
-
- let instance;
- if (useSFTP) {
- instance = new SFTP(this, session._chanInfo, {
- server: true,
- debug,
- });
- } else {
- instance = new Channel(
- this, session._chanInfo, { server: true }
- );
- instance.subtype =
- session.subtype = `${type}:${data}`;
- }
- session._channel = instance;
-
- return instance;
- };
-
- if (data === 'sftp') {
- if (listenerCount(session, 'sftp')) {
- session.emit('sftp', accept, reject);
- return;
- }
- useSFTP = false;
- }
- if (listenerCount(session, 'subsystem')) {
- session.emit('subsystem', accept, reject, {
- name: data
- });
- return;
- }
- break;
- }
- }
- debug && debug(
- `Automatic rejection of incoming channel request: ${type}`
- );
- reject && reject();
- },
- CHANNEL_EOF: (p, recipient) => {
- let channel = this._chanMgr.get(recipient);
- if (typeof channel !== 'object' || channel === null)
- return;
-
- if (channel.constructor === Session) {
- if (!channel._ending) {
- channel._ending = true;
- channel.emit('eof');
- channel.emit('end');
- }
- channel = channel._channel;
- if (!channel)
- return;
- }
-
- if (channel.incoming.state !== 'open')
- return;
- channel.incoming.state = 'eof';
-
- if (channel.readable)
- channel.push(null);
- },
- CHANNEL_CLOSE: (p, recipient) => {
- let channel = this._chanMgr.get(recipient);
- if (typeof channel !== 'object' || channel === null)
- return;
-
- if (channel.constructor === Session) {
- channel._ending = true;
- channel.emit('close');
- channel = channel._channel;
- if (!channel)
- return;
- }
-
- onCHANNEL_CLOSE(this, recipient, channel);
- },
- // Begin service/auth-related ==========================================
- SERVICE_REQUEST: (p, service) => {
- if (exchanges === 0
- || acceptedAuthSvc
- || this.authenticated
- || service !== 'ssh-userauth') {
- proto.disconnect(DISCONNECT_REASON.SERVICE_NOT_AVAILABLE);
- socket.end();
- return;
- }
-
- acceptedAuthSvc = true;
- proto.serviceAccept(service);
- },
- USERAUTH_REQUEST: (p, username, service, method, methodData) => {
- if (exchanges === 0
- || this.authenticated
- || (authCtx
- && (authCtx.username !== username
- || authCtx.service !== service))
- // TODO: support hostbased auth
- || (method !== 'password'
- && method !== 'publickey'
- && method !== 'hostbased'
- && method !== 'keyboard-interactive'
- && method !== 'none')
- || pendingAuths.length === MAX_PENDING_AUTHS) {
- proto.disconnect(DISCONNECT_REASON.PROTOCOL_ERROR);
- socket.end();
- return;
- } else if (service !== 'ssh-connection') {
- proto.disconnect(DISCONNECT_REASON.SERVICE_NOT_AVAILABLE);
- socket.end();
- return;
- }
-
- let ctx;
- switch (method) {
- case 'keyboard-interactive':
- ctx = new KeyboardAuthContext(proto, username, service, method,
- methodData, onAuthDecide);
- break;
- case 'publickey':
- ctx = new PKAuthContext(proto, username, service, method,
- methodData, onAuthDecide);
- break;
- case 'hostbased':
- ctx = new HostbasedAuthContext(proto, username, service, method,
- methodData, onAuthDecide);
- break;
- case 'password':
- if (authCtx
- && authCtx instanceof PwdAuthContext
- && authCtx._changeCb) {
- const cb = authCtx._changeCb;
- authCtx._changeCb = undefined;
- cb(methodData.newPassword);
- return;
- }
- ctx = new PwdAuthContext(proto, username, service, method,
- methodData, onAuthDecide);
- break;
- case 'none':
- ctx = new AuthContext(proto, username, service, method,
- onAuthDecide);
- break;
- }
-
- if (authCtx) {
- if (!authCtx._initialResponse) {
- return pendingAuths.push(ctx);
- } else if (authCtx._multistep && !authCtx._finalResponse) {
- // RFC 4252 says to silently abort the current auth request if a
- // new auth request comes in before the final response from an
- // auth method that requires additional request/response exchanges
- // -- this means keyboard-interactive for now ...
- authCtx._cleanup && authCtx._cleanup();
- authCtx.emit('abort');
- }
- }
-
- authCtx = ctx;
-
- if (listenerCount(this, 'authentication'))
- this.emit('authentication', authCtx);
- else
- authCtx.reject();
- },
- USERAUTH_INFO_RESPONSE: (p, responses) => {
- if (authCtx && authCtx instanceof KeyboardAuthContext)
- authCtx._onInfoResponse(responses);
- },
- // End service/auth-related ============================================
- GLOBAL_REQUEST: (p, name, wantReply, data) => {
- const reply = {
- type: null,
- buf: null
- };
-
- function setReply(type, buf) {
- reply.type = type;
- reply.buf = buf;
- sendReplies();
- }
-
- if (wantReply)
- unsentGlobalRequestsReplies.push(reply);
-
- if ((name === 'tcpip-forward'
- || name === 'cancel-tcpip-forward'
- || name === 'no-more-sessions@openssh.com'
- || name === 'streamlocal-forward@openssh.com'
- || name === 'cancel-streamlocal-forward@openssh.com')
- && listenerCount(this, 'request')
- && this.authenticated) {
- let accept;
- let reject;
-
- if (wantReply) {
- let replied = false;
- accept = (chosenPort) => {
- if (replied)
- return;
- replied = true;
- let bufPort;
- if (name === 'tcpip-forward'
- && data.bindPort === 0
- && typeof chosenPort === 'number') {
- bufPort = Buffer.allocUnsafe(4);
- writeUInt32BE(bufPort, chosenPort, 0);
- }
- setReply('SUCCESS', bufPort);
- };
- reject = () => {
- if (replied)
- return;
- replied = true;
- setReply('FAILURE');
- };
- }
-
- if (name === 'no-more-sessions@openssh.com') {
- this.noMoreSessions = true;
- accept && accept();
- return;
- }
-
- this.emit('request', accept, reject, name, data);
- } else if (wantReply) {
- setReply('FAILURE');
- }
- },
- },
- });
-
- socket.pause();
- cryptoInit.then(() => {
- proto.start();
- socket.on('data', (data) => {
- try {
- proto.parse(data, 0, data.length);
- } catch (ex) {
- this.emit('error', ex);
- try {
- if (isWritable(socket))
- socket.end();
- } catch {}
- }
- });
- socket.resume();
- }).catch((err) => {
- this.emit('error', err);
- try {
- if (isWritable(socket))
- socket.end();
- } catch {}
- });
- socket.on('error', (err) => {
- err.level = 'socket';
- this.emit('error', err);
- }).once('end', () => {
- debug && debug('Socket ended');
- proto.cleanup();
- this.emit('end');
- }).once('close', () => {
- debug && debug('Socket closed');
- proto.cleanup();
- this.emit('close');
-
- const err = new Error('No response from server');
-
- // Simulate error for pending channels and close any open channels
- this._chanMgr.cleanup(err);
- });
-
- const onAuthDecide = (ctx, allowed, methodsLeft, isPartial) => {
- if (authCtx === ctx && !this.authenticated) {
- if (allowed) {
- authCtx = undefined;
- this.authenticated = true;
- proto.authSuccess();
- pendingAuths = [];
- this.emit('ready');
- } else {
- proto.authFailure(methodsLeft, isPartial);
- if (pendingAuths.length) {
- authCtx = pendingAuths.pop();
- if (listenerCount(this, 'authentication'))
- this.emit('authentication', authCtx);
- else
- authCtx.reject();
- }
- }
- }
- };
-
- function sendReplies() {
- while (unsentGlobalRequestsReplies.length > 0
- && unsentGlobalRequestsReplies[0].type) {
- const reply = unsentGlobalRequestsReplies.shift();
- if (reply.type === 'SUCCESS')
- proto.requestSuccess(reply.buf);
- if (reply.type === 'FAILURE')
- proto.requestFailure();
- }
- }
- }
-
- end() {
- if (this._sock && isWritable(this._sock)) {
- this._protocol.disconnect(DISCONNECT_REASON.BY_APPLICATION);
- this._sock.end();
- }
- return this;
- }
-
- x11(originAddr, originPort, cb) {
- const opts = { originAddr, originPort };
- openChannel(this, 'x11', opts, cb);
- return this;
- }
-
- forwardOut(boundAddr, boundPort, remoteAddr, remotePort, cb) {
- const opts = { boundAddr, boundPort, remoteAddr, remotePort };
- openChannel(this, 'forwarded-tcpip', opts, cb);
- return this;
- }
-
- openssh_forwardOutStreamLocal(socketPath, cb) {
- const opts = { socketPath };
- openChannel(this, 'forwarded-streamlocal@openssh.com', opts, cb);
- return this;
- }
-
- rekey(cb) {
- let error;
-
- try {
- this._protocol.rekey();
- } catch (ex) {
- error = ex;
- }
-
- // TODO: re-throw error if no callback?
-
- if (typeof cb === 'function') {
- if (error)
- process.nextTick(cb, error);
- else
- this.once('rekey', cb);
- }
- }
-
- setNoDelay(noDelay) {
- if (this._sock && typeof this._sock.setNoDelay === 'function')
- this._sock.setNoDelay(noDelay);
-
- return this;
- }
-}
-
-
-function openChannel(self, type, opts, cb) {
- // Ask the client to open a channel for some purpose (e.g. a forwarded TCP
- // connection)
- const initWindow = MAX_WINDOW;
- const maxPacket = PACKET_SIZE;
-
- if (typeof opts === 'function') {
- cb = opts;
- opts = {};
- }
-
- const wrapper = (err, stream) => {
- cb(err, stream);
- };
- wrapper.type = type;
-
- const localChan = self._chanMgr.add(wrapper);
-
- if (localChan === -1) {
- cb(new Error('No free channels available'));
- return;
- }
-
- switch (type) {
- case 'forwarded-tcpip':
- self._protocol.forwardedTcpip(localChan, initWindow, maxPacket, opts);
- break;
- case 'x11':
- self._protocol.x11(localChan, initWindow, maxPacket, opts);
- break;
- case 'forwarded-streamlocal@openssh.com':
- self._protocol.openssh_forwardedStreamLocal(
- localChan, initWindow, maxPacket, opts
- );
- break;
- default:
- throw new Error(`Unsupported channel type: ${type}`);
- }
-}
-
-function compareNumbers(a, b) {
- return a - b;
-}
-
-module.exports = Server;
-module.exports.IncomingClient = Client;
diff --git a/node_modules/ssh2/package.json b/node_modules/ssh2/package.json
deleted file mode 100644
index 06b143b..0000000
--- a/node_modules/ssh2/package.json
+++ /dev/null
@@ -1,49 +0,0 @@
-{
- "name": "ssh2",
- "version": "1.16.0",
- "author": "Brian White ",
- "description": "SSH2 client and server modules written in pure JavaScript for node.js",
- "main": "./lib/index.js",
- "engines": {
- "node": ">=10.16.0"
- },
- "dependencies": {
- "asn1": "^0.2.6",
- "bcrypt-pbkdf": "^1.0.2"
- },
- "devDependencies": {
- "@mscdex/eslint-config": "^1.1.0",
- "eslint": "^7.32.0"
- },
- "optionalDependencies": {
- "cpu-features": "~0.0.10",
- "nan": "^2.20.0"
- },
- "scripts": {
- "install": "node install.js",
- "rebuild": "node install.js",
- "test": "node test/test.js",
- "lint": "eslint --cache --report-unused-disable-directives --ext=.js .eslintrc.js examples lib test",
- "lint:fix": "npm run lint -- --fix"
- },
- "keywords": [
- "ssh",
- "ssh2",
- "sftp",
- "secure",
- "shell",
- "exec",
- "remote",
- "client"
- ],
- "licenses": [
- {
- "type": "MIT",
- "url": "http://github.com/mscdex/ssh2/raw/master/LICENSE"
- }
- ],
- "repository": {
- "type": "git",
- "url": "http://github.com/mscdex/ssh2.git"
- }
-}
diff --git a/node_modules/ssh2/test/fixtures/bad_rsa_private_key b/node_modules/ssh2/test/fixtures/bad_rsa_private_key
deleted file mode 100644
index 80fdc87..0000000
--- a/node_modules/ssh2/test/fixtures/bad_rsa_private_key
+++ /dev/null
@@ -1,26 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIEpQIBAAKCAQEAz7MF4vhgw6HxNf3KtVf3VULTYgrRSlv+cCZdB1xxI1p/nGyu
-/eekUn5C+mGeDS488DX5ulzicxVpL7pamc/tFNcp91MrR7PiIMK2l+bwbZJubbLj
-DHhNcBklnFOSKxtmQRfuorGakpy/kXmIxF5of0xXGns6DlHRq9dGCJIXvrkqhcEb
-k4n2y4aV4VOiMHdo6FrFQVPzA8DlbJP2SjIFZ/0VdK7O7eiyiqV1p1xlbTQQ5rAX
-LdsshBn/GvoBOTCVupMXurn2582vgGh26Mmovj2QGzScMGUVttkMlnxUmKT/aQka
-mC0vR54QOW7lyWPjAitOV0qgmtGm3/cl7W7NjwIDAQABAoIBAFxH0C+951BEXWV9
-s1jLEqshG8YNxFtjcDLn+KFSoznv9Y7MgxtwlgPI8X1Jbe2xQ4X+lUwGBN7Y/nkk
-NSjtxwphZtXqb+pVs/yWRoZLJzunucSnnFVoBg/uPFWuk9zvOYlmVrKWcnT9i+fY
-tbl5sLgOdQzg/zRpidztssIQFti3o2jnpyrEGcepPWLkfCgqPfGmNv78BAIt/6iT
-zYDB4GMSq/LnPTIOFsIOvlkZg3RCcLWeAPRC+lvFQVY+M/uJL5WIbA5il1IMMKH7
-MULWpRO3lnb1JVrkZlBldK5uew6AN3tHDQOmg+C2JuIbOZ35J9dcnwsE+IptWWBj
-XiFRJCECgYEA8BeuufkslureqOycaPLMkqchMTue1OxbLJFvPN+dh/cW6Lng3b8+
-xAyzZrc0vccH/jl9WVHhIZ7TcKXDzSmmrtnZ/3m1c4gANGqIPwO+emL1ZzzkIKGd
-FrLeBZKP4TWry9kjg4cG1SKGpcB5ngJMPXUxMZNe74tC4Hk820PkFjcCgYEA3XXn
-ngRCgH9N1eKSD2daxxlBhTTSnTgjU+dDaDFQzPIhJCcS8HwyQBQmNTOSXXK9sShC
-fdXAsmiBby5WEBq/K5+cXeDG2ZlFLyPovEgTUrLgraw42PYs0+A8Ls7dFk7PuMez
-3G2gUPkY039JiyXKfcog9/dIRfbWCwzQ6s7TV2kCgYEArsme81cahhgg1zvCNokk
-M1Omz2/HFt2nFpAeOmPVDGnu7Kh9sxGKgTF53bpclBh0kjiKL99zFYXKCoUzQYYk
-CcEhemLBnYUSGRbBb5arMfAfFfR3Y+YkNaUsC0SCqILpOfMvbo57g+ipu7ufDlA/
-7rIFiUDvaVap7j909W+8egsCgYEAsuc/0DBixMmSyHl7QwRcmkC15HVSu32RVIOb
-ub01KAtmaH1EWJAMTCW64/mggOtjgI0kgeE/BSFVhsqo7eOdkhEj0db27OxbroRU
-zF1xdrpYtRRO7D6a4iLgm3OzuQS72+tASo8pFqDUxG6sq8NAvLOgRJE4ioSoT07w
-KvAgXRkCgYEAmWgcsX/BdNcKOteSDtPkys5NRtWCBz7Coxb+xXXoXz1FVegBolpY
-wXVePvXTIbU8VJOLunMyH5wpmMUiJbTX9v2o/yfpsH0ci4GaAeVtqpA=
------END RSA PRIVATE KEY-----
\ No newline at end of file
diff --git a/node_modules/ssh2/test/fixtures/id_dsa b/node_modules/ssh2/test/fixtures/id_dsa
deleted file mode 100644
index d9c9b5b..0000000
--- a/node_modules/ssh2/test/fixtures/id_dsa
+++ /dev/null
@@ -1,12 +0,0 @@
------BEGIN DSA PRIVATE KEY-----
-MIIBuwIBAAKBgQC3/2VIGHgqHuxvhPa6rryqqLy6sQmjeSIwyrIW5F/o8W4sz/mE
-0noDSW4PaoXjgPQv5egj1EByws6dMOUqLaZHNWNn+Lh/jkKlwKyhbSCAjqoWH3v3
-uI1j58GO/eZ2+REijfyA0XJxdm7kqEexxbg0UpFr1F/eLBUxpLIbhhS1cwIVAKcB
-B9DnAObuPJGTwYTCaIIBQDy9AoGAJicW0pIFwgoTYsIeywmUQopJ3FQ4M3eDwQ0U
-T33pzWvBZFN2OsUDTFg64PNm9ow09wk042qMg168eKCUTp2iR/Y9R4xTj8dls8iv
-aMGMZ/B32eURIjUREGiXYTyG1pfuB2znSvr/5pavhuz5yG9M0AJCiYiexdaQKO3N
-oJp6T3ACgYEAsep79p4WljnawrJc928zGq6dLYjs+5apYhqx4vf2l3Z2u26VqVNG
-i5zZkUzhWQYV3/qtEOpO43dyZTHW+d9L8ni6HbXFWRVx60WE+5WKkzkimHJ6gox2
-kDvOqPudiS34KJOCEYYLEnJmK8aUZBZzWFORXkN8QgA/h9ts8AU785UCFAVXZMWq
-CteWCH2HzcY2x/65dMwL
------END DSA PRIVATE KEY-----
diff --git a/node_modules/ssh2/test/fixtures/id_ecdsa b/node_modules/ssh2/test/fixtures/id_ecdsa
deleted file mode 100644
index 036e3b6..0000000
--- a/node_modules/ssh2/test/fixtures/id_ecdsa
+++ /dev/null
@@ -1,5 +0,0 @@
------BEGIN EC PRIVATE KEY-----
-MHcCAQEEIPMZuWP7fMsZeyC1XXVUALVebJOX7PTwmsPql9qG25SeoAoGCCqGSM49
-AwEHoUQDQgAEB/B6mC5lrekKPWfGEkKpnCk08+dRnzFUg2jUHpaIrOTt4jGdvq6T
-yAN57asB+PYmFyVIpi35NcmicF18qX3ayg==
------END EC PRIVATE KEY-----
diff --git a/node_modules/ssh2/test/fixtures/id_rsa b/node_modules/ssh2/test/fixtures/id_rsa
deleted file mode 100644
index 90a6f72..0000000
--- a/node_modules/ssh2/test/fixtures/id_rsa
+++ /dev/null
@@ -1,15 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIICXQIBAAKBgQDL0yFO4W4xbdrJk/i+CW3itPATvhRkS+x+gKmkdH739AqWYP6r
-kTFAmFTw9gLJ/c2tN7ow0T0QUR9iUsv/3QzTuwsjBu0feo3CVxwMkaJTo5ks9XBo
-OW0R3tyCcOLlAcQ1WjC7cv5Ifn4gXLLM+k8/y/m3u8ERtidNxbRqpQ/gPQIDAQAB
-AoGABirSRC/ABNDdIOJQUXe5knWFGiPTPCGr+zvrZiV8PgZtV5WBvzE6e0jgsRXQ
-icobMhWQla+PGHJL786vi4NlwuhwKcF7Pd908ofej1eeBOd1u/HQ/qsfxPdxI0zF
-dcWPYgAOo9ydOMGcSx4v1zDIgFInELJzKbv64LJQD0/xhoUCQQD7KhJ7M8Nkwsr2
-iKCyWTFM2M8/VKltgaiSmsNKZETashk5tKOrM3EWX4RcB/DnvHe8VNyYpC6Sd1uQ
-AHwPDfxDAkEAz7+7hDybH6Cfvmr8kUOlDXiJJWXp5lP37FLzMDU6a9wTKZFnh57F
-e91zRmKlQTegFet93MXaFYljRkI+4lMpfwJBAPPLbNEF973Qjq4rBMDZbs9HDDRO
-+35+AqD7dGC7X1Jg2bd3rf66GiU7ZgDm/GIUQK0gOlg31bT6AniO39zFGH0CQFBh
-Yd9HR8nT7xrQ8EoQPzNYGNBUf0xz3rAcZCWZ4rHK48sojEMoBkbnputrzX7PU+xH
-QlqCXuAIWVXc2dHd1WcCQQDIUJHPOsgeAfTLoRRRURp/m8zZ9IpbaPTyDstPVNYe
-zARW3Oa/tzPqdO6NWaetCp17u7Kb6X9np7Vz17i/4KED
------END RSA PRIVATE KEY-----
diff --git a/node_modules/ssh2/test/fixtures/id_rsa.ppk b/node_modules/ssh2/test/fixtures/id_rsa.ppk
deleted file mode 100644
index 4504f18..0000000
--- a/node_modules/ssh2/test/fixtures/id_rsa.ppk
+++ /dev/null
@@ -1,26 +0,0 @@
-PuTTY-User-Key-File-2: ssh-rsa
-Encryption: none
-Comment: rsa-key-20150522
-Public-Lines: 6
-AAAAB3NzaC1yc2EAAAABJQAAAQB1quqP0rhl78NOLD4lj+1x5FGAqZ3aqo6GiEPz
-KOaQmy86FuJMK0nHj3gUKTa/Kvaa+8PZyeu+uVseHg47YrynCOcJEEnpqvbArc8M
-xMWuUnTUMrjvokGDOBBiQu4UAE4bybpgXkNHJfbrcDVgivmv3Ikn8PVIZ1rLBMLZ
-6Lzn0rjPjFD0X4WqsAJW2SFiZnsjMZtVL2TWadNTyyfjjm2NCRBvd32VLohkSe9Q
-BZBD6MW8YQyBKUnEF/7WNY0eehDVrfx1YqPOV1bDwFUhRaAYpLDLDR0KCAPvx7qb
-8G5Cq0TIBsEr3H8ztNRcOTQoaKgn0T18M7cyS4ykoNLYW4Zx
-Private-Lines: 14
-AAABACyF3DZraF3sBLXLjSL4MFSblHXfUHxAiPSiQzlpa/9dUCPRTrUJddzOgHZU
-yJtcXU9mLm4VDRe7wZyxbSs6Hd5WZUGzIuLLEUH8k4hKdE/MLDSdkhV7qhX5iaij
-tAeRaammRoVUGXTd7rnzGx2cXnnkvkZ22VmqkQ6MLg1DTmWNfOO9cdwFGdQawf/n
-yUV0nTkWsHXy5Qrozq9wRFk8eyw+pFllxqavsNftZX8VDiQt27JLZPTU4LGkH660
-3gq1KhNS/l05TlXnMZGjlcPN8UEaBzmCWRezhJSttjs5Kgp1K3yDf4ozMR/HWOCj
-Jq8fd3VIgli6ML8yjr/c0A0T9MUAAACBAL1/byxHiCvY/2C+/L5T+ZZq13jdZuYK
-MmOFaNITgEdNGWSIFYRzhLKGXj7awQWOIW6chj470GNOfQjFL1TvXhbwfqW6esDa
-kETOYQPYQHZijABcn7uurMUm/bu5x/z9gYkAfniOCI5vmvMvJ09JcZ0iUmFWDZZY
-fAutBvrt+n/vAAAAgQCe9jrA51wn1/wzKmWF+2+OWFUG9usheIcEbHB8mxLguLfU
-+x4i+2vLo0FtXEPAw+Bt7Tge4t0m6USiVZXtW/QKsh0kMj4mNVHFz+XXw4l1QOYv
-n5TjnLepiP7majXv4GHI2eOcHkyly4sIkj4jNLYqvT86hMxW4IC+jtJEWhn/nwAA
-AIEAlJ8cExu2WrWukTDJQHrVegtvdJUhNjol2wLucPuWwSxKuB8FHYwaPRYRkf3d
-DkZ53hhjJZ0BVkAaQ28uqM09xKD+q1H4/r0nnbtlV4uHLl3cCD5mGrH8I/iDPJX4
-fFIqCa0+n1D6RzvDqs1QIu+PGSp0K6vHOOS5fP0ZpuT025E=
-Private-MAC: 4ca26008c85b901f4d2766b0924c25e527678d7e
diff --git a/node_modules/ssh2/test/fixtures/id_rsa_enc b/node_modules/ssh2/test/fixtures/id_rsa_enc
deleted file mode 100644
index 75a1e95..0000000
--- a/node_modules/ssh2/test/fixtures/id_rsa_enc
+++ /dev/null
@@ -1,30 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-Proc-Type: 4,ENCRYPTED
-DEK-Info: AES-128-CBC,CCE70744FB28F2EFB1D74377281A780C
-
-1WiGnqpSGXFIg+WYr7T2XN72C1YrNQ1jmRISb32TB/Rh2Zo47fjyQnv9impz8b6m
-91R/qF7uCLI0fswvT5oqwn1L0vUAA0YtW/E2IQJEx5GPiaexoDJYYfu2yy036Kca
-e9VtCajgrV+kycg1CknCxQKMcKXNq8Czvq66PM4Bzknek5hhdmxHxOl0QAE+8EXt
-pnasOGz3szTUKkD6givwWgvDXY3BnVG46fXff99Xqgb6fx5IDbAkVKaxWIN/c81E
-b0rcfyoLb7yjPgNYn9vUI6Z+24NMYUYARzb3dG5geaeX0BYb/VlCtJUsP0Rp2P2P
-jl+cdvBKaeOvA9gPo/jAtSOFexQRs7AzKzoOLYU1fokd8HhqxOKAljn9ujmEqif7
-qcimk2s7ff6tSSlxtRzDP+Uq9d1u5tyaONRV2lwj+GdP1gRoOmdZL5chdvoAi0I8
-5eMf58hEuN2d4h4FryO6z7K+XQ9oo6/N/xHU0U/t2Pco9oY2L6oWMDxKwbfPhaD5
-CcoEElsK4XFArYDielEq9Y1sXaEuwR5I0ksDDsANp74r9Bhcqz60gJa6hVz0ouEU
-QA67wV9+TRmulKRxwANvqxQwqPuxqcTPeJjXSUN/ZCaDwYmI+d1poxMx2fQzT82M
-onlgOWq+3HbCotyoeFpCameymwDQzmrYdMBr7oWLgnOrxmJ89zDc6+jkHFgQJvnU
-atyeVDqe866ZvvIGWS+r/EsDjV3cTW/cJvdsC+5BpnoXoVF4LqxE3LFbEbQBvqio
-4enCZpspQSMOJra37vSofbD+DyI5Wd+y8SBmfDLjyDFhT0spW9aN99uFqSc3UElA
-SAmnFmpYBFEQrRGpvpu5sC0c/YjZeRXr0/F1xPpIT1SWzpRsbcsWRBDzWjLOKWQx
-8ytwc2QS7eKedfqkPWpYKW0Qtps+XgnGWA6PBX42IYhLsKANRfhFXQv5LPqLNNOn
-3EsG9pd+0dBpfxFQfyyAKAUuvpJNgJ6kNx8VSj8Ppj8lyUdGa9YucgB02m7gHC9U
-A4YyJsIcjo6IcrjM+ez1govRRS0nE8AUb8ups9tn8mdBwqcPCrgcJhV7JkOYNJYh
-NAh0vgmneOq8LSVs2SRaL3uuLNbjh1LR9iViwbIY8kMQXkiXa2/V+PFwt5oqeX5f
-2x3yzCeGBiQW10InyBBnKutbPD85R4YJhQ55bOMDSFfGGqwOU1QURiO1NUzf9n/2
-+E8VE7J/IQoO0TrJpC+EV0ROKME9W6+AvEFdmdIigbq3bkdEgSixyLnrhV8V8T4N
-nbKlLoqfXt8DmT+h8XPzgsu0Fq/PNi6xBaiUsaN9tK6OP2ZVjr9ihbeLTI0rcKDr
-XX2cWPvTcboRLt+S4wmqchMf7Kxa2PfX5Tf+KCcdZNQO4YqS23wQZgk61kuOQCsS
-uOop+ICI7yWZkjqCOzGOeHLl/7FyFeprsFDIwD1g20y9bzibbJlbQPhwXSalqDQT
-MWLH3rdFuvgLH7ujtjxSakES+VzkOhbnmb/Wypbl1D7P7GT2seau16EEGQDhDzcJ
-Q4d/BjR2WqqxmC79MOAvUWAu6fZQjPD30/gYPGpMaEuiLrDlzDqvf+oi4A9+EtRL
------END RSA PRIVATE KEY-----
diff --git a/node_modules/ssh2/test/fixtures/openssh_new_rsa b/node_modules/ssh2/test/fixtures/openssh_new_rsa
deleted file mode 100644
index ccded2a..0000000
--- a/node_modules/ssh2/test/fixtures/openssh_new_rsa
+++ /dev/null
@@ -1,27 +0,0 @@
------BEGIN OPENSSH PRIVATE KEY-----
-b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABFwAAAAdzc2gtcn
-NhAAAAAwEAAQAAAQEA4q6eZdx7LYh46PcZNcS3CnO7GuYsEJZeTj5LQSgp21IyTelaBPpr
-ijnMwKa+pLQt5TEobpKFFNecPdT6oPoOKKMe6oH/pX0BNyAEB9KFZfZgh0v4J4IOiO0KHM
-BNkoTFeGrursPkqYRJ0HL4CqYqRdINy1sgDU6jUIOuDD5XZzlpDXb1ftZoCei9OHSWrMKb
-zibJc64JFM7tUoK6Vl64YiPgxsNXOJYMTrelVJYebtsNrJFmh3XXQABDVutWMYb8I6IrNs
-8zjxsf6c6N2tKXkk9G4EDKKip4g0bzDmD/fREPQ9vLi59N+ZsyjWCKKE3PZSvwtoyLQN38
-KvTx3wjNQwAAA8hLhVBxS4VQcQAAAAdzc2gtcnNhAAABAQDirp5l3HstiHjo9xk1xLcKc7
-sa5iwQll5OPktBKCnbUjJN6VoE+muKOczApr6ktC3lMShukoUU15w91Pqg+g4oox7qgf+l
-fQE3IAQH0oVl9mCHS/gngg6I7QocwE2ShMV4au6uw+SphEnQcvgKpipF0g3LWyANTqNQg6
-4MPldnOWkNdvV+1mgJ6L04dJaswpvOJslzrgkUzu1SgrpWXrhiI+DGw1c4lgxOt6VUlh5u
-2w2skWaHdddAAENW61Yxhvwjois2zzOPGx/pzo3a0peST0bgQMoqKniDRvMOYP99EQ9D28
-uLn035mzKNYIooTc9lK/C2jItA3fwq9PHfCM1DAAAAAwEAAQAAAQAmShSbZBiyYkD6KPLr
-MCUy8MWED6kVzDB1yvPvN5eKYmH44xe/i4UqvgSl7gR50a2G7zzDIKC2Go1brGQBWPuXRa
-ZtOjQygeD4rMHBiH/b7zfy4pQyKDfITTHOFXWE8ERiyL00bAZt09icCy92rQaq8IY/+U56
-sPPJH9UAYG9nEev8opFjAWToFDu0U2+dC+lbqLlXDqDRo75NlnDFmgUoja3y2eFr9A0Cc+
-hjecrdxyJFsCJfEfaLWtBnZb886gqzzvfbHImSQtBAKERcSxuki7uxMoP67g3iQOXa65uz
-8kFWRNmbQTGQttakoUaybh1t9eLpBqvVON/4Kg0THShRAAAAgFBTz2ajBK/R/crOSL9VK1
-f7oQv2iJTRVfnUs0r+qPGgf/a/5UwkGRj0KfEWBp3qYD+keShnPr6PDPFrm8UmIdUX8AY7
-3tWT2K/JQVlzJNuINsw+DNjn4M17Z25q0LPmReRWL0nRc2w6W/hmQ/Jmqz6w8Qc4+xpeqS
-/HG5feliVnAAAAgQD90a+5Ky3o/2YtueqRf/3dKoiMgGB7JAOzye4dDKGABSlWuQ4N4xEI
-CW5MSTp7i/uobTF/tyFO3tTSyb5b2Xwbn/kLO0vgvFCdUGR2BQfN3mcT92T0Gn3JDF3Wym
-i2mgU6qnPf+eu+RKZQ9IiyNGny61ROUQa0R0z0pgiAfA89xwAAAIEA5KE9i6hHmigJwfD7
-/AGI4ujyWIVpNyrTdXG3HAPhsdoFuG5ggHggrPuuBF9wNcosrhL20VNOQGHg15gWZIVudu
-0qxky4ivQs67Sk9XUjuvTnf+VubM51rIsmh4atKJFSSZo78DEcTRt8aXLrSNvGQ4WPRweM
-2Z0YGfMMDM9KJKUAAAASbmV3IG9wZW5zc2ggZm9ybWF0AQ==
------END OPENSSH PRIVATE KEY-----
diff --git a/node_modules/ssh2/test/fixtures/ssh_host_dsa_key b/node_modules/ssh2/test/fixtures/ssh_host_dsa_key
deleted file mode 100644
index 5448947..0000000
--- a/node_modules/ssh2/test/fixtures/ssh_host_dsa_key
+++ /dev/null
@@ -1,12 +0,0 @@
------BEGIN DSA PRIVATE KEY-----
-MIIBuwIBAAKBgQDEK+daQ7RuajwxkmBmogb0iUSi/w2RYKuvC2EiviBu3S2s9Bfq
-gROKscAnURrxpTOa+iYeI7hRzfuX0qFmnFwXIjKJBjqBdg9r76UR5UNytnWQkJ5x
-lxsZThMeAMw38SvmRMw15kkgxycKGqu4yvNLGyVwN02bPVjLcEVLWLCM1wIVAK50
-5JqF0nmGXFkcmNtxR24/mNXTAoGBAIc2p8C8b08OTQPmfZI+Wq8a+CuEr5R36bMW
-TAs5etqmO2aVo5zvR0MnTjoS2ZDbuznDG9RiSuIB+ivr/daEwi+K+Ha8pZfYjXCG
-ldzvmr5I4x8rkH3zyn7BADnc+/q3pa8AnZvTme5eNsxn1Pu/rmC/8KKnhmzRggqP
-N8ORhoQQAoGAMCvoMcsDAui2d/WVpgHZZEFlxfbf4dPUPYb5zf2xOiMG9OK+Cbv3
-NaLZwk/Hd2g4L3nwTKDASxfmRcrbuaOg/d7aDjQ2mJz18Js4IjY34QpgLspGCNX/
-6rJSQ+ov1Z2Etr95N4Tzm3qpxW5BH9TTgaC/ntb9NRqIzNPCvAHXmlcCFBxgZpyb
-4GUgmqhTOMtmBkJ7QpL9
------END DSA PRIVATE KEY-----
diff --git a/node_modules/ssh2/test/fixtures/ssh_host_ecdsa_key b/node_modules/ssh2/test/fixtures/ssh_host_ecdsa_key
deleted file mode 100644
index 0476442..0000000
--- a/node_modules/ssh2/test/fixtures/ssh_host_ecdsa_key
+++ /dev/null
@@ -1,5 +0,0 @@
------BEGIN EC PRIVATE KEY-----
-MHcCAQEEICrdbIIYmW/XTK9hxaQZZ56IGwG0NhqD2eppYUJNZsECoAoGCCqGSM49
-AwEHoUQDQgAEa+MuLv++3ft5HPFIsM2hQnmHPF12q08/MaHoGud4yqp3evyomjZN
-xbsSb39fv8t6XX1u1rm5oHQcBV5Mqomaeg==
------END EC PRIVATE KEY-----
diff --git a/node_modules/ssh2/test/fixtures/ssh_host_rsa_key b/node_modules/ssh2/test/fixtures/ssh_host_rsa_key
deleted file mode 100644
index 9c2cc6f..0000000
--- a/node_modules/ssh2/test/fixtures/ssh_host_rsa_key
+++ /dev/null
@@ -1,15 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIICXAIBAAKBgQC57UB/5H0M+t+mopksrltCCIXghryzofJjau+8tuMT9CG6ta3S
-O9aKApJUUG/xtc88giVhB7HFABX/oob+jrkSthR8s/whULC8E+GhvOBjHydRUZIs
-aPYOMBb42HcbOsgq3li/hwOcDk0vY00hZDKCum9BgvRAb7dPEkw2dmiCQQIDAQAB
-AoGAMG+HOwoaLbR5aR64yrQNYBF6Vvii1iUdURr9o2r9kygpVUuZIcim5kMvPbnK
-v+w+NaQt+q4XeJvCH1uG0W/69FwnphfaOVmCCUtsoJ6sU3fWr9x59MtKL2Llh8xR
-50lz6R+eDXoYRDq245hG9BFn/bu0vtqQqx06mlZJcjaRocECQQDjdYFmr+DSww3x
-VNx0G0DUkaQZZ+iqZiT3Zund2pcBB4aLiewOrqj0GFct4+YNzgxIXPejmS0eSokN
-N2lC3NxZAkEA0UGjN5TG5/LEK3zcYtx2kpXryenrYORo1n2L/WPMZ0mjLQyd4LJr
-ibfgVUfwX/kV3vgGYLwjpgcaTiMsecv4KQJAYMmMgZSPdz+WvD1e/WznXkyG5mSn
-xXJngnrhQw0TulVodBIBR5IcxJli510VdIRcB6K/oXa5ky0mOmB8wv3WKQJBAKEF
-PxE//KbzWhyUogm4180IbD4dMDCI0ltqlFRRfTJlqZi6wqnq4XFB+u/kwYU4aKoA
-dPfvDgduI8HIsyqt17ECQDI/HC8PiYsDIOyVpQuQdIAsbGmoavK7X1MVEWR2nj9t
-7BbUVFSnVKynL4TWIJZ6xP8WQwkDBQc5WjognHDaUTQ=
------END RSA PRIVATE KEY-----
diff --git a/node_modules/ssh2/test/test-openssh.js b/node_modules/ssh2/test/test-openssh.js
deleted file mode 100644
index 67e1b86..0000000
--- a/node_modules/ssh2/test/test-openssh.js
+++ /dev/null
@@ -1,261 +0,0 @@
-'use strict';
-
-const assert = require('assert');
-const { inspect } = require('util');
-
-const {
- fixture,
- mustCall,
- mustCallAtLeast,
- setup: setup_,
-} = require('./common.js');
-
-const debug = false;
-
-const clientCfg = { username: 'foo', password: 'bar' };
-const serverCfg = { hostKeys: [ fixture('ssh_host_rsa_key') ] };
-
-{
- const { client, server } = setup_(
- 'Exec with OpenSSH agent forwarding',
- {
- client: {
- ...clientCfg,
- agent: '/path/to/agent',
- },
- server: serverCfg,
-
- debug,
- },
- );
-
- server.on('connection', mustCall((conn) => {
- conn.on('authentication', mustCall((ctx) => {
- ctx.accept();
- })).on('ready', mustCall(() => {
- conn.on('session', mustCall((accept, reject) => {
- let sawAuthAgent = false;
- accept().on('auth-agent', mustCall((accept, reject) => {
- sawAuthAgent = true;
- accept && accept();
- })).on('exec', mustCall((accept, reject, info) => {
- assert(sawAuthAgent, 'Expected auth-agent before exec');
- assert(info.command === 'foo --bar',
- `Wrong exec command: ${info.command}`);
- const stream = accept();
- stream.exit(100);
- stream.end();
- conn.end();
- }));
- }));
- }));
- }));
-
- client.on('ready', mustCall(() => {
- client.exec('foo --bar', { agentForward: true }, mustCall((err, stream) => {
- assert(!err, `Unexpected exec error: ${err}`);
- stream.resume();
- }));
- }));
-}
-
-{
- const { client, server } = setup_(
- 'OpenSSH forwarded UNIX socket connection',
- {
- client: clientCfg,
- server: {
- ...serverCfg,
- ident: 'OpenSSH_7.1',
- },
-
- debug,
- },
- );
-
- const socketPath = '/foo';
- const events = [];
- const expected = [
- ['client', 'openssh_forwardInStreamLocal'],
- ['server', 'streamlocal-forward@openssh.com', { socketPath }],
- ['client', 'forward callback'],
- ['client', 'unix connection', { socketPath }],
- ['client', 'socket data', '1'],
- ['server', 'socket data', '2'],
- ['client', 'socket end'],
- ['server', 'cancel-streamlocal-forward@openssh.com', { socketPath }],
- ['client', 'cancel callback']
- ];
-
- server.on('connection', mustCall((conn) => {
- conn.on('authentication', mustCall((ctx) => {
- ctx.accept();
- })).on('ready', mustCall(() => {
- conn.once('request', mustCall((accept, reject, name, info) => {
- events.push(['server', name, info]);
- assert(name === 'streamlocal-forward@openssh.com',
- `Wrong request name: ${name}`);
- accept();
- conn.openssh_forwardOutStreamLocal(socketPath,
- mustCall((err, ch) => {
- assert(!err, `Unexpected error: ${err}`);
- ch.write('1');
- ch.on('data', mustCallAtLeast((data) => {
- events.push(['server', 'socket data', data.toString()]);
- ch.close();
- }));
- }));
-
- conn.on('request', mustCall((accept, reject, name, info) => {
- events.push(['server', name, info]);
- assert(name === 'cancel-streamlocal-forward@openssh.com',
- `Wrong request name: ${name}`);
- accept();
- }));
- }));
- }));
- }));
-
- client.on('ready', mustCall(() => {
- // request forwarding
- events.push(['client', 'openssh_forwardInStreamLocal']);
- client.openssh_forwardInStreamLocal(socketPath, mustCall((err) => {
- assert(!err, `Unexpected error: ${err}`);
- events.push(['client', 'forward callback']);
- }));
- client.on('unix connection', mustCall((info, accept, reject) => {
- events.push(['client', 'unix connection', info]);
- const stream = accept();
- stream.on('data', mustCallAtLeast((data) => {
- events.push(['client', 'socket data', data.toString()]);
- stream.write('2');
- })).on('end', mustCall(() => {
- events.push(['client', 'socket end']);
- client.openssh_unforwardInStreamLocal(socketPath,
- mustCall((err) => {
- assert(!err, `Unexpected error: ${err}`);
- events.push(['client', 'cancel callback']);
- client.end();
- }));
- }));
- }));
- })).on('close', mustCall(() => {
- assert.deepStrictEqual(
- events,
- expected,
- 'Events mismatch\n'
- + `Actual:\n${inspect(events)}\n`
- + `Expected:\n${inspect(expected)}`
- );
- }));
-}
-
-{
- const { client, server } = setup_(
- 'OpenSSH UNIX socket connection',
- {
- client: clientCfg,
- server: {
- ...serverCfg,
- ident: 'OpenSSH_8.0',
- },
-
- debug,
- },
- );
-
- const socketPath = '/foo/bar/baz';
- const response = 'Hello World';
-
- server.on('connection', mustCall((conn) => {
- conn.on('authentication', mustCall((ctx) => {
- ctx.accept();
- })).on('ready', mustCall(() => {
- conn.on('openssh.streamlocal', mustCall((accept, reject, info) => {
- assert.deepStrictEqual(
- info,
- { socketPath },
- `Wrong info: ${inspect(info)}`
- );
-
- const stream = accept();
- stream.on('close', mustCall(() => {
- client.end();
- })).end(response);
- stream.resume();
- }));
- }));
- }));
-
- client.on('ready', mustCall(() => {
- client.openssh_forwardOutStreamLocal(socketPath, mustCall((err, stream) => {
- assert(!err, `Unexpected error: ${err}`);
- let buf = '';
- stream.on('data', mustCallAtLeast((data) => {
- buf += data;
- })).on('close', mustCall(() => {
- assert(buf === response, `Wrong response: ${inspect(buf)}`);
- }));
- }));
- }));
-}
-
-{
- const { client, server } = setup_(
- 'OpenSSH 5.x workaround for binding on port 0',
- {
- client: clientCfg,
- server: {
- ...serverCfg,
- ident: 'OpenSSH_5.3',
- },
-
- debug,
- },
- );
-
- const boundAddr = 'good';
- const boundPort = 1337;
- const tcpInfo = {
- destIP: boundAddr,
- destPort: boundPort,
- srcIP: 'remote',
- srcPort: 12345,
- };
-
- server.on('connection', mustCall((conn) => {
- conn.on('authentication', mustCall((ctx) => {
- ctx.accept();
- })).on('ready', mustCall(() => {
- conn.on('request', mustCall((accept, reject, name, info) => {
- assert(name === 'tcpip-forward', `Unexpected request: ${name}`);
- assert(info.bindAddr === boundAddr, `Wrong addr: ${info.bindAddr}`);
- assert(info.bindPort === 0, `Wrong port: ${info.bindPort}`);
- accept(boundPort);
- conn.forwardOut(boundAddr,
- 0,
- tcpInfo.srcIP,
- tcpInfo.srcPort,
- mustCall((err, ch) => {
- assert(!err, `Unexpected error: ${err}`);
- client.end();
- }));
- }));
- }));
- }));
-
- client.on('ready', mustCall(() => {
- // request forwarding
- client.forwardIn(boundAddr, 0, mustCall((err, port) => {
- assert(!err, `Unexpected error: ${err}`);
- assert(port === boundPort, `Bad bound port: ${port}`);
- }));
- })).on('tcp connection', mustCall((details, accept, reject) => {
- assert.deepStrictEqual(
- details,
- tcpInfo,
- `Wrong tcp details: ${inspect(details)}`
- );
- accept();
- }));
-}
diff --git a/node_modules/ssh2/test/test.js b/node_modules/ssh2/test/test.js
deleted file mode 100644
index d0380f2..0000000
--- a/node_modules/ssh2/test/test.js
+++ /dev/null
@@ -1,20 +0,0 @@
-'use strict';
-
-const { spawnSync } = require('child_process');
-const { readdirSync } = require('fs');
-const { join } = require('path');
-
-const files = readdirSync(__dirname).sort();
-for (const filename of files) {
- if (filename.startsWith('test-')) {
- const path = join(__dirname, filename);
- console.log(`> Running ${filename} ...`);
- const result = spawnSync(`${process.argv0} ${path}`, {
- shell: true,
- stdio: 'inherit',
- windowsHide: true
- });
- if (result.status !== 0)
- process.exitCode = 1;
- }
-}
diff --git a/node_modules/ssh2/util/build_pagent.bat b/node_modules/ssh2/util/build_pagent.bat
deleted file mode 100644
index 9f5aaf8..0000000
--- a/node_modules/ssh2/util/build_pagent.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-@cl /Ox pagent.c User32.lib
-@del /Q *.obj
\ No newline at end of file
diff --git a/node_modules/ssh2/util/pagent.c b/node_modules/ssh2/util/pagent.c
deleted file mode 100644
index e900491..0000000
--- a/node_modules/ssh2/util/pagent.c
+++ /dev/null
@@ -1,88 +0,0 @@
-#include
-#include
-#include
-
-#define AGENT_COPYDATA_ID 0x804e50ba
-#define AGENT_MAX_MSGLEN 8192
-
-#define GET_32BIT_MSB_FIRST(cp) \
- (((unsigned long)(unsigned char)(cp)[0] << 24) | \
- ((unsigned long)(unsigned char)(cp)[1] << 16) | \
- ((unsigned long)(unsigned char)(cp)[2] << 8) | \
- ((unsigned long)(unsigned char)(cp)[3]))
-
-#define GET_32BIT(cp) GET_32BIT_MSB_FIRST(cp)
-
-#define RET_ERR_BADARGS 10
-#define RET_ERR_UNAVAILABLE 11
-#define RET_ERR_NOMAP 12
-#define RET_ERR_BINSTDIN 13
-#define RET_ERR_BINSTDOUT 14
-#define RET_ERR_BADLEN 15
-
-#define RET_NORESPONSE 1
-#define RET_RESPONSE 0
-
-int main (int argc, const char* argv[]) {
- HWND hwnd;
- char *mapname;
- HANDLE filemap;
- unsigned char *p, *ret;
- int id, retlen, inlen, n, rmode, r = RET_NORESPONSE;
- COPYDATASTRUCT cds;
- void *in;
-
- if (argc < 2)
- return RET_ERR_BADARGS;
-
- hwnd = FindWindow("Pageant", "Pageant");
- if (!hwnd)
- return RET_ERR_UNAVAILABLE;
-
- rmode = _setmode(_fileno(stdin), _O_BINARY);
- if (rmode == -1)
- return RET_ERR_BINSTDIN;
-
- rmode = _setmode(_fileno(stdout), _O_BINARY);
- if (rmode == -1)
- return RET_ERR_BINSTDOUT;
-
- inlen = atoi(argv[1]);
- in = malloc(inlen);
- n = fread(in, 1, inlen, stdin);
- if (n != inlen) {
- free(in);
- return RET_ERR_BADLEN;
- }
-
- mapname = malloc(32);
- n = sprintf(mapname, "PageantRequest%08x", (unsigned)GetCurrentThreadId());
-
- filemap = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE,
- 0, AGENT_MAX_MSGLEN, mapname);
- if (filemap == NULL || filemap == INVALID_HANDLE_VALUE) {
- free(in);
- free(mapname);
- return RET_ERR_NOMAP;
- }
-
- p = MapViewOfFile(filemap, FILE_MAP_WRITE, 0, 0, 0);
- memcpy(p, in, inlen);
- cds.dwData = AGENT_COPYDATA_ID;
- cds.cbData = 1 + n;
- cds.lpData = mapname;
-
- id = SendMessage(hwnd, WM_COPYDATA, (WPARAM) NULL, (LPARAM) &cds);
- if (id > 0) {
- r = RET_RESPONSE;
- retlen = 4 + GET_32BIT(p);
- fwrite(p, 1, retlen, stdout);
- }
-
- free(in);
- free(mapname);
- UnmapViewOfFile(p);
- CloseHandle(filemap);
-
- return r;
-}
diff --git a/node_modules/ssh2/util/pagent.exe b/node_modules/ssh2/util/pagent.exe
deleted file mode 100644
index 6e8a71c..0000000
Binary files a/node_modules/ssh2/util/pagent.exe and /dev/null differ
diff --git a/node_modules/string_decoder/LICENSE b/node_modules/string_decoder/LICENSE
deleted file mode 100644
index 778edb2..0000000
--- a/node_modules/string_decoder/LICENSE
+++ /dev/null
@@ -1,48 +0,0 @@
-Node.js is licensed for use as follows:
-
-"""
-Copyright Node.js contributors. All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.
-"""
-
-This license applies to parts of Node.js originating from the
-https://github.com/joyent/node repository:
-
-"""
-Copyright Joyent, Inc. and other Node contributors. All rights reserved.
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.
-"""
-
diff --git a/node_modules/string_decoder/README.md b/node_modules/string_decoder/README.md
deleted file mode 100644
index 5fd5831..0000000
--- a/node_modules/string_decoder/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-# string_decoder
-
-***Node-core v8.9.4 string_decoder for userland***
-
-
-[](https://nodei.co/npm/string_decoder/)
-[](https://nodei.co/npm/string_decoder/)
-
-
-```bash
-npm install --save string_decoder
-```
-
-***Node-core string_decoder for userland***
-
-This package is a mirror of the string_decoder implementation in Node-core.
-
-Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/).
-
-As of version 1.0.0 **string_decoder** uses semantic versioning.
-
-## Previous versions
-
-Previous version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10.
-
-## Update
-
-The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version.
-
-## Streams Working Group
-
-`string_decoder` is maintained by the Streams Working Group, which
-oversees the development and maintenance of the Streams API within
-Node.js. The responsibilities of the Streams Working Group include:
-
-* Addressing stream issues on the Node.js issue tracker.
-* Authoring and editing stream documentation within the Node.js project.
-* Reviewing changes to stream subclasses within the Node.js project.
-* Redirecting changes to streams from the Node.js project to this
- project.
-* Assisting in the implementation of stream providers within Node.js.
-* Recommending versions of `readable-stream` to be included in Node.js.
-* Messaging about the future of streams to give the community advance
- notice of changes.
-
-See [readable-stream](https://github.com/nodejs/readable-stream) for
-more details.
diff --git a/node_modules/string_decoder/lib/string_decoder.js b/node_modules/string_decoder/lib/string_decoder.js
deleted file mode 100644
index 2e89e63..0000000
--- a/node_modules/string_decoder/lib/string_decoder.js
+++ /dev/null
@@ -1,296 +0,0 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-'use strict';
-
-/**/
-
-var Buffer = require('safe-buffer').Buffer;
-/**/
-
-var isEncoding = Buffer.isEncoding || function (encoding) {
- encoding = '' + encoding;
- switch (encoding && encoding.toLowerCase()) {
- case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
- return true;
- default:
- return false;
- }
-};
-
-function _normalizeEncoding(enc) {
- if (!enc) return 'utf8';
- var retried;
- while (true) {
- switch (enc) {
- case 'utf8':
- case 'utf-8':
- return 'utf8';
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return 'utf16le';
- case 'latin1':
- case 'binary':
- return 'latin1';
- case 'base64':
- case 'ascii':
- case 'hex':
- return enc;
- default:
- if (retried) return; // undefined
- enc = ('' + enc).toLowerCase();
- retried = true;
- }
- }
-};
-
-// Do not cache `Buffer.isEncoding` when checking encoding names as some
-// modules monkey-patch it to support additional encodings
-function normalizeEncoding(enc) {
- var nenc = _normalizeEncoding(enc);
- if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
- return nenc || enc;
-}
-
-// StringDecoder provides an interface for efficiently splitting a series of
-// buffers into a series of JS strings without breaking apart multi-byte
-// characters.
-exports.StringDecoder = StringDecoder;
-function StringDecoder(encoding) {
- this.encoding = normalizeEncoding(encoding);
- var nb;
- switch (this.encoding) {
- case 'utf16le':
- this.text = utf16Text;
- this.end = utf16End;
- nb = 4;
- break;
- case 'utf8':
- this.fillLast = utf8FillLast;
- nb = 4;
- break;
- case 'base64':
- this.text = base64Text;
- this.end = base64End;
- nb = 3;
- break;
- default:
- this.write = simpleWrite;
- this.end = simpleEnd;
- return;
- }
- this.lastNeed = 0;
- this.lastTotal = 0;
- this.lastChar = Buffer.allocUnsafe(nb);
-}
-
-StringDecoder.prototype.write = function (buf) {
- if (buf.length === 0) return '';
- var r;
- var i;
- if (this.lastNeed) {
- r = this.fillLast(buf);
- if (r === undefined) return '';
- i = this.lastNeed;
- this.lastNeed = 0;
- } else {
- i = 0;
- }
- if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
- return r || '';
-};
-
-StringDecoder.prototype.end = utf8End;
-
-// Returns only complete characters in a Buffer
-StringDecoder.prototype.text = utf8Text;
-
-// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
-StringDecoder.prototype.fillLast = function (buf) {
- if (this.lastNeed <= buf.length) {
- buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
- return this.lastChar.toString(this.encoding, 0, this.lastTotal);
- }
- buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
- this.lastNeed -= buf.length;
-};
-
-// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
-// continuation byte. If an invalid byte is detected, -2 is returned.
-function utf8CheckByte(byte) {
- if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
- return byte >> 6 === 0x02 ? -1 : -2;
-}
-
-// Checks at most 3 bytes at the end of a Buffer in order to detect an
-// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
-// needed to complete the UTF-8 character (if applicable) are returned.
-function utf8CheckIncomplete(self, buf, i) {
- var j = buf.length - 1;
- if (j < i) return 0;
- var nb = utf8CheckByte(buf[j]);
- if (nb >= 0) {
- if (nb > 0) self.lastNeed = nb - 1;
- return nb;
- }
- if (--j < i || nb === -2) return 0;
- nb = utf8CheckByte(buf[j]);
- if (nb >= 0) {
- if (nb > 0) self.lastNeed = nb - 2;
- return nb;
- }
- if (--j < i || nb === -2) return 0;
- nb = utf8CheckByte(buf[j]);
- if (nb >= 0) {
- if (nb > 0) {
- if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
- }
- return nb;
- }
- return 0;
-}
-
-// Validates as many continuation bytes for a multi-byte UTF-8 character as
-// needed or are available. If we see a non-continuation byte where we expect
-// one, we "replace" the validated continuation bytes we've seen so far with
-// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
-// behavior. The continuation byte check is included three times in the case
-// where all of the continuation bytes for a character exist in the same buffer.
-// It is also done this way as a slight performance increase instead of using a
-// loop.
-function utf8CheckExtraBytes(self, buf, p) {
- if ((buf[0] & 0xC0) !== 0x80) {
- self.lastNeed = 0;
- return '\ufffd';
- }
- if (self.lastNeed > 1 && buf.length > 1) {
- if ((buf[1] & 0xC0) !== 0x80) {
- self.lastNeed = 1;
- return '\ufffd';
- }
- if (self.lastNeed > 2 && buf.length > 2) {
- if ((buf[2] & 0xC0) !== 0x80) {
- self.lastNeed = 2;
- return '\ufffd';
- }
- }
- }
-}
-
-// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
-function utf8FillLast(buf) {
- var p = this.lastTotal - this.lastNeed;
- var r = utf8CheckExtraBytes(this, buf, p);
- if (r !== undefined) return r;
- if (this.lastNeed <= buf.length) {
- buf.copy(this.lastChar, p, 0, this.lastNeed);
- return this.lastChar.toString(this.encoding, 0, this.lastTotal);
- }
- buf.copy(this.lastChar, p, 0, buf.length);
- this.lastNeed -= buf.length;
-}
-
-// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
-// partial character, the character's bytes are buffered until the required
-// number of bytes are available.
-function utf8Text(buf, i) {
- var total = utf8CheckIncomplete(this, buf, i);
- if (!this.lastNeed) return buf.toString('utf8', i);
- this.lastTotal = total;
- var end = buf.length - (total - this.lastNeed);
- buf.copy(this.lastChar, 0, end);
- return buf.toString('utf8', i, end);
-}
-
-// For UTF-8, a replacement character is added when ending on a partial
-// character.
-function utf8End(buf) {
- var r = buf && buf.length ? this.write(buf) : '';
- if (this.lastNeed) return r + '\ufffd';
- return r;
-}
-
-// UTF-16LE typically needs two bytes per character, but even if we have an even
-// number of bytes available, we need to check if we end on a leading/high
-// surrogate. In that case, we need to wait for the next two bytes in order to
-// decode the last character properly.
-function utf16Text(buf, i) {
- if ((buf.length - i) % 2 === 0) {
- var r = buf.toString('utf16le', i);
- if (r) {
- var c = r.charCodeAt(r.length - 1);
- if (c >= 0xD800 && c <= 0xDBFF) {
- this.lastNeed = 2;
- this.lastTotal = 4;
- this.lastChar[0] = buf[buf.length - 2];
- this.lastChar[1] = buf[buf.length - 1];
- return r.slice(0, -1);
- }
- }
- return r;
- }
- this.lastNeed = 1;
- this.lastTotal = 2;
- this.lastChar[0] = buf[buf.length - 1];
- return buf.toString('utf16le', i, buf.length - 1);
-}
-
-// For UTF-16LE we do not explicitly append special replacement characters if we
-// end on a partial character, we simply let v8 handle that.
-function utf16End(buf) {
- var r = buf && buf.length ? this.write(buf) : '';
- if (this.lastNeed) {
- var end = this.lastTotal - this.lastNeed;
- return r + this.lastChar.toString('utf16le', 0, end);
- }
- return r;
-}
-
-function base64Text(buf, i) {
- var n = (buf.length - i) % 3;
- if (n === 0) return buf.toString('base64', i);
- this.lastNeed = 3 - n;
- this.lastTotal = 3;
- if (n === 1) {
- this.lastChar[0] = buf[buf.length - 1];
- } else {
- this.lastChar[0] = buf[buf.length - 2];
- this.lastChar[1] = buf[buf.length - 1];
- }
- return buf.toString('base64', i, buf.length - n);
-}
-
-function base64End(buf) {
- var r = buf && buf.length ? this.write(buf) : '';
- if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
- return r;
-}
-
-// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
-function simpleWrite(buf) {
- return buf.toString(this.encoding);
-}
-
-function simpleEnd(buf) {
- return buf && buf.length ? this.write(buf) : '';
-}
\ No newline at end of file
diff --git a/node_modules/string_decoder/package.json b/node_modules/string_decoder/package.json
deleted file mode 100644
index b2bb141..0000000
--- a/node_modules/string_decoder/package.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "name": "string_decoder",
- "version": "1.3.0",
- "description": "The string_decoder module from Node core",
- "main": "lib/string_decoder.js",
- "files": [
- "lib"
- ],
- "dependencies": {
- "safe-buffer": "~5.2.0"
- },
- "devDependencies": {
- "babel-polyfill": "^6.23.0",
- "core-util-is": "^1.0.2",
- "inherits": "^2.0.3",
- "tap": "~0.4.8"
- },
- "scripts": {
- "test": "tap test/parallel/*.js && node test/verify-dependencies",
- "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/nodejs/string_decoder.git"
- },
- "homepage": "https://github.com/nodejs/string_decoder",
- "keywords": [
- "string",
- "decoder",
- "browser",
- "browserify"
- ],
- "license": "MIT"
-}
diff --git a/node_modules/tar-fs/.travis.yml b/node_modules/tar-fs/.travis.yml
deleted file mode 100644
index 5911b74..0000000
--- a/node_modules/tar-fs/.travis.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-language: node_js
-node_js:
- - 6
- - 8
- - 10
diff --git a/node_modules/tar-fs/LICENSE b/node_modules/tar-fs/LICENSE
deleted file mode 100644
index 757562e..0000000
--- a/node_modules/tar-fs/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Mathias Buus
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/tar-fs/README.md b/node_modules/tar-fs/README.md
deleted file mode 100644
index 06ba046..0000000
--- a/node_modules/tar-fs/README.md
+++ /dev/null
@@ -1,163 +0,0 @@
-# tar-fs
-
-filesystem bindings for [tar-stream](https://github.com/mafintosh/tar-stream).
-
-```
-npm install tar-fs
-```
-
-[](http://travis-ci.org/mafintosh/tar-fs)
-
-## Usage
-
-tar-fs allows you to pack directories into tarballs and extract tarballs into directories.
-
-It doesn't gunzip for you, so if you want to extract a `.tar.gz` with this you'll need to use something like [gunzip-maybe](https://github.com/mafintosh/gunzip-maybe) in addition to this.
-
-``` js
-var tar = require('tar-fs')
-var fs = require('fs')
-
-// packing a directory
-tar.pack('./my-directory').pipe(fs.createWriteStream('my-tarball.tar'))
-
-// extracting a directory
-fs.createReadStream('my-other-tarball.tar').pipe(tar.extract('./my-other-directory'))
-```
-
-To ignore various files when packing or extracting add a ignore function to the options. `ignore`
-is also an alias for `filter`. Additionally you get `header` if you use ignore while extracting.
-That way you could also filter by metadata.
-
-``` js
-var pack = tar.pack('./my-directory', {
- ignore: function(name) {
- return path.extname(name) === '.bin' // ignore .bin files when packing
- }
-})
-
-var extract = tar.extract('./my-other-directory', {
- ignore: function(name) {
- return path.extname(name) === '.bin' // ignore .bin files inside the tarball when extracing
- }
-})
-
-var extractFilesDirs = tar.extract('./my-other-other-directory', {
- ignore: function(_, header) {
- // pass files & directories, ignore e.g. symlinks
- return header.type !== 'file' && header.type !== 'directory'
- }
-})
-```
-
-You can also specify which entries to pack using the `entries` option
-
-```js
-var pack = tar.pack('./my-directory', {
- entries: ['file1', 'subdir/file2'] // only the specific entries will be packed
-})
-```
-
-If you want to modify the headers when packing/extracting add a map function to the options
-
-``` js
-var pack = tar.pack('./my-directory', {
- map: function(header) {
- header.name = 'prefixed/'+header.name
- return header
- }
-})
-
-var extract = tar.extract('./my-directory', {
- map: function(header) {
- header.name = 'another-prefix/'+header.name
- return header
- }
-})
-```
-
-Similarly you can use `mapStream` incase you wanna modify the input/output file streams
-
-``` js
-var pack = tar.pack('./my-directory', {
- mapStream: function(fileStream, header) {
- if (path.extname(header.name) === '.js') {
- return fileStream.pipe(someTransform)
- }
- return fileStream;
- }
-})
-
-var extract = tar.extract('./my-directory', {
- mapStream: function(fileStream, header) {
- if (path.extname(header.name) === '.js') {
- return fileStream.pipe(someTransform)
- }
- return fileStream;
- }
-})
-```
-
-Set `options.fmode` and `options.dmode` to ensure that files/directories extracted have the corresponding modes
-
-``` js
-var extract = tar.extract('./my-directory', {
- dmode: parseInt(555, 8), // all dirs should be readable
- fmode: parseInt(444, 8) // all files should be readable
-})
-```
-
-It can be useful to use `dmode` and `fmode` if you are packing/unpacking tarballs between *nix/windows to ensure that all files/directories unpacked are readable.
-
-Alternatively you can set `options.readable` and/or `options.writable` to set the dmode and fmode to readable/writable.
-
-``` js
-var extract = tar.extract('./my-directory', {
- readable: true, // all dirs and files should be readable
- writable: true, // all dirs and files should be writable
-})
-```
-
-Set `options.strict` to `false` if you want to ignore errors due to unsupported entry types (like device files)
-
-To dereference symlinks (pack the contents of the symlink instead of the link itself) set `options.dereference` to `true`.
-
-## Copy a directory
-
-Copying a directory with permissions and mtime intact is as simple as
-
-``` js
-tar.pack('source-directory').pipe(tar.extract('dest-directory'))
-```
-
-## Interaction with [`tar-stream`](https://github.com/mafintosh/tar-stream)
-
-Use `finalize: false` and the `finish` hook to
-leave the pack stream open for further entries (see
-[`tar-stream#pack`](https://github.com/mafintosh/tar-stream#packing)),
-and use `pack` to pass an existing pack stream.
-
-``` js
-var mypack = tar.pack('./my-directory', {
- finalize: false,
- finish: function(sameAsMypack) {
- mypack.entry({name: 'generated-file.txt'}, "hello")
- tar.pack('./other-directory', {
- pack: sameAsMypack
- })
- }
-})
-```
-
-
-## Performance
-
-Packing and extracting a 6.1 GB with 2496 directories and 2398 files yields the following results on my Macbook Air.
-[See the benchmark here](https://gist.github.com/mafintosh/8102201)
-
-* tar-fs: 34.261 seconds
-* [node-tar](https://github.com/isaacs/node-tar): 366.123 seconds (or 10x slower)
-
-## License
-
-MIT
diff --git a/node_modules/tar-fs/index.js b/node_modules/tar-fs/index.js
deleted file mode 100644
index adf46f1..0000000
--- a/node_modules/tar-fs/index.js
+++ /dev/null
@@ -1,348 +0,0 @@
-var chownr = require('chownr')
-var tar = require('tar-stream')
-var pump = require('pump')
-var mkdirp = require('mkdirp-classic')
-var fs = require('fs')
-var path = require('path')
-var os = require('os')
-
-var win32 = os.platform() === 'win32'
-
-var noop = function () {}
-
-var echo = function (name) {
- return name
-}
-
-var normalize = !win32 ? echo : function (name) {
- return name.replace(/\\/g, '/').replace(/[:?<>|]/g, '_')
-}
-
-var statAll = function (fs, stat, cwd, ignore, entries, sort) {
- var queue = entries || ['.']
-
- return function loop (callback) {
- if (!queue.length) return callback()
- var next = queue.shift()
- var nextAbs = path.join(cwd, next)
-
- stat(nextAbs, function (err, stat) {
- if (err) return callback(err)
-
- if (!stat.isDirectory()) return callback(null, next, stat)
-
- fs.readdir(nextAbs, function (err, files) {
- if (err) return callback(err)
-
- if (sort) files.sort()
- for (var i = 0; i < files.length; i++) {
- if (!ignore(path.join(cwd, next, files[i]))) queue.push(path.join(next, files[i]))
- }
-
- callback(null, next, stat)
- })
- })
- }
-}
-
-var strip = function (map, level) {
- return function (header) {
- header.name = header.name.split('/').slice(level).join('/')
-
- var linkname = header.linkname
- if (linkname && (header.type === 'link' || path.isAbsolute(linkname))) {
- header.linkname = linkname.split('/').slice(level).join('/')
- }
-
- return map(header)
- }
-}
-
-exports.pack = function (cwd, opts) {
- if (!cwd) cwd = '.'
- if (!opts) opts = {}
-
- var xfs = opts.fs || fs
- var ignore = opts.ignore || opts.filter || noop
- var map = opts.map || noop
- var mapStream = opts.mapStream || echo
- var statNext = statAll(xfs, opts.dereference ? xfs.stat : xfs.lstat, cwd, ignore, opts.entries, opts.sort)
- var strict = opts.strict !== false
- var umask = typeof opts.umask === 'number' ? ~opts.umask : ~processUmask()
- var dmode = typeof opts.dmode === 'number' ? opts.dmode : 0
- var fmode = typeof opts.fmode === 'number' ? opts.fmode : 0
- var pack = opts.pack || tar.pack()
- var finish = opts.finish || noop
-
- if (opts.strip) map = strip(map, opts.strip)
-
- if (opts.readable) {
- dmode |= parseInt(555, 8)
- fmode |= parseInt(444, 8)
- }
- if (opts.writable) {
- dmode |= parseInt(333, 8)
- fmode |= parseInt(222, 8)
- }
-
- var onsymlink = function (filename, header) {
- xfs.readlink(path.join(cwd, filename), function (err, linkname) {
- if (err) return pack.destroy(err)
- header.linkname = normalize(linkname)
- pack.entry(header, onnextentry)
- })
- }
-
- var onstat = function (err, filename, stat) {
- if (err) return pack.destroy(err)
- if (!filename) {
- if (opts.finalize !== false) pack.finalize()
- return finish(pack)
- }
-
- if (stat.isSocket()) return onnextentry() // tar does not support sockets...
-
- var header = {
- name: normalize(filename),
- mode: (stat.mode | (stat.isDirectory() ? dmode : fmode)) & umask,
- mtime: stat.mtime,
- size: stat.size,
- type: 'file',
- uid: stat.uid,
- gid: stat.gid
- }
-
- if (stat.isDirectory()) {
- header.size = 0
- header.type = 'directory'
- header = map(header) || header
- return pack.entry(header, onnextentry)
- }
-
- if (stat.isSymbolicLink()) {
- header.size = 0
- header.type = 'symlink'
- header = map(header) || header
- return onsymlink(filename, header)
- }
-
- // TODO: add fifo etc...
-
- header = map(header) || header
-
- if (!stat.isFile()) {
- if (strict) return pack.destroy(new Error('unsupported type for ' + filename))
- return onnextentry()
- }
-
- var entry = pack.entry(header, onnextentry)
- if (!entry) return
-
- var rs = mapStream(xfs.createReadStream(path.join(cwd, filename)), header)
-
- rs.on('error', function (err) { // always forward errors on destroy
- entry.destroy(err)
- })
-
- pump(rs, entry)
- }
-
- var onnextentry = function (err) {
- if (err) return pack.destroy(err)
- statNext(onstat)
- }
-
- onnextentry()
-
- return pack
-}
-
-var head = function (list) {
- return list.length ? list[list.length - 1] : null
-}
-
-var processGetuid = function () {
- return process.getuid ? process.getuid() : -1
-}
-
-var processUmask = function () {
- return process.umask ? process.umask() : 0
-}
-
-exports.extract = function (cwd, opts) {
- if (!cwd) cwd = '.'
- if (!opts) opts = {}
-
- var xfs = opts.fs || fs
- var ignore = opts.ignore || opts.filter || noop
- var map = opts.map || noop
- var mapStream = opts.mapStream || echo
- var own = opts.chown !== false && !win32 && processGetuid() === 0
- var extract = opts.extract || tar.extract()
- var stack = []
- var now = new Date()
- var umask = typeof opts.umask === 'number' ? ~opts.umask : ~processUmask()
- var dmode = typeof opts.dmode === 'number' ? opts.dmode : 0
- var fmode = typeof opts.fmode === 'number' ? opts.fmode : 0
- var strict = opts.strict !== false
-
- if (opts.strip) map = strip(map, opts.strip)
-
- if (opts.readable) {
- dmode |= parseInt(555, 8)
- fmode |= parseInt(444, 8)
- }
- if (opts.writable) {
- dmode |= parseInt(333, 8)
- fmode |= parseInt(222, 8)
- }
-
- var utimesParent = function (name, cb) { // we just set the mtime on the parent dir again everytime we write an entry
- var top
- while ((top = head(stack)) && name.slice(0, top[0].length) !== top[0]) stack.pop()
- if (!top) return cb()
- xfs.utimes(top[0], now, top[1], cb)
- }
-
- var utimes = function (name, header, cb) {
- if (opts.utimes === false) return cb()
-
- if (header.type === 'directory') return xfs.utimes(name, now, header.mtime, cb)
- if (header.type === 'symlink') return utimesParent(name, cb) // TODO: how to set mtime on link?
-
- xfs.utimes(name, now, header.mtime, function (err) {
- if (err) return cb(err)
- utimesParent(name, cb)
- })
- }
-
- var chperm = function (name, header, cb) {
- var link = header.type === 'symlink'
-
- /* eslint-disable node/no-deprecated-api */
- var chmod = link ? xfs.lchmod : xfs.chmod
- var chown = link ? xfs.lchown : xfs.chown
- /* eslint-enable node/no-deprecated-api */
-
- if (!chmod) return cb()
-
- var mode = (header.mode | (header.type === 'directory' ? dmode : fmode)) & umask
- chmod(name, mode, function (err) {
- if (err) return cb(err)
- if (!own) return cb()
- if (!chown) return cb()
- chown(name, header.uid, header.gid, cb)
- })
- }
-
- extract.on('entry', function (header, stream, next) {
- header = map(header) || header
- header.name = normalize(header.name)
- var name = path.join(cwd, path.join('/', header.name))
-
- if (ignore(name, header)) {
- stream.resume()
- return next()
- }
-
- var stat = function (err) {
- if (err) return next(err)
- utimes(name, header, function (err) {
- if (err) return next(err)
- if (win32) return next()
- chperm(name, header, next)
- })
- }
-
- var onsymlink = function () {
- if (win32) return next() // skip symlinks on win for now before it can be tested
- xfs.unlink(name, function () {
- xfs.symlink(header.linkname, name, stat)
- })
- }
-
- var onlink = function () {
- if (win32) return next() // skip links on win for now before it can be tested
- xfs.unlink(name, function () {
- var srcpath = path.join(cwd, path.join('/', header.linkname))
-
- xfs.link(srcpath, name, function (err) {
- if (err && err.code === 'EPERM' && opts.hardlinkAsFilesFallback) {
- stream = xfs.createReadStream(srcpath)
- return onfile()
- }
-
- stat(err)
- })
- })
- }
-
- var onfile = function () {
- var ws = xfs.createWriteStream(name)
- var rs = mapStream(stream, header)
-
- ws.on('error', function (err) { // always forward errors on destroy
- rs.destroy(err)
- })
-
- pump(rs, ws, function (err) {
- if (err) return next(err)
- ws.on('close', stat)
- })
- }
-
- if (header.type === 'directory') {
- stack.push([name, header.mtime])
- return mkdirfix(name, {
- fs: xfs, own: own, uid: header.uid, gid: header.gid
- }, stat)
- }
-
- var dir = path.dirname(name)
-
- validate(xfs, dir, path.join(cwd, '.'), function (err, valid) {
- if (err) return next(err)
- if (!valid) return next(new Error(dir + ' is not a valid path'))
-
- mkdirfix(dir, {
- fs: xfs, own: own, uid: header.uid, gid: header.gid
- }, function (err) {
- if (err) return next(err)
-
- switch (header.type) {
- case 'file': return onfile()
- case 'link': return onlink()
- case 'symlink': return onsymlink()
- }
-
- if (strict) return next(new Error('unsupported type for ' + name + ' (' + header.type + ')'))
-
- stream.resume()
- next()
- })
- })
- })
-
- if (opts.finish) extract.on('finish', opts.finish)
-
- return extract
-}
-
-function validate (fs, name, root, cb) {
- if (name === root) return cb(null, true)
- fs.lstat(name, function (err, st) {
- if (err && err.code !== 'ENOENT') return cb(err)
- if (err || st.isDirectory()) return validate(fs, path.join(name, '..'), root, cb)
- cb(null, false)
- })
-}
-
-function mkdirfix (name, opts, cb) {
- mkdirp(name, { fs: opts.fs }, function (err, made) {
- if (!err && made && opts.own) {
- chownr(made, opts.uid, opts.gid, cb)
- } else {
- cb(err)
- }
- })
-}
diff --git a/node_modules/tar-fs/package.json b/node_modules/tar-fs/package.json
deleted file mode 100644
index 213865d..0000000
--- a/node_modules/tar-fs/package.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "name": "tar-fs",
- "version": "2.0.1",
- "description": "filesystem bindings for tar-stream",
- "dependencies": {
- "chownr": "^1.1.1",
- "mkdirp-classic": "^0.5.2",
- "pump": "^3.0.0",
- "tar-stream": "^2.0.0"
- },
- "keywords": [
- "tar",
- "fs",
- "file",
- "tarball",
- "directory",
- "stream"
- ],
- "devDependencies": {
- "rimraf": "^2.6.3",
- "standard": "^12.0.1",
- "tape": "^4.9.2"
- },
- "scripts": {
- "test": "standard && tape test/index.js"
- },
- "bugs": {
- "url": "https://github.com/mafintosh/tar-fs/issues"
- },
- "homepage": "https://github.com/mafintosh/tar-fs",
- "main": "index.js",
- "directories": {
- "test": "test"
- },
- "author": "Mathias Buus",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/mafintosh/tar-fs.git"
- }
-}
diff --git a/node_modules/tar-fs/test/fixtures/a/hello.txt b/node_modules/tar-fs/test/fixtures/a/hello.txt
deleted file mode 100644
index 3b18e51..0000000
--- a/node_modules/tar-fs/test/fixtures/a/hello.txt
+++ /dev/null
@@ -1 +0,0 @@
-hello world
diff --git a/node_modules/tar-fs/test/fixtures/b/a/test.txt b/node_modules/tar-fs/test/fixtures/b/a/test.txt
deleted file mode 100644
index 9daeafb..0000000
--- a/node_modules/tar-fs/test/fixtures/b/a/test.txt
+++ /dev/null
@@ -1 +0,0 @@
-test
diff --git a/node_modules/tar-fs/test/fixtures/d/file1 b/node_modules/tar-fs/test/fixtures/d/file1
deleted file mode 100644
index e69de29..0000000
diff --git a/node_modules/tar-fs/test/fixtures/d/file2 b/node_modules/tar-fs/test/fixtures/d/file2
deleted file mode 100644
index e69de29..0000000
diff --git a/node_modules/tar-fs/test/fixtures/d/sub-dir/file5 b/node_modules/tar-fs/test/fixtures/d/sub-dir/file5
deleted file mode 100644
index e69de29..0000000
diff --git a/node_modules/tar-fs/test/fixtures/d/sub-files/file3 b/node_modules/tar-fs/test/fixtures/d/sub-files/file3
deleted file mode 100644
index e69de29..0000000
diff --git a/node_modules/tar-fs/test/fixtures/d/sub-files/file4 b/node_modules/tar-fs/test/fixtures/d/sub-files/file4
deleted file mode 100644
index e69de29..0000000
diff --git a/node_modules/tar-fs/test/fixtures/e/directory/.ignore b/node_modules/tar-fs/test/fixtures/e/directory/.ignore
deleted file mode 100644
index e69de29..0000000
diff --git a/node_modules/tar-fs/test/fixtures/e/file b/node_modules/tar-fs/test/fixtures/e/file
deleted file mode 100644
index e69de29..0000000
diff --git a/node_modules/tar-fs/test/fixtures/invalid.tar b/node_modules/tar-fs/test/fixtures/invalid.tar
deleted file mode 100644
index a645e9c..0000000
Binary files a/node_modules/tar-fs/test/fixtures/invalid.tar and /dev/null differ
diff --git a/node_modules/tar-fs/test/index.js b/node_modules/tar-fs/test/index.js
deleted file mode 100644
index 3f5e07b..0000000
--- a/node_modules/tar-fs/test/index.js
+++ /dev/null
@@ -1,346 +0,0 @@
-var test = require('tape')
-var rimraf = require('rimraf')
-var tar = require('../index')
-var tarStream = require('tar-stream')
-var path = require('path')
-var fs = require('fs')
-var os = require('os')
-
-var win32 = os.platform() === 'win32'
-
-var mtime = function (st) {
- return Math.floor(st.mtime.getTime() / 1000)
-}
-
-test('copy a -> copy/a', function (t) {
- t.plan(5)
-
- var a = path.join(__dirname, 'fixtures', 'a')
- var b = path.join(__dirname, 'fixtures', 'copy', 'a')
-
- rimraf.sync(b)
- tar.pack(a)
- .pipe(tar.extract(b))
- .on('finish', function () {
- var files = fs.readdirSync(b)
- t.same(files.length, 1)
- t.same(files[0], 'hello.txt')
- var fileB = path.join(b, files[0])
- var fileA = path.join(a, files[0])
- t.same(fs.readFileSync(fileB, 'utf-8'), fs.readFileSync(fileA, 'utf-8'))
- t.same(fs.statSync(fileB).mode, fs.statSync(fileA).mode)
- t.same(mtime(fs.statSync(fileB)), mtime(fs.statSync(fileA)))
- })
-})
-
-test('copy b -> copy/b', function (t) {
- t.plan(8)
-
- var a = path.join(__dirname, 'fixtures', 'b')
- var b = path.join(__dirname, 'fixtures', 'copy', 'b')
-
- rimraf.sync(b)
- tar.pack(a)
- .pipe(tar.extract(b))
- .on('finish', function () {
- var files = fs.readdirSync(b)
- t.same(files.length, 1)
- t.same(files[0], 'a')
- var dirB = path.join(b, files[0])
- var dirA = path.join(a, files[0])
- t.same(fs.statSync(dirB).mode, fs.statSync(dirA).mode)
- t.same(mtime(fs.statSync(dirB)), mtime(fs.statSync(dirA)))
- t.ok(fs.statSync(dirB).isDirectory())
- var fileB = path.join(dirB, 'test.txt')
- var fileA = path.join(dirA, 'test.txt')
- t.same(fs.readFileSync(fileB, 'utf-8'), fs.readFileSync(fileA, 'utf-8'))
- t.same(fs.statSync(fileB).mode, fs.statSync(fileA).mode)
- t.same(mtime(fs.statSync(fileB)), mtime(fs.statSync(fileA)))
- })
-})
-
-test('symlink', function (t) {
- if (win32) { // no symlink support on win32 currently. TODO: test if this can be enabled somehow
- t.plan(1)
- t.ok(true)
- return
- }
-
- t.plan(5)
-
- var a = path.join(__dirname, 'fixtures', 'c')
-
- rimraf.sync(path.join(a, 'link'))
- fs.symlinkSync('.gitignore', path.join(a, 'link'))
-
- var b = path.join(__dirname, 'fixtures', 'copy', 'c')
-
- rimraf.sync(b)
- tar.pack(a)
- .pipe(tar.extract(b))
- .on('finish', function () {
- var files = fs.readdirSync(b).sort()
- t.same(files.length, 2)
- t.same(files[0], '.gitignore')
- t.same(files[1], 'link')
-
- var linkA = path.join(a, 'link')
- var linkB = path.join(b, 'link')
-
- t.same(mtime(fs.lstatSync(linkB)), mtime(fs.lstatSync(linkA)))
- t.same(fs.readlinkSync(linkB), fs.readlinkSync(linkA))
- })
-})
-
-test('follow symlinks', function (t) {
- if (win32) { // no symlink support on win32 currently. TODO: test if this can be enabled somehow
- t.plan(1)
- t.ok(true)
- return
- }
-
- t.plan(5)
-
- var a = path.join(__dirname, 'fixtures', 'c')
-
- rimraf.sync(path.join(a, 'link'))
- fs.symlinkSync('.gitignore', path.join(a, 'link'))
-
- var b = path.join(__dirname, 'fixtures', 'copy', 'c-dereference')
-
- rimraf.sync(b)
- tar.pack(a, { dereference: true })
- .pipe(tar.extract(b))
- .on('finish', function () {
- var files = fs.readdirSync(b).sort()
- t.same(files.length, 2)
- t.same(files[0], '.gitignore')
- t.same(files[1], 'link')
-
- var file1 = path.join(b, '.gitignore')
- var file2 = path.join(b, 'link')
-
- t.same(mtime(fs.lstatSync(file1)), mtime(fs.lstatSync(file2)))
- t.same(fs.readFileSync(file1), fs.readFileSync(file2))
- })
-})
-
-test('strip', function (t) {
- t.plan(2)
-
- var a = path.join(__dirname, 'fixtures', 'b')
- var b = path.join(__dirname, 'fixtures', 'copy', 'b-strip')
-
- rimraf.sync(b)
-
- tar.pack(a)
- .pipe(tar.extract(b, { strip: 1 }))
- .on('finish', function () {
- var files = fs.readdirSync(b).sort()
- t.same(files.length, 1)
- t.same(files[0], 'test.txt')
- })
-})
-
-test('strip + map', function (t) {
- t.plan(2)
-
- var a = path.join(__dirname, 'fixtures', 'b')
- var b = path.join(__dirname, 'fixtures', 'copy', 'b-strip')
-
- rimraf.sync(b)
-
- var uppercase = function (header) {
- header.name = header.name.toUpperCase()
- return header
- }
-
- tar.pack(a)
- .pipe(tar.extract(b, { strip: 1, map: uppercase }))
- .on('finish', function () {
- var files = fs.readdirSync(b).sort()
- t.same(files.length, 1)
- t.same(files[0], 'TEST.TXT')
- })
-})
-
-test('map + dir + permissions', function (t) {
- t.plan(win32 ? 1 : 2) // skip chmod test, it's not working like unix
-
- var a = path.join(__dirname, 'fixtures', 'b')
- var b = path.join(__dirname, 'fixtures', 'copy', 'a-perms')
-
- rimraf.sync(b)
-
- var aWithMode = function (header) {
- if (header.name === 'a') {
- header.mode = parseInt(700, 8)
- }
- return header
- }
-
- tar.pack(a)
- .pipe(tar.extract(b, { map: aWithMode }))
- .on('finish', function () {
- var files = fs.readdirSync(b).sort()
- var stat = fs.statSync(path.join(b, 'a'))
- t.same(files.length, 1)
- if (!win32) {
- t.same(stat.mode & parseInt(777, 8), parseInt(700, 8))
- }
- })
-})
-
-test('specific entries', function (t) {
- t.plan(6)
-
- var a = path.join(__dirname, 'fixtures', 'd')
- var b = path.join(__dirname, 'fixtures', 'copy', 'd-entries')
-
- var entries = [ 'file1', 'sub-files/file3', 'sub-dir' ]
-
- rimraf.sync(b)
- tar.pack(a, { entries: entries })
- .pipe(tar.extract(b))
- .on('finish', function () {
- var files = fs.readdirSync(b)
- t.same(files.length, 3)
- t.notSame(files.indexOf('file1'), -1)
- t.notSame(files.indexOf('sub-files'), -1)
- t.notSame(files.indexOf('sub-dir'), -1)
- var subFiles = fs.readdirSync(path.join(b, 'sub-files'))
- t.same(subFiles, ['file3'])
- var subDir = fs.readdirSync(path.join(b, 'sub-dir'))
- t.same(subDir, ['file5'])
- })
-})
-
-test('check type while mapping header on packing', function (t) {
- t.plan(3)
-
- var e = path.join(__dirname, 'fixtures', 'e')
-
- var checkHeaderType = function (header) {
- if (header.name.indexOf('.') === -1) t.same(header.type, header.name)
- }
-
- tar.pack(e, { map: checkHeaderType })
-})
-
-test('finish callbacks', function (t) {
- t.plan(3)
-
- var a = path.join(__dirname, 'fixtures', 'a')
- var b = path.join(__dirname, 'fixtures', 'copy', 'a')
-
- rimraf.sync(b)
-
- var packEntries = 0
- var extractEntries = 0
-
- var countPackEntry = function (header) { packEntries++ }
- var countExtractEntry = function (header) { extractEntries++ }
-
- var pack
- var onPackFinish = function (passedPack) {
- t.equal(packEntries, 2, 'All entries have been packed') // 2 entries - the file and base directory
- t.equal(passedPack, pack, 'The finish hook passes the pack')
- }
-
- var onExtractFinish = function () { t.equal(extractEntries, 2) }
-
- pack = tar.pack(a, { map: countPackEntry, finish: onPackFinish })
-
- pack.pipe(tar.extract(b, { map: countExtractEntry, finish: onExtractFinish }))
- .on('finish', function () {
- t.end()
- })
-})
-
-test('not finalizing the pack', function (t) {
- t.plan(2)
-
- var a = path.join(__dirname, 'fixtures', 'a')
- var b = path.join(__dirname, 'fixtures', 'b')
-
- var out = path.join(__dirname, 'fixtures', 'copy', 'merged-packs')
-
- rimraf.sync(out)
-
- var prefixer = function (prefix) {
- return function (header) {
- header.name = path.join(prefix, header.name)
- return header
- }
- }
-
- tar.pack(a, {
- map: prefixer('a-files'),
- finalize: false,
- finish: packB
- })
-
- function packB (pack) {
- tar.pack(b, { pack: pack, map: prefixer('b-files') })
- .pipe(tar.extract(out))
- .on('finish', assertResults)
- }
-
- function assertResults () {
- var containers = fs.readdirSync(out)
- t.deepEqual(containers, ['a-files', 'b-files'])
- var aFiles = fs.readdirSync(path.join(out, 'a-files'))
- t.deepEqual(aFiles, ['hello.txt'])
- }
-})
-
-test('do not extract invalid tar', function (t) {
- var a = path.join(__dirname, 'fixtures', 'invalid.tar')
-
- var out = path.join(__dirname, 'fixtures', 'invalid')
-
- rimraf.sync(out)
-
- fs.createReadStream(a)
- .pipe(tar.extract(out))
- .on('error', function (err) {
- t.ok(/is not a valid path/i.test(err.message))
- fs.stat(path.join(out, '../bar'), function (err) {
- t.ok(err)
- t.end()
- })
- })
-})
-
-test('no abs hardlink targets', function (t) {
- var out = path.join(__dirname, 'fixtures', 'invalid')
- var outside = path.join(__dirname, 'fixtures', 'outside')
-
- rimraf.sync(out)
-
- var s = tarStream.pack()
-
- fs.writeFileSync(outside, 'something')
-
- s.entry({
- type: 'link',
- name: 'link',
- linkname: outside
- })
-
- s.entry({
- name: 'link'
- }, 'overwrite')
-
- s.finalize()
-
- s.pipe(tar.extract(out))
- .on('error', function (err) {
- t.ok(err, 'had error')
- fs.readFile(outside, 'utf-8', function (err, str) {
- t.error(err, 'no error')
- t.same(str, 'something')
- t.end()
- })
- })
-})
diff --git a/node_modules/tar-stream/LICENSE b/node_modules/tar-stream/LICENSE
deleted file mode 100644
index 757562e..0000000
--- a/node_modules/tar-stream/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Mathias Buus
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/tar-stream/README.md b/node_modules/tar-stream/README.md
deleted file mode 100644
index 2679d9d..0000000
--- a/node_modules/tar-stream/README.md
+++ /dev/null
@@ -1,168 +0,0 @@
-# tar-stream
-
-tar-stream is a streaming tar parser and generator and nothing else. It is streams2 and operates purely using streams which means you can easily extract/parse tarballs without ever hitting the file system.
-
-Note that you still need to gunzip your data if you have a `.tar.gz`. We recommend using [gunzip-maybe](https://github.com/mafintosh/gunzip-maybe) in conjunction with this.
-
-```
-npm install tar-stream
-```
-
-[](http://travis-ci.org/mafintosh/tar-stream)
-[](http://opensource.org/licenses/MIT)
-
-## Usage
-
-tar-stream exposes two streams, [pack](https://github.com/mafintosh/tar-stream#packing) which creates tarballs and [extract](https://github.com/mafintosh/tar-stream#extracting) which extracts tarballs. To [modify an existing tarball](https://github.com/mafintosh/tar-stream#modifying-existing-tarballs) use both.
-
-
-It implementes USTAR with additional support for pax extended headers. It should be compatible with all popular tar distributions out there (gnutar, bsdtar etc)
-
-## Related
-
-If you want to pack/unpack directories on the file system check out [tar-fs](https://github.com/mafintosh/tar-fs) which provides file system bindings to this module.
-
-## Packing
-
-To create a pack stream use `tar.pack()` and call `pack.entry(header, [callback])` to add tar entries.
-
-``` js
-var tar = require('tar-stream')
-var pack = tar.pack() // pack is a streams2 stream
-
-// add a file called my-test.txt with the content "Hello World!"
-pack.entry({ name: 'my-test.txt' }, 'Hello World!')
-
-// add a file called my-stream-test.txt from a stream
-var entry = pack.entry({ name: 'my-stream-test.txt', size: 11 }, function(err) {
- // the stream was added
- // no more entries
- pack.finalize()
-})
-
-entry.write('hello')
-entry.write(' ')
-entry.write('world')
-entry.end()
-
-// pipe the pack stream somewhere
-pack.pipe(process.stdout)
-```
-
-## Extracting
-
-To extract a stream use `tar.extract()` and listen for `extract.on('entry', (header, stream, next) )`
-
-``` js
-var extract = tar.extract()
-
-extract.on('entry', function(header, stream, next) {
- // header is the tar header
- // stream is the content body (might be an empty stream)
- // call next when you are done with this entry
-
- stream.on('end', function() {
- next() // ready for next entry
- })
-
- stream.resume() // just auto drain the stream
-})
-
-extract.on('finish', function() {
- // all entries read
-})
-
-pack.pipe(extract)
-```
-
-The tar archive is streamed sequentially, meaning you **must** drain each entry's stream as you get them or else the main extract stream will receive backpressure and stop reading.
-
-## Headers
-
-The header object using in `entry` should contain the following properties.
-Most of these values can be found by stat'ing a file.
-
-``` js
-{
- name: 'path/to/this/entry.txt',
- size: 1314, // entry size. defaults to 0
- mode: 0o644, // entry mode. defaults to to 0o755 for dirs and 0o644 otherwise
- mtime: new Date(), // last modified date for entry. defaults to now.
- type: 'file', // type of entry. defaults to file. can be:
- // file | link | symlink | directory | block-device
- // character-device | fifo | contiguous-file
- linkname: 'path', // linked file name
- uid: 0, // uid of entry owner. defaults to 0
- gid: 0, // gid of entry owner. defaults to 0
- uname: 'maf', // uname of entry owner. defaults to null
- gname: 'staff', // gname of entry owner. defaults to null
- devmajor: 0, // device major version. defaults to 0
- devminor: 0 // device minor version. defaults to 0
-}
-```
-
-## Modifying existing tarballs
-
-Using tar-stream it is easy to rewrite paths / change modes etc in an existing tarball.
-
-``` js
-var extract = tar.extract()
-var pack = tar.pack()
-var path = require('path')
-
-extract.on('entry', function(header, stream, callback) {
- // let's prefix all names with 'tmp'
- header.name = path.join('tmp', header.name)
- // write the new entry to the pack stream
- stream.pipe(pack.entry(header, callback))
-})
-
-extract.on('finish', function() {
- // all entries done - lets finalize it
- pack.finalize()
-})
-
-// pipe the old tarball to the extractor
-oldTarballStream.pipe(extract)
-
-// pipe the new tarball the another stream
-pack.pipe(newTarballStream)
-```
-
-## Saving tarball to fs
-
-
-``` js
-var fs = require('fs')
-var tar = require('tar-stream')
-
-var pack = tar.pack() // pack is a streams2 stream
-var path = 'YourTarBall.tar'
-var yourTarball = fs.createWriteStream(path)
-
-// add a file called YourFile.txt with the content "Hello World!"
-pack.entry({name: 'YourFile.txt'}, 'Hello World!', function (err) {
- if (err) throw err
- pack.finalize()
-})
-
-// pipe the pack stream to your file
-pack.pipe(yourTarball)
-
-yourTarball.on('close', function () {
- console.log(path + ' has been written')
- fs.stat(path, function(err, stats) {
- if (err) throw err
- console.log(stats)
- console.log('Got file info successfully!')
- })
-})
-```
-
-## Performance
-
-[See tar-fs for a performance comparison with node-tar](https://github.com/mafintosh/tar-fs/blob/master/README.md#performance)
-
-# License
-
-MIT
diff --git a/node_modules/tar-stream/extract.js b/node_modules/tar-stream/extract.js
deleted file mode 100644
index 11b13b7..0000000
--- a/node_modules/tar-stream/extract.js
+++ /dev/null
@@ -1,257 +0,0 @@
-var util = require('util')
-var bl = require('bl')
-var headers = require('./headers')
-
-var Writable = require('readable-stream').Writable
-var PassThrough = require('readable-stream').PassThrough
-
-var noop = function () {}
-
-var overflow = function (size) {
- size &= 511
- return size && 512 - size
-}
-
-var emptyStream = function (self, offset) {
- var s = new Source(self, offset)
- s.end()
- return s
-}
-
-var mixinPax = function (header, pax) {
- if (pax.path) header.name = pax.path
- if (pax.linkpath) header.linkname = pax.linkpath
- if (pax.size) header.size = parseInt(pax.size, 10)
- header.pax = pax
- return header
-}
-
-var Source = function (self, offset) {
- this._parent = self
- this.offset = offset
- PassThrough.call(this, { autoDestroy: false })
-}
-
-util.inherits(Source, PassThrough)
-
-Source.prototype.destroy = function (err) {
- this._parent.destroy(err)
-}
-
-var Extract = function (opts) {
- if (!(this instanceof Extract)) return new Extract(opts)
- Writable.call(this, opts)
-
- opts = opts || {}
-
- this._offset = 0
- this._buffer = bl()
- this._missing = 0
- this._partial = false
- this._onparse = noop
- this._header = null
- this._stream = null
- this._overflow = null
- this._cb = null
- this._locked = false
- this._destroyed = false
- this._pax = null
- this._paxGlobal = null
- this._gnuLongPath = null
- this._gnuLongLinkPath = null
-
- var self = this
- var b = self._buffer
-
- var oncontinue = function () {
- self._continue()
- }
-
- var onunlock = function (err) {
- self._locked = false
- if (err) return self.destroy(err)
- if (!self._stream) oncontinue()
- }
-
- var onstreamend = function () {
- self._stream = null
- var drain = overflow(self._header.size)
- if (drain) self._parse(drain, ondrain)
- else self._parse(512, onheader)
- if (!self._locked) oncontinue()
- }
-
- var ondrain = function () {
- self._buffer.consume(overflow(self._header.size))
- self._parse(512, onheader)
- oncontinue()
- }
-
- var onpaxglobalheader = function () {
- var size = self._header.size
- self._paxGlobal = headers.decodePax(b.slice(0, size))
- b.consume(size)
- onstreamend()
- }
-
- var onpaxheader = function () {
- var size = self._header.size
- self._pax = headers.decodePax(b.slice(0, size))
- if (self._paxGlobal) self._pax = Object.assign({}, self._paxGlobal, self._pax)
- b.consume(size)
- onstreamend()
- }
-
- var ongnulongpath = function () {
- var size = self._header.size
- this._gnuLongPath = headers.decodeLongPath(b.slice(0, size), opts.filenameEncoding)
- b.consume(size)
- onstreamend()
- }
-
- var ongnulonglinkpath = function () {
- var size = self._header.size
- this._gnuLongLinkPath = headers.decodeLongPath(b.slice(0, size), opts.filenameEncoding)
- b.consume(size)
- onstreamend()
- }
-
- var onheader = function () {
- var offset = self._offset
- var header
- try {
- header = self._header = headers.decode(b.slice(0, 512), opts.filenameEncoding, opts.allowUnknownFormat)
- } catch (err) {
- self.emit('error', err)
- }
- b.consume(512)
-
- if (!header) {
- self._parse(512, onheader)
- oncontinue()
- return
- }
- if (header.type === 'gnu-long-path') {
- self._parse(header.size, ongnulongpath)
- oncontinue()
- return
- }
- if (header.type === 'gnu-long-link-path') {
- self._parse(header.size, ongnulonglinkpath)
- oncontinue()
- return
- }
- if (header.type === 'pax-global-header') {
- self._parse(header.size, onpaxglobalheader)
- oncontinue()
- return
- }
- if (header.type === 'pax-header') {
- self._parse(header.size, onpaxheader)
- oncontinue()
- return
- }
-
- if (self._gnuLongPath) {
- header.name = self._gnuLongPath
- self._gnuLongPath = null
- }
-
- if (self._gnuLongLinkPath) {
- header.linkname = self._gnuLongLinkPath
- self._gnuLongLinkPath = null
- }
-
- if (self._pax) {
- self._header = header = mixinPax(header, self._pax)
- self._pax = null
- }
-
- self._locked = true
-
- if (!header.size || header.type === 'directory') {
- self._parse(512, onheader)
- self.emit('entry', header, emptyStream(self, offset), onunlock)
- return
- }
-
- self._stream = new Source(self, offset)
-
- self.emit('entry', header, self._stream, onunlock)
- self._parse(header.size, onstreamend)
- oncontinue()
- }
-
- this._onheader = onheader
- this._parse(512, onheader)
-}
-
-util.inherits(Extract, Writable)
-
-Extract.prototype.destroy = function (err) {
- if (this._destroyed) return
- this._destroyed = true
-
- if (err) this.emit('error', err)
- this.emit('close')
- if (this._stream) this._stream.emit('close')
-}
-
-Extract.prototype._parse = function (size, onparse) {
- if (this._destroyed) return
- this._offset += size
- this._missing = size
- if (onparse === this._onheader) this._partial = false
- this._onparse = onparse
-}
-
-Extract.prototype._continue = function () {
- if (this._destroyed) return
- var cb = this._cb
- this._cb = noop
- if (this._overflow) this._write(this._overflow, undefined, cb)
- else cb()
-}
-
-Extract.prototype._write = function (data, enc, cb) {
- if (this._destroyed) return
-
- var s = this._stream
- var b = this._buffer
- var missing = this._missing
- if (data.length) this._partial = true
-
- // we do not reach end-of-chunk now. just forward it
-
- if (data.length < missing) {
- this._missing -= data.length
- this._overflow = null
- if (s) return s.write(data, cb)
- b.append(data)
- return cb()
- }
-
- // end-of-chunk. the parser should call cb.
-
- this._cb = cb
- this._missing = 0
-
- var overflow = null
- if (data.length > missing) {
- overflow = data.slice(missing)
- data = data.slice(0, missing)
- }
-
- if (s) s.end(data)
- else b.append(data)
-
- this._overflow = overflow
- this._onparse()
-}
-
-Extract.prototype._final = function (cb) {
- if (this._partial) return this.destroy(new Error('Unexpected end of data'))
- cb()
-}
-
-module.exports = Extract
diff --git a/node_modules/tar-stream/headers.js b/node_modules/tar-stream/headers.js
deleted file mode 100644
index aba4ca4..0000000
--- a/node_modules/tar-stream/headers.js
+++ /dev/null
@@ -1,295 +0,0 @@
-var alloc = Buffer.alloc
-
-var ZEROS = '0000000000000000000'
-var SEVENS = '7777777777777777777'
-var ZERO_OFFSET = '0'.charCodeAt(0)
-var USTAR_MAGIC = Buffer.from('ustar\x00', 'binary')
-var USTAR_VER = Buffer.from('00', 'binary')
-var GNU_MAGIC = Buffer.from('ustar\x20', 'binary')
-var GNU_VER = Buffer.from('\x20\x00', 'binary')
-var MASK = parseInt('7777', 8)
-var MAGIC_OFFSET = 257
-var VERSION_OFFSET = 263
-
-var clamp = function (index, len, defaultValue) {
- if (typeof index !== 'number') return defaultValue
- index = ~~index // Coerce to integer.
- if (index >= len) return len
- if (index >= 0) return index
- index += len
- if (index >= 0) return index
- return 0
-}
-
-var toType = function (flag) {
- switch (flag) {
- case 0:
- return 'file'
- case 1:
- return 'link'
- case 2:
- return 'symlink'
- case 3:
- return 'character-device'
- case 4:
- return 'block-device'
- case 5:
- return 'directory'
- case 6:
- return 'fifo'
- case 7:
- return 'contiguous-file'
- case 72:
- return 'pax-header'
- case 55:
- return 'pax-global-header'
- case 27:
- return 'gnu-long-link-path'
- case 28:
- case 30:
- return 'gnu-long-path'
- }
-
- return null
-}
-
-var toTypeflag = function (flag) {
- switch (flag) {
- case 'file':
- return 0
- case 'link':
- return 1
- case 'symlink':
- return 2
- case 'character-device':
- return 3
- case 'block-device':
- return 4
- case 'directory':
- return 5
- case 'fifo':
- return 6
- case 'contiguous-file':
- return 7
- case 'pax-header':
- return 72
- }
-
- return 0
-}
-
-var indexOf = function (block, num, offset, end) {
- for (; offset < end; offset++) {
- if (block[offset] === num) return offset
- }
- return end
-}
-
-var cksum = function (block) {
- var sum = 8 * 32
- for (var i = 0; i < 148; i++) sum += block[i]
- for (var j = 156; j < 512; j++) sum += block[j]
- return sum
-}
-
-var encodeOct = function (val, n) {
- val = val.toString(8)
- if (val.length > n) return SEVENS.slice(0, n) + ' '
- else return ZEROS.slice(0, n - val.length) + val + ' '
-}
-
-/* Copied from the node-tar repo and modified to meet
- * tar-stream coding standard.
- *
- * Source: https://github.com/npm/node-tar/blob/51b6627a1f357d2eb433e7378e5f05e83b7aa6cd/lib/header.js#L349
- */
-function parse256 (buf) {
- // first byte MUST be either 80 or FF
- // 80 for positive, FF for 2's comp
- var positive
- if (buf[0] === 0x80) positive = true
- else if (buf[0] === 0xFF) positive = false
- else return null
-
- // build up a base-256 tuple from the least sig to the highest
- var tuple = []
- for (var i = buf.length - 1; i > 0; i--) {
- var byte = buf[i]
- if (positive) tuple.push(byte)
- else tuple.push(0xFF - byte)
- }
-
- var sum = 0
- var l = tuple.length
- for (i = 0; i < l; i++) {
- sum += tuple[i] * Math.pow(256, i)
- }
-
- return positive ? sum : -1 * sum
-}
-
-var decodeOct = function (val, offset, length) {
- val = val.slice(offset, offset + length)
- offset = 0
-
- // If prefixed with 0x80 then parse as a base-256 integer
- if (val[offset] & 0x80) {
- return parse256(val)
- } else {
- // Older versions of tar can prefix with spaces
- while (offset < val.length && val[offset] === 32) offset++
- var end = clamp(indexOf(val, 32, offset, val.length), val.length, val.length)
- while (offset < end && val[offset] === 0) offset++
- if (end === offset) return 0
- return parseInt(val.slice(offset, end).toString(), 8)
- }
-}
-
-var decodeStr = function (val, offset, length, encoding) {
- return val.slice(offset, indexOf(val, 0, offset, offset + length)).toString(encoding)
-}
-
-var addLength = function (str) {
- var len = Buffer.byteLength(str)
- var digits = Math.floor(Math.log(len) / Math.log(10)) + 1
- if (len + digits >= Math.pow(10, digits)) digits++
-
- return (len + digits) + str
-}
-
-exports.decodeLongPath = function (buf, encoding) {
- return decodeStr(buf, 0, buf.length, encoding)
-}
-
-exports.encodePax = function (opts) { // TODO: encode more stuff in pax
- var result = ''
- if (opts.name) result += addLength(' path=' + opts.name + '\n')
- if (opts.linkname) result += addLength(' linkpath=' + opts.linkname + '\n')
- var pax = opts.pax
- if (pax) {
- for (var key in pax) {
- result += addLength(' ' + key + '=' + pax[key] + '\n')
- }
- }
- return Buffer.from(result)
-}
-
-exports.decodePax = function (buf) {
- var result = {}
-
- while (buf.length) {
- var i = 0
- while (i < buf.length && buf[i] !== 32) i++
- var len = parseInt(buf.slice(0, i).toString(), 10)
- if (!len) return result
-
- var b = buf.slice(i + 1, len - 1).toString()
- var keyIndex = b.indexOf('=')
- if (keyIndex === -1) return result
- result[b.slice(0, keyIndex)] = b.slice(keyIndex + 1)
-
- buf = buf.slice(len)
- }
-
- return result
-}
-
-exports.encode = function (opts) {
- var buf = alloc(512)
- var name = opts.name
- var prefix = ''
-
- if (opts.typeflag === 5 && name[name.length - 1] !== '/') name += '/'
- if (Buffer.byteLength(name) !== name.length) return null // utf-8
-
- while (Buffer.byteLength(name) > 100) {
- var i = name.indexOf('/')
- if (i === -1) return null
- prefix += prefix ? '/' + name.slice(0, i) : name.slice(0, i)
- name = name.slice(i + 1)
- }
-
- if (Buffer.byteLength(name) > 100 || Buffer.byteLength(prefix) > 155) return null
- if (opts.linkname && Buffer.byteLength(opts.linkname) > 100) return null
-
- buf.write(name)
- buf.write(encodeOct(opts.mode & MASK, 6), 100)
- buf.write(encodeOct(opts.uid, 6), 108)
- buf.write(encodeOct(opts.gid, 6), 116)
- buf.write(encodeOct(opts.size, 11), 124)
- buf.write(encodeOct((opts.mtime.getTime() / 1000) | 0, 11), 136)
-
- buf[156] = ZERO_OFFSET + toTypeflag(opts.type)
-
- if (opts.linkname) buf.write(opts.linkname, 157)
-
- USTAR_MAGIC.copy(buf, MAGIC_OFFSET)
- USTAR_VER.copy(buf, VERSION_OFFSET)
- if (opts.uname) buf.write(opts.uname, 265)
- if (opts.gname) buf.write(opts.gname, 297)
- buf.write(encodeOct(opts.devmajor || 0, 6), 329)
- buf.write(encodeOct(opts.devminor || 0, 6), 337)
-
- if (prefix) buf.write(prefix, 345)
-
- buf.write(encodeOct(cksum(buf), 6), 148)
-
- return buf
-}
-
-exports.decode = function (buf, filenameEncoding, allowUnknownFormat) {
- var typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET
-
- var name = decodeStr(buf, 0, 100, filenameEncoding)
- var mode = decodeOct(buf, 100, 8)
- var uid = decodeOct(buf, 108, 8)
- var gid = decodeOct(buf, 116, 8)
- var size = decodeOct(buf, 124, 12)
- var mtime = decodeOct(buf, 136, 12)
- var type = toType(typeflag)
- var linkname = buf[157] === 0 ? null : decodeStr(buf, 157, 100, filenameEncoding)
- var uname = decodeStr(buf, 265, 32)
- var gname = decodeStr(buf, 297, 32)
- var devmajor = decodeOct(buf, 329, 8)
- var devminor = decodeOct(buf, 337, 8)
-
- var c = cksum(buf)
-
- // checksum is still initial value if header was null.
- if (c === 8 * 32) return null
-
- // valid checksum
- if (c !== decodeOct(buf, 148, 8)) throw new Error('Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?')
-
- if (USTAR_MAGIC.compare(buf, MAGIC_OFFSET, MAGIC_OFFSET + 6) === 0) {
- // ustar (posix) format.
- // prepend prefix, if present.
- if (buf[345]) name = decodeStr(buf, 345, 155, filenameEncoding) + '/' + name
- } else if (GNU_MAGIC.compare(buf, MAGIC_OFFSET, MAGIC_OFFSET + 6) === 0 &&
- GNU_VER.compare(buf, VERSION_OFFSET, VERSION_OFFSET + 2) === 0) {
- // 'gnu'/'oldgnu' format. Similar to ustar, but has support for incremental and
- // multi-volume tarballs.
- } else {
- if (!allowUnknownFormat) {
- throw new Error('Invalid tar header: unknown format.')
- }
- }
-
- // to support old tar versions that use trailing / to indicate dirs
- if (typeflag === 0 && name && name[name.length - 1] === '/') typeflag = 5
-
- return {
- name,
- mode,
- uid,
- gid,
- size,
- mtime: new Date(1000 * mtime),
- type,
- linkname,
- uname,
- gname,
- devmajor,
- devminor
- }
-}
diff --git a/node_modules/tar-stream/index.js b/node_modules/tar-stream/index.js
deleted file mode 100644
index 6481704..0000000
--- a/node_modules/tar-stream/index.js
+++ /dev/null
@@ -1,2 +0,0 @@
-exports.extract = require('./extract')
-exports.pack = require('./pack')
diff --git a/node_modules/tar-stream/pack.js b/node_modules/tar-stream/pack.js
deleted file mode 100644
index f1da3b7..0000000
--- a/node_modules/tar-stream/pack.js
+++ /dev/null
@@ -1,255 +0,0 @@
-var constants = require('fs-constants')
-var eos = require('end-of-stream')
-var inherits = require('inherits')
-var alloc = Buffer.alloc
-
-var Readable = require('readable-stream').Readable
-var Writable = require('readable-stream').Writable
-var StringDecoder = require('string_decoder').StringDecoder
-
-var headers = require('./headers')
-
-var DMODE = parseInt('755', 8)
-var FMODE = parseInt('644', 8)
-
-var END_OF_TAR = alloc(1024)
-
-var noop = function () {}
-
-var overflow = function (self, size) {
- size &= 511
- if (size) self.push(END_OF_TAR.slice(0, 512 - size))
-}
-
-function modeToType (mode) {
- switch (mode & constants.S_IFMT) {
- case constants.S_IFBLK: return 'block-device'
- case constants.S_IFCHR: return 'character-device'
- case constants.S_IFDIR: return 'directory'
- case constants.S_IFIFO: return 'fifo'
- case constants.S_IFLNK: return 'symlink'
- }
-
- return 'file'
-}
-
-var Sink = function (to) {
- Writable.call(this)
- this.written = 0
- this._to = to
- this._destroyed = false
-}
-
-inherits(Sink, Writable)
-
-Sink.prototype._write = function (data, enc, cb) {
- this.written += data.length
- if (this._to.push(data)) return cb()
- this._to._drain = cb
-}
-
-Sink.prototype.destroy = function () {
- if (this._destroyed) return
- this._destroyed = true
- this.emit('close')
-}
-
-var LinkSink = function () {
- Writable.call(this)
- this.linkname = ''
- this._decoder = new StringDecoder('utf-8')
- this._destroyed = false
-}
-
-inherits(LinkSink, Writable)
-
-LinkSink.prototype._write = function (data, enc, cb) {
- this.linkname += this._decoder.write(data)
- cb()
-}
-
-LinkSink.prototype.destroy = function () {
- if (this._destroyed) return
- this._destroyed = true
- this.emit('close')
-}
-
-var Void = function () {
- Writable.call(this)
- this._destroyed = false
-}
-
-inherits(Void, Writable)
-
-Void.prototype._write = function (data, enc, cb) {
- cb(new Error('No body allowed for this entry'))
-}
-
-Void.prototype.destroy = function () {
- if (this._destroyed) return
- this._destroyed = true
- this.emit('close')
-}
-
-var Pack = function (opts) {
- if (!(this instanceof Pack)) return new Pack(opts)
- Readable.call(this, opts)
-
- this._drain = noop
- this._finalized = false
- this._finalizing = false
- this._destroyed = false
- this._stream = null
-}
-
-inherits(Pack, Readable)
-
-Pack.prototype.entry = function (header, buffer, callback) {
- if (this._stream) throw new Error('already piping an entry')
- if (this._finalized || this._destroyed) return
-
- if (typeof buffer === 'function') {
- callback = buffer
- buffer = null
- }
-
- if (!callback) callback = noop
-
- var self = this
-
- if (!header.size || header.type === 'symlink') header.size = 0
- if (!header.type) header.type = modeToType(header.mode)
- if (!header.mode) header.mode = header.type === 'directory' ? DMODE : FMODE
- if (!header.uid) header.uid = 0
- if (!header.gid) header.gid = 0
- if (!header.mtime) header.mtime = new Date()
-
- if (typeof buffer === 'string') buffer = Buffer.from(buffer)
- if (Buffer.isBuffer(buffer)) {
- header.size = buffer.length
- this._encode(header)
- var ok = this.push(buffer)
- overflow(self, header.size)
- if (ok) process.nextTick(callback)
- else this._drain = callback
- return new Void()
- }
-
- if (header.type === 'symlink' && !header.linkname) {
- var linkSink = new LinkSink()
- eos(linkSink, function (err) {
- if (err) { // stream was closed
- self.destroy()
- return callback(err)
- }
-
- header.linkname = linkSink.linkname
- self._encode(header)
- callback()
- })
-
- return linkSink
- }
-
- this._encode(header)
-
- if (header.type !== 'file' && header.type !== 'contiguous-file') {
- process.nextTick(callback)
- return new Void()
- }
-
- var sink = new Sink(this)
-
- this._stream = sink
-
- eos(sink, function (err) {
- self._stream = null
-
- if (err) { // stream was closed
- self.destroy()
- return callback(err)
- }
-
- if (sink.written !== header.size) { // corrupting tar
- self.destroy()
- return callback(new Error('size mismatch'))
- }
-
- overflow(self, header.size)
- if (self._finalizing) self.finalize()
- callback()
- })
-
- return sink
-}
-
-Pack.prototype.finalize = function () {
- if (this._stream) {
- this._finalizing = true
- return
- }
-
- if (this._finalized) return
- this._finalized = true
- this.push(END_OF_TAR)
- this.push(null)
-}
-
-Pack.prototype.destroy = function (err) {
- if (this._destroyed) return
- this._destroyed = true
-
- if (err) this.emit('error', err)
- this.emit('close')
- if (this._stream && this._stream.destroy) this._stream.destroy()
-}
-
-Pack.prototype._encode = function (header) {
- if (!header.pax) {
- var buf = headers.encode(header)
- if (buf) {
- this.push(buf)
- return
- }
- }
- this._encodePax(header)
-}
-
-Pack.prototype._encodePax = function (header) {
- var paxHeader = headers.encodePax({
- name: header.name,
- linkname: header.linkname,
- pax: header.pax
- })
-
- var newHeader = {
- name: 'PaxHeader',
- mode: header.mode,
- uid: header.uid,
- gid: header.gid,
- size: paxHeader.length,
- mtime: header.mtime,
- type: 'pax-header',
- linkname: header.linkname && 'PaxHeader',
- uname: header.uname,
- gname: header.gname,
- devmajor: header.devmajor,
- devminor: header.devminor
- }
-
- this.push(headers.encode(newHeader))
- this.push(paxHeader)
- overflow(this, paxHeader.length)
-
- newHeader.size = header.size
- newHeader.type = header.type
- this.push(headers.encode(newHeader))
-}
-
-Pack.prototype._read = function (n) {
- var drain = this._drain
- this._drain = noop
- drain()
-}
-
-module.exports = Pack
diff --git a/node_modules/tar-stream/package.json b/node_modules/tar-stream/package.json
deleted file mode 100644
index d717dfc..0000000
--- a/node_modules/tar-stream/package.json
+++ /dev/null
@@ -1,58 +0,0 @@
-{
- "name": "tar-stream",
- "version": "2.2.0",
- "description": "tar-stream is a streaming tar parser and generator and nothing else. It is streams2 and operates purely using streams which means you can easily extract/parse tarballs without ever hitting the file system.",
- "author": "Mathias Buus ",
- "dependencies": {
- "bl": "^4.0.3",
- "end-of-stream": "^1.4.1",
- "fs-constants": "^1.0.0",
- "inherits": "^2.0.3",
- "readable-stream": "^3.1.1"
- },
- "devDependencies": {
- "concat-stream": "^2.0.0",
- "standard": "^12.0.1",
- "tape": "^4.9.2"
- },
- "scripts": {
- "test": "standard && tape test/extract.js test/pack.js",
- "test-all": "standard && tape test/*.js"
- },
- "keywords": [
- "tar",
- "tarball",
- "parse",
- "parser",
- "generate",
- "generator",
- "stream",
- "stream2",
- "streams",
- "streams2",
- "streaming",
- "pack",
- "extract",
- "modify"
- ],
- "bugs": {
- "url": "https://github.com/mafintosh/tar-stream/issues"
- },
- "homepage": "https://github.com/mafintosh/tar-stream",
- "main": "index.js",
- "files": [
- "*.js",
- "LICENSE"
- ],
- "directories": {
- "test": "test"
- },
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/mafintosh/tar-stream.git"
- },
- "engines": {
- "node": ">=6"
- }
-}
diff --git a/node_modules/tar-stream/sandbox.js b/node_modules/tar-stream/sandbox.js
deleted file mode 100644
index 9b82d40..0000000
--- a/node_modules/tar-stream/sandbox.js
+++ /dev/null
@@ -1,11 +0,0 @@
-const tar = require('tar-stream')
-const fs = require('fs')
-const path = require('path')
-const pipeline = require('pump') // eequire('stream').pipeline
-
-fs.createReadStream('test.tar')
- .pipe(tar.extract())
- .on('entry', function (header, stream, done) {
- console.log(header.name)
- pipeline(stream, fs.createWriteStream(path.join('/tmp', header.name)), done)
- })
diff --git a/node_modules/telegram-notify/TelegramNotify.js b/node_modules/telegram-notify/TelegramNotify.js
deleted file mode 100644
index 7716a17..0000000
--- a/node_modules/telegram-notify/TelegramNotify.js
+++ /dev/null
@@ -1,45 +0,0 @@
-const fetch = require('node-fetch');
-const HttpsProxyAgent = require('https-proxy-agent');
-const {sleep} = require('usleep');
-const MAX_ERRORS = 5;
-
-class TelegramNotify {
-
- constructor(config) {
- this.token = config.token;
- this.chatId = config.chatId;
- this.proxy = config.proxy;
- this.maxErrors = config.maxErrors || MAX_ERRORS;
- }
-
- async send(message, fetchOptions = {}, apiOptions = {}) {
- fetchOptions.timeout = fetchOptions.timeout || 3000;
- if (this.proxy) {
- fetchOptions.agent = new HttpsProxyAgent(this.proxy);
- }
- apiOptions.disable_web_page_preview = typeof apiOptions.disable_web_page_preview !== 'undefined' ? apiOptions.disable_web_page_preview : 1;
- apiOptions.disable_notification = typeof apiOptions.disable_notification !== 'undefined' ? apiOptions.disable_notification : true;
- apiOptions.text = encodeURIComponent(message);
- let url = 'https://api.telegram.org/bot' + this.token + '/sendmessage?chat_id=' + this.chatId;
- for (let param in apiOptions) {
- url += '&' + param + '=' + apiOptions[param];
- }
-
- return await this.#apiRequest(url, fetchOptions);
- }
-
- async #apiRequest(url, fetchOptions, attempt = 1) {
- try {
- return await (await fetch(url, fetchOptions)).json();
- } catch (e) {
- console.error(new Date().toLocaleString(), 'attempt ' + attempt, e.message);
- if (attempt >= this.maxErrors) {
- return false;
- }
- await sleep(5);
- return await this.#apiRequest(url, fetchOptions, ++attempt);
- }
- }
-}
-
-module.exports = TelegramNotify;
diff --git a/node_modules/telegram-notify/package.json b/node_modules/telegram-notify/package.json
deleted file mode 100644
index 692c7eb..0000000
--- a/node_modules/telegram-notify/package.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "name": "telegram-notify",
- "main": "TelegramNotify.js",
- "version": "1.3.3",
- "description": "telegram-notify",
- "repository": "https://github.com/nebaz/telegram-notify",
- "license": "MIT",
- "author": "Nebaz ",
- "dependencies": {
- "node-fetch": "~2.6.7",
- "https-proxy-agent": "~5.0.0",
- "usleep": "^1.0.3"
- }
-}
diff --git a/node_modules/telegram-notify/readme.md b/node_modules/telegram-notify/readme.md
deleted file mode 100644
index 356f2ac..0000000
--- a/node_modules/telegram-notify/readme.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# telegram-notify
-this package for sending telegram messages
-
-## Usage
- const Telegram = require('telegram-notify');
- let notify = new Telegram({token:'tokenString', chaiId:'id'});
- await notify.send('alert');
-
-
-## Installation
-To use the library, install it through [npm](https://npmjs.com)
-```shell
-npm install --save telegram-notify
-```
-
-## config
-* `token` - your telegram bot token, create bot: https://t.me/BotFather
-* `chatId` - telegram chat id for notify, get the id: https://t.me/get_id_bot
-* `proxy` - telegram proxy string [optional], e.q. http://login:password@ip:port
-* `maxErrors` - max attempts to send a telegram message (default:5)
-
-## API
-* `send` send a telegram message
\ No newline at end of file
diff --git a/node_modules/tweetnacl/.npmignore b/node_modules/tweetnacl/.npmignore
deleted file mode 100644
index 7d98dcb..0000000
--- a/node_modules/tweetnacl/.npmignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.eslintrc
-.travis.yml
-bower.json
-test
diff --git a/node_modules/tweetnacl/AUTHORS.md b/node_modules/tweetnacl/AUTHORS.md
deleted file mode 100644
index 6d74d40..0000000
--- a/node_modules/tweetnacl/AUTHORS.md
+++ /dev/null
@@ -1,28 +0,0 @@
-List of TweetNaCl.js authors
-============================
-
- Alphabetical order by first name.
- Format: Name (GitHub username or URL)
-
-* AndSDev (@AndSDev)
-* Devi Mandiri (@devi)
-* Dmitry Chestnykh (@dchest)
-
-List of authors of third-party public domain code from which TweetNaCl.js code was derived
-==========================================================================================
-
-[TweetNaCl](http://tweetnacl.cr.yp.to/)
---------------------------------------
-
-* Bernard van Gastel
-* Daniel J. Bernstein
-* Peter Schwabe
-* Sjaak Smetsers
-* Tanja Lange
-* Wesley Janssen
-
-
-[Poly1305-donna](https://github.com/floodyberry/poly1305-donna)
---------------------------------------------------------------
-
-* Andrew Moon (@floodyberry)
diff --git a/node_modules/tweetnacl/CHANGELOG.md b/node_modules/tweetnacl/CHANGELOG.md
deleted file mode 100644
index 92a4fdc..0000000
--- a/node_modules/tweetnacl/CHANGELOG.md
+++ /dev/null
@@ -1,221 +0,0 @@
-TweetNaCl.js Changelog
-======================
-
-
-v0.14.5
--------
-
-* Fixed incomplete return types in TypeScript typings.
-* Replaced COPYING.txt with LICENSE file, which now has public domain dedication
- text from The Unlicense. License fields in package.json and bower.json have
- been set to "Unlicense". The project was and will be in the public domain --
- this change just makes it easier for automated tools to know about this fact by
- using the widely recognized and SPDX-compatible template for public domain
- dedication.
-
-
-v0.14.4
--------
-
-* Added TypeScript type definitions (contributed by @AndSDev).
-* Improved benchmarking code.
-
-
-v0.14.3
--------
-
-Fixed a bug in the fast version of Poly1305 and brought it back.
-
-Thanks to @floodyberry for promptly responding and fixing the original C code:
-
-> "The issue was not properly detecting if st->h was >= 2^130 - 5, coupled with
-> [testing mistake] not catching the failure. The chance of the bug affecting
-> anything in the real world is essentially zero luckily, but it's good to have
-> it fixed."
-
-https://github.com/floodyberry/poly1305-donna/issues/2#issuecomment-202698577
-
-
-v0.14.2
--------
-
-Switched Poly1305 fast version back to original (slow) version due to a bug.
-
-
-v0.14.1
--------
-
-No code changes, just tweaked packaging and added COPYING.txt.
-
-
-v0.14.0
--------
-
-* **Breaking change!** All functions from `nacl.util` have been removed. These
- functions are no longer available:
-
- nacl.util.decodeUTF8
- nacl.util.encodeUTF8
- nacl.util.decodeBase64
- nacl.util.encodeBase64
-
- If want to continue using them, you can include
- package:
-
-
-
-
- or
-
- var nacl = require('tweetnacl');
- nacl.util = require('tweetnacl-util');
-
- However it is recommended to use better packages that have wider
- compatibility and better performance. Functions from `nacl.util` were never
- intended to be robust solution for string conversion and were included for
- convenience: cryptography library is not the right place for them.
-
- Currently calling these functions will throw error pointing to
- `tweetnacl-util-js` (in the next version this error message will be removed).
-
-* Improved detection of available random number generators, making it possible
- to use `nacl.randomBytes` and related functions in Web Workers without
- changes.
-
-* Changes to testing (see README).
-
-
-v0.13.3
--------
-
-No code changes.
-
-* Reverted license field in package.json to "Public domain".
-
-* Fixed typo in README.
-
-
-v0.13.2
--------
-
-* Fixed undefined variable bug in fast version of Poly1305. No worries, this
- bug was *never* triggered.
-
-* Specified CC0 public domain dedication.
-
-* Updated development dependencies.
-
-
-v0.13.1
--------
-
-* Exclude `crypto` and `buffer` modules from browserify builds.
-
-
-v0.13.0
--------
-
-* Made `nacl-fast` the default version in NPM package. Now
- `require("tweetnacl")` will use fast version; to get the original version,
- use `require("tweetnacl/nacl.js")`.
-
-* Cleanup temporary array after generating random bytes.
-
-
-v0.12.2
--------
-
-* Improved performance of curve operations, making `nacl.scalarMult`, `nacl.box`,
- `nacl.sign` and related functions up to 3x faster in `nacl-fast` version.
-
-
-v0.12.1
--------
-
-* Significantly improved performance of Salsa20 (~1.5x faster) and
- Poly1305 (~3.5x faster) in `nacl-fast` version.
-
-
-v0.12.0
--------
-
-* Instead of using the given secret key directly, TweetNaCl.js now copies it to
- a new array in `nacl.box.keyPair.fromSecretKey` and
- `nacl.sign.keyPair.fromSecretKey`.
-
-
-v0.11.2
--------
-
-* Added new constant: `nacl.sign.seedLength`.
-
-
-v0.11.1
--------
-
-* Even faster hash for both short and long inputs (in `nacl-fast`).
-
-
-v0.11.0
--------
-
-* Implement `nacl.sign.keyPair.fromSeed` to enable creation of sign key pairs
- deterministically from a 32-byte seed. (It behaves like
- [libsodium's](http://doc.libsodium.org/public-key_cryptography/public-key_signatures.html)
- `crypto_sign_seed_keypair`: the seed becomes a secret part of the secret key.)
-
-* Fast version now has an improved hash implementation that is 2x-5x faster.
-
-* Fixed benchmarks, which may have produced incorrect measurements.
-
-
-v0.10.1
--------
-
-* Exported undocumented `nacl.lowlevel.crypto_core_hsalsa20`.
-
-
-v0.10.0
--------
-
-* **Signature API breaking change!** `nacl.sign` and `nacl.sign.open` now deal
- with signed messages, and new `nacl.sign.detached` and
- `nacl.sign.detached.verify` are available.
-
- Previously, `nacl.sign` returned a signature, and `nacl.sign.open` accepted a
- message and "detached" signature. This was unlike NaCl's API, which dealt with
- signed messages (concatenation of signature and message).
-
- The new API is:
-
- nacl.sign(message, secretKey) -> signedMessage
- nacl.sign.open(signedMessage, publicKey) -> message | null
-
- Since detached signatures are common, two new API functions were introduced:
-
- nacl.sign.detached(message, secretKey) -> signature
- nacl.sign.detached.verify(message, signature, publicKey) -> true | false
-
- (Note that it's `verify`, not `open`, and it returns a boolean value, unlike
- `open`, which returns an "unsigned" message.)
-
-* NPM package now comes without `test` directory to keep it small.
-
-
-v0.9.2
-------
-
-* Improved documentation.
-* Fast version: increased theoretical message size limit from 2^32-1 to 2^52
- bytes in Poly1305 (and thus, secretbox and box). However this has no impact
- in practice since JavaScript arrays or ArrayBuffers are limited to 32-bit
- indexes, and most implementations won't allocate more than a gigabyte or so.
- (Obviously, there are no tests for the correctness of implementation.) Also,
- it's not recommended to use messages that large without splitting them into
- smaller packets anyway.
-
-
-v0.9.1
-------
-
-* Initial release
diff --git a/node_modules/tweetnacl/LICENSE b/node_modules/tweetnacl/LICENSE
deleted file mode 100644
index cf1ab25..0000000
--- a/node_modules/tweetnacl/LICENSE
+++ /dev/null
@@ -1,24 +0,0 @@
-This is free and unencumbered software released into the public domain.
-
-Anyone is free to copy, modify, publish, use, compile, sell, or
-distribute this software, either in source code form or as a compiled
-binary, for any purpose, commercial or non-commercial, and by any
-means.
-
-In jurisdictions that recognize copyright laws, the author or authors
-of this software dedicate any and all copyright interest in the
-software to the public domain. We make this dedication for the benefit
-of the public at large and to the detriment of our heirs and
-successors. We intend this dedication to be an overt act of
-relinquishment in perpetuity of all present and future rights to this
-software under copyright law.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-For more information, please refer to
diff --git a/node_modules/tweetnacl/PULL_REQUEST_TEMPLATE.md b/node_modules/tweetnacl/PULL_REQUEST_TEMPLATE.md
deleted file mode 100644
index a8eb4a9..0000000
--- a/node_modules/tweetnacl/PULL_REQUEST_TEMPLATE.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# Important!
-
-If your contribution is not trivial (not a typo fix, etc.), we can only accept
-it if you dedicate your copyright for the contribution to the public domain.
-Make sure you understand what it means (see http://unlicense.org/)! If you
-agree, please add yourself to AUTHORS.md file, and include the following text
-to your pull request description or a comment in it:
-
-------------------------------------------------------------------------------
-
- I dedicate any and all copyright interest in this software to the
- public domain. I make this dedication for the benefit of the public at
- large and to the detriment of my heirs and successors. I intend this
- dedication to be an overt act of relinquishment in perpetuity of all
- present and future rights to this software under copyright law.
-
- Anyone is free to copy, modify, publish, use, compile, sell, or
- distribute this software, either in source code form or as a compiled
- binary, for any purpose, commercial or non-commercial, and by any
- means.
diff --git a/node_modules/tweetnacl/README.md b/node_modules/tweetnacl/README.md
deleted file mode 100644
index ffb6871..0000000
--- a/node_modules/tweetnacl/README.md
+++ /dev/null
@@ -1,459 +0,0 @@
-TweetNaCl.js
-============
-
-Port of [TweetNaCl](http://tweetnacl.cr.yp.to) / [NaCl](http://nacl.cr.yp.to/)
-to JavaScript for modern browsers and Node.js. Public domain.
-
-[
-](https://travis-ci.org/dchest/tweetnacl-js)
-
-Demo:
-
-**:warning: The library is stable and API is frozen, however it has not been
-independently reviewed. If you can help reviewing it, please [contact
-me](mailto:dmitry@codingrobots.com).**
-
-Documentation
-=============
-
-* [Overview](#overview)
-* [Installation](#installation)
-* [Usage](#usage)
- * [Public-key authenticated encryption (box)](#public-key-authenticated-encryption-box)
- * [Secret-key authenticated encryption (secretbox)](#secret-key-authenticated-encryption-secretbox)
- * [Scalar multiplication](#scalar-multiplication)
- * [Signatures](#signatures)
- * [Hashing](#hashing)
- * [Random bytes generation](#random-bytes-generation)
- * [Constant-time comparison](#constant-time-comparison)
-* [System requirements](#system-requirements)
-* [Development and testing](#development-and-testing)
-* [Benchmarks](#benchmarks)
-* [Contributors](#contributors)
-* [Who uses it](#who-uses-it)
-
-
-Overview
---------
-
-The primary goal of this project is to produce a translation of TweetNaCl to
-JavaScript which is as close as possible to the original C implementation, plus
-a thin layer of idiomatic high-level API on top of it.
-
-There are two versions, you can use either of them:
-
-* `nacl.js` is the port of TweetNaCl with minimum differences from the
- original + high-level API.
-
-* `nacl-fast.js` is like `nacl.js`, but with some functions replaced with
- faster versions.
-
-
-Installation
-------------
-
-You can install TweetNaCl.js via a package manager:
-
-[Bower](http://bower.io):
-
- $ bower install tweetnacl
-
-[NPM](https://www.npmjs.org/):
-
- $ npm install tweetnacl
-
-or [download source code](https://github.com/dchest/tweetnacl-js/releases).
-
-
-Usage
------
-
-All API functions accept and return bytes as `Uint8Array`s. If you need to
-encode or decode strings, use functions from
- or one of the more robust codec
-packages.
-
-In Node.js v4 and later `Buffer` objects are backed by `Uint8Array`s, so you
-can freely pass them to TweetNaCl.js functions as arguments. The returned
-objects are still `Uint8Array`s, so if you need `Buffer`s, you'll have to
-convert them manually; make sure to convert using copying: `new Buffer(array)`,
-instead of sharing: `new Buffer(array.buffer)`, because some functions return
-subarrays of their buffers.
-
-
-### Public-key authenticated encryption (box)
-
-Implements *curve25519-xsalsa20-poly1305*.
-
-#### nacl.box.keyPair()
-
-Generates a new random key pair for box and returns it as an object with
-`publicKey` and `secretKey` members:
-
- {
- publicKey: ..., // Uint8Array with 32-byte public key
- secretKey: ... // Uint8Array with 32-byte secret key
- }
-
-
-#### nacl.box.keyPair.fromSecretKey(secretKey)
-
-Returns a key pair for box with public key corresponding to the given secret
-key.
-
-#### nacl.box(message, nonce, theirPublicKey, mySecretKey)
-
-Encrypt and authenticates message using peer's public key, our secret key, and
-the given nonce, which must be unique for each distinct message for a key pair.
-
-Returns an encrypted and authenticated message, which is
-`nacl.box.overheadLength` longer than the original message.
-
-#### nacl.box.open(box, nonce, theirPublicKey, mySecretKey)
-
-Authenticates and decrypts the given box with peer's public key, our secret
-key, and the given nonce.
-
-Returns the original message, or `false` if authentication fails.
-
-#### nacl.box.before(theirPublicKey, mySecretKey)
-
-Returns a precomputed shared key which can be used in `nacl.box.after` and
-`nacl.box.open.after`.
-
-#### nacl.box.after(message, nonce, sharedKey)
-
-Same as `nacl.box`, but uses a shared key precomputed with `nacl.box.before`.
-
-#### nacl.box.open.after(box, nonce, sharedKey)
-
-Same as `nacl.box.open`, but uses a shared key precomputed with `nacl.box.before`.
-
-#### nacl.box.publicKeyLength = 32
-
-Length of public key in bytes.
-
-#### nacl.box.secretKeyLength = 32
-
-Length of secret key in bytes.
-
-#### nacl.box.sharedKeyLength = 32
-
-Length of precomputed shared key in bytes.
-
-#### nacl.box.nonceLength = 24
-
-Length of nonce in bytes.
-
-#### nacl.box.overheadLength = 16
-
-Length of overhead added to box compared to original message.
-
-
-### Secret-key authenticated encryption (secretbox)
-
-Implements *xsalsa20-poly1305*.
-
-#### nacl.secretbox(message, nonce, key)
-
-Encrypt and authenticates message using the key and the nonce. The nonce must
-be unique for each distinct message for this key.
-
-Returns an encrypted and authenticated message, which is
-`nacl.secretbox.overheadLength` longer than the original message.
-
-#### nacl.secretbox.open(box, nonce, key)
-
-Authenticates and decrypts the given secret box using the key and the nonce.
-
-Returns the original message, or `false` if authentication fails.
-
-#### nacl.secretbox.keyLength = 32
-
-Length of key in bytes.
-
-#### nacl.secretbox.nonceLength = 24
-
-Length of nonce in bytes.
-
-#### nacl.secretbox.overheadLength = 16
-
-Length of overhead added to secret box compared to original message.
-
-
-### Scalar multiplication
-
-Implements *curve25519*.
-
-#### nacl.scalarMult(n, p)
-
-Multiplies an integer `n` by a group element `p` and returns the resulting
-group element.
-
-#### nacl.scalarMult.base(n)
-
-Multiplies an integer `n` by a standard group element and returns the resulting
-group element.
-
-#### nacl.scalarMult.scalarLength = 32
-
-Length of scalar in bytes.
-
-#### nacl.scalarMult.groupElementLength = 32
-
-Length of group element in bytes.
-
-
-### Signatures
-
-Implements [ed25519](http://ed25519.cr.yp.to).
-
-#### nacl.sign.keyPair()
-
-Generates new random key pair for signing and returns it as an object with
-`publicKey` and `secretKey` members:
-
- {
- publicKey: ..., // Uint8Array with 32-byte public key
- secretKey: ... // Uint8Array with 64-byte secret key
- }
-
-#### nacl.sign.keyPair.fromSecretKey(secretKey)
-
-Returns a signing key pair with public key corresponding to the given
-64-byte secret key. The secret key must have been generated by
-`nacl.sign.keyPair` or `nacl.sign.keyPair.fromSeed`.
-
-#### nacl.sign.keyPair.fromSeed(seed)
-
-Returns a new signing key pair generated deterministically from a 32-byte seed.
-The seed must contain enough entropy to be secure. This method is not
-recommended for general use: instead, use `nacl.sign.keyPair` to generate a new
-key pair from a random seed.
-
-#### nacl.sign(message, secretKey)
-
-Signs the message using the secret key and returns a signed message.
-
-#### nacl.sign.open(signedMessage, publicKey)
-
-Verifies the signed message and returns the message without signature.
-
-Returns `null` if verification failed.
-
-#### nacl.sign.detached(message, secretKey)
-
-Signs the message using the secret key and returns a signature.
-
-#### nacl.sign.detached.verify(message, signature, publicKey)
-
-Verifies the signature for the message and returns `true` if verification
-succeeded or `false` if it failed.
-
-#### nacl.sign.publicKeyLength = 32
-
-Length of signing public key in bytes.
-
-#### nacl.sign.secretKeyLength = 64
-
-Length of signing secret key in bytes.
-
-#### nacl.sign.seedLength = 32
-
-Length of seed for `nacl.sign.keyPair.fromSeed` in bytes.
-
-#### nacl.sign.signatureLength = 64
-
-Length of signature in bytes.
-
-
-### Hashing
-
-Implements *SHA-512*.
-
-#### nacl.hash(message)
-
-Returns SHA-512 hash of the message.
-
-#### nacl.hash.hashLength = 64
-
-Length of hash in bytes.
-
-
-### Random bytes generation
-
-#### nacl.randomBytes(length)
-
-Returns a `Uint8Array` of the given length containing random bytes of
-cryptographic quality.
-
-**Implementation note**
-
-TweetNaCl.js uses the following methods to generate random bytes,
-depending on the platform it runs on:
-
-* `window.crypto.getRandomValues` (WebCrypto standard)
-* `window.msCrypto.getRandomValues` (Internet Explorer 11)
-* `crypto.randomBytes` (Node.js)
-
-If the platform doesn't provide a suitable PRNG, the following functions,
-which require random numbers, will throw exception:
-
-* `nacl.randomBytes`
-* `nacl.box.keyPair`
-* `nacl.sign.keyPair`
-
-Other functions are deterministic and will continue working.
-
-If a platform you are targeting doesn't implement secure random number
-generator, but you somehow have a cryptographically-strong source of entropy
-(not `Math.random`!), and you know what you are doing, you can plug it into
-TweetNaCl.js like this:
-
- nacl.setPRNG(function(x, n) {
- // ... copy n random bytes into x ...
- });
-
-Note that `nacl.setPRNG` *completely replaces* internal random byte generator
-with the one provided.
-
-
-### Constant-time comparison
-
-#### nacl.verify(x, y)
-
-Compares `x` and `y` in constant time and returns `true` if their lengths are
-non-zero and equal, and their contents are equal.
-
-Returns `false` if either of the arguments has zero length, or arguments have
-different lengths, or their contents differ.
-
-
-System requirements
--------------------
-
-TweetNaCl.js supports modern browsers that have a cryptographically secure
-pseudorandom number generator and typed arrays, including the latest versions
-of:
-
-* Chrome
-* Firefox
-* Safari (Mac, iOS)
-* Internet Explorer 11
-
-Other systems:
-
-* Node.js
-
-
-Development and testing
-------------------------
-
-Install NPM modules needed for development:
-
- $ npm install
-
-To build minified versions:
-
- $ npm run build
-
-Tests use minified version, so make sure to rebuild it every time you change
-`nacl.js` or `nacl-fast.js`.
-
-### Testing
-
-To run tests in Node.js:
-
- $ npm run test-node
-
-By default all tests described here work on `nacl.min.js`. To test other
-versions, set environment variable `NACL_SRC` to the file name you want to test.
-For example, the following command will test fast minified version:
-
- $ NACL_SRC=nacl-fast.min.js npm run test-node
-
-To run full suite of tests in Node.js, including comparing outputs of
-JavaScript port to outputs of the original C version:
-
- $ npm run test-node-all
-
-To prepare tests for browsers:
-
- $ npm run build-test-browser
-
-and then open `test/browser/test.html` (or `test/browser/test-fast.html`) to
-run them.
-
-To run headless browser tests with `tape-run` (powered by Electron):
-
- $ npm run test-browser
-
-(If you get `Error: spawn ENOENT`, install *xvfb*: `sudo apt-get install xvfb`.)
-
-To run tests in both Node and Electron:
-
- $ npm test
-
-### Benchmarking
-
-To run benchmarks in Node.js:
-
- $ npm run bench
- $ NACL_SRC=nacl-fast.min.js npm run bench
-
-To run benchmarks in a browser, open `test/benchmark/bench.html` (or
-`test/benchmark/bench-fast.html`).
-
-
-Benchmarks
-----------
-
-For reference, here are benchmarks from MacBook Pro (Retina, 13-inch, Mid 2014)
-laptop with 2.6 GHz Intel Core i5 CPU (Intel) in Chrome 53/OS X and Xiaomi Redmi
-Note 3 smartphone with 1.8 GHz Qualcomm Snapdragon 650 64-bit CPU (ARM) in
-Chrome 52/Android:
-
-| | nacl.js Intel | nacl-fast.js Intel | nacl.js ARM | nacl-fast.js ARM |
-| ------------- |:-------------:|:-------------------:|:-------------:|:-----------------:|
-| salsa20 | 1.3 MB/s | 128 MB/s | 0.4 MB/s | 43 MB/s |
-| poly1305 | 13 MB/s | 171 MB/s | 4 MB/s | 52 MB/s |
-| hash | 4 MB/s | 34 MB/s | 0.9 MB/s | 12 MB/s |
-| secretbox 1K | 1113 op/s | 57583 op/s | 334 op/s | 14227 op/s |
-| box 1K | 145 op/s | 718 op/s | 37 op/s | 368 op/s |
-| scalarMult | 171 op/s | 733 op/s | 56 op/s | 380 op/s |
-| sign | 77 op/s | 200 op/s | 20 op/s | 61 op/s |
-| sign.open | 39 op/s | 102 op/s | 11 op/s | 31 op/s |
-
-(You can run benchmarks on your devices by clicking on the links at the bottom
-of the [home page](https://tweetnacl.js.org)).
-
-In short, with *nacl-fast.js* and 1024-byte messages you can expect to encrypt and
-authenticate more than 57000 messages per second on a typical laptop or more than
-14000 messages per second on a $170 smartphone, sign about 200 and verify 100
-messages per second on a laptop or 60 and 30 messages per second on a smartphone,
-per CPU core (with Web Workers you can do these operations in parallel),
-which is good enough for most applications.
-
-
-Contributors
-------------
-
-See AUTHORS.md file.
-
-
-Third-party libraries based on TweetNaCl.js
--------------------------------------------
-
-* [forward-secrecy](https://github.com/alax/forward-secrecy) — Axolotl ratchet implementation
-* [nacl-stream](https://github.com/dchest/nacl-stream-js) - streaming encryption
-* [tweetnacl-auth-js](https://github.com/dchest/tweetnacl-auth-js) — implementation of [`crypto_auth`](http://nacl.cr.yp.to/auth.html)
-* [chloride](https://github.com/dominictarr/chloride) - unified API for various NaCl modules
-
-
-Who uses it
------------
-
-Some notable users of TweetNaCl.js:
-
-* [miniLock](http://minilock.io/)
-* [Stellar](https://www.stellar.org/)
diff --git a/node_modules/tweetnacl/nacl-fast.js b/node_modules/tweetnacl/nacl-fast.js
deleted file mode 100644
index 5e4562f..0000000
--- a/node_modules/tweetnacl/nacl-fast.js
+++ /dev/null
@@ -1,2388 +0,0 @@
-(function(nacl) {
-'use strict';
-
-// Ported in 2014 by Dmitry Chestnykh and Devi Mandiri.
-// Public domain.
-//
-// Implementation derived from TweetNaCl version 20140427.
-// See for details: http://tweetnacl.cr.yp.to/
-
-var gf = function(init) {
- var i, r = new Float64Array(16);
- if (init) for (i = 0; i < init.length; i++) r[i] = init[i];
- return r;
-};
-
-// Pluggable, initialized in high-level API below.
-var randombytes = function(/* x, n */) { throw new Error('no PRNG'); };
-
-var _0 = new Uint8Array(16);
-var _9 = new Uint8Array(32); _9[0] = 9;
-
-var gf0 = gf(),
- gf1 = gf([1]),
- _121665 = gf([0xdb41, 1]),
- D = gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]),
- D2 = gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]),
- X = gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]),
- Y = gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]),
- I = gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]);
-
-function ts64(x, i, h, l) {
- x[i] = (h >> 24) & 0xff;
- x[i+1] = (h >> 16) & 0xff;
- x[i+2] = (h >> 8) & 0xff;
- x[i+3] = h & 0xff;
- x[i+4] = (l >> 24) & 0xff;
- x[i+5] = (l >> 16) & 0xff;
- x[i+6] = (l >> 8) & 0xff;
- x[i+7] = l & 0xff;
-}
-
-function vn(x, xi, y, yi, n) {
- var i,d = 0;
- for (i = 0; i < n; i++) d |= x[xi+i]^y[yi+i];
- return (1 & ((d - 1) >>> 8)) - 1;
-}
-
-function crypto_verify_16(x, xi, y, yi) {
- return vn(x,xi,y,yi,16);
-}
-
-function crypto_verify_32(x, xi, y, yi) {
- return vn(x,xi,y,yi,32);
-}
-
-function core_salsa20(o, p, k, c) {
- var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,
- j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,
- j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,
- j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,
- j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,
- j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,
- j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,
- j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,
- j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,
- j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,
- j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,
- j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,
- j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,
- j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,
- j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,
- j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;
-
- var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,
- x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,
- x15 = j15, u;
-
- for (var i = 0; i < 20; i += 2) {
- u = x0 + x12 | 0;
- x4 ^= u<<7 | u>>>(32-7);
- u = x4 + x0 | 0;
- x8 ^= u<<9 | u>>>(32-9);
- u = x8 + x4 | 0;
- x12 ^= u<<13 | u>>>(32-13);
- u = x12 + x8 | 0;
- x0 ^= u<<18 | u>>>(32-18);
-
- u = x5 + x1 | 0;
- x9 ^= u<<7 | u>>>(32-7);
- u = x9 + x5 | 0;
- x13 ^= u<<9 | u>>>(32-9);
- u = x13 + x9 | 0;
- x1 ^= u<<13 | u>>>(32-13);
- u = x1 + x13 | 0;
- x5 ^= u<<18 | u>>>(32-18);
-
- u = x10 + x6 | 0;
- x14 ^= u<<7 | u>>>(32-7);
- u = x14 + x10 | 0;
- x2 ^= u<<9 | u>>>(32-9);
- u = x2 + x14 | 0;
- x6 ^= u<<13 | u>>>(32-13);
- u = x6 + x2 | 0;
- x10 ^= u<<18 | u>>>(32-18);
-
- u = x15 + x11 | 0;
- x3 ^= u<<7 | u>>>(32-7);
- u = x3 + x15 | 0;
- x7 ^= u<<9 | u>>>(32-9);
- u = x7 + x3 | 0;
- x11 ^= u<<13 | u>>>(32-13);
- u = x11 + x7 | 0;
- x15 ^= u<<18 | u>>>(32-18);
-
- u = x0 + x3 | 0;
- x1 ^= u<<7 | u>>>(32-7);
- u = x1 + x0 | 0;
- x2 ^= u<<9 | u>>>(32-9);
- u = x2 + x1 | 0;
- x3 ^= u<<13 | u>>>(32-13);
- u = x3 + x2 | 0;
- x0 ^= u<<18 | u>>>(32-18);
-
- u = x5 + x4 | 0;
- x6 ^= u<<7 | u>>>(32-7);
- u = x6 + x5 | 0;
- x7 ^= u<<9 | u>>>(32-9);
- u = x7 + x6 | 0;
- x4 ^= u<<13 | u>>>(32-13);
- u = x4 + x7 | 0;
- x5 ^= u<<18 | u>>>(32-18);
-
- u = x10 + x9 | 0;
- x11 ^= u<<7 | u>>>(32-7);
- u = x11 + x10 | 0;
- x8 ^= u<<9 | u>>>(32-9);
- u = x8 + x11 | 0;
- x9 ^= u<<13 | u>>>(32-13);
- u = x9 + x8 | 0;
- x10 ^= u<<18 | u>>>(32-18);
-
- u = x15 + x14 | 0;
- x12 ^= u<<7 | u>>>(32-7);
- u = x12 + x15 | 0;
- x13 ^= u<<9 | u>>>(32-9);
- u = x13 + x12 | 0;
- x14 ^= u<<13 | u>>>(32-13);
- u = x14 + x13 | 0;
- x15 ^= u<<18 | u>>>(32-18);
- }
- x0 = x0 + j0 | 0;
- x1 = x1 + j1 | 0;
- x2 = x2 + j2 | 0;
- x3 = x3 + j3 | 0;
- x4 = x4 + j4 | 0;
- x5 = x5 + j5 | 0;
- x6 = x6 + j6 | 0;
- x7 = x7 + j7 | 0;
- x8 = x8 + j8 | 0;
- x9 = x9 + j9 | 0;
- x10 = x10 + j10 | 0;
- x11 = x11 + j11 | 0;
- x12 = x12 + j12 | 0;
- x13 = x13 + j13 | 0;
- x14 = x14 + j14 | 0;
- x15 = x15 + j15 | 0;
-
- o[ 0] = x0 >>> 0 & 0xff;
- o[ 1] = x0 >>> 8 & 0xff;
- o[ 2] = x0 >>> 16 & 0xff;
- o[ 3] = x0 >>> 24 & 0xff;
-
- o[ 4] = x1 >>> 0 & 0xff;
- o[ 5] = x1 >>> 8 & 0xff;
- o[ 6] = x1 >>> 16 & 0xff;
- o[ 7] = x1 >>> 24 & 0xff;
-
- o[ 8] = x2 >>> 0 & 0xff;
- o[ 9] = x2 >>> 8 & 0xff;
- o[10] = x2 >>> 16 & 0xff;
- o[11] = x2 >>> 24 & 0xff;
-
- o[12] = x3 >>> 0 & 0xff;
- o[13] = x3 >>> 8 & 0xff;
- o[14] = x3 >>> 16 & 0xff;
- o[15] = x3 >>> 24 & 0xff;
-
- o[16] = x4 >>> 0 & 0xff;
- o[17] = x4 >>> 8 & 0xff;
- o[18] = x4 >>> 16 & 0xff;
- o[19] = x4 >>> 24 & 0xff;
-
- o[20] = x5 >>> 0 & 0xff;
- o[21] = x5 >>> 8 & 0xff;
- o[22] = x5 >>> 16 & 0xff;
- o[23] = x5 >>> 24 & 0xff;
-
- o[24] = x6 >>> 0 & 0xff;
- o[25] = x6 >>> 8 & 0xff;
- o[26] = x6 >>> 16 & 0xff;
- o[27] = x6 >>> 24 & 0xff;
-
- o[28] = x7 >>> 0 & 0xff;
- o[29] = x7 >>> 8 & 0xff;
- o[30] = x7 >>> 16 & 0xff;
- o[31] = x7 >>> 24 & 0xff;
-
- o[32] = x8 >>> 0 & 0xff;
- o[33] = x8 >>> 8 & 0xff;
- o[34] = x8 >>> 16 & 0xff;
- o[35] = x8 >>> 24 & 0xff;
-
- o[36] = x9 >>> 0 & 0xff;
- o[37] = x9 >>> 8 & 0xff;
- o[38] = x9 >>> 16 & 0xff;
- o[39] = x9 >>> 24 & 0xff;
-
- o[40] = x10 >>> 0 & 0xff;
- o[41] = x10 >>> 8 & 0xff;
- o[42] = x10 >>> 16 & 0xff;
- o[43] = x10 >>> 24 & 0xff;
-
- o[44] = x11 >>> 0 & 0xff;
- o[45] = x11 >>> 8 & 0xff;
- o[46] = x11 >>> 16 & 0xff;
- o[47] = x11 >>> 24 & 0xff;
-
- o[48] = x12 >>> 0 & 0xff;
- o[49] = x12 >>> 8 & 0xff;
- o[50] = x12 >>> 16 & 0xff;
- o[51] = x12 >>> 24 & 0xff;
-
- o[52] = x13 >>> 0 & 0xff;
- o[53] = x13 >>> 8 & 0xff;
- o[54] = x13 >>> 16 & 0xff;
- o[55] = x13 >>> 24 & 0xff;
-
- o[56] = x14 >>> 0 & 0xff;
- o[57] = x14 >>> 8 & 0xff;
- o[58] = x14 >>> 16 & 0xff;
- o[59] = x14 >>> 24 & 0xff;
-
- o[60] = x15 >>> 0 & 0xff;
- o[61] = x15 >>> 8 & 0xff;
- o[62] = x15 >>> 16 & 0xff;
- o[63] = x15 >>> 24 & 0xff;
-}
-
-function core_hsalsa20(o,p,k,c) {
- var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,
- j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,
- j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,
- j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,
- j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,
- j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,
- j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,
- j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,
- j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,
- j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,
- j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,
- j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,
- j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,
- j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,
- j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,
- j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;
-
- var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,
- x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,
- x15 = j15, u;
-
- for (var i = 0; i < 20; i += 2) {
- u = x0 + x12 | 0;
- x4 ^= u<<7 | u>>>(32-7);
- u = x4 + x0 | 0;
- x8 ^= u<<9 | u>>>(32-9);
- u = x8 + x4 | 0;
- x12 ^= u<<13 | u>>>(32-13);
- u = x12 + x8 | 0;
- x0 ^= u<<18 | u>>>(32-18);
-
- u = x5 + x1 | 0;
- x9 ^= u<<7 | u>>>(32-7);
- u = x9 + x5 | 0;
- x13 ^= u<<9 | u>>>(32-9);
- u = x13 + x9 | 0;
- x1 ^= u<<13 | u>>>(32-13);
- u = x1 + x13 | 0;
- x5 ^= u<<18 | u>>>(32-18);
-
- u = x10 + x6 | 0;
- x14 ^= u<<7 | u>>>(32-7);
- u = x14 + x10 | 0;
- x2 ^= u<<9 | u>>>(32-9);
- u = x2 + x14 | 0;
- x6 ^= u<<13 | u>>>(32-13);
- u = x6 + x2 | 0;
- x10 ^= u<<18 | u>>>(32-18);
-
- u = x15 + x11 | 0;
- x3 ^= u<<7 | u>>>(32-7);
- u = x3 + x15 | 0;
- x7 ^= u<<9 | u>>>(32-9);
- u = x7 + x3 | 0;
- x11 ^= u<<13 | u>>>(32-13);
- u = x11 + x7 | 0;
- x15 ^= u<<18 | u>>>(32-18);
-
- u = x0 + x3 | 0;
- x1 ^= u<<7 | u>>>(32-7);
- u = x1 + x0 | 0;
- x2 ^= u<<9 | u>>>(32-9);
- u = x2 + x1 | 0;
- x3 ^= u<<13 | u>>>(32-13);
- u = x3 + x2 | 0;
- x0 ^= u<<18 | u>>>(32-18);
-
- u = x5 + x4 | 0;
- x6 ^= u<<7 | u>>>(32-7);
- u = x6 + x5 | 0;
- x7 ^= u<<9 | u>>>(32-9);
- u = x7 + x6 | 0;
- x4 ^= u<<13 | u>>>(32-13);
- u = x4 + x7 | 0;
- x5 ^= u<<18 | u>>>(32-18);
-
- u = x10 + x9 | 0;
- x11 ^= u<<7 | u>>>(32-7);
- u = x11 + x10 | 0;
- x8 ^= u<<9 | u>>>(32-9);
- u = x8 + x11 | 0;
- x9 ^= u<<13 | u>>>(32-13);
- u = x9 + x8 | 0;
- x10 ^= u<<18 | u>>>(32-18);
-
- u = x15 + x14 | 0;
- x12 ^= u<<7 | u>>>(32-7);
- u = x12 + x15 | 0;
- x13 ^= u<<9 | u>>>(32-9);
- u = x13 + x12 | 0;
- x14 ^= u<<13 | u>>>(32-13);
- u = x14 + x13 | 0;
- x15 ^= u<<18 | u>>>(32-18);
- }
-
- o[ 0] = x0 >>> 0 & 0xff;
- o[ 1] = x0 >>> 8 & 0xff;
- o[ 2] = x0 >>> 16 & 0xff;
- o[ 3] = x0 >>> 24 & 0xff;
-
- o[ 4] = x5 >>> 0 & 0xff;
- o[ 5] = x5 >>> 8 & 0xff;
- o[ 6] = x5 >>> 16 & 0xff;
- o[ 7] = x5 >>> 24 & 0xff;
-
- o[ 8] = x10 >>> 0 & 0xff;
- o[ 9] = x10 >>> 8 & 0xff;
- o[10] = x10 >>> 16 & 0xff;
- o[11] = x10 >>> 24 & 0xff;
-
- o[12] = x15 >>> 0 & 0xff;
- o[13] = x15 >>> 8 & 0xff;
- o[14] = x15 >>> 16 & 0xff;
- o[15] = x15 >>> 24 & 0xff;
-
- o[16] = x6 >>> 0 & 0xff;
- o[17] = x6 >>> 8 & 0xff;
- o[18] = x6 >>> 16 & 0xff;
- o[19] = x6 >>> 24 & 0xff;
-
- o[20] = x7 >>> 0 & 0xff;
- o[21] = x7 >>> 8 & 0xff;
- o[22] = x7 >>> 16 & 0xff;
- o[23] = x7 >>> 24 & 0xff;
-
- o[24] = x8 >>> 0 & 0xff;
- o[25] = x8 >>> 8 & 0xff;
- o[26] = x8 >>> 16 & 0xff;
- o[27] = x8 >>> 24 & 0xff;
-
- o[28] = x9 >>> 0 & 0xff;
- o[29] = x9 >>> 8 & 0xff;
- o[30] = x9 >>> 16 & 0xff;
- o[31] = x9 >>> 24 & 0xff;
-}
-
-function crypto_core_salsa20(out,inp,k,c) {
- core_salsa20(out,inp,k,c);
-}
-
-function crypto_core_hsalsa20(out,inp,k,c) {
- core_hsalsa20(out,inp,k,c);
-}
-
-var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]);
- // "expand 32-byte k"
-
-function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k) {
- var z = new Uint8Array(16), x = new Uint8Array(64);
- var u, i;
- for (i = 0; i < 16; i++) z[i] = 0;
- for (i = 0; i < 8; i++) z[i] = n[i];
- while (b >= 64) {
- crypto_core_salsa20(x,z,k,sigma);
- for (i = 0; i < 64; i++) c[cpos+i] = m[mpos+i] ^ x[i];
- u = 1;
- for (i = 8; i < 16; i++) {
- u = u + (z[i] & 0xff) | 0;
- z[i] = u & 0xff;
- u >>>= 8;
- }
- b -= 64;
- cpos += 64;
- mpos += 64;
- }
- if (b > 0) {
- crypto_core_salsa20(x,z,k,sigma);
- for (i = 0; i < b; i++) c[cpos+i] = m[mpos+i] ^ x[i];
- }
- return 0;
-}
-
-function crypto_stream_salsa20(c,cpos,b,n,k) {
- var z = new Uint8Array(16), x = new Uint8Array(64);
- var u, i;
- for (i = 0; i < 16; i++) z[i] = 0;
- for (i = 0; i < 8; i++) z[i] = n[i];
- while (b >= 64) {
- crypto_core_salsa20(x,z,k,sigma);
- for (i = 0; i < 64; i++) c[cpos+i] = x[i];
- u = 1;
- for (i = 8; i < 16; i++) {
- u = u + (z[i] & 0xff) | 0;
- z[i] = u & 0xff;
- u >>>= 8;
- }
- b -= 64;
- cpos += 64;
- }
- if (b > 0) {
- crypto_core_salsa20(x,z,k,sigma);
- for (i = 0; i < b; i++) c[cpos+i] = x[i];
- }
- return 0;
-}
-
-function crypto_stream(c,cpos,d,n,k) {
- var s = new Uint8Array(32);
- crypto_core_hsalsa20(s,n,k,sigma);
- var sn = new Uint8Array(8);
- for (var i = 0; i < 8; i++) sn[i] = n[i+16];
- return crypto_stream_salsa20(c,cpos,d,sn,s);
-}
-
-function crypto_stream_xor(c,cpos,m,mpos,d,n,k) {
- var s = new Uint8Array(32);
- crypto_core_hsalsa20(s,n,k,sigma);
- var sn = new Uint8Array(8);
- for (var i = 0; i < 8; i++) sn[i] = n[i+16];
- return crypto_stream_salsa20_xor(c,cpos,m,mpos,d,sn,s);
-}
-
-/*
-* Port of Andrew Moon's Poly1305-donna-16. Public domain.
-* https://github.com/floodyberry/poly1305-donna
-*/
-
-var poly1305 = function(key) {
- this.buffer = new Uint8Array(16);
- this.r = new Uint16Array(10);
- this.h = new Uint16Array(10);
- this.pad = new Uint16Array(8);
- this.leftover = 0;
- this.fin = 0;
-
- var t0, t1, t2, t3, t4, t5, t6, t7;
-
- t0 = key[ 0] & 0xff | (key[ 1] & 0xff) << 8; this.r[0] = ( t0 ) & 0x1fff;
- t1 = key[ 2] & 0xff | (key[ 3] & 0xff) << 8; this.r[1] = ((t0 >>> 13) | (t1 << 3)) & 0x1fff;
- t2 = key[ 4] & 0xff | (key[ 5] & 0xff) << 8; this.r[2] = ((t1 >>> 10) | (t2 << 6)) & 0x1f03;
- t3 = key[ 6] & 0xff | (key[ 7] & 0xff) << 8; this.r[3] = ((t2 >>> 7) | (t3 << 9)) & 0x1fff;
- t4 = key[ 8] & 0xff | (key[ 9] & 0xff) << 8; this.r[4] = ((t3 >>> 4) | (t4 << 12)) & 0x00ff;
- this.r[5] = ((t4 >>> 1)) & 0x1ffe;
- t5 = key[10] & 0xff | (key[11] & 0xff) << 8; this.r[6] = ((t4 >>> 14) | (t5 << 2)) & 0x1fff;
- t6 = key[12] & 0xff | (key[13] & 0xff) << 8; this.r[7] = ((t5 >>> 11) | (t6 << 5)) & 0x1f81;
- t7 = key[14] & 0xff | (key[15] & 0xff) << 8; this.r[8] = ((t6 >>> 8) | (t7 << 8)) & 0x1fff;
- this.r[9] = ((t7 >>> 5)) & 0x007f;
-
- this.pad[0] = key[16] & 0xff | (key[17] & 0xff) << 8;
- this.pad[1] = key[18] & 0xff | (key[19] & 0xff) << 8;
- this.pad[2] = key[20] & 0xff | (key[21] & 0xff) << 8;
- this.pad[3] = key[22] & 0xff | (key[23] & 0xff) << 8;
- this.pad[4] = key[24] & 0xff | (key[25] & 0xff) << 8;
- this.pad[5] = key[26] & 0xff | (key[27] & 0xff) << 8;
- this.pad[6] = key[28] & 0xff | (key[29] & 0xff) << 8;
- this.pad[7] = key[30] & 0xff | (key[31] & 0xff) << 8;
-};
-
-poly1305.prototype.blocks = function(m, mpos, bytes) {
- var hibit = this.fin ? 0 : (1 << 11);
- var t0, t1, t2, t3, t4, t5, t6, t7, c;
- var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9;
-
- var h0 = this.h[0],
- h1 = this.h[1],
- h2 = this.h[2],
- h3 = this.h[3],
- h4 = this.h[4],
- h5 = this.h[5],
- h6 = this.h[6],
- h7 = this.h[7],
- h8 = this.h[8],
- h9 = this.h[9];
-
- var r0 = this.r[0],
- r1 = this.r[1],
- r2 = this.r[2],
- r3 = this.r[3],
- r4 = this.r[4],
- r5 = this.r[5],
- r6 = this.r[6],
- r7 = this.r[7],
- r8 = this.r[8],
- r9 = this.r[9];
-
- while (bytes >= 16) {
- t0 = m[mpos+ 0] & 0xff | (m[mpos+ 1] & 0xff) << 8; h0 += ( t0 ) & 0x1fff;
- t1 = m[mpos+ 2] & 0xff | (m[mpos+ 3] & 0xff) << 8; h1 += ((t0 >>> 13) | (t1 << 3)) & 0x1fff;
- t2 = m[mpos+ 4] & 0xff | (m[mpos+ 5] & 0xff) << 8; h2 += ((t1 >>> 10) | (t2 << 6)) & 0x1fff;
- t3 = m[mpos+ 6] & 0xff | (m[mpos+ 7] & 0xff) << 8; h3 += ((t2 >>> 7) | (t3 << 9)) & 0x1fff;
- t4 = m[mpos+ 8] & 0xff | (m[mpos+ 9] & 0xff) << 8; h4 += ((t3 >>> 4) | (t4 << 12)) & 0x1fff;
- h5 += ((t4 >>> 1)) & 0x1fff;
- t5 = m[mpos+10] & 0xff | (m[mpos+11] & 0xff) << 8; h6 += ((t4 >>> 14) | (t5 << 2)) & 0x1fff;
- t6 = m[mpos+12] & 0xff | (m[mpos+13] & 0xff) << 8; h7 += ((t5 >>> 11) | (t6 << 5)) & 0x1fff;
- t7 = m[mpos+14] & 0xff | (m[mpos+15] & 0xff) << 8; h8 += ((t6 >>> 8) | (t7 << 8)) & 0x1fff;
- h9 += ((t7 >>> 5)) | hibit;
-
- c = 0;
-
- d0 = c;
- d0 += h0 * r0;
- d0 += h1 * (5 * r9);
- d0 += h2 * (5 * r8);
- d0 += h3 * (5 * r7);
- d0 += h4 * (5 * r6);
- c = (d0 >>> 13); d0 &= 0x1fff;
- d0 += h5 * (5 * r5);
- d0 += h6 * (5 * r4);
- d0 += h7 * (5 * r3);
- d0 += h8 * (5 * r2);
- d0 += h9 * (5 * r1);
- c += (d0 >>> 13); d0 &= 0x1fff;
-
- d1 = c;
- d1 += h0 * r1;
- d1 += h1 * r0;
- d1 += h2 * (5 * r9);
- d1 += h3 * (5 * r8);
- d1 += h4 * (5 * r7);
- c = (d1 >>> 13); d1 &= 0x1fff;
- d1 += h5 * (5 * r6);
- d1 += h6 * (5 * r5);
- d1 += h7 * (5 * r4);
- d1 += h8 * (5 * r3);
- d1 += h9 * (5 * r2);
- c += (d1 >>> 13); d1 &= 0x1fff;
-
- d2 = c;
- d2 += h0 * r2;
- d2 += h1 * r1;
- d2 += h2 * r0;
- d2 += h3 * (5 * r9);
- d2 += h4 * (5 * r8);
- c = (d2 >>> 13); d2 &= 0x1fff;
- d2 += h5 * (5 * r7);
- d2 += h6 * (5 * r6);
- d2 += h7 * (5 * r5);
- d2 += h8 * (5 * r4);
- d2 += h9 * (5 * r3);
- c += (d2 >>> 13); d2 &= 0x1fff;
-
- d3 = c;
- d3 += h0 * r3;
- d3 += h1 * r2;
- d3 += h2 * r1;
- d3 += h3 * r0;
- d3 += h4 * (5 * r9);
- c = (d3 >>> 13); d3 &= 0x1fff;
- d3 += h5 * (5 * r8);
- d3 += h6 * (5 * r7);
- d3 += h7 * (5 * r6);
- d3 += h8 * (5 * r5);
- d3 += h9 * (5 * r4);
- c += (d3 >>> 13); d3 &= 0x1fff;
-
- d4 = c;
- d4 += h0 * r4;
- d4 += h1 * r3;
- d4 += h2 * r2;
- d4 += h3 * r1;
- d4 += h4 * r0;
- c = (d4 >>> 13); d4 &= 0x1fff;
- d4 += h5 * (5 * r9);
- d4 += h6 * (5 * r8);
- d4 += h7 * (5 * r7);
- d4 += h8 * (5 * r6);
- d4 += h9 * (5 * r5);
- c += (d4 >>> 13); d4 &= 0x1fff;
-
- d5 = c;
- d5 += h0 * r5;
- d5 += h1 * r4;
- d5 += h2 * r3;
- d5 += h3 * r2;
- d5 += h4 * r1;
- c = (d5 >>> 13); d5 &= 0x1fff;
- d5 += h5 * r0;
- d5 += h6 * (5 * r9);
- d5 += h7 * (5 * r8);
- d5 += h8 * (5 * r7);
- d5 += h9 * (5 * r6);
- c += (d5 >>> 13); d5 &= 0x1fff;
-
- d6 = c;
- d6 += h0 * r6;
- d6 += h1 * r5;
- d6 += h2 * r4;
- d6 += h3 * r3;
- d6 += h4 * r2;
- c = (d6 >>> 13); d6 &= 0x1fff;
- d6 += h5 * r1;
- d6 += h6 * r0;
- d6 += h7 * (5 * r9);
- d6 += h8 * (5 * r8);
- d6 += h9 * (5 * r7);
- c += (d6 >>> 13); d6 &= 0x1fff;
-
- d7 = c;
- d7 += h0 * r7;
- d7 += h1 * r6;
- d7 += h2 * r5;
- d7 += h3 * r4;
- d7 += h4 * r3;
- c = (d7 >>> 13); d7 &= 0x1fff;
- d7 += h5 * r2;
- d7 += h6 * r1;
- d7 += h7 * r0;
- d7 += h8 * (5 * r9);
- d7 += h9 * (5 * r8);
- c += (d7 >>> 13); d7 &= 0x1fff;
-
- d8 = c;
- d8 += h0 * r8;
- d8 += h1 * r7;
- d8 += h2 * r6;
- d8 += h3 * r5;
- d8 += h4 * r4;
- c = (d8 >>> 13); d8 &= 0x1fff;
- d8 += h5 * r3;
- d8 += h6 * r2;
- d8 += h7 * r1;
- d8 += h8 * r0;
- d8 += h9 * (5 * r9);
- c += (d8 >>> 13); d8 &= 0x1fff;
-
- d9 = c;
- d9 += h0 * r9;
- d9 += h1 * r8;
- d9 += h2 * r7;
- d9 += h3 * r6;
- d9 += h4 * r5;
- c = (d9 >>> 13); d9 &= 0x1fff;
- d9 += h5 * r4;
- d9 += h6 * r3;
- d9 += h7 * r2;
- d9 += h8 * r1;
- d9 += h9 * r0;
- c += (d9 >>> 13); d9 &= 0x1fff;
-
- c = (((c << 2) + c)) | 0;
- c = (c + d0) | 0;
- d0 = c & 0x1fff;
- c = (c >>> 13);
- d1 += c;
-
- h0 = d0;
- h1 = d1;
- h2 = d2;
- h3 = d3;
- h4 = d4;
- h5 = d5;
- h6 = d6;
- h7 = d7;
- h8 = d8;
- h9 = d9;
-
- mpos += 16;
- bytes -= 16;
- }
- this.h[0] = h0;
- this.h[1] = h1;
- this.h[2] = h2;
- this.h[3] = h3;
- this.h[4] = h4;
- this.h[5] = h5;
- this.h[6] = h6;
- this.h[7] = h7;
- this.h[8] = h8;
- this.h[9] = h9;
-};
-
-poly1305.prototype.finish = function(mac, macpos) {
- var g = new Uint16Array(10);
- var c, mask, f, i;
-
- if (this.leftover) {
- i = this.leftover;
- this.buffer[i++] = 1;
- for (; i < 16; i++) this.buffer[i] = 0;
- this.fin = 1;
- this.blocks(this.buffer, 0, 16);
- }
-
- c = this.h[1] >>> 13;
- this.h[1] &= 0x1fff;
- for (i = 2; i < 10; i++) {
- this.h[i] += c;
- c = this.h[i] >>> 13;
- this.h[i] &= 0x1fff;
- }
- this.h[0] += (c * 5);
- c = this.h[0] >>> 13;
- this.h[0] &= 0x1fff;
- this.h[1] += c;
- c = this.h[1] >>> 13;
- this.h[1] &= 0x1fff;
- this.h[2] += c;
-
- g[0] = this.h[0] + 5;
- c = g[0] >>> 13;
- g[0] &= 0x1fff;
- for (i = 1; i < 10; i++) {
- g[i] = this.h[i] + c;
- c = g[i] >>> 13;
- g[i] &= 0x1fff;
- }
- g[9] -= (1 << 13);
-
- mask = (c ^ 1) - 1;
- for (i = 0; i < 10; i++) g[i] &= mask;
- mask = ~mask;
- for (i = 0; i < 10; i++) this.h[i] = (this.h[i] & mask) | g[i];
-
- this.h[0] = ((this.h[0] ) | (this.h[1] << 13) ) & 0xffff;
- this.h[1] = ((this.h[1] >>> 3) | (this.h[2] << 10) ) & 0xffff;
- this.h[2] = ((this.h[2] >>> 6) | (this.h[3] << 7) ) & 0xffff;
- this.h[3] = ((this.h[3] >>> 9) | (this.h[4] << 4) ) & 0xffff;
- this.h[4] = ((this.h[4] >>> 12) | (this.h[5] << 1) | (this.h[6] << 14)) & 0xffff;
- this.h[5] = ((this.h[6] >>> 2) | (this.h[7] << 11) ) & 0xffff;
- this.h[6] = ((this.h[7] >>> 5) | (this.h[8] << 8) ) & 0xffff;
- this.h[7] = ((this.h[8] >>> 8) | (this.h[9] << 5) ) & 0xffff;
-
- f = this.h[0] + this.pad[0];
- this.h[0] = f & 0xffff;
- for (i = 1; i < 8; i++) {
- f = (((this.h[i] + this.pad[i]) | 0) + (f >>> 16)) | 0;
- this.h[i] = f & 0xffff;
- }
-
- mac[macpos+ 0] = (this.h[0] >>> 0) & 0xff;
- mac[macpos+ 1] = (this.h[0] >>> 8) & 0xff;
- mac[macpos+ 2] = (this.h[1] >>> 0) & 0xff;
- mac[macpos+ 3] = (this.h[1] >>> 8) & 0xff;
- mac[macpos+ 4] = (this.h[2] >>> 0) & 0xff;
- mac[macpos+ 5] = (this.h[2] >>> 8) & 0xff;
- mac[macpos+ 6] = (this.h[3] >>> 0) & 0xff;
- mac[macpos+ 7] = (this.h[3] >>> 8) & 0xff;
- mac[macpos+ 8] = (this.h[4] >>> 0) & 0xff;
- mac[macpos+ 9] = (this.h[4] >>> 8) & 0xff;
- mac[macpos+10] = (this.h[5] >>> 0) & 0xff;
- mac[macpos+11] = (this.h[5] >>> 8) & 0xff;
- mac[macpos+12] = (this.h[6] >>> 0) & 0xff;
- mac[macpos+13] = (this.h[6] >>> 8) & 0xff;
- mac[macpos+14] = (this.h[7] >>> 0) & 0xff;
- mac[macpos+15] = (this.h[7] >>> 8) & 0xff;
-};
-
-poly1305.prototype.update = function(m, mpos, bytes) {
- var i, want;
-
- if (this.leftover) {
- want = (16 - this.leftover);
- if (want > bytes)
- want = bytes;
- for (i = 0; i < want; i++)
- this.buffer[this.leftover + i] = m[mpos+i];
- bytes -= want;
- mpos += want;
- this.leftover += want;
- if (this.leftover < 16)
- return;
- this.blocks(this.buffer, 0, 16);
- this.leftover = 0;
- }
-
- if (bytes >= 16) {
- want = bytes - (bytes % 16);
- this.blocks(m, mpos, want);
- mpos += want;
- bytes -= want;
- }
-
- if (bytes) {
- for (i = 0; i < bytes; i++)
- this.buffer[this.leftover + i] = m[mpos+i];
- this.leftover += bytes;
- }
-};
-
-function crypto_onetimeauth(out, outpos, m, mpos, n, k) {
- var s = new poly1305(k);
- s.update(m, mpos, n);
- s.finish(out, outpos);
- return 0;
-}
-
-function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) {
- var x = new Uint8Array(16);
- crypto_onetimeauth(x,0,m,mpos,n,k);
- return crypto_verify_16(h,hpos,x,0);
-}
-
-function crypto_secretbox(c,m,d,n,k) {
- var i;
- if (d < 32) return -1;
- crypto_stream_xor(c,0,m,0,d,n,k);
- crypto_onetimeauth(c, 16, c, 32, d - 32, c);
- for (i = 0; i < 16; i++) c[i] = 0;
- return 0;
-}
-
-function crypto_secretbox_open(m,c,d,n,k) {
- var i;
- var x = new Uint8Array(32);
- if (d < 32) return -1;
- crypto_stream(x,0,32,n,k);
- if (crypto_onetimeauth_verify(c, 16,c, 32,d - 32,x) !== 0) return -1;
- crypto_stream_xor(m,0,c,0,d,n,k);
- for (i = 0; i < 32; i++) m[i] = 0;
- return 0;
-}
-
-function set25519(r, a) {
- var i;
- for (i = 0; i < 16; i++) r[i] = a[i]|0;
-}
-
-function car25519(o) {
- var i, v, c = 1;
- for (i = 0; i < 16; i++) {
- v = o[i] + c + 65535;
- c = Math.floor(v / 65536);
- o[i] = v - c * 65536;
- }
- o[0] += c-1 + 37 * (c-1);
-}
-
-function sel25519(p, q, b) {
- var t, c = ~(b-1);
- for (var i = 0; i < 16; i++) {
- t = c & (p[i] ^ q[i]);
- p[i] ^= t;
- q[i] ^= t;
- }
-}
-
-function pack25519(o, n) {
- var i, j, b;
- var m = gf(), t = gf();
- for (i = 0; i < 16; i++) t[i] = n[i];
- car25519(t);
- car25519(t);
- car25519(t);
- for (j = 0; j < 2; j++) {
- m[0] = t[0] - 0xffed;
- for (i = 1; i < 15; i++) {
- m[i] = t[i] - 0xffff - ((m[i-1]>>16) & 1);
- m[i-1] &= 0xffff;
- }
- m[15] = t[15] - 0x7fff - ((m[14]>>16) & 1);
- b = (m[15]>>16) & 1;
- m[14] &= 0xffff;
- sel25519(t, m, 1-b);
- }
- for (i = 0; i < 16; i++) {
- o[2*i] = t[i] & 0xff;
- o[2*i+1] = t[i]>>8;
- }
-}
-
-function neq25519(a, b) {
- var c = new Uint8Array(32), d = new Uint8Array(32);
- pack25519(c, a);
- pack25519(d, b);
- return crypto_verify_32(c, 0, d, 0);
-}
-
-function par25519(a) {
- var d = new Uint8Array(32);
- pack25519(d, a);
- return d[0] & 1;
-}
-
-function unpack25519(o, n) {
- var i;
- for (i = 0; i < 16; i++) o[i] = n[2*i] + (n[2*i+1] << 8);
- o[15] &= 0x7fff;
-}
-
-function A(o, a, b) {
- for (var i = 0; i < 16; i++) o[i] = a[i] + b[i];
-}
-
-function Z(o, a, b) {
- for (var i = 0; i < 16; i++) o[i] = a[i] - b[i];
-}
-
-function M(o, a, b) {
- var v, c,
- t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0,
- t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0,
- t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0,
- t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0,
- b0 = b[0],
- b1 = b[1],
- b2 = b[2],
- b3 = b[3],
- b4 = b[4],
- b5 = b[5],
- b6 = b[6],
- b7 = b[7],
- b8 = b[8],
- b9 = b[9],
- b10 = b[10],
- b11 = b[11],
- b12 = b[12],
- b13 = b[13],
- b14 = b[14],
- b15 = b[15];
-
- v = a[0];
- t0 += v * b0;
- t1 += v * b1;
- t2 += v * b2;
- t3 += v * b3;
- t4 += v * b4;
- t5 += v * b5;
- t6 += v * b6;
- t7 += v * b7;
- t8 += v * b8;
- t9 += v * b9;
- t10 += v * b10;
- t11 += v * b11;
- t12 += v * b12;
- t13 += v * b13;
- t14 += v * b14;
- t15 += v * b15;
- v = a[1];
- t1 += v * b0;
- t2 += v * b1;
- t3 += v * b2;
- t4 += v * b3;
- t5 += v * b4;
- t6 += v * b5;
- t7 += v * b6;
- t8 += v * b7;
- t9 += v * b8;
- t10 += v * b9;
- t11 += v * b10;
- t12 += v * b11;
- t13 += v * b12;
- t14 += v * b13;
- t15 += v * b14;
- t16 += v * b15;
- v = a[2];
- t2 += v * b0;
- t3 += v * b1;
- t4 += v * b2;
- t5 += v * b3;
- t6 += v * b4;
- t7 += v * b5;
- t8 += v * b6;
- t9 += v * b7;
- t10 += v * b8;
- t11 += v * b9;
- t12 += v * b10;
- t13 += v * b11;
- t14 += v * b12;
- t15 += v * b13;
- t16 += v * b14;
- t17 += v * b15;
- v = a[3];
- t3 += v * b0;
- t4 += v * b1;
- t5 += v * b2;
- t6 += v * b3;
- t7 += v * b4;
- t8 += v * b5;
- t9 += v * b6;
- t10 += v * b7;
- t11 += v * b8;
- t12 += v * b9;
- t13 += v * b10;
- t14 += v * b11;
- t15 += v * b12;
- t16 += v * b13;
- t17 += v * b14;
- t18 += v * b15;
- v = a[4];
- t4 += v * b0;
- t5 += v * b1;
- t6 += v * b2;
- t7 += v * b3;
- t8 += v * b4;
- t9 += v * b5;
- t10 += v * b6;
- t11 += v * b7;
- t12 += v * b8;
- t13 += v * b9;
- t14 += v * b10;
- t15 += v * b11;
- t16 += v * b12;
- t17 += v * b13;
- t18 += v * b14;
- t19 += v * b15;
- v = a[5];
- t5 += v * b0;
- t6 += v * b1;
- t7 += v * b2;
- t8 += v * b3;
- t9 += v * b4;
- t10 += v * b5;
- t11 += v * b6;
- t12 += v * b7;
- t13 += v * b8;
- t14 += v * b9;
- t15 += v * b10;
- t16 += v * b11;
- t17 += v * b12;
- t18 += v * b13;
- t19 += v * b14;
- t20 += v * b15;
- v = a[6];
- t6 += v * b0;
- t7 += v * b1;
- t8 += v * b2;
- t9 += v * b3;
- t10 += v * b4;
- t11 += v * b5;
- t12 += v * b6;
- t13 += v * b7;
- t14 += v * b8;
- t15 += v * b9;
- t16 += v * b10;
- t17 += v * b11;
- t18 += v * b12;
- t19 += v * b13;
- t20 += v * b14;
- t21 += v * b15;
- v = a[7];
- t7 += v * b0;
- t8 += v * b1;
- t9 += v * b2;
- t10 += v * b3;
- t11 += v * b4;
- t12 += v * b5;
- t13 += v * b6;
- t14 += v * b7;
- t15 += v * b8;
- t16 += v * b9;
- t17 += v * b10;
- t18 += v * b11;
- t19 += v * b12;
- t20 += v * b13;
- t21 += v * b14;
- t22 += v * b15;
- v = a[8];
- t8 += v * b0;
- t9 += v * b1;
- t10 += v * b2;
- t11 += v * b3;
- t12 += v * b4;
- t13 += v * b5;
- t14 += v * b6;
- t15 += v * b7;
- t16 += v * b8;
- t17 += v * b9;
- t18 += v * b10;
- t19 += v * b11;
- t20 += v * b12;
- t21 += v * b13;
- t22 += v * b14;
- t23 += v * b15;
- v = a[9];
- t9 += v * b0;
- t10 += v * b1;
- t11 += v * b2;
- t12 += v * b3;
- t13 += v * b4;
- t14 += v * b5;
- t15 += v * b6;
- t16 += v * b7;
- t17 += v * b8;
- t18 += v * b9;
- t19 += v * b10;
- t20 += v * b11;
- t21 += v * b12;
- t22 += v * b13;
- t23 += v * b14;
- t24 += v * b15;
- v = a[10];
- t10 += v * b0;
- t11 += v * b1;
- t12 += v * b2;
- t13 += v * b3;
- t14 += v * b4;
- t15 += v * b5;
- t16 += v * b6;
- t17 += v * b7;
- t18 += v * b8;
- t19 += v * b9;
- t20 += v * b10;
- t21 += v * b11;
- t22 += v * b12;
- t23 += v * b13;
- t24 += v * b14;
- t25 += v * b15;
- v = a[11];
- t11 += v * b0;
- t12 += v * b1;
- t13 += v * b2;
- t14 += v * b3;
- t15 += v * b4;
- t16 += v * b5;
- t17 += v * b6;
- t18 += v * b7;
- t19 += v * b8;
- t20 += v * b9;
- t21 += v * b10;
- t22 += v * b11;
- t23 += v * b12;
- t24 += v * b13;
- t25 += v * b14;
- t26 += v * b15;
- v = a[12];
- t12 += v * b0;
- t13 += v * b1;
- t14 += v * b2;
- t15 += v * b3;
- t16 += v * b4;
- t17 += v * b5;
- t18 += v * b6;
- t19 += v * b7;
- t20 += v * b8;
- t21 += v * b9;
- t22 += v * b10;
- t23 += v * b11;
- t24 += v * b12;
- t25 += v * b13;
- t26 += v * b14;
- t27 += v * b15;
- v = a[13];
- t13 += v * b0;
- t14 += v * b1;
- t15 += v * b2;
- t16 += v * b3;
- t17 += v * b4;
- t18 += v * b5;
- t19 += v * b6;
- t20 += v * b7;
- t21 += v * b8;
- t22 += v * b9;
- t23 += v * b10;
- t24 += v * b11;
- t25 += v * b12;
- t26 += v * b13;
- t27 += v * b14;
- t28 += v * b15;
- v = a[14];
- t14 += v * b0;
- t15 += v * b1;
- t16 += v * b2;
- t17 += v * b3;
- t18 += v * b4;
- t19 += v * b5;
- t20 += v * b6;
- t21 += v * b7;
- t22 += v * b8;
- t23 += v * b9;
- t24 += v * b10;
- t25 += v * b11;
- t26 += v * b12;
- t27 += v * b13;
- t28 += v * b14;
- t29 += v * b15;
- v = a[15];
- t15 += v * b0;
- t16 += v * b1;
- t17 += v * b2;
- t18 += v * b3;
- t19 += v * b4;
- t20 += v * b5;
- t21 += v * b6;
- t22 += v * b7;
- t23 += v * b8;
- t24 += v * b9;
- t25 += v * b10;
- t26 += v * b11;
- t27 += v * b12;
- t28 += v * b13;
- t29 += v * b14;
- t30 += v * b15;
-
- t0 += 38 * t16;
- t1 += 38 * t17;
- t2 += 38 * t18;
- t3 += 38 * t19;
- t4 += 38 * t20;
- t5 += 38 * t21;
- t6 += 38 * t22;
- t7 += 38 * t23;
- t8 += 38 * t24;
- t9 += 38 * t25;
- t10 += 38 * t26;
- t11 += 38 * t27;
- t12 += 38 * t28;
- t13 += 38 * t29;
- t14 += 38 * t30;
- // t15 left as is
-
- // first car
- c = 1;
- v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536;
- v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536;
- v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536;
- v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536;
- v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536;
- v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536;
- v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536;
- v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536;
- v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536;
- v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536;
- v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;
- v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;
- v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;
- v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;
- v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;
- v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;
- t0 += c-1 + 37 * (c-1);
-
- // second car
- c = 1;
- v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536;
- v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536;
- v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536;
- v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536;
- v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536;
- v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536;
- v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536;
- v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536;
- v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536;
- v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536;
- v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;
- v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;
- v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;
- v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;
- v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;
- v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;
- t0 += c-1 + 37 * (c-1);
-
- o[ 0] = t0;
- o[ 1] = t1;
- o[ 2] = t2;
- o[ 3] = t3;
- o[ 4] = t4;
- o[ 5] = t5;
- o[ 6] = t6;
- o[ 7] = t7;
- o[ 8] = t8;
- o[ 9] = t9;
- o[10] = t10;
- o[11] = t11;
- o[12] = t12;
- o[13] = t13;
- o[14] = t14;
- o[15] = t15;
-}
-
-function S(o, a) {
- M(o, a, a);
-}
-
-function inv25519(o, i) {
- var c = gf();
- var a;
- for (a = 0; a < 16; a++) c[a] = i[a];
- for (a = 253; a >= 0; a--) {
- S(c, c);
- if(a !== 2 && a !== 4) M(c, c, i);
- }
- for (a = 0; a < 16; a++) o[a] = c[a];
-}
-
-function pow2523(o, i) {
- var c = gf();
- var a;
- for (a = 0; a < 16; a++) c[a] = i[a];
- for (a = 250; a >= 0; a--) {
- S(c, c);
- if(a !== 1) M(c, c, i);
- }
- for (a = 0; a < 16; a++) o[a] = c[a];
-}
-
-function crypto_scalarmult(q, n, p) {
- var z = new Uint8Array(32);
- var x = new Float64Array(80), r, i;
- var a = gf(), b = gf(), c = gf(),
- d = gf(), e = gf(), f = gf();
- for (i = 0; i < 31; i++) z[i] = n[i];
- z[31]=(n[31]&127)|64;
- z[0]&=248;
- unpack25519(x,p);
- for (i = 0; i < 16; i++) {
- b[i]=x[i];
- d[i]=a[i]=c[i]=0;
- }
- a[0]=d[0]=1;
- for (i=254; i>=0; --i) {
- r=(z[i>>>3]>>>(i&7))&1;
- sel25519(a,b,r);
- sel25519(c,d,r);
- A(e,a,c);
- Z(a,a,c);
- A(c,b,d);
- Z(b,b,d);
- S(d,e);
- S(f,a);
- M(a,c,a);
- M(c,b,e);
- A(e,a,c);
- Z(a,a,c);
- S(b,a);
- Z(c,d,f);
- M(a,c,_121665);
- A(a,a,d);
- M(c,c,a);
- M(a,d,f);
- M(d,b,x);
- S(b,e);
- sel25519(a,b,r);
- sel25519(c,d,r);
- }
- for (i = 0; i < 16; i++) {
- x[i+16]=a[i];
- x[i+32]=c[i];
- x[i+48]=b[i];
- x[i+64]=d[i];
- }
- var x32 = x.subarray(32);
- var x16 = x.subarray(16);
- inv25519(x32,x32);
- M(x16,x16,x32);
- pack25519(q,x16);
- return 0;
-}
-
-function crypto_scalarmult_base(q, n) {
- return crypto_scalarmult(q, n, _9);
-}
-
-function crypto_box_keypair(y, x) {
- randombytes(x, 32);
- return crypto_scalarmult_base(y, x);
-}
-
-function crypto_box_beforenm(k, y, x) {
- var s = new Uint8Array(32);
- crypto_scalarmult(s, x, y);
- return crypto_core_hsalsa20(k, _0, s, sigma);
-}
-
-var crypto_box_afternm = crypto_secretbox;
-var crypto_box_open_afternm = crypto_secretbox_open;
-
-function crypto_box(c, m, d, n, y, x) {
- var k = new Uint8Array(32);
- crypto_box_beforenm(k, y, x);
- return crypto_box_afternm(c, m, d, n, k);
-}
-
-function crypto_box_open(m, c, d, n, y, x) {
- var k = new Uint8Array(32);
- crypto_box_beforenm(k, y, x);
- return crypto_box_open_afternm(m, c, d, n, k);
-}
-
-var K = [
- 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
- 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
- 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
- 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
- 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
- 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
- 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
- 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
- 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
- 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
- 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
- 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
- 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
- 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
- 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
- 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
- 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
- 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
- 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
- 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
- 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
- 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
- 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
- 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
- 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
- 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
- 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
- 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
- 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
- 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
- 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
- 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
- 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
- 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
- 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
- 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
- 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
- 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
- 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
- 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
-];
-
-function crypto_hashblocks_hl(hh, hl, m, n) {
- var wh = new Int32Array(16), wl = new Int32Array(16),
- bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7,
- bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7,
- th, tl, i, j, h, l, a, b, c, d;
-
- var ah0 = hh[0],
- ah1 = hh[1],
- ah2 = hh[2],
- ah3 = hh[3],
- ah4 = hh[4],
- ah5 = hh[5],
- ah6 = hh[6],
- ah7 = hh[7],
-
- al0 = hl[0],
- al1 = hl[1],
- al2 = hl[2],
- al3 = hl[3],
- al4 = hl[4],
- al5 = hl[5],
- al6 = hl[6],
- al7 = hl[7];
-
- var pos = 0;
- while (n >= 128) {
- for (i = 0; i < 16; i++) {
- j = 8 * i + pos;
- wh[i] = (m[j+0] << 24) | (m[j+1] << 16) | (m[j+2] << 8) | m[j+3];
- wl[i] = (m[j+4] << 24) | (m[j+5] << 16) | (m[j+6] << 8) | m[j+7];
- }
- for (i = 0; i < 80; i++) {
- bh0 = ah0;
- bh1 = ah1;
- bh2 = ah2;
- bh3 = ah3;
- bh4 = ah4;
- bh5 = ah5;
- bh6 = ah6;
- bh7 = ah7;
-
- bl0 = al0;
- bl1 = al1;
- bl2 = al2;
- bl3 = al3;
- bl4 = al4;
- bl5 = al5;
- bl6 = al6;
- bl7 = al7;
-
- // add
- h = ah7;
- l = al7;
-
- a = l & 0xffff; b = l >>> 16;
- c = h & 0xffff; d = h >>> 16;
-
- // Sigma1
- h = ((ah4 >>> 14) | (al4 << (32-14))) ^ ((ah4 >>> 18) | (al4 << (32-18))) ^ ((al4 >>> (41-32)) | (ah4 << (32-(41-32))));
- l = ((al4 >>> 14) | (ah4 << (32-14))) ^ ((al4 >>> 18) | (ah4 << (32-18))) ^ ((ah4 >>> (41-32)) | (al4 << (32-(41-32))));
-
- a += l & 0xffff; b += l >>> 16;
- c += h & 0xffff; d += h >>> 16;
-
- // Ch
- h = (ah4 & ah5) ^ (~ah4 & ah6);
- l = (al4 & al5) ^ (~al4 & al6);
-
- a += l & 0xffff; b += l >>> 16;
- c += h & 0xffff; d += h >>> 16;
-
- // K
- h = K[i*2];
- l = K[i*2+1];
-
- a += l & 0xffff; b += l >>> 16;
- c += h & 0xffff; d += h >>> 16;
-
- // w
- h = wh[i%16];
- l = wl[i%16];
-
- a += l & 0xffff; b += l >>> 16;
- c += h & 0xffff; d += h >>> 16;
-
- b += a >>> 16;
- c += b >>> 16;
- d += c >>> 16;
-
- th = c & 0xffff | d << 16;
- tl = a & 0xffff | b << 16;
-
- // add
- h = th;
- l = tl;
-
- a = l & 0xffff; b = l >>> 16;
- c = h & 0xffff; d = h >>> 16;
-
- // Sigma0
- h = ((ah0 >>> 28) | (al0 << (32-28))) ^ ((al0 >>> (34-32)) | (ah0 << (32-(34-32)))) ^ ((al0 >>> (39-32)) | (ah0 << (32-(39-32))));
- l = ((al0 >>> 28) | (ah0 << (32-28))) ^ ((ah0 >>> (34-32)) | (al0 << (32-(34-32)))) ^ ((ah0 >>> (39-32)) | (al0 << (32-(39-32))));
-
- a += l & 0xffff; b += l >>> 16;
- c += h & 0xffff; d += h >>> 16;
-
- // Maj
- h = (ah0 & ah1) ^ (ah0 & ah2) ^ (ah1 & ah2);
- l = (al0 & al1) ^ (al0 & al2) ^ (al1 & al2);
-
- a += l & 0xffff; b += l >>> 16;
- c += h & 0xffff; d += h >>> 16;
-
- b += a >>> 16;
- c += b >>> 16;
- d += c >>> 16;
-
- bh7 = (c & 0xffff) | (d << 16);
- bl7 = (a & 0xffff) | (b << 16);
-
- // add
- h = bh3;
- l = bl3;
-
- a = l & 0xffff; b = l >>> 16;
- c = h & 0xffff; d = h >>> 16;
-
- h = th;
- l = tl;
-
- a += l & 0xffff; b += l >>> 16;
- c += h & 0xffff; d += h >>> 16;
-
- b += a >>> 16;
- c += b >>> 16;
- d += c >>> 16;
-
- bh3 = (c & 0xffff) | (d << 16);
- bl3 = (a & 0xffff) | (b << 16);
-
- ah1 = bh0;
- ah2 = bh1;
- ah3 = bh2;
- ah4 = bh3;
- ah5 = bh4;
- ah6 = bh5;
- ah7 = bh6;
- ah0 = bh7;
-
- al1 = bl0;
- al2 = bl1;
- al3 = bl2;
- al4 = bl3;
- al5 = bl4;
- al6 = bl5;
- al7 = bl6;
- al0 = bl7;
-
- if (i%16 === 15) {
- for (j = 0; j < 16; j++) {
- // add
- h = wh[j];
- l = wl[j];
-
- a = l & 0xffff; b = l >>> 16;
- c = h & 0xffff; d = h >>> 16;
-
- h = wh[(j+9)%16];
- l = wl[(j+9)%16];
-
- a += l & 0xffff; b += l >>> 16;
- c += h & 0xffff; d += h >>> 16;
-
- // sigma0
- th = wh[(j+1)%16];
- tl = wl[(j+1)%16];
- h = ((th >>> 1) | (tl << (32-1))) ^ ((th >>> 8) | (tl << (32-8))) ^ (th >>> 7);
- l = ((tl >>> 1) | (th << (32-1))) ^ ((tl >>> 8) | (th << (32-8))) ^ ((tl >>> 7) | (th << (32-7)));
-
- a += l & 0xffff; b += l >>> 16;
- c += h & 0xffff; d += h >>> 16;
-
- // sigma1
- th = wh[(j+14)%16];
- tl = wl[(j+14)%16];
- h = ((th >>> 19) | (tl << (32-19))) ^ ((tl >>> (61-32)) | (th << (32-(61-32)))) ^ (th >>> 6);
- l = ((tl >>> 19) | (th << (32-19))) ^ ((th >>> (61-32)) | (tl << (32-(61-32)))) ^ ((tl >>> 6) | (th << (32-6)));
-
- a += l & 0xffff; b += l >>> 16;
- c += h & 0xffff; d += h >>> 16;
-
- b += a >>> 16;
- c += b >>> 16;
- d += c >>> 16;
-
- wh[j] = (c & 0xffff) | (d << 16);
- wl[j] = (a & 0xffff) | (b << 16);
- }
- }
- }
-
- // add
- h = ah0;
- l = al0;
-
- a = l & 0xffff; b = l >>> 16;
- c = h & 0xffff; d = h >>> 16;
-
- h = hh[0];
- l = hl[0];
-
- a += l & 0xffff; b += l >>> 16;
- c += h & 0xffff; d += h >>> 16;
-
- b += a >>> 16;
- c += b >>> 16;
- d += c >>> 16;
-
- hh[0] = ah0 = (c & 0xffff) | (d << 16);
- hl[0] = al0 = (a & 0xffff) | (b << 16);
-
- h = ah1;
- l = al1;
-
- a = l & 0xffff; b = l >>> 16;
- c = h & 0xffff; d = h >>> 16;
-
- h = hh[1];
- l = hl[1];
-
- a += l & 0xffff; b += l >>> 16;
- c += h & 0xffff; d += h >>> 16;
-
- b += a >>> 16;
- c += b >>> 16;
- d += c >>> 16;
-
- hh[1] = ah1 = (c & 0xffff) | (d << 16);
- hl[1] = al1 = (a & 0xffff) | (b << 16);
-
- h = ah2;
- l = al2;
-
- a = l & 0xffff; b = l >>> 16;
- c = h & 0xffff; d = h >>> 16;
-
- h = hh[2];
- l = hl[2];
-
- a += l & 0xffff; b += l >>> 16;
- c += h & 0xffff; d += h >>> 16;
-
- b += a >>> 16;
- c += b >>> 16;
- d += c >>> 16;
-
- hh[2] = ah2 = (c & 0xffff) | (d << 16);
- hl[2] = al2 = (a & 0xffff) | (b << 16);
-
- h = ah3;
- l = al3;
-
- a = l & 0xffff; b = l >>> 16;
- c = h & 0xffff; d = h >>> 16;
-
- h = hh[3];
- l = hl[3];
-
- a += l & 0xffff; b += l >>> 16;
- c += h & 0xffff; d += h >>> 16;
-
- b += a >>> 16;
- c += b >>> 16;
- d += c >>> 16;
-
- hh[3] = ah3 = (c & 0xffff) | (d << 16);
- hl[3] = al3 = (a & 0xffff) | (b << 16);
-
- h = ah4;
- l = al4;
-
- a = l & 0xffff; b = l >>> 16;
- c = h & 0xffff; d = h >>> 16;
-
- h = hh[4];
- l = hl[4];
-
- a += l & 0xffff; b += l >>> 16;
- c += h & 0xffff; d += h >>> 16;
-
- b += a >>> 16;
- c += b >>> 16;
- d += c >>> 16;
-
- hh[4] = ah4 = (c & 0xffff) | (d << 16);
- hl[4] = al4 = (a & 0xffff) | (b << 16);
-
- h = ah5;
- l = al5;
-
- a = l & 0xffff; b = l >>> 16;
- c = h & 0xffff; d = h >>> 16;
-
- h = hh[5];
- l = hl[5];
-
- a += l & 0xffff; b += l >>> 16;
- c += h & 0xffff; d += h >>> 16;
-
- b += a >>> 16;
- c += b >>> 16;
- d += c >>> 16;
-
- hh[5] = ah5 = (c & 0xffff) | (d << 16);
- hl[5] = al5 = (a & 0xffff) | (b << 16);
-
- h = ah6;
- l = al6;
-
- a = l & 0xffff; b = l >>> 16;
- c = h & 0xffff; d = h >>> 16;
-
- h = hh[6];
- l = hl[6];
-
- a += l & 0xffff; b += l >>> 16;
- c += h & 0xffff; d += h >>> 16;
-
- b += a >>> 16;
- c += b >>> 16;
- d += c >>> 16;
-
- hh[6] = ah6 = (c & 0xffff) | (d << 16);
- hl[6] = al6 = (a & 0xffff) | (b << 16);
-
- h = ah7;
- l = al7;
-
- a = l & 0xffff; b = l >>> 16;
- c = h & 0xffff; d = h >>> 16;
-
- h = hh[7];
- l = hl[7];
-
- a += l & 0xffff; b += l >>> 16;
- c += h & 0xffff; d += h >>> 16;
-
- b += a >>> 16;
- c += b >>> 16;
- d += c >>> 16;
-
- hh[7] = ah7 = (c & 0xffff) | (d << 16);
- hl[7] = al7 = (a & 0xffff) | (b << 16);
-
- pos += 128;
- n -= 128;
- }
-
- return n;
-}
-
-function crypto_hash(out, m, n) {
- var hh = new Int32Array(8),
- hl = new Int32Array(8),
- x = new Uint8Array(256),
- i, b = n;
-
- hh[0] = 0x6a09e667;
- hh[1] = 0xbb67ae85;
- hh[2] = 0x3c6ef372;
- hh[3] = 0xa54ff53a;
- hh[4] = 0x510e527f;
- hh[5] = 0x9b05688c;
- hh[6] = 0x1f83d9ab;
- hh[7] = 0x5be0cd19;
-
- hl[0] = 0xf3bcc908;
- hl[1] = 0x84caa73b;
- hl[2] = 0xfe94f82b;
- hl[3] = 0x5f1d36f1;
- hl[4] = 0xade682d1;
- hl[5] = 0x2b3e6c1f;
- hl[6] = 0xfb41bd6b;
- hl[7] = 0x137e2179;
-
- crypto_hashblocks_hl(hh, hl, m, n);
- n %= 128;
-
- for (i = 0; i < n; i++) x[i] = m[b-n+i];
- x[n] = 128;
-
- n = 256-128*(n<112?1:0);
- x[n-9] = 0;
- ts64(x, n-8, (b / 0x20000000) | 0, b << 3);
- crypto_hashblocks_hl(hh, hl, x, n);
-
- for (i = 0; i < 8; i++) ts64(out, 8*i, hh[i], hl[i]);
-
- return 0;
-}
-
-function add(p, q) {
- var a = gf(), b = gf(), c = gf(),
- d = gf(), e = gf(), f = gf(),
- g = gf(), h = gf(), t = gf();
-
- Z(a, p[1], p[0]);
- Z(t, q[1], q[0]);
- M(a, a, t);
- A(b, p[0], p[1]);
- A(t, q[0], q[1]);
- M(b, b, t);
- M(c, p[3], q[3]);
- M(c, c, D2);
- M(d, p[2], q[2]);
- A(d, d, d);
- Z(e, b, a);
- Z(f, d, c);
- A(g, d, c);
- A(h, b, a);
-
- M(p[0], e, f);
- M(p[1], h, g);
- M(p[2], g, f);
- M(p[3], e, h);
-}
-
-function cswap(p, q, b) {
- var i;
- for (i = 0; i < 4; i++) {
- sel25519(p[i], q[i], b);
- }
-}
-
-function pack(r, p) {
- var tx = gf(), ty = gf(), zi = gf();
- inv25519(zi, p[2]);
- M(tx, p[0], zi);
- M(ty, p[1], zi);
- pack25519(r, ty);
- r[31] ^= par25519(tx) << 7;
-}
-
-function scalarmult(p, q, s) {
- var b, i;
- set25519(p[0], gf0);
- set25519(p[1], gf1);
- set25519(p[2], gf1);
- set25519(p[3], gf0);
- for (i = 255; i >= 0; --i) {
- b = (s[(i/8)|0] >> (i&7)) & 1;
- cswap(p, q, b);
- add(q, p);
- add(p, p);
- cswap(p, q, b);
- }
-}
-
-function scalarbase(p, s) {
- var q = [gf(), gf(), gf(), gf()];
- set25519(q[0], X);
- set25519(q[1], Y);
- set25519(q[2], gf1);
- M(q[3], X, Y);
- scalarmult(p, q, s);
-}
-
-function crypto_sign_keypair(pk, sk, seeded) {
- var d = new Uint8Array(64);
- var p = [gf(), gf(), gf(), gf()];
- var i;
-
- if (!seeded) randombytes(sk, 32);
- crypto_hash(d, sk, 32);
- d[0] &= 248;
- d[31] &= 127;
- d[31] |= 64;
-
- scalarbase(p, d);
- pack(pk, p);
-
- for (i = 0; i < 32; i++) sk[i+32] = pk[i];
- return 0;
-}
-
-var L = new Float64Array([0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]);
-
-function modL(r, x) {
- var carry, i, j, k;
- for (i = 63; i >= 32; --i) {
- carry = 0;
- for (j = i - 32, k = i - 12; j < k; ++j) {
- x[j] += carry - 16 * x[i] * L[j - (i - 32)];
- carry = (x[j] + 128) >> 8;
- x[j] -= carry * 256;
- }
- x[j] += carry;
- x[i] = 0;
- }
- carry = 0;
- for (j = 0; j < 32; j++) {
- x[j] += carry - (x[31] >> 4) * L[j];
- carry = x[j] >> 8;
- x[j] &= 255;
- }
- for (j = 0; j < 32; j++) x[j] -= carry * L[j];
- for (i = 0; i < 32; i++) {
- x[i+1] += x[i] >> 8;
- r[i] = x[i] & 255;
- }
-}
-
-function reduce(r) {
- var x = new Float64Array(64), i;
- for (i = 0; i < 64; i++) x[i] = r[i];
- for (i = 0; i < 64; i++) r[i] = 0;
- modL(r, x);
-}
-
-// Note: difference from C - smlen returned, not passed as argument.
-function crypto_sign(sm, m, n, sk) {
- var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64);
- var i, j, x = new Float64Array(64);
- var p = [gf(), gf(), gf(), gf()];
-
- crypto_hash(d, sk, 32);
- d[0] &= 248;
- d[31] &= 127;
- d[31] |= 64;
-
- var smlen = n + 64;
- for (i = 0; i < n; i++) sm[64 + i] = m[i];
- for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i];
-
- crypto_hash(r, sm.subarray(32), n+32);
- reduce(r);
- scalarbase(p, r);
- pack(sm, p);
-
- for (i = 32; i < 64; i++) sm[i] = sk[i];
- crypto_hash(h, sm, n + 64);
- reduce(h);
-
- for (i = 0; i < 64; i++) x[i] = 0;
- for (i = 0; i < 32; i++) x[i] = r[i];
- for (i = 0; i < 32; i++) {
- for (j = 0; j < 32; j++) {
- x[i+j] += h[i] * d[j];
- }
- }
-
- modL(sm.subarray(32), x);
- return smlen;
-}
-
-function unpackneg(r, p) {
- var t = gf(), chk = gf(), num = gf(),
- den = gf(), den2 = gf(), den4 = gf(),
- den6 = gf();
-
- set25519(r[2], gf1);
- unpack25519(r[1], p);
- S(num, r[1]);
- M(den, num, D);
- Z(num, num, r[2]);
- A(den, r[2], den);
-
- S(den2, den);
- S(den4, den2);
- M(den6, den4, den2);
- M(t, den6, num);
- M(t, t, den);
-
- pow2523(t, t);
- M(t, t, num);
- M(t, t, den);
- M(t, t, den);
- M(r[0], t, den);
-
- S(chk, r[0]);
- M(chk, chk, den);
- if (neq25519(chk, num)) M(r[0], r[0], I);
-
- S(chk, r[0]);
- M(chk, chk, den);
- if (neq25519(chk, num)) return -1;
-
- if (par25519(r[0]) === (p[31]>>7)) Z(r[0], gf0, r[0]);
-
- M(r[3], r[0], r[1]);
- return 0;
-}
-
-function crypto_sign_open(m, sm, n, pk) {
- var i, mlen;
- var t = new Uint8Array(32), h = new Uint8Array(64);
- var p = [gf(), gf(), gf(), gf()],
- q = [gf(), gf(), gf(), gf()];
-
- mlen = -1;
- if (n < 64) return -1;
-
- if (unpackneg(q, pk)) return -1;
-
- for (i = 0; i < n; i++) m[i] = sm[i];
- for (i = 0; i < 32; i++) m[i+32] = pk[i];
- crypto_hash(h, m, n);
- reduce(h);
- scalarmult(p, q, h);
-
- scalarbase(q, sm.subarray(32));
- add(p, q);
- pack(t, p);
-
- n -= 64;
- if (crypto_verify_32(sm, 0, t, 0)) {
- for (i = 0; i < n; i++) m[i] = 0;
- return -1;
- }
-
- for (i = 0; i < n; i++) m[i] = sm[i + 64];
- mlen = n;
- return mlen;
-}
-
-var crypto_secretbox_KEYBYTES = 32,
- crypto_secretbox_NONCEBYTES = 24,
- crypto_secretbox_ZEROBYTES = 32,
- crypto_secretbox_BOXZEROBYTES = 16,
- crypto_scalarmult_BYTES = 32,
- crypto_scalarmult_SCALARBYTES = 32,
- crypto_box_PUBLICKEYBYTES = 32,
- crypto_box_SECRETKEYBYTES = 32,
- crypto_box_BEFORENMBYTES = 32,
- crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES,
- crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES,
- crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES,
- crypto_sign_BYTES = 64,
- crypto_sign_PUBLICKEYBYTES = 32,
- crypto_sign_SECRETKEYBYTES = 64,
- crypto_sign_SEEDBYTES = 32,
- crypto_hash_BYTES = 64;
-
-nacl.lowlevel = {
- crypto_core_hsalsa20: crypto_core_hsalsa20,
- crypto_stream_xor: crypto_stream_xor,
- crypto_stream: crypto_stream,
- crypto_stream_salsa20_xor: crypto_stream_salsa20_xor,
- crypto_stream_salsa20: crypto_stream_salsa20,
- crypto_onetimeauth: crypto_onetimeauth,
- crypto_onetimeauth_verify: crypto_onetimeauth_verify,
- crypto_verify_16: crypto_verify_16,
- crypto_verify_32: crypto_verify_32,
- crypto_secretbox: crypto_secretbox,
- crypto_secretbox_open: crypto_secretbox_open,
- crypto_scalarmult: crypto_scalarmult,
- crypto_scalarmult_base: crypto_scalarmult_base,
- crypto_box_beforenm: crypto_box_beforenm,
- crypto_box_afternm: crypto_box_afternm,
- crypto_box: crypto_box,
- crypto_box_open: crypto_box_open,
- crypto_box_keypair: crypto_box_keypair,
- crypto_hash: crypto_hash,
- crypto_sign: crypto_sign,
- crypto_sign_keypair: crypto_sign_keypair,
- crypto_sign_open: crypto_sign_open,
-
- crypto_secretbox_KEYBYTES: crypto_secretbox_KEYBYTES,
- crypto_secretbox_NONCEBYTES: crypto_secretbox_NONCEBYTES,
- crypto_secretbox_ZEROBYTES: crypto_secretbox_ZEROBYTES,
- crypto_secretbox_BOXZEROBYTES: crypto_secretbox_BOXZEROBYTES,
- crypto_scalarmult_BYTES: crypto_scalarmult_BYTES,
- crypto_scalarmult_SCALARBYTES: crypto_scalarmult_SCALARBYTES,
- crypto_box_PUBLICKEYBYTES: crypto_box_PUBLICKEYBYTES,
- crypto_box_SECRETKEYBYTES: crypto_box_SECRETKEYBYTES,
- crypto_box_BEFORENMBYTES: crypto_box_BEFORENMBYTES,
- crypto_box_NONCEBYTES: crypto_box_NONCEBYTES,
- crypto_box_ZEROBYTES: crypto_box_ZEROBYTES,
- crypto_box_BOXZEROBYTES: crypto_box_BOXZEROBYTES,
- crypto_sign_BYTES: crypto_sign_BYTES,
- crypto_sign_PUBLICKEYBYTES: crypto_sign_PUBLICKEYBYTES,
- crypto_sign_SECRETKEYBYTES: crypto_sign_SECRETKEYBYTES,
- crypto_sign_SEEDBYTES: crypto_sign_SEEDBYTES,
- crypto_hash_BYTES: crypto_hash_BYTES
-};
-
-/* High-level API */
-
-function checkLengths(k, n) {
- if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size');
- if (n.length !== crypto_secretbox_NONCEBYTES) throw new Error('bad nonce size');
-}
-
-function checkBoxLengths(pk, sk) {
- if (pk.length !== crypto_box_PUBLICKEYBYTES) throw new Error('bad public key size');
- if (sk.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size');
-}
-
-function checkArrayTypes() {
- var t, i;
- for (i = 0; i < arguments.length; i++) {
- if ((t = Object.prototype.toString.call(arguments[i])) !== '[object Uint8Array]')
- throw new TypeError('unexpected type ' + t + ', use Uint8Array');
- }
-}
-
-function cleanup(arr) {
- for (var i = 0; i < arr.length; i++) arr[i] = 0;
-}
-
-// TODO: Completely remove this in v0.15.
-if (!nacl.util) {
- nacl.util = {};
- nacl.util.decodeUTF8 = nacl.util.encodeUTF8 = nacl.util.encodeBase64 = nacl.util.decodeBase64 = function() {
- throw new Error('nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js');
- };
-}
-
-nacl.randomBytes = function(n) {
- var b = new Uint8Array(n);
- randombytes(b, n);
- return b;
-};
-
-nacl.secretbox = function(msg, nonce, key) {
- checkArrayTypes(msg, nonce, key);
- checkLengths(key, nonce);
- var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length);
- var c = new Uint8Array(m.length);
- for (var i = 0; i < msg.length; i++) m[i+crypto_secretbox_ZEROBYTES] = msg[i];
- crypto_secretbox(c, m, m.length, nonce, key);
- return c.subarray(crypto_secretbox_BOXZEROBYTES);
-};
-
-nacl.secretbox.open = function(box, nonce, key) {
- checkArrayTypes(box, nonce, key);
- checkLengths(key, nonce);
- var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length);
- var m = new Uint8Array(c.length);
- for (var i = 0; i < box.length; i++) c[i+crypto_secretbox_BOXZEROBYTES] = box[i];
- if (c.length < 32) return false;
- if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) return false;
- return m.subarray(crypto_secretbox_ZEROBYTES);
-};
-
-nacl.secretbox.keyLength = crypto_secretbox_KEYBYTES;
-nacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES;
-nacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES;
-
-nacl.scalarMult = function(n, p) {
- checkArrayTypes(n, p);
- if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');
- if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size');
- var q = new Uint8Array(crypto_scalarmult_BYTES);
- crypto_scalarmult(q, n, p);
- return q;
-};
-
-nacl.scalarMult.base = function(n) {
- checkArrayTypes(n);
- if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');
- var q = new Uint8Array(crypto_scalarmult_BYTES);
- crypto_scalarmult_base(q, n);
- return q;
-};
-
-nacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES;
-nacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES;
-
-nacl.box = function(msg, nonce, publicKey, secretKey) {
- var k = nacl.box.before(publicKey, secretKey);
- return nacl.secretbox(msg, nonce, k);
-};
-
-nacl.box.before = function(publicKey, secretKey) {
- checkArrayTypes(publicKey, secretKey);
- checkBoxLengths(publicKey, secretKey);
- var k = new Uint8Array(crypto_box_BEFORENMBYTES);
- crypto_box_beforenm(k, publicKey, secretKey);
- return k;
-};
-
-nacl.box.after = nacl.secretbox;
-
-nacl.box.open = function(msg, nonce, publicKey, secretKey) {
- var k = nacl.box.before(publicKey, secretKey);
- return nacl.secretbox.open(msg, nonce, k);
-};
-
-nacl.box.open.after = nacl.secretbox.open;
-
-nacl.box.keyPair = function() {
- var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);
- var sk = new Uint8Array(crypto_box_SECRETKEYBYTES);
- crypto_box_keypair(pk, sk);
- return {publicKey: pk, secretKey: sk};
-};
-
-nacl.box.keyPair.fromSecretKey = function(secretKey) {
- checkArrayTypes(secretKey);
- if (secretKey.length !== crypto_box_SECRETKEYBYTES)
- throw new Error('bad secret key size');
- var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);
- crypto_scalarmult_base(pk, secretKey);
- return {publicKey: pk, secretKey: new Uint8Array(secretKey)};
-};
-
-nacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES;
-nacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES;
-nacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES;
-nacl.box.nonceLength = crypto_box_NONCEBYTES;
-nacl.box.overheadLength = nacl.secretbox.overheadLength;
-
-nacl.sign = function(msg, secretKey) {
- checkArrayTypes(msg, secretKey);
- if (secretKey.length !== crypto_sign_SECRETKEYBYTES)
- throw new Error('bad secret key size');
- var signedMsg = new Uint8Array(crypto_sign_BYTES+msg.length);
- crypto_sign(signedMsg, msg, msg.length, secretKey);
- return signedMsg;
-};
-
-nacl.sign.open = function(signedMsg, publicKey) {
- if (arguments.length !== 2)
- throw new Error('nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?');
- checkArrayTypes(signedMsg, publicKey);
- if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)
- throw new Error('bad public key size');
- var tmp = new Uint8Array(signedMsg.length);
- var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey);
- if (mlen < 0) return null;
- var m = new Uint8Array(mlen);
- for (var i = 0; i < m.length; i++) m[i] = tmp[i];
- return m;
-};
-
-nacl.sign.detached = function(msg, secretKey) {
- var signedMsg = nacl.sign(msg, secretKey);
- var sig = new Uint8Array(crypto_sign_BYTES);
- for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i];
- return sig;
-};
-
-nacl.sign.detached.verify = function(msg, sig, publicKey) {
- checkArrayTypes(msg, sig, publicKey);
- if (sig.length !== crypto_sign_BYTES)
- throw new Error('bad signature size');
- if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)
- throw new Error('bad public key size');
- var sm = new Uint8Array(crypto_sign_BYTES + msg.length);
- var m = new Uint8Array(crypto_sign_BYTES + msg.length);
- var i;
- for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i];
- for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i];
- return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0);
-};
-
-nacl.sign.keyPair = function() {
- var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
- var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);
- crypto_sign_keypair(pk, sk);
- return {publicKey: pk, secretKey: sk};
-};
-
-nacl.sign.keyPair.fromSecretKey = function(secretKey) {
- checkArrayTypes(secretKey);
- if (secretKey.length !== crypto_sign_SECRETKEYBYTES)
- throw new Error('bad secret key size');
- var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
- for (var i = 0; i < pk.length; i++) pk[i] = secretKey[32+i];
- return {publicKey: pk, secretKey: new Uint8Array(secretKey)};
-};
-
-nacl.sign.keyPair.fromSeed = function(seed) {
- checkArrayTypes(seed);
- if (seed.length !== crypto_sign_SEEDBYTES)
- throw new Error('bad seed size');
- var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
- var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);
- for (var i = 0; i < 32; i++) sk[i] = seed[i];
- crypto_sign_keypair(pk, sk, true);
- return {publicKey: pk, secretKey: sk};
-};
-
-nacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES;
-nacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES;
-nacl.sign.seedLength = crypto_sign_SEEDBYTES;
-nacl.sign.signatureLength = crypto_sign_BYTES;
-
-nacl.hash = function(msg) {
- checkArrayTypes(msg);
- var h = new Uint8Array(crypto_hash_BYTES);
- crypto_hash(h, msg, msg.length);
- return h;
-};
-
-nacl.hash.hashLength = crypto_hash_BYTES;
-
-nacl.verify = function(x, y) {
- checkArrayTypes(x, y);
- // Zero length arguments are considered not equal.
- if (x.length === 0 || y.length === 0) return false;
- if (x.length !== y.length) return false;
- return (vn(x, 0, y, 0, x.length) === 0) ? true : false;
-};
-
-nacl.setPRNG = function(fn) {
- randombytes = fn;
-};
-
-(function() {
- // Initialize PRNG if environment provides CSPRNG.
- // If not, methods calling randombytes will throw.
- var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null;
- if (crypto && crypto.getRandomValues) {
- // Browsers.
- var QUOTA = 65536;
- nacl.setPRNG(function(x, n) {
- var i, v = new Uint8Array(n);
- for (i = 0; i < n; i += QUOTA) {
- crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA)));
- }
- for (i = 0; i < n; i++) x[i] = v[i];
- cleanup(v);
- });
- } else if (typeof require !== 'undefined') {
- // Node.js.
- crypto = require('crypto');
- if (crypto && crypto.randomBytes) {
- nacl.setPRNG(function(x, n) {
- var i, v = crypto.randomBytes(n);
- for (i = 0; i < n; i++) x[i] = v[i];
- cleanup(v);
- });
- }
- }
-})();
-
-})(typeof module !== 'undefined' && module.exports ? module.exports : (self.nacl = self.nacl || {}));
diff --git a/node_modules/tweetnacl/nacl-fast.min.js b/node_modules/tweetnacl/nacl-fast.min.js
deleted file mode 100644
index 8bc47da..0000000
--- a/node_modules/tweetnacl/nacl-fast.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-!function(r){"use strict";function t(r,t,n,e){r[t]=n>>24&255,r[t+1]=n>>16&255,r[t+2]=n>>8&255,r[t+3]=255&n,r[t+4]=e>>24&255,r[t+5]=e>>16&255,r[t+6]=e>>8&255,r[t+7]=255&e}function n(r,t,n,e,o){var i,h=0;for(i=0;i>>8)-1}function e(r,t,e,o){return n(r,t,e,o,16)}function o(r,t,e,o){return n(r,t,e,o,32)}function i(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,c=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,u=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,v=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,b=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,g=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,_=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,d=i,U=h,E=a,x=f,M=s,m=c,B=u,S=y,K=l,T=w,Y=p,k=v,L=b,z=g,R=_,P=A,O=0;O<20;O+=2)o=d+L|0,M^=o<<7|o>>>25,o=M+d|0,K^=o<<9|o>>>23,o=K+M|0,L^=o<<13|o>>>19,o=L+K|0,d^=o<<18|o>>>14,o=m+U|0,T^=o<<7|o>>>25,o=T+m|0,z^=o<<9|o>>>23,o=z+T|0,U^=o<<13|o>>>19,o=U+z|0,m^=o<<18|o>>>14,o=Y+B|0,R^=o<<7|o>>>25,o=R+Y|0,E^=o<<9|o>>>23,o=E+R|0,B^=o<<13|o>>>19,o=B+E|0,Y^=o<<18|o>>>14,o=P+k|0,x^=o<<7|o>>>25,o=x+P|0,S^=o<<9|o>>>23,o=S+x|0,k^=o<<13|o>>>19,o=k+S|0,P^=o<<18|o>>>14,o=d+x|0,U^=o<<7|o>>>25,o=U+d|0,E^=o<<9|o>>>23,o=E+U|0,x^=o<<13|o>>>19,o=x+E|0,d^=o<<18|o>>>14,o=m+M|0,B^=o<<7|o>>>25,o=B+m|0,S^=o<<9|o>>>23,o=S+B|0,M^=o<<13|o>>>19,o=M+S|0,m^=o<<18|o>>>14,o=Y+T|0,k^=o<<7|o>>>25,o=k+Y|0,K^=o<<9|o>>>23,o=K+k|0,T^=o<<13|o>>>19,o=T+K|0,Y^=o<<18|o>>>14,o=P+R|0,L^=o<<7|o>>>25,o=L+P|0,z^=o<<9|o>>>23,o=z+L|0,R^=o<<13|o>>>19,o=R+z|0,P^=o<<18|o>>>14;d=d+i|0,U=U+h|0,E=E+a|0,x=x+f|0,M=M+s|0,m=m+c|0,B=B+u|0,S=S+y|0,K=K+l|0,T=T+w|0,Y=Y+p|0,k=k+v|0,L=L+b|0,z=z+g|0,R=R+_|0,P=P+A|0,r[0]=d>>>0&255,r[1]=d>>>8&255,r[2]=d>>>16&255,r[3]=d>>>24&255,r[4]=U>>>0&255,r[5]=U>>>8&255,r[6]=U>>>16&255,r[7]=U>>>24&255,r[8]=E>>>0&255,r[9]=E>>>8&255,r[10]=E>>>16&255,r[11]=E>>>24&255,r[12]=x>>>0&255,r[13]=x>>>8&255,r[14]=x>>>16&255,r[15]=x>>>24&255,r[16]=M>>>0&255,r[17]=M>>>8&255,r[18]=M>>>16&255,r[19]=M>>>24&255,r[20]=m>>>0&255,r[21]=m>>>8&255,r[22]=m>>>16&255,r[23]=m>>>24&255,r[24]=B>>>0&255,r[25]=B>>>8&255,r[26]=B>>>16&255,r[27]=B>>>24&255,r[28]=S>>>0&255,r[29]=S>>>8&255,r[30]=S>>>16&255,r[31]=S>>>24&255,r[32]=K>>>0&255,r[33]=K>>>8&255,r[34]=K>>>16&255,r[35]=K>>>24&255,r[36]=T>>>0&255,r[37]=T>>>8&255,r[38]=T>>>16&255,r[39]=T>>>24&255,r[40]=Y>>>0&255,r[41]=Y>>>8&255,r[42]=Y>>>16&255,r[43]=Y>>>24&255,r[44]=k>>>0&255,r[45]=k>>>8&255,r[46]=k>>>16&255,r[47]=k>>>24&255,r[48]=L>>>0&255,r[49]=L>>>8&255,r[50]=L>>>16&255,r[51]=L>>>24&255,r[52]=z>>>0&255,r[53]=z>>>8&255,r[54]=z>>>16&255,r[55]=z>>>24&255,r[56]=R>>>0&255,r[57]=R>>>8&255,r[58]=R>>>16&255,r[59]=R>>>24&255,r[60]=P>>>0&255,r[61]=P>>>8&255,r[62]=P>>>16&255,r[63]=P>>>24&255}function h(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,c=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,u=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,v=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,b=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,g=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,_=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,d=i,U=h,E=a,x=f,M=s,m=c,B=u,S=y,K=l,T=w,Y=p,k=v,L=b,z=g,R=_,P=A,O=0;O<20;O+=2)o=d+L|0,M^=o<<7|o>>>25,o=M+d|0,K^=o<<9|o>>>23,o=K+M|0,L^=o<<13|o>>>19,o=L+K|0,d^=o<<18|o>>>14,o=m+U|0,T^=o<<7|o>>>25,o=T+m|0,z^=o<<9|o>>>23,o=z+T|0,U^=o<<13|o>>>19,o=U+z|0,m^=o<<18|o>>>14,o=Y+B|0,R^=o<<7|o>>>25,o=R+Y|0,E^=o<<9|o>>>23,o=E+R|0,B^=o<<13|o>>>19,o=B+E|0,Y^=o<<18|o>>>14,o=P+k|0,x^=o<<7|o>>>25,o=x+P|0,S^=o<<9|o>>>23,o=S+x|0,k^=o<<13|o>>>19,o=k+S|0,P^=o<<18|o>>>14,o=d+x|0,U^=o<<7|o>>>25,o=U+d|0,E^=o<<9|o>>>23,o=E+U|0,x^=o<<13|o>>>19,o=x+E|0,d^=o<<18|o>>>14,o=m+M|0,B^=o<<7|o>>>25,o=B+m|0,S^=o<<9|o>>>23,o=S+B|0,M^=o<<13|o>>>19,o=M+S|0,m^=o<<18|o>>>14,o=Y+T|0,k^=o<<7|o>>>25,o=k+Y|0,K^=o<<9|o>>>23,o=K+k|0,T^=o<<13|o>>>19,o=T+K|0,Y^=o<<18|o>>>14,o=P+R|0,L^=o<<7|o>>>25,o=L+P|0,z^=o<<9|o>>>23,o=z+L|0,R^=o<<13|o>>>19,o=R+z|0,P^=o<<18|o>>>14;r[0]=d>>>0&255,r[1]=d>>>8&255,r[2]=d>>>16&255,r[3]=d>>>24&255,r[4]=m>>>0&255,r[5]=m>>>8&255,r[6]=m>>>16&255,r[7]=m>>>24&255,r[8]=Y>>>0&255,r[9]=Y>>>8&255,r[10]=Y>>>16&255,r[11]=Y>>>24&255,r[12]=P>>>0&255,r[13]=P>>>8&255,r[14]=P>>>16&255,r[15]=P>>>24&255,r[16]=B>>>0&255,r[17]=B>>>8&255,r[18]=B>>>16&255,r[19]=B>>>24&255,r[20]=S>>>0&255,r[21]=S>>>8&255,r[22]=S>>>16&255,r[23]=S>>>24&255,r[24]=K>>>0&255,r[25]=K>>>8&255,r[26]=K>>>16&255,r[27]=K>>>24&255,r[28]=T>>>0&255,r[29]=T>>>8&255,r[30]=T>>>16&255,r[31]=T>>>24&255}function a(r,t,n,e){i(r,t,n,e)}function f(r,t,n,e){h(r,t,n,e)}function s(r,t,n,e,o,i,h){var f,s,c=new Uint8Array(16),u=new Uint8Array(64);for(s=0;s<16;s++)c[s]=0;for(s=0;s<8;s++)c[s]=i[s];for(;o>=64;){for(a(u,c,h,ur),s=0;s<64;s++)r[t+s]=n[e+s]^u[s];for(f=1,s=8;s<16;s++)f=f+(255&c[s])|0,c[s]=255&f,f>>>=8;o-=64,t+=64,e+=64}if(o>0)for(a(u,c,h,ur),s=0;s=64;){for(a(s,f,o,ur),h=0;h<64;h++)r[t+h]=s[h];for(i=1,h=8;h<16;h++)i=i+(255&f[h])|0,f[h]=255&i,i>>>=8;n-=64,t+=64}if(n>0)for(a(s,f,o,ur),h=0;h>16&1),i[n-1]&=65535;i[15]=h[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,_(h,i,1-o)}for(n=0;n<16;n++)r[2*n]=255&h[n],r[2*n+1]=h[n]>>8}function d(r,t){var n=new Uint8Array(32),e=new Uint8Array(32);return A(n,r),A(e,t),o(n,0,e,0)}function U(r){var t=new Uint8Array(32);return A(t,r),1&t[0]}function E(r,t){var n;for(n=0;n<16;n++)r[n]=t[2*n]+(t[2*n+1]<<8);r[15]&=32767}function x(r,t,n){for(var e=0;e<16;e++)r[e]=t[e]+n[e]}function M(r,t,n){for(var e=0;e<16;e++)r[e]=t[e]-n[e]}function m(r,t,n){var e,o,i=0,h=0,a=0,f=0,s=0,c=0,u=0,y=0,l=0,w=0,p=0,v=0,b=0,g=0,_=0,A=0,d=0,U=0,E=0,x=0,M=0,m=0,B=0,S=0,K=0,T=0,Y=0,k=0,L=0,z=0,R=0,P=n[0],O=n[1],N=n[2],C=n[3],F=n[4],I=n[5],G=n[6],Z=n[7],j=n[8],q=n[9],V=n[10],X=n[11],D=n[12],H=n[13],J=n[14],Q=n[15];e=t[0],i+=e*P,h+=e*O,a+=e*N,f+=e*C,s+=e*F,c+=e*I,u+=e*G,y+=e*Z,l+=e*j,w+=e*q,p+=e*V,v+=e*X,b+=e*D,g+=e*H,_+=e*J,A+=e*Q,e=t[1],h+=e*P,a+=e*O,f+=e*N,s+=e*C,c+=e*F,u+=e*I,y+=e*G,l+=e*Z,w+=e*j,p+=e*q,v+=e*V,b+=e*X,g+=e*D,_+=e*H,A+=e*J,d+=e*Q,e=t[2],a+=e*P,f+=e*O,s+=e*N,c+=e*C,u+=e*F,y+=e*I,l+=e*G,w+=e*Z,p+=e*j,v+=e*q,b+=e*V,g+=e*X,_+=e*D,A+=e*H,d+=e*J,U+=e*Q,e=t[3],f+=e*P,s+=e*O,c+=e*N,u+=e*C,y+=e*F,l+=e*I,w+=e*G,p+=e*Z,v+=e*j,b+=e*q,g+=e*V,_+=e*X,A+=e*D,d+=e*H,U+=e*J,E+=e*Q,e=t[4],s+=e*P,c+=e*O,u+=e*N,y+=e*C,l+=e*F,w+=e*I,p+=e*G,v+=e*Z,b+=e*j,g+=e*q,_+=e*V,A+=e*X,d+=e*D,U+=e*H,E+=e*J,x+=e*Q,e=t[5],c+=e*P,u+=e*O,y+=e*N,l+=e*C,w+=e*F,p+=e*I,v+=e*G,b+=e*Z,g+=e*j,_+=e*q,A+=e*V,d+=e*X,U+=e*D,E+=e*H,x+=e*J,M+=e*Q,e=t[6],u+=e*P,y+=e*O,l+=e*N,w+=e*C,p+=e*F,v+=e*I,b+=e*G,g+=e*Z,_+=e*j,A+=e*q,d+=e*V,U+=e*X,E+=e*D,x+=e*H,M+=e*J,m+=e*Q,e=t[7],y+=e*P,l+=e*O,w+=e*N,p+=e*C,v+=e*F,b+=e*I,g+=e*G,_+=e*Z,A+=e*j,d+=e*q,U+=e*V,E+=e*X,x+=e*D,M+=e*H,m+=e*J,B+=e*Q,e=t[8],l+=e*P,w+=e*O,p+=e*N,v+=e*C,b+=e*F,g+=e*I,_+=e*G,A+=e*Z,d+=e*j,U+=e*q,E+=e*V,x+=e*X,M+=e*D,m+=e*H,B+=e*J,S+=e*Q,e=t[9],w+=e*P,p+=e*O,v+=e*N,b+=e*C,g+=e*F,_+=e*I,A+=e*G,d+=e*Z,U+=e*j,E+=e*q,x+=e*V,M+=e*X,m+=e*D,B+=e*H,S+=e*J,K+=e*Q,e=t[10],p+=e*P,v+=e*O,b+=e*N,g+=e*C,_+=e*F,A+=e*I,d+=e*G,U+=e*Z,E+=e*j,x+=e*q,M+=e*V,m+=e*X,B+=e*D,S+=e*H,K+=e*J,T+=e*Q,e=t[11],v+=e*P,b+=e*O,g+=e*N,_+=e*C,A+=e*F,d+=e*I,U+=e*G,E+=e*Z,x+=e*j,M+=e*q,m+=e*V,B+=e*X;S+=e*D;K+=e*H,T+=e*J,Y+=e*Q,e=t[12],b+=e*P,g+=e*O,_+=e*N,A+=e*C,d+=e*F,U+=e*I,E+=e*G,x+=e*Z,M+=e*j,m+=e*q,B+=e*V,S+=e*X,K+=e*D,T+=e*H,Y+=e*J,k+=e*Q,e=t[13],g+=e*P,_+=e*O,A+=e*N,d+=e*C,U+=e*F,E+=e*I,x+=e*G,M+=e*Z,m+=e*j,B+=e*q,S+=e*V,K+=e*X,T+=e*D,Y+=e*H,k+=e*J,L+=e*Q,e=t[14],_+=e*P,A+=e*O,d+=e*N,U+=e*C,E+=e*F,x+=e*I,M+=e*G,m+=e*Z,B+=e*j,S+=e*q,K+=e*V,T+=e*X,Y+=e*D,k+=e*H,L+=e*J,z+=e*Q,e=t[15],A+=e*P,d+=e*O,U+=e*N,E+=e*C,x+=e*F,M+=e*I,m+=e*G,B+=e*Z,S+=e*j,K+=e*q,T+=e*V,Y+=e*X,k+=e*D,L+=e*H,z+=e*J,R+=e*Q,i+=38*d,h+=38*U,a+=38*E,f+=38*x,s+=38*M,c+=38*m,u+=38*B,y+=38*S,l+=38*K,w+=38*T,p+=38*Y,v+=38*k,b+=38*L,g+=38*z,_+=38*R,o=1,e=i+o+65535,o=Math.floor(e/65536),i=e-65536*o,e=h+o+65535,o=Math.floor(e/65536),h=e-65536*o,e=a+o+65535,o=Math.floor(e/65536),a=e-65536*o,e=f+o+65535,o=Math.floor(e/65536),f=e-65536*o,e=s+o+65535,o=Math.floor(e/65536),s=e-65536*o,e=c+o+65535,o=Math.floor(e/65536),c=e-65536*o,e=u+o+65535,o=Math.floor(e/65536),u=e-65536*o,e=y+o+65535,o=Math.floor(e/65536),y=e-65536*o,e=l+o+65535,o=Math.floor(e/65536),l=e-65536*o,e=w+o+65535,o=Math.floor(e/65536),w=e-65536*o,e=p+o+65535,o=Math.floor(e/65536),p=e-65536*o,e=v+o+65535,o=Math.floor(e/65536),v=e-65536*o,e=b+o+65535,o=Math.floor(e/65536),b=e-65536*o,e=g+o+65535,o=Math.floor(e/65536),g=e-65536*o,e=_+o+65535,o=Math.floor(e/65536),_=e-65536*o,e=A+o+65535,o=Math.floor(e/65536),A=e-65536*o,i+=o-1+37*(o-1),o=1,e=i+o+65535,o=Math.floor(e/65536),i=e-65536*o,e=h+o+65535,o=Math.floor(e/65536),h=e-65536*o,e=a+o+65535,o=Math.floor(e/65536),a=e-65536*o,e=f+o+65535,o=Math.floor(e/65536),f=e-65536*o,e=s+o+65535,o=Math.floor(e/65536),s=e-65536*o,e=c+o+65535,o=Math.floor(e/65536),c=e-65536*o,e=u+o+65535,o=Math.floor(e/65536),u=e-65536*o,e=y+o+65535,o=Math.floor(e/65536),y=e-65536*o,e=l+o+65535,o=Math.floor(e/65536),l=e-65536*o,e=w+o+65535,o=Math.floor(e/65536),w=e-65536*o,e=p+o+65535,o=Math.floor(e/65536),p=e-65536*o,e=v+o+65535,o=Math.floor(e/65536),v=e-65536*o,e=b+o+65535,o=Math.floor(e/65536),b=e-65536*o,e=g+o+65535,o=Math.floor(e/65536),g=e-65536*o,e=_+o+65535,o=Math.floor(e/65536),_=e-65536*o,e=A+o+65535,o=Math.floor(e/65536),A=e-65536*o,i+=o-1+37*(o-1),r[0]=i,r[1]=h,r[2]=a,r[3]=f,r[4]=s,r[5]=c,r[6]=u,r[7]=y,r[8]=l,r[9]=w,r[10]=p,r[11]=v,r[12]=b,r[13]=g;r[14]=_;r[15]=A}function B(r,t){m(r,t,t)}function S(r,t){var n,e=$();for(n=0;n<16;n++)e[n]=t[n];for(n=253;n>=0;n--)B(e,e),2!==n&&4!==n&&m(e,e,t);for(n=0;n<16;n++)r[n]=e[n]}function K(r,t){var n,e=$();for(n=0;n<16;n++)e[n]=t[n];for(n=250;n>=0;n--)B(e,e),1!==n&&m(e,e,t);for(n=0;n<16;n++)r[n]=e[n]}function T(r,t,n){var e,o,i=new Uint8Array(32),h=new Float64Array(80),a=$(),f=$(),s=$(),c=$(),u=$(),y=$();for(o=0;o<31;o++)i[o]=t[o];for(i[31]=127&t[31]|64,i[0]&=248,E(h,n),o=0;o<16;o++)f[o]=h[o],c[o]=a[o]=s[o]=0;for(a[0]=c[0]=1,o=254;o>=0;--o)e=i[o>>>3]>>>(7&o)&1,_(a,f,e),_(s,c,e),x(u,a,s),M(a,a,s),x(s,f,c),M(f,f,c),B(c,u),B(y,a),m(a,s,a),m(s,f,u),x(u,a,s),M(a,a,s),B(f,a),M(s,c,y),m(a,s,ir),x(a,a,c),m(s,s,a),m(a,c,y),m(c,f,h),B(f,u),_(a,f,e),_(s,c,e);for(o=0;o<16;o++)h[o+16]=a[o],h[o+32]=s[o],h[o+48]=f[o],h[o+64]=c[o];var l=h.subarray(32),w=h.subarray(16);return S(l,l),m(w,w,l),A(r,w),0}function Y(r,t){return T(r,t,nr)}function k(r,t){return rr(t,32),Y(r,t)}function L(r,t,n){var e=new Uint8Array(32);return T(e,n,t),f(r,tr,e,ur)}function z(r,t,n,e,o,i){var h=new Uint8Array(32);return L(h,o,i),lr(r,t,n,e,h)}function R(r,t,n,e,o,i){var h=new Uint8Array(32);return L(h,o,i),wr(r,t,n,e,h)}function P(r,t,n,e){for(var o,i,h,a,f,s,c,u,y,l,w,p,v,b,g,_,A,d,U,E,x,M,m,B,S,K,T=new Int32Array(16),Y=new Int32Array(16),k=r[0],L=r[1],z=r[2],R=r[3],P=r[4],O=r[5],N=r[6],C=r[7],F=t[0],I=t[1],G=t[2],Z=t[3],j=t[4],q=t[5],V=t[6],X=t[7],D=0;e>=128;){for(U=0;U<16;U++)E=8*U+D,T[U]=n[E+0]<<24|n[E+1]<<16|n[E+2]<<8|n[E+3],Y[U]=n[E+4]<<24|n[E+5]<<16|n[E+6]<<8|n[E+7];for(U=0;U<80;U++)if(o=k,i=L,h=z,a=R,f=P,s=O,c=N,u=C,y=F,l=I,w=G,p=Z,v=j,b=q,g=V,_=X,x=C,M=X,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=(P>>>14|j<<18)^(P>>>18|j<<14)^(j>>>9|P<<23),M=(j>>>14|P<<18)^(j>>>18|P<<14)^(P>>>9|j<<23),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=P&O^~P&N,M=j&q^~j&V,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=pr[2*U],M=pr[2*U+1],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=T[U%16],M=Y[U%16],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,A=65535&S|K<<16,d=65535&m|B<<16,x=A,M=d,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=(k>>>28|F<<4)^(F>>>2|k<<30)^(F>>>7|k<<25),M=(F>>>28|k<<4)^(k>>>2|F<<30)^(k>>>7|F<<25),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=k&L^k&z^L&z,M=F&I^F&G^I&G,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,u=65535&S|K<<16,_=65535&m|B<<16,x=a,M=p,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=A,M=d,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,a=65535&S|K<<16,p=65535&m|B<<16,L=o,z=i,R=h,P=a,O=f,N=s,C=c,k=u,I=y,G=l,Z=w,j=p,q=v,V=b,X=g,F=_,U%16===15)for(E=0;E<16;E++)x=T[E],M=Y[E],m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=T[(E+9)%16],M=Y[(E+9)%16],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,A=T[(E+1)%16],d=Y[(E+1)%16],x=(A>>>1|d<<31)^(A>>>8|d<<24)^A>>>7,M=(d>>>1|A<<31)^(d>>>8|A<<24)^(d>>>7|A<<25),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,A=T[(E+14)%16],d=Y[(E+14)%16],x=(A>>>19|d<<13)^(d>>>29|A<<3)^A>>>6,M=(d>>>19|A<<13)^(A>>>29|d<<3)^(d>>>6|A<<26),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,T[E]=65535&S|K<<16,Y[E]=65535&m|B<<16;x=k,M=F,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[0],M=t[0],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[0]=k=65535&S|K<<16,t[0]=F=65535&m|B<<16,x=L,M=I,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[1],M=t[1],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[1]=L=65535&S|K<<16,t[1]=I=65535&m|B<<16,x=z,M=G,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[2],M=t[2],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[2]=z=65535&S|K<<16,t[2]=G=65535&m|B<<16,x=R,M=Z,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[3],M=t[3],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[3]=R=65535&S|K<<16,t[3]=Z=65535&m|B<<16,x=P,M=j,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[4],M=t[4],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[4]=P=65535&S|K<<16,t[4]=j=65535&m|B<<16,x=O,M=q,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[5],M=t[5],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[5]=O=65535&S|K<<16,t[5]=q=65535&m|B<<16,x=N,M=V,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[6],M=t[6],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[6]=N=65535&S|K<<16,t[6]=V=65535&m|B<<16,x=C,M=X,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[7],M=t[7],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[7]=C=65535&S|K<<16,t[7]=X=65535&m|B<<16,D+=128,e-=128}return e}function O(r,n,e){var o,i=new Int32Array(8),h=new Int32Array(8),a=new Uint8Array(256),f=e;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,h[0]=4089235720,h[1]=2227873595,h[2]=4271175723,h[3]=1595750129,h[4]=2917565137,h[5]=725511199,h[6]=4215389547,h[7]=327033209,P(i,h,n,e),e%=128,o=0;o=0;--o)e=n[o/8|0]>>(7&o)&1,C(r,t,e),N(t,r),N(r,r),C(r,t,e)}function G(r,t){var n=[$(),$(),$(),$()];b(n[0],fr),b(n[1],sr),b(n[2],or),m(n[3],fr,sr),I(r,n,t)}function Z(r,t,n){var e,o=new Uint8Array(64),i=[$(),$(),$(),$()];for(n||rr(t,32),O(o,t,32),o[0]&=248,o[31]&=127,o[31]|=64,G(i,o),F(r,i),e=0;e<32;e++)t[e+32]=r[e];return 0}function j(r,t){var n,e,o,i;for(e=63;e>=32;--e){for(n=0,o=e-32,i=e-12;o>8,t[o]-=256*n;t[o]+=n,t[e]=0}for(n=0,o=0;o<32;o++)t[o]+=n-(t[31]>>4)*vr[o],n=t[o]>>8,t[o]&=255;for(o=0;o<32;o++)t[o]-=n*vr[o];for(e=0;e<32;e++)t[e+1]+=t[e]>>8,r[e]=255&t[e]}function q(r){var t,n=new Float64Array(64);for(t=0;t<64;t++)n[t]=r[t];for(t=0;t<64;t++)r[t]=0;j(r,n)}function V(r,t,n,e){var o,i,h=new Uint8Array(64),a=new Uint8Array(64),f=new Uint8Array(64),s=new Float64Array(64),c=[$(),$(),$(),$()];O(h,e,32),h[0]&=248,h[31]&=127,h[31]|=64;var u=n+64;for(o=0;o>7&&M(r[0],er,r[0]),m(r[3],r[0],r[1]),0)}function D(r,t,n,e){var i,h,a=new Uint8Array(32),f=new Uint8Array(64),s=[$(),$(),$(),$()],c=[$(),$(),$(),$()];if(h=-1,n<64)return-1;if(X(c,e))return-1;for(i=0;i>>13|n<<3),e=255&r[4]|(255&r[5])<<8,this.r[2]=7939&(n>>>10|e<<6),o=255&r[6]|(255&r[7])<<8,this.r[3]=8191&(e>>>7|o<<9),i=255&r[8]|(255&r[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,h=255&r[10]|(255&r[11])<<8,this.r[6]=8191&(i>>>14|h<<2),a=255&r[12]|(255&r[13])<<8,this.r[7]=8065&(h>>>11|a<<5),f=255&r[14]|(255&r[15])<<8,this.r[8]=8191&(a>>>8|f<<8),this.r[9]=f>>>5&127,this.pad[0]=255&r[16]|(255&r[17])<<8,this.pad[1]=255&r[18]|(255&r[19])<<8,this.pad[2]=255&r[20]|(255&r[21])<<8,this.pad[3]=255&r[22]|(255&r[23])<<8,this.pad[4]=255&r[24]|(255&r[25])<<8,this.pad[5]=255&r[26]|(255&r[27])<<8,this.pad[6]=255&r[28]|(255&r[29])<<8,this.pad[7]=255&r[30]|(255&r[31])<<8};yr.prototype.blocks=function(r,t,n){for(var e,o,i,h,a,f,s,c,u,y,l,w,p,v,b,g,_,A,d,U=this.fin?0:2048,E=this.h[0],x=this.h[1],M=this.h[2],m=this.h[3],B=this.h[4],S=this.h[5],K=this.h[6],T=this.h[7],Y=this.h[8],k=this.h[9],L=this.r[0],z=this.r[1],R=this.r[2],P=this.r[3],O=this.r[4],N=this.r[5],C=this.r[6],F=this.r[7],I=this.r[8],G=this.r[9];n>=16;)e=255&r[t+0]|(255&r[t+1])<<8,E+=8191&e,o=255&r[t+2]|(255&r[t+3])<<8,x+=8191&(e>>>13|o<<3),i=255&r[t+4]|(255&r[t+5])<<8,M+=8191&(o>>>10|i<<6),h=255&r[t+6]|(255&r[t+7])<<8,m+=8191&(i>>>7|h<<9),a=255&r[t+8]|(255&r[t+9])<<8,B+=8191&(h>>>4|a<<12),S+=a>>>1&8191,f=255&r[t+10]|(255&r[t+11])<<8,K+=8191&(a>>>14|f<<2),s=255&r[t+12]|(255&r[t+13])<<8,T+=8191&(f>>>11|s<<5),c=255&r[t+14]|(255&r[t+15])<<8,Y+=8191&(s>>>8|c<<8),k+=c>>>5|U,u=0,y=u,y+=E*L,y+=x*(5*G),y+=M*(5*I),y+=m*(5*F),y+=B*(5*C),u=y>>>13,y&=8191,y+=S*(5*N),y+=K*(5*O),y+=T*(5*P),y+=Y*(5*R),y+=k*(5*z),u+=y>>>13,y&=8191,l=u,l+=E*z,l+=x*L,l+=M*(5*G),l+=m*(5*I),l+=B*(5*F),u=l>>>13,l&=8191,l+=S*(5*C),l+=K*(5*N),l+=T*(5*O),l+=Y*(5*P),l+=k*(5*R),u+=l>>>13,l&=8191,w=u,w+=E*R,w+=x*z,w+=M*L,w+=m*(5*G),w+=B*(5*I),u=w>>>13,w&=8191,w+=S*(5*F),w+=K*(5*C),w+=T*(5*N),w+=Y*(5*O),w+=k*(5*P),u+=w>>>13,w&=8191,p=u,p+=E*P,p+=x*R,p+=M*z,p+=m*L,p+=B*(5*G),u=p>>>13,p&=8191,p+=S*(5*I),p+=K*(5*F),p+=T*(5*C),p+=Y*(5*N),p+=k*(5*O),u+=p>>>13,p&=8191,v=u,v+=E*O,v+=x*P,v+=M*R,v+=m*z,v+=B*L,u=v>>>13,v&=8191,v+=S*(5*G),v+=K*(5*I),v+=T*(5*F),v+=Y*(5*C),v+=k*(5*N),u+=v>>>13,v&=8191,b=u,b+=E*N,b+=x*O,b+=M*P,b+=m*R,b+=B*z,u=b>>>13,b&=8191,b+=S*L,b+=K*(5*G),b+=T*(5*I),b+=Y*(5*F),b+=k*(5*C),u+=b>>>13,b&=8191,g=u,g+=E*C,g+=x*N,g+=M*O,g+=m*P,g+=B*R,u=g>>>13,g&=8191,g+=S*z,g+=K*L,g+=T*(5*G),g+=Y*(5*I),g+=k*(5*F),u+=g>>>13,g&=8191,_=u,_+=E*F,_+=x*C,_+=M*N,_+=m*O,_+=B*P,u=_>>>13,_&=8191,_+=S*R,_+=K*z,_+=T*L,_+=Y*(5*G),_+=k*(5*I),u+=_>>>13,_&=8191,A=u,A+=E*I,A+=x*F,A+=M*C,A+=m*N,A+=B*O,u=A>>>13,A&=8191,A+=S*P,A+=K*R,A+=T*z,A+=Y*L,A+=k*(5*G),u+=A>>>13,A&=8191,d=u,d+=E*G,d+=x*I,d+=M*F,d+=m*C,d+=B*N,u=d>>>13,d&=8191,d+=S*O,d+=K*P,d+=T*R,d+=Y*z,d+=k*L,u+=d>>>13,d&=8191,u=(u<<2)+u|0,u=u+y|0,y=8191&u,u>>>=13,l+=u,E=y,x=l,M=w,m=p,B=v,S=b,K=g,T=_,Y=A,k=d,t+=16,n-=16;this.h[0]=E,this.h[1]=x,this.h[2]=M,this.h[3]=m,this.h[4]=B,this.h[5]=S,this.h[6]=K,this.h[7]=T,this.h[8]=Y,this.h[9]=k},yr.prototype.finish=function(r,t){var n,e,o,i,h=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,h[0]=this.h[0]+5,n=h[0]>>>13,h[0]&=8191,i=1;i<10;i++)h[i]=this.h[i]+n,n=h[i]>>>13,h[i]&=8191;for(h[9]-=8192,e=(1^n)-1,i=0;i<10;i++)h[i]&=e;for(e=~e,i=0;i<10;i++)this.h[i]=this.h[i]&e|h[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;r[t+0]=this.h[0]>>>0&255,r[t+1]=this.h[0]>>>8&255,r[t+2]=this.h[1]>>>0&255,r[t+3]=this.h[1]>>>8&255,r[t+4]=this.h[2]>>>0&255,r[t+5]=this.h[2]>>>8&255,r[t+6]=this.h[3]>>>0&255,r[t+7]=this.h[3]>>>8&255,r[t+8]=this.h[4]>>>0&255,r[t+9]=this.h[4]>>>8&255,r[t+10]=this.h[5]>>>0&255,r[t+11]=this.h[5]>>>8&255,r[t+12]=this.h[6]>>>0&255,r[t+13]=this.h[6]>>>8&255,r[t+14]=this.h[7]>>>0&255,r[t+15]=this.h[7]>>>8&255},yr.prototype.update=function(r,t,n){var e,o;if(this.leftover){for(o=16-this.leftover,o>n&&(o=n),e=0;e=16&&(o=n-n%16,this.blocks(r,t,o),t+=o,n-=o),n){for(e=0;e=0},r.sign.keyPair=function(){var r=new Uint8Array(Tr),t=new Uint8Array(Yr);return Z(r,t),{publicKey:r,secretKey:t}},r.sign.keyPair.fromSecretKey=function(r){if(Q(r),r.length!==Yr)throw new Error("bad secret key size");for(var t=new Uint8Array(Tr),n=0;n void): void;
-}
diff --git a/node_modules/tweetnacl/nacl.js b/node_modules/tweetnacl/nacl.js
deleted file mode 100644
index f72dd78..0000000
--- a/node_modules/tweetnacl/nacl.js
+++ /dev/null
@@ -1,1175 +0,0 @@
-(function(nacl) {
-'use strict';
-
-// Ported in 2014 by Dmitry Chestnykh and Devi Mandiri.
-// Public domain.
-//
-// Implementation derived from TweetNaCl version 20140427.
-// See for details: http://tweetnacl.cr.yp.to/
-
-var u64 = function(h, l) { this.hi = h|0 >>> 0; this.lo = l|0 >>> 0; };
-var gf = function(init) {
- var i, r = new Float64Array(16);
- if (init) for (i = 0; i < init.length; i++) r[i] = init[i];
- return r;
-};
-
-// Pluggable, initialized in high-level API below.
-var randombytes = function(/* x, n */) { throw new Error('no PRNG'); };
-
-var _0 = new Uint8Array(16);
-var _9 = new Uint8Array(32); _9[0] = 9;
-
-var gf0 = gf(),
- gf1 = gf([1]),
- _121665 = gf([0xdb41, 1]),
- D = gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]),
- D2 = gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]),
- X = gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]),
- Y = gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]),
- I = gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]);
-
-function L32(x, c) { return (x << c) | (x >>> (32 - c)); }
-
-function ld32(x, i) {
- var u = x[i+3] & 0xff;
- u = (u<<8)|(x[i+2] & 0xff);
- u = (u<<8)|(x[i+1] & 0xff);
- return (u<<8)|(x[i+0] & 0xff);
-}
-
-function dl64(x, i) {
- var h = (x[i] << 24) | (x[i+1] << 16) | (x[i+2] << 8) | x[i+3];
- var l = (x[i+4] << 24) | (x[i+5] << 16) | (x[i+6] << 8) | x[i+7];
- return new u64(h, l);
-}
-
-function st32(x, j, u) {
- var i;
- for (i = 0; i < 4; i++) { x[j+i] = u & 255; u >>>= 8; }
-}
-
-function ts64(x, i, u) {
- x[i] = (u.hi >> 24) & 0xff;
- x[i+1] = (u.hi >> 16) & 0xff;
- x[i+2] = (u.hi >> 8) & 0xff;
- x[i+3] = u.hi & 0xff;
- x[i+4] = (u.lo >> 24) & 0xff;
- x[i+5] = (u.lo >> 16) & 0xff;
- x[i+6] = (u.lo >> 8) & 0xff;
- x[i+7] = u.lo & 0xff;
-}
-
-function vn(x, xi, y, yi, n) {
- var i,d = 0;
- for (i = 0; i < n; i++) d |= x[xi+i]^y[yi+i];
- return (1 & ((d - 1) >>> 8)) - 1;
-}
-
-function crypto_verify_16(x, xi, y, yi) {
- return vn(x,xi,y,yi,16);
-}
-
-function crypto_verify_32(x, xi, y, yi) {
- return vn(x,xi,y,yi,32);
-}
-
-function core(out,inp,k,c,h) {
- var w = new Uint32Array(16), x = new Uint32Array(16),
- y = new Uint32Array(16), t = new Uint32Array(4);
- var i, j, m;
-
- for (i = 0; i < 4; i++) {
- x[5*i] = ld32(c, 4*i);
- x[1+i] = ld32(k, 4*i);
- x[6+i] = ld32(inp, 4*i);
- x[11+i] = ld32(k, 16+4*i);
- }
-
- for (i = 0; i < 16; i++) y[i] = x[i];
-
- for (i = 0; i < 20; i++) {
- for (j = 0; j < 4; j++) {
- for (m = 0; m < 4; m++) t[m] = x[(5*j+4*m)%16];
- t[1] ^= L32((t[0]+t[3])|0, 7);
- t[2] ^= L32((t[1]+t[0])|0, 9);
- t[3] ^= L32((t[2]+t[1])|0,13);
- t[0] ^= L32((t[3]+t[2])|0,18);
- for (m = 0; m < 4; m++) w[4*j+(j+m)%4] = t[m];
- }
- for (m = 0; m < 16; m++) x[m] = w[m];
- }
-
- if (h) {
- for (i = 0; i < 16; i++) x[i] = (x[i] + y[i]) | 0;
- for (i = 0; i < 4; i++) {
- x[5*i] = (x[5*i] - ld32(c, 4*i)) | 0;
- x[6+i] = (x[6+i] - ld32(inp, 4*i)) | 0;
- }
- for (i = 0; i < 4; i++) {
- st32(out,4*i,x[5*i]);
- st32(out,16+4*i,x[6+i]);
- }
- } else {
- for (i = 0; i < 16; i++) st32(out, 4 * i, (x[i] + y[i]) | 0);
- }
-}
-
-function crypto_core_salsa20(out,inp,k,c) {
- core(out,inp,k,c,false);
- return 0;
-}
-
-function crypto_core_hsalsa20(out,inp,k,c) {
- core(out,inp,k,c,true);
- return 0;
-}
-
-var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]);
- // "expand 32-byte k"
-
-function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k) {
- var z = new Uint8Array(16), x = new Uint8Array(64);
- var u, i;
- if (!b) return 0;
- for (i = 0; i < 16; i++) z[i] = 0;
- for (i = 0; i < 8; i++) z[i] = n[i];
- while (b >= 64) {
- crypto_core_salsa20(x,z,k,sigma);
- for (i = 0; i < 64; i++) c[cpos+i] = (m?m[mpos+i]:0) ^ x[i];
- u = 1;
- for (i = 8; i < 16; i++) {
- u = u + (z[i] & 0xff) | 0;
- z[i] = u & 0xff;
- u >>>= 8;
- }
- b -= 64;
- cpos += 64;
- if (m) mpos += 64;
- }
- if (b > 0) {
- crypto_core_salsa20(x,z,k,sigma);
- for (i = 0; i < b; i++) c[cpos+i] = (m?m[mpos+i]:0) ^ x[i];
- }
- return 0;
-}
-
-function crypto_stream_salsa20(c,cpos,d,n,k) {
- return crypto_stream_salsa20_xor(c,cpos,null,0,d,n,k);
-}
-
-function crypto_stream(c,cpos,d,n,k) {
- var s = new Uint8Array(32);
- crypto_core_hsalsa20(s,n,k,sigma);
- return crypto_stream_salsa20(c,cpos,d,n.subarray(16),s);
-}
-
-function crypto_stream_xor(c,cpos,m,mpos,d,n,k) {
- var s = new Uint8Array(32);
- crypto_core_hsalsa20(s,n,k,sigma);
- return crypto_stream_salsa20_xor(c,cpos,m,mpos,d,n.subarray(16),s);
-}
-
-function add1305(h, c) {
- var j, u = 0;
- for (j = 0; j < 17; j++) {
- u = (u + ((h[j] + c[j]) | 0)) | 0;
- h[j] = u & 255;
- u >>>= 8;
- }
-}
-
-var minusp = new Uint32Array([
- 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 252
-]);
-
-function crypto_onetimeauth(out, outpos, m, mpos, n, k) {
- var s, i, j, u;
- var x = new Uint32Array(17), r = new Uint32Array(17),
- h = new Uint32Array(17), c = new Uint32Array(17),
- g = new Uint32Array(17);
- for (j = 0; j < 17; j++) r[j]=h[j]=0;
- for (j = 0; j < 16; j++) r[j]=k[j];
- r[3]&=15;
- r[4]&=252;
- r[7]&=15;
- r[8]&=252;
- r[11]&=15;
- r[12]&=252;
- r[15]&=15;
-
- while (n > 0) {
- for (j = 0; j < 17; j++) c[j] = 0;
- for (j = 0; (j < 16) && (j < n); ++j) c[j] = m[mpos+j];
- c[j] = 1;
- mpos += j; n -= j;
- add1305(h,c);
- for (i = 0; i < 17; i++) {
- x[i] = 0;
- for (j = 0; j < 17; j++) x[i] = (x[i] + (h[j] * ((j <= i) ? r[i - j] : ((320 * r[i + 17 - j])|0))) | 0) | 0;
- }
- for (i = 0; i < 17; i++) h[i] = x[i];
- u = 0;
- for (j = 0; j < 16; j++) {
- u = (u + h[j]) | 0;
- h[j] = u & 255;
- u >>>= 8;
- }
- u = (u + h[16]) | 0; h[16] = u & 3;
- u = (5 * (u >>> 2)) | 0;
- for (j = 0; j < 16; j++) {
- u = (u + h[j]) | 0;
- h[j] = u & 255;
- u >>>= 8;
- }
- u = (u + h[16]) | 0; h[16] = u;
- }
-
- for (j = 0; j < 17; j++) g[j] = h[j];
- add1305(h,minusp);
- s = (-(h[16] >>> 7) | 0);
- for (j = 0; j < 17; j++) h[j] ^= s & (g[j] ^ h[j]);
-
- for (j = 0; j < 16; j++) c[j] = k[j + 16];
- c[16] = 0;
- add1305(h,c);
- for (j = 0; j < 16; j++) out[outpos+j] = h[j];
- return 0;
-}
-
-function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) {
- var x = new Uint8Array(16);
- crypto_onetimeauth(x,0,m,mpos,n,k);
- return crypto_verify_16(h,hpos,x,0);
-}
-
-function crypto_secretbox(c,m,d,n,k) {
- var i;
- if (d < 32) return -1;
- crypto_stream_xor(c,0,m,0,d,n,k);
- crypto_onetimeauth(c, 16, c, 32, d - 32, c);
- for (i = 0; i < 16; i++) c[i] = 0;
- return 0;
-}
-
-function crypto_secretbox_open(m,c,d,n,k) {
- var i;
- var x = new Uint8Array(32);
- if (d < 32) return -1;
- crypto_stream(x,0,32,n,k);
- if (crypto_onetimeauth_verify(c, 16,c, 32,d - 32,x) !== 0) return -1;
- crypto_stream_xor(m,0,c,0,d,n,k);
- for (i = 0; i < 32; i++) m[i] = 0;
- return 0;
-}
-
-function set25519(r, a) {
- var i;
- for (i = 0; i < 16; i++) r[i] = a[i]|0;
-}
-
-function car25519(o) {
- var c;
- var i;
- for (i = 0; i < 16; i++) {
- o[i] += 65536;
- c = Math.floor(o[i] / 65536);
- o[(i+1)*(i<15?1:0)] += c - 1 + 37 * (c-1) * (i===15?1:0);
- o[i] -= (c * 65536);
- }
-}
-
-function sel25519(p, q, b) {
- var t, c = ~(b-1);
- for (var i = 0; i < 16; i++) {
- t = c & (p[i] ^ q[i]);
- p[i] ^= t;
- q[i] ^= t;
- }
-}
-
-function pack25519(o, n) {
- var i, j, b;
- var m = gf(), t = gf();
- for (i = 0; i < 16; i++) t[i] = n[i];
- car25519(t);
- car25519(t);
- car25519(t);
- for (j = 0; j < 2; j++) {
- m[0] = t[0] - 0xffed;
- for (i = 1; i < 15; i++) {
- m[i] = t[i] - 0xffff - ((m[i-1]>>16) & 1);
- m[i-1] &= 0xffff;
- }
- m[15] = t[15] - 0x7fff - ((m[14]>>16) & 1);
- b = (m[15]>>16) & 1;
- m[14] &= 0xffff;
- sel25519(t, m, 1-b);
- }
- for (i = 0; i < 16; i++) {
- o[2*i] = t[i] & 0xff;
- o[2*i+1] = t[i]>>8;
- }
-}
-
-function neq25519(a, b) {
- var c = new Uint8Array(32), d = new Uint8Array(32);
- pack25519(c, a);
- pack25519(d, b);
- return crypto_verify_32(c, 0, d, 0);
-}
-
-function par25519(a) {
- var d = new Uint8Array(32);
- pack25519(d, a);
- return d[0] & 1;
-}
-
-function unpack25519(o, n) {
- var i;
- for (i = 0; i < 16; i++) o[i] = n[2*i] + (n[2*i+1] << 8);
- o[15] &= 0x7fff;
-}
-
-function A(o, a, b) {
- var i;
- for (i = 0; i < 16; i++) o[i] = (a[i] + b[i])|0;
-}
-
-function Z(o, a, b) {
- var i;
- for (i = 0; i < 16; i++) o[i] = (a[i] - b[i])|0;
-}
-
-function M(o, a, b) {
- var i, j, t = new Float64Array(31);
- for (i = 0; i < 31; i++) t[i] = 0;
- for (i = 0; i < 16; i++) {
- for (j = 0; j < 16; j++) {
- t[i+j] += a[i] * b[j];
- }
- }
- for (i = 0; i < 15; i++) {
- t[i] += 38 * t[i+16];
- }
- for (i = 0; i < 16; i++) o[i] = t[i];
- car25519(o);
- car25519(o);
-}
-
-function S(o, a) {
- M(o, a, a);
-}
-
-function inv25519(o, i) {
- var c = gf();
- var a;
- for (a = 0; a < 16; a++) c[a] = i[a];
- for (a = 253; a >= 0; a--) {
- S(c, c);
- if(a !== 2 && a !== 4) M(c, c, i);
- }
- for (a = 0; a < 16; a++) o[a] = c[a];
-}
-
-function pow2523(o, i) {
- var c = gf();
- var a;
- for (a = 0; a < 16; a++) c[a] = i[a];
- for (a = 250; a >= 0; a--) {
- S(c, c);
- if(a !== 1) M(c, c, i);
- }
- for (a = 0; a < 16; a++) o[a] = c[a];
-}
-
-function crypto_scalarmult(q, n, p) {
- var z = new Uint8Array(32);
- var x = new Float64Array(80), r, i;
- var a = gf(), b = gf(), c = gf(),
- d = gf(), e = gf(), f = gf();
- for (i = 0; i < 31; i++) z[i] = n[i];
- z[31]=(n[31]&127)|64;
- z[0]&=248;
- unpack25519(x,p);
- for (i = 0; i < 16; i++) {
- b[i]=x[i];
- d[i]=a[i]=c[i]=0;
- }
- a[0]=d[0]=1;
- for (i=254; i>=0; --i) {
- r=(z[i>>>3]>>>(i&7))&1;
- sel25519(a,b,r);
- sel25519(c,d,r);
- A(e,a,c);
- Z(a,a,c);
- A(c,b,d);
- Z(b,b,d);
- S(d,e);
- S(f,a);
- M(a,c,a);
- M(c,b,e);
- A(e,a,c);
- Z(a,a,c);
- S(b,a);
- Z(c,d,f);
- M(a,c,_121665);
- A(a,a,d);
- M(c,c,a);
- M(a,d,f);
- M(d,b,x);
- S(b,e);
- sel25519(a,b,r);
- sel25519(c,d,r);
- }
- for (i = 0; i < 16; i++) {
- x[i+16]=a[i];
- x[i+32]=c[i];
- x[i+48]=b[i];
- x[i+64]=d[i];
- }
- var x32 = x.subarray(32);
- var x16 = x.subarray(16);
- inv25519(x32,x32);
- M(x16,x16,x32);
- pack25519(q,x16);
- return 0;
-}
-
-function crypto_scalarmult_base(q, n) {
- return crypto_scalarmult(q, n, _9);
-}
-
-function crypto_box_keypair(y, x) {
- randombytes(x, 32);
- return crypto_scalarmult_base(y, x);
-}
-
-function crypto_box_beforenm(k, y, x) {
- var s = new Uint8Array(32);
- crypto_scalarmult(s, x, y);
- return crypto_core_hsalsa20(k, _0, s, sigma);
-}
-
-var crypto_box_afternm = crypto_secretbox;
-var crypto_box_open_afternm = crypto_secretbox_open;
-
-function crypto_box(c, m, d, n, y, x) {
- var k = new Uint8Array(32);
- crypto_box_beforenm(k, y, x);
- return crypto_box_afternm(c, m, d, n, k);
-}
-
-function crypto_box_open(m, c, d, n, y, x) {
- var k = new Uint8Array(32);
- crypto_box_beforenm(k, y, x);
- return crypto_box_open_afternm(m, c, d, n, k);
-}
-
-function add64() {
- var a = 0, b = 0, c = 0, d = 0, m16 = 65535, l, h, i;
- for (i = 0; i < arguments.length; i++) {
- l = arguments[i].lo;
- h = arguments[i].hi;
- a += (l & m16); b += (l >>> 16);
- c += (h & m16); d += (h >>> 16);
- }
-
- b += (a >>> 16);
- c += (b >>> 16);
- d += (c >>> 16);
-
- return new u64((c & m16) | (d << 16), (a & m16) | (b << 16));
-}
-
-function shr64(x, c) {
- return new u64((x.hi >>> c), (x.lo >>> c) | (x.hi << (32 - c)));
-}
-
-function xor64() {
- var l = 0, h = 0, i;
- for (i = 0; i < arguments.length; i++) {
- l ^= arguments[i].lo;
- h ^= arguments[i].hi;
- }
- return new u64(h, l);
-}
-
-function R(x, c) {
- var h, l, c1 = 32 - c;
- if (c < 32) {
- h = (x.hi >>> c) | (x.lo << c1);
- l = (x.lo >>> c) | (x.hi << c1);
- } else if (c < 64) {
- h = (x.lo >>> c) | (x.hi << c1);
- l = (x.hi >>> c) | (x.lo << c1);
- }
- return new u64(h, l);
-}
-
-function Ch(x, y, z) {
- var h = (x.hi & y.hi) ^ (~x.hi & z.hi),
- l = (x.lo & y.lo) ^ (~x.lo & z.lo);
- return new u64(h, l);
-}
-
-function Maj(x, y, z) {
- var h = (x.hi & y.hi) ^ (x.hi & z.hi) ^ (y.hi & z.hi),
- l = (x.lo & y.lo) ^ (x.lo & z.lo) ^ (y.lo & z.lo);
- return new u64(h, l);
-}
-
-function Sigma0(x) { return xor64(R(x,28), R(x,34), R(x,39)); }
-function Sigma1(x) { return xor64(R(x,14), R(x,18), R(x,41)); }
-function sigma0(x) { return xor64(R(x, 1), R(x, 8), shr64(x,7)); }
-function sigma1(x) { return xor64(R(x,19), R(x,61), shr64(x,6)); }
-
-var K = [
- new u64(0x428a2f98, 0xd728ae22), new u64(0x71374491, 0x23ef65cd),
- new u64(0xb5c0fbcf, 0xec4d3b2f), new u64(0xe9b5dba5, 0x8189dbbc),
- new u64(0x3956c25b, 0xf348b538), new u64(0x59f111f1, 0xb605d019),
- new u64(0x923f82a4, 0xaf194f9b), new u64(0xab1c5ed5, 0xda6d8118),
- new u64(0xd807aa98, 0xa3030242), new u64(0x12835b01, 0x45706fbe),
- new u64(0x243185be, 0x4ee4b28c), new u64(0x550c7dc3, 0xd5ffb4e2),
- new u64(0x72be5d74, 0xf27b896f), new u64(0x80deb1fe, 0x3b1696b1),
- new u64(0x9bdc06a7, 0x25c71235), new u64(0xc19bf174, 0xcf692694),
- new u64(0xe49b69c1, 0x9ef14ad2), new u64(0xefbe4786, 0x384f25e3),
- new u64(0x0fc19dc6, 0x8b8cd5b5), new u64(0x240ca1cc, 0x77ac9c65),
- new u64(0x2de92c6f, 0x592b0275), new u64(0x4a7484aa, 0x6ea6e483),
- new u64(0x5cb0a9dc, 0xbd41fbd4), new u64(0x76f988da, 0x831153b5),
- new u64(0x983e5152, 0xee66dfab), new u64(0xa831c66d, 0x2db43210),
- new u64(0xb00327c8, 0x98fb213f), new u64(0xbf597fc7, 0xbeef0ee4),
- new u64(0xc6e00bf3, 0x3da88fc2), new u64(0xd5a79147, 0x930aa725),
- new u64(0x06ca6351, 0xe003826f), new u64(0x14292967, 0x0a0e6e70),
- new u64(0x27b70a85, 0x46d22ffc), new u64(0x2e1b2138, 0x5c26c926),
- new u64(0x4d2c6dfc, 0x5ac42aed), new u64(0x53380d13, 0x9d95b3df),
- new u64(0x650a7354, 0x8baf63de), new u64(0x766a0abb, 0x3c77b2a8),
- new u64(0x81c2c92e, 0x47edaee6), new u64(0x92722c85, 0x1482353b),
- new u64(0xa2bfe8a1, 0x4cf10364), new u64(0xa81a664b, 0xbc423001),
- new u64(0xc24b8b70, 0xd0f89791), new u64(0xc76c51a3, 0x0654be30),
- new u64(0xd192e819, 0xd6ef5218), new u64(0xd6990624, 0x5565a910),
- new u64(0xf40e3585, 0x5771202a), new u64(0x106aa070, 0x32bbd1b8),
- new u64(0x19a4c116, 0xb8d2d0c8), new u64(0x1e376c08, 0x5141ab53),
- new u64(0x2748774c, 0xdf8eeb99), new u64(0x34b0bcb5, 0xe19b48a8),
- new u64(0x391c0cb3, 0xc5c95a63), new u64(0x4ed8aa4a, 0xe3418acb),
- new u64(0x5b9cca4f, 0x7763e373), new u64(0x682e6ff3, 0xd6b2b8a3),
- new u64(0x748f82ee, 0x5defb2fc), new u64(0x78a5636f, 0x43172f60),
- new u64(0x84c87814, 0xa1f0ab72), new u64(0x8cc70208, 0x1a6439ec),
- new u64(0x90befffa, 0x23631e28), new u64(0xa4506ceb, 0xde82bde9),
- new u64(0xbef9a3f7, 0xb2c67915), new u64(0xc67178f2, 0xe372532b),
- new u64(0xca273ece, 0xea26619c), new u64(0xd186b8c7, 0x21c0c207),
- new u64(0xeada7dd6, 0xcde0eb1e), new u64(0xf57d4f7f, 0xee6ed178),
- new u64(0x06f067aa, 0x72176fba), new u64(0x0a637dc5, 0xa2c898a6),
- new u64(0x113f9804, 0xbef90dae), new u64(0x1b710b35, 0x131c471b),
- new u64(0x28db77f5, 0x23047d84), new u64(0x32caab7b, 0x40c72493),
- new u64(0x3c9ebe0a, 0x15c9bebc), new u64(0x431d67c4, 0x9c100d4c),
- new u64(0x4cc5d4be, 0xcb3e42b6), new u64(0x597f299c, 0xfc657e2a),
- new u64(0x5fcb6fab, 0x3ad6faec), new u64(0x6c44198c, 0x4a475817)
-];
-
-function crypto_hashblocks(x, m, n) {
- var z = [], b = [], a = [], w = [], t, i, j;
-
- for (i = 0; i < 8; i++) z[i] = a[i] = dl64(x, 8*i);
-
- var pos = 0;
- while (n >= 128) {
- for (i = 0; i < 16; i++) w[i] = dl64(m, 8*i+pos);
- for (i = 0; i < 80; i++) {
- for (j = 0; j < 8; j++) b[j] = a[j];
- t = add64(a[7], Sigma1(a[4]), Ch(a[4], a[5], a[6]), K[i], w[i%16]);
- b[7] = add64(t, Sigma0(a[0]), Maj(a[0], a[1], a[2]));
- b[3] = add64(b[3], t);
- for (j = 0; j < 8; j++) a[(j+1)%8] = b[j];
- if (i%16 === 15) {
- for (j = 0; j < 16; j++) {
- w[j] = add64(w[j], w[(j+9)%16], sigma0(w[(j+1)%16]), sigma1(w[(j+14)%16]));
- }
- }
- }
-
- for (i = 0; i < 8; i++) {
- a[i] = add64(a[i], z[i]);
- z[i] = a[i];
- }
-
- pos += 128;
- n -= 128;
- }
-
- for (i = 0; i < 8; i++) ts64(x, 8*i, z[i]);
- return n;
-}
-
-var iv = new Uint8Array([
- 0x6a,0x09,0xe6,0x67,0xf3,0xbc,0xc9,0x08,
- 0xbb,0x67,0xae,0x85,0x84,0xca,0xa7,0x3b,
- 0x3c,0x6e,0xf3,0x72,0xfe,0x94,0xf8,0x2b,
- 0xa5,0x4f,0xf5,0x3a,0x5f,0x1d,0x36,0xf1,
- 0x51,0x0e,0x52,0x7f,0xad,0xe6,0x82,0xd1,
- 0x9b,0x05,0x68,0x8c,0x2b,0x3e,0x6c,0x1f,
- 0x1f,0x83,0xd9,0xab,0xfb,0x41,0xbd,0x6b,
- 0x5b,0xe0,0xcd,0x19,0x13,0x7e,0x21,0x79
-]);
-
-function crypto_hash(out, m, n) {
- var h = new Uint8Array(64), x = new Uint8Array(256);
- var i, b = n;
-
- for (i = 0; i < 64; i++) h[i] = iv[i];
-
- crypto_hashblocks(h, m, n);
- n %= 128;
-
- for (i = 0; i < 256; i++) x[i] = 0;
- for (i = 0; i < n; i++) x[i] = m[b-n+i];
- x[n] = 128;
-
- n = 256-128*(n<112?1:0);
- x[n-9] = 0;
- ts64(x, n-8, new u64((b / 0x20000000) | 0, b << 3));
- crypto_hashblocks(h, x, n);
-
- for (i = 0; i < 64; i++) out[i] = h[i];
-
- return 0;
-}
-
-function add(p, q) {
- var a = gf(), b = gf(), c = gf(),
- d = gf(), e = gf(), f = gf(),
- g = gf(), h = gf(), t = gf();
-
- Z(a, p[1], p[0]);
- Z(t, q[1], q[0]);
- M(a, a, t);
- A(b, p[0], p[1]);
- A(t, q[0], q[1]);
- M(b, b, t);
- M(c, p[3], q[3]);
- M(c, c, D2);
- M(d, p[2], q[2]);
- A(d, d, d);
- Z(e, b, a);
- Z(f, d, c);
- A(g, d, c);
- A(h, b, a);
-
- M(p[0], e, f);
- M(p[1], h, g);
- M(p[2], g, f);
- M(p[3], e, h);
-}
-
-function cswap(p, q, b) {
- var i;
- for (i = 0; i < 4; i++) {
- sel25519(p[i], q[i], b);
- }
-}
-
-function pack(r, p) {
- var tx = gf(), ty = gf(), zi = gf();
- inv25519(zi, p[2]);
- M(tx, p[0], zi);
- M(ty, p[1], zi);
- pack25519(r, ty);
- r[31] ^= par25519(tx) << 7;
-}
-
-function scalarmult(p, q, s) {
- var b, i;
- set25519(p[0], gf0);
- set25519(p[1], gf1);
- set25519(p[2], gf1);
- set25519(p[3], gf0);
- for (i = 255; i >= 0; --i) {
- b = (s[(i/8)|0] >> (i&7)) & 1;
- cswap(p, q, b);
- add(q, p);
- add(p, p);
- cswap(p, q, b);
- }
-}
-
-function scalarbase(p, s) {
- var q = [gf(), gf(), gf(), gf()];
- set25519(q[0], X);
- set25519(q[1], Y);
- set25519(q[2], gf1);
- M(q[3], X, Y);
- scalarmult(p, q, s);
-}
-
-function crypto_sign_keypair(pk, sk, seeded) {
- var d = new Uint8Array(64);
- var p = [gf(), gf(), gf(), gf()];
- var i;
-
- if (!seeded) randombytes(sk, 32);
- crypto_hash(d, sk, 32);
- d[0] &= 248;
- d[31] &= 127;
- d[31] |= 64;
-
- scalarbase(p, d);
- pack(pk, p);
-
- for (i = 0; i < 32; i++) sk[i+32] = pk[i];
- return 0;
-}
-
-var L = new Float64Array([0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]);
-
-function modL(r, x) {
- var carry, i, j, k;
- for (i = 63; i >= 32; --i) {
- carry = 0;
- for (j = i - 32, k = i - 12; j < k; ++j) {
- x[j] += carry - 16 * x[i] * L[j - (i - 32)];
- carry = (x[j] + 128) >> 8;
- x[j] -= carry * 256;
- }
- x[j] += carry;
- x[i] = 0;
- }
- carry = 0;
- for (j = 0; j < 32; j++) {
- x[j] += carry - (x[31] >> 4) * L[j];
- carry = x[j] >> 8;
- x[j] &= 255;
- }
- for (j = 0; j < 32; j++) x[j] -= carry * L[j];
- for (i = 0; i < 32; i++) {
- x[i+1] += x[i] >> 8;
- r[i] = x[i] & 255;
- }
-}
-
-function reduce(r) {
- var x = new Float64Array(64), i;
- for (i = 0; i < 64; i++) x[i] = r[i];
- for (i = 0; i < 64; i++) r[i] = 0;
- modL(r, x);
-}
-
-// Note: difference from C - smlen returned, not passed as argument.
-function crypto_sign(sm, m, n, sk) {
- var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64);
- var i, j, x = new Float64Array(64);
- var p = [gf(), gf(), gf(), gf()];
-
- crypto_hash(d, sk, 32);
- d[0] &= 248;
- d[31] &= 127;
- d[31] |= 64;
-
- var smlen = n + 64;
- for (i = 0; i < n; i++) sm[64 + i] = m[i];
- for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i];
-
- crypto_hash(r, sm.subarray(32), n+32);
- reduce(r);
- scalarbase(p, r);
- pack(sm, p);
-
- for (i = 32; i < 64; i++) sm[i] = sk[i];
- crypto_hash(h, sm, n + 64);
- reduce(h);
-
- for (i = 0; i < 64; i++) x[i] = 0;
- for (i = 0; i < 32; i++) x[i] = r[i];
- for (i = 0; i < 32; i++) {
- for (j = 0; j < 32; j++) {
- x[i+j] += h[i] * d[j];
- }
- }
-
- modL(sm.subarray(32), x);
- return smlen;
-}
-
-function unpackneg(r, p) {
- var t = gf(), chk = gf(), num = gf(),
- den = gf(), den2 = gf(), den4 = gf(),
- den6 = gf();
-
- set25519(r[2], gf1);
- unpack25519(r[1], p);
- S(num, r[1]);
- M(den, num, D);
- Z(num, num, r[2]);
- A(den, r[2], den);
-
- S(den2, den);
- S(den4, den2);
- M(den6, den4, den2);
- M(t, den6, num);
- M(t, t, den);
-
- pow2523(t, t);
- M(t, t, num);
- M(t, t, den);
- M(t, t, den);
- M(r[0], t, den);
-
- S(chk, r[0]);
- M(chk, chk, den);
- if (neq25519(chk, num)) M(r[0], r[0], I);
-
- S(chk, r[0]);
- M(chk, chk, den);
- if (neq25519(chk, num)) return -1;
-
- if (par25519(r[0]) === (p[31]>>7)) Z(r[0], gf0, r[0]);
-
- M(r[3], r[0], r[1]);
- return 0;
-}
-
-function crypto_sign_open(m, sm, n, pk) {
- var i, mlen;
- var t = new Uint8Array(32), h = new Uint8Array(64);
- var p = [gf(), gf(), gf(), gf()],
- q = [gf(), gf(), gf(), gf()];
-
- mlen = -1;
- if (n < 64) return -1;
-
- if (unpackneg(q, pk)) return -1;
-
- for (i = 0; i < n; i++) m[i] = sm[i];
- for (i = 0; i < 32; i++) m[i+32] = pk[i];
- crypto_hash(h, m, n);
- reduce(h);
- scalarmult(p, q, h);
-
- scalarbase(q, sm.subarray(32));
- add(p, q);
- pack(t, p);
-
- n -= 64;
- if (crypto_verify_32(sm, 0, t, 0)) {
- for (i = 0; i < n; i++) m[i] = 0;
- return -1;
- }
-
- for (i = 0; i < n; i++) m[i] = sm[i + 64];
- mlen = n;
- return mlen;
-}
-
-var crypto_secretbox_KEYBYTES = 32,
- crypto_secretbox_NONCEBYTES = 24,
- crypto_secretbox_ZEROBYTES = 32,
- crypto_secretbox_BOXZEROBYTES = 16,
- crypto_scalarmult_BYTES = 32,
- crypto_scalarmult_SCALARBYTES = 32,
- crypto_box_PUBLICKEYBYTES = 32,
- crypto_box_SECRETKEYBYTES = 32,
- crypto_box_BEFORENMBYTES = 32,
- crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES,
- crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES,
- crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES,
- crypto_sign_BYTES = 64,
- crypto_sign_PUBLICKEYBYTES = 32,
- crypto_sign_SECRETKEYBYTES = 64,
- crypto_sign_SEEDBYTES = 32,
- crypto_hash_BYTES = 64;
-
-nacl.lowlevel = {
- crypto_core_hsalsa20: crypto_core_hsalsa20,
- crypto_stream_xor: crypto_stream_xor,
- crypto_stream: crypto_stream,
- crypto_stream_salsa20_xor: crypto_stream_salsa20_xor,
- crypto_stream_salsa20: crypto_stream_salsa20,
- crypto_onetimeauth: crypto_onetimeauth,
- crypto_onetimeauth_verify: crypto_onetimeauth_verify,
- crypto_verify_16: crypto_verify_16,
- crypto_verify_32: crypto_verify_32,
- crypto_secretbox: crypto_secretbox,
- crypto_secretbox_open: crypto_secretbox_open,
- crypto_scalarmult: crypto_scalarmult,
- crypto_scalarmult_base: crypto_scalarmult_base,
- crypto_box_beforenm: crypto_box_beforenm,
- crypto_box_afternm: crypto_box_afternm,
- crypto_box: crypto_box,
- crypto_box_open: crypto_box_open,
- crypto_box_keypair: crypto_box_keypair,
- crypto_hash: crypto_hash,
- crypto_sign: crypto_sign,
- crypto_sign_keypair: crypto_sign_keypair,
- crypto_sign_open: crypto_sign_open,
-
- crypto_secretbox_KEYBYTES: crypto_secretbox_KEYBYTES,
- crypto_secretbox_NONCEBYTES: crypto_secretbox_NONCEBYTES,
- crypto_secretbox_ZEROBYTES: crypto_secretbox_ZEROBYTES,
- crypto_secretbox_BOXZEROBYTES: crypto_secretbox_BOXZEROBYTES,
- crypto_scalarmult_BYTES: crypto_scalarmult_BYTES,
- crypto_scalarmult_SCALARBYTES: crypto_scalarmult_SCALARBYTES,
- crypto_box_PUBLICKEYBYTES: crypto_box_PUBLICKEYBYTES,
- crypto_box_SECRETKEYBYTES: crypto_box_SECRETKEYBYTES,
- crypto_box_BEFORENMBYTES: crypto_box_BEFORENMBYTES,
- crypto_box_NONCEBYTES: crypto_box_NONCEBYTES,
- crypto_box_ZEROBYTES: crypto_box_ZEROBYTES,
- crypto_box_BOXZEROBYTES: crypto_box_BOXZEROBYTES,
- crypto_sign_BYTES: crypto_sign_BYTES,
- crypto_sign_PUBLICKEYBYTES: crypto_sign_PUBLICKEYBYTES,
- crypto_sign_SECRETKEYBYTES: crypto_sign_SECRETKEYBYTES,
- crypto_sign_SEEDBYTES: crypto_sign_SEEDBYTES,
- crypto_hash_BYTES: crypto_hash_BYTES
-};
-
-/* High-level API */
-
-function checkLengths(k, n) {
- if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size');
- if (n.length !== crypto_secretbox_NONCEBYTES) throw new Error('bad nonce size');
-}
-
-function checkBoxLengths(pk, sk) {
- if (pk.length !== crypto_box_PUBLICKEYBYTES) throw new Error('bad public key size');
- if (sk.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size');
-}
-
-function checkArrayTypes() {
- var t, i;
- for (i = 0; i < arguments.length; i++) {
- if ((t = Object.prototype.toString.call(arguments[i])) !== '[object Uint8Array]')
- throw new TypeError('unexpected type ' + t + ', use Uint8Array');
- }
-}
-
-function cleanup(arr) {
- for (var i = 0; i < arr.length; i++) arr[i] = 0;
-}
-
-// TODO: Completely remove this in v0.15.
-if (!nacl.util) {
- nacl.util = {};
- nacl.util.decodeUTF8 = nacl.util.encodeUTF8 = nacl.util.encodeBase64 = nacl.util.decodeBase64 = function() {
- throw new Error('nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js');
- };
-}
-
-nacl.randomBytes = function(n) {
- var b = new Uint8Array(n);
- randombytes(b, n);
- return b;
-};
-
-nacl.secretbox = function(msg, nonce, key) {
- checkArrayTypes(msg, nonce, key);
- checkLengths(key, nonce);
- var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length);
- var c = new Uint8Array(m.length);
- for (var i = 0; i < msg.length; i++) m[i+crypto_secretbox_ZEROBYTES] = msg[i];
- crypto_secretbox(c, m, m.length, nonce, key);
- return c.subarray(crypto_secretbox_BOXZEROBYTES);
-};
-
-nacl.secretbox.open = function(box, nonce, key) {
- checkArrayTypes(box, nonce, key);
- checkLengths(key, nonce);
- var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length);
- var m = new Uint8Array(c.length);
- for (var i = 0; i < box.length; i++) c[i+crypto_secretbox_BOXZEROBYTES] = box[i];
- if (c.length < 32) return false;
- if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) return false;
- return m.subarray(crypto_secretbox_ZEROBYTES);
-};
-
-nacl.secretbox.keyLength = crypto_secretbox_KEYBYTES;
-nacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES;
-nacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES;
-
-nacl.scalarMult = function(n, p) {
- checkArrayTypes(n, p);
- if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');
- if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size');
- var q = new Uint8Array(crypto_scalarmult_BYTES);
- crypto_scalarmult(q, n, p);
- return q;
-};
-
-nacl.scalarMult.base = function(n) {
- checkArrayTypes(n);
- if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');
- var q = new Uint8Array(crypto_scalarmult_BYTES);
- crypto_scalarmult_base(q, n);
- return q;
-};
-
-nacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES;
-nacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES;
-
-nacl.box = function(msg, nonce, publicKey, secretKey) {
- var k = nacl.box.before(publicKey, secretKey);
- return nacl.secretbox(msg, nonce, k);
-};
-
-nacl.box.before = function(publicKey, secretKey) {
- checkArrayTypes(publicKey, secretKey);
- checkBoxLengths(publicKey, secretKey);
- var k = new Uint8Array(crypto_box_BEFORENMBYTES);
- crypto_box_beforenm(k, publicKey, secretKey);
- return k;
-};
-
-nacl.box.after = nacl.secretbox;
-
-nacl.box.open = function(msg, nonce, publicKey, secretKey) {
- var k = nacl.box.before(publicKey, secretKey);
- return nacl.secretbox.open(msg, nonce, k);
-};
-
-nacl.box.open.after = nacl.secretbox.open;
-
-nacl.box.keyPair = function() {
- var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);
- var sk = new Uint8Array(crypto_box_SECRETKEYBYTES);
- crypto_box_keypair(pk, sk);
- return {publicKey: pk, secretKey: sk};
-};
-
-nacl.box.keyPair.fromSecretKey = function(secretKey) {
- checkArrayTypes(secretKey);
- if (secretKey.length !== crypto_box_SECRETKEYBYTES)
- throw new Error('bad secret key size');
- var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);
- crypto_scalarmult_base(pk, secretKey);
- return {publicKey: pk, secretKey: new Uint8Array(secretKey)};
-};
-
-nacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES;
-nacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES;
-nacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES;
-nacl.box.nonceLength = crypto_box_NONCEBYTES;
-nacl.box.overheadLength = nacl.secretbox.overheadLength;
-
-nacl.sign = function(msg, secretKey) {
- checkArrayTypes(msg, secretKey);
- if (secretKey.length !== crypto_sign_SECRETKEYBYTES)
- throw new Error('bad secret key size');
- var signedMsg = new Uint8Array(crypto_sign_BYTES+msg.length);
- crypto_sign(signedMsg, msg, msg.length, secretKey);
- return signedMsg;
-};
-
-nacl.sign.open = function(signedMsg, publicKey) {
- if (arguments.length !== 2)
- throw new Error('nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?');
- checkArrayTypes(signedMsg, publicKey);
- if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)
- throw new Error('bad public key size');
- var tmp = new Uint8Array(signedMsg.length);
- var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey);
- if (mlen < 0) return null;
- var m = new Uint8Array(mlen);
- for (var i = 0; i < m.length; i++) m[i] = tmp[i];
- return m;
-};
-
-nacl.sign.detached = function(msg, secretKey) {
- var signedMsg = nacl.sign(msg, secretKey);
- var sig = new Uint8Array(crypto_sign_BYTES);
- for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i];
- return sig;
-};
-
-nacl.sign.detached.verify = function(msg, sig, publicKey) {
- checkArrayTypes(msg, sig, publicKey);
- if (sig.length !== crypto_sign_BYTES)
- throw new Error('bad signature size');
- if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)
- throw new Error('bad public key size');
- var sm = new Uint8Array(crypto_sign_BYTES + msg.length);
- var m = new Uint8Array(crypto_sign_BYTES + msg.length);
- var i;
- for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i];
- for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i];
- return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0);
-};
-
-nacl.sign.keyPair = function() {
- var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
- var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);
- crypto_sign_keypair(pk, sk);
- return {publicKey: pk, secretKey: sk};
-};
-
-nacl.sign.keyPair.fromSecretKey = function(secretKey) {
- checkArrayTypes(secretKey);
- if (secretKey.length !== crypto_sign_SECRETKEYBYTES)
- throw new Error('bad secret key size');
- var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
- for (var i = 0; i < pk.length; i++) pk[i] = secretKey[32+i];
- return {publicKey: pk, secretKey: new Uint8Array(secretKey)};
-};
-
-nacl.sign.keyPair.fromSeed = function(seed) {
- checkArrayTypes(seed);
- if (seed.length !== crypto_sign_SEEDBYTES)
- throw new Error('bad seed size');
- var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
- var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);
- for (var i = 0; i < 32; i++) sk[i] = seed[i];
- crypto_sign_keypair(pk, sk, true);
- return {publicKey: pk, secretKey: sk};
-};
-
-nacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES;
-nacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES;
-nacl.sign.seedLength = crypto_sign_SEEDBYTES;
-nacl.sign.signatureLength = crypto_sign_BYTES;
-
-nacl.hash = function(msg) {
- checkArrayTypes(msg);
- var h = new Uint8Array(crypto_hash_BYTES);
- crypto_hash(h, msg, msg.length);
- return h;
-};
-
-nacl.hash.hashLength = crypto_hash_BYTES;
-
-nacl.verify = function(x, y) {
- checkArrayTypes(x, y);
- // Zero length arguments are considered not equal.
- if (x.length === 0 || y.length === 0) return false;
- if (x.length !== y.length) return false;
- return (vn(x, 0, y, 0, x.length) === 0) ? true : false;
-};
-
-nacl.setPRNG = function(fn) {
- randombytes = fn;
-};
-
-(function() {
- // Initialize PRNG if environment provides CSPRNG.
- // If not, methods calling randombytes will throw.
- var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null;
- if (crypto && crypto.getRandomValues) {
- // Browsers.
- var QUOTA = 65536;
- nacl.setPRNG(function(x, n) {
- var i, v = new Uint8Array(n);
- for (i = 0; i < n; i += QUOTA) {
- crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA)));
- }
- for (i = 0; i < n; i++) x[i] = v[i];
- cleanup(v);
- });
- } else if (typeof require !== 'undefined') {
- // Node.js.
- crypto = require('crypto');
- if (crypto && crypto.randomBytes) {
- nacl.setPRNG(function(x, n) {
- var i, v = crypto.randomBytes(n);
- for (i = 0; i < n; i++) x[i] = v[i];
- cleanup(v);
- });
- }
- }
-})();
-
-})(typeof module !== 'undefined' && module.exports ? module.exports : (self.nacl = self.nacl || {}));
diff --git a/node_modules/tweetnacl/nacl.min.js b/node_modules/tweetnacl/nacl.min.js
deleted file mode 100644
index 4484974..0000000
--- a/node_modules/tweetnacl/nacl.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(r){"use strict";function n(r,n){return r<>>32-n}function e(r,n){var e=255&r[n+3];return e=e<<8|255&r[n+2],e=e<<8|255&r[n+1],e<<8|255&r[n+0]}function t(r,n){var e=r[n]<<24|r[n+1]<<16|r[n+2]<<8|r[n+3],t=r[n+4]<<24|r[n+5]<<16|r[n+6]<<8|r[n+7];return new sr(e,t)}function o(r,n,e){var t;for(t=0;t<4;t++)r[n+t]=255&e,e>>>=8}function i(r,n,e){r[n]=e.hi>>24&255,r[n+1]=e.hi>>16&255,r[n+2]=e.hi>>8&255,r[n+3]=255&e.hi,r[n+4]=e.lo>>24&255,r[n+5]=e.lo>>16&255,r[n+6]=e.lo>>8&255,r[n+7]=255&e.lo}function a(r,n,e,t,o){var i,a=0;for(i=0;i>>8)-1}function f(r,n,e,t){return a(r,n,e,t,16)}function u(r,n,e,t){return a(r,n,e,t,32)}function c(r,t,i,a,f){var u,c,w,y=new Uint32Array(16),l=new Uint32Array(16),s=new Uint32Array(16),h=new Uint32Array(4);for(u=0;u<4;u++)l[5*u]=e(a,4*u),l[1+u]=e(i,4*u),l[6+u]=e(t,4*u),l[11+u]=e(i,16+4*u);for(u=0;u<16;u++)s[u]=l[u];for(u=0;u<20;u++){for(c=0;c<4;c++){for(w=0;w<4;w++)h[w]=l[(5*c+4*w)%16];for(h[1]^=n(h[0]+h[3]|0,7),h[2]^=n(h[1]+h[0]|0,9),h[3]^=n(h[2]+h[1]|0,13),h[0]^=n(h[3]+h[2]|0,18),w=0;w<4;w++)y[4*c+(c+w)%4]=h[w]}for(w=0;w<16;w++)l[w]=y[w]}if(f){for(u=0;u<16;u++)l[u]=l[u]+s[u]|0;for(u=0;u<4;u++)l[5*u]=l[5*u]-e(a,4*u)|0,l[6+u]=l[6+u]-e(t,4*u)|0;for(u=0;u<4;u++)o(r,4*u,l[5*u]),o(r,16+4*u,l[6+u])}else for(u=0;u<16;u++)o(r,4*u,l[u]+s[u]|0)}function w(r,n,e,t){return c(r,n,e,t,!1),0}function y(r,n,e,t){return c(r,n,e,t,!0),0}function l(r,n,e,t,o,i,a){var f,u,c=new Uint8Array(16),y=new Uint8Array(64);if(!o)return 0;for(u=0;u<16;u++)c[u]=0;for(u=0;u<8;u++)c[u]=i[u];for(;o>=64;){for(w(y,c,a,Br),u=0;u<64;u++)r[n+u]=(e?e[t+u]:0)^y[u];for(f=1,u=8;u<16;u++)f=f+(255&c[u])|0,c[u]=255&f,f>>>=8;o-=64,n+=64,e&&(t+=64)}if(o>0)for(w(y,c,a,Br),u=0;u>>=8}function b(r,n,e,t,o,i){var a,f,u,c,w=new Uint32Array(17),y=new Uint32Array(17),l=new Uint32Array(17),s=new Uint32Array(17),h=new Uint32Array(17);for(u=0;u<17;u++)y[u]=l[u]=0;for(u=0;u<16;u++)y[u]=i[u];for(y[3]&=15,y[4]&=252,y[7]&=15,y[8]&=252,y[11]&=15,y[12]&=252,y[15]&=15;o>0;){for(u=0;u<17;u++)s[u]=0;for(u=0;u<16&&u>>=8;for(c=c+l[16]|0,l[16]=3&c,c=5*(c>>>2)|0,u=0;u<16;u++)c=c+l[u]|0,l[u]=255&c,c>>>=8;c=c+l[16]|0,l[16]=c}for(u=0;u<17;u++)h[u]=l[u];for(v(l,Sr),a=0|-(l[16]>>>7),u=0;u<17;u++)l[u]^=a&(h[u]^l[u]);for(u=0;u<16;u++)s[u]=i[u+16];for(s[16]=0,v(l,s),u=0;u<16;u++)r[n+u]=l[u];return 0}function p(r,n,e,t,o,i){var a=new Uint8Array(16);return b(a,0,e,t,o,i),f(r,n,a,0)}function _(r,n,e,t,o){var i;if(e<32)return-1;for(g(r,0,n,0,e,t,o),b(r,16,r,32,e-32,r),i=0;i<16;i++)r[i]=0;return 0}function A(r,n,e,t,o){var i,a=new Uint8Array(32);if(e<32)return-1;if(h(a,0,32,t,o),0!==p(n,16,n,32,e-32,a))return-1;for(g(r,0,n,0,e,t,o),i=0;i<32;i++)r[i]=0;return 0}function U(r,n){var e;for(e=0;e<16;e++)r[e]=0|n[e]}function E(r){var n,e;for(e=0;e<16;e++)r[e]+=65536,n=Math.floor(r[e]/65536),r[(e+1)*(e<15?1:0)]+=n-1+37*(n-1)*(15===e?1:0),r[e]-=65536*n}function d(r,n,e){for(var t,o=~(e-1),i=0;i<16;i++)t=o&(r[i]^n[i]),r[i]^=t,n[i]^=t}function x(r,n){var e,t,o,i=hr(),a=hr();for(e=0;e<16;e++)a[e]=n[e];for(E(a),E(a),E(a),t=0;t<2;t++){for(i[0]=a[0]-65517,e=1;e<15;e++)i[e]=a[e]-65535-(i[e-1]>>16&1),i[e-1]&=65535;i[15]=a[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,d(a,i,1-o)}for(e=0;e<16;e++)r[2*e]=255&a[e],r[2*e+1]=a[e]>>8}function m(r,n){var e=new Uint8Array(32),t=new Uint8Array(32);return x(e,r),x(t,n),u(e,0,t,0)}function B(r){var n=new Uint8Array(32);return x(n,r),1&n[0]}function S(r,n){var e;for(e=0;e<16;e++)r[e]=n[2*e]+(n[2*e+1]<<8);r[15]&=32767}function K(r,n,e){var t;for(t=0;t<16;t++)r[t]=n[t]+e[t]|0}function T(r,n,e){var t;for(t=0;t<16;t++)r[t]=n[t]-e[t]|0}function Y(r,n,e){var t,o,i=new Float64Array(31);for(t=0;t<31;t++)i[t]=0;for(t=0;t<16;t++)for(o=0;o<16;o++)i[t+o]+=n[t]*e[o];for(t=0;t<15;t++)i[t]+=38*i[t+16];for(t=0;t<16;t++)r[t]=i[t];E(r),E(r)}function L(r,n){Y(r,n,n)}function k(r,n){var e,t=hr();for(e=0;e<16;e++)t[e]=n[e];for(e=253;e>=0;e--)L(t,t),2!==e&&4!==e&&Y(t,t,n);for(e=0;e<16;e++)r[e]=t[e]}function z(r,n){var e,t=hr();for(e=0;e<16;e++)t[e]=n[e];for(e=250;e>=0;e--)L(t,t),1!==e&&Y(t,t,n);for(e=0;e<16;e++)r[e]=t[e]}function R(r,n,e){var t,o,i=new Uint8Array(32),a=new Float64Array(80),f=hr(),u=hr(),c=hr(),w=hr(),y=hr(),l=hr();for(o=0;o<31;o++)i[o]=n[o];for(i[31]=127&n[31]|64,i[0]&=248,S(a,e),o=0;o<16;o++)u[o]=a[o],w[o]=f[o]=c[o]=0;for(f[0]=w[0]=1,o=254;o>=0;--o)t=i[o>>>3]>>>(7&o)&1,d(f,u,t),d(c,w,t),K(y,f,c),T(f,f,c),K(c,u,w),T(u,u,w),L(w,y),L(l,f),Y(f,c,f),Y(c,u,y),K(y,f,c),T(f,f,c),L(u,f),T(c,w,l),Y(f,c,Ar),K(f,f,w),Y(c,c,f),Y(f,w,l),Y(w,u,a),L(u,y),d(f,u,t),d(c,w,t);for(o=0;o<16;o++)a[o+16]=f[o],a[o+32]=c[o],a[o+48]=u[o],a[o+64]=w[o];var s=a.subarray(32),h=a.subarray(16);return k(s,s),Y(h,h,s),x(r,h),0}function P(r,n){return R(r,n,br)}function O(r,n){return gr(n,32),P(r,n)}function F(r,n,e){var t=new Uint8Array(32);return R(t,e,n),y(r,vr,t,Br)}function N(r,n,e,t,o,i){var a=new Uint8Array(32);return F(a,o,i),Kr(r,n,e,t,a)}function C(r,n,e,t,o,i){var a=new Uint8Array(32);return F(a,o,i),Tr(r,n,e,t,a)}function M(){var r,n,e,t=0,o=0,i=0,a=0,f=65535;for(e=0;e>>16,i+=n&f,a+=n>>>16;return o+=t>>>16,i+=o>>>16,a+=i>>>16,new sr(i&f|a<<16,t&f|o<<16)}function G(r,n){return new sr(r.hi>>>n,r.lo>>>n|r.hi<<32-n)}function Z(){var r,n=0,e=0;for(r=0;r>>n|r.lo<>>n|r.hi<>>n|r.hi<>>n|r.lo<=128;){for(a=0;a<16;a++)y[a]=t(n,8*a+l);for(a=0;a<80;a++){for(f=0;f<8;f++)c[f]=w[f];for(o=M(w[7],X(w[4]),q(w[4],w[5],w[6]),Yr[a],y[a%16]),c[7]=M(o,V(w[0]),I(w[0],w[1],w[2])),c[3]=M(c[3],o),f=0;f<8;f++)w[(f+1)%8]=c[f];if(a%16===15)for(f=0;f<16;f++)y[f]=M(y[f],y[(f+9)%16],D(y[(f+1)%16]),H(y[(f+14)%16]))}for(a=0;a<8;a++)w[a]=M(w[a],u[a]),u[a]=w[a];l+=128,e-=128}for(a=0;a<8;a++)i(r,8*a,u[a]);return e}function Q(r,n,e){var t,o=new Uint8Array(64),a=new Uint8Array(256),f=e;for(t=0;t<64;t++)o[t]=Lr[t];for(J(o,n,e),e%=128,t=0;t<256;t++)a[t]=0;for(t=0;t=0;--o)t=e[o/8|0]>>(7&o)&1,$(r,n,t),W(n,r),W(r,r),$(r,n,t)}function er(r,n){var e=[hr(),hr(),hr(),hr()];U(e[0],dr),U(e[1],xr),U(e[2],_r),Y(e[3],dr,xr),nr(r,e,n)}function tr(r,n,e){var t,o=new Uint8Array(64),i=[hr(),hr(),hr(),hr()];for(e||gr(n,32),Q(o,n,32),o[0]&=248,o[31]&=127,o[31]|=64,er(i,o),rr(r,i),t=0;t<32;t++)n[t+32]=r[t];return 0}function or(r,n){var e,t,o,i;for(t=63;t>=32;--t){for(e=0,o=t-32,i=t-12;o>8,n[o]-=256*e;n[o]+=e,n[t]=0}for(e=0,o=0;o<32;o++)n[o]+=e-(n[31]>>4)*kr[o],e=n[o]>>8,n[o]&=255;for(o=0;o<32;o++)n[o]-=e*kr[o];for(t=0;t<32;t++)n[t+1]+=n[t]>>8,r[t]=255&n[t]}function ir(r){var n,e=new Float64Array(64);for(n=0;n<64;n++)e[n]=r[n];for(n=0;n<64;n++)r[n]=0;or(r,e)}function ar(r,n,e,t){var o,i,a=new Uint8Array(64),f=new Uint8Array(64),u=new Uint8Array(64),c=new Float64Array(64),w=[hr(),hr(),hr(),hr()];Q(a,t,32),a[0]&=248,a[31]&=127,a[31]|=64;var y=e+64;for(o=0;o>7&&T(r[0],pr,r[0]),Y(r[3],r[0],r[1]),0)}function ur(r,n,e,t){var o,i,a=new Uint8Array(32),f=new Uint8Array(64),c=[hr(),hr(),hr(),hr()],w=[hr(),hr(),hr(),hr()];if(i=-1,e<64)return-1;if(fr(w,t))return-1;for(o=0;o=0},r.sign.keyPair=function(){var r=new Uint8Array(Vr),n=new Uint8Array(Xr);return tr(r,n),{publicKey:r,secretKey:n}},r.sign.keyPair.fromSecretKey=function(r){if(yr(r),r.length!==Xr)throw new Error("bad secret key size");for(var n=new Uint8Array(Vr),e=0;e/dev/null && browserify test/browser/init.js test/*.quick.js | uglifyjs -c -m -o test/browser/_bundle-quick.js 2>/dev/null",
- "test": "npm run test-node-all && npm run test-browser",
- "bench": "node test/benchmark/bench.js",
- "lint": "eslint nacl.js nacl-fast.js test/*.js test/benchmark/*.js"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/dchest/tweetnacl-js.git"
- },
- "keywords": [
- "crypto",
- "cryptography",
- "curve25519",
- "ed25519",
- "encrypt",
- "hash",
- "key",
- "nacl",
- "poly1305",
- "public",
- "salsa20",
- "signatures"
- ],
- "author": "TweetNaCl-js contributors",
- "license": "Unlicense",
- "bugs": {
- "url": "https://github.com/dchest/tweetnacl-js/issues"
- },
- "homepage": "https://tweetnacl.js.org",
- "devDependencies": {
- "browserify": "^13.0.0",
- "eslint": "^2.2.0",
- "faucet": "^0.0.1",
- "tap-browser-color": "^0.1.2",
- "tape": "^4.4.0",
- "tape-run": "^2.1.3",
- "tweetnacl-util": "^0.13.3",
- "uglify-js": "^2.6.1"
- },
- "browser": {
- "buffer": false,
- "crypto": false
- }
-}
diff --git a/node_modules/util-deprecate/History.md b/node_modules/util-deprecate/History.md
deleted file mode 100644
index acc8675..0000000
--- a/node_modules/util-deprecate/History.md
+++ /dev/null
@@ -1,16 +0,0 @@
-
-1.0.2 / 2015-10-07
-==================
-
- * use try/catch when checking `localStorage` (#3, @kumavis)
-
-1.0.1 / 2014-11-25
-==================
-
- * browser: use `console.warn()` for deprecation calls
- * browser: more jsdocs
-
-1.0.0 / 2014-04-30
-==================
-
- * initial commit
diff --git a/node_modules/util-deprecate/LICENSE b/node_modules/util-deprecate/LICENSE
deleted file mode 100644
index 6a60e8c..0000000
--- a/node_modules/util-deprecate/LICENSE
+++ /dev/null
@@ -1,24 +0,0 @@
-(The MIT License)
-
-Copyright (c) 2014 Nathan Rajlich
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/util-deprecate/README.md b/node_modules/util-deprecate/README.md
deleted file mode 100644
index 75622fa..0000000
--- a/node_modules/util-deprecate/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-util-deprecate
-==============
-### The Node.js `util.deprecate()` function with browser support
-
-In Node.js, this module simply re-exports the `util.deprecate()` function.
-
-In the web browser (i.e. via browserify), a browser-specific implementation
-of the `util.deprecate()` function is used.
-
-
-## API
-
-A `deprecate()` function is the only thing exposed by this module.
-
-``` javascript
-// setup:
-exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead');
-
-
-// users see:
-foo();
-// foo() is deprecated, use bar() instead
-foo();
-foo();
-```
-
-
-## License
-
-(The MIT License)
-
-Copyright (c) 2014 Nathan Rajlich
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/util-deprecate/browser.js b/node_modules/util-deprecate/browser.js
deleted file mode 100644
index 549ae2f..0000000
--- a/node_modules/util-deprecate/browser.js
+++ /dev/null
@@ -1,67 +0,0 @@
-
-/**
- * Module exports.
- */
-
-module.exports = deprecate;
-
-/**
- * Mark that a method should not be used.
- * Returns a modified function which warns once by default.
- *
- * If `localStorage.noDeprecation = true` is set, then it is a no-op.
- *
- * If `localStorage.throwDeprecation = true` is set, then deprecated functions
- * will throw an Error when invoked.
- *
- * If `localStorage.traceDeprecation = true` is set, then deprecated functions
- * will invoke `console.trace()` instead of `console.error()`.
- *
- * @param {Function} fn - the function to deprecate
- * @param {String} msg - the string to print to the console when `fn` is invoked
- * @returns {Function} a new "deprecated" version of `fn`
- * @api public
- */
-
-function deprecate (fn, msg) {
- if (config('noDeprecation')) {
- return fn;
- }
-
- var warned = false;
- function deprecated() {
- if (!warned) {
- if (config('throwDeprecation')) {
- throw new Error(msg);
- } else if (config('traceDeprecation')) {
- console.trace(msg);
- } else {
- console.warn(msg);
- }
- warned = true;
- }
- return fn.apply(this, arguments);
- }
-
- return deprecated;
-}
-
-/**
- * Checks `localStorage` for boolean values for the given `name`.
- *
- * @param {String} name
- * @returns {Boolean}
- * @api private
- */
-
-function config (name) {
- // accessing global.localStorage can trigger a DOMException in sandboxed iframes
- try {
- if (!global.localStorage) return false;
- } catch (_) {
- return false;
- }
- var val = global.localStorage[name];
- if (null == val) return false;
- return String(val).toLowerCase() === 'true';
-}
diff --git a/node_modules/util-deprecate/node.js b/node_modules/util-deprecate/node.js
deleted file mode 100644
index 5e6fcff..0000000
--- a/node_modules/util-deprecate/node.js
+++ /dev/null
@@ -1,6 +0,0 @@
-
-/**
- * For Node.js, simply re-export the core `util.deprecate` function.
- */
-
-module.exports = require('util').deprecate;
diff --git a/node_modules/util-deprecate/package.json b/node_modules/util-deprecate/package.json
deleted file mode 100644
index 2e79f89..0000000
--- a/node_modules/util-deprecate/package.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "name": "util-deprecate",
- "version": "1.0.2",
- "description": "The Node.js `util.deprecate()` function with browser support",
- "main": "node.js",
- "browser": "browser.js",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/TooTallNate/util-deprecate.git"
- },
- "keywords": [
- "util",
- "deprecate",
- "browserify",
- "browser",
- "node"
- ],
- "author": "Nathan Rajlich (http://n8.io/)",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/TooTallNate/util-deprecate/issues"
- },
- "homepage": "https://github.com/TooTallNate/util-deprecate"
-}
diff --git a/node_modules/wrappy/LICENSE b/node_modules/wrappy/LICENSE
deleted file mode 100644
index 19129e3..0000000
--- a/node_modules/wrappy/LICENSE
+++ /dev/null
@@ -1,15 +0,0 @@
-The ISC License
-
-Copyright (c) Isaac Z. Schlueter and Contributors
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
-IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/wrappy/README.md b/node_modules/wrappy/README.md
deleted file mode 100644
index 98eab25..0000000
--- a/node_modules/wrappy/README.md
+++ /dev/null
@@ -1,36 +0,0 @@
-# wrappy
-
-Callback wrapping utility
-
-## USAGE
-
-```javascript
-var wrappy = require("wrappy")
-
-// var wrapper = wrappy(wrapperFunction)
-
-// make sure a cb is called only once
-// See also: http://npm.im/once for this specific use case
-var once = wrappy(function (cb) {
- var called = false
- return function () {
- if (called) return
- called = true
- return cb.apply(this, arguments)
- }
-})
-
-function printBoo () {
- console.log('boo')
-}
-// has some rando property
-printBoo.iAmBooPrinter = true
-
-var onlyPrintOnce = once(printBoo)
-
-onlyPrintOnce() // prints 'boo'
-onlyPrintOnce() // does nothing
-
-// random property is retained!
-assert.equal(onlyPrintOnce.iAmBooPrinter, true)
-```
diff --git a/node_modules/wrappy/package.json b/node_modules/wrappy/package.json
deleted file mode 100644
index 1307520..0000000
--- a/node_modules/wrappy/package.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "name": "wrappy",
- "version": "1.0.2",
- "description": "Callback wrapping utility",
- "main": "wrappy.js",
- "files": [
- "wrappy.js"
- ],
- "directories": {
- "test": "test"
- },
- "dependencies": {},
- "devDependencies": {
- "tap": "^2.3.1"
- },
- "scripts": {
- "test": "tap --coverage test/*.js"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/npm/wrappy"
- },
- "author": "Isaac Z. Schlueter (http://blog.izs.me/)",
- "license": "ISC",
- "bugs": {
- "url": "https://github.com/npm/wrappy/issues"
- },
- "homepage": "https://github.com/npm/wrappy"
-}
diff --git a/node_modules/wrappy/wrappy.js b/node_modules/wrappy/wrappy.js
deleted file mode 100644
index bb7e7d6..0000000
--- a/node_modules/wrappy/wrappy.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// Returns a wrapper function that returns a wrapped callback
-// The wrapper function should do some stuff, and return a
-// presumably different callback function.
-// This makes sure that own properties are retained, so that
-// decorations and such are not lost along the way.
-module.exports = wrappy
-function wrappy (fn, cb) {
- if (fn && cb) return wrappy(fn)(cb)
-
- if (typeof fn !== 'function')
- throw new TypeError('need wrapper function')
-
- Object.keys(fn).forEach(function (k) {
- wrapper[k] = fn[k]
- })
-
- return wrapper
-
- function wrapper() {
- var args = new Array(arguments.length)
- for (var i = 0; i < args.length; i++) {
- args[i] = arguments[i]
- }
- var ret = fn.apply(this, args)
- var cb = args[args.length-1]
- if (typeof ret === 'function' && ret !== cb) {
- Object.keys(cb).forEach(function (k) {
- ret[k] = cb[k]
- })
- }
- return ret
- }
-}
diff --git a/package-lock.json b/package-lock.json
index dcdd257..296358b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,18 +1,19 @@
{
"name": "monocker",
- "version": "2.13.6",
+ "version": "2.13.7",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "monocker",
- "version": "2.13.6",
+ "version": "2.13.7",
"license": "MIT",
"dependencies": {
"@slack/web-api": "^7.0.4",
"axios": "^1.7.2",
"discord-webhook-node": "^1.1.8",
"dockerode": "^4.0.2",
+ "dotenv": "^16.4.7",
"express": "^4.19.2",
"gotify": "^1.1.0",
"matrix-js-sdk": "^34.9.0",
@@ -618,6 +619,18 @@
"node": ">= 8.0"
}
},
+ "node_modules/dotenv": {
+ "version": "16.4.7",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz",
+ "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==",
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://dotenvx.com"
+ }
+ },
"node_modules/duplexer3": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.5.tgz",
diff --git a/package.json b/package.json
index cfcfa90..873ce73 100644
--- a/package.json
+++ b/package.json
@@ -32,6 +32,7 @@
"axios": "^1.7.2",
"discord-webhook-node": "^1.1.8",
"dockerode": "^4.0.2",
+ "dotenv": "^16.4.7",
"express": "^4.19.2",
"gotify": "^1.1.0",
"matrix-js-sdk": "^34.9.0",