diff --git a/.env.example b/.env.example index 7fc89c40..0e149bba 100644 --- a/.env.example +++ b/.env.example @@ -1,18 +1,20 @@ # Gun db storage DATA_FILE_NAME=radata2 # Gun peer -PEERS=["http://gun.shock.network:8765/gun"] +PEERS=["https://gun.shock.network/gun","https://gun-eu.shock.network/gun"] # API Device Token MS_TO_TOKEN_EXPIRATION=4500000 -# E2EE -DISABLE_SHOCK_ENCRYPTION=false +# E2EE +SHOCK_ENCRYPTION_ECC=true CACHE_HEADERS_MANDATORY=true SHOCK_CACHE=true -# Use only if disabling LND encrypt phrase (security risk) -TRUSTED_KEYS=true # SSH Tunnel Provider LOCAL_TUNNEL_SERVER=https://tunnel.rip # Default content to your own seed server TORRENT_SEED_URL=https://webtorrent.shock.network # Admin token for your own seed server TORRENT_SEED_TOKEN=jibberish +# "default" or "hosting" +DEPLOYMENT_TYPE=hosting +# allow to create a user with unlocked lnd +ALLOW_UNLOCKED_LND=false \ No newline at end of file diff --git a/.eslintignore b/.eslintignore index 6461deec..72d042d3 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,2 @@ *.ts +/public/*.min.js \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json index 252f73b1..6d35aae7 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,10 +1,14 @@ { - "extends": ["eslint:all", "prettier", "plugin:jest/all"], - "plugins": ["prettier", "jest", "babel"], + "extends": ["eslint:all", "prettier", "plugin:mocha/recommended"], + "plugins": ["prettier", "mocha", "babel"], "rules": { "prettier/prettier": "error", "strict": "off", + "mocha/no-mocha-arrows": "off", + + "max-statements-per-line": "off", + "no-empty-function": "off", "no-console": "off", diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 6706dda6..ba493827 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,4 +1,3 @@ # These are supported funding model platforms github: [shocknet,] -custom: ['https://shock.pub/qsgziGQS99sPUxV1CRwwRckn9cG6cJ3prbDsrbL7qko.oRbCaVKwJFQURWrS1pFhkfAzrkEvkQgBRIUz9uoWtrg',] diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..ee026a26 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,30 @@ +version: 2 +updates: +- package-ecosystem: npm + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 + ignore: + - dependency-name: bitcore-lib + versions: + - 8.24.2 + - 8.25.0 + - 8.25.2 + - 8.25.3 + - 8.25.4 + - 8.25.7 + - 9.0.0 + - dependency-name: socket.io + versions: + - 3.1.0 + - dependency-name: commander + versions: + - 7.0.0 + - 7.1.0 + - dependency-name: lint-staged + versions: + - 10.5.3 + - dependency-name: eslint-plugin-prettier + versions: + - 3.3.1 diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml new file mode 100644 index 00000000..f0f566ad --- /dev/null +++ b/.github/workflows/dockerhub.yml @@ -0,0 +1,40 @@ +name: Publish Docker image + +on: + release: + types: [published] + +jobs: + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Log in to Docker Hub + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: shockwallet/api + + - name: Build and push Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 726e1641..1bb412c2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,9 +19,22 @@ jobs: repo: ['shocknet/Wizard'] runs-on: ubuntu-latest steps: - - name: Repository Dispatch + - name: 🛎️ Checkout + uses: actions/checkout@v2.3.1 + with: + persist-credentials: false + ref: ${{ github.ref }} + + - name: ⚙️ Install Dependencies + run: yarn install + + - name: 📝 Run Tests + run: yarn test + + - name: 📯 Repository Dispatch uses: peter-evans/repository-dispatch@v1 with: token: ${{ secrets.REPO_ACCESS_TOKEN }} repository: ${{ matrix.repo }} event-type: api-update + client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' diff --git a/.gitignore b/.gitignore index 81cbd001..77d816b5 100644 --- a/.gitignore +++ b/.gitignore @@ -6,10 +6,20 @@ services/auth/secrets.json # New logger date format *.log.* .directory +.DS_Store +test-radata/ radata/ radata-*.tmp *.cert *.key *-audit.json +# Yarn v2 +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions \ No newline at end of file diff --git a/.npmrc b/.npmrc new file mode 100644 index 00000000..c42da845 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +engine-strict = true diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..d4fca6f6 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v14.18.3 diff --git a/.vscode/launch.json b/.vscode/launch.json index 12ad01c9..4e5e98fa 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,14 +1,77 @@ { "configurations": [ { - "name": "Launch Program", + "name": "Attach", + "port": 9229, + "request": "attach", + "skipFiles": ["/**"], + "type": "pwa-node" + }, + { + "name": "Nodemon", "program": "${workspaceFolder}/main.js", - "args": ["-h", "0.0.0.0", "-c"], + "args": ["--", "-h", "0.0.0.0", "-c"], "request": "launch", "skipFiles": ["/**"], "type": "node", "envFile": "${workspaceFolder}/.env", - "outputCapture": "std" + "outputCapture": "std", + + // https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_restarting-debug-sessions-automatically-when-source-is-edited + // Tip: Pressing the Stop button stops the debug session and disconnects + // from Node.js, but nodemon (and Node.js) will continue to run. To stop + // nodemon, you will have to kill it from the command line (which is + // easily possible if you use the integratedTerminal as shown above). + + // Tip: In case of syntax errors, nodemon will not be able to start + // Node.js successfully until the error has been fixed. In this case, VS + // Code will continue trying to attach to Node.js but eventually give up + // (after 10 seconds). To avoid this, you can increase the timeout by + // adding a timeout attribute with a larger value (in milliseconds). + + "runtimeExecutable": "${workspaceFolder}/node_modules/nodemon/bin/nodemon.js", + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen", + "restart": true + }, + { + "name": "Nodemon+Polar", + "program": "${workspaceFolder}/main.js", + "args": [ + "--", + "-h", + "0.0.0.0", + "--trace-warnings", + "--max-old-space-size=4096", + "-c", + "-d", + "C:\\Users\\Predator\\AppData\\Local\\Lnd\\tls.cert", + "-m", + "C:\\Users\\Predator\\AppData\\Local\\Lnd\\data\\chain\\bitcoin\\mainnet\\admin.macaroon", + "--tunnel" + ], + "request": "launch", + "skipFiles": ["/**"], + "type": "node", + "envFile": "${workspaceFolder}/.env", + "outputCapture": "std", + + // https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_restarting-debug-sessions-automatically-when-source-is-edited + // Tip: Pressing the Stop button stops the debug session and disconnects + // from Node.js, but nodemon (and Node.js) will continue to run. To stop + // nodemon, you will have to kill it from the command line (which is + // easily possible if you use the integratedTerminal as shown above). + + // Tip: In case of syntax errors, nodemon will not be able to start + // Node.js successfully until the error has been fixed. In this case, VS + // Code will continue trying to attach to Node.js but eventually give up + // (after 10 seconds). To avoid this, you can increase the timeout by + // adding a timeout attribute with a larger value (in milliseconds). + + "runtimeExecutable": "${workspaceFolder}/node_modules/nodemon/bin/nodemon.js", + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen", + "restart": true } ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 38a20598..c6028c15 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,5 +3,81 @@ "typescript.tsdk": "node_modules/typescript/lib", "debug.node.autoAttach": "on", "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "esbenp.prettier-vscode", + "cSpell.words": [ + "acked", + "addinvoice", + "Authing", + "channelbalance", + "ciphertext", + "closechannel", + "closedchannels", + "Cltv", + "connectpeer", + "disconnectpeer", + "eccrypto", + "endregion", + "ephem", + "epriv", + "Epub", + "estimatefee", + "estimateroutefee", + "exportallchanbackups", + "exportchanbackup", + "falsey", + "forwardinghistory", + "getchaninfo", + "getinfo", + "getnetworkinfo", + "getnodeinfo", + "GUNRPC", + "Healthz", + "initwall", + "ISEA", + "keysend", + "kubernetes", + "listchannels", + "listinvoices", + "listpayments", + "listpeers", + "listunspent", + "lndchanbackups", + "LNDRPC", + "lndstreaming", + "lnrpc", + "lres", + "msgpack", + "newaddress", + "openchannel", + "otheruser", + "payreq", + "pendingchannels", + "preimage", + "PUBKEY", + "qrcode", + "queryroute", + "radata", + "Reqs", + "resave", + "satoshis", + "sendcoins", + "sendmany", + "sendpayment", + "sendtoroute", + "serverhost", + "serverport", + "shockping", + "SHOCKWALLET", + "signmessage", + "thenables", + "trackpayment", + "txid", + "unfollow", + "Unlocker", + "unsubscription", + "utxos", + "uuidv", + "verifymessage", + "walletbalance" + ] } diff --git a/Dockerfile b/Dockerfile index 90e3aef2..7479b4ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,18 @@ -FROM node:12.18.0-alpine3.9 +FROM node:14-buster-slim -WORKDIR /usr/src/app - - -ADD ./package.json /usr/src/app/package.json -ADD ./yarn.lock /usr/src/app/yarn.lock -#RUN useradd app && \ -# mkdir -p /home/app/.lnd -RUN apk update && apk upgrade && \ - apk add --no-cache bash git openssh -RUN yarn install - -ADD . /usr/src/app -RUN ls /usr/src/app - -RUN chmod +x ./docker-start.sh -#ADD ./tls.cert /usr/src/app/tls.cert -#ADD ./admin.macaroon /usr/src/app/admin.macaroon - -# && \ -# chown -R app:app /home/app && \ -# chown -R app:app /usr/src/app && \ -# chown -R app:app /start.sh - -#ARG lnd_address -#ENV LND_ADDR=$lnd_address EXPOSE 9835 -CMD ["./docker-start.sh"] \ No newline at end of file + +VOLUME [ "/root/.lnd", "/data" ] +RUN apt-get update && apt-get install -y apt-transport-https git + +WORKDIR /app + + +ADD ./package.json /app/package.json +ADD ./yarn.lock /app/yarn.lock + +RUN yarn + +ADD . /app + +ENTRYPOINT [ "node", "main.js" ] diff --git a/README.md b/README.md index f2ca2b81..f2f69b9a 100644 --- a/README.md +++ b/README.md @@ -1,53 +1,80 @@ -

ShockAPI

+

Lightning.Pub

-![GitHub last commit](https://img.shields.io/github/last-commit/shocknet/api?style=flat-square) +![GitHub last commit](https://img.shields.io/github/last-commit/shocknet/Lightning.Pub?style=flat-square) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) -[![Chat](https://img.shields.io/badge/chat-on%20Telegram-blue?style=flat-square)](https://t.me/Shockwallet) -[![Twitter Follow](https://img.shields.io/twitter/follow/ShockBTC?style=flat-square)](https://twitter.com/shockbtc) +[![Chat](https://img.shields.io/badge/chat-on%20Telegram-blue?style=flat-square)](https://t.me/ShockBTC) +[![Twitter Follow](https://img.shields.io/twitter/follow/ShockBTC?style=flat-square)](https://twitter.com/ShockBTC)

-This is an alpha release of the Shockwallet backend service, providing a wrapper for [LND](https://github.com/shocknet/lnd/releases) and a daemon for a decentralized social graph over [GUN](https://gun.eco/).
+`Pub` enables your Lightning node with public Web API's, providing a framework for permissionless applications that depend on Lightning. +- As a wrapper for [`LND`](https://github.com/lightningnetwork/lnd/releases), `Pub` also offers node operators Enterprise-class management capabilities. +- An optional SSL proxy service is included for ease of use through zero-configuration networking.
-Run this service on your Lightning node and connect with a mobile device or desktop browser. +#### This repository is under rapid iteration and should only be used in development. -### Easy Installation -For easy setup on your Laptop/Desktop, [a node wizard is available here.](https://github.com/shocknet/wizard) + +--- + +- [Manual Installation](#manual-installation) +- [Docker Usage](#docker-usage) +- [Node Security](#node-security) + +--- + ### Manual Installation #### Notes: * The service defaults to port `9835` * Looks for local LND in its default path -* Default gun peer is `gun.shock.network` * Change defaults in `defaults.js` -* Requires [Node.js](https://nodejs.org) 14 +* Requires [Node.js](https://nodejs.org) 16 #### Steps: -1) Run [LND](https://github.com/shocknet/lnd/releases) - *Example mainnet startup*: - -(Neutrino example requires builds with experimental flags, [our binaries](https://github.com/shocknet/lnd/releases) include them.) +1) Run [LND](https://github.com/lightningnetwork/lnd/releases) - *Example mainnet startup*: ``` ./lnd --bitcoin.active --bitcoin.mainnet --bitcoin.node=neutrino --neutrino.connect=neutrino.shock.network --routing.assumechanvalid --accept-keysend --allow-circular-route --feeurl=https://nodes.lightning.computer/fees/v1/btc-fee-estimates.json ``` -2) Download and Install API +2) Download and Install Lightning.Pub ``` -git clone https://github.com/shocknet/api -cd api +git clone https://github.com/shocknet/Lightning.Pub +cd Lightning.Pub yarn install ``` -3) Run with `yarn start` -4) Connect with Shockwallet *(Provide your nodes IP manually or scan QR from ShockWizard)* - -*Optionally, add the `--tunnel` flag to create an ssh connection through a tunnel.rip webserver for zero-configuration networking. All communication between the api and wallet is end-to-end encrypted and your privacy is protected.* +3) Run with `yarn start -t` *(`-t` is recommended but [not required](#node-security))* +4) Connect with Dashboard -### Docker for Raspberry Pi +### Docker Usage +To run `Pub` in a fully isolated environment you can use the Docker image +provided on the Docker Hub and easily interact with API's CLI interface and flags. -* [Instructions](https://gist.github.com/boufni95/3f4e1f19cf9525c3b7741b7a29f122bc) +#### Prerequisites +To use `Pub` Docker images you will need an instance of LND running, and +also if your LND related files are located in a container file system, you'll need to mount **Docker Volumes** pointed to them while starting the container. + +Example of listing available configuration flags: +``` +docker run --rm shockwallet/Lightning.Pub:latest --help +``` +Example of running an local instance with mounted volumes: +``` +docker run -v /home/$USER/.lnd:/root/.lnd --network host shockwallet/Lightning.Pub:latest +``` + +### Node Security + +`Pub` administration API's use E2E encryption bootstrapped with PAKE to prevent interception by the proxy. There are advanced or testing scenarios where you may wish to bypass this security, to do so pass the env `TRUSTED_KEYS=false` + +Communication between the administrator Dashboard and Lightning.Pub is otherwise encrypted, regardless of whether or not SSL is used, though an SSL equipped reverse proxy is recommended for better usability with web browsers. + +Running with `-t` enables the built-in SSL proxy provider for ease of use via zero-configuration networking. diff --git a/composers/windows-2network-alice/docker-compose.yml b/composers/windows-2network-alice/docker-compose.yml new file mode 100644 index 00000000..d03ab95a --- /dev/null +++ b/composers/windows-2network-alice/docker-compose.yml @@ -0,0 +1,16 @@ +version: "3.8" +networks: + default: + external: true + name: 2_default +services: + web: + image: shockwallet/api:latest + command: -c -h 0.0.0.0 -l polar-n2-alice:10009 -m /root/.lnd/data/chain/bitcoin/regtest/admin.macaroon -d /root/.lnd/tls.cert + restart: on-failure + stop_grace_period: 1m + ports: + - 9835:9835 + volumes: + - C:\Users\boufn\.polar\networks\2\volumes\lnd\alice:/root/.lnd + \ No newline at end of file diff --git a/config/defaults.js b/config/defaults.js index a44376f4..73890de2 100644 --- a/config/defaults.js +++ b/config/defaults.js @@ -47,7 +47,7 @@ module.exports = (mainnet = false) => { logfile: "shockapi.log", lndLogFile: parsePath(`${lndDirectory}/logs/bitcoin/${network}/lnd.log`), lndDirPath: lndDirectory, - peers: ['https://gun.shock.network:8765/gun'], + peers: ['https://gun.shock.network/gun','https://gun-eu.shock.network/gun'], useTLS: false, tokenExpirationMS: 259200000, localtunnelHost:'https://tunnel.rip' diff --git a/config/log.js b/config/log.js index 7b63b7a8..06214472 100644 --- a/config/log.js +++ b/config/log.js @@ -1,44 +1,58 @@ -// config/log.js +/** @prettier */ -const winston = require("winston"); -require("winston-daily-rotate-file"); +const { createLogger, transports, format } = require('winston') +const util = require('util') +require('winston-daily-rotate-file') -const winstonAttached = new Map(); +// @ts-ignore +const transform = info => { + const args = info[Symbol.for('splat')] + if (args) { + return { ...info, message: util.format(info.message, ...args) } + } + return info +} -/** - * @param {string} logFileName - * @param {string} logLevel - * @returns {import("winston").Logger} - */ -module.exports = (logFileName, logLevel) => { - if (!winstonAttached.has(logFileName)) { - winston.add(new (winston.transports.DailyRotateFile)({ - filename: logFileName, - datePattern: "yyyy-MM-DD", +const logFormatter = () => ({ transform }) + +const formatter = format.combine( + format.colorize(), + format.errors({ stack: true }), + logFormatter(), + format.prettyPrint(), + format.timestamp(), + format.simple(), + format.align(), + format.printf(info => { + const { timestamp, level, message, stack, exception } = info + + const ts = timestamp.slice(0, 19).replace('T', ' ') + const isObject = typeof message === 'object' + const formattedJson = isObject ? JSON.stringify(message, null, 2) : message + const formattedException = exception ? exception.stack : '' + const errorMessage = stack || formattedException + const formattedMessage = errorMessage ? errorMessage : formattedJson + + return `${ts} [${level}]: ${formattedMessage}` + }) +) + +const Logger = createLogger({ + format: formatter, + transports: [ + new transports.DailyRotateFile({ + filename: 'shockapi.log', + datePattern: 'yyyy-MM-DD', // https://github.com/winstonjs/winston-daily-rotate-file/issues/188 - json: true, + json: false, maxSize: 1000000, maxFiles: 7, - level: logLevel - })) - winston.add(new winston.transports.Console({ - format: winston.format.combine( - winston.format.colorize(), - winston.format.timestamp(), - winston.format.align(), - winston.format.printf((info) => { - const { - timestamp, level, message, ...args - } = info; + handleExceptions: true + }), + new transports.Console({ + handleExceptions: true + }) + ] +}) - const ts = timestamp.slice(0, 19).replace('T', ' '); - return `${ts} [${level}]: ${message} ${Object.keys(args).length ? JSON.stringify(args, null, 2) : ''}`; - }), - ) - })) - winston.level = logLevel - winstonAttached.set(logFileName, winston) - } - - return winstonAttached.get(logFileName) -} \ No newline at end of file +module.exports = Logger diff --git a/config/router.proto b/config/router.proto index 25bc765a..2743dff0 100644 --- a/config/router.proto +++ b/config/router.proto @@ -40,9 +40,10 @@ service Router { } /* - SendToRouteV2 attempts to make a payment via the specified route. This method - differs from SendPayment in that it allows users to specify a full route - manually. This can be used for things like rebalancing, and atomic swaps. + SendToRouteV2 attempts to make a payment via the specified route. This + method differs from SendPayment in that it allows users to specify a full + route manually. This can be used for things like rebalancing, and atomic + swaps. */ rpc SendToRouteV2 (SendToRouteRequest) returns (lnrpc.HTLCAttempt); @@ -60,6 +61,28 @@ service Router { rpc QueryMissionControl (QueryMissionControlRequest) returns (QueryMissionControlResponse); + /* + XImportMissionControl is an experimental API that imports the state provided + to the internal mission control's state, using all results which are more + recent than our existing values. These values will only be imported + in-memory, and will not be persisted across restarts. + */ + rpc XImportMissionControl (XImportMissionControlRequest) + returns (XImportMissionControlResponse); + + /* + GetMissionControlConfig returns mission control's current config. + */ + rpc GetMissionControlConfig (GetMissionControlConfigRequest) + returns (GetMissionControlConfigResponse); + + /* + SetMissionControlConfig will set mission control's config, if the config + provided is valid. + */ + rpc SetMissionControlConfig (SetMissionControlConfigRequest) + returns (SetMissionControlConfigResponse); + /* QueryProbability returns the current success probability estimate for a given node pair and amount. @@ -82,7 +105,7 @@ service Router { returns (stream HtlcEvent); /* - Deprecated, use SendPaymentV2. SendPayment attempts to route a payment + Deprecated, use SendPaymentV2. SendPayment attempts to route a payment described by the passed PaymentRequest to the final destination. The call returns a stream of payment status updates. */ @@ -97,6 +120,25 @@ service Router { rpc TrackPayment (TrackPaymentRequest) returns (stream PaymentStatus) { option deprecated = true; } + + /** + HtlcInterceptor dispatches a bi-directional streaming RPC in which + Forwarded HTLC requests are sent to the client and the client responds with + a boolean that tells LND if this htlc should be intercepted. + In case of interception, the htlc can be either settled, cancelled or + resumed later by using the ResolveHoldForward endpoint. + */ + rpc HtlcInterceptor (stream ForwardHtlcInterceptResponse) + returns (stream ForwardHtlcInterceptRequest); + + /* + UpdateChanStatus attempts to manually set the state of a channel + (enabled, disabled, or auto). A manual "disable" request will cause the + channel to stay disabled until a subsequent manual request of either + "enable" or "auto". + */ + rpc UpdateChanStatus (UpdateChanStatusRequest) + returns (UpdateChanStatusResponse); } message SendPaymentRequest { @@ -126,6 +168,9 @@ message SendPaymentRequest { */ int32 final_cltv_delta = 4; + // An optional payment addr to be included within the last hop of the route. + bytes payment_addr = 20; + /* A bare-bones invoice for a payment within the Lightning Network. With the details of the invoice, the sender has all the data necessary to send a @@ -226,6 +271,19 @@ message SendPaymentRequest { that show which htlcs are still in flight are suppressed. */ bool no_inflight_updates = 18; + + /* + The largest payment split that should be attempted when making a payment if + splitting is necessary. Setting this value will effectively cause lnd to + split more aggressively, vs only when it thinks it needs to. Note that this + value is in milli-satoshis. + */ + uint64 max_shard_size_msat = 21; + + /* + If set, an AMP-payment will be attempted. + */ + bool amp = 22; } message TrackPaymentRequest { @@ -299,6 +357,14 @@ message QueryMissionControlResponse { repeated PairHistory pairs = 2; } +message XImportMissionControlRequest { + // Node pair-level mission control state to be imported. + repeated PairHistory pairs = 1; +} + +message XImportMissionControlResponse { +} + // PairHistory contains the mission control state for a particular node pair. message PairHistory { // The source node pubkey of the pair. @@ -340,6 +406,67 @@ message PairData { int64 success_amt_msat = 7; } +message GetMissionControlConfigRequest { +} + +message GetMissionControlConfigResponse { + /* + Mission control's currently active config. + */ + MissionControlConfig config = 1; +} + +message SetMissionControlConfigRequest { + /* + The config to set for mission control. Note that all values *must* be set, + because the full config will be applied. + */ + MissionControlConfig config = 1; +} + +message SetMissionControlConfigResponse { +} + +message MissionControlConfig { + /* + The amount of time mission control will take to restore a penalized node + or channel back to 50% success probability, expressed in seconds. Setting + this value to a higher value will penalize failures for longer, making + mission control less likely to route through nodes and channels that we + have previously recorded failures for. + */ + uint64 half_life_seconds = 1; + + /* + The probability of success mission control should assign to hop in a route + where it has no other information available. Higher values will make mission + control more willing to try hops that we have no information about, lower + values will discourage trying these hops. + */ + float hop_probability = 2; + + /* + The importance that mission control should place on historical results, + expressed as a value in [0;1]. Setting this value to 1 will ignore all + historical payments and just use the hop probability to assess the + probability of success for each hop. A zero value ignores hop probability + completely and relies entirely on historical results, unless none are + available. + */ + float weight = 3; + + /* + The maximum number of payment results that mission control will store. + */ + uint32 maximum_payment_results = 4; + + /* + The minimum time that must have passed since the previously recorded failure + before we raise the failure amount. + */ + uint64 minimum_failure_relax_interval = 5; +} + message QueryProbabilityRequest { // The source node pubkey of the pair. bytes from_node = 1; @@ -383,6 +510,9 @@ message BuildRouteRequest { pubkey. */ repeated bytes hop_pubkeys = 4; + + // An optional payment addr to be included within the last hop of the route. + bytes payment_addr = 5; } message BuildRouteResponse { @@ -579,3 +709,90 @@ message PaymentStatus { repeated lnrpc.HTLCAttempt htlcs = 4; } +message CircuitKey { + /// The id of the channel that the is part of this circuit. + uint64 chan_id = 1; + + /// The index of the incoming htlc in the incoming channel. + uint64 htlc_id = 2; +} + +message ForwardHtlcInterceptRequest { + /* + The key of this forwarded htlc. It defines the incoming channel id and + the index in this channel. + */ + CircuitKey incoming_circuit_key = 1; + + // The incoming htlc amount. + uint64 incoming_amount_msat = 5; + + // The incoming htlc expiry. + uint32 incoming_expiry = 6; + + /* + The htlc payment hash. This value is not guaranteed to be unique per + request. + */ + bytes payment_hash = 2; + + // The requested outgoing channel id for this forwarded htlc. Because of + // non-strict forwarding, this isn't necessarily the channel over which the + // packet will be forwarded eventually. A different channel to the same peer + // may be selected as well. + uint64 outgoing_requested_chan_id = 7; + + // The outgoing htlc amount. + uint64 outgoing_amount_msat = 3; + + // The outgoing htlc expiry. + uint32 outgoing_expiry = 4; + + // Any custom records that were present in the payload. + map custom_records = 8; + + // The onion blob for the next hop + bytes onion_blob = 9; +} + +/** +ForwardHtlcInterceptResponse enables the caller to resolve a previously hold +forward. The caller can choose either to: +- `Resume`: Execute the default behavior (usually forward). +- `Reject`: Fail the htlc backwards. +- `Settle`: Settle this htlc with a given preimage. +*/ +message ForwardHtlcInterceptResponse { + /** + The key of this forwarded htlc. It defines the incoming channel id and + the index in this channel. + */ + CircuitKey incoming_circuit_key = 1; + + // The resolve action for this intercepted htlc. + ResolveHoldForwardAction action = 2; + + // The preimage in case the resolve action is Settle. + bytes preimage = 3; +} + +enum ResolveHoldForwardAction { + SETTLE = 0; + FAIL = 1; + RESUME = 2; +} + +message UpdateChanStatusRequest { + lnrpc.ChannelPoint chan_point = 1; + + ChanStatusAction action = 2; +} + +enum ChanStatusAction { + ENABLE = 0; + DISABLE = 1; + AUTO = 2; +} + +message UpdateChanStatusResponse { +} diff --git a/config/rpc.proto b/config/rpc.proto index bd681142..d3754dbe 100644 --- a/config/rpc.proto +++ b/config/rpc.proto @@ -32,8 +32,9 @@ service Lightning { rpc WalletBalance (WalletBalanceRequest) returns (WalletBalanceResponse); /* lncli: `channelbalance` - ChannelBalance returns the total funds available across all open channels - in satoshis. + ChannelBalance returns a report on the total funds across all open channels, + categorized in local/remote, pending local/remote and unsettled local/remote + balances. */ rpc ChannelBalance (ChannelBalanceRequest) returns (ChannelBalanceResponse); @@ -46,13 +47,18 @@ service Lightning { /* lncli: `estimatefee` EstimateFee asks the chain backend to estimate the fee rate and total fees for a transaction that pays to multiple specified outputs. + + When using REST, the `AddrToAmount` map type can be set by appending + `&AddrToAmount[
]=` to the URL. Unfortunately this + map type doesn't appear in the REST API documentation because of a bug in + the grpc-gateway library. */ rpc EstimateFee (EstimateFeeRequest) returns (EstimateFeeResponse); /* lncli: `sendcoins` SendCoins executes a request to send coins to a particular address. Unlike SendMany, this RPC call only allows creating a single output at a time. If - neither target_conf, or sat_per_byte are set, then the internal wallet will + neither target_conf, or sat_per_vbyte are set, then the internal wallet will consult its fee model to determine a fee for the default confirmation target. */ @@ -76,7 +82,7 @@ service Lightning { /* lncli: `sendmany` SendMany handles a request for a transaction that creates multiple specified - outputs in parallel. If neither target_conf, or sat_per_byte are set, then + outputs in parallel. If neither target_conf, or sat_per_vbyte are set, then the internal wallet will consult its fee model to determine a fee for the default confirmation target. */ @@ -135,6 +141,14 @@ service Lightning { */ rpc GetInfo (GetInfoRequest) returns (GetInfoResponse); + /** lncli: `getrecoveryinfo` + GetRecoveryInfo returns information concerning the recovery mode including + whether it's in a recovery mode, whether the recovery is finished, and the + progress made so far. + */ + rpc GetRecoveryInfo (GetRecoveryInfoRequest) + returns (GetRecoveryInfoResponse); + // TODO(roasbeef): merge with below with bool? /* lncli: `pendingchannels` PendingChannels returns a list of all the channels that are currently @@ -222,8 +236,10 @@ service Lightning { /* lncli: `abandonchannel` AbandonChannel removes all channel state from the database except for a close summary. This method can be used to get rid of permanently unusable - channels due to bugs fixed in newer versions of lnd. Only available - when in debug builds of lnd. + channels due to bugs fixed in newer versions of lnd. This method can also be + used to remove externally funded channels where the funding transaction was + never broadcast. Only available for non-externally funded channels in dev + build. */ rpc AbandonChannel (AbandonChannelRequest) returns (AbandonChannelResponse); @@ -355,6 +371,11 @@ service Lightning { satoshis. The returned route contains the full details required to craft and send an HTLC, also including the necessary information that should be present within the Sphinx packet encapsulated within the HTLC. + + When using REST, the `dest_custom_records` map type can be set by appending + `&dest_custom_records[]=` + to the URL. Unfortunately this map type doesn't appear in the REST API + documentation because of a bug in the grpc-gateway library. */ rpc QueryRoutes (QueryRoutesRequest) returns (QueryRoutesResponse); @@ -405,8 +426,9 @@ service Lightning { /* lncli: `fwdinghistory` ForwardingHistory allows the caller to query the htlcswitch for a record of all HTLCs forwarded within the target time range, and integer offset - within that time range. If no time-range is specified, then the first chunk - of the past 24 hrs of forwarding history are returned. + within that time range, for a maximum number of events. If no maximum number + of events is specified, up to 100 events will be returned. If no time-range + is specified, then events will be returned in the order that they occured. A list of forwarding events are returned. The size of each forwarding event is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB. @@ -473,6 +495,26 @@ service Lightning { offline. */ rpc BakeMacaroon (BakeMacaroonRequest) returns (BakeMacaroonResponse); + + /* lncli: `listmacaroonids` + ListMacaroonIDs returns all root key IDs that are in use. + */ + rpc ListMacaroonIDs (ListMacaroonIDsRequest) + returns (ListMacaroonIDsResponse); + + /* lncli: `deletemacaroonid` + DeleteMacaroonID deletes the specified macaroon ID and invalidates all + macaroons derived from that ID. + */ + rpc DeleteMacaroonID (DeleteMacaroonIDRequest) + returns (DeleteMacaroonIDResponse); + + /* lncli: `listpermissions` + ListPermissions lists all RPC method URIs and their required macaroon + permissions to access them. + */ + rpc ListPermissions (ListPermissionsRequest) + returns (ListPermissionsResponse); } message Utxo { @@ -541,6 +583,9 @@ message GetTransactionsRequest { default to this option. */ int32 end_height = 2; + + // An optional filter to only include transactions relevant to an account. + string account = 3; } message TransactionDetails { @@ -667,6 +712,11 @@ message SendRequest { fallback. */ repeated FeatureBit dest_features = 15; + + /* + The payment address of the generated invoice. + */ + bytes payment_addr = 16; } message SendResponse { @@ -750,6 +800,58 @@ message ChannelAcceptResponse { // The pending channel id to which this response applies. bytes pending_chan_id = 2; + + /* + An optional error to send the initiating party to indicate why the channel + was rejected. This field *should not* contain sensitive information, it will + be sent to the initiating party. This field should only be set if accept is + false, the channel will be rejected if an error is set with accept=true + because the meaning of this response is ambiguous. Limited to 500 + characters. + */ + string error = 3; + + /* + The upfront shutdown address to use if the initiating peer supports option + upfront shutdown script (see ListPeers for the features supported). Note + that the channel open will fail if this value is set for a peer that does + not support this feature bit. + */ + string upfront_shutdown = 4; + + /* + The csv delay (in blocks) that we require for the remote party. + */ + uint32 csv_delay = 5; + + /* + The reserve amount in satoshis that we require the remote peer to adhere to. + We require that the remote peer always have some reserve amount allocated to + them so that there is always a disincentive to broadcast old state (if they + hold 0 sats on their side of the channel, there is nothing to lose). + */ + uint64 reserve_sat = 6; + + /* + The maximum amount of funds in millisatoshis that we allow the remote peer + to have in outstanding htlcs. + */ + uint64 in_flight_max_msat = 7; + + /* + The maximum number of htlcs that the remote peer can offer us. + */ + uint32 max_htlc_count = 8; + + /* + The minimum value in millisatoshis for incoming htlcs on the channel. + */ + uint64 min_htlc_in = 9; + + /* + The number of confirmations we require before we consider the channel open. + */ + uint32 min_accept_depth = 10; } message ChannelPoint { @@ -798,14 +900,25 @@ message EstimateFeeRequest { // The target number of blocks that this transaction should be confirmed // by. int32 target_conf = 2; + + // The minimum number of confirmations each one of your outputs used for + // the transaction must satisfy. + int32 min_confs = 3; + + // Whether unconfirmed outputs should be used as inputs for the transaction. + bool spend_unconfirmed = 4; } message EstimateFeeResponse { // The total fee in satoshis. int64 fee_sat = 1; - // The fee rate in satoshi/byte. - int64 feerate_sat_per_byte = 2; + // Deprecated, use sat_per_vbyte. + // The fee rate in satoshi/vbyte. + int64 feerate_sat_per_byte = 2 [deprecated = true]; + + // The fee rate in satoshi/vbyte. + uint64 sat_per_vbyte = 3; } message SendManyRequest { @@ -816,12 +929,24 @@ message SendManyRequest { // by. int32 target_conf = 3; - // A manual fee rate set in sat/byte that should be used when crafting the + // A manual fee rate set in sat/vbyte that should be used when crafting the // transaction. - int64 sat_per_byte = 5; + uint64 sat_per_vbyte = 4; + + // Deprecated, use sat_per_vbyte. + // A manual fee rate set in sat/vbyte that should be used when crafting the + // transaction. + int64 sat_per_byte = 5 [deprecated = true]; // An optional label for the transaction, limited to 500 characters. string label = 6; + + // The minimum number of confirmations each one of your outputs used for + // the transaction must satisfy. + int32 min_confs = 7; + + // Whether unconfirmed outputs should be used as inputs for the transaction. + bool spend_unconfirmed = 8; } message SendManyResponse { // The id of the transaction @@ -839,9 +964,14 @@ message SendCoinsRequest { // by. int32 target_conf = 3; - // A manual fee rate set in sat/byte that should be used when crafting the + // A manual fee rate set in sat/vbyte that should be used when crafting the // transaction. - int64 sat_per_byte = 5; + uint64 sat_per_vbyte = 4; + + // Deprecated, use sat_per_vbyte. + // A manual fee rate set in sat/vbyte that should be used when crafting the + // transaction. + int64 sat_per_byte = 5 [deprecated = true]; /* If set, then the amount field will be ignored, and lnd will attempt to @@ -852,6 +982,13 @@ message SendCoinsRequest { // An optional label for the transaction, limited to 500 characters. string label = 7; + + // The minimum number of confirmations each one of your outputs used for + // the transaction must satisfy. + int32 min_confs = 8; + + // Whether unconfirmed outputs should be used as inputs for the transaction. + bool spend_unconfirmed = 9; } message SendCoinsResponse { // The transaction ID of the transaction @@ -864,6 +1001,9 @@ message ListUnspentRequest { // The maximum number of confirmations to be included. int32 max_confs = 2; + + // An optional filter to only include outputs belonging to an account. + string account = 3; } message ListUnspentResponse { // A list of utxos @@ -884,8 +1024,14 @@ enum AddressType { } message NewAddressRequest { - // The address type + // The type of address to generate. AddressType type = 1; + + /* + The name of the account to generate a new address for. If empty, the + default wallet account is used. + */ + string account = 2; } message NewAddressResponse { // The newly generated wallet address @@ -929,6 +1075,12 @@ message ConnectPeerRequest { /* If set, the daemon will attempt to persistently connect to the target * peer. Otherwise, the call will be synchronous. */ bool perm = 2; + + /* + The connection timeout value (in seconds) for this request. It won't affect + other requests. + */ + uint64 timeout = 3; } message ConnectPeerResponse { } @@ -945,6 +1097,21 @@ message HTLC { int64 amount = 2; bytes hash_lock = 3; uint32 expiration_height = 4; + + // Index identifying the htlc on the channel. + uint64 htlc_index = 5; + + // If this HTLC is involved in a forwarding operation, this field indicates + // the forwarding channel. For an outgoing htlc, it is the incoming channel. + // For an incoming htlc, it is the outgoing channel. When the htlc + // originates from this node or this node is the final destination, + // forwarding_channel will be zero. The forwarding channel will also be zero + // for htlcs that need to be forwarded but don't have a forwarding decision + // persisted yet. + uint64 forwarding_channel = 6; + + // Index identifying the htlc on the forwarding channel. + uint64 forwarding_htlc_index = 7; } enum CommitmentType { @@ -975,6 +1142,30 @@ enum CommitmentType { UNKNOWN_COMMITMENT_TYPE = 999; } +message ChannelConstraints { + /* + The CSV delay expressed in relative blocks. If the channel is force closed, + we will need to wait for this many blocks before we can regain our funds. + */ + uint32 csv_delay = 1; + + // The minimum satoshis this node is required to reserve in its balance. + uint64 chan_reserve_sat = 2; + + // The dust limit (in satoshis) of the initiator's commitment tx. + uint64 dust_limit_sat = 3; + + // The maximum amount of coins in millisatoshis that can be pending in this + // channel. + uint64 max_pending_amt_msat = 4; + + // The smallest HTLC in millisatoshis that the initiator will accept. + uint64 min_htlc_msat = 5; + + // The total number of incoming HTLC's that the initiator will accept. + uint32 max_accepted_htlcs = 6; +} + message Channel { // Whether this channel is active or not bool active = 1; @@ -1047,10 +1238,11 @@ message Channel { repeated HTLC pending_htlcs = 15; /* - The CSV delay expressed in relative blocks. If the channel is force closed, - we will need to wait for this many blocks before we can regain our funds. + Deprecated. The CSV delay expressed in relative blocks. If the channel is + force closed, we will need to wait for this many blocks before we can regain + our funds. */ - uint32 csv_delay = 16; + uint32 csv_delay = 16 [deprecated = true]; // Whether this channel is advertised to the network or not. bool private = 17; @@ -1061,13 +1253,15 @@ message Channel { // A set of flags showing the current state of the channel. string chan_status_flags = 19; - // The minimum satoshis this node is required to reserve in its balance. - int64 local_chan_reserve_sat = 20; + // Deprecated. The minimum satoshis this node is required to reserve in its + // balance. + int64 local_chan_reserve_sat = 20 [deprecated = true]; /* - The minimum satoshis the other node is required to reserve in its balance. + Deprecated. The minimum satoshis the other node is required to reserve in + its balance. */ - int64 remote_chan_reserve_sat = 21; + int64 remote_chan_reserve_sat = 21 [deprecated = true]; // Deprecated. Use commitment_type. bool static_remote_key = 22 [deprecated = true]; @@ -1112,9 +1306,17 @@ message Channel { frozen channel doest not allow a cooperative channel close by the initiator. The thaw_height is the height that this restriction stops applying to the channel. This field is optional, not setting it or using a - value of zero will mean the channel has no additional restrictions. + value of zero will mean the channel has no additional restrictions. The + height can be interpreted in two ways: as a relative height if the value is + less than 500,000, or as an absolute height otherwise. */ uint32 thaw_height = 28; + + // List constraints for the local node. + ChannelConstraints local_constraints = 29; + + // List constraints for the remote node. + ChannelConstraints remote_constraints = 30; } message ListChannelsRequest { @@ -1196,6 +1398,79 @@ message ChannelCloseSummary { force closes, although only one party's close will be confirmed on chain. */ Initiator close_initiator = 12; + + repeated Resolution resolutions = 13; +} + +enum ResolutionType { + TYPE_UNKNOWN = 0; + + // We resolved an anchor output. + ANCHOR = 1; + + /* + We are resolving an incoming htlc on chain. This if this htlc is + claimed, we swept the incoming htlc with the preimage. If it is timed + out, our peer swept the timeout path. + */ + INCOMING_HTLC = 2; + + /* + We are resolving an outgoing htlc on chain. If this htlc is claimed, + the remote party swept the htlc with the preimage. If it is timed out, + we swept it with the timeout path. + */ + OUTGOING_HTLC = 3; + + // We force closed and need to sweep our time locked commitment output. + COMMIT = 4; +} + +enum ResolutionOutcome { + // Outcome unknown. + OUTCOME_UNKNOWN = 0; + + // An output was claimed on chain. + CLAIMED = 1; + + // An output was left unclaimed on chain. + UNCLAIMED = 2; + + /* + ResolverOutcomeAbandoned indicates that an output that we did not + claim on chain, for example an anchor that we did not sweep and a + third party claimed on chain, or a htlc that we could not decode + so left unclaimed. + */ + ABANDONED = 3; + + /* + If we force closed our channel, our htlcs need to be claimed in two + stages. This outcome represents the broadcast of a timeout or success + transaction for this two stage htlc claim. + */ + FIRST_STAGE = 4; + + // A htlc was timed out on chain. + TIMEOUT = 5; +} + +message Resolution { + // The type of output we are resolving. + ResolutionType resolution_type = 1; + + // The outcome of our on chain action that resolved the outpoint. + ResolutionOutcome outcome = 2; + + // The outpoint that was spent by the resolution. + OutPoint outpoint = 3; + + // The amount that was claimed by the resolution. + uint64 amount_sat = 4; + + // The hex-encoded transaction ID of the sweep transaction that spent the + // output. + string sweep_txid = 5; } message ClosedChannelsRequest { @@ -1251,6 +1526,11 @@ message Peer { Denotes that we are not receiving new graph updates from the peer. */ PASSIVE_SYNC = 2; + + /* + Denotes that this peer is pinned into an active sync. + */ + PINNED_SYNC = 3; } // The type of sync we are currently performing with this peer. @@ -1267,6 +1547,20 @@ message Peer { spamming us with errors at no cost. */ repeated TimestampedError errors = 12; + + /* + The number of times we have recorded this peer going offline or coming + online, recorded across restarts. Note that this value is decreased over + time if the peer has not recently flapped, so that we can forgive peers + with historically high flap counts. + */ + int32 flap_count = 13; + + /* + The timestamp of the last flap we observed for this peer. If this value is + zero, we have not observed any flaps for this peer. + */ + int64 last_flap_ns = 14; } message TimestampedError { @@ -1371,6 +1665,19 @@ message GetInfoResponse { map features = 19; } +message GetRecoveryInfoRequest { +} +message GetRecoveryInfoResponse { + // Whether the wallet is in recovery mode + bool recovery_mode = 1; + + // Whether the wallet recovery progress is finished + bool recovery_finished = 2; + + // The recovery progress, ranging from 0 to 1. + double progress = 3; +} + message Chain { // The blockchain the node is on (eg bitcoin, litecoin) string chain = 1; @@ -1412,9 +1719,10 @@ message CloseChannelRequest { // confirmed by. int32 target_conf = 3; - // A manual fee rate set in sat/byte that should be used when crafting the + // Deprecated, use sat_per_vbyte. + // A manual fee rate set in sat/vbyte that should be used when crafting the // closure transaction. - int64 sat_per_byte = 4; + int64 sat_per_byte = 4 [deprecated = true]; /* An optional address to send funds to in the case of a cooperative close. @@ -1423,6 +1731,10 @@ message CloseChannelRequest { to the upfront shutdown addresss. */ string delivery_address = 5; + + // A manual fee rate set in sat/vbyte that should be used when crafting the + // closure transaction. + uint64 sat_per_vbyte = 6; } message CloseStatusUpdate { @@ -1460,6 +1772,10 @@ message ReadyForPsbtFunding { } message OpenChannelRequest { + // A manual fee rate set in sat/vbyte that should be used when crafting the + // funding transaction. + uint64 sat_per_vbyte = 1; + /* The pubkey of the node to open a channel with. When using REST, this field must be encoded as base64. @@ -1483,9 +1799,10 @@ message OpenChannelRequest { // confirmed by. int32 target_conf = 6; - // A manual fee rate set in sat/byte that should be used when crafting the + // Deprecated, use sat_per_vbyte. + // A manual fee rate set in sat/vbyte that should be used when crafting the // funding transaction. - int64 sat_per_byte = 7; + int64 sat_per_byte = 7 [deprecated = true]; // Whether this channel should be private, not announced to the greater // network. @@ -1527,6 +1844,24 @@ message OpenChannelRequest { carried out in an interactive manner (PSBT based). */ FundingShim funding_shim = 14; + + /* + The maximum amount of coins in millisatoshi that can be pending within + the channel. It only applies to the remote party. + */ + uint64 remote_max_value_in_flight_msat = 15; + + /* + The maximum number of concurrent HTLCs we will allow the remote party to add + to the commitment transaction. + */ + uint32 remote_max_htlcs = 16; + + /* + Max local csv is the maximum csv delay we will allow for our own commitment + transaction. + */ + uint32 max_local_csv = 17; } message OpenStatusUpdate { oneof update { @@ -1601,10 +1936,11 @@ message ChanPointShim { bytes pending_chan_id = 5; /* - This uint32 indicates if this channel is to be considered 'frozen'. A - frozen channel does not allow a cooperative channel close by the - initiator. The thaw_height is the height that this restriction stops - applying to the channel. + This uint32 indicates if this channel is to be considered 'frozen'. A frozen + channel does not allow a cooperative channel close by the initiator. The + thaw_height is the height that this restriction stops applying to the + channel. The height can be interpreted in two ways: as a relative height if + the value is less than 500,000, or as an absolute height otherwise. */ uint32 thaw_height = 6; } @@ -1622,6 +1958,16 @@ message PsbtShim { non-empty, it must be a binary serialized PSBT. */ bytes base_psbt = 2; + + /* + If a channel should be part of a batch (multiple channel openings in one + transaction), it can be dangerous if the whole batch transaction is + published too early before all channel opening negotiations are completed. + This flag prevents this particular channel from broadcasting the transaction + after the negotiation with the remote peer. In a batch of channel openings + this flag should be set to true for every channel but the very last. + */ + bool no_publish = 3; } message FundingShim { @@ -1661,12 +2007,19 @@ message FundingPsbtFinalize { /* The funded PSBT that contains all witness data to send the exact channel capacity amount to the PK script returned in the open channel message in a - previous step. + previous step. Cannot be set at the same time as final_raw_tx. */ bytes signed_psbt = 1; // The pending channel ID of the channel to get the PSBT for. bytes pending_chan_id = 2; + + /* + As an alternative to the signed PSBT with all witness data, the final raw + wire format transaction can also be specified directly. Cannot be set at the + same time as signed_psbt. + */ + bytes final_raw_tx = 3; } message FundingTransitionMsg { @@ -1909,8 +2262,17 @@ message ChannelEventUpdate { UpdateType type = 5; } +message WalletAccountBalance { + // The confirmed balance of the account (with >= 1 confirmations). + int64 confirmed_balance = 1; + + // The unconfirmed balance of the account (with 0 confirmations). + int64 unconfirmed_balance = 2; +} + message WalletBalanceRequest { } + message WalletBalanceResponse { // The balance of the wallet int64 total_balance = 1; @@ -1920,16 +2282,45 @@ message WalletBalanceResponse { // The unconfirmed balance of a wallet(with 0 confirmations) int64 unconfirmed_balance = 3; + + // A mapping of each wallet account's name to its balance. + map account_balance = 4; +} + +message Amount { + // Value denominated in satoshis. + uint64 sat = 1; + + // Value denominated in milli-satoshis. + uint64 msat = 2; } message ChannelBalanceRequest { } message ChannelBalanceResponse { - // Sum of channels balances denominated in satoshis - int64 balance = 1; + // Deprecated. Sum of channels balances denominated in satoshis + int64 balance = 1 [deprecated = true]; - // Sum of channels pending balances denominated in satoshis - int64 pending_open_balance = 2; + // Deprecated. Sum of channels pending balances denominated in satoshis + int64 pending_open_balance = 2 [deprecated = true]; + + // Sum of channels local balances. + Amount local_balance = 3; + + // Sum of channels remote balances. + Amount remote_balance = 4; + + // Sum of channels local unsettled balances. + Amount unsettled_local_balance = 5; + + // Sum of channels remote unsettled balances. + Amount unsettled_remote_balance = 6; + + // Sum of channels pending local balances. + Amount pending_open_local_balance = 7; + + // Sum of channels pending remote balances. + Amount pending_open_remote_balance = 8; } message QueryRoutesRequest { @@ -2088,7 +2479,7 @@ message Hop { output index for the channel. */ uint64 chan_id = 1 [jstype = JS_STRING]; - int64 chan_capacity = 2; + int64 chan_capacity = 2 [deprecated = true]; int64 amt_to_forward = 3 [deprecated = true]; int64 fee = 4 [deprecated = true]; uint32 expiry = 5; @@ -2110,12 +2501,22 @@ message Hop { /* An optional TLV record that signals the use of an MPP payment. If present, - the receiver will enforce that that the same mpp_record is included in the - final hop payload of all non-zero payments in the HTLC set. If empty, a - regular single-shot payment is or was attempted. + the receiver will enforce that the same mpp_record is included in the final + hop payload of all non-zero payments in the HTLC set. If empty, a regular + single-shot payment is or was attempted. */ MPPRecord mpp_record = 10; + /* + An optional TLV record that signals the use of an AMP payment. If present, + the receiver will treat all received payments including the same + (payment_addr, set_id) pair as being part of one logical payment. The + payment will be settled by XORing the root_share's together and deriving the + child hashes and preimages according to BOLT XX. Must be used in conjunction + with mpp_record. + */ + AMPRecord amp_record = 12; + /* An optional set of key-value TLV records. This is useful within the context of the SendToRoute call as it allows callers to specify arbitrary K-V pairs @@ -2142,6 +2543,14 @@ message MPPRecord { int64 total_amt_msat = 10; } +message AMPRecord { + bytes root_share = 1; + + bytes set_id = 2; + + uint32 child_index = 3; +} + /* A path through the channel graph which runs over one or more channels in succession. This struct carries all the information required to craft the @@ -2367,11 +2776,27 @@ message GraphTopologyUpdate { repeated ClosedChannelUpdate closed_chans = 3; } message NodeUpdate { - repeated string addresses = 1; + /* + Deprecated, use node_addresses. + */ + repeated string addresses = 1 [deprecated = true]; + string identity_key = 2; - bytes global_features = 3; + + /* + Deprecated, use features. + */ + bytes global_features = 3 [deprecated = true]; + string alias = 4; string color = 5; + repeated NodeAddress node_addresses = 7; + + /* + Features that the node has advertised in the init message, node + announcements and invoices. + */ + map features = 6; } message ChannelEdgeUpdate { /* @@ -2572,6 +2997,18 @@ message Invoice { [EXPERIMENTAL]. */ bool is_keysend = 25; + + /* + The payment address of this invoice. This value will be used in MPP + payments, and also for newer invoies that always require the MPP paylaod + for added end-to-end security. + */ + bytes payment_addr = 26; + + /* + Signals whether or not this is an AMP invoice. + */ + bool is_amp = 27; } enum InvoiceHTLCState { @@ -2611,6 +3048,31 @@ message InvoiceHTLC { // The total amount of the mpp payment in msat. uint64 mpp_total_amt_msat = 10; + + // Details relevant to AMP HTLCs, only populated if this is an AMP HTLC. + AMP amp = 11; +} + +// Details specific to AMP HTLCs. +message AMP { + // An n-of-n secret share of the root seed from which child payment hashes + // and preimages are derived. + bytes root_share = 1; + + // An identifier for the HTLC set that this HTLC belongs to. + bytes set_id = 2; + + // A nonce used to randomize the child preimage and child hash from a given + // root_share. + uint32 child_index = 3; + + // The payment hash of the AMP HTLC. + bytes hash = 4; + + // The preimage used to settle this AMP htlc. This field will only be + // populated if the invoice is in InvoiceState_ACCEPTED or + // InvoiceState_SETTLED. + bytes preimage = 5; } message AddInvoiceResponse { @@ -2630,6 +3092,13 @@ message AddInvoiceResponse { invoices with an add_index greater than this one. */ uint64 add_index = 16; + + /* + The payment address of the generated invoice. This value should be used + in all payments for this invoice as we require it for end to end + security. + */ + bytes payment_addr = 17; } message PaymentHash { /* @@ -2801,6 +3270,9 @@ message Payment { } message HTLCAttempt { + // The unique ID that is used for this attempt. + uint64 attempt_id = 7; + enum HTLCStatus { IN_FLIGHT = 0; SUCCEEDED = 1; @@ -2876,6 +3348,13 @@ message ListPaymentsResponse { } message DeleteAllPaymentsRequest { + // Only delete failed payments. + bool failed_payments_only = 1; + + /* + Only delete failed HTLCs from payments, not the payment itself. + */ + bool failed_htlcs_only = 2; } message DeleteAllPaymentsResponse { @@ -2883,6 +3362,8 @@ message DeleteAllPaymentsResponse { message AbandonChannelRequest { ChannelPoint channel_point = 1; + + bool pending_funding_shim_only = 2; } message AbandonChannelResponse { @@ -2934,6 +3415,14 @@ enum FeatureBit { PAYMENT_ADDR_OPT = 15; MPP_REQ = 16; MPP_OPT = 17; + WUMBO_CHANNELS_REQ = 18; + WUMBO_CHANNELS_OPT = 19; + ANCHORS_REQ = 20; + ANCHORS_OPT = 21; + ANCHORS_ZERO_FEE_HTLC_REQ = 22; + ANCHORS_ZERO_FEE_HTLC_OPT = 23; + AMP_REQ = 30; + AMP_OPT = 31; } message Feature { @@ -3034,8 +3523,8 @@ message ForwardingHistoryRequest { } message ForwardingEvent { // Timestamp is the time (unix epoch offset) that this circuit was - // completed. - uint64 timestamp = 1; + // completed. Deprecated by timestamp_ns. + uint64 timestamp = 1 [deprecated = true]; // The incoming channel ID that carried the HTLC that created the circuit. uint64 chan_id_in = 2 [jstype = JS_STRING]; @@ -3066,6 +3555,10 @@ message ForwardingEvent { // the second half of the circuit. uint64 amt_out_msat = 10; + // The number of nanoseconds elapsed since January 1, 1970 UTC when this + // circuit was completed. + uint64 timestamp_ns = 11; + // TODO(roasbeef): add settlement latency? // * use FPE on the chan id? // * also list failures? @@ -3171,12 +3664,46 @@ message MacaroonPermission { message BakeMacaroonRequest { // The list of permissions the new macaroon should grant. repeated MacaroonPermission permissions = 1; + + // The root key ID used to create the macaroon, must be a positive integer. + uint64 root_key_id = 2; } message BakeMacaroonResponse { // The hex encoded macaroon, serialized in binary format. string macaroon = 1; } +message ListMacaroonIDsRequest { +} +message ListMacaroonIDsResponse { + // The list of root key IDs that are in use. + repeated uint64 root_key_ids = 1; +} + +message DeleteMacaroonIDRequest { + // The root key ID to be removed. + uint64 root_key_id = 1; +} +message DeleteMacaroonIDResponse { + // A boolean indicates that the deletion is successful. + bool deleted = 1; +} + +message MacaroonPermissionList { + // A list of macaroon permissions. + repeated MacaroonPermission permissions = 1; +} + +message ListPermissionsRequest { +} +message ListPermissionsResponse { + /* + A map between all RPC method URIs and their required macaroon permissions to + access them. + */ + map method_permissions = 1; +} + message Failure { enum FailureCode { /* @@ -3209,6 +3736,7 @@ message Failure { PERMANENT_CHANNEL_FAILURE = 21; EXPIRY_TOO_FAR = 22; MPP_TIMEOUT = 23; + INVALID_ONION_PAYLOAD = 24; /* An internal error occurred. @@ -3339,3 +3867,14 @@ message ChannelUpdate { */ bytes extra_opaque_data = 12; } + +message MacaroonId { + bytes nonce = 1; + bytes storageId = 2; + repeated Op ops = 3; +} + +message Op { + string entity = 1; + repeated string actions = 2; +} diff --git a/config/rpc.proto.old b/config/rpc.proto.old deleted file mode 100644 index 453787a2..00000000 --- a/config/rpc.proto.old +++ /dev/null @@ -1,2798 +0,0 @@ -syntax = "proto3"; - - -package lnrpc; - -option go_package = "github.com/lightningnetwork/lnd/lnrpc"; - -/** - * Comments in this file will be directly parsed into the API - * Documentation as descriptions of the associated method, message, or field. - * These descriptions should go right above the definition of the object, and - * can be in either block or /// comment format. - * - * One edge case exists where a // comment followed by a /// comment in the - * next line will cause the description not to show up in the documentation. In - * that instance, simply separate the two comments with a blank line. - * - * An RPC method can be matched to an lncli command by placing a line in the - * beginning of the description in exactly the following format: - * lncli: `methodname` - * - * Failure to specify the exact name of the command will cause documentation - * generation to fail. - * - * More information on how exactly the gRPC documentation is generated from - * this proto file can be found here: - * https://github.com/lightninglabs/lightning-api - */ - -// The WalletUnlocker service is used to set up a wallet password for -// lnd at first startup, and unlock a previously set up wallet. -service WalletUnlocker { - /** - GenSeed is the first method that should be used to instantiate a new lnd - instance. This method allows a caller to generate a new aezeed cipher seed - given an optional passphrase. If provided, the passphrase will be necessary - to decrypt the cipherseed to expose the internal wallet seed. - - Once the cipherseed is obtained and verified by the user, the InitWallet - method should be used to commit the newly generated seed, and create the - wallet. - */ - rpc GenSeed(GenSeedRequest) returns (GenSeedResponse) { - option (google.api.http) = { - get: "/v1/genseed" - }; - } - - /** - InitWallet is used when lnd is starting up for the first time to fully - initialize the daemon and its internal wallet. At the very least a wallet - password must be provided. This will be used to encrypt sensitive material - on disk. - - In the case of a recovery scenario, the user can also specify their aezeed - mnemonic and passphrase. If set, then the daemon will use this prior state - to initialize its internal wallet. - - Alternatively, this can be used along with the GenSeed RPC to obtain a - seed, then present it to the user. Once it has been verified by the user, - the seed can be fed into this RPC in order to commit the new wallet. - */ - rpc InitWallet(InitWalletRequest) returns (InitWalletResponse) { - option (google.api.http) = { - post: "/v1/initwallet" - body: "*" - }; - } - - /** lncli: `unlock` - UnlockWallet is used at startup of lnd to provide a password to unlock - the wallet database. - */ - rpc UnlockWallet(UnlockWalletRequest) returns (UnlockWalletResponse) { - option (google.api.http) = { - post: "/v1/unlockwallet" - body: "*" - }; - } - - /** lncli: `changepassword` - ChangePassword changes the password of the encrypted wallet. This will - automatically unlock the wallet database if successful. - */ - rpc ChangePassword (ChangePasswordRequest) returns (ChangePasswordResponse) { - option (google.api.http) = { - post: "/v1/changepassword" - body: "*" - }; - } -} - -message GenSeedRequest { - /** - aezeed_passphrase is an optional user provided passphrase that will be used - to encrypt the generated aezeed cipher seed. When using REST, this field - must be encoded as base64. - */ - bytes aezeed_passphrase = 1; - - /** - seed_entropy is an optional 16-bytes generated via CSPRNG. If not - specified, then a fresh set of randomness will be used to create the seed. - When using REST, this field must be encoded as base64. - */ - bytes seed_entropy = 2; -} -message GenSeedResponse { - /** - cipher_seed_mnemonic is a 24-word mnemonic that encodes a prior aezeed - cipher seed obtained by the user. This field is optional, as if not - provided, then the daemon will generate a new cipher seed for the user. - Otherwise, then the daemon will attempt to recover the wallet state linked - to this cipher seed. - */ - repeated string cipher_seed_mnemonic = 1; - - /** - enciphered_seed are the raw aezeed cipher seed bytes. This is the raw - cipher text before run through our mnemonic encoding scheme. - */ - bytes enciphered_seed = 2; -} - -message InitWalletRequest { - /** - wallet_password is the passphrase that should be used to encrypt the - wallet. This MUST be at least 8 chars in length. After creation, this - password is required to unlock the daemon. When using REST, this field - must be encoded as base64. - */ - bytes wallet_password = 1; - - /** - cipher_seed_mnemonic is a 24-word mnemonic that encodes a prior aezeed - cipher seed obtained by the user. This may have been generated by the - GenSeed method, or be an existing seed. - */ - repeated string cipher_seed_mnemonic = 2; - - /** - aezeed_passphrase is an optional user provided passphrase that will be used - to encrypt the generated aezeed cipher seed. When using REST, this field - must be encoded as base64. - */ - bytes aezeed_passphrase = 3; - - /** - recovery_window is an optional argument specifying the address lookahead - when restoring a wallet seed. The recovery window applies to each - individual branch of the BIP44 derivation paths. Supplying a recovery - window of zero indicates that no addresses should be recovered, such after - the first initialization of the wallet. - */ - int32 recovery_window = 4; - - /** - channel_backups is an optional argument that allows clients to recover the - settled funds within a set of channels. This should be populated if the - user was unable to close out all channels and sweep funds before partial or - total data loss occurred. If specified, then after on-chain recovery of - funds, lnd begin to carry out the data loss recovery protocol in order to - recover the funds in each channel from a remote force closed transaction. - */ - ChanBackupSnapshot channel_backups = 5; -} -message InitWalletResponse { -} - -message UnlockWalletRequest { - /** - wallet_password should be the current valid passphrase for the daemon. This - will be required to decrypt on-disk material that the daemon requires to - function properly. When using REST, this field must be encoded as base64. - */ - bytes wallet_password = 1; - - /** - recovery_window is an optional argument specifying the address lookahead - when restoring a wallet seed. The recovery window applies to each - individual branch of the BIP44 derivation paths. Supplying a recovery - window of zero indicates that no addresses should be recovered, such after - the first initialization of the wallet. - */ - int32 recovery_window = 2; - - /** - channel_backups is an optional argument that allows clients to recover the - settled funds within a set of channels. This should be populated if the - user was unable to close out all channels and sweep funds before partial or - total data loss occurred. If specified, then after on-chain recovery of - funds, lnd begin to carry out the data loss recovery protocol in order to - recover the funds in each channel from a remote force closed transaction. - */ - ChanBackupSnapshot channel_backups = 3; -} -message UnlockWalletResponse {} - -message ChangePasswordRequest { - /** - current_password should be the current valid passphrase used to unlock the - daemon. When using REST, this field must be encoded as base64. - */ - bytes current_password = 1; - - /** - new_password should be the new passphrase that will be needed to unlock the - daemon. When using REST, this field must be encoded as base64. - */ - bytes new_password = 2; -} -message ChangePasswordResponse {} - -service Lightning { - /** lncli: `walletbalance` - WalletBalance returns total unspent outputs(confirmed and unconfirmed), all - confirmed unspent outputs and all unconfirmed unspent outputs under control - of the wallet. - */ - rpc WalletBalance (WalletBalanceRequest) returns (WalletBalanceResponse) { - option (google.api.http) = { - get: "/v1/balance/blockchain" - }; - } - - /** lncli: `channelbalance` - ChannelBalance returns the total funds available across all open channels - in satoshis. - */ - rpc ChannelBalance (ChannelBalanceRequest) returns (ChannelBalanceResponse) { - option (google.api.http) = { - get: "/v1/balance/channels" - }; - } - - /** lncli: `listchaintxns` - GetTransactions returns a list describing all the known transactions - relevant to the wallet. - */ - rpc GetTransactions (GetTransactionsRequest) returns (TransactionDetails) { - option (google.api.http) = { - get: "/v1/transactions" - }; - } - - /** lncli: `estimatefee` - EstimateFee asks the chain backend to estimate the fee rate and total fees - for a transaction that pays to multiple specified outputs. - */ - rpc EstimateFee (EstimateFeeRequest) returns (EstimateFeeResponse) { - option (google.api.http) = { - get: "/v1/transactions/fee" - }; - } - - /** lncli: `sendcoins` - SendCoins executes a request to send coins to a particular address. Unlike - SendMany, this RPC call only allows creating a single output at a time. If - neither target_conf, or sat_per_byte are set, then the internal wallet will - consult its fee model to determine a fee for the default confirmation - target. - */ - rpc SendCoins (SendCoinsRequest) returns (SendCoinsResponse) { - option (google.api.http) = { - post: "/v1/transactions" - body: "*" - }; - } - - /** lncli: `listunspent` - ListUnspent returns a list of all utxos spendable by the wallet with a - number of confirmations between the specified minimum and maximum. - */ - rpc ListUnspent (ListUnspentRequest) returns (ListUnspentResponse) { - option (google.api.http) = { - get: "/v1/utxos" - }; - } - - /** - SubscribeTransactions creates a uni-directional stream from the server to - the client in which any newly discovered transactions relevant to the - wallet are sent over. - */ - rpc SubscribeTransactions (GetTransactionsRequest) returns (stream Transaction); - - /** lncli: `sendmany` - SendMany handles a request for a transaction that creates multiple specified - outputs in parallel. If neither target_conf, or sat_per_byte are set, then - the internal wallet will consult its fee model to determine a fee for the - default confirmation target. - */ - rpc SendMany (SendManyRequest) returns (SendManyResponse); - - /** lncli: `newaddress` - NewAddress creates a new address under control of the local wallet. - */ - rpc NewAddress (NewAddressRequest) returns (NewAddressResponse) { - option (google.api.http) = { - get: "/v1/newaddress" - }; - } - - /** lncli: `signmessage` - SignMessage signs a message with this node's private key. The returned - signature string is `zbase32` encoded and pubkey recoverable, meaning that - only the message digest and signature are needed for verification. - */ - rpc SignMessage (SignMessageRequest) returns (SignMessageResponse) { - option (google.api.http) = { - post: "/v1/signmessage" - body: "*" - }; - } - - /** lncli: `verifymessage` - VerifyMessage verifies a signature over a msg. The signature must be - zbase32 encoded and signed by an active node in the resident node's - channel database. In addition to returning the validity of the signature, - VerifyMessage also returns the recovered pubkey from the signature. - */ - rpc VerifyMessage (VerifyMessageRequest) returns (VerifyMessageResponse) { - option (google.api.http) = { - post: "/v1/verifymessage" - body: "*" - }; - } - - /** lncli: `connect` - ConnectPeer attempts to establish a connection to a remote peer. This is at - the networking level, and is used for communication between nodes. This is - distinct from establishing a channel with a peer. - */ - rpc ConnectPeer (ConnectPeerRequest) returns (ConnectPeerResponse) { - option (google.api.http) = { - post: "/v1/peers" - body: "*" - }; - } - - /** lncli: `disconnect` - DisconnectPeer attempts to disconnect one peer from another identified by a - given pubKey. In the case that we currently have a pending or active channel - with the target peer, then this action will be not be allowed. - */ - rpc DisconnectPeer (DisconnectPeerRequest) returns (DisconnectPeerResponse) { - option (google.api.http) = { - delete: "/v1/peers/{pub_key}" - }; - } - - /** lncli: `listpeers` - ListPeers returns a verbose listing of all currently active peers. - */ - rpc ListPeers (ListPeersRequest) returns (ListPeersResponse) { - option (google.api.http) = { - get: "/v1/peers" - }; - } - - /** lncli: `getinfo` - GetInfo returns general information concerning the lightning node including - it's identity pubkey, alias, the chains it is connected to, and information - concerning the number of open+pending channels. - */ - rpc GetInfo (GetInfoRequest) returns (GetInfoResponse) { - option (google.api.http) = { - get: "/v1/getinfo" - }; - } - - // TODO(roasbeef): merge with below with bool? - /** lncli: `pendingchannels` - PendingChannels returns a list of all the channels that are currently - considered "pending". A channel is pending if it has finished the funding - workflow and is waiting for confirmations for the funding txn, or is in the - process of closure, either initiated cooperatively or non-cooperatively. - */ - rpc PendingChannels (PendingChannelsRequest) returns (PendingChannelsResponse) { - option (google.api.http) = { - get: "/v1/channels/pending" - }; - } - - /** lncli: `listchannels` - ListChannels returns a description of all the open channels that this node - is a participant in. - */ - rpc ListChannels (ListChannelsRequest) returns (ListChannelsResponse) { - option (google.api.http) = { - get: "/v1/channels" - }; - } - - /** - SubscribeChannelEvents creates a uni-directional stream from the server to - the client in which any updates relevant to the state of the channels are - sent over. Events include new active channels, inactive channels, and closed - channels. - */ - rpc SubscribeChannelEvents (ChannelEventSubscription) returns (stream ChannelEventUpdate); - - /** lncli: `closedchannels` - ClosedChannels returns a description of all the closed channels that - this node was a participant in. - */ - rpc ClosedChannels (ClosedChannelsRequest) returns (ClosedChannelsResponse) { - option (google.api.http) = { - get: "/v1/channels/closed" - }; - } - - - /** - OpenChannelSync is a synchronous version of the OpenChannel RPC call. This - call is meant to be consumed by clients to the REST proxy. As with all - other sync calls, all byte slices are intended to be populated as hex - encoded strings. - */ - rpc OpenChannelSync (OpenChannelRequest) returns (ChannelPoint) { - option (google.api.http) = { - post: "/v1/channels" - body: "*" - }; - } - - /** lncli: `openchannel` - OpenChannel attempts to open a singly funded channel specified in the - request to a remote peer. Users are able to specify a target number of - blocks that the funding transaction should be confirmed in, or a manual fee - rate to us for the funding transaction. If neither are specified, then a - lax block confirmation target is used. - */ - rpc OpenChannel (OpenChannelRequest) returns (stream OpenStatusUpdate); - - /** - ChannelAcceptor dispatches a bi-directional streaming RPC in which - OpenChannel requests are sent to the client and the client responds with - a boolean that tells LND whether or not to accept the channel. This allows - node operators to specify their own criteria for accepting inbound channels - through a single persistent connection. - */ - rpc ChannelAcceptor (stream ChannelAcceptResponse) returns (stream ChannelAcceptRequest); - - /** lncli: `closechannel` - CloseChannel attempts to close an active channel identified by its channel - outpoint (ChannelPoint). The actions of this method can additionally be - augmented to attempt a force close after a timeout period in the case of an - inactive peer. If a non-force close (cooperative closure) is requested, - then the user can specify either a target number of blocks until the - closure transaction is confirmed, or a manual fee rate. If neither are - specified, then a default lax, block confirmation target is used. - */ - rpc CloseChannel (CloseChannelRequest) returns (stream CloseStatusUpdate) { - option (google.api.http) = { - delete: "/v1/channels/{channel_point.funding_txid_str}/{channel_point.output_index}" - }; - } - - /** lncli: `abandonchannel` - AbandonChannel removes all channel state from the database except for a - close summary. This method can be used to get rid of permanently unusable - channels due to bugs fixed in newer versions of lnd. Only available - when in debug builds of lnd. - */ - rpc AbandonChannel (AbandonChannelRequest) returns (AbandonChannelResponse) { - option (google.api.http) = { - delete: "/v1/channels/abandon/{channel_point.funding_txid_str}/{channel_point.output_index}" - }; - } - - - /** lncli: `sendpayment` - SendPayment dispatches a bi-directional streaming RPC for sending payments - through the Lightning Network. A single RPC invocation creates a persistent - bi-directional stream allowing clients to rapidly send payments through the - Lightning Network with a single persistent connection. - */ - rpc SendPayment (stream SendRequest) returns (stream SendResponse); - - /** - SendPaymentSync is the synchronous non-streaming version of SendPayment. - This RPC is intended to be consumed by clients of the REST proxy. - Additionally, this RPC expects the destination's public key and the payment - hash (if any) to be encoded as hex strings. - */ - rpc SendPaymentSync (SendRequest) returns (SendResponse) { - option (google.api.http) = { - post: "/v1/channels/transactions" - body: "*" - }; - } - - /** lncli: `sendtoroute` - SendToRoute is a bi-directional streaming RPC for sending payment through - the Lightning Network. This method differs from SendPayment in that it - allows users to specify a full route manually. This can be used for things - like rebalancing, and atomic swaps. - */ - rpc SendToRoute(stream SendToRouteRequest) returns (stream SendResponse); - - /** - SendToRouteSync is a synchronous version of SendToRoute. It Will block - until the payment either fails or succeeds. - */ - rpc SendToRouteSync (SendToRouteRequest) returns (SendResponse) { - option (google.api.http) = { - post: "/v1/channels/transactions/route" - body: "*" - }; - } - - /** lncli: `addinvoice` - AddInvoice attempts to add a new invoice to the invoice database. Any - duplicated invoices are rejected, therefore all invoices *must* have a - unique payment preimage. - */ - rpc AddInvoice (Invoice) returns (AddInvoiceResponse) { - option (google.api.http) = { - post: "/v1/invoices" - body: "*" - }; - } - - /** lncli: `listinvoices` - ListInvoices returns a list of all the invoices currently stored within the - database. Any active debug invoices are ignored. It has full support for - paginated responses, allowing users to query for specific invoices through - their add_index. This can be done by using either the first_index_offset or - last_index_offset fields included in the response as the index_offset of the - next request. By default, the first 100 invoices created will be returned. - Backwards pagination is also supported through the Reversed flag. - */ - rpc ListInvoices (ListInvoiceRequest) returns (ListInvoiceResponse) { - option (google.api.http) = { - get: "/v1/invoices" - }; - } - - /** lncli: `lookupinvoice` - LookupInvoice attempts to look up an invoice according to its payment hash. - The passed payment hash *must* be exactly 32 bytes, if not, an error is - returned. - */ - rpc LookupInvoice (PaymentHash) returns (Invoice) { - option (google.api.http) = { - get: "/v1/invoice/{r_hash_str}" - }; - } - - /** - SubscribeInvoices returns a uni-directional stream (server -> client) for - notifying the client of newly added/settled invoices. The caller can - optionally specify the add_index and/or the settle_index. If the add_index - is specified, then we'll first start by sending add invoice events for all - invoices with an add_index greater than the specified value. If the - settle_index is specified, the next, we'll send out all settle events for - invoices with a settle_index greater than the specified value. One or both - of these fields can be set. If no fields are set, then we'll only send out - the latest add/settle events. - */ - rpc SubscribeInvoices (InvoiceSubscription) returns (stream Invoice) { - option (google.api.http) = { - get: "/v1/invoices/subscribe" - }; - } - - /** lncli: `decodepayreq` - DecodePayReq takes an encoded payment request string and attempts to decode - it, returning a full description of the conditions encoded within the - payment request. - */ - rpc DecodePayReq (PayReqString) returns (PayReq) { - option (google.api.http) = { - get: "/v1/payreq/{pay_req}" - }; - } - - /** lncli: `listpayments` - ListPayments returns a list of all outgoing payments. - */ - rpc ListPayments (ListPaymentsRequest) returns (ListPaymentsResponse) { - option (google.api.http) = { - get: "/v1/payments" - }; - }; - - /** - DeleteAllPayments deletes all outgoing payments from DB. - */ - rpc DeleteAllPayments (DeleteAllPaymentsRequest) returns (DeleteAllPaymentsResponse) { - option (google.api.http) = { - delete: "/v1/payments" - }; - }; - - /** lncli: `describegraph` - DescribeGraph returns a description of the latest graph state from the - point of view of the node. The graph information is partitioned into two - components: all the nodes/vertexes, and all the edges that connect the - vertexes themselves. As this is a directed graph, the edges also contain - the node directional specific routing policy which includes: the time lock - delta, fee information, etc. - */ - rpc DescribeGraph (ChannelGraphRequest) returns (ChannelGraph) { - option (google.api.http) = { - get: "/v1/graph" - }; - } - - /** lncli: `getchaninfo` - GetChanInfo returns the latest authenticated network announcement for the - given channel identified by its channel ID: an 8-byte integer which - uniquely identifies the location of transaction's funding output within the - blockchain. - */ - rpc GetChanInfo (ChanInfoRequest) returns (ChannelEdge) { - option (google.api.http) = { - get: "/v1/graph/edge/{chan_id}" - }; - } - - /** lncli: `getnodeinfo` - GetNodeInfo returns the latest advertised, aggregated, and authenticated - channel information for the specified node identified by its public key. - */ - rpc GetNodeInfo (NodeInfoRequest) returns (NodeInfo) { - option (google.api.http) = { - get: "/v1/graph/node/{pub_key}" - }; - } - - /** lncli: `queryroutes` - QueryRoutes attempts to query the daemon's Channel Router for a possible - route to a target destination capable of carrying a specific amount of - satoshis. The returned route contains the full details required to craft and - send an HTLC, also including the necessary information that should be - present within the Sphinx packet encapsulated within the HTLC. - */ - rpc QueryRoutes(QueryRoutesRequest) returns (QueryRoutesResponse) { - option (google.api.http) = { - get: "/v1/graph/routes/{pub_key}/{amt}" - }; - } - - /** lncli: `getnetworkinfo` - GetNetworkInfo returns some basic stats about the known channel graph from - the point of view of the node. - */ - rpc GetNetworkInfo (NetworkInfoRequest) returns (NetworkInfo) { - option (google.api.http) = { - get: "/v1/graph/info" - }; - } - - /** lncli: `stop` - StopDaemon will send a shutdown request to the interrupt handler, triggering - a graceful shutdown of the daemon. - */ - rpc StopDaemon(StopRequest) returns (StopResponse); - - /** - SubscribeChannelGraph launches a streaming RPC that allows the caller to - receive notifications upon any changes to the channel graph topology from - the point of view of the responding node. Events notified include: new - nodes coming online, nodes updating their authenticated attributes, new - channels being advertised, updates in the routing policy for a directional - channel edge, and when channels are closed on-chain. - */ - rpc SubscribeChannelGraph(GraphTopologySubscription) returns (stream GraphTopologyUpdate); - - /** lncli: `debuglevel` - DebugLevel allows a caller to programmatically set the logging verbosity of - lnd. The logging can be targeted according to a coarse daemon-wide logging - level, or in a granular fashion to specify the logging for a target - sub-system. - */ - rpc DebugLevel (DebugLevelRequest) returns (DebugLevelResponse); - - /** lncli: `feereport` - FeeReport allows the caller to obtain a report detailing the current fee - schedule enforced by the node globally for each channel. - */ - rpc FeeReport(FeeReportRequest) returns (FeeReportResponse) { - option (google.api.http) = { - get: "/v1/fees" - }; - } - - /** lncli: `updatechanpolicy` - UpdateChannelPolicy allows the caller to update the fee schedule and - channel policies for all channels globally, or a particular channel. - */ - rpc UpdateChannelPolicy(PolicyUpdateRequest) returns (PolicyUpdateResponse) { - option (google.api.http) = { - post: "/v1/chanpolicy" - body: "*" - }; - } - - /** lncli: `fwdinghistory` - ForwardingHistory allows the caller to query the htlcswitch for a record of - all HTLCs forwarded within the target time range, and integer offset - within that time range. If no time-range is specified, then the first chunk - of the past 24 hrs of forwarding history are returned. - - A list of forwarding events are returned. The size of each forwarding event - is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB. - As a result each message can only contain 50k entries. Each response has - the index offset of the last entry. The index offset can be provided to the - request to allow the caller to skip a series of records. - */ - rpc ForwardingHistory(ForwardingHistoryRequest) returns (ForwardingHistoryResponse) { - option (google.api.http) = { - post: "/v1/switch" - body: "*" - }; - }; - - /** lncli: `exportchanbackup` - ExportChannelBackup attempts to return an encrypted static channel backup - for the target channel identified by it channel point. The backup is - encrypted with a key generated from the aezeed seed of the user. The - returned backup can either be restored using the RestoreChannelBackup - method once lnd is running, or via the InitWallet and UnlockWallet methods - from the WalletUnlocker service. - */ - rpc ExportChannelBackup(ExportChannelBackupRequest) returns (ChannelBackup) { - option (google.api.http) = { - get: "/v1/channels/backup/{chan_point.funding_txid_str}/{chan_point.output_index}" - }; - }; - - /** - ExportAllChannelBackups returns static channel backups for all existing - channels known to lnd. A set of regular singular static channel backups for - each channel are returned. Additionally, a multi-channel backup is returned - as well, which contains a single encrypted blob containing the backups of - each channel. - */ - rpc ExportAllChannelBackups(ChanBackupExportRequest) returns (ChanBackupSnapshot) { - option (google.api.http) = { - get: "/v1/channels/backup" - }; - }; - - /** - VerifyChanBackup allows a caller to verify the integrity of a channel backup - snapshot. This method will accept either a packed Single or a packed Multi. - Specifying both will result in an error. - */ - rpc VerifyChanBackup(ChanBackupSnapshot) returns (VerifyChanBackupResponse) { - option (google.api.http) = { - post: "/v1/channels/backup/verify" - body: "*" - }; - }; - - /** lncli: `restorechanbackup` - RestoreChannelBackups accepts a set of singular channel backups, or a - single encrypted multi-chan backup and attempts to recover any funds - remaining within the channel. If we are able to unpack the backup, then the - new channel will be shown under listchannels, as well as pending channels. - */ - rpc RestoreChannelBackups(RestoreChanBackupRequest) returns (RestoreBackupResponse) { - option (google.api.http) = { - post: "/v1/channels/backup/restore" - body: "*" - }; - }; - - /** - SubscribeChannelBackups allows a client to sub-subscribe to the most up to - date information concerning the state of all channel backups. Each time a - new channel is added, we return the new set of channels, along with a - multi-chan backup containing the backup info for all channels. Each time a - channel is closed, we send a new update, which contains new new chan back - ups, but the updated set of encrypted multi-chan backups with the closed - channel(s) removed. - */ - rpc SubscribeChannelBackups(ChannelBackupSubscription) returns (stream ChanBackupSnapshot) { - }; - - /** lncli: `bakemacaroon` - BakeMacaroon allows the creation of a new macaroon with custom read and - write permissions. No first-party caveats are added since this can be done - offline. - */ - rpc BakeMacaroon(BakeMacaroonRequest) returns (BakeMacaroonResponse) { - option (google.api.http) = { - post: "/v1/macaroon" - body: "*" - }; - }; -} - -message Utxo { - /// The type of address - AddressType type = 1 [json_name = "address_type"]; - - /// The address - string address = 2 [json_name = "address"]; - - /// The value of the unspent coin in satoshis - int64 amount_sat = 3 [json_name = "amount_sat"]; - - /// The pkscript in hex - string pk_script = 4 [json_name = "pk_script"]; - - /// The outpoint in format txid:n - OutPoint outpoint = 5 [json_name = "outpoint"]; - - /// The number of confirmations for the Utxo - int64 confirmations = 6 [json_name = "confirmations"]; -} - -message Transaction { - /// The transaction hash - string tx_hash = 1 [ json_name = "tx_hash" ]; - - /// The transaction amount, denominated in satoshis - int64 amount = 2 [ json_name = "amount" ]; - - /// The number of confirmations - int32 num_confirmations = 3 [ json_name = "num_confirmations" ]; - - /// The hash of the block this transaction was included in - string block_hash = 4 [ json_name = "block_hash" ]; - - /// The height of the block this transaction was included in - int32 block_height = 5 [ json_name = "block_height" ]; - - /// Timestamp of this transaction - int64 time_stamp = 6 [ json_name = "time_stamp" ]; - - /// Fees paid for this transaction - int64 total_fees = 7 [ json_name = "total_fees" ]; - - /// Addresses that received funds for this transaction - repeated string dest_addresses = 8 [ json_name = "dest_addresses" ]; - - /// The raw transaction hex. - string raw_tx_hex = 9 [ json_name = "raw_tx_hex" ]; -} -message GetTransactionsRequest { -} -message TransactionDetails { - /// The list of transactions relevant to the wallet. - repeated Transaction transactions = 1 [json_name = "transactions"]; -} - -message FeeLimit { - oneof limit { - /** - The fee limit expressed as a fixed amount of satoshis. - - The fields fixed and fixed_msat are mutually exclusive. - */ - int64 fixed = 1; - - /** - The fee limit expressed as a fixed amount of millisatoshis. - - The fields fixed and fixed_msat are mutually exclusive. - */ - int64 fixed_msat = 3; - - /// The fee limit expressed as a percentage of the payment amount. - int64 percent = 2; - } -} - -message SendRequest { - /** - The identity pubkey of the payment recipient. When using REST, this field - must be encoded as base64. - */ - bytes dest = 1; - - /** - The hex-encoded identity pubkey of the payment recipient. Deprecated now - that the REST gateway supports base64 encoding of bytes fields. - */ - string dest_string = 2 [deprecated = true]; - - /** - The amount to send expressed in satoshis. - - The fields amt and amt_msat are mutually exclusive. - */ - int64 amt = 3; - - /** - The amount to send expressed in millisatoshis. - - The fields amt and amt_msat are mutually exclusive. - */ - int64 amt_msat = 12; - - /** - The hash to use within the payment's HTLC. When using REST, this field - must be encoded as base64. - */ - bytes payment_hash = 4; - - /** - The hex-encoded hash to use within the payment's HTLC. Deprecated now - that the REST gateway supports base64 encoding of bytes fields. - */ - string payment_hash_string = 5 [deprecated = true]; - - /** - A bare-bones invoice for a payment within the Lightning Network. With the - details of the invoice, the sender has all the data necessary to send a - payment to the recipient. - */ - string payment_request = 6; - - /** - The CLTV delta from the current height that should be used to set the - timelock for the final hop. - */ - int32 final_cltv_delta = 7; - - /** - The maximum number of satoshis that will be paid as a fee of the payment. - This value can be represented either as a percentage of the amount being - sent, or as a fixed amount of the maximum fee the user is willing the pay to - send the payment. - */ - FeeLimit fee_limit = 8; - - /** - The channel id of the channel that must be taken to the first hop. If zero, - any channel may be used. - */ - uint64 outgoing_chan_id = 9 [jstype = JS_STRING]; - - /** - The pubkey of the last hop of the route. If empty, any hop may be used. - */ - bytes last_hop_pubkey = 13; - - /** - An optional maximum total time lock for the route. This should not exceed - lnd's `--max-cltv-expiry` setting. If zero, then the value of - `--max-cltv-expiry` is enforced. - */ - uint32 cltv_limit = 10; - - /** - An optional field that can be used to pass an arbitrary set of TLV records - to a peer which understands the new records. This can be used to pass - application specific data during the payment attempt. When using REST, the - values must be encoded as base64. - */ - map dest_tlv = 11; -} - -message SendResponse { - string payment_error = 1 [json_name = "payment_error"]; - bytes payment_preimage = 2 [json_name = "payment_preimage"]; - Route payment_route = 3 [json_name = "payment_route"]; - bytes payment_hash = 4 [json_name = "payment_hash"]; -} - -message SendToRouteRequest { - /** - The payment hash to use for the HTLC. When using REST, this field must be - encoded as base64. - */ - bytes payment_hash = 1; - - /** - An optional hex-encoded payment hash to be used for the HTLC. Deprecated now - that the REST gateway supports base64 encoding of bytes fields. - */ - string payment_hash_string = 2 [deprecated = true]; - - reserved 3; - - /// Route that should be used to attempt to complete the payment. - Route route = 4; -} - -message ChannelAcceptRequest { - /// The pubkey of the node that wishes to open an inbound channel. - bytes node_pubkey = 1; - - /// The hash of the genesis block that the proposed channel resides in. - bytes chain_hash = 2; - - /// The pending channel id. - bytes pending_chan_id = 3; - - /// The funding amount in satoshis that initiator wishes to use in the channel. - uint64 funding_amt = 4; - - /// The push amount of the proposed channel in millisatoshis. - uint64 push_amt = 5; - - /// The dust limit of the initiator's commitment tx. - uint64 dust_limit = 6; - - /// The maximum amount of coins in millisatoshis that can be pending in this channel. - uint64 max_value_in_flight = 7; - - /// The minimum amount of satoshis the initiator requires us to have at all times. - uint64 channel_reserve = 8; - - /// The smallest HTLC in millisatoshis that the initiator will accept. - uint64 min_htlc = 9; - - /// The initial fee rate that the initiator suggests for both commitment transactions. - uint64 fee_per_kw = 10; - - /** - The number of blocks to use for the relative time lock in the pay-to-self output - of both commitment transactions. - */ - uint32 csv_delay = 11; - - /// The total number of incoming HTLC's that the initiator will accept. - uint32 max_accepted_htlcs = 12; - - /// A bit-field which the initiator uses to specify proposed channel behavior. - uint32 channel_flags = 13; -} - -message ChannelAcceptResponse { - /// Whether or not the client accepts the channel. - bool accept = 1; - - /// The pending channel id to which this response applies. - bytes pending_chan_id = 2; -} - -message ChannelPoint { - oneof funding_txid { - /** - Txid of the funding transaction. When using REST, this field must be - encoded as base64. - */ - bytes funding_txid_bytes = 1 [json_name = "funding_txid_bytes"]; - - /** - Hex-encoded string representing the byte-reversed hash of the funding - transaction. - */ - string funding_txid_str = 2 [json_name = "funding_txid_str"]; - } - - /// The index of the output of the funding transaction - uint32 output_index = 3 [json_name = "output_index"]; -} - -message OutPoint { - /// Raw bytes representing the transaction id. - bytes txid_bytes = 1 [json_name = "txid_bytes"]; - - /// Reversed, hex-encoded string representing the transaction id. - string txid_str = 2 [json_name = "txid_str"]; - - /// The index of the output on the transaction. - uint32 output_index = 3 [json_name = "output_index"]; -} - -message LightningAddress { - /// The identity pubkey of the Lightning node - string pubkey = 1 [json_name = "pubkey"]; - - /// The network location of the lightning node, e.g. `69.69.69.69:1337` or `localhost:10011` - string host = 2 [json_name = "host"]; -} - -message EstimateFeeRequest { - /// The map from addresses to amounts for the transaction. - map AddrToAmount = 1; - - /// The target number of blocks that this transaction should be confirmed by. - int32 target_conf = 2; -} - -message EstimateFeeResponse { - /// The total fee in satoshis. - int64 fee_sat = 1 [json_name = "fee_sat"]; - - /// The fee rate in satoshi/byte. - int64 feerate_sat_per_byte = 2 [json_name = "feerate_sat_per_byte"]; -} - -message SendManyRequest { - /// The map from addresses to amounts - map AddrToAmount = 1; - - /// The target number of blocks that this transaction should be confirmed by. - int32 target_conf = 3; - - /// A manual fee rate set in sat/byte that should be used when crafting the transaction. - int64 sat_per_byte = 5; -} -message SendManyResponse { - /// The id of the transaction - string txid = 1 [json_name = "txid"]; -} - -message SendCoinsRequest { - /// The address to send coins to - string addr = 1; - - /// The amount in satoshis to send - int64 amount = 2; - - /// The target number of blocks that this transaction should be confirmed by. - int32 target_conf = 3; - - /// A manual fee rate set in sat/byte that should be used when crafting the transaction. - int64 sat_per_byte = 5; - - /** - If set, then the amount field will be ignored, and lnd will attempt to - send all the coins under control of the internal wallet to the specified - address. - */ - bool send_all = 6; -} -message SendCoinsResponse { - /// The transaction ID of the transaction - string txid = 1 [json_name = "txid"]; -} - -message ListUnspentRequest { - /// The minimum number of confirmations to be included. - int32 min_confs = 1; - - /// The maximum number of confirmations to be included. - int32 max_confs = 2; -} -message ListUnspentResponse { - /// A list of utxos - repeated Utxo utxos = 1 [json_name = "utxos"]; -} - -/** -`AddressType` has to be one of: - -- `p2wkh`: Pay to witness key hash (`WITNESS_PUBKEY_HASH` = 0) -- `np2wkh`: Pay to nested witness key hash (`NESTED_PUBKEY_HASH` = 1) -*/ -enum AddressType { - WITNESS_PUBKEY_HASH = 0; - NESTED_PUBKEY_HASH = 1; - UNUSED_WITNESS_PUBKEY_HASH = 2; - UNUSED_NESTED_PUBKEY_HASH = 3; -} - -message NewAddressRequest { - /// The address type - AddressType type = 1; -} -message NewAddressResponse { - /// The newly generated wallet address - string address = 1 [json_name = "address"]; -} - -message SignMessageRequest { - /** - The message to be signed. When using REST, this field must be encoded as - base64. - */ - bytes msg = 1 [ json_name = "msg" ]; -} -message SignMessageResponse { - /// The signature for the given message - string signature = 1 [ json_name = "signature" ]; -} - -message VerifyMessageRequest { - /** - The message over which the signature is to be verified. When using REST, - this field must be encoded as base64. - */ - bytes msg = 1 [ json_name = "msg" ]; - - /// The signature to be verified over the given message - string signature = 2 [ json_name = "signature" ]; -} -message VerifyMessageResponse { - /// Whether the signature was valid over the given message - bool valid = 1 [ json_name = "valid" ]; - - /// The pubkey recovered from the signature - string pubkey = 2 [ json_name = "pubkey" ]; -} - -message ConnectPeerRequest { - /// Lightning address of the peer, in the format `@host` - LightningAddress addr = 1; - - /** If set, the daemon will attempt to persistently connect to the target - * peer. Otherwise, the call will be synchronous. */ - bool perm = 2; -} -message ConnectPeerResponse { -} - -message DisconnectPeerRequest { - /// The pubkey of the node to disconnect from - string pub_key = 1 [json_name = "pub_key"]; -} -message DisconnectPeerResponse { -} - -message HTLC { - bool incoming = 1 [json_name = "incoming"]; - int64 amount = 2 [json_name = "amount"]; - bytes hash_lock = 3 [json_name = "hash_lock"]; - uint32 expiration_height = 4 [json_name = "expiration_height"]; -} - -message Channel { - /// Whether this channel is active or not - bool active = 1 [json_name = "active"]; - - /// The identity pubkey of the remote node - string remote_pubkey = 2 [json_name = "remote_pubkey"]; - - /** - The outpoint (txid:index) of the funding transaction. With this value, Bob - will be able to generate a signature for Alice's version of the commitment - transaction. - */ - string channel_point = 3 [json_name = "channel_point"]; - - /** - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 chan_id = 4 [json_name = "chan_id", jstype = JS_STRING]; - - /// The total amount of funds held in this channel - int64 capacity = 5 [json_name = "capacity"]; - - /// This node's current balance in this channel - int64 local_balance = 6 [json_name = "local_balance"]; - - /// The counterparty's current balance in this channel - int64 remote_balance = 7 [json_name = "remote_balance"]; - - /** - The amount calculated to be paid in fees for the current set of commitment - transactions. The fee amount is persisted with the channel in order to - allow the fee amount to be removed and recalculated with each channel state - update, including updates that happen after a system restart. - */ - int64 commit_fee = 8 [json_name = "commit_fee"]; - - /// The weight of the commitment transaction - int64 commit_weight = 9 [json_name = "commit_weight"]; - - /** - The required number of satoshis per kilo-weight that the requester will pay - at all times, for both the funding transaction and commitment transaction. - This value can later be updated once the channel is open. - */ - int64 fee_per_kw = 10 [json_name = "fee_per_kw"]; - - /// The unsettled balance in this channel - int64 unsettled_balance = 11 [json_name = "unsettled_balance"]; - - /** - The total number of satoshis we've sent within this channel. - */ - int64 total_satoshis_sent = 12 [json_name = "total_satoshis_sent"]; - - /** - The total number of satoshis we've received within this channel. - */ - int64 total_satoshis_received = 13 [json_name = "total_satoshis_received"]; - - /** - The total number of updates conducted within this channel. - */ - uint64 num_updates = 14 [json_name = "num_updates"]; - - /** - The list of active, uncleared HTLCs currently pending within the channel. - */ - repeated HTLC pending_htlcs = 15 [json_name = "pending_htlcs"]; - - /** - The CSV delay expressed in relative blocks. If the channel is force closed, - we will need to wait for this many blocks before we can regain our funds. - */ - uint32 csv_delay = 16 [json_name = "csv_delay"]; - - /// Whether this channel is advertised to the network or not. - bool private = 17 [json_name = "private"]; - - /// True if we were the ones that created the channel. - bool initiator = 18 [json_name = "initiator"]; - - /// A set of flags showing the current state of the channel. - string chan_status_flags = 19 [json_name = "chan_status_flags"]; - - /// The minimum satoshis this node is required to reserve in its balance. - int64 local_chan_reserve_sat = 20 [json_name = "local_chan_reserve_sat"]; - - /** - The minimum satoshis the other node is required to reserve in its balance. - */ - int64 remote_chan_reserve_sat = 21 [json_name = "remote_chan_reserve_sat"]; - - /** - If true, then this channel uses the modern commitment format where the key - in the output of the remote party does not change each state. This makes - back up and recovery easier as when the channel is closed, the funds go - directly to that key. - */ - bool static_remote_key = 22 [json_name = "static_remote_key"]; - - /** - The number of seconds that the channel has been monitored by the channel - scoring system. Scores are currently not persisted, so this value may be - less than the lifetime of the channel [EXPERIMENTAL]. - */ - int64 lifetime = 23 [json_name = "lifetime"]; - - /** - The number of seconds that the remote peer has been observed as being online - by the channel scoring system over the lifetime of the channel [EXPERIMENTAL]. - */ - int64 uptime = 24 [json_name = "uptime"]; -} - - -message ListChannelsRequest { - bool active_only = 1; - bool inactive_only = 2; - bool public_only = 3; - bool private_only = 4; -} -message ListChannelsResponse { - /// The list of active channels - repeated Channel channels = 11 [json_name = "channels"]; -} - -message ChannelCloseSummary { - /// The outpoint (txid:index) of the funding transaction. - string channel_point = 1 [json_name = "channel_point"]; - - /// The unique channel ID for the channel. - uint64 chan_id = 2 [json_name = "chan_id", jstype = JS_STRING]; - - /// The hash of the genesis block that this channel resides within. - string chain_hash = 3 [json_name = "chain_hash"]; - - /// The txid of the transaction which ultimately closed this channel. - string closing_tx_hash = 4 [json_name = "closing_tx_hash"]; - - /// Public key of the remote peer that we formerly had a channel with. - string remote_pubkey = 5 [json_name = "remote_pubkey"]; - - /// Total capacity of the channel. - int64 capacity = 6 [json_name = "capacity"]; - - /// Height at which the funding transaction was spent. - uint32 close_height = 7 [json_name = "close_height"]; - - /// Settled balance at the time of channel closure - int64 settled_balance = 8 [json_name = "settled_balance"]; - - /// The sum of all the time-locked outputs at the time of channel closure - int64 time_locked_balance = 9 [json_name = "time_locked_balance"]; - - enum ClosureType { - COOPERATIVE_CLOSE = 0; - LOCAL_FORCE_CLOSE = 1; - REMOTE_FORCE_CLOSE = 2; - BREACH_CLOSE = 3; - FUNDING_CANCELED = 4; - ABANDONED = 5; - } - - /// Details on how the channel was closed. - ClosureType close_type = 10 [json_name = "close_type"]; -} - -message ClosedChannelsRequest { - bool cooperative = 1; - bool local_force = 2; - bool remote_force = 3; - bool breach = 4; - bool funding_canceled = 5; - bool abandoned = 6; -} - -message ClosedChannelsResponse { - repeated ChannelCloseSummary channels = 1 [json_name = "channels"]; -} - -message Peer { - /// The identity pubkey of the peer - string pub_key = 1 [json_name = "pub_key"]; - - /// Network address of the peer; eg `127.0.0.1:10011` - string address = 3 [json_name = "address"]; - - /// Bytes of data transmitted to this peer - uint64 bytes_sent = 4 [json_name = "bytes_sent"]; - - /// Bytes of data transmitted from this peer - uint64 bytes_recv = 5 [json_name = "bytes_recv"]; - - /// Satoshis sent to this peer - int64 sat_sent = 6 [json_name = "sat_sent"]; - - /// Satoshis received from this peer - int64 sat_recv = 7 [json_name = "sat_recv"]; - - /// A channel is inbound if the counterparty initiated the channel - bool inbound = 8 [json_name = "inbound"]; - - /// Ping time to this peer - int64 ping_time = 9 [json_name = "ping_time"]; - - enum SyncType { - /** - Denotes that we cannot determine the peer's current sync type. - */ - UNKNOWN_SYNC = 0; - - /** - Denotes that we are actively receiving new graph updates from the peer. - */ - ACTIVE_SYNC = 1; - - /** - Denotes that we are not receiving new graph updates from the peer. - */ - PASSIVE_SYNC = 2; - } - - // The type of sync we are currently performing with this peer. - SyncType sync_type = 10 [json_name = "sync_type"]; -} - -message ListPeersRequest { -} -message ListPeersResponse { - /// The list of currently connected peers - repeated Peer peers = 1 [json_name = "peers"]; -} - -message GetInfoRequest { -} -message GetInfoResponse { - - /// The identity pubkey of the current node. - string identity_pubkey = 1 [json_name = "identity_pubkey"]; - - /// If applicable, the alias of the current node, e.g. "bob" - string alias = 2 [json_name = "alias"]; - - /// Number of pending channels - uint32 num_pending_channels = 3 [json_name = "num_pending_channels"]; - - /// Number of active channels - uint32 num_active_channels = 4 [json_name = "num_active_channels"]; - - /// Number of peers - uint32 num_peers = 5 [json_name = "num_peers"]; - - /// The node's current view of the height of the best block - uint32 block_height = 6 [json_name = "block_height"]; - - /// The node's current view of the hash of the best block - string block_hash = 8 [json_name = "block_hash"]; - - /// Whether the wallet's view is synced to the main chain - bool synced_to_chain = 9 [json_name = "synced_to_chain"]; - - /** - Whether the current node is connected to testnet. This field is - deprecated and the network field should be used instead - **/ - bool testnet = 10 [json_name = "testnet", deprecated = true]; - - reserved 11; - - /// The URIs of the current node. - repeated string uris = 12 [json_name = "uris"]; - - /// Timestamp of the block best known to the wallet - int64 best_header_timestamp = 13 [ json_name = "best_header_timestamp" ]; - - /// The version of the LND software that the node is running. - string version = 14 [ json_name = "version" ]; - - /// Number of inactive channels - uint32 num_inactive_channels = 15 [json_name = "num_inactive_channels"]; - - /// A list of active chains the node is connected to - repeated Chain chains = 16 [json_name = "chains"]; - - /// The color of the current node in hex code format - string color = 17 [json_name = "color"]; - - // Whether we consider ourselves synced with the public channel graph. - bool synced_to_graph = 18 [json_name = "synced_to_graph"]; -} - -message Chain { - /// The blockchain the node is on (eg bitcoin, litecoin) - string chain = 1 [json_name = "chain"]; - - /// The network the node is on (eg regtest, testnet, mainnet) - string network = 2 [json_name = "network"]; -} - -message ConfirmationUpdate { - bytes block_sha = 1; - int32 block_height = 2; - - uint32 num_confs_left = 3; -} - -message ChannelOpenUpdate { - ChannelPoint channel_point = 1 [json_name = "channel_point"]; -} - -message ChannelCloseUpdate { - bytes closing_txid = 1 [json_name = "closing_txid"]; - - bool success = 2 [json_name = "success"]; -} - -message CloseChannelRequest { - /** - The outpoint (txid:index) of the funding transaction. With this value, Bob - will be able to generate a signature for Alice's version of the commitment - transaction. - */ - ChannelPoint channel_point = 1; - - /// If true, then the channel will be closed forcibly. This means the current commitment transaction will be signed and broadcast. - bool force = 2; - - /// The target number of blocks that the closure transaction should be confirmed by. - int32 target_conf = 3; - - /// A manual fee rate set in sat/byte that should be used when crafting the closure transaction. - int64 sat_per_byte = 4; -} - -message CloseStatusUpdate { - oneof update { - PendingUpdate close_pending = 1 [json_name = "close_pending"]; - ChannelCloseUpdate chan_close = 3 [json_name = "chan_close"]; - } -} - -message PendingUpdate { - bytes txid = 1 [json_name = "txid"]; - uint32 output_index = 2 [json_name = "output_index"]; -} - -message OpenChannelRequest { - /** - The pubkey of the node to open a channel with. When using REST, this field - must be encoded as base64. - */ - bytes node_pubkey = 2 [json_name = "node_pubkey"]; - - /** - The hex encoded pubkey of the node to open a channel with. Deprecated now - that the REST gateway supports base64 encoding of bytes fields. - */ - string node_pubkey_string = 3 [json_name = "node_pubkey_string", deprecated = true]; - - /// The number of satoshis the wallet should commit to the channel - int64 local_funding_amount = 4 [json_name = "local_funding_amount"]; - - /// The number of satoshis to push to the remote side as part of the initial commitment state - int64 push_sat = 5 [json_name = "push_sat"]; - - /// The target number of blocks that the funding transaction should be confirmed by. - int32 target_conf = 6; - - /// A manual fee rate set in sat/byte that should be used when crafting the funding transaction. - int64 sat_per_byte = 7; - - /// Whether this channel should be private, not announced to the greater network. - bool private = 8 [json_name = "private"]; - - /// The minimum value in millisatoshi we will require for incoming HTLCs on the channel. - int64 min_htlc_msat = 9 [json_name = "min_htlc_msat"]; - - /// The delay we require on the remote's commitment transaction. If this is not set, it will be scaled automatically with the channel size. - uint32 remote_csv_delay = 10 [json_name = "remote_csv_delay"]; - - /// The minimum number of confirmations each one of your outputs used for the funding transaction must satisfy. - int32 min_confs = 11 [json_name = "min_confs"]; - - /// Whether unconfirmed outputs should be used as inputs for the funding transaction. - bool spend_unconfirmed = 12 [json_name = "spend_unconfirmed"]; -} -message OpenStatusUpdate { - oneof update { - PendingUpdate chan_pending = 1 [json_name = "chan_pending"]; - ChannelOpenUpdate chan_open = 3 [json_name = "chan_open"]; - } -} - -message PendingHTLC { - - /// The direction within the channel that the htlc was sent - bool incoming = 1 [ json_name = "incoming" ]; - - /// The total value of the htlc - int64 amount = 2 [ json_name = "amount" ]; - - /// The final output to be swept back to the user's wallet - string outpoint = 3 [ json_name = "outpoint" ]; - - /// The next block height at which we can spend the current stage - uint32 maturity_height = 4 [ json_name = "maturity_height" ]; - - /** - The number of blocks remaining until the current stage can be swept. - Negative values indicate how many blocks have passed since becoming - mature. - */ - int32 blocks_til_maturity = 5 [ json_name = "blocks_til_maturity" ]; - - /// Indicates whether the htlc is in its first or second stage of recovery - uint32 stage = 6 [ json_name = "stage" ]; -} - -message PendingChannelsRequest {} -message PendingChannelsResponse { - message PendingChannel { - string remote_node_pub = 1 [ json_name = "remote_node_pub" ]; - string channel_point = 2 [ json_name = "channel_point" ]; - - int64 capacity = 3 [ json_name = "capacity" ]; - - int64 local_balance = 4 [ json_name = "local_balance" ]; - int64 remote_balance = 5 [ json_name = "remote_balance" ]; - - /// The minimum satoshis this node is required to reserve in its balance. - int64 local_chan_reserve_sat = 6 [json_name = "local_chan_reserve_sat"]; - - /** - The minimum satoshis the other node is required to reserve in its - balance. - */ - int64 remote_chan_reserve_sat = 7 [json_name = "remote_chan_reserve_sat"]; - } - - message PendingOpenChannel { - /// The pending channel - PendingChannel channel = 1 [ json_name = "channel" ]; - - /// The height at which this channel will be confirmed - uint32 confirmation_height = 2 [ json_name = "confirmation_height" ]; - - /** - The amount calculated to be paid in fees for the current set of - commitment transactions. The fee amount is persisted with the channel - in order to allow the fee amount to be removed and recalculated with - each channel state update, including updates that happen after a system - restart. - */ - int64 commit_fee = 4 [json_name = "commit_fee" ]; - - /// The weight of the commitment transaction - int64 commit_weight = 5 [ json_name = "commit_weight" ]; - - /** - The required number of satoshis per kilo-weight that the requester will - pay at all times, for both the funding transaction and commitment - transaction. This value can later be updated once the channel is open. - */ - int64 fee_per_kw = 6 [ json_name = "fee_per_kw" ]; - } - - message WaitingCloseChannel { - /// The pending channel waiting for closing tx to confirm - PendingChannel channel = 1; - - /// The balance in satoshis encumbered in this channel - int64 limbo_balance = 2 [ json_name = "limbo_balance" ]; - } - - message ClosedChannel { - /// The pending channel to be closed - PendingChannel channel = 1; - - /// The transaction id of the closing transaction - string closing_txid = 2 [ json_name = "closing_txid" ]; - } - - message ForceClosedChannel { - /// The pending channel to be force closed - PendingChannel channel = 1 [ json_name = "channel" ]; - - /// The transaction id of the closing transaction - string closing_txid = 2 [ json_name = "closing_txid" ]; - - /// The balance in satoshis encumbered in this pending channel - int64 limbo_balance = 3 [ json_name = "limbo_balance" ]; - - /// The height at which funds can be swept into the wallet - uint32 maturity_height = 4 [ json_name = "maturity_height" ]; - - /* - Remaining # of blocks until the commitment output can be swept. - Negative values indicate how many blocks have passed since becoming - mature. - */ - int32 blocks_til_maturity = 5 [ json_name = "blocks_til_maturity" ]; - - /// The total value of funds successfully recovered from this channel - int64 recovered_balance = 6 [ json_name = "recovered_balance" ]; - - repeated PendingHTLC pending_htlcs = 8 [ json_name = "pending_htlcs" ]; - } - - /// The balance in satoshis encumbered in pending channels - int64 total_limbo_balance = 1 [ json_name = "total_limbo_balance" ]; - - /// Channels pending opening - repeated PendingOpenChannel pending_open_channels = 2 [ json_name = "pending_open_channels" ]; - - /// Channels pending closing - repeated ClosedChannel pending_closing_channels = 3 [ json_name = "pending_closing_channels" ]; - - /// Channels pending force closing - repeated ForceClosedChannel pending_force_closing_channels = 4 [ json_name = "pending_force_closing_channels" ]; - - /// Channels waiting for closing tx to confirm - repeated WaitingCloseChannel waiting_close_channels = 5 [ json_name = "waiting_close_channels" ]; -} - -message ChannelEventSubscription { -} - -message ChannelEventUpdate { - oneof channel { - Channel open_channel = 1 [ json_name = "open_channel" ]; - ChannelCloseSummary closed_channel = 2 [ json_name = "closed_channel" ]; - ChannelPoint active_channel = 3 [ json_name = "active_channel" ]; - ChannelPoint inactive_channel = 4 [ json_name = "inactive_channel" ]; - } - - enum UpdateType { - OPEN_CHANNEL = 0; - CLOSED_CHANNEL = 1; - ACTIVE_CHANNEL = 2; - INACTIVE_CHANNEL = 3; - } - - UpdateType type = 5 [ json_name = "type" ]; -} - -message WalletBalanceRequest { -} -message WalletBalanceResponse { - /// The balance of the wallet - int64 total_balance = 1 [json_name = "total_balance"]; - - /// The confirmed balance of a wallet(with >= 1 confirmations) - int64 confirmed_balance = 2 [json_name = "confirmed_balance"]; - - /// The unconfirmed balance of a wallet(with 0 confirmations) - int64 unconfirmed_balance = 3 [json_name = "unconfirmed_balance"]; -} - -message ChannelBalanceRequest { -} -message ChannelBalanceResponse { - /// Sum of channels balances denominated in satoshis - int64 balance = 1 [json_name = "balance"]; - - /// Sum of channels pending balances denominated in satoshis - int64 pending_open_balance = 2 [json_name = "pending_open_balance"]; -} - -message QueryRoutesRequest { - /// The 33-byte hex-encoded public key for the payment destination - string pub_key = 1; - - /** - The amount to send expressed in satoshis. - - The fields amt and amt_msat are mutually exclusive. - */ - int64 amt = 2; - - /** - The amount to send expressed in millisatoshis. - - The fields amt and amt_msat are mutually exclusive. - */ - int64 amt_msat = 12; - - reserved 3; - - /// An optional CLTV delta from the current height that should be used for the timelock of the final hop - int32 final_cltv_delta = 4; - - /** - The maximum number of satoshis that will be paid as a fee of the payment. - This value can be represented either as a percentage of the amount being - sent, or as a fixed amount of the maximum fee the user is willing the pay to - send the payment. - */ - FeeLimit fee_limit = 5; - - /** - A list of nodes to ignore during path finding. When using REST, these fields - must be encoded as base64. - */ - repeated bytes ignored_nodes = 6; - - /** - Deprecated. A list of edges to ignore during path finding. - */ - repeated EdgeLocator ignored_edges = 7 [deprecated = true]; - - /** - The source node where the request route should originated from. If empty, - self is assumed. - */ - string source_pub_key = 8; - - /** - If set to true, edge probabilities from mission control will be used to get - the optimal route. - */ - bool use_mission_control = 9; - - /** - A list of directed node pairs that will be ignored during path finding. - */ - repeated NodePair ignored_pairs = 10; - - /** - An optional maximum total time lock for the route. If the source is empty or - ourselves, this should not exceed lnd's `--max-cltv-expiry` setting. If - zero, then the value of `--max-cltv-expiry` is used as the limit. - */ - uint32 cltv_limit = 11; -} - -message NodePair { - /** - The sending node of the pair. When using REST, this field must be encoded as - base64. - */ - bytes from = 1; - - /** - The receiving node of the pair. When using REST, this field must be encoded - as base64. - */ - bytes to = 2; -} - -message EdgeLocator { - /// The short channel id of this edge. - uint64 channel_id = 1 [jstype = JS_STRING]; - - /** - The direction of this edge. If direction_reverse is false, the direction - of this edge is from the channel endpoint with the lexicographically smaller - pub key to the endpoint with the larger pub key. If direction_reverse is - is true, the edge goes the other way. - */ - bool direction_reverse = 2; -} - -message QueryRoutesResponse { - /** - The route that results from the path finding operation. This is still a - repeated field to retain backwards compatibility. - */ - repeated Route routes = 1 [json_name = "routes"]; - - /** - The success probability of the returned route based on the current mission - control state. [EXPERIMENTAL] - */ - double success_prob = 2 [json_name = "success_prob"]; -} - -message Hop { - /** - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 chan_id = 1 [json_name = "chan_id", jstype = JS_STRING]; - int64 chan_capacity = 2 [json_name = "chan_capacity"]; - int64 amt_to_forward = 3 [json_name = "amt_to_forward", deprecated = true]; - int64 fee = 4 [json_name = "fee", deprecated = true]; - uint32 expiry = 5 [json_name = "expiry"]; - int64 amt_to_forward_msat = 6 [json_name = "amt_to_forward_msat"]; - int64 fee_msat = 7 [json_name = "fee_msat"]; - - /** - An optional public key of the hop. If the public key is given, the payment - can be executed without relying on a copy of the channel graph. - */ - string pub_key = 8 [json_name = "pub_key"]; - - /** - If set to true, then this hop will be encoded using the new variable length - TLV format. - */ - bool tlv_payload = 9 [json_name = "tlv_payload"]; - - /** - An optional TLV record tha singals the use of an MPP payment. If present, - the receiver will enforce that that the same mpp_record is included in the - final hop payload of all non-zero payments in the HTLC set. If empty, a - regular single-shot payment is or was attempted. - */ - MPPRecord mpp_record = 10 [json_name = "mpp_record"]; -} - -message MPPRecord { - /** - A unique, random identifier used to authenticate the sender as the intended - payer of a multi-path payment. The payment_addr must be the same for all - subpayments, and match the payment_addr provided in the receiver's invoice. - The same payment_addr must be used on all subpayments. - */ - bytes payment_addr = 11 [json_name = "payment_addr"]; - - /** - The total amount in milli-satoshis being sent as part of a larger multi-path - payment. The caller is responsible for ensuring subpayments to the same node - and payment_hash sum exactly to total_amt_msat. The same - total_amt_msat must be used on all subpayments. - */ - int64 total_amt_msat = 10 [json_name = "total_amt_msat"]; -} - -/** -A path through the channel graph which runs over one or more channels in -succession. This struct carries all the information required to craft the -Sphinx onion packet, and send the payment along the first hop in the path. A -route is only selected as valid if all the channels have sufficient capacity to -carry the initial payment amount after fees are accounted for. -*/ -message Route { - - /** - The cumulative (final) time lock across the entire route. This is the CLTV - value that should be extended to the first hop in the route. All other hops - will decrement the time-lock as advertised, leaving enough time for all - hops to wait for or present the payment preimage to complete the payment. - */ - uint32 total_time_lock = 1 [json_name = "total_time_lock"]; - - /** - The sum of the fees paid at each hop within the final route. In the case - of a one-hop payment, this value will be zero as we don't need to pay a fee - to ourselves. - */ - int64 total_fees = 2 [json_name = "total_fees", deprecated = true]; - - /** - The total amount of funds required to complete a payment over this route. - This value includes the cumulative fees at each hop. As a result, the HTLC - extended to the first-hop in the route will need to have at least this many - satoshis, otherwise the route will fail at an intermediate node due to an - insufficient amount of fees. - */ - int64 total_amt = 3 [json_name = "total_amt", deprecated = true]; - - /** - Contains details concerning the specific forwarding details at each hop. - */ - repeated Hop hops = 4 [json_name = "hops"]; - - /** - The total fees in millisatoshis. - */ - int64 total_fees_msat = 5 [json_name = "total_fees_msat"]; - - /** - The total amount in millisatoshis. - */ - int64 total_amt_msat = 6 [json_name = "total_amt_msat"]; -} - -message NodeInfoRequest { - /// The 33-byte hex-encoded compressed public of the target node - string pub_key = 1; - - /// If true, will include all known channels associated with the node. - bool include_channels = 2; -} - -message NodeInfo { - - /** - An individual vertex/node within the channel graph. A node is - connected to other nodes by one or more channel edges emanating from it. As - the graph is directed, a node will also have an incoming edge attached to - it for each outgoing edge. - */ - LightningNode node = 1 [json_name = "node"]; - - /// The total number of channels for the node. - uint32 num_channels = 2 [json_name = "num_channels"]; - - /// The sum of all channels capacity for the node, denominated in satoshis. - int64 total_capacity = 3 [json_name = "total_capacity"]; - - /// A list of all public channels for the node. - repeated ChannelEdge channels = 4 [json_name = "channels"]; -} - -/** -An individual vertex/node within the channel graph. A node is -connected to other nodes by one or more channel edges emanating from it. As the -graph is directed, a node will also have an incoming edge attached to it for -each outgoing edge. -*/ -message LightningNode { - uint32 last_update = 1 [ json_name = "last_update" ]; - string pub_key = 2 [ json_name = "pub_key" ]; - string alias = 3 [ json_name = "alias" ]; - repeated NodeAddress addresses = 4 [ json_name = "addresses" ]; - string color = 5 [ json_name = "color" ]; -} - -message NodeAddress { - string network = 1 [ json_name = "network" ]; - string addr = 2 [ json_name = "addr" ]; -} - -message RoutingPolicy { - uint32 time_lock_delta = 1 [json_name = "time_lock_delta"]; - int64 min_htlc = 2 [json_name = "min_htlc"]; - int64 fee_base_msat = 3 [json_name = "fee_base_msat"]; - int64 fee_rate_milli_msat = 4 [json_name = "fee_rate_milli_msat"]; - bool disabled = 5 [json_name = "disabled"]; - uint64 max_htlc_msat = 6 [json_name = "max_htlc_msat"]; - uint32 last_update = 7 [json_name = "last_update"]; -} - -/** -A fully authenticated channel along with all its unique attributes. -Once an authenticated channel announcement has been processed on the network, -then an instance of ChannelEdgeInfo encapsulating the channels attributes is -stored. The other portions relevant to routing policy of a channel are stored -within a ChannelEdgePolicy for each direction of the channel. -*/ -message ChannelEdge { - - /** - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 channel_id = 1 [json_name = "channel_id", jstype = JS_STRING]; - string chan_point = 2 [json_name = "chan_point"]; - - uint32 last_update = 3 [json_name = "last_update", deprecated = true]; - - string node1_pub = 4 [json_name = "node1_pub"]; - string node2_pub = 5 [json_name = "node2_pub"]; - - int64 capacity = 6 [json_name = "capacity"]; - - RoutingPolicy node1_policy = 7 [json_name = "node1_policy"]; - RoutingPolicy node2_policy = 8 [json_name = "node2_policy"]; -} - -message ChannelGraphRequest { - /** - Whether unannounced channels are included in the response or not. If set, - unannounced channels are included. Unannounced channels are both private - channels, and public channels that are not yet announced to the network. - */ - bool include_unannounced = 1 [json_name = "include_unannounced"]; -} - -/// Returns a new instance of the directed channel graph. -message ChannelGraph { - /// The list of `LightningNode`s in this channel graph - repeated LightningNode nodes = 1 [json_name = "nodes"]; - - /// The list of `ChannelEdge`s in this channel graph - repeated ChannelEdge edges = 2 [json_name = "edges"]; -} - -message ChanInfoRequest { - /** - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 chan_id = 1 [jstype = JS_STRING]; -} - -message NetworkInfoRequest { -} -message NetworkInfo { - uint32 graph_diameter = 1 [json_name = "graph_diameter"]; - double avg_out_degree = 2 [json_name = "avg_out_degree"]; - uint32 max_out_degree = 3 [json_name = "max_out_degree"]; - - uint32 num_nodes = 4 [json_name = "num_nodes"]; - uint32 num_channels = 5 [json_name = "num_channels"]; - - int64 total_network_capacity = 6 [json_name = "total_network_capacity"]; - - double avg_channel_size = 7 [json_name = "avg_channel_size"]; - int64 min_channel_size = 8 [json_name = "min_channel_size"]; - int64 max_channel_size = 9 [json_name = "max_channel_size"]; - int64 median_channel_size_sat = 10 [json_name = "median_channel_size_sat"]; - - // The number of edges marked as zombies. - uint64 num_zombie_chans = 11 [json_name = "num_zombie_chans"]; - - // TODO(roasbeef): fee rate info, expiry - // * also additional RPC for tracking fee info once in -} - -message StopRequest{} -message StopResponse{} - -message GraphTopologySubscription {} -message GraphTopologyUpdate { - repeated NodeUpdate node_updates = 1; - repeated ChannelEdgeUpdate channel_updates = 2; - repeated ClosedChannelUpdate closed_chans = 3; -} -message NodeUpdate { - repeated string addresses = 1; - string identity_key = 2; - bytes global_features = 3; - string alias = 4; - string color = 5; -} -message ChannelEdgeUpdate { - /** - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 chan_id = 1 [jstype = JS_STRING]; - - ChannelPoint chan_point = 2; - - int64 capacity = 3; - - RoutingPolicy routing_policy = 4; - - string advertising_node = 5; - string connecting_node = 6; -} -message ClosedChannelUpdate { - /** - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 chan_id = 1 [jstype = JS_STRING]; - int64 capacity = 2; - uint32 closed_height = 3; - ChannelPoint chan_point = 4; -} - -message HopHint { - /// The public key of the node at the start of the channel. - string node_id = 1 [json_name = "node_id"]; - - /// The unique identifier of the channel. - uint64 chan_id = 2 [json_name = "chan_id", jstype = JS_STRING]; - - /// The base fee of the channel denominated in millisatoshis. - uint32 fee_base_msat = 3 [json_name = "fee_base_msat"]; - - /** - The fee rate of the channel for sending one satoshi across it denominated in - millionths of a satoshi. - */ - uint32 fee_proportional_millionths = 4 [json_name = "fee_proportional_millionths"]; - - /// The time-lock delta of the channel. - uint32 cltv_expiry_delta = 5 [json_name = "cltv_expiry_delta"]; -} - -message RouteHint { - /** - A list of hop hints that when chained together can assist in reaching a - specific destination. - */ - repeated HopHint hop_hints = 1 [json_name = "hop_hints"]; -} - -message Invoice { - /** - An optional memo to attach along with the invoice. Used for record keeping - purposes for the invoice's creator, and will also be set in the description - field of the encoded payment request if the description_hash field is not - being used. - */ - string memo = 1 [json_name = "memo"]; - - /** Deprecated. An optional cryptographic receipt of payment which is not - implemented. - */ - bytes receipt = 2 [json_name = "receipt", deprecated = true]; - - /** - The hex-encoded preimage (32 byte) which will allow settling an incoming - HTLC payable to this preimage. When using REST, this field must be encoded - as base64. - */ - bytes r_preimage = 3 [json_name = "r_preimage"]; - - /** - The hash of the preimage. When using REST, this field must be encoded as - base64. - */ - bytes r_hash = 4 [json_name = "r_hash"]; - - /** - The value of this invoice in satoshis - - The fields value and value_msat are mutually exclusive. - */ - int64 value = 5 [json_name = "value"]; - - /** - The value of this invoice in millisatoshis - - The fields value and value_msat are mutually exclusive. - */ - int64 value_msat = 23 [json_name = "value_msat"]; - - /// Whether this invoice has been fulfilled - bool settled = 6 [json_name = "settled", deprecated = true]; - - /// When this invoice was created - int64 creation_date = 7 [json_name = "creation_date"]; - - /// When this invoice was settled - int64 settle_date = 8 [json_name = "settle_date"]; - - /** - A bare-bones invoice for a payment within the Lightning Network. With the - details of the invoice, the sender has all the data necessary to send a - payment to the recipient. - */ - string payment_request = 9 [json_name = "payment_request"]; - - /** - Hash (SHA-256) of a description of the payment. Used if the description of - payment (memo) is too long to naturally fit within the description field - of an encoded payment request. When using REST, this field must be encoded - as base64. - */ - bytes description_hash = 10 [json_name = "description_hash"]; - - /// Payment request expiry time in seconds. Default is 3600 (1 hour). - int64 expiry = 11 [json_name = "expiry"]; - - /// Fallback on-chain address. - string fallback_addr = 12 [json_name = "fallback_addr"]; - - /// Delta to use for the time-lock of the CLTV extended to the final hop. - uint64 cltv_expiry = 13 [json_name = "cltv_expiry"]; - - /** - Route hints that can each be individually used to assist in reaching the - invoice's destination. - */ - repeated RouteHint route_hints = 14 [json_name = "route_hints"]; - - /// Whether this invoice should include routing hints for private channels. - bool private = 15 [json_name = "private"]; - - /** - The "add" index of this invoice. Each newly created invoice will increment - this index making it monotonically increasing. Callers to the - SubscribeInvoices call can use this to instantly get notified of all added - invoices with an add_index greater than this one. - */ - uint64 add_index = 16 [json_name = "add_index"]; - - /** - The "settle" index of this invoice. Each newly settled invoice will - increment this index making it monotonically increasing. Callers to the - SubscribeInvoices call can use this to instantly get notified of all - settled invoices with an settle_index greater than this one. - */ - uint64 settle_index = 17 [json_name = "settle_index"]; - - /// Deprecated, use amt_paid_sat or amt_paid_msat. - int64 amt_paid = 18 [json_name = "amt_paid", deprecated = true]; - - /** - The amount that was accepted for this invoice, in satoshis. This will ONLY - be set if this invoice has been settled. We provide this field as if the - invoice was created with a zero value, then we need to record what amount - was ultimately accepted. Additionally, it's possible that the sender paid - MORE that was specified in the original invoice. So we'll record that here - as well. - */ - int64 amt_paid_sat = 19 [json_name = "amt_paid_sat"]; - - /** - The amount that was accepted for this invoice, in millisatoshis. This will - ONLY be set if this invoice has been settled. We provide this field as if - the invoice was created with a zero value, then we need to record what - amount was ultimately accepted. Additionally, it's possible that the sender - paid MORE that was specified in the original invoice. So we'll record that - here as well. - */ - int64 amt_paid_msat = 20 [json_name = "amt_paid_msat"]; - - enum InvoiceState { - OPEN = 0; - SETTLED = 1; - CANCELED = 2; - ACCEPTED = 3; - } - - /** - The state the invoice is in. - */ - InvoiceState state = 21 [json_name = "state"]; - - /// List of HTLCs paying to this invoice [EXPERIMENTAL]. - repeated InvoiceHTLC htlcs = 22 [json_name = "htlcs"]; -} - -enum InvoiceHTLCState { - ACCEPTED = 0; - SETTLED = 1; - CANCELED = 2; -} - -/// Details of an HTLC that paid to an invoice -message InvoiceHTLC { - /// Short channel id over which the htlc was received. - uint64 chan_id = 1 [json_name = "chan_id", jstype = JS_STRING]; - - /// Index identifying the htlc on the channel. - uint64 htlc_index = 2 [json_name = "htlc_index"]; - - /// The amount of the htlc in msat. - uint64 amt_msat = 3 [json_name = "amt_msat"]; - - /// Block height at which this htlc was accepted. - int32 accept_height = 4 [json_name = "accept_height"]; - - /// Time at which this htlc was accepted. - int64 accept_time = 5 [json_name = "accept_time"]; - - /// Time at which this htlc was settled or canceled. - int64 resolve_time = 6 [json_name = "resolve_time"]; - - /// Block height at which this htlc expires. - int32 expiry_height = 7 [json_name = "expiry_height"]; - - /// Current state the htlc is in. - InvoiceHTLCState state = 8 [json_name = "state"]; -} - -message AddInvoiceResponse { - bytes r_hash = 1 [json_name = "r_hash"]; - - /** - A bare-bones invoice for a payment within the Lightning Network. With the - details of the invoice, the sender has all the data necessary to send a - payment to the recipient. - */ - string payment_request = 2 [json_name = "payment_request"]; - - /** - The "add" index of this invoice. Each newly created invoice will increment - this index making it monotonically increasing. Callers to the - SubscribeInvoices call can use this to instantly get notified of all added - invoices with an add_index greater than this one. - */ - uint64 add_index = 16 [json_name = "add_index"]; -} -message PaymentHash { - /** - The hex-encoded payment hash of the invoice to be looked up. The passed - payment hash must be exactly 32 bytes, otherwise an error is returned. - Deprecated now that the REST gateway supports base64 encoding of bytes - fields. - */ - string r_hash_str = 1 [json_name = "r_hash_str", deprecated = true]; - - /** - The payment hash of the invoice to be looked up. When using REST, this field - must be encoded as base64. - */ - bytes r_hash = 2 [json_name = "r_hash"]; -} - -message ListInvoiceRequest { - /// If set, only unsettled invoices will be returned in the response. - bool pending_only = 1 [json_name = "pending_only"]; - - /** - The index of an invoice that will be used as either the start or end of a - query to determine which invoices should be returned in the response. - */ - uint64 index_offset = 4 [json_name = "index_offset"]; - - /// The max number of invoices to return in the response to this query. - uint64 num_max_invoices = 5 [json_name = "num_max_invoices"]; - - /** - If set, the invoices returned will result from seeking backwards from the - specified index offset. This can be used to paginate backwards. - */ - bool reversed = 6 [json_name = "reversed"]; -} -message ListInvoiceResponse { - /** - A list of invoices from the time slice of the time series specified in the - request. - */ - repeated Invoice invoices = 1 [json_name = "invoices"]; - - /** - The index of the last item in the set of returned invoices. This can be used - to seek further, pagination style. - */ - uint64 last_index_offset = 2 [json_name = "last_index_offset"]; - - /** - The index of the last item in the set of returned invoices. This can be used - to seek backwards, pagination style. - */ - uint64 first_index_offset = 3 [json_name = "first_index_offset"]; -} - -message InvoiceSubscription { - /** - If specified (non-zero), then we'll first start by sending out - notifications for all added indexes with an add_index greater than this - value. This allows callers to catch up on any events they missed while they - weren't connected to the streaming RPC. - */ - uint64 add_index = 1 [json_name = "add_index"]; - - /** - If specified (non-zero), then we'll first start by sending out - notifications for all settled indexes with an settle_index greater than - this value. This allows callers to catch up on any events they missed while - they weren't connected to the streaming RPC. - */ - uint64 settle_index = 2 [json_name = "settle_index"]; -} - - -message Payment { - /// The payment hash - string payment_hash = 1 [json_name = "payment_hash"]; - - /// Deprecated, use value_sat or value_msat. - int64 value = 2 [json_name = "value", deprecated = true]; - - /// Deprecated, use creation_time_ns - int64 creation_date = 3 [json_name = "creation_date", deprecated = true]; - - /// The path this payment took. - repeated string path = 4 [json_name = "path", deprecated = true]; - - /// Deprecated, use fee_sat or fee_msat. - int64 fee = 5 [json_name = "fee", deprecated = true]; - - /// The payment preimage - string payment_preimage = 6 [json_name = "payment_preimage"]; - - /// The value of the payment in satoshis - int64 value_sat = 7 [json_name = "value_sat"]; - - /// The value of the payment in milli-satoshis - int64 value_msat = 8 [json_name = "value_msat"]; - - /// The optional payment request being fulfilled. - string payment_request = 9 [json_name = "payment_request"]; - - enum PaymentStatus { - UNKNOWN = 0; - IN_FLIGHT = 1; - SUCCEEDED = 2; - FAILED = 3; - } - - // The status of the payment. - PaymentStatus status = 10 [json_name = "status"]; - - /// The fee paid for this payment in satoshis - int64 fee_sat = 11 [json_name = "fee_sat"]; - - /// The fee paid for this payment in milli-satoshis - int64 fee_msat = 12 [json_name = "fee_msat"]; - - /// The time in UNIX nanoseconds at which the payment was created. - int64 creation_time_ns = 13 [json_name = "creation_time_ns"]; - - /// The HTLCs made in attempt to settle the payment [EXPERIMENTAL]. - repeated HTLCAttempt htlcs = 14 [json_name = "htlcs"]; -} - -message HTLCAttempt { - enum HTLCStatus { - IN_FLIGHT = 0; - SUCCEEDED = 1; - FAILED = 2; - } - - /// The status of the HTLC. - HTLCStatus status = 1 [json_name = "status"]; - - /// The route taken by this HTLC. - Route route = 2 [json_name = "route"]; - - /// The time in UNIX nanoseconds at which this HTLC was sent. - int64 attempt_time_ns = 3 [json_name = "attempt_time_ns"]; - - /** - The time in UNIX nanoseconds at which this HTLC was settled or failed. - This value will not be set if the HTLC is still IN_FLIGHT. - */ - int64 resolve_time_ns = 4 [json_name = "resolve_time_ns"]; -} - -message ListPaymentsRequest { - /** - If true, then return payments that have not yet fully completed. This means - that pending payments, as well as failed payments will show up if this - field is set to True. - */ - bool include_incomplete = 1; -} - -message ListPaymentsResponse { - /// The list of payments - repeated Payment payments = 1 [json_name = "payments"]; -} - -message DeleteAllPaymentsRequest { -} - -message DeleteAllPaymentsResponse { -} - -message AbandonChannelRequest { - ChannelPoint channel_point = 1; -} - -message AbandonChannelResponse { -} - - -message DebugLevelRequest { - bool show = 1; - string level_spec = 2; -} -message DebugLevelResponse { - string sub_systems = 1 [json_name = "sub_systems"]; -} - -message PayReqString { - /// The payment request string to be decoded - string pay_req = 1; -} -message PayReq { - string destination = 1 [json_name = "destination"]; - string payment_hash = 2 [json_name = "payment_hash"]; - int64 num_satoshis = 3 [json_name = "num_satoshis"]; - int64 timestamp = 4 [json_name = "timestamp"]; - int64 expiry = 5 [json_name = "expiry"]; - string description = 6 [json_name = "description"]; - string description_hash = 7 [json_name = "description_hash"]; - string fallback_addr = 8 [json_name = "fallback_addr"]; - int64 cltv_expiry = 9 [json_name = "cltv_expiry"]; - repeated RouteHint route_hints = 10 [json_name = "route_hints"]; -} - -message FeeReportRequest {} -message ChannelFeeReport { - /// The channel that this fee report belongs to. - string chan_point = 1 [json_name = "channel_point"]; - - /// The base fee charged regardless of the number of milli-satoshis sent. - int64 base_fee_msat = 2 [json_name = "base_fee_msat"]; - - /// The amount charged per milli-satoshis transferred expressed in millionths of a satoshi. - int64 fee_per_mil = 3 [json_name = "fee_per_mil"]; - - /// The effective fee rate in milli-satoshis. Computed by dividing the fee_per_mil value by 1 million. - double fee_rate = 4 [json_name = "fee_rate"]; -} -message FeeReportResponse { - /// An array of channel fee reports which describes the current fee schedule for each channel. - repeated ChannelFeeReport channel_fees = 1 [json_name = "channel_fees"]; - - /// The total amount of fee revenue (in satoshis) the switch has collected over the past 24 hrs. - uint64 day_fee_sum = 2 [json_name = "day_fee_sum"]; - - /// The total amount of fee revenue (in satoshis) the switch has collected over the past 1 week. - uint64 week_fee_sum = 3 [json_name = "week_fee_sum"]; - - /// The total amount of fee revenue (in satoshis) the switch has collected over the past 1 month. - uint64 month_fee_sum = 4 [json_name = "month_fee_sum"]; -} - -message PolicyUpdateRequest { - oneof scope { - /// If set, then this update applies to all currently active channels. - bool global = 1 [json_name = "global"] ; - - /// If set, this update will target a specific channel. - ChannelPoint chan_point = 2 [json_name = "chan_point"]; - } - - /// The base fee charged regardless of the number of milli-satoshis sent. - int64 base_fee_msat = 3 [json_name = "base_fee_msat"]; - - /// The effective fee rate in milli-satoshis. The precision of this value goes up to 6 decimal places, so 1e-6. - double fee_rate = 4 [json_name = "fee_rate"]; - - /// The required timelock delta for HTLCs forwarded over the channel. - uint32 time_lock_delta = 5 [json_name = "time_lock_delta"]; - - /// If set, the maximum HTLC size in milli-satoshis. If unset, the maximum HTLC will be unchanged. - uint64 max_htlc_msat = 6 [json_name = "max_htlc_msat"]; -} -message PolicyUpdateResponse { -} - -message ForwardingHistoryRequest { - /// Start time is the starting point of the forwarding history request. All records beyond this point will be included, respecting the end time, and the index offset. - uint64 start_time = 1 [json_name = "start_time"]; - - /// End time is the end point of the forwarding history request. The response will carry at most 50k records between the start time and the end time. The index offset can be used to implement pagination. - uint64 end_time = 2 [json_name = "end_time"]; - - /// Index offset is the offset in the time series to start at. As each response can only contain 50k records, callers can use this to skip around within a packed time series. - uint32 index_offset = 3 [json_name = "index_offset"]; - - /// The max number of events to return in the response to this query. - uint32 num_max_events = 4 [json_name = "num_max_events"]; -} -message ForwardingEvent { - /// Timestamp is the time (unix epoch offset) that this circuit was completed. - uint64 timestamp = 1 [json_name = "timestamp"]; - - /// The incoming channel ID that carried the HTLC that created the circuit. - uint64 chan_id_in = 2 [json_name = "chan_id_in", jstype = JS_STRING]; - - /// The outgoing channel ID that carried the preimage that completed the circuit. - uint64 chan_id_out = 4 [json_name = "chan_id_out", jstype = JS_STRING]; - - /// The total amount (in satoshis) of the incoming HTLC that created half the circuit. - uint64 amt_in = 5 [json_name = "amt_in"]; - - /// The total amount (in satoshis) of the outgoing HTLC that created the second half of the circuit. - uint64 amt_out = 6 [json_name = "amt_out"]; - - /// The total fee (in satoshis) that this payment circuit carried. - uint64 fee = 7 [json_name = "fee"]; - - /// The total fee (in milli-satoshis) that this payment circuit carried. - uint64 fee_msat = 8 [json_name = "fee_msat"]; - - /// The total amount (in milli-satoshis) of the incoming HTLC that created half the circuit. - uint64 amt_in_msat = 9 [json_name = "amt_in_msat"]; - - /// The total amount (in milli-satoshis) of the outgoing HTLC that created the second half of the circuit. - uint64 amt_out_msat = 10 [json_name = "amt_out_msat"]; - - - // TODO(roasbeef): add settlement latency? - // * use FPE on the chan id? - // * also list failures? -} -message ForwardingHistoryResponse { - /// A list of forwarding events from the time slice of the time series specified in the request. - repeated ForwardingEvent forwarding_events = 1 [json_name = "forwarding_events"]; - - /// The index of the last time in the set of returned forwarding events. Can be used to seek further, pagination style. - uint32 last_offset_index = 2 [json_name = "last_offset_index"]; -} - -message ExportChannelBackupRequest { - /// The target channel point to obtain a back up for. - ChannelPoint chan_point = 1; -} - -message ChannelBackup { - /** - Identifies the channel that this backup belongs to. - */ - ChannelPoint chan_point = 1 [ json_name = "chan_point" ]; - - /** - Is an encrypted single-chan backup. this can be passed to - RestoreChannelBackups, or the WalletUnlocker Init and Unlock methods in - order to trigger the recovery protocol. When using REST, this field must be - encoded as base64. - */ - bytes chan_backup = 2 [ json_name = "chan_backup" ]; -} - -message MultiChanBackup { - /** - Is the set of all channels that are included in this multi-channel backup. - */ - repeated ChannelPoint chan_points = 1 [ json_name = "chan_points" ]; - - /** - A single encrypted blob containing all the static channel backups of the - channel listed above. This can be stored as a single file or blob, and - safely be replaced with any prior/future versions. When using REST, this - field must be encoded as base64. - */ - bytes multi_chan_backup = 2 [ json_name = "multi_chan_backup" ]; -} - -message ChanBackupExportRequest {} -message ChanBackupSnapshot { - /** - The set of new channels that have been added since the last channel backup - snapshot was requested. - */ - ChannelBackups single_chan_backups = 1 [ json_name = "single_chan_backups" ]; - - /** - A multi-channel backup that covers all open channels currently known to - lnd. - */ - MultiChanBackup multi_chan_backup = 2 [ json_name = "multi_chan_backup" ]; -} - -message ChannelBackups { - /** - A set of single-chan static channel backups. - */ - repeated ChannelBackup chan_backups = 1 [ json_name = "chan_backups" ]; -} - -message RestoreChanBackupRequest { - oneof backup { - /** - The channels to restore as a list of channel/backup pairs. - */ - ChannelBackups chan_backups = 1 [ json_name = "chan_backups" ]; - - /** - The channels to restore in the packed multi backup format. When using - REST, this field must be encoded as base64. - */ - bytes multi_chan_backup = 2 [ json_name = "multi_chan_backup" ]; - } -} -message RestoreBackupResponse {} - -message ChannelBackupSubscription {} - -message VerifyChanBackupResponse { -} - -message MacaroonPermission { - /// The entity a permission grants access to. - string entity = 1 [json_name = "entity"]; - - /// The action that is granted. - string action = 2 [json_name = "action"]; -} -message BakeMacaroonRequest { - /// The list of permissions the new macaroon should grant. - repeated MacaroonPermission permissions = 1 [json_name = "permissions"]; -} -message BakeMacaroonResponse { - /// The hex encoded macaroon, serialized in binary format. - string macaroon = 1 [json_name = "macaroon"]; -} diff --git a/config/walletunlocker.proto b/config/walletunlocker.proto index ec3ac257..6e5e4ed9 100644 --- a/config/walletunlocker.proto +++ b/config/walletunlocker.proto @@ -141,8 +141,24 @@ message InitWalletRequest { recover the funds in each channel from a remote force closed transaction. */ ChanBackupSnapshot channel_backups = 5; + + /* + stateless_init is an optional argument instructing the daemon NOT to create + any *.macaroon files in its filesystem. If this parameter is set, then the + admin macaroon returned in the response MUST be stored by the caller of the + RPC as otherwise all access to the daemon will be lost! + */ + bool stateless_init = 6; } message InitWalletResponse { + /* + The binary serialized admin macaroon that can be used to access the daemon + after creating the wallet. If the stateless_init parameter was set to true, + this is the ONLY copy of the macaroon and MUST be stored safely by the + caller. Otherwise a copy of this macaroon is also persisted on disk by the + daemon, together with other macaroon files. + */ + bytes admin_macaroon = 1; } message UnlockWalletRequest { @@ -171,6 +187,12 @@ message UnlockWalletRequest { recover the funds in each channel from a remote force closed transaction. */ ChanBackupSnapshot channel_backups = 3; + + /* + stateless_init is an optional argument instructing the daemon NOT to create + any *.macaroon files in its file system. + */ + bool stateless_init = 4; } message UnlockWalletResponse { } @@ -187,6 +209,30 @@ message ChangePasswordRequest { daemon. When using REST, this field must be encoded as base64. */ bytes new_password = 2; + + /* + stateless_init is an optional argument instructing the daemon NOT to create + any *.macaroon files in its filesystem. If this parameter is set, then the + admin macaroon returned in the response MUST be stored by the caller of the + RPC as otherwise all access to the daemon will be lost! + */ + bool stateless_init = 3; + + /* + new_macaroon_root_key is an optional argument instructing the daemon to + rotate the macaroon root key when set to true. This will invalidate all + previously generated macaroons. + */ + bool new_macaroon_root_key = 4; } message ChangePasswordResponse { -} \ No newline at end of file + /* + The binary serialized admin macaroon that can be used to access the daemon + after rotating the macaroon root key. If both the stateless_init and + new_macaroon_root_key parameter were set to true, this is the ONLY copy of + the macaroon that was created from the new root key and MUST be stored + safely by the caller. Otherwise a copy of this macaroon is also persisted on + disk by the daemon, together with other macaroon files. + */ + bytes admin_macaroon = 1; +} diff --git a/guntest.html b/guntest.html index 861398fb..09b02bd6 100644 --- a/guntest.html +++ b/guntest.html @@ -7,7 +7,7 @@ Document - + @@ -21,19 +21,31 @@ + + + + +
+
+

some random name i dont know

+

JUST TIPPED YOU!

+

100sats

+
+
+ + + \ No newline at end of file diff --git a/public/qrcode.min.js b/public/qrcode.min.js new file mode 100644 index 00000000..993e88f3 --- /dev/null +++ b/public/qrcode.min.js @@ -0,0 +1 @@ +var QRCode;!function(){function a(a){this.mode=c.MODE_8BIT_BYTE,this.data=a,this.parsedData=[];for(var b=[],d=0,e=this.data.length;e>d;d++){var f=this.data.charCodeAt(d);f>65536?(b[0]=240|(1835008&f)>>>18,b[1]=128|(258048&f)>>>12,b[2]=128|(4032&f)>>>6,b[3]=128|63&f):f>2048?(b[0]=224|(61440&f)>>>12,b[1]=128|(4032&f)>>>6,b[2]=128|63&f):f>128?(b[0]=192|(1984&f)>>>6,b[1]=128|63&f):b[0]=f,this.parsedData=this.parsedData.concat(b)}this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function b(a,b){this.typeNumber=a,this.errorCorrectLevel=b,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function i(a,b){if(void 0==a.length)throw new Error(a.length+"/"+b);for(var c=0;c=f;f++){var h=0;switch(b){case d.L:h=l[f][0];break;case d.M:h=l[f][1];break;case d.Q:h=l[f][2];break;case d.H:h=l[f][3]}if(h>=e)break;c++}if(c>l.length)throw new Error("Too long data");return c}function s(a){var b=encodeURI(a).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return b.length+(b.length!=a?3:0)}a.prototype={getLength:function(){return this.parsedData.length},write:function(a){for(var b=0,c=this.parsedData.length;c>b;b++)a.put(this.parsedData[b],8)}},b.prototype={addData:function(b){var c=new a(b);this.dataList.push(c),this.dataCache=null},isDark:function(a,b){if(0>a||this.moduleCount<=a||0>b||this.moduleCount<=b)throw new Error(a+","+b);return this.modules[a][b]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var d=0;d=7&&this.setupTypeNumber(a),null==this.dataCache&&(this.dataCache=b.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,c)},setupPositionProbePattern:function(a,b){for(var c=-1;7>=c;c++)if(!(-1>=a+c||this.moduleCount<=a+c))for(var d=-1;7>=d;d++)-1>=b+d||this.moduleCount<=b+d||(this.modules[a+c][b+d]=c>=0&&6>=c&&(0==d||6==d)||d>=0&&6>=d&&(0==c||6==c)||c>=2&&4>=c&&d>=2&&4>=d?!0:!1)},getBestMaskPattern:function(){for(var a=0,b=0,c=0;8>c;c++){this.makeImpl(!0,c);var d=f.getLostPoint(this);(0==c||a>d)&&(a=d,b=c)}return b},createMovieClip:function(a,b,c){var d=a.createEmptyMovieClip(b,c),e=1;this.make();for(var f=0;f=g;g++)for(var h=-2;2>=h;h++)this.modules[d+g][e+h]=-2==g||2==g||-2==h||2==h||0==g&&0==h?!0:!1}},setupTypeNumber:function(a){for(var b=f.getBCHTypeNumber(this.typeNumber),c=0;18>c;c++){var d=!a&&1==(1&b>>c);this.modules[Math.floor(c/3)][c%3+this.moduleCount-8-3]=d}for(var c=0;18>c;c++){var d=!a&&1==(1&b>>c);this.modules[c%3+this.moduleCount-8-3][Math.floor(c/3)]=d}},setupTypeInfo:function(a,b){for(var c=this.errorCorrectLevel<<3|b,d=f.getBCHTypeInfo(c),e=0;15>e;e++){var g=!a&&1==(1&d>>e);6>e?this.modules[e][8]=g:8>e?this.modules[e+1][8]=g:this.modules[this.moduleCount-15+e][8]=g}for(var e=0;15>e;e++){var g=!a&&1==(1&d>>e);8>e?this.modules[8][this.moduleCount-e-1]=g:9>e?this.modules[8][15-e-1+1]=g:this.modules[8][15-e-1]=g}this.modules[this.moduleCount-8][8]=!a},mapData:function(a,b){for(var c=-1,d=this.moduleCount-1,e=7,g=0,h=this.moduleCount-1;h>0;h-=2)for(6==h&&h--;;){for(var i=0;2>i;i++)if(null==this.modules[d][h-i]){var j=!1;g>>e));var k=f.getMask(b,d,h-i);k&&(j=!j),this.modules[d][h-i]=j,e--,-1==e&&(g++,e=7)}if(d+=c,0>d||this.moduleCount<=d){d-=c,c=-c;break}}}},b.PAD0=236,b.PAD1=17,b.createData=function(a,c,d){for(var e=j.getRSBlocks(a,c),g=new k,h=0;h8*l)throw new Error("code length overflow. ("+g.getLengthInBits()+">"+8*l+")");for(g.getLengthInBits()+4<=8*l&&g.put(0,4);0!=g.getLengthInBits()%8;)g.putBit(!1);for(;;){if(g.getLengthInBits()>=8*l)break;if(g.put(b.PAD0,8),g.getLengthInBits()>=8*l)break;g.put(b.PAD1,8)}return b.createBytes(g,e)},b.createBytes=function(a,b){for(var c=0,d=0,e=0,g=new Array(b.length),h=new Array(b.length),j=0;j=0?p.get(q):0}}for(var r=0,m=0;mm;m++)for(var j=0;jm;m++)for(var j=0;j=0;)b^=f.G15<=0;)b^=f.G18<>>=1;return b},getPatternPosition:function(a){return f.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,b,c){switch(a){case e.PATTERN000:return 0==(b+c)%2;case e.PATTERN001:return 0==b%2;case e.PATTERN010:return 0==c%3;case e.PATTERN011:return 0==(b+c)%3;case e.PATTERN100:return 0==(Math.floor(b/2)+Math.floor(c/3))%2;case e.PATTERN101:return 0==b*c%2+b*c%3;case e.PATTERN110:return 0==(b*c%2+b*c%3)%2;case e.PATTERN111:return 0==(b*c%3+(b+c)%2)%2;default:throw new Error("bad maskPattern:"+a)}},getErrorCorrectPolynomial:function(a){for(var b=new i([1],0),c=0;a>c;c++)b=b.multiply(new i([1,g.gexp(c)],0));return b},getLengthInBits:function(a,b){if(b>=1&&10>b)switch(a){case c.MODE_NUMBER:return 10;case c.MODE_ALPHA_NUM:return 9;case c.MODE_8BIT_BYTE:return 8;case c.MODE_KANJI:return 8;default:throw new Error("mode:"+a)}else if(27>b)switch(a){case c.MODE_NUMBER:return 12;case c.MODE_ALPHA_NUM:return 11;case c.MODE_8BIT_BYTE:return 16;case c.MODE_KANJI:return 10;default:throw new Error("mode:"+a)}else{if(!(41>b))throw new Error("type:"+b);switch(a){case c.MODE_NUMBER:return 14;case c.MODE_ALPHA_NUM:return 13;case c.MODE_8BIT_BYTE:return 16;case c.MODE_KANJI:return 12;default:throw new Error("mode:"+a)}}},getLostPoint:function(a){for(var b=a.getModuleCount(),c=0,d=0;b>d;d++)for(var e=0;b>e;e++){for(var f=0,g=a.isDark(d,e),h=-1;1>=h;h++)if(!(0>d+h||d+h>=b))for(var i=-1;1>=i;i++)0>e+i||e+i>=b||(0!=h||0!=i)&&g==a.isDark(d+h,e+i)&&f++;f>5&&(c+=3+f-5)}for(var d=0;b-1>d;d++)for(var e=0;b-1>e;e++){var j=0;a.isDark(d,e)&&j++,a.isDark(d+1,e)&&j++,a.isDark(d,e+1)&&j++,a.isDark(d+1,e+1)&&j++,(0==j||4==j)&&(c+=3)}for(var d=0;b>d;d++)for(var e=0;b-6>e;e++)a.isDark(d,e)&&!a.isDark(d,e+1)&&a.isDark(d,e+2)&&a.isDark(d,e+3)&&a.isDark(d,e+4)&&!a.isDark(d,e+5)&&a.isDark(d,e+6)&&(c+=40);for(var e=0;b>e;e++)for(var d=0;b-6>d;d++)a.isDark(d,e)&&!a.isDark(d+1,e)&&a.isDark(d+2,e)&&a.isDark(d+3,e)&&a.isDark(d+4,e)&&!a.isDark(d+5,e)&&a.isDark(d+6,e)&&(c+=40);for(var k=0,e=0;b>e;e++)for(var d=0;b>d;d++)a.isDark(d,e)&&k++;var l=Math.abs(100*k/b/b-50)/5;return c+=10*l}},g={glog:function(a){if(1>a)throw new Error("glog("+a+")");return g.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;a>=256;)a-=255;return g.EXP_TABLE[a]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},h=0;8>h;h++)g.EXP_TABLE[h]=1<h;h++)g.EXP_TABLE[h]=g.EXP_TABLE[h-4]^g.EXP_TABLE[h-5]^g.EXP_TABLE[h-6]^g.EXP_TABLE[h-8];for(var h=0;255>h;h++)g.LOG_TABLE[g.EXP_TABLE[h]]=h;i.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var b=new Array(this.getLength()+a.getLength()-1),c=0;cf;f++)for(var g=c[3*f+0],h=c[3*f+1],i=c[3*f+2],k=0;g>k;k++)e.push(new j(h,i));return e},j.getRsBlockTable=function(a,b){switch(b){case d.L:return j.RS_BLOCK_TABLE[4*(a-1)+0];case d.M:return j.RS_BLOCK_TABLE[4*(a-1)+1];case d.Q:return j.RS_BLOCK_TABLE[4*(a-1)+2];case d.H:return j.RS_BLOCK_TABLE[4*(a-1)+3];default:return void 0}},k.prototype={get:function(a){var b=Math.floor(a/8);return 1==(1&this.buffer[b]>>>7-a%8)},put:function(a,b){for(var c=0;b>c;c++)this.putBit(1==(1&a>>>b-c-1))},getLengthInBits:function(){return this.length},putBit:function(a){var b=Math.floor(this.length/8);this.buffer.length<=b&&this.buffer.push(0),a&&(this.buffer[b]|=128>>>this.length%8),this.length++}};var l=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],o=function(){var a=function(a,b){this._el=a,this._htOption=b};return a.prototype.draw=function(a){function g(a,b){var c=document.createElementNS("http://www.w3.org/2000/svg",a);for(var d in b)b.hasOwnProperty(d)&&c.setAttribute(d,b[d]);return c}var b=this._htOption,c=this._el,d=a.getModuleCount();Math.floor(b.width/d),Math.floor(b.height/d),this.clear();var h=g("svg",{viewBox:"0 0 "+String(d)+" "+String(d),width:"100%",height:"100%",fill:b.colorLight});h.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),c.appendChild(h),h.appendChild(g("rect",{fill:b.colorDark,width:"1",height:"1",id:"template"}));for(var i=0;d>i;i++)for(var j=0;d>j;j++)if(a.isDark(i,j)){var k=g("use",{x:String(i),y:String(j)});k.setAttributeNS("http://www.w3.org/1999/xlink","href","#template"),h.appendChild(k)}},a.prototype.clear=function(){for(;this._el.hasChildNodes();)this._el.removeChild(this._el.lastChild)},a}(),p="svg"===document.documentElement.tagName.toLowerCase(),q=p?o:m()?function(){function a(){this._elImage.src=this._elCanvas.toDataURL("image/png"),this._elImage.style.display="block",this._elCanvas.style.display="none"}function d(a,b){var c=this;if(c._fFail=b,c._fSuccess=a,null===c._bSupportDataURI){var d=document.createElement("img"),e=function(){c._bSupportDataURI=!1,c._fFail&&_fFail.call(c)},f=function(){c._bSupportDataURI=!0,c._fSuccess&&c._fSuccess.call(c)};return d.onabort=e,d.onerror=e,d.onload=f,d.src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",void 0}c._bSupportDataURI===!0&&c._fSuccess?c._fSuccess.call(c):c._bSupportDataURI===!1&&c._fFail&&c._fFail.call(c)}if(this._android&&this._android<=2.1){var b=1/window.devicePixelRatio,c=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(a,d,e,f,g,h,i,j){if("nodeName"in a&&/img/i.test(a.nodeName))for(var l=arguments.length-1;l>=1;l--)arguments[l]=arguments[l]*b;else"undefined"==typeof j&&(arguments[1]*=b,arguments[2]*=b,arguments[3]*=b,arguments[4]*=b);c.apply(this,arguments)}}var e=function(a,b){this._bIsPainted=!1,this._android=n(),this._htOption=b,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=b.width,this._elCanvas.height=b.height,a.appendChild(this._elCanvas),this._el=a,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._elImage=document.createElement("img"),this._elImage.style.display="none",this._el.appendChild(this._elImage),this._bSupportDataURI=null};return e.prototype.draw=function(a){var b=this._elImage,c=this._oContext,d=this._htOption,e=a.getModuleCount(),f=d.width/e,g=d.height/e,h=Math.round(f),i=Math.round(g);b.style.display="none",this.clear();for(var j=0;e>j;j++)for(var k=0;e>k;k++){var l=a.isDark(j,k),m=k*f,n=j*g;c.strokeStyle=l?d.colorDark:d.colorLight,c.lineWidth=1,c.fillStyle=l?d.colorDark:d.colorLight,c.fillRect(m,n,f,g),c.strokeRect(Math.floor(m)+.5,Math.floor(n)+.5,h,i),c.strokeRect(Math.ceil(m)-.5,Math.ceil(n)-.5,h,i)}this._bIsPainted=!0},e.prototype.makeImage=function(){this._bIsPainted&&d.call(this,a)},e.prototype.isPainted=function(){return this._bIsPainted},e.prototype.clear=function(){this._oContext.clearRect(0,0,this._elCanvas.width,this._elCanvas.height),this._bIsPainted=!1},e.prototype.round=function(a){return a?Math.floor(1e3*a)/1e3:a},e}():function(){var a=function(a,b){this._el=a,this._htOption=b};return a.prototype.draw=function(a){for(var b=this._htOption,c=this._el,d=a.getModuleCount(),e=Math.floor(b.width/d),f=Math.floor(b.height/d),g=[''],h=0;d>h;h++){g.push("");for(var i=0;d>i;i++)g.push('');g.push("")}g.push("
"),c.innerHTML=g.join("");var j=c.childNodes[0],k=(b.width-j.offsetWidth)/2,l=(b.height-j.offsetHeight)/2;k>0&&l>0&&(j.style.margin=l+"px "+k+"px")},a.prototype.clear=function(){this._el.innerHTML=""},a}();QRCode=function(a,b){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:d.H},"string"==typeof b&&(b={text:b}),b)for(var c in b)this._htOption[c]=b[c];"string"==typeof a&&(a=document.getElementById(a)),this._android=n(),this._el=a,this._oQRCode=null,this._oDrawing=new q(this._el,this._htOption),this._htOption.text&&this.makeCode(this._htOption.text)},QRCode.prototype.makeCode=function(a){this._oQRCode=new b(r(a,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(a),this._oQRCode.make(),this._el.title=a,this._oDrawing.draw(this._oQRCode),this.makeImage()},QRCode.prototype.makeImage=function(){"function"==typeof this._oDrawing.makeImage&&(!this._android||this._android>=3)&&this._oDrawing.makeImage()},QRCode.prototype.clear=function(){this._oDrawing.clear()},QRCode.CorrectLevel=d}(); \ No newline at end of file diff --git a/services/auth/auth.js b/services/auth/auth.js index 8ffd8c1c..d44ac608 100644 --- a/services/auth/auth.js +++ b/services/auth/auth.js @@ -6,7 +6,7 @@ const jwt = require('jsonwebtoken') const uuidv1 = require('uuid/v1') const jsonfile = require('jsonfile') const path = require('path') -const logger = require('winston') +const logger = require('../../config/log') const Storage = require('node-persist') const FS = require('../../utils/fs') diff --git a/services/gunDB/Mediator/index.js b/services/gunDB/Mediator/index.js index cbcaf748..a906c2a3 100644 --- a/services/gunDB/Mediator/index.js +++ b/services/gunDB/Mediator/index.js @@ -2,20 +2,20 @@ * @format */ const Common = require('shock-common') -const Gun = require('gun') +const Gun = require('../../../utils/GunSmith') // @ts-ignore require('gun/nts') -const logger = require('winston') +const logger = require('../../../config/log') // @ts-ignore -Gun.log = () => {} +// Gun.log = () => {} // @ts-ignore require('gun/lib/open') // @ts-ignore require('gun/lib/load') -const debounce = require('lodash/debounce') //@ts-ignore const { encryptedEmit, encryptedOn } = require('../../../utils/ECC/socket') const Key = require('../contact-api/key') +const Config = require('../config') /** @type {import('../contact-api/SimpleGUN').ISEA} */ // @ts-ignore @@ -178,7 +178,7 @@ mySEA.secret = async (recipientOrSenderEpub, recipientOrSenderSEA) => { if (recipientOrSenderSEA === null) { throw new TypeError( - 'sea has to be nont null, args: ' + + 'sea has to be non null, args: ' + `${JSON.stringify(recipientOrSenderEpub)} -- ${JSON.stringify( recipientOrSenderSEA )}` @@ -187,7 +187,7 @@ mySEA.secret = async (recipientOrSenderEpub, recipientOrSenderSEA) => { if (recipientOrSenderEpub === recipientOrSenderSEA.pub) { throw new Error( - 'Do not use pub for mysecret, args: ' + + 'Do not use pub for mySecret, args: ' + `${JSON.stringify(recipientOrSenderEpub)} -- ${JSON.stringify( recipientOrSenderSEA )}` @@ -215,14 +215,9 @@ mySEA.secret = async (recipientOrSenderEpub, recipientOrSenderSEA) => { return sec } -const auth = require('../../auth/auth') - const { Constants } = require('shock-common') -const { Action, Event } = Constants const API = require('../contact-api/index') -const Config = require('../config') -// const { nonEncryptedRoutes } = require('../../../utils/protectedRoutes') /** * @typedef {import('../contact-api/SimpleGUN').GUNNode} GUNNode @@ -257,25 +252,21 @@ const Config = require('../config') /** * @typedef {object} SimpleSocket * @prop {(eventName: string, data?: Emission|EncryptedEmissionLegacy|EncryptedEmission|ValidDataValue) => void} emit - * @prop {(eventName: string, handler: (data: any) => void) => void} on + * @prop {(eventName: string, handler: (data: any, callback: (err?: any, data?: any) => void) => void) => void} on * @prop {{ auth: { [key: string]: any } }} handshake */ /* eslint-disable init-declarations */ -/** @type {GUNNode} */ -// @ts-ignore -let gun +const gun = Gun({ + axe: false, + peers: Config.PEERS +}) -/** @type {UserGUNNode} */ -let user +const user = gun.user() /* eslint-enable init-declarations */ -/** @type {string|null} */ -let _currentAlias = null -/** @type {string|null} */ - /** @type {string|null} */ let mySec = null @@ -290,12 +281,12 @@ const isAuthenticating = () => _isAuthenticating const isRegistering = () => _isRegistering const getGun = () => { - return gun + throw new Error('NO GUNS') } const getUser = () => { if (!user.is) { - logger.warn('called getUser() without being authed') + logger.warn('called getUser() without being authenticated') throw new Error(Constants.ErrorCode.NOT_AUTH) } return user @@ -305,10 +296,9 @@ const getUser = () => { * Returns a promise containing the public key of the newly created user. * @param {string} alias * @param {string} pass - * @param {UserGUNNode=} __user * @returns {Promise} */ -const authenticate = async (alias, pass, __user) => { +const authenticate = async (alias, pass) => { if (!Common.isPopulatedString(alias)) { throw new TypeError( `Expected alias to be a populated string, instead got: ${alias}` @@ -319,85 +309,6 @@ const authenticate = async (alias, pass, __user) => { `Expected pass to be a populated string, instead got: ${pass}` ) } - const _user = __user || user - const isFreshGun = _user !== user - if (isFreshGun) { - const ack = await new Promise(res => { - _user.auth(alias, pass, _ack => { - res(_ack) - }) - }) - - if (typeof ack.err === 'string') { - throw new Error(ack.err) - } else if (typeof ack.sea === 'object') { - // clock skew - await new Promise(res => setTimeout(res, 2000)) - - await /** @type {Promise} */ (new Promise((res, rej) => { - _user.get(Key.FOLLOWS).put( - { - unused: null - }, - ack => { - if (ack.err && typeof ack.err !== 'number') { - rej(new Error(`Error initializing follows: ${ack.err}`)) - } else { - res() - } - } - ) - })) - - return ack.sea.pub - } else { - throw new Error('Unknown error.') - } - } - - if (isAuthenticated()) { - if (alias !== _currentAlias) { - throw new Error( - `Tried to re-authenticate with an alias different to that of stored one, tried: ${alias} - stored: ${_currentAlias}, logoff first if need to change aliases.` - ) - } - - // clock skew - await new Promise(res => setTimeout(res, 2000)) - - await /** @type {Promise} */ (new Promise((res, rej) => { - _user.get(Key.FOLLOWS).put( - { - unused: null - }, - ack => { - if (ack.err && typeof ack.err !== 'number') { - rej(new Error(`Error initializing follows: ${ack.err}`)) - } else { - res() - } - } - ) - })) - - // move this to a subscription; implement off() ? todo - API.Jobs.onAcceptedRequests(_user, mySEA) - API.Jobs.onOrders(_user, gun, mySEA) - API.Jobs.lastSeenNode(_user) - - API.Events.onAvatar(() => {}, user)() - API.Events.onBio(() => {}, user) - API.Events.onBlacklist(() => {}, user) - API.Events.onChats(() => {})() - API.Events.onCurrentHandshakeAddress(() => {}, user)() - API.Events.onDisplayName(() => {}, user)() - API.Events.onOutgoing(() => {})() - API.Events.onSeedBackup(() => {}, user, mySEA) - API.Events.onSimplerReceivedRequests(() => {})() - API.Events.onSimplerSentRequests(() => {})() - - return _user._.sea.pub - } if (isAuthenticating()) { throw new Error( @@ -408,7 +319,7 @@ const authenticate = async (alias, pass, __user) => { _isAuthenticating = true const ack = await new Promise(res => { - _user.auth(alias, pass, _ack => { + user.auth(alias, pass, _ack => { res(_ack) }) }) @@ -418,20 +329,26 @@ const authenticate = async (alias, pass, __user) => { if (typeof ack.err === 'string') { throw new Error(ack.err) } else if (typeof ack.sea === 'object') { - mySec = await mySEA.secret(_user._.sea.epub, _user._.sea) - - _currentAlias = alias - - await new Promise(res => setTimeout(res, 5000)) + mySec = await mySEA.secret(user._.sea.epub, user._.sea) + // clock skew + await new Promise(res => setTimeout(res, 2000)) await /** @type {Promise} */ (new Promise((res, rej) => { - _user.get(Key.FOLLOWS).put( + user.get(Key.FOLLOWS).put( { unused: null }, ack => { if (ack.err && typeof ack.err !== 'number') { - rej(new Error(`Error initializing follows: ${ack.err}`)) + rej( + new Error( + `Error initializing follows: ${JSON.stringify( + ack.err, + null, + 4 + )}` + ) + ) } else { res() } @@ -439,23 +356,14 @@ const authenticate = async (alias, pass, __user) => { ) })) - API.Jobs.onAcceptedRequests(_user, mySEA) - API.Jobs.onOrders(_user, gun, mySEA) - API.Jobs.lastSeenNode(_user) - - API.Events.onAvatar(() => {}, user)() - API.Events.onBio(() => {}, user) - API.Events.onBlacklist(() => {}, user) - API.Events.onChats(() => {})() - API.Events.onCurrentHandshakeAddress(() => {}, user)() - API.Events.onDisplayName(() => {}, user)() - API.Events.onOutgoing(() => {})() + // move this to a subscription; implement off() ? todo + API.Jobs.onOrders(user, gun, mySEA) + API.Jobs.lastSeenNode(user) API.Events.onSeedBackup(() => {}, user, mySEA) - API.Events.onSimplerReceivedRequests(() => {})() - API.Events.onSimplerSentRequests(() => {})() return ack.sea.pub } else { + logger.info(ack) logger.error( `Unknown error, wrong password? Ack looks like: ${JSON.stringify(ack)}` ) @@ -467,843 +375,6 @@ const logoff = () => { user.leave() } -const instantiateGun = () => { - if (user) { - user.leave() - } - // @ts-ignore - user = null - if (gun) { - gun.off() - } - // @ts-ignore - gun = null - - const _gun = /** @type {unknown} */ (new Gun({ - axe: false, - multicast: false, - peers: ['https://gun.shock.network:8765/gun'] - })) - - gun = /** @type {GUNNode} */ (_gun) - - user = gun.user() -} - -instantiateGun() - -const freshGun = () => { - return { - gun, - user - } -} - -/** - * @param {string} token - * @returns {Promise} - */ -const isValidToken = async token => { - const validation = await auth.validateToken(token) - - if (typeof validation !== 'object') { - return false - } - - if (validation === null) { - return false - } - - if (typeof validation.valid !== 'boolean') { - return false - } - - return validation.valid -} - -/** - * @param {string} token - * @throws {Error} If the token is invalid - * @returns {Promise} - */ -const throwOnInvalidToken = async token => { - const isValid = await isValidToken(token) - - if (!isValid) { - throw new Error('Token expired.') - } -} - -class Mediator { - /** - * @param {Readonly} socket - */ - constructor(socket) { - this.socket = this.encryptSocketInstance(socket) - - this.connected = true - - this.socket.on('disconnect', this.onDisconnect) - - this.socket.on(Action.ACCEPT_REQUEST, this.acceptRequest) - this.socket.on(Action.BLACKLIST, this.blacklist) - this.socket.on( - Action.GENERATE_NEW_HANDSHAKE_NODE, - this.generateHandshakeNode - ) - this.socket.on('GENERATE_ORDER_ADDRESS', this.generateOrderAddress) - this.socket.on('INIT_FEED_WALL', this.initWall) - this.socket.on(Action.SEND_HANDSHAKE_REQUEST, this.sendHandshakeRequest) - this.socket.on( - Action.SEND_HANDSHAKE_REQUEST_WITH_INITIAL_MSG, - this.sendHRWithInitialMsg - ) - this.socket.on(Action.SEND_MESSAGE, this.sendMessage) - this.socket.on(Action.SET_AVATAR, this.setAvatar) - this.socket.on(Action.SET_DISPLAY_NAME, this.setDisplayName) - this.socket.on(Action.SEND_PAYMENT, this.sendPayment) - this.socket.on(Action.SET_BIO, this.setBio) - this.socket.on(Action.DISCONNECT, this.disconnect) - - this.socket.on(Event.ON_AVATAR, this.onAvatar) - this.socket.on(Event.ON_BLACKLIST, this.onBlacklist) - this.socket.on(Event.ON_CHATS, this.onChats) - this.socket.on(Event.ON_DISPLAY_NAME, this.onDisplayName) - this.socket.on(Event.ON_HANDSHAKE_ADDRESS, this.onHandshakeAddress) - this.socket.on(Event.ON_RECEIVED_REQUESTS, this.onReceivedRequests) - this.socket.on(Event.ON_SENT_REQUESTS, this.onSentRequests) - this.socket.on(Event.ON_BIO, this.onBio) - this.socket.on(Event.ON_SEED_BACKUP, this.onSeedBackup) - - this.socket.on(Constants.Misc.IS_GUN_AUTH, this.isGunAuth) - - this.socket.on(Action.SET_LAST_SEEN_APP, this.setLastSeenApp) - - Object.values(Action).forEach(actionConstant => - this.socket.on(actionConstant, this.setLastSeenApp) - ) - } - - /** @param {SimpleSocket} socket */ - encryptSocketInstance = socket => { - const emit = encryptedEmit(socket) - const on = encryptedOn(socket) - - return { - /** - * @type {SimpleSocket['on']} - */ - on, - /** @type {SimpleSocket['emit']} */ - emit - } - } - - /** @param {{ token: string }} body */ - setLastSeenApp = async body => { - logger.info('setLastSeen Called') - try { - await throwOnInvalidToken(body.token) - await API.Actions.setLastSeenApp() - this.socket.emit(Action.SET_LAST_SEEN_APP, { - ok: true, - msg: null, - origBody: body - }) - } catch (e) { - this.socket.emit(Action.SET_LAST_SEEN_APP, { - ok: false, - msg: e.message, - origBody: body - }) - } - } - - isGunAuth = () => { - try { - const isGunAuth = isAuthenticated() - - this.socket.emit(Constants.Misc.IS_GUN_AUTH, { - ok: true, - msg: { - isGunAuth - }, - origBody: {} - }) - } catch (err) { - this.socket.emit(Constants.Misc.IS_GUN_AUTH, { - ok: false, - msg: err.message, - origBody: {} - }) - } - } - - /** - * @param {Readonly<{ requestID: string , token: string }>} body - */ - acceptRequest = async body => { - try { - const { requestID, token } = body - - await throwOnInvalidToken(token) - - await API.Actions.acceptRequest(requestID, gun, user, mySEA) - - this.socket.emit(Action.ACCEPT_REQUEST, { - ok: true, - msg: null, - origBody: body - }) - } catch (err) { - logger.info(err) - this.socket.emit(Action.ACCEPT_REQUEST, { - ok: false, - msg: err.message, - origBody: body - }) - } - } - - /** - * @param {Readonly<{ publicKey: string , token: string }>} body - */ - blacklist = async body => { - try { - const { publicKey, token } = body - - await throwOnInvalidToken(token) - - await API.Actions.blacklist(publicKey, user) - - this.socket.emit(Action.BLACKLIST, { - ok: true, - msg: null, - origBody: body - }) - } catch (err) { - logger.info(err) - this.socket.emit(Action.BLACKLIST, { - ok: false, - msg: err.message, - origBody: body - }) - } - } - - onDisconnect = () => { - this.connected = false - } - - /** - * @param {Readonly<{ token: string }>} body - */ - generateHandshakeNode = async body => { - try { - const { token } = body - - await throwOnInvalidToken(token) - - await API.Actions.generateHandshakeAddress() - - this.socket.emit(Action.GENERATE_NEW_HANDSHAKE_NODE, { - ok: true, - msg: null, - origBody: body - }) - } catch (err) { - logger.info(err) - this.socket.emit(Action.GENERATE_NEW_HANDSHAKE_NODE, { - ok: false, - msg: err.message, - origBody: body - }) - } - } - - /** - * @param {Readonly<{ token: string }>} body - */ - generateOrderAddress = async body => { - try { - const { token } = body - - await throwOnInvalidToken(token) - - await API.Actions.generateOrderAddress(user) - - this.socket.emit('GENERATE_ORDER_ADDRESS', { - ok: true, - msg: null, - origBody: body - }) - } catch (err) { - logger.info(err) - this.socket.emit('GENERATE_ORDER_ADDRESS', { - ok: false, - msg: err.message, - origBody: body - }) - } - } - - /** - * @param {Readonly<{ token: string }>} body - */ - initWall = async body => { - try { - const { token } = body - - await throwOnInvalidToken(token) - - await API.Actions.initWall() - - this.socket.emit('INIT_FEED_WALL', { - ok: true, - msg: null, - origBody: body - }) - } catch (err) { - logger.info(err) - this.socket.emit('INIT_FEED_WALL', { - ok: false, - msg: err.message, - origBody: body - }) - } - } - - /** - * @param {Readonly<{ recipientPublicKey: string , token: string }>} body - */ - sendHandshakeRequest = async body => { - try { - if (Config.SHOW_LOG) { - logger.info('\n') - logger.info('------------------------------') - logger.info('will now try to send a handshake request') - logger.info('------------------------------') - logger.info('\n') - } - - const { recipientPublicKey, token } = body - - await throwOnInvalidToken(token) - - await API.Actions.sendHandshakeRequest( - recipientPublicKey, - gun, - user, - mySEA - ) - - if (Config.SHOW_LOG) { - logger.info('\n') - logger.info('------------------------------') - logger.info('handshake request successfuly sent') - logger.info('------------------------------') - logger.info('\n') - } - - this.socket.emit(Action.SEND_HANDSHAKE_REQUEST, { - ok: true, - msg: null, - origBody: body - }) - } catch (err) { - if (Config.SHOW_LOG) { - logger.info('\n') - logger.info('------------------------------') - logger.info('handshake request send fail: ' + err.message) - logger.info('------------------------------') - logger.info('\n') - } - - this.socket.emit(Action.SEND_HANDSHAKE_REQUEST, { - ok: false, - msg: err.message, - origBody: body - }) - } - } - - /** - * @param {Readonly<{ initialMsg: string , recipientPublicKey: string , token: string }>} body - */ - sendHRWithInitialMsg = async body => { - try { - const { initialMsg, recipientPublicKey, token } = body - - await throwOnInvalidToken(token) - - await API.Actions.sendHRWithInitialMsg( - initialMsg, - recipientPublicKey, - gun, - user, - mySEA - ) - - this.socket.emit(Action.SEND_HANDSHAKE_REQUEST_WITH_INITIAL_MSG, { - ok: true, - msg: null, - origBody: body - }) - } catch (err) { - logger.info(err) - this.socket.emit(Action.SEND_HANDSHAKE_REQUEST_WITH_INITIAL_MSG, { - ok: false, - msg: err.message, - origBody: body - }) - } - } - - /** - * @param {Readonly<{ body: string , recipientPublicKey: string , token: string }>} reqBody - */ - sendMessage = async reqBody => { - try { - const { body, recipientPublicKey, token } = reqBody - - await throwOnInvalidToken(token) - - this.socket.emit(Action.SEND_MESSAGE, { - ok: true, - msg: await API.Actions.sendMessage( - recipientPublicKey, - body, - user, - mySEA - ), - origBody: reqBody - }) - } catch (err) { - logger.info(err) - this.socket.emit(Action.SEND_MESSAGE, { - ok: false, - msg: err.message, - origBody: reqBody - }) - } - } - - /** - * @param {Readonly<{ uuid: string, recipientPub: string, amount: number, memo: string, token: string, feeLimit:number }>} reqBody - */ - sendPayment = async reqBody => { - try { - const { recipientPub, amount, memo, feeLimit, token } = reqBody - - await throwOnInvalidToken(token) - - const preimage = await API.Actions.sendPayment( - recipientPub, - amount, - memo, - feeLimit - ) - - this.socket.emit(Action.SEND_PAYMENT, { - ok: true, - msg: preimage, - origBody: reqBody - }) - } catch (err) { - logger.info(err) - this.socket.emit(Action.SEND_PAYMENT, { - ok: false, - msg: err.message, - origBody: reqBody - }) - } - } - - /** - * @param {Readonly<{ avatar: string|null , token: string }>} body - */ - setAvatar = async body => { - try { - const { avatar, token } = body - - await throwOnInvalidToken(token) - - await API.Actions.setAvatar(avatar, user) - - this.socket.emit(Action.SET_AVATAR, { - ok: true, - msg: null, - origBody: body - }) - } catch (err) { - logger.info(err) - this.socket.emit(Action.SET_AVATAR, { - ok: false, - msg: err.message, - origBody: body - }) - } - } - - /** - * @param {Readonly<{ displayName: string , token: string }>} body - */ - setDisplayName = async body => { - try { - const { displayName, token } = body - - await throwOnInvalidToken(token) - - await API.Actions.setDisplayName(displayName, user) - - this.socket.emit(Action.SET_DISPLAY_NAME, { - ok: true, - msg: null, - origBody: body - }) - } catch (err) { - logger.info(err) - this.socket.emit(Action.SET_DISPLAY_NAME, { - ok: false, - msg: err.message, - origBody: body - }) - } - } - - ////////////////////////////////////////////////////////////////////////////// - - /** - * @param {Readonly<{ token: string }>} body - */ - onAvatar = async body => { - try { - const { token } = body - - await throwOnInvalidToken(token) - - API.Events.onAvatar(avatar => { - if (Config.SHOW_LOG) { - logger.info('---avatar---') - logger.info(avatar || 'null') - logger.info('-----------------------') - } - - this.socket.emit(Event.ON_AVATAR, { - msg: avatar, - ok: true, - origBody: body - }) - }, user) - } catch (err) { - logger.info(err) - this.socket.emit(Event.ON_AVATAR, { - ok: false, - msg: err.message, - origBody: body - }) - } - } - - /** - * @param {Readonly<{ token: string }>} body - */ - onBlacklist = async body => { - try { - const { token } = body - - await throwOnInvalidToken(token) - - API.Events.onBlacklist(blacklist => { - if (Config.SHOW_LOG) { - logger.info('---blacklist---') - logger.info(blacklist.join(',')) - logger.info('-----------------------') - } - - this.socket.emit(Event.ON_BLACKLIST, { - msg: blacklist, - ok: true, - origBody: body - }) - }, user) - } catch (err) { - logger.info(err) - this.socket.emit(Event.ON_BLACKLIST, { - ok: false, - msg: err.message, - origBody: body - }) - } - } - - /** - * @param {Readonly<{ token: string }>} body - */ - onChats = async body => { - try { - const { token } = body - - // logger.info('ON_CHATS', body) - - await throwOnInvalidToken(token) - - API.Events.onChats(chats => { - if (Config.SHOW_LOG) { - logger.info('---chats---') - logger.info(JSON.stringify(chats)) - logger.info('-----------------------') - } - - this.socket.emit(Event.ON_CHATS, { - msg: chats, - ok: true, - origBody: body - }) - }) - } catch (err) { - logger.info(err) - this.socket.emit(Event.ON_CHATS, { - ok: false, - msg: err.message, - origBody: body - }) - } - } - - /** - * @param {Readonly<{ token: string }>} body - */ - onDisplayName = async body => { - try { - const { token } = body - - await throwOnInvalidToken(token) - - API.Events.onDisplayName(displayName => { - if (Config.SHOW_LOG) { - logger.info('---displayName---') - logger.info(displayName || 'null or empty string') - logger.info('-----------------------') - } - - this.socket.emit(Event.ON_DISPLAY_NAME, { - msg: displayName, - ok: true, - origBody: body - }) - }, user) - } catch (err) { - logger.info(err) - this.socket.emit(Event.ON_DISPLAY_NAME, { - ok: false, - msg: err.message, - origBody: body - }) - } - } - - /** - * @param {Readonly<{ token: string }>} body - */ - onHandshakeAddress = async body => { - try { - const { token } = body - - await throwOnInvalidToken(token) - - API.Events.onCurrentHandshakeAddress(addr => { - if (Config.SHOW_LOG) { - logger.info('---addr---') - logger.info(addr || 'null or empty string') - logger.info('-----------------------') - } - - this.socket.emit(Event.ON_HANDSHAKE_ADDRESS, { - ok: true, - msg: addr, - origBody: body - }) - }, user) - } catch (err) { - logger.info(err) - this.socket.emit(Event.ON_HANDSHAKE_ADDRESS, { - ok: false, - msg: err.message, - origBody: body - }) - } - } - - /** - * @param {Readonly<{ token: string }>} body - */ - onReceivedRequests = async body => { - try { - const { token } = body - - await throwOnInvalidToken(token) - - API.Events.onSimplerReceivedRequests(receivedRequests => { - this.socket.emit(Event.ON_RECEIVED_REQUESTS, { - msg: receivedRequests, - ok: true, - origBody: body - }) - }) - } catch (err) { - logger.info(err) - this.socket.emit(Event.ON_RECEIVED_REQUESTS, { - msg: err.message, - ok: false, - origBody: body - }) - } - } - - onSentRequestsSubbed = false - - /** - * @param {Readonly<{ token: string }>} body - */ - onSentRequests = async body => { - try { - const { token } = body - - await throwOnInvalidToken(token) - - if (!this.onSentRequestsSubbed) { - this.onSentRequestsSubbed = true - - API.Events.onSimplerSentRequests( - debounce(sentRequests => { - // logger.info( - // `new Reqss in mediator: ${JSON.stringify(sentRequests)}` - // ) - this.socket.emit(Event.ON_SENT_REQUESTS, { - msg: sentRequests, - ok: true, - origBody: body - }) - }, 1000) - ) - } - } catch (err) { - logger.info(err) - this.socket.emit(Event.ON_SENT_REQUESTS, { - msg: err.message, - ok: false, - origBody: body - }) - } - } - - /** - * @param {Readonly<{ token: string }>} body - */ - onBio = async body => { - try { - const { token } = body - - await throwOnInvalidToken(token) - - API.Events.onBio(bio => { - this.socket.emit(Event.ON_BIO, { - msg: bio, - ok: true, - origBody: body - }) - }, user) - } catch (err) { - logger.info(err) - this.socket.emit(Event.ON_BIO, { - ok: false, - msg: err.message, - origBody: body - }) - } - } - - /** - * @param {Readonly<{ bio: string|null , token: string }>} body - */ - setBio = async body => { - try { - const { bio, token } = body - - await throwOnInvalidToken(token) - - await API.Actions.setBio(bio, user) - - this.socket.emit(Action.SET_BIO, { - ok: true, - msg: null, - origBody: body - }) - } catch (err) { - logger.info(err) - this.socket.emit(Action.SET_BIO, { - ok: false, - msg: err.message, - origBody: body - }) - } - } - - /** - * @param {Readonly<{ token: string }>} body - */ - onSeedBackup = async body => { - try { - const { token } = body - - await throwOnInvalidToken(token) - - await API.Events.onSeedBackup( - seedBackup => { - this.socket.emit(Event.ON_SEED_BACKUP, { - ok: true, - msg: seedBackup, - origBody: body - }) - }, - user, - mySEA - ) - } catch (err) { - logger.info(err) - this.socket.emit(Event.ON_SEED_BACKUP, { - ok: false, - msg: err.message, - origBody: body - }) - } - } - - /** @param {Readonly<{ pub: string, token: string }>} body */ - disconnect = async body => { - try { - const { pub, token } = body - - await throwOnInvalidToken(token) - - await API.Actions.disconnect(pub) - - this.socket.emit(Action.DISCONNECT, { - ok: true, - msg: null, - origBody: body - }) - } catch (err) { - this.socket.emit(Action.DISCONNECT, { - ok: false, - msg: err.message, - origBody: body - }) - } - } -} - /** * Creates an user for gun. Returns a promise containing the public key of the * newly created user. @@ -1343,40 +414,23 @@ const register = async (alias, pass) => { if (theresPeers && !atLeastOneIsConnected) { throw new Error( - 'No connected to any peers for checking of duplicate aliases' + 'Not connected to any peers for checking of duplicate aliases' ) } if (theresPeers && atLeastOneIsConnected) { - // this import is done here to avoid circular dependency hell - const { timeout5 } = require('../contact-api/utils') - - let userData = await timeout5( - new Promise(res => { - gun.get(`~@${alias}`).once(ud => res(ud)) - }) - ) - - if (userData) { - throw new Error( - 'The given alias has been used before, use an unique alias instead.' - ) - } - await new Promise(res => setTimeout(res, 300)) - userData = await timeout5( - new Promise(res => { - gun.get(`~@${alias}`).once(ud => res(ud), { - // https://github.com/amark/gun/pull/971#issue-438630761 - wait: 1500 - }) + const userData = await new Promise(res => { + gun.get(`~@${alias}`).once(ud => res(ud), { + // https://github.com/amark/gun/pull/971#issue-438630761 + wait: 1500 }) - ) + }) if (userData) { throw new Error( - 'The given alias has been used before, use an unique alias instead. (Caught at 2nd try)' + 'The given alias has been used before, use a unique alias instead. (Caught at 2nd try)' ) } } @@ -1408,45 +462,25 @@ const register = async (alias, pass) => { // restart instances so write to user graph work, there's an issue with gun // (at least on node) where after initial user creation, writes to user graph // don't work - instantiateGun() + // instantiateGun() - return authenticate(alias, pass).then(async pub => { - await API.Actions.setDisplayName('anon' + pub.slice(0, 8), user) - await API.Actions.generateHandshakeAddress() - await API.Actions.generateOrderAddress(user) - await API.Actions.initWall() - await API.Actions.setBio('A little bit about myself.', user) - return pub - }) -} + logoff() -/** - * @param {SimpleSocket} socket - * @throws {Error} If gun is not authenticated or is in the process of - * authenticating. Use `isAuthenticating()` and `isAuthenticated()` to check for - * this first. - * @returns {Mediator} - */ -const createMediator = socket => { - // if (isAuthenticating() || !isAuthenticated()) { - // throw new Error("Gun must be authenticated to create a Mediator"); - // } - - return new Mediator(socket) + return authenticate(alias, pass) } module.exports = { authenticate, - logoff, - createMediator, isAuthenticated, isAuthenticating, isRegistering, + gun, + user, register, getGun, getUser, mySEA, getMySecret, - freshGun, + logoff, $$__SHOCKWALLET__ENCRYPTED__ } diff --git a/services/gunDB/contact-api/actions.js b/services/gunDB/contact-api/actions.js index 39831095..b1b8243a 100644 --- a/services/gunDB/contact-api/actions.js +++ b/services/gunDB/contact-api/actions.js @@ -2,10 +2,10 @@ * @format */ const uuidv1 = require('uuid/v1') -const logger = require('winston') +const logger = require('../../../config/log') +const throttle = require('lodash/throttle') const Common = require('shock-common') const { Constants, Schema } = Common -const Gun = require('gun') const { ErrorCode } = Constants @@ -22,266 +22,16 @@ const Getters = require('./getters') const Key = require('./key') const Utils = require('./utils') const SchemaManager = require('../../schema') -const LNDHealthMananger = require('../../../utils/lightningServices/errors') +const LNDHealthManager = require('../../../utils/lightningServices/errors') const { enrollContentTokens, selfContentToken } = require('../../seed') +/// + /** - * @typedef {import('./SimpleGUN').GUNNode} GUNNode * @typedef {import('./SimpleGUN').ISEA} ISEA - * @typedef {import('./SimpleGUN').UserGUNNode} UserGUNNode - * @typedef {import('shock-common').Schema.HandshakeRequest} HandshakeRequest - * @typedef {import('shock-common').Schema.StoredRequest} StoredReq - * @typedef {import('shock-common').Schema.Message} Message - * @typedef {import('shock-common').Schema.Outgoing} Outgoing - * @typedef {import('shock-common').Schema.PartialOutgoing} PartialOutgoing - * @typedef {import('shock-common').Schema.Order} Order - * @typedef {import('./SimpleGUN').Ack} Ack + * @typedef {Smith.UserSmithNode} UserGUNNode */ -/** - * Create a an outgoing feed. The feed will have an initial special acceptance - * message. Returns a promise that resolves to the id of the newly-created - * outgoing feed. - * - * If an outgoing feed is already created for the recipient, then returns the id - * of that one. - * @param {string} withPublicKey Public key of the intended recipient of the - * outgoing feed that will be created. - * @throws {Error} If the outgoing feed cannot be created or if the initial - * message for it also cannot be created. These errors aren't coded as they are - * not meant to be caught outside of this module. - * @param {UserGUNNode} user - * @param {ISEA} SEA - * @returns {Promise} - */ -const __createOutgoingFeed = async (withPublicKey, user, SEA) => { - if (!user.is) { - throw new Error(ErrorCode.NOT_AUTH) - } - - const mySecret = require('../Mediator').getMySecret() - const encryptedForMeRecipientPub = await SEA.encrypt(withPublicKey, mySecret) - const ourSecret = await SEA.secret( - await Utils.pubToEpub(withPublicKey), - user._.sea - ) - - const maybeOutgoingID = await Utils.recipientToOutgoingID(withPublicKey) - - let outgoingFeedID = '' - - // if there was no stored outgoing, create an outgoing feed - if (typeof maybeOutgoingID !== 'string') { - /** @type {PartialOutgoing} */ - const newPartialOutgoingFeed = { - with: encryptedForMeRecipientPub - } - - /** @type {string} */ - const newOutgoingFeedID = await new Promise((res, rej) => { - const _outFeedNode = user - .get(Key.OUTGOINGS) - //@ts-ignore - .set(newPartialOutgoingFeed, ack => { - if (ack.err && typeof ack.err !== 'number') { - rej(new Error(ack.err)) - } else { - res(_outFeedNode._.get) - } - }) - }) - - if (typeof newOutgoingFeedID !== 'string') { - throw new TypeError('typeof newOutgoingFeedID !== "string"') - } - - /** @type {Message} */ - const initialMsg = { - body: await SEA.encrypt(Constants.Misc.INITIAL_MSG, ourSecret), - timestamp: Date.now() - } - - await /** @type {Promise} */ (new Promise((res, rej) => { - user - .get(Key.OUTGOINGS) - .get(newOutgoingFeedID) - .get(Key.MESSAGES) - //@ts-ignore - .set(initialMsg, ack => { - if (ack.err && typeof ack.err !== 'number') { - rej(new Error(ack.err)) - } else { - res() - } - }) - })) - - const encryptedForMeNewOutgoingFeedID = await SEA.encrypt( - newOutgoingFeedID, - mySecret - ) - - await /** @type {Promise} */ (new Promise((res, rej) => { - user - .get(Key.RECIPIENT_TO_OUTGOING) - .get(withPublicKey) - .put(encryptedForMeNewOutgoingFeedID, ack => { - if (ack.err && typeof ack.err !== 'number') { - rej(Error(ack.err)) - } else { - res() - } - }) - })) - - outgoingFeedID = newOutgoingFeedID - } - - // otherwise decrypt stored outgoing - else { - outgoingFeedID = maybeOutgoingID - } - - if (typeof outgoingFeedID === 'undefined') { - throw new TypeError( - '__createOutgoingFeed() -> typeof outgoingFeedID === "undefined"' - ) - } - - if (typeof outgoingFeedID !== 'string') { - throw new TypeError( - '__createOutgoingFeed() -> expected outgoingFeedID to be an string' - ) - } - - if (outgoingFeedID.length === 0) { - throw new TypeError( - '__createOutgoingFeed() -> expected outgoingFeedID to be a populated string.' - ) - } - - return outgoingFeedID -} - -/** - * Given a request's ID, that should be found on the user's current handshake - * node, accept the request by creating an outgoing feed intended for the - * requestor, then encrypting and putting the id of this newly created outgoing - * feed on the response prop of the request. - * @param {string} requestID The id for the request to accept. - * @param {GUNNode} gun - * @param {UserGUNNode} user Pass only for testing purposes. - * @param {ISEA} SEA - * @param {typeof __createOutgoingFeed} outgoingFeedCreator Pass only - * for testing. purposes. - * @throws {Error} Throws if trying to accept an invalid request, or an error on - * gun's part. - * @returns {Promise} - */ -const acceptRequest = async ( - requestID, - gun, - user, - SEA, - outgoingFeedCreator = __createOutgoingFeed -) => { - if (!user.is) { - throw new Error(ErrorCode.NOT_AUTH) - } - - const handshakeAddress = await Utils.tryAndWait(async (_, user) => { - const addr = await user.get(Key.CURRENT_HANDSHAKE_ADDRESS).then() - - if (typeof addr !== 'string') { - throw new TypeError("typeof addr !== 'string'") - } - - return addr - }) - - const { - response: encryptedForUsIncomingID, - from: senderPublicKey - } = await Utils.tryAndWait(async gun => { - const hr = await gun - .get(Key.HANDSHAKE_NODES) - .get(handshakeAddress) - .get(requestID) - .then() - - if (!Schema.isHandshakeRequest(hr)) { - throw new Error(ErrorCode.TRIED_TO_ACCEPT_AN_INVALID_REQUEST) - } - - return hr - }) - - /** @type {string} */ - const requestorEpub = await Utils.pubToEpub(senderPublicKey) - - const ourSecret = await SEA.secret(requestorEpub, user._.sea) - if (typeof ourSecret !== 'string') { - throw new TypeError("typeof ourSecret !== 'string'") - } - - const incomingID = await SEA.decrypt(encryptedForUsIncomingID, ourSecret) - if (typeof incomingID !== 'string') { - throw new TypeError("typeof incomingID !== 'string'") - } - - const newlyCreatedOutgoingFeedID = await outgoingFeedCreator( - senderPublicKey, - user, - SEA - ) - - const mySecret = require('../Mediator').getMySecret() - const encryptedForMeIncomingID = await SEA.encrypt(incomingID, mySecret) - - await /** @type {Promise} */ (new Promise((res, rej) => { - user - .get(Key.USER_TO_INCOMING) - .get(senderPublicKey) - .put(encryptedForMeIncomingID, ack => { - if (ack.err && typeof ack.err !== 'number') { - rej(new Error(ack.err)) - } else { - res() - } - }) - })) - - //////////////////////////////////////////////////////////////////////////// - // NOTE: perform non-reversable actions before destructive actions - // In case any of the non-reversable actions reject. - // In this case, writing to the response is the non-revesarble op. - //////////////////////////////////////////////////////////////////////////// - - const encryptedForUsOutgoingID = await SEA.encrypt( - newlyCreatedOutgoingFeedID, - ourSecret - ) - //why await if you dont need the response? - await /** @type {Promise} */ (new Promise((res, rej) => { - gun - .get(Key.HANDSHAKE_NODES) - .get(handshakeAddress) - .get(requestID) - .put( - { - response: encryptedForUsOutgoingID - }, - ack => { - if (ack.err && typeof ack.err !== 'number') { - rej(new Error(ack.err)) - } else { - res() - } - } - ) - })) -} - /** * @param {string} user * @param {string} pass @@ -310,7 +60,11 @@ const authenticate = (user, pass, userNode) => } userNode.auth(user, pass, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { reject(new Error(ack.err)) } else if (!userNode.is) { reject(new Error('authentication failed')) @@ -333,7 +87,11 @@ const blacklist = (publicKey, user) => } user.get(Key.BLACKLIST).set(publicKey, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { reject(new Error(ack.err)) } else { resolve() @@ -352,7 +110,11 @@ const generateHandshakeAddress = async () => { await /** @type {Promise} */ (new Promise((res, rej) => { user.get(Key.CURRENT_HANDSHAKE_ADDRESS).put(address, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { rej(new Error(ack.err)) } else { res() @@ -365,7 +127,11 @@ const generateHandshakeAddress = async () => { .get(Key.HANDSHAKE_NODES) .get(address) .put({ unused: 0 }, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { rej(new Error(ack.err)) } else { res() @@ -374,438 +140,6 @@ const generateHandshakeAddress = async () => { })) } -/** - * - * @param {string} pub - * @throws {Error} - * @returns {Promise} - */ -const cleanup = async pub => { - const user = require('../Mediator').getUser() - - const outGoingID = await Utils.recipientToOutgoingID(pub) - - const promises = [] - - promises.push( - /** @type {Promise} */ (new Promise((res, rej) => { - user - .get(Key.USER_TO_INCOMING) - .get(pub) - .put(null, ack => { - if (ack.err && typeof ack.err !== 'number') { - rej(new Error(ack.err)) - } else { - res() - } - }) - })) - ) - - promises.push( - /** @type {Promise} */ (new Promise((res, rej) => { - user - .get(Key.RECIPIENT_TO_OUTGOING) - .get(pub) - .put(null, ack => { - if (ack.err && typeof ack.err !== 'number') { - rej(new Error(ack.err)) - } else { - res() - } - }) - })) - ) - - promises.push( - /** @type {Promise} */ (new Promise((res, rej) => { - user - .get(Key.USER_TO_LAST_REQUEST_SENT) - .get(pub) - .put(null, ack => { - if (ack.err && typeof ack.err !== 'number') { - rej(new Error(ack.err)) - } else { - res() - } - }) - })) - ) - - if (outGoingID) { - promises.push( - /** @type {Promise} */ (new Promise((res, rej) => { - user - .get(Key.OUTGOINGS) - .get(outGoingID) - .put(null, ack => { - if (ack.err && typeof ack.err !== 'number') { - rej(new Error(ack.err)) - } else { - res() - } - }) - })) - ) - } - - await Promise.all(promises) -} - -/** - * @param {string} recipientPublicKey - * @param {GUNNode} gun - * @param {UserGUNNode} user - * @param {ISEA} SEA - * @throws {Error|TypeError} - * @returns {Promise} - */ -const sendHandshakeRequest = async (recipientPublicKey, gun, user, SEA) => { - if (!user.is) { - throw new Error(ErrorCode.NOT_AUTH) - } - - await cleanup(recipientPublicKey) - - if (typeof recipientPublicKey !== 'string') { - throw new TypeError( - `recipientPublicKey is not string, got: ${typeof recipientPublicKey}` - ) - } - - if (recipientPublicKey.length === 0) { - throw new TypeError('recipientPublicKey is an string of length 0') - } - - if (recipientPublicKey === user.is.pub) { - throw new Error('Do not send a request to yourself') - } - - logger.info('sendHR() -> before recipientEpub') - - /** @type {string} */ - const recipientEpub = await Utils.pubToEpub(recipientPublicKey) - - logger.info('sendHR() -> before mySecret') - - const mySecret = require('../Mediator').getMySecret() - logger.info('sendHR() -> before ourSecret') - const ourSecret = await SEA.secret(recipientEpub, user._.sea) - - // check if successful handshake is present - - logger.info('sendHR() -> before alreadyHandshaked') - - /** @type {boolean} */ - const alreadyHandshaked = await Utils.successfulHandshakeAlreadyExists( - recipientPublicKey - ) - - if (alreadyHandshaked) { - throw new Error(ErrorCode.ALREADY_HANDSHAKED) - } - - logger.info('sendHR() -> before maybeLastRequestIDSentToUser') - - // check that we have already sent a request to this user, on his current - // handshake node - const maybeLastRequestIDSentToUser = await Utils.tryAndWait((_, user) => - user - .get(Key.USER_TO_LAST_REQUEST_SENT) - .get(recipientPublicKey) - .then() - ) - - logger.info('sendHR() -> before currentHandshakeAddress') - - const currentHandshakeAddress = await Utils.tryAndWait( - gun => - Common.Utils.makePromise(res => { - gun - .user(recipientPublicKey) - .get(Key.CURRENT_HANDSHAKE_ADDRESS) - .once( - data => { - res(data) - }, - { wait: 1000 } - ) - }), - data => typeof data !== 'string' - ) - - if (typeof currentHandshakeAddress !== 'string') { - throw new TypeError( - 'expected current handshake address found on recipients user node to be an string' - ) - } - - if (typeof maybeLastRequestIDSentToUser === 'string') { - if (maybeLastRequestIDSentToUser.length < 5) { - throw new TypeError( - 'sendHandshakeRequest() -> maybeLastRequestIDSentToUser.length < 5' - ) - } - - const lastRequestIDSentToUser = maybeLastRequestIDSentToUser - - logger.info('sendHR() -> before alreadyContactedOnCurrHandshakeNode') - - const hrInHandshakeNode = await Utils.tryAndWait( - gun => - new Promise(res => { - gun - .get(Key.HANDSHAKE_NODES) - .get(currentHandshakeAddress) - .get(lastRequestIDSentToUser) - .once(data => { - res(data) - }) - }), - // force retry on undefined in case the undefined was a false negative - v => typeof v === 'undefined' - ) - - const alreadyContactedOnCurrHandshakeNode = - typeof hrInHandshakeNode !== 'undefined' - - if (alreadyContactedOnCurrHandshakeNode) { - throw new Error(ErrorCode.ALREADY_REQUESTED_HANDSHAKE) - } - } - - logger.info('sendHR() -> before __createOutgoingFeed') - - const outgoingFeedID = await __createOutgoingFeed( - recipientPublicKey, - user, - SEA - ) - - logger.info('sendHR() -> before encryptedForUsOutgoingFeedID') - - const encryptedForUsOutgoingFeedID = await SEA.encrypt( - outgoingFeedID, - ourSecret - ) - - const timestamp = Date.now() - - /** @type {HandshakeRequest} */ - const handshakeRequestData = { - from: user.is.pub, - response: encryptedForUsOutgoingFeedID, - timestamp - } - - const encryptedForMeRecipientPublicKey = await SEA.encrypt( - recipientPublicKey, - mySecret - ) - - logger.info('sendHR() -> before newHandshakeRequestID') - /** @type {string} */ - const newHandshakeRequestID = await new Promise((res, rej) => { - const hr = gun - .get(Key.HANDSHAKE_NODES) - .get(currentHandshakeAddress) - //@ts-ignore - .set(handshakeRequestData, ack => { - if (ack.err && typeof ack.err !== 'number') { - rej(new Error(`Error trying to create request: ${ack.err}`)) - } else { - res(hr._.get) - } - }) - }) - - await /** @type {Promise} */ (new Promise((res, rej) => { - user - .get(Key.USER_TO_LAST_REQUEST_SENT) - .get(recipientPublicKey) - .put(newHandshakeRequestID, ack => { - if (ack.err && typeof ack.err !== 'number') { - rej(new Error(ack.err)) - } else { - res() - } - }) - })) - - // This needs to come before the write to sent requests. Because that write - // triggers Jobs.onAcceptedRequests and it in turn reads from request-to-user - - /** - * @type {StoredReq} - */ - const storedReq = { - sentReqID: await SEA.encrypt(newHandshakeRequestID, mySecret), - recipientPub: encryptedForMeRecipientPublicKey, - handshakeAddress: await SEA.encrypt(currentHandshakeAddress, mySecret), - timestamp - } - //why await if you dont need the response? - await /** @type {Promise} */ (new Promise((res, rej) => { - //@ts-ignore - user.get(Key.STORED_REQS).set(storedReq, ack => { - if (ack.err && typeof ack.err !== 'number') { - rej( - new Error( - `Error saving newly created request to sent requests: ${ack.err}` - ) - ) - } else { - res() - } - }) - })) -} - -/** - * Returns the message id. - * @param {string} recipientPublicKey - * @param {string} body - * @param {UserGUNNode} user - * @param {ISEA} SEA - * @returns {Promise} The message id. - */ -const sendMessageNew = async (recipientPublicKey, body, user, SEA) => { - if (!user.is) { - throw new Error(ErrorCode.NOT_AUTH) - } - - if (typeof recipientPublicKey !== 'string') { - throw new TypeError( - `expected recipientPublicKey to be an string, but instead got: ${typeof recipientPublicKey}` - ) - } - - if (recipientPublicKey.length === 0) { - throw new TypeError( - 'expected recipientPublicKey to be an string of length greater than zero' - ) - } - - if (typeof body !== 'string') { - throw new TypeError( - `expected message to be an string, instead got: ${typeof body}` - ) - } - - if (body.length === 0) { - throw new TypeError( - 'expected message to be an string of length greater than zero' - ) - } - - const outgoingID = await Utils.recipientToOutgoingID(recipientPublicKey) - - if (outgoingID === null) { - throw new Error( - `Could not fetch an outgoing id for user: ${recipientPublicKey}` - ) - } - - const recipientEpub = await Utils.pubToEpub(recipientPublicKey) - const ourSecret = await SEA.secret(recipientEpub, user._.sea) - if (typeof ourSecret !== 'string') { - throw new TypeError("sendMessage() -> typeof ourSecret !== 'string'") - } - const encryptedBody = await SEA.encrypt(body, ourSecret) - - const newMessage = { - body: encryptedBody, - timestamp: Date.now() - } - - return new Promise((res, rej) => { - const msgNode = user - .get(Key.OUTGOINGS) - .get(outgoingID) - .get(Key.MESSAGES) - .set(newMessage, ack => { - if (ack.err && typeof ack.err !== 'number') { - rej(new Error(ack.err)) - } else { - res({ - body, - id: msgNode._.get, - outgoing: true, - timestamp: newMessage.timestamp - }) - } - }) - }) -} - -/** - * Returns the message id. - * @param {string} recipientPublicKey - * @param {string} body - * @param {UserGUNNode} user - * @param {ISEA} SEA - * @returns {Promise} The message id. - */ -const sendMessage = async (recipientPublicKey, body, user, SEA) => - (await sendMessageNew(recipientPublicKey, body, user, SEA)).id - -/** - * @param {string} recipientPub - * @param {string} msgID - * @param {UserGUNNode} user - * @returns {Promise} - */ -const deleteMessage = async (recipientPub, msgID, user) => { - if (!user.is) { - throw new Error(ErrorCode.NOT_AUTH) - } - - if (typeof recipientPub !== 'string') { - throw new TypeError( - `expected recipientPublicKey to be an string, but instead got: ${typeof recipientPub}` - ) - } - - if (recipientPub.length === 0) { - throw new TypeError( - 'expected recipientPublicKey to be an string of length greater than zero' - ) - } - - if (typeof msgID !== 'string') { - throw new TypeError( - `expected msgID to be an string, instead got: ${typeof msgID}` - ) - } - - if (msgID.length === 0) { - throw new TypeError( - 'expected msgID to be an string of length greater than zero' - ) - } - - const outgoingID = await Utils.recipientToOutgoingID(recipientPub) - - if (outgoingID === null) { - throw new Error(`Could not fetch an outgoing id for user: ${recipientPub}`) - } - - return new Promise((res, rej) => { - user - .get(Key.OUTGOINGS) - .get(outgoingID) - .get(Key.MESSAGES) - .get(msgID) - .put(null, ack => { - if (ack.err && typeof ack.err !== 'number') { - rej(new Error(ack.err)) - } else { - res() - } - }) - }) -} - /** * @param {string|null} avatar * @param {UserGUNNode} user @@ -834,7 +168,11 @@ const setAvatar = (avatar, user) => .get(Key.PROFILE_BINARY) .get(Key.AVATAR) .put(avatar, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { reject(new Error(ack.err)) } else { resolve() @@ -867,7 +205,11 @@ const setDisplayName = (displayName, user) => .get(Key.PROFILE) .get(Key.DISPLAY_NAME) .put(displayName, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { reject(new Error(ack.err)) } else { resolve() @@ -876,53 +218,94 @@ const setDisplayName = (displayName, user) => }) /** - * @param {string} initialMsg - * @param {string} recipientPublicKey - * @param {GUNNode} gun + * @param {string} encryptedSeedProvider * @param {UserGUNNode} user - * @param {ISEA} SEA - * @throws {Error|TypeError} + * @throws {TypeError} Rejects if displayName is not an string or an empty + * string. * @returns {Promise} */ -const sendHRWithInitialMsg = async ( - initialMsg, - recipientPublicKey, - gun, - user, - SEA -) => { - /** @type {boolean} */ - const alreadyHandshaked = await Utils.tryAndWait( - (_, user) => - new Promise((res, rej) => { - user - .get(Key.USER_TO_INCOMING) - .get(recipientPublicKey) - .once(inc => { - if (typeof inc !== 'string') { - res(false) - } else if (inc.length === 0) { - rej( - new Error( - `sendHRWithInitialMsg()-> obtained encryptedIncomingId from user-to-incoming an string but of length 0` - ) - ) - } else { - res(true) - } - }) +const setDefaultSeedProvider = (encryptedSeedProvider, user) => + new Promise((resolve, reject) => { + if (!user.is) { + throw new Error(ErrorCode.NOT_AUTH) + } + + if (typeof encryptedSeedProvider !== 'string') { + throw new TypeError() + } + user + .get('preferencesSeedServiceProvider') + .put(encryptedSeedProvider, ack => { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { + reject(new Error(ack.err)) + } else { + resolve() + } }) - ) + }) +/** + * @param {string} encryptedSeedServiceData + * @param {UserGUNNode} user + * @throws {TypeError} + * @returns {Promise} + */ +const setSeedServiceData = (encryptedSeedServiceData, user) => + new Promise((resolve, reject) => { + if (!user.is) { + throw new Error(ErrorCode.NOT_AUTH) + } - if (!alreadyHandshaked) { - await sendHandshakeRequest(recipientPublicKey, gun, user, SEA) - } + if (typeof encryptedSeedServiceData !== 'string') { + throw new TypeError() + } + user + .get('preferencesSeedServiceData') + .put(encryptedSeedServiceData, ack => { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { + reject(new Error(ack.err)) + } else { + resolve() + } + }) + }) +/** + * @param {string} encryptedCurrentStreamInfo + * @param {UserGUNNode} user + * @throws {TypeError} + * @returns {Promise} + */ +const setCurrentStreamInfo = (encryptedCurrentStreamInfo, user) => + new Promise((resolve, reject) => { + if (!user.is) { + throw new Error(ErrorCode.NOT_AUTH) + } - await sendMessage(recipientPublicKey, initialMsg, user, SEA) -} + if (typeof encryptedCurrentStreamInfo !== 'string') { + throw new TypeError() + } + user.get('currentStreamInfo').put(encryptedCurrentStreamInfo, ack => { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { + reject(new Error(ack.err)) + } else { + resolve() + } + }) + }) /** - * @typedef {object} SpontPaymentOptions + * @typedef {object} SpontaneousPaymentOptions * @prop {Common.Schema.OrderTargetType} type * @prop {string=} ackInfo */ @@ -937,7 +320,7 @@ const sendHRWithInitialMsg = async ( * @param {number} amount * @param {string} memo * @param {number} feeLimit - * @param {SpontPaymentOptions} opts + * @param {SpontaneousPaymentOptions} opts * @throws {Error} If no response in less than 20 seconds from the recipient, or * lightning cannot find a route for the payment. * @returns {Promise} The payment's preimage. @@ -966,9 +349,9 @@ const sendSpontaneousPayment = async ( throw new Error('torrentSeed service not available') } const { seedUrl } = seedInfo - console.log('SEED URL OK') + logger.info('SEED URL OK') const tokens = await enrollContentTokens(numberOfTokens, seedInfo) - console.log('RES SEED OK') + logger.info('RES SEED OK') const ackData = JSON.stringify({ seedUrl, tokens }) return { payment: null, @@ -986,7 +369,7 @@ const sendSpontaneousPayment = async ( logger.info('sendPayment() -> will now create order:') - /** @type {Order} */ + /** @type {import('shock-common').Schema.Order} */ const order = { amount: amount.toString(), from: getUser()._.sea.pub, @@ -1023,7 +406,11 @@ const sendSpontaneousPayment = async ( .get(currOrderAddress) //@ts-ignore .set(order, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { rej( new Error( `Error writing order to order node: ${currOrderAddress} for pub: ${to}: ${ack.err}` @@ -1041,25 +428,26 @@ const sendSpontaneousPayment = async ( )}` throw new Error(msg) } - console.log('ORDER ID') - console.log(orderID) + logger.info('ORDER ID') + logger.info(orderID) /** @type {import('shock-common').Schema.OrderResponse} */ - const encryptedOrderRes = await Utils.tryAndWait( - gun => - new Promise(res => { - gun - .user(to) - .get(Key.ORDER_TO_RESPONSE) - .get(orderID) - .on(orderResponse => { - console.log(orderResponse) - if (Schema.isOrderResponse(orderResponse)) { - res(orderResponse) - } - }) - }), - v => Schema.isOrderResponse(v) - ) + const encryptedOrderRes = await Common.makePromise((res, rej) => { + setTimeout(() => { + rej(new Error('Timeout of 30s passed when awaiting order response.')) + }, 30000) + + require('../Mediator') + .getGun() + .user(to) + .get(Key.ORDER_TO_RESPONSE) + .get(orderID) + .on(orderResponse => { + logger.info(orderResponse) + if (Schema.isOrderResponse(orderResponse)) { + res(orderResponse) + } + }) + }) if (!Schema.isOrderResponse(encryptedOrderRes)) { const e = TypeError( @@ -1089,13 +477,19 @@ const sendSpontaneousPayment = async ( const { num_satoshis: decodedAmt } = await decodePayReq(encodedInvoice) - if (decodedAmt !== amount.toString()) { - throw new Error('Invoice amount mismatch') + if (decodedAmt.toString() !== amount.toString()) { + throw new Error( + `Invoice amount mismatch got: ${decodedAmt.toString()} expected: ${amount.toString()}` + ) } // double check - if (Number(decodedAmt) !== amount) { - throw new Error('Invoice amount mismatch') + if (Number(decodedAmt) !== Number(amount)) { + throw new Error( + `Invoice amount mismatch got:${Number(decodedAmt)} expected:${Number( + amount + )}` + ) } logger.info('Will now send payment through lightning') @@ -1104,12 +498,11 @@ const sendSpontaneousPayment = async ( feeLimit, payment_request: orderResponse.response }) - const myLndPub = LNDHealthMananger.lndPub + const myLndPub = LNDHealthManager.lndPub if ( (opts.type !== 'contentReveal' && opts.type !== 'torrentSeed' && opts.type !== 'service' && - opts.type !== 'streamSeed' && opts.type !== 'product') || !orderResponse.ackNode ) { @@ -1126,30 +519,34 @@ const sendSpontaneousPayment = async ( }) return { payment } } - console.log('ACK NODE') - console.log(orderResponse.ackNode) + logger.info('ACK NODE') + logger.info(orderResponse.ackNode) /** @type {import('shock-common').Schema.OrderResponse} */ - const encryptedOrderAckRes = await Utils.tryAndWait( - gun => - new Promise(res => { - gun - .user(to) - .get(Key.ORDER_TO_RESPONSE) - .get(orderResponse.ackNode) - .on(orderResponse => { - console.log(orderResponse) - console.log(Schema.isOrderResponse(orderResponse)) + const encryptedOrderAckRes = await Common.makePromise((res, rej) => { + setTimeout(() => { + rej( + new Error( + "Timeout of 30s exceeded when waiting for order response's ack." + ) + ) + }, 30000) - //@ts-expect-error - if (orderResponse && orderResponse.type === 'orderAck') { - //@ts-expect-error - res(orderResponse) - } - }) - }), - //@ts-expect-error - v => !v || !v.type - ) + require('../Mediator') + .getGun() + .user(to) + .get(Key.ORDER_TO_RESPONSE) + .get(orderResponse.ackNode) + .on(orderResponse => { + logger.info(orderResponse) + logger.info(Schema.isOrderResponse(orderResponse)) + + //@ts-expect-error + if (orderResponse && orderResponse.type === 'orderAck') { + //@ts-expect-error + res(orderResponse) + } + }) + }) if (!encryptedOrderAckRes || !encryptedOrderAckRes.type) { const e = TypeError( @@ -1159,9 +556,17 @@ const sendSpontaneousPayment = async ( throw e } + const decryptedResponse = await SEA.decrypt( + encryptedOrderAckRes.response, + ourSecret + ) + logger.info(`decryptedResponse: `, decryptedResponse) + const parsedResponse = JSON.parse(decryptedResponse) + logger.info(`parsedResponse: `, parsedResponse) + /** @type {import('shock-common').Schema.OrderResponse} */ const orderAck = { - response: await SEA.decrypt(encryptedOrderAckRes.response, ourSecret), + response: parsedResponse, type: encryptedOrderAckRes.type } @@ -1188,7 +593,7 @@ const sendSpontaneousPayment = async ( }) return { payment, orderAck } } catch (e) { - console.log(e) + logger.info(e) logger.error('Error inside sendPayment()') logger.error(e) throw e @@ -1226,7 +631,11 @@ const generateOrderAddress = user => const address = uuidv1() user.get(Key.CURRENT_ORDER_ADDRESS).put(address, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { rej(new Error(ack.err)) } else { res() @@ -1259,7 +668,11 @@ const setBio = (bio, user) => } user.get(Key.BIO).put(bio, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { reject(new Error(ack.err)) } else { resolve() @@ -1272,7 +685,11 @@ const setBio = (bio, user) => .get(Key.PROFILE) .get(Key.BIO) .put(bio, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { reject(new Error(ack.err)) } else { resolve() @@ -1301,7 +718,11 @@ const saveSeedBackup = async (mnemonicPhrase, user, SEA) => { return new Promise((res, rej) => { user.get(Key.SEED_BACKUP).put(encryptedSeed, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { rej(new Error(ack.err)) } else { res() @@ -1324,7 +745,11 @@ const saveChannelsBackup = async (backups, user, SEA) => { const encryptBackups = await SEA.encrypt(backups, mySecret) return new Promise((res, rej) => { user.get(Key.CHANNELS_BACKUP).put(encryptBackups, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { rej(new Error(ack.err)) } else { res() @@ -1334,48 +759,16 @@ const saveChannelsBackup = async (backups, user, SEA) => { } /** - * @param {string} pub * @returns {Promise} */ -const disconnect = async pub => { - if (!(await Utils.successfulHandshakeAlreadyExists(pub))) { - throw new Error('No handshake exists for this pub') - } +const setLastSeenApp = throttle(() => { + const user = require('../Mediator').getUser() - await Promise.all([cleanup(pub), generateHandshakeAddress()]) -} - -/** - * @returns {Promise} - */ -const setLastSeenApp = () => - /** @type {Promise} */ (new Promise((res, rej) => { - require('../Mediator') - .getUser() - .get(Key.LAST_SEEN_APP) - .put(Date.now(), ack => { - if (ack.err && typeof ack.err !== 'number') { - rej(new Error(ack.err)) - } else { - res() - } - }) - })).then( - () => - new Promise((res, rej) => { - require('../Mediator') - .getUser() - .get(Key.PROFILE) - .get(Key.LAST_SEEN_APP) - .put(Date.now(), ack => { - if (ack.err && typeof ack.err !== 'number') { - rej(new Error(ack.err)) - } else { - res() - } - }) - }) - ) + return user + .get(Key.PROFILE) + .get(Key.LAST_SEEN_APP) + .pPut(Date.now()) +}, 10000) /** * @param {string[]} tags @@ -1397,8 +790,7 @@ const createPostNew = async (tags, title, content) => { const mySecret = require('../Mediator').getMySecret() await Common.Utils.asyncForEach(content, async c => { - // @ts-expect-error - const uuid = Gun.text.random() + const uuid = Utils.gunID() newPost.contentItems[uuid] = c if ( (c.type === 'image/embedded' || c.type === 'video/embedded') && @@ -1420,7 +812,11 @@ const createPostNew = async (tags, title, content) => { // @ts-expect-error newPost, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { rej(new Error(ack.err)) } else { res(_n._.get) @@ -1432,162 +828,6 @@ const createPostNew = async (tags, title, content) => { return [postID, newPost] } -/** - * @param {string[]} tags - * @param {string} title - * @param {Common.Schema.ContentItem[]} content - * @returns {Promise} - */ -const createPost = async (tags, title, content) => { - if (content.length === 0) { - throw new Error(`A post must contain at least one paragraph/image/video`) - } - - const numOfPages = await (async () => { - const maybeNumOfPages = await Utils.tryAndWait( - (_, user) => - user - .get(Key.WALL) - .get(Key.NUM_OF_PAGES) - .then(), - v => typeof v !== 'number' - ) - - if (typeof maybeNumOfPages !== 'number') { - throw new TypeError( - `Could not fetch number of pages from wall, instead got: ${JSON.stringify( - maybeNumOfPages - )}` - ) - } - - return maybeNumOfPages - })() - - let pageIdx = Math.max(0, numOfPages - 1).toString() - - const count = await (async () => { - if (numOfPages === 0) { - return 0 - } - - const maybeCount = await Utils.tryAndWait( - (_, user) => - user - .get(Key.WALL) - .get(Key.PAGES) - .get(pageIdx) - .get(Key.COUNT) - .then(), - v => typeof v !== 'number' - ) - - return typeof maybeCount === 'number' ? maybeCount : 0 - })() - - const shouldBeNewPage = - count >= Common.Constants.Misc.NUM_OF_POSTS_PER_WALL_PAGE - - if (shouldBeNewPage) { - pageIdx = Number(pageIdx + 1).toString() - } - - await /** @type {Promise} */ (new Promise((res, rej) => { - require('../Mediator') - .getUser() - .get(Key.WALL) - .get(Key.PAGES) - .get(pageIdx) - .put( - { - [Key.COUNT]: shouldBeNewPage ? 1 : count + 1, - posts: { - unused: null - } - }, - ack => { - if (ack.err && typeof ack.err !== 'number') { - rej(new Error(ack.err)) - } - - res() - } - ) - })) - - const [postID, newPost] = await createPostNew(tags, title, content) - - await Common.makePromise((res, rej) => { - require('../Mediator') - .getUser() - .get(Key.WALL) - .get(Key.PAGES) - .get(pageIdx) - .get(Key.POSTS) - .get(postID) - .put( - // @ts-expect-error - newPost, - ack => { - if (ack.err && typeof ack.err !== 'number') { - rej(new Error(ack.err)) - } else { - res() - } - } - ) - }) - - if (shouldBeNewPage || numOfPages === 0) { - await /** @type {Promise} */ (new Promise(res => { - require('../Mediator') - .getUser() - .get(Key.WALL) - .get(Key.NUM_OF_PAGES) - .put(numOfPages + 1, ack => { - if (ack.err && typeof ack.err !== 'number') { - throw new Error(ack.err) - } - - res() - }) - })) - } - - const loadedPost = await new Promise(res => { - require('../Mediator') - .getUser() - .get(Key.WALL) - .get(Key.PAGES) - .get(pageIdx) - .get(Key.POSTS) - .get(postID) - .load(data => { - res(data) - }) - }) - - /** @type {Common.Schema.User} */ - const userForPost = await Getters.getMyUser() - - /** @type {Common.Schema.Post} */ - const completePost = { - ...loadedPost, - author: userForPost, - id: postID - } - - if (!Common.Schema.isPost(completePost)) { - throw new Error( - `completePost not a Post inside Actions.createPost(): ${JSON.stringify( - completePost - )}` - ) - } - - return completePost -} - /** * @param {string} postId * @param {string} page @@ -1603,7 +843,11 @@ const deletePost = async (postId, page) => { .get(Key.POSTS) .get(postId) .put(null, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { rej(new Error(ack.err)) } else { res() @@ -1632,7 +876,11 @@ const follow = async (publicKey, isPrivate) => { .get(publicKey) // @ts-ignore .put(newFollow, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { rej(new Error(ack.err)) } else { res() @@ -1652,7 +900,11 @@ const unfollow = publicKey => .get(Key.FOLLOWS) .get(publicKey) .put(null, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { rej(new Error(ack.err)) } else { res() @@ -1675,7 +927,11 @@ const initWall = async () => { .get(Key.WALL) .get(Key.NUM_OF_PAGES) .put(0, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { rej(new Error(ack.err)) } else { res() @@ -1696,7 +952,11 @@ const initWall = async () => { unused: null }, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { rej(new Error(ack.err)) } else { res() @@ -1714,7 +974,11 @@ const initWall = async () => { .get('0') .get(Key.COUNT) .put(0, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { rej(new Error(ack.err)) } else { res() @@ -1727,15 +991,9 @@ const initWall = async () => { } module.exports = { - __createOutgoingFeed, - acceptRequest, authenticate, blacklist, generateHandshakeAddress, - sendHandshakeRequest, - deleteMessage, - sendMessage, - sendHRWithInitialMsg, setAvatar, setDisplayName, sendPayment, @@ -1743,14 +1001,14 @@ module.exports = { setBio, saveSeedBackup, saveChannelsBackup, - disconnect, setLastSeenApp, - createPost, deletePost, follow, unfollow, initWall, - sendMessageNew, sendSpontaneousPayment, - createPostNew + createPostNew, + setDefaultSeedProvider, + setSeedServiceData, + setCurrentStreamInfo } diff --git a/services/gunDB/contact-api/events/index.js b/services/gunDB/contact-api/events/index.js index d046c7eb..d060cb34 100644 --- a/services/gunDB/contact-api/events/index.js +++ b/services/gunDB/contact-api/events/index.js @@ -2,598 +2,23 @@ * @prettier */ const debounce = require('lodash/debounce') -const logger = require('winston') + const { - Constants: { ErrorCode }, - Schema, - Utils: CommonUtils + Constants: { ErrorCode } } = require('shock-common') const Key = require('../key') -const Utils = require('../utils') -/** - * @typedef {import('../SimpleGUN').UserGUNNode} UserGUNNode - * @typedef {import('../SimpleGUN').GUNNode} GUNNode - * @typedef {import('../SimpleGUN').ISEA} ISEA - * @typedef {import('../SimpleGUN').ListenerData} ListenerData - * @typedef {import('shock-common').Schema.HandshakeRequest} HandshakeRequest - * @typedef {import('shock-common').Schema.Message} Message - * @typedef {import('shock-common').Schema.Outgoing} Outgoing - * @typedef {import('shock-common').Schema.PartialOutgoing} PartialOutgoing - * @typedef {import('shock-common').Schema.Chat} Chat - * @typedef {import('shock-common').Schema.ChatMessage} ChatMessage - * @typedef {import('shock-common').Schema.SimpleSentRequest} SimpleSentRequest - * @typedef {import('shock-common').Schema.SimpleReceivedRequest} SimpleReceivedRequest - */ +/// const DEBOUNCE_WAIT_TIME = 500 -/** - * @param {(userToIncoming: Record) => void} cb - * @param {UserGUNNode} user Pass only for testing purposes. - * @param {ISEA} SEA - * @returns {void} - */ -const __onUserToIncoming = (cb, user, SEA) => { - if (!user.is) { - throw new Error(ErrorCode.NOT_AUTH) - } - - const callb = debounce(cb, DEBOUNCE_WAIT_TIME) - - /** @type {Record} */ - const userToIncoming = {} - - const mySecret = require('../../Mediator').getMySecret() - - user - .get(Key.USER_TO_INCOMING) - .map() - .on(async (encryptedIncomingID, userPub) => { - if (typeof encryptedIncomingID !== 'string') { - if (encryptedIncomingID === null) { - // on disconnect - delete userToIncoming[userPub] - } else { - logger.error( - 'got a non string non null value inside user to incoming' - ) - } - return - } - - if (encryptedIncomingID.length === 0) { - logger.error('got an empty string value') - return - } - - const incomingID = await SEA.decrypt(encryptedIncomingID, mySecret) - - if (typeof incomingID === 'undefined') { - logger.warn('could not decrypt incomingID inside __onUserToIncoming') - return - } - - userToIncoming[userPub] = incomingID - - callb(userToIncoming) - }) -} - -/** @type {Set<(av: string|null) => void>} */ -const avatarListeners = new Set() - -/** @type {string|null} */ -let currentAvatar = null - -const getAvatar = () => currentAvatar - -/** @param {string|null} av */ -const setAvatar = av => { - currentAvatar = av - avatarListeners.forEach(l => l(currentAvatar)) -} - -let avatarSubbed = false - -/** - * @param {(avatar: string|null) => void} cb - * @param {UserGUNNode} user Pass only for testing purposes. - * @throws {Error} If user hasn't been auth. - * @returns {() => void} - */ -const onAvatar = (cb, user) => { - if (!user.is) { - throw new Error(ErrorCode.NOT_AUTH) - } - - avatarListeners.add(cb) - - cb(currentAvatar) - - if (!avatarSubbed) { - avatarSubbed = true - user - .get(Key.PROFILE_BINARY) - .get(Key.AVATAR) - .on(avatar => { - if (typeof avatar === 'string' || avatar === null) { - setAvatar(avatar) - } - }) - } - - return () => { - avatarListeners.delete(cb) - } -} - -/** - * @param {(blacklist: string[]) => void} cb - * @param {UserGUNNode} user - * @returns {void} - */ -const onBlacklist = (cb, user) => { - /** @type {string[]} */ - const blacklist = [] - - if (!user.is) { - throw new Error(ErrorCode.NOT_AUTH) - } - - const callb = debounce(cb, DEBOUNCE_WAIT_TIME) - - // Initial value if no items are in blacklist in gun - callb(blacklist) - - user - .get(Key.BLACKLIST) - .map() - .on(publicKey => { - if (typeof publicKey === 'string' && publicKey.length > 0) { - blacklist.push(publicKey) - callb(blacklist) - } else { - logger.warn('Invalid public key received for blacklist') - } - }) -} - -/** @type {Set<(addr: string|null) => void>} */ -const addressListeners = new Set() - -/** @type {string|null} */ -let currentAddress = null - -const getHandshakeAddress = () => currentAddress - -/** @param {string|null} addr */ -const setAddress = addr => { - currentAddress = addr - addressListeners.forEach(l => l(currentAddress)) -} - -let addrSubbed = false - -/** - * @param {(currentHandshakeAddress: string|null) => void} cb - * @param {UserGUNNode} user - * @returns {() => void} - */ -const onCurrentHandshakeAddress = (cb, user) => { - if (!user.is) { - throw new Error(ErrorCode.NOT_AUTH) - } - - addressListeners.add(cb) - - cb(currentAddress) - - if (!addrSubbed) { - addrSubbed = true - - user.get(Key.CURRENT_HANDSHAKE_ADDRESS).on(addr => { - if (typeof addr !== 'string') { - logger.error('expected handshake address to be an string') - - setAddress(null) - - return - } - - setAddress(addr) - }) - } - - return () => { - addressListeners.delete(cb) - } -} - -/** @type {Set<(dn: string|null) => void>} */ -const dnListeners = new Set() - -/** @type {string|null} */ -let currentDn = null - -const getDisplayName = () => currentDn - -/** @param {string|null} dn */ -const setDn = dn => { - currentDn = dn - dnListeners.forEach(l => l(currentDn)) -} - -let dnSubbed = false - -/** - * @param {(displayName: string|null) => void} cb - * @param {UserGUNNode} user Pass only for testing purposes. - * @throws {Error} If user hasn't been auth. - * @returns {() => void} - */ -const onDisplayName = (cb, user) => { - if (!user.is) { - throw new Error(ErrorCode.NOT_AUTH) - } - - cb(currentDn) - - dnListeners.add(cb) - - if (!dnSubbed) { - dnSubbed = true - user - .get(Key.PROFILE) - .get(Key.DISPLAY_NAME) - .on(displayName => { - if (typeof displayName === 'string' || displayName === null) { - setDn(displayName) - } - }) - } - - return () => { - dnListeners.delete(cb) - } -} - -/** - * @param {(messages: Record) => void} cb - * @param {string} userPK Public key of the user from whom the incoming - * messages will be obtained. - * @param {string} incomingFeedID ID of the outgoing feed from which the - * incoming messages will be obtained. - * @param {GUNNode} gun (Pass only for testing purposes) - * @param {UserGUNNode} user - * @param {ISEA} SEA - * @returns {void} - */ -const onIncomingMessages = (cb, userPK, incomingFeedID, gun, user, SEA) => { - if (!user.is) { - throw new Error(ErrorCode.NOT_AUTH) - } - - const callb = debounce(cb, DEBOUNCE_WAIT_TIME) - - const otherUser = gun.user(userPK) - - /** - * @type {Record} - */ - const messages = {} - - callb(messages) - - otherUser - .get(Key.OUTGOINGS) - .get(incomingFeedID) - .get(Key.MESSAGES) - .map() - .on(async (data, key) => { - if (!Schema.isMessage(data)) { - logger.warn('non-message received') - return - } - - /** @type {string} */ - const recipientEpub = await Utils.pubToEpub(userPK) - - const secret = await SEA.secret(recipientEpub, user._.sea) - - let { body } = data - body = await SEA.decrypt(body, secret) - - messages[key] = { - body, - timestamp: data.timestamp - } - - callb(messages) - }) -} - -/** - * @typedef {Record} Outgoings - * @typedef {(outgoings: Outgoings) => void} OutgoingsListener - */ - -/** - * @type {Outgoings} - */ -let currentOutgoings = {} - -const getCurrentOutgoings = () => currentOutgoings - -/** @type {Set} */ -const outgoingsListeners = new Set() - -outgoingsListeners.add(o => { - const values = Object.values(o) - const nulls = values.filter(x => x === null).length - const nonNulls = values.length - nulls - - logger.info(`new outgoings, ${nulls} nulls and ${nonNulls} nonNulls`) -}) - -const notifyOutgoingsListeners = () => { - outgoingsListeners.forEach(l => l(currentOutgoings)) -} - -let outSubbed = false - -/** - * @param {OutgoingsListener} cb - * @returns {() => void} - */ -const onOutgoing = cb => { - outgoingsListeners.add(cb) - cb(currentOutgoings) - - if (!outSubbed) { - const user = require('../../Mediator').getUser() - user.get(Key.OUTGOINGS).open( - debounce(async data => { - try { - if (typeof data !== 'object' || data === null) { - currentOutgoings = {} - notifyOutgoingsListeners() - return - } - - /** @type {Record} */ - const newOuts = {} - - const SEA = require('../../Mediator').mySEA - const mySecret = await Utils.mySecret() - - await CommonUtils.asyncForEach( - Object.entries(data), - async ([id, out]) => { - if (typeof out !== 'object') { - return - } - - if (out === null) { - newOuts[id] = null - return - } - - const { with: encPub, messages } = out - - if (typeof encPub !== 'string') { - return - } - - const pub = await SEA.decrypt(encPub, mySecret) - - if (!newOuts[id]) { - newOuts[id] = { - with: pub, - messages: {} - } - } - - const ourSec = await SEA.secret( - await Utils.pubToEpub(pub), - user._.sea - ) - - if (typeof messages === 'object' && messages !== null) { - await CommonUtils.asyncForEach( - Object.entries(messages), - async ([mid, msg]) => { - if (typeof msg === 'object' && msg !== null) { - if ( - typeof msg.body === 'string' && - typeof msg.timestamp === 'number' - ) { - const newOut = newOuts[id] - if (!newOut) { - return - } - newOut.messages[mid] = { - body: await SEA.decrypt(msg.body, ourSec), - timestamp: msg.timestamp - } - } - } - } - ) - } - } - ) - - currentOutgoings = newOuts - notifyOutgoingsListeners() - } catch (e) { - logger.info('--------------------------') - logger.info('Events -> onOutgoing') - logger.info(e) - logger.info('--------------------------') - } - }, 400) - ) - - outSubbed = true - } - - return () => { - outgoingsListeners.delete(cb) - } -} -//////////////////////////////////////////////////////////////////////////////// -/** - * @typedef {(chats: Chat[]) => void} ChatsListener - */ - -/** @type {Chat[]} */ -let currentChats = [] - -const getChats = () => currentChats - -/** @type {Set} */ -const chatsListeners = new Set() - -chatsListeners.add(c => { - logger.info(`Chats: ${c.length}`) -}) - -const notifyChatsListeners = () => { - chatsListeners.forEach(l => l(currentChats)) -} - -const processChats = debounce(() => { - const Streams = require('../streams') - const pubToAvatar = Streams.getPubToAvatar() - const pubToDn = Streams.getPubToDn() - const pubToLastSeenApp = Streams.getPubToLastSeenApp() - const existingOutgoings = /** @type {[string, Outgoing][]} */ (Object.entries( - getCurrentOutgoings() - ).filter(([_, o]) => o !== null)) - const pubToFeed = Streams.getPubToFeed() - - /** @type {Chat[]} */ - const newChats = [] - - for (const [outID, out] of existingOutgoings) { - if (typeof pubToAvatar[out.with] === 'undefined') { - // eslint-disable-next-line no-empty-function - Streams.onAvatar(() => {}, out.with)() - } - if (typeof pubToDn[out.with] === 'undefined') { - // eslint-disable-next-line no-empty-function - Streams.onDisplayName(() => {}, out.with)() - } - if (typeof pubToLastSeenApp[out.with] === 'undefined') { - // eslint-disable-next-line no-empty-function - Streams.onPubToLastSeenApp(() => {}, out.with)() - } - - /** @type {ChatMessage[]} */ - let msgs = Object.entries(out.messages) - .map(([mid, m]) => ({ - id: mid, - outgoing: true, - body: m.body, - timestamp: m.timestamp - })) - // filter out null messages - .filter(m => typeof m.body === 'string') - - const incoming = pubToFeed[out.with] - - if (Array.isArray(incoming)) { - msgs = [...msgs, ...incoming] - } - - /** @type {Chat} */ - const chat = { - recipientPublicKey: out.with, - didDisconnect: pubToFeed[out.with] === 'disconnected', - id: out.with + outID, - messages: msgs, - recipientAvatar: null, - recipientDisplayName: null, - lastSeenApp: pubToLastSeenApp[out.with] || null - } - - newChats.push(chat) - } - - currentChats = newChats.filter( - c => - Array.isArray(pubToFeed[c.recipientPublicKey]) || - pubToFeed[c.recipientPublicKey] === 'disconnected' - ) - - notifyChatsListeners() -}, 750) - -let onChatsSubbed = false - -/** - * Massages all of the more primitive data structures into a more manageable - * 'Chat' paradigm. - * @param {ChatsListener} cb - * @returns {() => void} - */ -const onChats = cb => { - if (!chatsListeners.add(cb)) { - throw new Error('Tried to subscribe twice') - } - cb(currentChats) - - if (!onChatsSubbed) { - const Streams = require('../streams') - onOutgoing(processChats) - Streams.onAvatar(processChats) - Streams.onDisplayName(processChats) - Streams.onPubToFeed(processChats) - Streams.onPubToLastSeenApp(processChats) - onChatsSubbed = true - } - - return () => { - if (!chatsListeners.delete(cb)) { - throw new Error('Tried to unsubscribe twice') - } - } -} - -/** @type {string|null} */ -let currentBio = null - -/** - * @param {(bio: string|null) => void} cb - * @param {UserGUNNode} user Pass only for testing purposes. - * @throws {Error} If user hasn't been auth. - * @returns {void}outgoingsListeners.forEach() - */ -const onBio = (cb, user) => { - if (!user.is) { - throw new Error(ErrorCode.NOT_AUTH) - } - - const callb = debounce(cb, DEBOUNCE_WAIT_TIME) - // Initial value if avvatar is undefined in gun - callb(currentBio) - - user.get(Key.BIO).on(bio => { - if (typeof bio === 'string' || bio === null) { - currentBio = bio - callb(bio) - } - }) -} - /** @type {string|null} */ let currentSeedBackup = null /** * @param {(seedBackup: string|null) => void} cb - * @param {UserGUNNode} user - * @param {ISEA} SEA + * @param {Smith.UserSmithNode} user + * @param {import('../SimpleGUN').ISEA} SEA * @throws {Error} If user hasn't been auth. * @returns {void} */ @@ -616,23 +41,5 @@ const onSeedBackup = (cb, user, SEA) => { } module.exports = { - __onUserToIncoming, - onAvatar, - onBlacklist, - onCurrentHandshakeAddress, - onDisplayName, - onIncomingMessages, - onOutgoing, - getCurrentOutgoings, - onSimplerReceivedRequests: require('./onReceivedReqs').onReceivedReqs, - onSimplerSentRequests: require('./onSentReqs').onSentReqs, - getCurrentSentReqs: require('./onSentReqs').getCurrentSentReqs, - getCurrentReceivedReqs: require('./onReceivedReqs').getReceivedReqs, - onBio, - onSeedBackup, - onChats, - getAvatar, - getDisplayName, - getHandshakeAddress, - getChats + onSeedBackup } diff --git a/services/gunDB/contact-api/events/onReceivedReqs.js b/services/gunDB/contact-api/events/onReceivedReqs.js deleted file mode 100644 index 66048e83..00000000 --- a/services/gunDB/contact-api/events/onReceivedReqs.js +++ /dev/null @@ -1,151 +0,0 @@ -/** @format */ -const debounce = require('lodash/debounce') -const logger = require('winston') -const { Schema } = require('shock-common') -const size = require('lodash/size') - -const Key = require('../key') -const Streams = require('../streams') - -/** - * @typedef {Readonly} SimpleReceivedRequest - * @typedef {(reqs: ReadonlyArray) => void} Listener - */ - -/** @type {Set} */ -const listeners = new Set() - -/** @type {string|null} */ -let currentAddress = null - -/** @type {Record} */ -let currReceivedReqsMap = {} - -/** - * Unprocessed requests in current handshake node. - * @type {Record} - */ -let currAddressData = {} - -/** @returns {SimpleReceivedRequest[]} */ -const getReceivedReqs = () => Object.values(currReceivedReqsMap) -/** @param {Record} reqs */ -const setReceivedReqsMap = reqs => { - currReceivedReqsMap = reqs - listeners.forEach(l => l(getReceivedReqs())) -} - -listeners.add(() => { - logger.info(`new received reqs: ${size(getReceivedReqs())}`) -}) - -const react = debounce(() => { - /** @type {Record} */ - const newReceivedReqsMap = {} - - const pubToFeed = Streams.getPubToFeed() - const pubToAvatar = Streams.getPubToAvatar() - const pubToDn = Streams.getPubToDn() - - for (const [id, req] of Object.entries(currAddressData)) { - const inContact = Array.isArray(pubToFeed[req.from]) - const isDisconnected = pubToFeed[req.from] === 'disconnected' - - if (typeof pubToAvatar[req.from] === 'undefined') { - // eslint-disable-next-line no-empty-function - Streams.onAvatar(() => {}, req.from)() - } - if (typeof pubToDn[req.from] === 'undefined') { - // eslint-disable-next-line no-empty-function - Streams.onDisplayName(() => {}, req.from)() - } - - if (!inContact && !isDisconnected) { - newReceivedReqsMap[req.from] = { - id, - requestorAvatar: null, - requestorDisplayName: null, - requestorPK: req.from, - timestamp: req.timestamp - } - } - } - - setReceivedReqsMap(newReceivedReqsMap) -}, 750) - -/** - * @param {string} addr - * @returns {(data: import('../SimpleGUN').OpenListenerData) => void} - */ -const listenerForAddr = addr => data => { - // did invalidate - if (addr !== currentAddress) { - return - } - - if (typeof data !== 'object' || data === null) { - currAddressData = {} - } else { - for (const [id, req] of Object.entries(data)) { - // no need to update them just write them once - if (Schema.isHandshakeRequest(req) && !currAddressData[id]) { - currAddressData[id] = req - } - } - } - - logger.info('data for address length: ' + size(addr)) - - react() -} - -let subbed = false - -/** - * @param {Listener} cb - * @returns {() => void} - */ -const onReceivedReqs = cb => { - listeners.add(cb) - cb(getReceivedReqs()) - - if (!subbed) { - const user = require('../../Mediator').getUser() - if (!user.is) { - logger.warn('Tried subscribing to onReceivedReqs without authing') - } - require('./index').onCurrentHandshakeAddress(addr => { - if (currentAddress === addr) { - return - } - - currentAddress = addr - currAddressData = {} - setReceivedReqsMap({}) - - if (typeof addr === 'string') { - require('../../Mediator') - .getGun() - .get(Key.HANDSHAKE_NODES) - .get(addr) - .open(listenerForAddr(addr)) - } - }, user) - - Streams.onAvatar(react) - Streams.onDisplayName(react) - Streams.onPubToFeed(react) - - subbed = true - } - - return () => { - listeners.delete(cb) - } -} - -module.exports = { - getReceivedReqs, - onReceivedReqs -} diff --git a/services/gunDB/contact-api/events/onSentReqs.js b/services/gunDB/contact-api/events/onSentReqs.js deleted file mode 100644 index 653ad3dc..00000000 --- a/services/gunDB/contact-api/events/onSentReqs.js +++ /dev/null @@ -1,146 +0,0 @@ -/** @format */ -const debounce = require('lodash/debounce') -const logger = require('winston') -const size = require('lodash/size') - -const Streams = require('../streams') -/** - * @typedef {import('../SimpleGUN').UserGUNNode} UserGUNNode - * @typedef {import('../SimpleGUN').GUNNode} GUNNode - * @typedef {import('../SimpleGUN').ISEA} ISEA - * @typedef {import('../SimpleGUN').ListenerData} ListenerData - * @typedef {import('shock-common').Schema.HandshakeRequest} HandshakeRequest - * @typedef {import('shock-common').Schema.Message} Message - * @typedef {import('shock-common').Schema.Outgoing} Outgoing - * @typedef {import('shock-common').Schema.PartialOutgoing} PartialOutgoing - * @typedef {import('shock-common').Schema.Chat} Chat - * @typedef {import('shock-common').Schema.ChatMessage} ChatMessage - * @typedef {import('shock-common').Schema.SimpleSentRequest} SimpleSentRequest - * @typedef {import('shock-common').Schema.SimpleReceivedRequest} SimpleReceivedRequest - */ - -/** - * @typedef {(chats: SimpleSentRequest[]) => void} Listener - */ - -/** @type {Set} */ -const listeners = new Set() - -/** @type {SimpleSentRequest[]} */ -let currentReqs = [] - -listeners.add(() => { - logger.info(`new sent reqs length: ${size(currentReqs)}`) -}) - -const getCurrentSentReqs = () => currentReqs - -// any time any of the streams we use notifies us that it changed, we fire up -// react() -const react = debounce(() => { - /** @type {SimpleSentRequest[]} */ - const newReqs = [] - - // reactive streams - // maps a pk to its current handshake address - const pubToHAddr = Streams.getAddresses() - // a set or list containing copies of sent requests - const storedReqs = Streams.getStoredReqs() - // maps a pk to the last request sent to it (so old stored reqs are invalidated) - const pubToLastSentReqID = Streams.getSentReqIDs() - // maps a pk to a feed, messages if subbed and pk is pubbing, null / - // 'disconnected' otherwise - const pubToFeed = Streams.getPubToFeed() - // pk to avatar - const pubToAvatar = Streams.getPubToAvatar() - // pk to display name - const pubToDN = Streams.getPubToDn() - - logger.info(`pubToLastSentREqID length: ${size(pubToLastSentReqID)}`) - - for (const storedReq of storedReqs) { - const { handshakeAddress, recipientPub, sentReqID, timestamp } = storedReq - const currAddress = pubToHAddr[recipientPub] - - const lastReqID = pubToLastSentReqID[recipientPub] - // invalidate if this stored request is not the last one sent to this - // particular pk - const isStale = typeof lastReqID !== 'undefined' && lastReqID !== sentReqID - // invalidate if we are in a pub/sub state to this pk (handshake in place) - const isConnected = Array.isArray(pubToFeed[recipientPub]) - - if (isStale || isConnected) { - // eslint-disable-next-line no-continue - continue - } - - // no address for this pk? let's ask the corresponding stream to sub to - // gun.user(pk).get('currentAddr') - if (typeof currAddress === 'undefined') { - // eslint-disable-next-line no-empty-function - Streams.onAddresses(() => {}, recipientPub)() - } - // no avatar for this pk? let's ask the corresponding stream to sub to - // gun.user(pk).get('avatar') - if (typeof pubToAvatar[recipientPub] === 'undefined') { - // eslint-disable-next-line no-empty-function - Streams.onAvatar(() => {}, recipientPub)() - } - // no display name for this pk? let's ask the corresponding stream to sub to - // gun.user(pk).get('displayName') - if (typeof pubToDN[recipientPub] === 'undefined') { - // eslint-disable-next-line no-empty-function - Streams.onDisplayName(() => {}, recipientPub)() - } - - newReqs.push({ - id: sentReqID, - recipientAvatar: null, - recipientChangedRequestAddress: - // if we haven't received the other's user current handshake address, - // let's assume he hasn't changed it and that this request is still - // valid - typeof currAddress !== 'undefined' && handshakeAddress !== currAddress, - recipientDisplayName: null, - recipientPublicKey: recipientPub, - timestamp - }) - } - - currentReqs = newReqs - - listeners.forEach(l => l(currentReqs)) -}, 750) - -let subbed = false - -/** - * Massages all of the more primitive data structures into a more manageable - * 'Chat' paradigm. - * @param {Listener} cb - * @returns {() => void} - */ -const onSentReqs = cb => { - listeners.add(cb) - cb(currentReqs) - - if (!subbed) { - Streams.onAddresses(react) - Streams.onStoredReqs(react) - Streams.onLastSentReqIDs(react) - Streams.onPubToFeed(react) - Streams.onAvatar(react) - Streams.onDisplayName(react) - - subbed = true - } - - return () => { - listeners.delete(cb) - } -} - -module.exports = { - onSentReqs, - getCurrentSentReqs -} diff --git a/services/gunDB/contact-api/getters/feed.js b/services/gunDB/contact-api/getters/feed.js deleted file mode 100644 index ba4704ce..00000000 --- a/services/gunDB/contact-api/getters/feed.js +++ /dev/null @@ -1,89 +0,0 @@ -/** - * @format - */ -//@ts-ignore -const Common = require('shock-common') -const isFinite = require('lodash/isFinite') -const shuffle = require('lodash/shuffle') -const R = require('ramda') - -const { asyncFilter } = require('../../../../utils') - -const Follows = require('./follows') -const Wall = require('./wall') - -/** - * @param {number} numberOfPublicKeyGroups - * @param {number} pageRequested - * @returns {[ number , number ]} - */ -const calculateWallRequest = (numberOfPublicKeyGroups, pageRequested) => { - // thanks to sebassdc - - return [ - (pageRequested - 1) % numberOfPublicKeyGroups, - Math.ceil(pageRequested / numberOfPublicKeyGroups) - ] -} - -/** - * @param {number} page - * @throws {TypeError} - * @throws {RangeError} - * @returns {Promise} - */ -//@returns {Promise} -const getFeedPage = async page => { - if (!isFinite(page)) { - throw new TypeError(`Please provide an actual number for [page]`) - } - - if (page <= 0) { - throw new RangeError(`Please provide only positive numbers for [page]`) - } - - const subbedPublicKeys = Object.values(await Follows.currentFollows()).map( - f => f.user - ) - - if (subbedPublicKeys.length === 0) { - return [] - } - - // say there are 20 public keys total - // page 1: page 1 from first 10 public keys - // page 2: page 1 from second 10 public keys - // page 3: page 2 from first 10 public keys - // page 4: page 2 from first 10 public keys - // etc - // thanks to sebassdc (github) - - const pagedPublicKeys = R.splitEvery(10, shuffle(subbedPublicKeys)) - - const [publicKeyGroupIdx, pageToRequest] = calculateWallRequest( - pagedPublicKeys.length, - page - ) - - const publicKeysRaw = pagedPublicKeys[publicKeyGroupIdx] - const publicKeys = await asyncFilter( - publicKeysRaw, - // reject public keys for which the page to request would result in an out - // of bounds error - async pk => pageToRequest <= (await Wall.getWallTotalPages(pk)) - ) - - const fetchedPages = await Promise.all( - publicKeys.map(pk => Wall.getWallPage(pageToRequest, pk)) - ) - - const fetchedPostsGroups = fetchedPages.map(wp => Object.values(wp.posts)) - const fetchedPosts = R.flatten(fetchedPostsGroups) - const sortered = R.sort((a, b) => b.date - a.date, fetchedPosts) - - return sortered -} - -module.exports = { - getFeedPage -} diff --git a/services/gunDB/contact-api/getters/follows.js b/services/gunDB/contact-api/getters/follows.js deleted file mode 100644 index da7de6e1..00000000 --- a/services/gunDB/contact-api/getters/follows.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @format - */ -const Common = require('shock-common') -const Logger = require('winston') -const size = require('lodash/size') - -const Utils = require('../utils') -const Key = require('../key') - -/** - * @typedef {Common.Schema.Follow} Follow - */ - -/** - * @throws {TypeError} - * @returns {Promise>} - */ -exports.currentFollows = async () => { - /** - * @type {Record} - */ - const raw = await Utils.tryAndWait( - (_, user) => - new Promise(res => - // @ts-expect-error - user.get(Key.FOLLOWS).load(res) - ), - v => { - if (typeof v !== 'object' || v === null) { - return true - } - - // load sometimes returns an empty set on the first try - if (size(v) === 0) { - return true - } - - // sometimes it returns empty sub objects - return Object.values(v) - .filter(Common.Schema.isObj) - .some(obj => size(obj) === 0) - } - ) - - if (typeof raw !== 'object' || raw === null) { - Logger.error( - `Expected user.follows to be an object but instead got: ${JSON.stringify( - raw - )}` - ) - throw new TypeError('Could not get follows, not an object') - } - - const clean = { - ...raw - } - - for (const [key, followOrNull] of Object.entries(clean)) { - if (!Common.Schema.isFollow(followOrNull)) { - delete clean[key] - } - } - - return clean -} diff --git a/services/gunDB/contact-api/getters/index.js b/services/gunDB/contact-api/getters/index.js index 81ea8dc2..2f2d9944 100644 --- a/services/gunDB/contact-api/getters/index.js +++ b/services/gunDB/contact-api/getters/index.js @@ -1,27 +1,19 @@ /** * @format */ -const Common = require('shock-common') const Key = require('../key') -const Utils = require('../utils') - -const Wall = require('./wall') -const Feed = require('./feed') -const User = require('./user') -const { size } = require('lodash') /** * @param {string} pub * @returns {Promise} */ exports.currentOrderAddress = async pub => { - const currAddr = await Utils.tryAndWait(gun => - gun - .user(pub) - .get(Key.CURRENT_ORDER_ADDRESS) - .then() - ) + const currAddr = await require('../../Mediator') + .getGun() + .user(pub) + .get(Key.CURRENT_ORDER_ADDRESS) + .specialThen() if (typeof currAddr !== 'string') { throw new TypeError('Expected user.currentOrderAddress to be an string') @@ -29,118 +21,3 @@ exports.currentOrderAddress = async pub => { return currAddr } - -/** - * @param {string} pub - * @returns {Promise} - */ -exports.userToIncomingID = async pub => { - const incomingID = await require('../../Mediator') - .getUser() - .get(Key.USER_TO_INCOMING) - .get(pub) - .then() - - if (typeof incomingID === 'string') return incomingID - - return null -} - -/** - * @returns {Promise} - */ -//@returns {Promise} -const getMyUser = async () => { - const oldProfile = await Utils.tryAndWait( - (_, user) => new Promise(res => user.get(Key.PROFILE).load(res)), - v => { - if (typeof v !== 'object') { - return true - } - - if (v === null) { - return true - } - - // load sometimes returns an empty set on the first try - return size(v) === 0 - } - ) - - const bio = await Utils.tryAndWait( - (_, user) => user.get(Key.BIO).then(), - v => typeof v !== 'string' - ) - - const lastSeenApp = await Utils.tryAndWait( - (_, user) => user.get(Key.LAST_SEEN_APP).then(), - v => typeof v !== 'number' - ) - - const lastSeenNode = await Utils.tryAndWait( - (_, user) => user.get(Key.LAST_SEEN_NODE).then(), - v => typeof v !== 'number' - ) - - const publicKey = await Utils.tryAndWait( - (_, user) => Promise.resolve(user.is && user.is.pub), - v => typeof v !== 'string' - ) - //@ts-ignore - /** @type {Common.SchemaTypes.User} */ - const u = { - avatar: oldProfile.avatar, - // @ts-ignore - bio, - displayName: oldProfile.displayName, - // @ts-ignore - lastSeenApp, - // @ts-ignore - lastSeenNode, - // @ts-ignore - publicKey - } - - return u -} -/** - * @param {string} publicKey - */ -const getUserInfo = async publicKey => { - const userInfo = await Utils.tryAndWait( - gun => - new Promise(res => - gun - .user(publicKey) - .get(Key.PROFILE) - .load(res) - ), - v => { - if (typeof v !== 'object') { - return true - } - - if (v === null) { - return true - } - - // load sometimes returns an empty set on the first try - return size(v) === 0 - } - ) - return { - publicKey, - avatar: userInfo.avatar, - displayName: userInfo.displayName - } -} - -module.exports.getMyUser = getMyUser -module.exports.getUserInfo = getUserInfo -module.exports.Follows = require('./follows') - -module.exports.getWallPage = Wall.getWallPage -module.exports.getWallTotalPages = Wall.getWallTotalPages - -module.exports.getFeedPage = Feed.getFeedPage -module.exports.getAnUser = User.getAnUser diff --git a/services/gunDB/contact-api/getters/user.js b/services/gunDB/contact-api/getters/user.js deleted file mode 100644 index f560d65c..00000000 --- a/services/gunDB/contact-api/getters/user.js +++ /dev/null @@ -1,129 +0,0 @@ -/** - * @format - */ -const Common = require('shock-common') -const size = require('lodash/size') - -const Key = require('../key') -const Utils = require('../utils') - -/** - * @param {string} publicKey - * @returns {Promise} - */ -//@returns {Promise} -const getAnUser = async publicKey => { - const oldProfile = await Utils.tryAndWait( - (g, u) => { - const user = u._.sea.pub === publicKey ? u : g.user(publicKey) - - return new Promise(res => user.get(Key.PROFILE).load(res)) - }, - v => typeof v !== 'object' - ) - - const bio = await Utils.tryAndWait( - (g, u) => { - const user = u._.sea.pub === publicKey ? u : g.user(publicKey) - - return user.get(Key.BIO).then() - }, - v => typeof v !== 'string' - ) - - const lastSeenApp = await Utils.tryAndWait( - (g, u) => { - const user = u._.sea.pub === publicKey ? u : g.user(publicKey) - - return user.get(Key.LAST_SEEN_APP).then() - }, - v => typeof v !== 'number' - ) - - const lastSeenNode = await Utils.tryAndWait( - (g, u) => { - const user = u._.sea.pub === publicKey ? u : g.user(publicKey) - - return user.get(Key.LAST_SEEN_NODE).then() - }, - v => typeof v !== 'number' - ) - //@ts-ignore - /** @type {Common.SchemaTypes.User} */ - const u = { - avatar: oldProfile.avatar || null, - // @ts-ignore - bio: bio || null, - displayName: oldProfile.displayName || null, - // @ts-ignore - lastSeenApp: lastSeenApp || 0, - // @ts-ignore - lastSeenNode: lastSeenNode || 0, - // @ts-ignore - publicKey - } - - return u -} - -module.exports.getAnUser = getAnUser - -/** - * @returns {Promise} - */ -//@returns {Promise} -const getMyUser = async () => { - const oldProfile = await Utils.tryAndWait( - (_, user) => new Promise(res => user.get(Key.PROFILE).load(res)), - v => { - if (typeof v !== 'object') { - return true - } - - if (v === null) { - return true - } - - // load sometimes returns an empty set on the first try - return size(v) === 0 - } - ) - - const bio = await Utils.tryAndWait( - (_, user) => user.get(Key.BIO).then(), - v => typeof v !== 'string' - ) - - const lastSeenApp = await Utils.tryAndWait( - (_, user) => user.get(Key.LAST_SEEN_APP).then(), - v => typeof v !== 'number' - ) - - const lastSeenNode = await Utils.tryAndWait( - (_, user) => user.get(Key.LAST_SEEN_NODE).then(), - v => typeof v !== 'number' - ) - - const publicKey = await Utils.tryAndWait( - (_, user) => Promise.resolve(user.is && user.is.pub), - v => typeof v !== 'string' - ) - //@ts-ignore - /** @type {Common.SchemaTypes.User} */ - const u = { - avatar: oldProfile.avatar, - // @ts-ignore - bio, - displayName: oldProfile.displayName, - // @ts-ignore - lastSeenApp, - // @ts-ignore - lastSeenNode, - // @ts-ignore - publicKey - } - - return u -} - -module.exports.getMyUser = getMyUser diff --git a/services/gunDB/contact-api/getters/wall.js b/services/gunDB/contact-api/getters/wall.js deleted file mode 100644 index 96c7fd70..00000000 --- a/services/gunDB/contact-api/getters/wall.js +++ /dev/null @@ -1,208 +0,0 @@ -/** - * @format - */ -const Common = require('shock-common') -const pickBy = require('lodash/pickBy') -const size = require('lodash/size') -const mapValues = require('lodash/mapValues') - -const Utils = require('../utils') -const Key = require('../key') - -const User = require('./user') - -/** - * @param {string=} publicKey - * @returns {Promise} - */ -const getWallTotalPages = async publicKey => { - const totalPages = await Utils.tryAndWait( - (gun, u) => { - /** - * @type {import('../SimpleGUN').GUNNode} - */ - let user = u - - if (publicKey && u._.sea.pub !== publicKey) { - user = gun.user(publicKey) - } - - return user - .get(Key.WALL) - .get(Key.NUM_OF_PAGES) - .then() - }, - v => typeof v !== 'number' - ) - - return typeof totalPages === 'number' ? totalPages : 0 -} - -/** - * @param {number} page - * @param {string=} publicKey - * @throws {TypeError} - * @throws {RangeError} - * @returns {Promise} - */ -////@returns {Promise} -const getWallPage = async (page, publicKey) => { - const totalPages = await getWallTotalPages(publicKey) - - if (page === 0) { - throw new RangeError( - `Page number cannot be zero, only positive and negative integers are allowed.` - ) - } - - const empty = { - count: 0, - posts: {} - } - - if (totalPages === 0) { - return empty - } - - const actualPageIdx = page < 0 ? totalPages + page : page - 1 - - if (actualPageIdx > totalPages - 1) { - throw new RangeError(`Requested a page out of bounds`) - } - - /** - * @type {number} - */ - // @ts-ignore - const count = await Utils.tryAndWait( - (g, u) => { - /** - * @type {import('../SimpleGUN').GUNNode} - */ - let user = u - - if (publicKey && u._.sea.pub !== publicKey) { - user = g.user(publicKey) - } - - return user - .get(Key.WALL) - .get(Key.PAGES) - .get(actualPageIdx.toString()) - .get(Key.COUNT) - .then() - }, - v => typeof v !== 'number' - ) - - if (count === 0) { - return empty - } - - /** - * We just use it so Common.Schema.isWallPage passes. - */ - const mockUser = await User.getMyUser() - - /* - * @type {Common.SchemaTypes.WallPage} - */ - //@ts-ignore - const thePage = await Utils.tryAndWait( - (g, u) => { - /** - * @type {import('../SimpleGUN').GUNNode} - */ - let user = u - - if (publicKey && u._.sea.pub !== publicKey) { - user = g.user(publicKey) - } - - return new Promise(res => { - // forces data fetch - user - .get(Key.WALL) - .get(Key.PAGES) - .get(actualPageIdx.toString()) - // @ts-ignore - .load(() => {}) - - process.nextTick(() => { - user - .get(Key.WALL) - .get(Key.PAGES) - .get(actualPageIdx.toString()) - // @ts-ignore - .load(res) - }) - }) - }, - maybePage => { - // sometimes load() returns an empty object on the first call - if (size(/** @type {any} */ (maybePage)) === 0) { - return true - } - - const page = /** @type {Common.Schema.WallPage} */ (maybePage) - - if (typeof page.count !== 'number') { - return true - } - - // removes 'unused' initializer and aborted writes - page.posts = pickBy(page.posts, v => v !== null) - - // .load() sometimes doesn't load all data on first call - if (size(page.posts) === 0) { - return true - } - - // Give ids based on keys - page.posts = mapValues(page.posts, (v, k) => ({ - ...v, - id: k - })) - - page.posts = mapValues(page.posts, v => ({ - ...v, - // isWallPage() would otherwise not pass - author: mockUser - })) - - return !Common.Schema.isWallPage(page) - } - ) - - const clean = { - ...thePage - } - - for (const [key, post] of Object.entries(clean.posts)) { - // delete unsuccessful writes - if (post === null) { - delete clean.posts[key] - clean.count-- - } else { - post.author = publicKey - ? // eslint-disable-next-line no-await-in-loop - await User.getAnUser(publicKey) - : // eslint-disable-next-line no-await-in-loop - await User.getMyUser() - post.id = key - } - } - - if (!Common.Schema.isWallPage(clean)) { - throw new Error( - `Fetched page not a wall page, instead got: ${JSON.stringify(clean)}` - ) - } - - return clean -} - -module.exports = { - getWallTotalPages, - getWallPage -} diff --git a/services/gunDB/contact-api/jobs/index.js b/services/gunDB/contact-api/jobs/index.js index 8818d047..96dcc67d 100644 --- a/services/gunDB/contact-api/jobs/index.js +++ b/services/gunDB/contact-api/jobs/index.js @@ -9,12 +9,10 @@ * tasks accept factories that are homonymous to the events on this same module. */ -const onAcceptedRequests = require('./onAcceptedRequests') const onOrders = require('./onOrders') const lastSeenNode = require('./lastSeenNode') module.exports = { - onAcceptedRequests, onOrders, lastSeenNode } diff --git a/services/gunDB/contact-api/jobs/lastSeenNode.js b/services/gunDB/contact-api/jobs/lastSeenNode.js index 4bd070ee..c92ef7e6 100644 --- a/services/gunDB/contact-api/jobs/lastSeenNode.js +++ b/services/gunDB/contact-api/jobs/lastSeenNode.js @@ -2,7 +2,7 @@ * @format */ -const logger = require('winston') +const logger = require('../../../../config/log') const { Constants: { @@ -11,12 +11,13 @@ const { } } = require('shock-common') const Key = require('../key') +/// /** - * @typedef {import('../SimpleGUN').GUNNode} GUNNode - * @typedef {import('../SimpleGUN').ListenerData} ListenerData + * @typedef {Smith.GunSmithNode} GUNNode + * @typedef {GunT.ListenerData} ListenerData * @typedef {import('../SimpleGUN').ISEA} ISEA - * @typedef {import('../SimpleGUN').UserGUNNode} UserGUNNode + * @typedef {Smith.UserSmithNode} UserGUNNode */ /** @@ -26,27 +27,34 @@ const Key = require('../key') */ const lastSeenNode = user => { if (!user.is) { - logger.warn('onOrders() -> tried to sub without authing') + logger.warn('lastSeenNode() -> tried to sub without authing') throw new Error(ErrorCode.NOT_AUTH) } - setInterval(() => { - if (user.is) { - user.get(Key.LAST_SEEN_NODE).put(Date.now(), ack => { - if (ack.err && typeof ack.err !== 'number') { - logger.error(`Error inside lastSeenNode job: ${ack.err}`) - } - }) + let gotLatestProfileAck = true - user - .get(Key.PROFILE) - .get(Key.LAST_SEEN_NODE) - .put(Date.now(), ack => { - if (ack.err && typeof ack.err !== 'number') { - logger.error(`Error inside lastSeenNode job: ${ack.err}`) - } - }) + setInterval(() => { + if (!user.is) { + return } + if (!gotLatestProfileAck) { + logger.error(`lastSeenNode profile job: didnt get latest ack`) + return + } + gotLatestProfileAck = false + user + .get(Key.PROFILE) + .get(Key.LAST_SEEN_NODE) + .put(Date.now(), ack => { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { + logger.error(`Error inside lastSeenNode profile job: ${ack.err}`) + } + gotLatestProfileAck = true + }) }, LAST_SEEN_NODE_INTERVAL) } diff --git a/services/gunDB/contact-api/jobs/onAcceptedRequests.js b/services/gunDB/contact-api/jobs/onAcceptedRequests.js deleted file mode 100644 index 255cc107..00000000 --- a/services/gunDB/contact-api/jobs/onAcceptedRequests.js +++ /dev/null @@ -1,191 +0,0 @@ -/** - * @format - */ -const logger = require('winston') -const { - Constants: { ErrorCode }, - Schema -} = require('shock-common') -const size = require('lodash/size') - -const Key = require('../key') -const Utils = require('../utils') - -/** - * @typedef {import('../SimpleGUN').GUNNode} GUNNode - * @typedef {import('../SimpleGUN').ISEA} ISEA - * @typedef {import('../SimpleGUN').UserGUNNode} UserGUNNode - */ - -let procid = 0 - -/** - * @throws {Error} NOT_AUTH - * @param {UserGUNNode} user - * @param {ISEA} SEA - * @returns {void} - */ -const onAcceptedRequests = (user, SEA) => { - if (!user.is) { - logger.warn('onAcceptedRequests() -> tried to sub without authing') - throw new Error(ErrorCode.NOT_AUTH) - } - - procid++ - - user - .get(Key.STORED_REQS) - .map() - .once(async (storedReq, id) => { - logger.info( - `------------------------------------\nPROCID:${procid} (used for debugging memory leaks in jobs)\n---------------------------------------` - ) - - const mySecret = require('../../Mediator').getMySecret() - - try { - if (!Schema.isStoredRequest(storedReq)) { - throw new Error( - 'Stored request not an StoredRequest, instead got: ' + - JSON.stringify(storedReq) + - ' this can be due to nulling out an old request (if null) or something else happened (please look at the output)' - ) - } - // get the recipient pub from the stored request to avoid an attacker - // overwriting the handshake request in the root graph - const recipientPub = await SEA.decrypt(storedReq.recipientPub, mySecret) - - if (typeof recipientPub !== 'string') { - throw new TypeError( - `Expected storedReq.recipientPub to be an string, instead got: ${recipientPub}` - ) - } - - if (await Utils.successfulHandshakeAlreadyExists(recipientPub)) { - return - } - - const requestAddress = await SEA.decrypt( - storedReq.handshakeAddress, - mySecret - ) - if (typeof requestAddress !== 'string') { - throw new TypeError() - } - const sentReqID = await SEA.decrypt(storedReq.sentReqID, mySecret) - if (typeof sentReqID !== 'string') { - throw new TypeError() - } - - const latestReqSentID = await Utils.recipientPubToLastReqSentID( - recipientPub - ) - - const isStaleRequest = latestReqSentID !== sentReqID - if (isStaleRequest) { - return - } - - const gun = require('../../Mediator').getGun() - const user = require('../../Mediator').getUser() - - const recipientEpub = await Utils.pubToEpub(recipientPub) - const ourSecret = await SEA.secret(recipientEpub, user._.sea) - - await /** @type {Promise} */ (new Promise((res, rej) => { - gun - .get(Key.HANDSHAKE_NODES) - .get(requestAddress) - .get(sentReqID) - .on(async sentReq => { - if (!Schema.isHandshakeRequest(sentReq)) { - rej( - new Error( - 'sent request found in handshake node not a handshake request' - ) - ) - return - } - - // The response can be decrypted with the same secret regardless - // of who wrote to it last (see HandshakeRequest definition). This - // could be our feed ID for the recipient, or the recipient's feed - // id if he accepted the request. - const feedID = await SEA.decrypt(sentReq.response, ourSecret) - - if (typeof feedID !== 'string') { - throw new TypeError("typeof feedID !== 'string'") - } - - logger.info(`onAcceptedRequests -> decrypted feed ID: ${feedID}`) - - logger.info( - 'Will now try to access the other users outgoing feed' - ) - - const maybeFeedOnRecipientsOutgoings = await Utils.tryAndWait( - gun => - new Promise(res => { - gun - .user(recipientPub) - .get(Key.OUTGOINGS) - .get(feedID) - .once(feed => { - res(feed) - }) - }), - // @ts-ignore - v => size(v) === 0 - ) - - const feedIDExistsOnRecipientsOutgoings = - typeof maybeFeedOnRecipientsOutgoings === 'object' && - maybeFeedOnRecipientsOutgoings !== null - - if (!feedIDExistsOnRecipientsOutgoings) { - return - } - - const encryptedForMeIncomingID = await SEA.encrypt( - feedID, - mySecret - ) - - await /** @type {Promise} */ (new Promise((res, rej) => { - user - .get(Key.USER_TO_INCOMING) - .get(recipientPub) - .put(encryptedForMeIncomingID, ack => { - if (ack.err && typeof ack.err !== 'number') { - rej(new Error(ack.err)) - } else { - res() - } - }) - })) - - await /** @type {Promise} */ (new Promise((res, rej) => { - user - .get(Key.STORED_REQS) - .get(id) - .put(null, ack => { - if (ack.err && typeof ack.err !== 'number') { - rej(new Error(ack.err)) - } else { - res() - } - }) - })) - - // ensure this listeners gets called at least once - res() - }) - })) - } catch (err) { - logger.warn(`Jobs.onAcceptedRequests() -> ${err.message}`) - logger.error(err) - } - }) -} - -module.exports = onAcceptedRequests diff --git a/services/gunDB/contact-api/jobs/onOrders.js b/services/gunDB/contact-api/jobs/onOrders.js index 23bfbf0a..d9e8634b 100644 --- a/services/gunDB/contact-api/jobs/onOrders.js +++ b/services/gunDB/contact-api/jobs/onOrders.js @@ -2,7 +2,7 @@ * @format */ // @ts-check -const logger = require('winston') +const logger = require('../../../../config/log') const isFinite = require('lodash/isFinite') const isNumber = require('lodash/isNumber') const isNaN = require('lodash/isNaN') @@ -15,8 +15,9 @@ const SchemaManager = require('../../../schema') const LightningServices = require('../../../../utils/lightningServices') const Key = require('../key') const Utils = require('../utils') -const Gun = require('gun') const { selfContentToken, enrollContentTokens } = require('../../../seed') +/// +const TipForwarder = require('../../../tipsCallback') const getUser = () => require('../../Mediator').getUser() @@ -26,10 +27,10 @@ const getUser = () => require('../../Mediator').getUser() const ordersProcessed = new Set() /** - * @typedef {import('../SimpleGUN').GUNNode} GUNNode - * @typedef {import('../SimpleGUN').ListenerData} ListenerData + * @typedef {Smith.GunSmithNode} GUNNode + * @typedef {GunT.ListenerData} ListenerData * @typedef {import('../SimpleGUN').ISEA} ISEA - * @typedef {import('../SimpleGUN').UserGUNNode} UserGUNNode + * @typedef {Smith.UserSmithNode} UserGUNNode */ /** @@ -87,32 +88,41 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { try { if (addr !== currentOrderAddr) { logger.info( + orderID, `order address: ${addr} invalidated (current address: ${currentOrderAddr})` ) return } - if (!Schema.isOrder(order)) { - logger.info(`Expected an order instead got: ${JSON.stringify(order)}`) + // Was recycled + if (order === null) { return } - if (ordersProcessed.has(orderID)) { - logger.warn( - `skipping already processed order: ${orderID}, this means orders are being processed twice!` + if (!Schema.isOrder(order)) { + logger.info( + orderID, + `Expected an order instead got: ${JSON.stringify(order)}` ) return } + // Gun might callback several times for the same order, avoid dupe + // processing. + if (ordersProcessed.has(orderID)) { + return + } + //const listenerStartTime = performance.now() ordersProcessed.add(orderID) - logger.info( - `onOrders() -> processing order: ${orderID} -- ${JSON.stringify( - order - )} -- addr: ${addr}` - ) + if (Date.now() - order.timestamp > 66000) { + logger.info('Not processing old order', orderID) + return + } + + logger.info('processing order ', orderID) const alreadyAnswered = await getUser() .get(Key.ORDER_TO_RESPONSE) @@ -120,10 +130,12 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { .then() if (alreadyAnswered) { - logger.info('this order is already answered, quitting') + logger.info(orderID, 'alreadyAnswered') return } + logger.info(orderID, ' was not answered, will now answer') + const senderEpub = await Utils.pubToEpub(order.from) const secret = await SEA.secret(senderEpub, getUser()._.sea) @@ -136,19 +148,19 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { if (!isNumber(amount)) { throw new TypeError( - `Could not parse decrypted amount as a number, not a number?, decryptedAmount: ${decryptedAmount}` + `${orderID} Could not parse decrypted amount as a number, not a number?, decryptedAmount: ${decryptedAmount}` ) } if (isNaN(amount)) { throw new TypeError( - `Could not parse decrypted amount as a number, got NaN, decryptedAmount: ${decryptedAmount}` + `${orderID} Could not parse decrypted amount as a number, got NaN, decryptedAmount: ${decryptedAmount}` ) } if (!isFinite(amount)) { throw new TypeError( - `Amount was correctly decrypted, but got a non finite number, decryptedAmount: ${decryptedAmount}` + `${orderID} Amount was correctly decrypted, but got a non finite number, decryptedAmount: ${decryptedAmount}` ) } const mySecret = require('../../Mediator').getMySecret() @@ -159,37 +171,39 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { /** * @type {{ seedUrl: string, seedToken: string }|null} */ - let serviceOrderContentSeedInfo = null //in case the service is of type 'torrentSeed' or 'streamSeed' this is {seedUrl,seedToken}, can be omitted, in that case, it will be taken from env + let serviceOrderContentSeedInfo = null //in case the service is of type 'torrentSeed' this is {seedUrl,seedToken}, can be omitted, in that case, it will be taken from env if (order.targetType === 'service') { - console.log('General Service') + logger.info(orderID, 'General Service') const { ackInfo: serviceID } = order - console.log('ACK INFO') - console.log(serviceID) + logger.info(orderID, 'ACK INFO') + logger.info(orderID, serviceID) if (!Common.isPopulatedString(serviceID)) { - throw new TypeError(`no serviceID provided to orderAck`) + throw new TypeError(`${orderID} no serviceID provided to orderAck`) } - const selectedService = await new Promise(res => { - getUser() - .get(Key.OFFERED_SERVICES) - .get(serviceID) - .load(res) - }) - console.log(selectedService) - if (!selectedService) { - throw new TypeError(`invalid serviceID provided to orderAck`) + const selectedService = await getUser() + .get(Key.OFFERED_SERVICES) + .get(serviceID) + .then() + + logger.info(orderID, selectedService) + if (!Common.isObj(selectedService)) { + throw new TypeError( + `${orderID} invalid serviceID provided to orderAck or service is not an object` + ) } + const { serviceType, servicePrice, serviceSeedUrl: encSeedUrl, //= serviceSeedToken: encSeedToken //= - } = selectedService + } = /** @type {Record} */ (selectedService) if (Number(amount) !== Number(servicePrice)) { throw new TypeError( - `service price mismatch ${amount} : ${servicePrice}` + `${orderID} service price mismatch ${amount} : ${servicePrice}` ) } - if (serviceType === 'torrentSeed' || serviceType === 'streamSeed') { + if (serviceType === 'torrentSeed') { if (encSeedUrl && encSeedToken) { const seedUrl = await SEA.decrypt(encSeedUrl, mySecret) const seedToken = await SEA.decrypt(encSeedToken, mySecret) @@ -207,23 +221,19 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { private: true } - logger.info( - `onOrders() -> Will now create an invoice : ${JSON.stringify(invoiceReq)}` - ) - const invoice = await _addInvoice(invoiceReq) logger.info( - 'onOrders() -> Successfully created the invoice, will now encrypt it' + `${orderID} onOrders() -> Successfully created the invoice, will now encrypt it` ) const encInvoice = await SEA.encrypt(invoice.payment_request, secret) logger.info( - `onOrders() -> Will now place the encrypted invoice in order to response usergraph: ${addr}` + `${orderID} onOrders() -> Will now place the encrypted invoice in order to response usergraph: ${addr}` ) - //@ts-expect-error - const ackNode = Gun.text.random() + + const ackNode = Utils.gunID() /** @type {import('shock-common').Schema.OrderResponse} */ const orderResponse = { @@ -238,10 +248,14 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { .get(orderID) // @ts-expect-error .put(orderResponse, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { rej( new Error( - `Error saving encrypted invoice to order to response usergraph: ${ack}` + `${orderID} Error saving encrypted invoice to order to response usergraph: ${ack}` ) ) } else { @@ -253,31 +267,76 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { //logger.info(`[PERF] Added invoice to GunDB in ${invoicePutEndTime}ms`) /** * - * @param {Common.Schema.InvoiceWhenListed & {r_hash:Buffer,payment_addr:string}} paidInvoice + * @param {Common.Schema.InvoiceWhenListed & {r_hash:Buffer,payment_addr:Buffer}} paidInvoice */ const invoicePaidCb = async paidInvoice => { - console.log('INVOICE PAID') + logger.info(orderID, 'INVOICE PAID') + // Recycle + require('../../Mediator') + .getGun() + .get('orderNodes') + .get(addr) + .get(orderID) + .put(null) + let breakError = null let orderMetadata //eslint-disable-line init-declarations const hashString = paidInvoice.r_hash.toString('hex') const { amt_paid_sat: amt, add_index: addIndex, - payment_addr: paymentAddr + payment_addr } = paidInvoice + const paymentAddr = payment_addr.toString('hex') const orderType = serviceOrderType || order.targetType const { ackInfo } = order //a string representing what has been requested switch (orderType) { case 'tip': { const postID = ackInfo if (!Common.isPopulatedString(postID)) { - breakError = 'invalid ackInfo provided for postID' + breakError = orderID + ' invalid ackInfo provided for postID' break //create the coordinate, but stop because of the invalid id } getUser() - .get('postToTipCount') + .get(Key.POSTS_NEW) .get(postID) - .set(null) // each item in the set is a tip + .get('tipsSet') + .set(amt) // each item in the set is a tip + + TipForwarder.notifySocketIfAny( + postID, + order.from, + paidInvoice.memo || 'TIPPED YOU', + amt + ' sats' + ) + const ackData = { tippedPost: postID } + const toSend = JSON.stringify(ackData) + const encrypted = await SEA.encrypt(toSend, secret) + const ordResponse = { + type: 'orderAck', + response: encrypted + } + await new Promise((res, rej) => { + getUser() + .get(Key.ORDER_TO_RESPONSE) + .get(ackNode) + .put(ordResponse, ack => { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { + rej( + new Error( + `${orderID} Error saving encrypted orderAck to order to response usergraph: ${ack}` + ) + ) + } else { + res(null) + } + }) + }) + orderMetadata = JSON.stringify(ackData) break } case 'spontaneousPayment': { @@ -285,24 +344,28 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { break } case 'contentReveal': { - console.log('cONTENT REVEAL') + logger.info(orderID, 'CONTENT REVEAL') //assuming digital product that only requires to be unlocked const postID = ackInfo - console.log('ACK INFO') - console.log(ackInfo) + logger.info(orderID, 'ACK INFO') + logger.info(ackInfo) if (!Common.isPopulatedString(postID)) { breakError = 'invalid ackInfo provided for postID' break //create the coordinate, but stop because of the invalid id } - console.log('IS STRING') - const selectedPost = await new Promise(res => { - getUser() - .get(Key.POSTS_NEW) - .get(postID) - .load(res) - }) - console.log('LOAD ok') - console.log(selectedPost) + logger.info(orderID, 'IS STRING') + const selectedPost = /** @type {Record} */ (await getUser() + .get(Key.POSTS_NEW) + .get(postID) + .then()) + const selectedPostContent = /** @type {Record} */ (await getUser() + .get(Key.POSTS_NEW) + .get(postID) + .get(Key.CONTENT_ITEMS) + .then()) + + logger.info(orderID, 'LOAD ok') + logger.info(selectedPost) if ( !selectedPost || !selectedPost.status || @@ -311,15 +374,15 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { breakError = 'ackInfo provided does not correspond to a valid post' break //create the coordinate, but stop because of the invalid post } - console.log('IS POST') + logger.info(orderID, 'IS POST') /** * @type {Record} */ const contentsToSend = {} - console.log('SECRET OK') + logger.info(orderID, 'SECRET OK') let privateFound = false await Common.Utils.asyncForEach( - Object.entries(selectedPost.contentItems), + Object.entries(selectedPostContent), async ([contentID, item]) => { if ( item.type !== 'image/embedded' && @@ -347,14 +410,18 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { type: 'orderAck', response: encrypted } - console.log('RES READY') + logger.info(orderID, 'RES READY') await new Promise((res, rej) => { getUser() .get(Key.ORDER_TO_RESPONSE) .get(ackNode) .put(ordResponse, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { rej( new Error( `Error saving encrypted orderAck to order to response usergraph: ${ack}` @@ -365,12 +432,12 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { } }) }) - console.log('RES SENT CONTENT') - orderMetadata = JSON.stringify(ordResponse) + logger.info(orderID, 'RES SENT CONTENT') + orderMetadata = JSON.stringify(ackData) break } case 'torrentSeed': { - console.log('TORRENT') + logger.info(orderID, 'TORRENT') const numberOfTokens = Number(ackInfo) || 1 const seedInfo = selfContentToken() if (!seedInfo && !serviceOrderContentSeedInfo) { @@ -387,7 +454,7 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { numberOfTokens, seedInfoReady ) - console.log('RES SEED OK') + logger.info(orderID, 'RES SEED OK') const ackData = { seedUrl, tokens, ackInfo } const toSend = JSON.stringify(ackData) const encrypted = await SEA.encrypt(toSend, secret) @@ -395,13 +462,17 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { type: 'orderAck', response: encrypted } - console.log('RES SEED SENT') + logger.info(orderID, 'RES SEED SENT') await new Promise((res, rej) => { getUser() .get(Key.ORDER_TO_RESPONSE) .get(ackNode) .put(serviceResponse, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { rej( new Error( `Error saving encrypted orderAck to order to response usergraph: ${ack}` @@ -412,59 +483,8 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { } }) }) - console.log('RES SENT SEED') - orderMetadata = JSON.stringify(serviceResponse) - break - } - case 'streamSeed': { - console.log('STREAM') - const numberOfTokens = 1 - const seedInfo = selfContentToken() //TODO this must change for streams - if (!seedInfo && !serviceOrderContentSeedInfo) { - breakError = 'torrentSeed service not available' - break //service not available - } - const seedInfoReady = serviceOrderContentSeedInfo || seedInfo - if (!seedInfoReady) { - breakError = 'torrentSeed service not available' - break //service not available - } - const { seedUrl } = seedInfoReady - const tokens = await enrollContentTokens( - numberOfTokens, - seedInfoReady - ) - console.log('RES SEED OK') - const ackData = { - seedUrl, - tokens, - ackInfo - } - const toSend = JSON.stringify(ackData) - const encrypted = await SEA.encrypt(toSend, secret) - const serviceResponse = { - type: 'orderAck', - response: encrypted - } - console.log('RES SEED SENT') - await new Promise((res, rej) => { - getUser() - .get(Key.ORDER_TO_RESPONSE) - .get(ackNode) - .put(serviceResponse, ack => { - if (ack.err && typeof ack.err !== 'number') { - rej( - new Error( - `Error saving encrypted orderAck to order to response usergraph: ${ack}` - ) - ) - } else { - res(null) - } - }) - }) - console.log('RES SENT SEED') - orderMetadata = JSON.stringify(serviceResponse) + logger.info(orderID, 'RES SENT SEED') + orderMetadata = JSON.stringify(ackData) break } case 'other': //not implemented yet but save them as a coordinate anyways @@ -493,17 +513,18 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { throw new Error(breakError) } } - console.log('WAITING INVOICE TO BE PAID') + logger.info(orderID, 'Waiting for invoice to be paid for order ' + orderID) new Promise(res => SchemaManager.addListenInvoice(invoice.r_hash, res)) .then(invoicePaidCb) .catch(err => { logger.error( + orderID, `error inside onOrders, orderAddr: ${addr}, orderID: ${orderID}, order: ${JSON.stringify( order )}` ) - logger.error(err) - console.log(err) + logger.error(orderID, err) + logger.info(orderID, err) /** @type {import('shock-common').Schema.OrderResponse} */ const orderResponse = { @@ -516,21 +537,27 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { .get(orderID) // @ts-expect-error .put(orderResponse, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { logger.error( + orderID, `Error saving encrypted invoice to order to response usergraph: ${ack}` ) } }) }) - } catch (err) { + } catch (/** @type {any} */ err) { logger.error( + orderID, `error inside onOrders, orderAddr: ${addr}, orderID: ${orderID}, order: ${JSON.stringify( order )}` ) - logger.error(err) - console.log(err) + logger.error(orderID, err) + logger.info(orderID, err) /** @type {import('shock-common').Schema.OrderResponse} */ const orderResponse = { @@ -543,8 +570,13 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { .get(orderID) // @ts-expect-error .put(orderResponse, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { logger.error( + orderID, `Error saving encrypted invoice to order to response usergraph: ${ack}` ) } @@ -572,6 +604,11 @@ const onOrders = (user, gun, SEA) => { return } + if (currentOrderAddr === addr) { + // Already subscribed + return + } + currentOrderAddr = addr logger.info(`listening to address: ${addr}`) diff --git a/services/gunDB/contact-api/streams/addresses.js b/services/gunDB/contact-api/streams/addresses.js deleted file mode 100644 index 705e8b4c..00000000 --- a/services/gunDB/contact-api/streams/addresses.js +++ /dev/null @@ -1,56 +0,0 @@ -/** @format */ -const logger = require('winston') -const size = require('lodash/size') - -const Key = require('../key') -/** - * @typedef {Record} Addresses - */ - -/** @type {Addresses} */ -const pubToAddress = {} - -/** @type {Set<() => void>} */ -const listeners = new Set() - -listeners.add(() => { - logger.info(`pubToAddress length: ${size(pubToAddress)}`) -}) - -const notify = () => listeners.forEach(l => l()) - -/** @type {Set} */ -const subbedPublicKeys = new Set() - -/** - * @param {() => void} cb - * @param {string=} pub - */ -const onAddresses = (cb, pub) => { - listeners.add(cb) - cb() - if (pub && subbedPublicKeys.add(pub)) { - require('../../Mediator') - .getGun() - .user(pub) - .get(Key.CURRENT_HANDSHAKE_ADDRESS) - .on(addr => { - if (typeof addr === 'string' || addr === null) { - pubToAddress[pub] = addr - } else { - pubToAddress[pub] = null - } - notify() - }) - } - return () => { - listeners.delete(cb) - } -} - -const getAddresses = () => pubToAddress - -module.exports = { - onAddresses, - getAddresses -} diff --git a/services/gunDB/contact-api/streams/index.js b/services/gunDB/contact-api/streams/index.js index 0b211bcd..7ff4d7be 100644 --- a/services/gunDB/contact-api/streams/index.js +++ b/services/gunDB/contact-api/streams/index.js @@ -1,196 +1,6 @@ /** @format */ -const { Schema, Utils: CommonUtils } = require('shock-common') - -const Key = require('../key') -const Utils = require('../utils') -/** - * @typedef {Record} Avatars - * @typedef {(avatars: Avatars) => void} AvatarListener - */ - -/** @type {Avatars} */ -const pubToAvatar = {} - -const getPubToAvatar = () => pubToAvatar - -/** @type {Set} */ -const avatarListeners = new Set() - -const notifyAvatarListeners = () => { - avatarListeners.forEach(l => l(pubToAvatar)) -} - -/** @type {Set} */ -const pubsWithAvatarListeners = new Set() - -/** - * @param {AvatarListener} cb - * @param {string=} pub - */ -const onAvatar = (cb, pub) => { - avatarListeners.add(cb) - cb(pubToAvatar) - if (pub && pubsWithAvatarListeners.add(pub)) { - require('../../Mediator') - .getGun() - .user(pub) - .get(Key.PROFILE_BINARY) - .get(Key.AVATAR) - .on(av => { - if (typeof av === 'string' || av === null) { - pubToAvatar[pub] = av || null - } else { - pubToAvatar[pub] = null - } - notifyAvatarListeners() - }) - } - return () => { - avatarListeners.delete(cb) - } -} - -/** - * @typedef {Record} DisplayNames - * @typedef {(avatars: Avatars) => void} DisplayNameListener - */ - -/** @type {DisplayNames} */ -const pubToDisplayName = {} - -const getPubToDn = () => pubToDisplayName - -/** @type {Set} */ -const displayNameListeners = new Set() - -const notifyDisplayNameListeners = () => { - displayNameListeners.forEach(l => l(pubToDisplayName)) -} - -/** @type {Set} */ -const pubsWithDisplayNameListeners = new Set() - -/** - * @param {DisplayNameListener} cb - * @param {string=} pub - */ -const onDisplayName = (cb, pub) => { - displayNameListeners.add(cb) - cb(pubToDisplayName) - if (pub && pubsWithDisplayNameListeners.add(pub)) { - require('../../Mediator') - .getGun() - .user(pub) - .get(Key.PROFILE) - .get(Key.DISPLAY_NAME) - .on(dn => { - if (typeof dn === 'string' || dn === null) { - pubToDisplayName[pub] = dn || null - } else { - pubToDisplayName[pub] = null - } - notifyDisplayNameListeners() - }) - } - return () => { - displayNameListeners.delete(cb) - } -} - -/** - * @typedef {import('shock-common').Schema.StoredRequest} StoredRequest - * @typedef {(reqs: StoredRequest[]) => void} StoredRequestsListener - */ - -/** @type {Set} */ -const storedRequestsListeners = new Set() - -/** - * @type {StoredRequest[]} - */ -let encryptedStoredReqs = [] - -/** - * @type {StoredRequest[]} - */ -let currentStoredReqs = [] - -const getStoredReqs = () => currentStoredReqs - -const processStoredReqs = async () => { - const ereqs = encryptedStoredReqs - encryptedStoredReqs = [] - const mySecret = await Utils.mySecret() - const SEA = require('../../Mediator').mySEA - const finalReqs = await CommonUtils.asyncMap(ereqs, async er => { - /** @type {StoredRequest} */ - const r = { - handshakeAddress: await SEA.decrypt(er.handshakeAddress, mySecret), - recipientPub: await SEA.decrypt(er.recipientPub, mySecret), - sentReqID: await SEA.decrypt(er.sentReqID, mySecret), - timestamp: er.timestamp - } - - return r - }) - currentStoredReqs = finalReqs - storedRequestsListeners.forEach(l => l(currentStoredReqs)) -} - -let storedReqsSubbed = false - -/** - * @param {StoredRequestsListener} cb - */ -const onStoredReqs = cb => { - storedRequestsListeners.add(cb) - - if (!storedReqsSubbed) { - require('../../Mediator') - .getUser() - .get(Key.STORED_REQS) - .open(d => { - if (typeof d === 'object' && d !== null) { - //@ts-ignore - encryptedStoredReqs = /** @type {StoredRequest[]} */ (Object.values( - d - ).filter(i => Schema.isStoredRequest(i))) - } - - processStoredReqs() - }) - - storedReqsSubbed = true - } - - cb(currentStoredReqs) - - return () => { - storedRequestsListeners.delete(cb) - } -} module.exports = { - onAvatar, - getPubToAvatar, - onDisplayName, - getPubToDn, - - onPubToIncoming: require('./pubToIncoming').onPubToIncoming, - getPubToIncoming: require('./pubToIncoming').getPubToIncoming, - setPubToIncoming: require('./pubToIncoming').setPubToIncoming, - - onPubToFeed: require('./pubToFeed').onPubToFeed, - getPubToFeed: require('./pubToFeed').getPubToFeed, - - onStoredReqs, - getStoredReqs, - onAddresses: require('./addresses').onAddresses, - getAddresses: require('./addresses').getAddresses, - onLastSentReqIDs: require('./lastSentReqID').onLastSentReqIDs, - getSentReqIDs: require('./lastSentReqID').getSentReqIDs, - PubToIncoming: require('./pubToIncoming'), - getPubToLastSeenApp: require('./pubToLastSeenApp').getPubToLastSeenApp, onPubToLastSeenApp: require('./pubToLastSeenApp').on } diff --git a/services/gunDB/contact-api/streams/lastSentReqID.js b/services/gunDB/contact-api/streams/lastSentReqID.js deleted file mode 100644 index 431adb58..00000000 --- a/services/gunDB/contact-api/streams/lastSentReqID.js +++ /dev/null @@ -1,56 +0,0 @@ -/** @format */ -const logger = require('winston') -const { Constants } = require('shock-common') - -const Key = require('../key') - -/** @type {Record} */ -let pubToLastSentReqID = {} - -/** @type {Set<() => void>} */ -const listeners = new Set() -const notify = () => listeners.forEach(l => l()) - -let subbed = false - -/** - * @param {() => void} cb - */ -const onLastSentReqIDs = cb => { - listeners.add(cb) - cb() - - if (!subbed) { - const user = require('../../Mediator').getUser() - if (!user.is) { - logger.warn('lastSentReqID() -> tried to sub without authing') - throw new Error(Constants.ErrorCode.NOT_AUTH) - } - - user.get(Key.USER_TO_LAST_REQUEST_SENT).open(data => { - if (typeof data === 'object' && data !== null) { - for (const [pub, id] of Object.entries(data)) { - if (typeof id === 'string' || id === null) { - pubToLastSentReqID[pub] = id - } - } - } else { - pubToLastSentReqID = {} - } - - notify() - }) - subbed = true - } - - return () => { - listeners.delete(cb) - } -} - -const getSentReqIDs = () => pubToLastSentReqID - -module.exports = { - onLastSentReqIDs, - getSentReqIDs -} diff --git a/services/gunDB/contact-api/streams/pubToFeed.js b/services/gunDB/contact-api/streams/pubToFeed.js deleted file mode 100644 index f140aaea..00000000 --- a/services/gunDB/contact-api/streams/pubToFeed.js +++ /dev/null @@ -1,260 +0,0 @@ -/** @format */ -const uuidv1 = require('uuid/v1') -const logger = require('winston') -const debounce = require('lodash/debounce') -const { Schema, Utils: CommonUtils } = require('shock-common') -const size = require('lodash/size') - -const Key = require('../key') -const Utils = require('../utils') -/** - * @typedef {import('shock-common').Schema.ChatMessage} Message - * @typedef {import('../SimpleGUN').OpenListenerData} OpenListenerData - */ - -const PubToIncoming = require('./pubToIncoming') - -/** - * @typedef {Record} Feeds - * @typedef {(feeds: Feeds) => void} FeedsListener - */ - -/** @type {Set} */ -const feedsListeners = new Set() - -/** - * @type {Feeds} - */ -let pubToFeed = {} - -const getPubToFeed = () => pubToFeed - -feedsListeners.add(() => { - logger.info(`new pubToFeed length: ${size(getPubToFeed())}`) -}) - -/** @param {Feeds} ptf */ -const setPubToFeed = ptf => { - pubToFeed = ptf - feedsListeners.forEach(l => { - l(pubToFeed) - }) -} - -/** - * If at one point we subscribed to a feed, record it here. Keeps track of it - * for unsubbing. - * - * Since we can't really unsub in GUN, what we do is that each listener created - * checks the last incoming feed, if it was created for other feed that is not - * the latest, it becomes inactive. - * @type {Record} - */ -const pubToLastIncoming = {} - -/** - * Any pub-feed pair listener will write its update id here when fired up. Avoid - * race conditions between different listeners and between different invocations - * of the same listener. - * @type {Record} - */ -const pubToLastUpdate = {} - -/** - * Performs a sub to a pub feed pair that will only emit if it is the last - * subbed feed for that pub, according to `pubToLastIncoming`. This listener is - * not in charge of writing to the cache. - * @param {[ string , string ]} param0 - * @returns {(data: OpenListenerData) => void} - */ -const onOpenForPubFeedPair = ([pub, feed]) => - debounce(async data => { - try { - // did invalidate - if (pubToLastIncoming[pub] !== feed) { - return - } - - if ( - // did disconnect - data === null || - // interpret as disconnect - typeof data !== 'object' - ) { - // invalidate this listener. If a reconnection happens it will be for a - // different pub-feed pair. - pubToLastIncoming[pub] = null - setImmediate(() => { - logger.info( - `onOpenForPubFeedPair -> didDisconnect -> pub: ${pub} - feed: ${feed}` - ) - }) - // signal disconnect to listeners listeners should rely on pubToFeed for - // disconnect status instead of pub-to-incoming. Only the latter will - // detect remote disconnection - setPubToFeed({ - ...getPubToFeed(), - [pub]: /** @type {'disconnected'} */ ('disconnected') - }) - return - } - //@ts-ignore - const incoming = /** @type {import('shock-common').Schema.Outgoing} */ (data) - - // incomplete data, let's not assume anything - if ( - typeof incoming.with !== 'string' || - typeof incoming.messages !== 'object' - ) { - return - } - - /** @type {import('shock-common').Schema.ChatMessage[]} */ - const newMsgs = Object.entries(incoming.messages) - // filter out messages with incomplete data - .filter(([_, msg]) => Schema.isMessage(msg)) - .map(([id, msg]) => { - /** @type {import('shock-common').Schema.ChatMessage} */ - const m = { - // we'll decrypt later - body: msg.body, - id, - outgoing: false, - timestamp: msg.timestamp - } - - return m - }) - - if (newMsgs.length === 0) { - setPubToFeed({ - ...getPubToFeed(), - [pub]: [] - }) - return - } - - const thisUpdate = uuidv1() - pubToLastUpdate[pub] = thisUpdate - - const user = require('../../Mediator').getUser() - if (!user.is) { - logger.warn('pubToFeed -> onOpenForPubFeedPair() -> user is not auth') - } - const SEA = require('../../Mediator').mySEA - - const ourSecret = await SEA.secret(await Utils.pubToEpub(pub), user._.sea) - - const decryptedMsgs = await CommonUtils.asyncMap(newMsgs, async m => { - /** @type {import('shock-common').Schema.ChatMessage} */ - const decryptedMsg = { - ...m, - body: await SEA.decrypt(m.body, ourSecret) - } - - return decryptedMsg - }) - - // this listener got invalidated while we were awaiting the async operations - // above. - if (pubToLastUpdate[pub] !== thisUpdate) { - return - } - - setPubToFeed({ - ...getPubToFeed(), - [pub]: decryptedMsgs - }) - } catch (err) { - logger.warn(`error inside pub to pk-feed pair: ${pub} -- ${feed}`) - logger.error(err) - } - }, 750) - -const react = () => { - const pubToIncoming = PubToIncoming.getPubToIncoming() - - const gun = require('../../Mediator').getGun() - - /** @type {Feeds} */ - const newPubToFeed = {} - - for (const [pub, inc] of Object.entries(pubToIncoming)) { - /** - * empty string -> null - * @type {string|null} - */ - const newIncoming = inc || null - - if ( - // if disconnected, the same incoming feed will try to overwrite the - // nulled out pubToLastIncoming[pub] entry. Making the listener for that - // pub feed pair fire up again, etc. Now. When the user disconnects from - // this side of things. He will overwrite the pub to incoming with null. - // Let's allow that. - newIncoming === pubToLastIncoming[pub] && - !(pubToFeed[pub] === 'disconnected' && newIncoming === null) - ) { - // eslint-disable-next-line no-continue - continue - } - - // will invalidate stale listeners (a listener for an outdated incoming feed - // id) - pubToLastIncoming[pub] = newIncoming - // Invalidate pending writes from stale listener(s) for the old incoming - // address. - pubToLastUpdate[pub] = uuidv1() - newPubToFeed[pub] = newIncoming ? [] : null - - // sub to this incoming feed - if (typeof newIncoming === 'string') { - // perform sub to pub-incoming_feed pair - // leave all of the sideffects from this for the next tick - setImmediate(() => { - gun - .user(pub) - .get(Key.OUTGOINGS) - .get(newIncoming) - .open(onOpenForPubFeedPair([pub, newIncoming])) - }) - } - } - - if (Object.keys(newPubToFeed).length > 0) { - setPubToFeed({ - ...getPubToFeed(), - ...newPubToFeed - }) - } -} - -let subbed = false - -/** - * Array.isArray(pubToFeed[pub]) means a Handshake is in place, look for - * incoming messages here. - * pubToIncoming[pub] === null means a disconnection took place. - * typeof pubToIncoming[pub] === 'undefined' means none of the above. - * @param {FeedsListener} cb - * @returns {() => void} - */ -const onPubToFeed = cb => { - feedsListeners.add(cb) - cb(getPubToFeed()) - - if (!subbed) { - PubToIncoming.onPubToIncoming(react) - subbed = true - } - - return () => { - feedsListeners.delete(cb) - } -} - -module.exports = { - getPubToFeed, - setPubToFeed, - onPubToFeed -} diff --git a/services/gunDB/contact-api/streams/pubToIncoming.js b/services/gunDB/contact-api/streams/pubToIncoming.js deleted file mode 100644 index 2834ca79..00000000 --- a/services/gunDB/contact-api/streams/pubToIncoming.js +++ /dev/null @@ -1,105 +0,0 @@ -/** @format */ -const uuidv1 = require('uuid/v1') -const debounce = require('lodash/debounce') -const logger = require('winston') -const { Utils: CommonUtils } = require('shock-common') -const size = require('lodash/size') - -const { USER_TO_INCOMING } = require('../key') -/** @typedef {import('../SimpleGUN').OpenListenerData} OpenListenerData */ - -/** - * @typedef {Record} PubToIncoming - */ - -/** @type {Set<() => void>} */ -const listeners = new Set() - -/** @type {PubToIncoming} */ -let pubToIncoming = {} - -const getPubToIncoming = () => pubToIncoming -/** - * @param {PubToIncoming} pti - * @returns {void} - */ -const setPubToIncoming = pti => { - pubToIncoming = pti - listeners.forEach(l => l()) -} - -let latestUpdate = uuidv1() - -listeners.add(() => { - logger.info(`new pubToIncoming length: ${size(getPubToIncoming())}`) -}) - -const onOpen = debounce(async uti => { - const SEA = require('../../Mediator').mySEA - const mySec = require('../../Mediator').getMySecret() - const thisUpdate = uuidv1() - latestUpdate = thisUpdate - - if (typeof uti !== 'object' || uti === null) { - setPubToIncoming({}) - return - } - - /** @type {PubToIncoming} */ - const newPubToIncoming = {} - - await CommonUtils.asyncForEach( - Object.entries(uti), - async ([pub, encFeedID]) => { - if (encFeedID === null) { - newPubToIncoming[pub] = null - return - } - - if (typeof encFeedID === 'string') { - newPubToIncoming[pub] = await SEA.decrypt(encFeedID, mySec) - } - } - ) - - // avoid old data from overwriting new data if decrypting took longer to - // process for the older open() call than for the newer open() call - if (latestUpdate === thisUpdate) { - setPubToIncoming(newPubToIncoming) - } -}, 750) - -let subbed = false - -/** - * @param {() => void} cb - * @returns {() => void} - */ -const onPubToIncoming = cb => { - if (!listeners.add(cb)) { - throw new Error('Tried to subscribe twice') - } - - cb() - - if (!subbed) { - const user = require('../../Mediator').getUser() - if (!user.is) { - logger.warn(`subscribing to pubToIncoming on a unauth user`) - } - user.get(USER_TO_INCOMING).open(onOpen) - subbed = true - } - - return () => { - if (!listeners.delete(cb)) { - throw new Error('Tried to unsubscribe twice') - } - } -} - -module.exports = { - getPubToIncoming, - setPubToIncoming, - onPubToIncoming -} diff --git a/services/gunDB/contact-api/streams/pubToLastSeenApp.js b/services/gunDB/contact-api/streams/pubToLastSeenApp.js index 729f5e59..421b9f29 100644 --- a/services/gunDB/contact-api/streams/pubToLastSeenApp.js +++ b/services/gunDB/contact-api/streams/pubToLastSeenApp.js @@ -27,14 +27,15 @@ const on = (cb, pub) => { listeners.add(cb) cb(pubToLastSeenApp) if (pub && pubsWithListeners.add(pub)) { - pubToLastSeenApp[pub] = null; + pubToLastSeenApp[pub] = null notifyListeners() require('../../Mediator') .getGun() .user(pub) .get(Key.LAST_SEEN_APP) .on(timestamp => { - pubToLastSeenApp[pub] = typeof timestamp === 'number' ? timestamp : undefined + pubToLastSeenApp[pub] = + typeof timestamp === 'number' ? timestamp : undefined notifyListeners() }) } @@ -45,5 +46,5 @@ const on = (cb, pub) => { module.exports = { getPubToLastSeenApp, - on, -} \ No newline at end of file + on +} diff --git a/services/gunDB/contact-api/utils/index.js b/services/gunDB/contact-api/utils/index.js index 3af89742..60a744cc 100644 --- a/services/gunDB/contact-api/utils/index.js +++ b/services/gunDB/contact-api/utils/index.js @@ -2,15 +2,16 @@ * @format */ /* eslint-disable init-declarations */ -const logger = require('winston') +const logger = require('../../../../config/log') const { Constants, Utils: CommonUtils } = require('shock-common') const Key = require('../key') +/// /** - * @typedef {import('../SimpleGUN').GUNNode} GUNNode + * @typedef {Smith.GunSmithNode} GUNNode * @typedef {import('../SimpleGUN').ISEA} ISEA - * @typedef {import('../SimpleGUN').UserGUNNode} UserGUNNode + * @typedef {Smith.UserSmithNode} UserGUNNode */ /** @@ -25,73 +26,54 @@ const delay = ms => new Promise(res => setTimeout(res, ms)) const mySecret = () => Promise.resolve(require('../../Mediator').getMySecret()) /** - * @template T - * @param {Promise} promise - * @returns {Promise} + * Just a pointer. */ -const timeout10 = promise => { +const TIMEOUT_PTR = {} + +/** + * @param {number} ms Milliseconds + * @returns {(promise: Promise) => Promise} + */ +const timeout = ms => async promise => { /** @type {NodeJS.Timeout} */ // @ts-ignore let timeoutID - return Promise.race([ + + const result = await Promise.race([ promise.then(v => { clearTimeout(timeoutID) return v }), - new Promise((_, rej) => { + CommonUtils.makePromise(res => { timeoutID = setTimeout(() => { - rej(new Error(Constants.ErrorCode.TIMEOUT_ERR)) - }, 10000) + clearTimeout(timeoutID) + res(TIMEOUT_PTR) + }, ms) }) ]) + + if (result === TIMEOUT_PTR) { + throw new Error(Constants.TIMEOUT_ERR) + } + + return result } /** - * @template T - * @param {Promise} promise - * @returns {Promise} + * Time outs at 10 seconds. */ -const timeout5 = promise => { - /** @type {NodeJS.Timeout} */ - // @ts-ignore - let timeoutID - return Promise.race([ - promise.then(v => { - clearTimeout(timeoutID) - return v - }), - - new Promise((_, rej) => { - timeoutID = setTimeout(() => { - rej(new Error(Constants.ErrorCode.TIMEOUT_ERR)) - }, 5000) - }) - ]) -} +const timeout10 = timeout(10) /** - * @template T - * @param {Promise} promise - * @returns {Promise} + * Time outs at 5 seconds. */ -const timeout2 = promise => { - /** @type {NodeJS.Timeout} */ - // @ts-ignore - let timeoutID - return Promise.race([ - promise.then(v => { - clearTimeout(timeoutID) - return v - }), +const timeout5 = timeout(5) - new Promise((_, rej) => { - timeoutID = setTimeout(() => { - rej(new Error(Constants.ErrorCode.TIMEOUT_ERR)) - }, 2000) - }) - ]) -} +/** + * Time outs at 2 seconds. + */ +const timeout2 = timeout(2) /** * @template T @@ -101,7 +83,6 @@ const timeout2 = promise => { * @returns {Promise} */ const tryAndWait = async (promGen, shouldRetry = () => false) => { - /* eslint-disable no-empty */ /* eslint-disable init-declarations */ // If hang stop at 10, wait 3, retry, if hang stop at 5, reinstate, warm for @@ -118,27 +99,15 @@ const tryAndWait = async (promGen, shouldRetry = () => false) => { ) ) - if (shouldRetry(resolvedValue)) { - logger.info( - 'force retrying' + - ` args: ${promGen.toString()} -- ${shouldRetry.toString()} \n resolvedValue: ${resolvedValue}, type: ${typeof resolvedValue}` - ) - } else { + if (!shouldRetry(resolvedValue)) { return resolvedValue } } catch (e) { - logger.error(e) - logger.info(JSON.stringify(e)) - if (e.message === Constants.ErrorCode.NOT_AUTH) { + if (e.message !== Constants.ErrorCode.TIMEOUT_ERR) { throw e } } - logger.info( - `\n retrying \n` + - ` args: ${promGen.toString()} -- ${shouldRetry.toString()}` - ) - await delay(200) try { @@ -149,26 +118,15 @@ const tryAndWait = async (promGen, shouldRetry = () => false) => { ) ) - if (shouldRetry(resolvedValue)) { - logger.info( - 'force retrying' + - ` args: ${promGen.toString()} -- ${shouldRetry.toString()} \n resolvedValue: ${resolvedValue}, type: ${typeof resolvedValue}` - ) - } else { + if (!shouldRetry(resolvedValue)) { return resolvedValue } } catch (e) { - logger.error(e) - if (e.message === Constants.ErrorCode.NOT_AUTH) { + if (e.message !== Constants.ErrorCode.TIMEOUT_ERR) { throw e } } - logger.info( - `\n retrying \n` + - ` args: ${promGen.toString()} -- ${shouldRetry.toString()}` - ) - await delay(3000) try { @@ -179,30 +137,22 @@ const tryAndWait = async (promGen, shouldRetry = () => false) => { ) ) - if (shouldRetry(resolvedValue)) { - logger.info( - 'force retrying' + - ` args: ${promGen.toString()} -- ${shouldRetry.toString()} \n resolvedValue: ${resolvedValue}, type: ${typeof resolvedValue}` - ) - } else { + if (!shouldRetry(resolvedValue)) { return resolvedValue } } catch (e) { - logger.error(e) - if (e.message === Constants.ErrorCode.NOT_AUTH) { + if (e.message !== Constants.ErrorCode.TIMEOUT_ERR) { throw e } } - logger.info( - `\n NOT recreating a fresh gun but retrying one last time \n` + - ` args: ${promGen.toString()} -- ${shouldRetry.toString()}` + return timeout10( + promGen( + require('../../Mediator/index').getGun(), + require('../../Mediator/index').getUser() + ) ) - const { gun, user } = require('../../Mediator/index').freshGun() - - return timeout10(promGen(gun, user)) - /* eslint-enable no-empty */ /* eslint-enable init-declarations */ } @@ -212,97 +162,20 @@ const tryAndWait = async (promGen, shouldRetry = () => false) => { */ const pubToEpub = async pub => { try { - const epub = await timeout10( - CommonUtils.makePromise(res => { - require('../../Mediator/index') - .getGun() - .user(pub) - .get('epub') - .on(data => { - if (typeof data === 'string') { - res(data) - } - }) - }) - ) + const epub = await require('../../Mediator/index') + .getGun() + .user(pub) + .get('epub') + .specialThen() - return epub + return /** @type {string} */ (epub) } catch (err) { - logger.error(err) - throw new Error(`pubToEpub() -> ${err.message}`) - } -} - -/** - * Should only be called with a recipient pub that has already been contacted. - * If returns null, a disconnect happened. - * @param {string} recipientPub - * @returns {Promise} - */ -const recipientPubToLastReqSentID = async recipientPub => { - const maybeLastReqSentID = await tryAndWait( - (_, user) => { - const userToLastReqSent = user.get(Key.USER_TO_LAST_REQUEST_SENT) - return userToLastReqSent.get(recipientPub).then() - }, - // retry on undefined, in case it is a false negative - v => typeof v === 'undefined' - ) - - if (typeof maybeLastReqSentID !== 'string') { - return null - } - - return maybeLastReqSentID -} - -/** - * @param {string} recipientPub - * @returns {Promise} - */ -const successfulHandshakeAlreadyExists = async recipientPub => { - const maybeIncomingID = await tryAndWait((_, user) => { - const userToIncoming = user.get(Key.USER_TO_INCOMING) - - return userToIncoming.get(recipientPub).then() - }) - - const maybeOutgoingID = await tryAndWait((_, user) => { - const recipientToOutgoing = user.get(Key.RECIPIENT_TO_OUTGOING) - - return recipientToOutgoing.get(recipientPub).then() - }) - - return ( - typeof maybeIncomingID === 'string' && typeof maybeOutgoingID === 'string' - ) -} - -/** - * @param {string} recipientPub - * @returns {Promise} - */ -const recipientToOutgoingID = async recipientPub => { - const maybeEncryptedOutgoingID = await tryAndWait( - (_, user) => - user - .get(Key.RECIPIENT_TO_OUTGOING) - .get(recipientPub) - .then(), - // force retry in case undefined is a false negative - v => typeof v === 'undefined' - ) - - if (typeof maybeEncryptedOutgoingID === 'string') { - const outgoingID = await require('../../Mediator/index').mySEA.decrypt( - maybeEncryptedOutgoingID, - await mySecret() + logger.error( + `Error inside pubToEpub for pub ${pub.slice(0, 8)}...${pub.slice(-8)}:` ) - - return outgoingID || null + logger.error(err) + throw err } - - return null } /** @@ -341,17 +214,30 @@ const isNodeOnline = async pub => { ) } +/** + * @returns {string} + */ +const gunID = () => { + // Copied from gun internals + let s = '' + let l = 24 // you are not going to make a 0 length random number, so no need to check type + const c = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxyz' + while (l > 0) { + s += c.charAt(Math.floor(Math.random() * c.length)) + l-- + } + return s +} + module.exports = { dataHasSoul, delay, pubToEpub, - recipientPubToLastReqSentID, - successfulHandshakeAlreadyExists, - recipientToOutgoingID, tryAndWait, mySecret, promisifyGunNode: require('./promisifygun'), timeout5, timeout2, - isNodeOnline + isNodeOnline, + gunID } diff --git a/services/gunDB/contact-api/utils/index.spec.js b/services/gunDB/contact-api/utils/index.spec.js new file mode 100644 index 00000000..228a9908 --- /dev/null +++ b/services/gunDB/contact-api/utils/index.spec.js @@ -0,0 +1,14 @@ +/** + * @format + */ +const expect = require('expect') + +const { gunID } = require('./index') + +describe('gunID()', () => { + it('generates 24-chars-long unique IDs', () => { + const id = gunID() + expect(id).toBeTruthy() + expect(id.length).toBe(24) + }) +}) diff --git a/services/gunDB/contact-api/utils/promisifygun.js b/services/gunDB/contact-api/utils/promisifygun.js index 633626e5..d5944dda 100644 --- a/services/gunDB/contact-api/utils/promisifygun.js +++ b/services/gunDB/contact-api/utils/promisifygun.js @@ -20,7 +20,11 @@ const promisify = node => { pnode.put = data => new Promise((res, rej) => { oldPut(data, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { rej(new Error(ack.err)) } else { res() @@ -31,7 +35,11 @@ const promisify = node => { pnode.set = data => new Promise((res, rej) => { oldSet(data, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { rej(new Error(ack.err)) } else { res() diff --git a/services/gunDB/rpc/index.js b/services/gunDB/rpc/index.js index 3feecde2..5682a988 100644 --- a/services/gunDB/rpc/index.js +++ b/services/gunDB/rpc/index.js @@ -6,7 +6,6 @@ const { makePromise, Constants, Schema } = require('shock-common') const mapValues = require('lodash/mapValues') const Bluebird = require('bluebird') -const Gun = require('gun') const { pubToEpub } = require('../contact-api/utils') const { @@ -16,6 +15,8 @@ const { getMySecret, $$__SHOCKWALLET__ENCRYPTED__ } = require('../Mediator') +const logger = require('../../../config/log') +const Utils = require('../contact-api/utils') /** * @typedef {import('../contact-api/SimpleGUN').ValidDataValue} ValidDataValue * @typedef {import('./types').ValidRPCDataValue} ValidRPCDataValue @@ -27,12 +28,15 @@ const PATH_SEPARATOR = '>' /** * @param {ValidDataValue} value * @param {string} publicKey + * @param {string=} epubForDecryption * @returns {Promise} */ -const deepDecryptIfNeeded = async (value, publicKey) => { +const deepDecryptIfNeeded = async (value, publicKey, epubForDecryption) => { if (Schema.isObj(value)) { return Bluebird.props( - mapValues(value, o => deepDecryptIfNeeded(o, publicKey)) + mapValues(value, o => + deepDecryptIfNeeded(o, publicKey, epubForDecryption) + ) ) } @@ -46,10 +50,16 @@ const deepDecryptIfNeeded = async (value, publicKey) => { } let sec = '' - if (user.is.pub === publicKey) { + if (user.is.pub === publicKey || 'me' === publicKey) { sec = getMySecret() } else { - sec = await SEA.secret(await pubToEpub(publicKey), user._.sea) + let epub = epubForDecryption + + if (!epub) { + epub = await pubToEpub(publicKey) + } + + sec = await SEA.secret(epub, user._.sea) } const decrypted = SEA.decrypt(value, sec) @@ -81,6 +91,7 @@ async function deepEncryptIfNeeded(value) { } const pk = /** @type {string|undefined} */ (value.$$__ENCRYPT__FOR) + const epub = /** @type {string|undefined} */ (value.$$__EPUB__FOR) if (!pk) { return Bluebird.props(mapValues(value, deepEncryptIfNeeded)) @@ -93,7 +104,15 @@ async function deepEncryptIfNeeded(value) { if (pk === u.is.pub || pk === 'me') { encryptedValue = await SEA.encrypt(actualValue, getMySecret()) } else { - const sec = await SEA.secret(await pubToEpub(pk), u._.sea) + const sec = await SEA.secret( + await (() => { + if (epub) { + return epub + } + return pubToEpub(pk) + })(), + u._.sea + ) encryptedValue = await SEA.encrypt(actualValue, sec) } @@ -186,8 +205,18 @@ const put = async (rawPath, value) => { } /* is primitive */ else { await makePromise((res, rej) => { node.put(/** @type {ValidDataValue} */ (theValue), ack => { - if (ack.err && typeof ack.err !== 'number') { - rej(new Error(ack.err)) + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { + if (typeof ack.err === 'string') { + rej(new Error(ack.err)) + } else { + logger.info(`NON STANDARD GUN ERROR:`) + logger.info(ack) + rej(new Error(JSON.stringify(ack.err, null, 4))) + } } else { res() } @@ -237,8 +266,7 @@ async function set(rawPath, value) { if (Array.isArray(theValue)) { // we'll create a set of sets - // @ts-expect-error - const uuid = Gun.text.random() + const uuid = Utils.gunID() // here we are simulating the top-most set() const subPath = rawPath + PATH_SEPARATOR + uuid @@ -249,8 +277,7 @@ async function set(rawPath, value) { return uuid } else if (Schema.isObj(theValue)) { - // @ts-expect-error - const uuid = Gun.text.random() // we'll handle UUID ourselves + const uuid = Utils.gunID() // we'll handle UUID ourselves // so we can use our own put() @@ -265,7 +292,11 @@ async function set(rawPath, value) { const id = await makePromise((res, rej) => { const subNode = node.set(theValue, ack => { - if (ack.err && typeof ack.err !== 'number') { + if ( + ack.err && + typeof ack.err !== 'number' && + typeof ack.err !== 'object' + ) { rej(new Error(ack.err)) } else { res(subNode._.get) diff --git a/services/gunDB/sockets/index.js b/services/gunDB/sockets/index.js new file mode 100644 index 00000000..9b52563b --- /dev/null +++ b/services/gunDB/sockets/index.js @@ -0,0 +1,254 @@ +/** + * @format + */ + +const logger = require('../../../config/log') +const Common = require('shock-common') +const uuidv4 = require('uuid/v4') + +const { getGun, getUser, isAuthenticated } = require('../Mediator') +const { deepDecryptIfNeeded } = require('../rpc') +const Subscriptions = require('./subscriptions') +const GunActions = require('../../gunDB/contact-api/actions') +const { + encryptedEmit, + encryptedOn, + encryptedCallback +} = require('../../../utils/ECC/socket') +/// + +const ALLOWED_GUN_METHODS = [ + 'map', + 'map.on', + 'on', + 'once', + 'load', + 'then', + 'open' +] + +/** + * @typedef {import('../contact-api/SimpleGUN').ValidDataValue} ValidDataValue + */ + +/** + * @typedef {(data: ValidDataValue, key?: string, _msg?: any, event?: any) => (void | Promise)} GunListener + * @typedef {{ reconnect: boolean, token: string }} SubscriptionOptions + */ + +/** + * @param {string} root + */ +const getNode = root => { + if (root === '$gun') { + return getGun() + } + + if (root === '$user') { + return getUser() + } + + return getGun().user(root) +} + +/** + * @param {Smith.GunSmithNode} node + * @param {string} path + */ +const getGunQuery = (node, path) => { + const bits = path.split('>') + const query = bits.reduce((gunQuery, bit) => gunQuery.get(bit), node) + return query +} + +/** + * Executes a GunDB query call using the specified method + * @param {any} query + * @param {string} method + * @param {GunListener} listener + */ +const executeGunQuery = (query, method, listener) => { + if (!ALLOWED_GUN_METHODS.includes(method)) { + throw { + field: 'method', + message: `Invalid GunDB method specified (${method}). ` + } + } + + if (method === 'on') { + return query.on(listener) + } + + if (method === 'open') { + return query.open(listener) + } + + if (method === 'map.on') { + return query.map().on(listener) + } + + if (method === 'map.once') { + return query.map().once(listener) + } +} + +/** + * @param {Object} queryData + * @param {(eventName: string, ...args: any[]) => Promise} queryData.emit + * @param {string} queryData.publicKeyForDecryption + * @param {string} queryData.subscriptionId + * @param {string} queryData.deviceId + * @param {string=} queryData.epubForDecryption + * @param {string=} queryData.epubField If the epub is included in the received + * data itself. Handshake requests for example, have an epub field. + * @returns {GunListener} + */ +const queryListenerCallback = ({ + emit, + publicKeyForDecryption, + subscriptionId, + deviceId, + epubForDecryption, + epubField +}) => async (data, key, _msg, event) => { + try { + const subscription = Subscriptions.get({ + deviceId, + subscriptionId + }) + if (subscription && !subscription.unsubscribe && event) { + Subscriptions.attachUnsubscribe({ + deviceId, + subscriptionId, + unsubscribe: () => event.off() + }) + } + const eventName = `query:data` + if (publicKeyForDecryption?.length > 0 || epubForDecryption || epubField) { + const decData = await deepDecryptIfNeeded( + data, + publicKeyForDecryption, + (() => { + if (epubField) { + if (Common.isObj(data)) { + const epub = data[epubField] + if (Common.isPopulatedString(epub)) { + return epub + } + + logger.error( + `Got epubField in a rifle query, but the resulting value obtained is not an string -> `, + { + data, + epub + } + ) + } else { + logger.warn( + `Got epubField in a rifle query for a non-object data -> `, + { + epubField, + data + } + ) + } + } + return epubForDecryption + })() + ) + emit(eventName, { subscriptionId, response: { data: decData, key } }) + return + } + + emit(eventName, { subscriptionId, response: { data, key } }) + } catch (err) { + logger.error(`Error for gun rpc socket: ${err.message}`) + } +} + +/** @param {import('socket.io').Socket} socket */ +const startSocket = socket => { + try { + const emit = encryptedEmit(socket) + const on = encryptedOn(socket) + const { encryptionId } = socket.handshake.auth + + if (!isAuthenticated()) { + logger.warn('GunDB is not yet authenticated') + socket.emit(Common.Constants.ErrorCode.NOT_AUTH) + } + + if (isAuthenticated()) { + socket.onAny(async () => { + try { + await GunActions.setLastSeenApp() + } catch (err) { + logger.info('error setting last seen app', err) + } + }) + } + + on('subscribe:query', (query, response) => { + const { $shock, publicKey, epubForDecryption, epubField } = query + const subscriptionId = uuidv4() + try { + if (!isAuthenticated()) { + socket.emit(Common.Constants.ErrorCode.NOT_AUTH) + return + } + + const [root, path, method] = $shock.split('::') + const socketCallback = encryptedCallback(socket, response) + + if (!ALLOWED_GUN_METHODS.includes(method)) { + socketCallback( + `Invalid method for gun rpc call: ${method}, query: ${$shock}` + ) + return + } + + Subscriptions.add({ + deviceId: encryptionId, + subscriptionId + }) + + const queryCallback = queryListenerCallback({ + emit, + publicKeyForDecryption: publicKey, + subscriptionId, + deviceId: encryptionId, + epubForDecryption, + epubField + }) + + socketCallback(null, { + subscriptionId + }) + + const node = getNode(root) + const query = getGunQuery(node, path) + + executeGunQuery(query, method, queryCallback) + } catch (error) { + emit(`query:error`, { subscriptionId, response: { data: error } }) + } + }) + + on('unsubscribe', ({ subscriptionId }, response) => { + const callback = encryptedCallback(socket, response) + Subscriptions.remove({ deviceId: encryptionId, subscriptionId }) + callback(null, { + message: 'Unsubscribed successfully!', + success: true + }) + }) + + socket.on('disconnect', () => { + Subscriptions.removeDevice({ deviceId: encryptionId }) + }) + } catch (err) { + logger.error('GUNRPC: ' + err.message) + } +} + +module.exports = startSocket diff --git a/services/gunDB/sockets/subscriptions.js b/services/gunDB/sockets/subscriptions.js new file mode 100644 index 00000000..553a11d7 --- /dev/null +++ b/services/gunDB/sockets/subscriptions.js @@ -0,0 +1,123 @@ +/** + * @typedef {() => void} Unsubscribe + */ + +/** @type {Map void, metadata?: object }>>} */ +const userSubscriptions = new Map() + +/** + * Adds a new Subscription + * @param {Object} subscription + * @param {string} subscription.deviceId + * @param {string} subscription.subscriptionId + * @param {(Unsubscribe)=} subscription.unsubscribe + * @param {(object)=} subscription.metadata + */ +const add = ({ deviceId, subscriptionId, unsubscribe, metadata }) => { + const deviceSubscriptions = userSubscriptions.get(deviceId) + + const subscriptions = deviceSubscriptions ?? new Map() + subscriptions.set(subscriptionId, { + subscriptionId, + unsubscribe, + metadata + }) + userSubscriptions.set(deviceId, subscriptions) +} + +/** + * Adds a new Subscription + * @param {Object} subscription + * @param {string} subscription.deviceId + * @param {string} subscription.subscriptionId + * @param {Unsubscribe} subscription.unsubscribe + */ +const attachUnsubscribe = ({ deviceId, subscriptionId, unsubscribe }) => { + const deviceSubscriptions = userSubscriptions.get(deviceId) + + const subscriptions = deviceSubscriptions + + if (!subscriptions) { + return + } + + const subscription = subscriptions.get(subscriptionId) + + if (!subscription) { + return + } + + subscriptions.set(subscriptionId, { + ...subscription, + unsubscribe + }) + userSubscriptions.set(deviceId, subscriptions) +} + +/** + * Unsubscribes from a GunDB query + * @param {Object} subscription + * @param {string} subscription.deviceId + * @param {string} subscription.subscriptionId + */ +const remove = ({ deviceId, subscriptionId }) => { + const deviceSubscriptions = userSubscriptions.get(deviceId) + + const subscriptions = deviceSubscriptions ?? new Map() + const subscription = subscriptions.get(subscriptionId) + + if (subscription?.unsubscribe) { + subscription.unsubscribe() + } + + subscriptions.delete(subscriptionId) + userSubscriptions.set(deviceId, subscriptions) +} + +/** + * Unsubscribes from all GunDB queries for a specific device + * @param {Object} subscription + * @param {string} subscription.deviceId + */ +const removeDevice = ({ deviceId }) => { + const deviceSubscriptions = userSubscriptions.get(deviceId) + + if (!deviceSubscriptions) { + return + } + + Array.from(deviceSubscriptions.values()).map(subscription => { + if (subscription && subscription.unsubscribe) { + subscription.unsubscribe() + } + + return subscription + }) + + userSubscriptions.set(deviceId, new Map()) +} + +/** + * Retrieves the specified subscription's info if it exists + * @param {Object} subscription + * @param {string} subscription.deviceId + * @param {string} subscription.subscriptionId + */ +const get = ({ deviceId, subscriptionId }) => { + const deviceSubscriptions = userSubscriptions.get(deviceId) + + if (!deviceSubscriptions) { + return false + } + + const subscription = deviceSubscriptions.get(subscriptionId) + return subscription +} + +module.exports = { + add, + attachUnsubscribe, + get, + remove, + removeDevice +} diff --git a/services/initializer.js b/services/initializer.js new file mode 100644 index 00000000..9d12684c --- /dev/null +++ b/services/initializer.js @@ -0,0 +1,12 @@ +const API = require('./gunDB/contact-api') + +module.exports.InitUserData = async (user) => { + await API.Actions.setDisplayName('anon' + user._.sea.pub.slice(0, 8), user) + await API.Actions.generateHandshakeAddress() + await API.Actions.generateOrderAddress(user) + await API.Actions.initWall() + await API.Actions.setBio('A little bit about myself.', user) + await API.Actions.setDefaultSeedProvider('', user) + await API.Actions.setSeedServiceData('', user) + await API.Actions.setCurrentStreamInfo('', user) +} \ No newline at end of file diff --git a/services/schema/index.js b/services/schema/index.js index 9bf34fd8..4fb0034c 100644 --- a/services/schema/index.js +++ b/services/schema/index.js @@ -1,5 +1,5 @@ const Crypto = require('crypto') -const logger = require('winston') +const logger = require('../../config/log') const Common = require('shock-common') const getGunUser = () => require('../gunDB/Mediator').getUser() const isAuthenticated = () => require('../gunDB/Mediator').isAuthenticated() @@ -201,7 +201,7 @@ const AddTmpChainOrder = async (address, orderInfo) => { .get(Key.TMP_CHAIN_COORDINATE) .get(addressSHA256) .put(encryptedOrderString, ack => { - if (ack.err && typeof ack.err !== 'number') { + if (ack.err && typeof ack.err !== 'number' && typeof ack.err !== 'object') { rej( new Error( `Error saving tmp chain coordinate order to user-graph: ${ack}` @@ -268,7 +268,7 @@ const clearTmpChainOrder = async (address) => { .get(Key.TMP_CHAIN_COORDINATE) .get(addressSHA256) .put(null, ack => { - if (ack.err && typeof ack.err !== 'number') { + if (ack.err && typeof ack.err !== 'number' && typeof ack.err !== 'object') { rej( new Error( `Error nulling tmp chain coordinate order to user-graph: ${ack}` @@ -370,8 +370,8 @@ class SchemaManager { .get(Key.COORDINATES) .get(coordinateSHA256) .put(encryptedOrderString, ack => { - if (ack.err && typeof ack.err !== 'number') { - console.log(ack) + if (ack.err && typeof ack.err !== 'number' && typeof ack.err !== 'object') { + logger.info(ack) rej( new Error( `Error saving coordinate order to user-graph: ${ack}` @@ -429,7 +429,7 @@ return orderedOrders }*/ /** - * @typedef {Common.Schema.InvoiceWhenListed & {r_hash:Buffer,payment_addr:string}} Invoice + * @typedef {Common.Schema.InvoiceWhenListed & {r_hash:Buffer,payment_addr:Buffer}} Invoice */ /** * @type {Recordvoid>} @@ -448,7 +448,7 @@ return orderedOrders /** * - * @param {Common.Schema.InvoiceWhenListed & {r_hash:Buffer,payment_addr:string}} data + * @param {Common.Schema.InvoiceWhenListed & {r_hash:Buffer,payment_addr:Buffer}} data */ invoiceStreamDataCb(data) { if (!data.settled) { @@ -468,7 +468,7 @@ return orderedOrders coordinateIndex: parseInt(data.add_index, 10), inbound: true, amount: amt, - toLndPub: data.payment_addr, + toLndPub: data.payment_addr.toString('hex'), invoiceMemo: data.memo }) } diff --git a/services/streams.js b/services/streams.js new file mode 100644 index 00000000..d567fb35 --- /dev/null +++ b/services/streams.js @@ -0,0 +1,150 @@ + +const EventEmitter = require('events') +const fetch = require('node-fetch') +const Key = require('./gunDB/contact-api/key') +const StreamLiveManager = new EventEmitter() + +const startedStream = (data) => { + StreamLiveManager.emit('awaitStream',data) +} +const endStream = (data) => { + StreamLiveManager.emit('endStream',data) +} +module.exports = {startedStream,endStream} + +//----------------------------------------- + +const intervalsWaitingAlive = {} +const intervalsStreamingViewers = {} +const intervalsWaitingMp4 = {} + +const clearStreamInterval = (postId, map) => { + if(!postId){ + return + } + if(map === "intervalsWaitingAlive"){ + if(!intervalsWaitingAlive[postId]){ + return + } + clearInterval(intervalsWaitingAlive[postId]) + delete intervalsWaitingAlive[postId] + } + if(map === "intervalsStreamingViewers"){ + if(!intervalsStreamingViewers[postId]){ + return + } + clearInterval(intervalsStreamingViewers[postId]) + delete intervalsStreamingViewers[postId] + } + if(map === "intervalsWaitingMp4"){ + if(!intervalsWaitingMp4[postId]){ + return + } + clearInterval(intervalsWaitingMp4[postId]) + delete intervalsWaitingMp4[postId] + } +} + +StreamLiveManager.on('awaitStream', data => { + const { postId, contentId, statusUrl } = data + if(intervalsWaitingAlive[postId]){ + clearStreamInterval(intervalsWaitingAlive[postId]) + } + const user = require('../services/gunDB/Mediator').getUser() + intervalsWaitingAlive[postId] = setInterval(async () => { + try { + const res = await fetch(statusUrl) + const j = await res.json() + if (!j.isLive) { + return + } + user + .get(Key.POSTS_NEW) + .get(postId) + .get('contentItems') + .get(contentId) + .get('liveStatus') + .put('live') + clearStreamInterval(postId,"intervalsWaitingAlive") + StreamLiveManager.emit('followStream', data) + //eslint-disable-next-line no-empty + } catch{} + }, 2 * 1000) + //kill sub after 10 minutes + setTimeout(()=>{ + clearStreamInterval(postId,"intervalsWaitingAlive") + },10 * 60 * 1000) +}) + +StreamLiveManager.on('followStream', data => { + const { postId, contentId, statusUrl } = data + if(intervalsStreamingViewers[postId]){ + clearStreamInterval(postId,"intervalsStreamingViewers") + } + const user = require('../services/gunDB/Mediator').getUser() + intervalsStreamingViewers[postId] = setInterval(async () => { + try { + const res = await fetch(statusUrl) + const j = await res.json() + if (typeof j.viewers !== 'number') { + return + } + user + .get(Key.POSTS_NEW) + .get(postId) + .get('contentItems') + .get(contentId) + .get('viewersCounter') + .put(j.viewers) + //eslint-disable-next-line no-empty + } catch{} + }, 5 * 1000) +}) + +StreamLiveManager.on('endStream', data => { + const { postId, contentId, endUrl, urlForMagnet, obsToken } = data + console.log("ending stream!") + clearStreamInterval(postId,"intervalsStreamingViewers") + if(intervalsWaitingMp4[postId]){ + clearStreamInterval(postId,"intervalsWaitingMp4") + } + const user = require('../services/gunDB/Mediator').getUser() + user + .get(Key.POSTS_NEW) + .get(postId) + .get('contentItems') + .get(contentId) + .get('liveStatus') + .put('waiting') + fetch(endUrl,{ + headers: { + 'Authorization': `Bearer ${obsToken}` + }, + }) + intervalsWaitingMp4[postId] = setInterval(async () => { + try { + const res = await fetch(urlForMagnet) + const j = await res.json() + if (!j.magnet) { + return + } + user + .get(Key.POSTS_NEW) + .get(postId) + .get('contentItems') + .get(contentId) + .get('liveStatus') + .put('wasLive') + user + .get(Key.POSTS_NEW) + .get(postId) + .get('contentItems') + .get(contentId) + .get('playbackMagnet') + .put(j.magnet) + clearStreamInterval(postId,"intervalsWaitingMp4") + //eslint-disable-next-line no-empty + } catch{} + }, 5 * 1000) +}) + diff --git a/services/tipsCallback.js b/services/tipsCallback.js new file mode 100644 index 00000000..e0bf73e5 --- /dev/null +++ b/services/tipsCallback.js @@ -0,0 +1,44 @@ +//@ts-nocheck TODO- fix types +const { gunUUID } = require("../utils") +const logger = require('../config/log') +class TipsCB { + listeners = {} + + postsEnabled = {} + + enablePostNotifications(postID){ + const accessId = gunUUID() + this.postsEnabled[accessId] = postID + return accessId + } + + addSocket(accessId,socket){ + if(!this.postsEnabled[accessId]){ + return "invalid access id" + } + const postID = this.postsEnabled[accessId] + logger.info("subbing new socket for post: "+postID) + + if(!this.listeners[postID]){ + this.listeners[postID] = [] + } + this.listeners[postID].push(socket) + } + + notifySocketIfAny(postID,name,message,amount){ + if(!this.listeners[postID]){ + return + } + this.listeners[postID].forEach(socket => { + if(!socket.connected){ + return + } + socket.emit("update",{ + name,message,amount + }) + }); + } +} + +const TipsForwarder = new TipsCB() +module.exports = TipsForwarder \ No newline at end of file diff --git a/src/cors.js b/src/cors.js index f3617730..0c6ef438 100644 --- a/src/cors.js +++ b/src/cors.js @@ -3,7 +3,7 @@ const setAccessControlHeaders = (req, res) => { res.header("Access-Control-Allow-Methods", "OPTIONS,POST,GET,PUT,DELETE") res.header( "Access-Control-Allow-Headers", - "Origin, X-Requested-With, Content-Type, Accept, Authorization, public-key-for-decryption, encryption-device-id" + "Origin, X-Requested-With, Content-Type, Accept, Authorization, public-key-for-decryption, encryption-device-id, public-key-for-decryption,x-shock-hybrid-relay-id-x" ); }; diff --git a/src/routes.js b/src/routes.js index 3037f99f..48d33775 100644 --- a/src/routes.js +++ b/src/routes.js @@ -1,25 +1,27 @@ /** * @prettier */ +// @ts-check 'use strict' -const Axios = require('axios') +const Axios = require('axios').default const Crypto = require('crypto') const Storage = require('node-persist') -const logger = require('winston') +const logger = require('../config/log') const httpsAgent = require('https') const responseTime = require('response-time') const uuid = require('uuid/v4') const Common = require('shock-common') const isARealUsableNumber = require('lodash/isFinite') -const Big = require('big.js') -const size = require('lodash/size') -const { range, flatten, evolve } = require('ramda') +const Big = require('big.js').default +const { evolve } = require('ramda') +const path = require('path') +const cors = require('cors') +const ECCrypto = require('eccrypto') const getListPage = require('../utils/paginate') const auth = require('../services/auth/auth') const FS = require('../utils/fs') -const Encryption = require('../utils/encryptionStore') const ECC = require('../utils/ECC') const LightningServices = require('../utils/lightningServices') const lndErrorManager = require('../utils/lightningServices/errors') @@ -29,658 +31,614 @@ const { nonEncryptedRoutes } = require('../utils/protectedRoutes') const GunActions = require('../services/gunDB/contact-api/actions') -const GunGetters = require('../services/gunDB/contact-api/getters') -const GunKey = require('../services/gunDB/contact-api/key') const LV2 = require('../utils/lightningServices/v2') const GunWriteRPC = require('../services/gunDB/rpc') +const Key = require('../services/gunDB/contact-api/key') +const { startedStream, endStream } = require('../services/streams') +const channelRequest = require('../utils/lightningServices/channelRequests') +const TipsForwarder = require('../services/tipsCallback') +const UserInitializer = require('../services/initializer') const DEFAULT_MAX_NUM_ROUTES_TO_QUERY = 10 const SESSION_ID = uuid() // module.exports = (app) => { module.exports = async ( - app, + _app, config, - mySocketsEvents, - { serverPort, CA, CA_KEY, usetls } + { serverPort, useTLS, CA, CA_KEY, runPrivateKey, runPublicKey, accessSecret } ) => { - const { timeout5 } = require('../services/gunDB/contact-api/utils') + /** + * @typedef {import('express').Application} Application + */ - const Http = Axios.create({ - httpsAgent: new httpsAgent.Agent({ - ca: await FS.readFile(CA) - }) - }) + const app = /** @type {Application} */ (_app) - const sanitizeLNDError = (message = '') => { - if (message.toLowerCase().includes('unknown')) { - const splittedMessage = message.split('UNKNOWN: ') - return splittedMessage.length > 1 - ? splittedMessage.slice(1).join('') - : splittedMessage.join('') - } - - return message - } - - const getAvailableService = () => { - return lndErrorManager.getAvailableService() - } - - const checkHealth = async () => { - logger.info('Getting service status...') - let LNDStatus = {} - try { - const serviceStatus = await getAvailableService() - logger.info('Received status:', serviceStatus) - LNDStatus = serviceStatus - } catch (e) { - LNDStatus = { - message: e.message, - success: false - } - } - - try { - logger.info('Getting API status...') - const APIHealth = await Http.get( - `${usetls ? 'https' : 'http'}://localhost:${serverPort}/ping` + try { + const Http = Axios.create({ + httpsAgent: new httpsAgent.Agent( + CA && CA_KEY + ? { + ca: await FS.readFile(CA), + key: await FS.readFile(CA_KEY) + } + : {} ) - const APIStatus = { - message: APIHealth.data, - responseTime: APIHealth.headers['x-response-time'], - success: true - } - logger.info('Received API status!', APIStatus) - return { - LNDStatus, - APIStatus - } - } catch (err) { - logger.error(err) - const APIStatus = { - message: err.response.data, - responseTime: err.response.headers['x-response-time'], - success: false - } - logger.warn('Failed to retrieve API status', APIStatus) - return { - LNDStatus, - APIStatus - } - } - } - - const handleError = async (res, err) => { - const health = await checkHealth() - if (health.LNDStatus.success) { - if (err) { - res.json({ - errorMessage: sanitizeLNDError(err.message) - }) - } else { - res.sendStatus(403) - } - } else { - res.status(500) - res.json({ errorMessage: 'LND is down' }) - } - } - - const recreateLnServices = async () => { - await LightningServices.init() - - return true - } - - const lastSeenMiddleware = (req, res, next) => { - const { authorization } = req.headers - const { path, method } = req - if ( - !unprotectedRoutes[method][path] && - authorization && - GunDB.isAuthenticated() - ) { - GunActions.setLastSeenApp() - } - - next() - } - - const unlockWallet = password => - new Promise((resolve, reject) => { - try { - const args = { - wallet_password: Buffer.from(password, 'utf-8') - } - const { walletUnlocker } = LightningServices.services - walletUnlocker.unlockWallet(args, (unlockErr, unlockResponse) => { - if (unlockErr) { - reject(unlockErr) - return - } - - resolve(unlockResponse) - }) - } catch (err) { - if (err.message === 'unknown service lnrpc.WalletUnlocker') { - resolve({ - field: 'walletUnlocker', - message: 'Wallet already unlocked' - }) - return - } - - logger.error('Unlock Error:', err) - - reject({ - field: 'wallet', - code: err.code, - message: sanitizeLNDError(err.message) - }) - } }) - // Hack to check whether or not a wallet exists - const walletExists = async () => { - try { - const availableService = await getAvailableService() - if (availableService.service === 'lightning') { - return true + const sanitizeLNDError = (message = '') => { + if (message.toLowerCase().includes('unknown')) { + const splittedMessage = message.split('UNKNOWN: ') + return splittedMessage.length > 1 + ? splittedMessage.slice(1).join('') + : splittedMessage.join('') } - if (availableService.service === 'walletUnlocker') { - const randomPassword = Crypto.randomBytes(4).toString('hex') + return message + } + + const unlockWallet = password => + new Promise((resolve, reject) => { try { - await unlockWallet(randomPassword) - return true + const args = { + wallet_password: Buffer.from(password, 'utf-8') + } + const { walletUnlocker } = LightningServices.services + walletUnlocker.unlockWallet(args, (unlockErr, unlockResponse) => { + if (unlockErr) { + reject(unlockErr) + return + } + + resolve(unlockResponse) + }) } catch (err) { - if (err.message.indexOf('invalid passphrase') > -1) { - return true - } - return false - } - } - } catch (err) { - logger.error('LND error:', err) - return false - } - } - - app.use((req, res, next) => { - res.setHeader('x-session-id', SESSION_ID) - next() - }) - - app.use((req, res, next) => { - const legacyDeviceId = req.headers['x-shockwallet-device-id'] - const deviceId = req.headers['encryption-device-id'] - logger.debug('Decrypting route...') - try { - if ( - nonEncryptedRoutes.includes(req.path) || - process.env.DISABLE_SHOCK_ENCRYPTION === 'true' || - (deviceId && !legacyDeviceId) - ) { - return next() - } - - if (!legacyDeviceId) { - const error = { - field: 'deviceId', - message: 'Please specify a device ID' - } - logger.error('Please specify a device ID') - return res.status(401).json(error) - } - - if (!Encryption.isAuthorizedDevice({ deviceId: legacyDeviceId })) { - const error = { - field: 'deviceId', - message: 'Please specify a device ID' - } - logger.error('Unknown Device') - return res.status(401).json(error) - } - if ( - !req.body.encryptionKey && - !req.body.iv && - !req.headers['x-shock-encryption-token'] - ) { - return next() - } - let reqData = null - let IV = null - let encryptedKey = null - let encryptedToken = null - if (req.method === 'GET' || req.method === 'DELETE') { - if (req.headers['x-shock-encryption-token']) { - encryptedToken = req.headers['x-shock-encryption-token'] - encryptedKey = req.headers['x-shock-encryption-key'] - IV = req.headers['x-shock-encryption-iv'] - } - } else { - encryptedToken = req.body.token - encryptedKey = req.body.encryptionKey || req.body.encryptedKey - IV = req.body.iv - reqData = req.body.data || req.body.encryptedData - } - const decryptedKey = Encryption.decryptKey({ - deviceId: legacyDeviceId, - message: encryptedKey - }) - if (reqData) { - const decryptedMessage = Encryption.decryptMessage({ - message: reqData, - key: decryptedKey, - iv: IV - }) - req.body = JSON.parse(decryptedMessage) - } - - const decryptedToken = encryptedToken - ? Encryption.decryptMessage({ - message: encryptedToken, - key: decryptedKey, - iv: IV - }) - : null - - if (decryptedToken) { - req.headers.authorization = decryptedToken - } - - return next() - } catch (err) { - logger.error(err) - return res.status(401).json(err) - } - }) - - app.use(async (req, res, next) => { - const legacyDeviceId = req.headers['x-shockwallet-device-id'] - const deviceId = req.headers['encryption-device-id'] - logger.info('Decrypting route...') - try { - if ( - nonEncryptedRoutes.includes(req.path) || - process.env.DISABLE_SHOCK_ENCRYPTION === 'true' || - (legacyDeviceId && !deviceId) - ) { - logger.info( - 'Unprotected route detected! ' + - req.path + - ' Legacy ID:' + - legacyDeviceId + - ' Device ID:' + - deviceId - ) - return next() - } - - if (!deviceId) { - const error = { - field: 'deviceId', - message: 'Please specify a device ID' - } - logger.error('Please specify a device ID') - return res.status(401).json(error) - } - - if (!ECC.isAuthorizedDevice({ deviceId })) { - const error = { - field: 'deviceId', - message: 'Please specify a device ID' - } - logger.error('Unknown Device') - return res.status(401).json(error) - } - - if (req.method === 'GET') { - return next() - } - - if (!ECC.isEncryptedMessage(req.body)) { - logger.warn('Message not encrypted!', req.body) - return next() - } - - logger.info('Decrypting ECC message...') - - const decryptedMessage = await ECC.decryptMessage({ - deviceId, - encryptedMessage: req.body - }) - - // eslint-disable-next-line - req.body = JSON.parse(decryptedMessage) - - return next() - } catch (err) { - logger.error(err) - return res.status(401).json(err) - } - }) - - app.use(async (req, res, next) => { - logger.info(`Route: ${req.path}`) - if (unprotectedRoutes[req.method][req.path]) { - next() - } else { - try { - const response = await auth.validateToken( - req.headers.authorization.replace('Bearer ', '') - ) - if (response.valid) { - next() - } else { - res.status(401).json({ - field: 'authorization', - errorMessage: "The authorization token you've supplied is invalid" - }) - } - } catch (err) { - logger.error( - !req.headers.authorization - ? 'Please add an Authorization header' - : err - ) - res - .status(401) - .json({ field: 'authorization', errorMessage: 'Please log in' }) - } - } - }) - - app.use(async (req, res, next) => { - try { - if (unprotectedRoutes[req.method][req.path]) { - next() - return - } - - if (req.path.includes('/api/lnd')) { - const walletStatus = await walletExists() - const availableService = await getAvailableService() - const statusMessage = availableService.walletStatus - if (availableService.code === 12) { - return res.status(401).json({ - field: 'lnd_locked', - errorMessage: availableService.message - ? availableService.message - : 'unknown' - }) - } - if (availableService.code === 14) { - return res.status(401).json({ - field: 'lnd_dead', - errorMessage: availableService.message - ? availableService.message - : 'unknown' - }) - } - if (walletStatus) { - if (statusMessage === 'unlocked') { - return next() - } - return res.status(401).json({ - field: 'wallet', - errorMessage: availableService.message - ? availableService.message - : 'unknown' - }) - } - - return res.status(401).json({ - field: 'wallet', - errorMessage: 'Please create a wallet before using the API' - }) - } - - if (req.path.includes('/api/gun')) { - const authenticated = GunDB.isAuthenticated() - - if (!authenticated) { - return res.status(401).json({ - field: 'gun', - errorMessage: 'Please login in order to perform this action' - }) - } - } - next() - } catch (err) { - logger.error(err) - if (err.code === 12) { - return res.status(401).json({ - field: 'lnd_locked', - errorMessage: err.message ? err.message : 'unknown' - }) - } - if (err.code === 14) { - return res.status(401).json({ - field: 'lnd_dead', - errorMessage: err.message ? err.message : 'unknown' - }) - } - res.status(500).json({ - field: 'wallet', - errorMessage: err.message ? err.message : err - }) - } - }) - - app.use(lastSeenMiddleware) - - app.use(['/ping'], responseTime()) - - /** - * health check - */ - app.get('/health', async (req, res) => { - const health = await checkHealth() - res.json(health) - }) - - /** - * kubernetes health check - */ - app.get('/healthz', async (req, res) => { - const health = await checkHealth() - logger.info('Healthz response:', health) - res.json(health) - }) - - app.get('/ping', (req, res) => { - logger.info('Ping completed!') - res.json({ message: 'OK' }) - }) - - app.post('/api/mobile/error', (req, res) => { - logger.debug('Mobile error:', JSON.stringify(req.body)) - res.json({ msg: 'OK' }) - }) - - app.post('/api/security/exchangeKeys', async (req, res) => { - try { - const { publicKey, deviceId } = req.body - - if (!publicKey) { - return res.status(400).json({ - field: 'publicKey', - message: 'Please provide a valid public key' - }) - } - - if ( - !deviceId || - !/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/iu.test( - deviceId - ) - ) { - return res.status(400).json({ - field: 'deviceId', - message: 'Please provide a valid device ID' - }) - } - - const authorizedDevice = await Encryption.authorizeDevice({ - deviceId, - publicKey - }) - logger.info(authorizedDevice) - return res.json(authorizedDevice) - } catch (err) { - logger.error(err) - return res.status(401).json({ - field: 'unknown', - message: err - }) - } - }) - - app.post('/api/encryption/exchange', async (req, res) => { - try { - const { publicKey, deviceId } = req.body - - if (!publicKey) { - return res.status(400).json({ - field: 'publicKey', - message: 'Please provide a valid public key' - }) - } - - if ( - !deviceId || - !/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/iu.test( - deviceId - ) - ) { - return res.status(400).json({ - field: 'deviceId', - message: 'Please provide a valid device ID' - }) - } - - const authorizedDevice = await ECC.authorizeDevice({ - deviceId, - publicKey - }) - return res.json(authorizedDevice) - } catch (err) { - logger.error(err) - return res.status(401).json({ - field: 'unknown', - message: err - }) - } - }) - - app.get('/api/lnd/wallet/status', async (req, res) => { - try { - const walletStatus = await walletExists() - const availableService = await getAvailableService() - - res.json({ - walletExists: walletStatus, - walletStatus: walletStatus ? availableService.walletStatus : null - }) - } catch (err) { - logger.error(err) - const sanitizedMessage = sanitizeLNDError(err.message) - res.status(500).json({ - field: 'LND', - errorMessage: sanitizedMessage - ? sanitizedMessage - : 'An unknown error has occurred, please try restarting your LND and API servers' - }) - } - }) - - const validateToken = async token => { - try { - const tokenValid = await auth.validateToken(token) - return tokenValid - } catch (err) { - return false - } - } - - app.post('/api/lnd/auth', async (req, res) => { - try { - const health = await checkHealth() - const walletInitialized = await walletExists() - // If we're connected to lnd, unlock the wallet using the password supplied - // and generate an auth token if that operation was successful. - if (health.LNDStatus.success && walletInitialized) { - const { alias, password } = req.body - - await recreateLnServices() - - if (GunDB.isAuthenticated()) { - GunDB.logoff() - } - - const publicKey = await GunDB.authenticate(alias, password) - - if (!publicKey) { - res.status(401).json({ - field: 'alias', - errorMessage: 'Invalid alias/password combination', - success: false - }) - return false - } - - const trustedKeysEnabled = - process.env.TRUSTED_KEYS === 'true' || !process.env.TRUSTED_KEYS - const trustedKeys = await Storage.get('trustedPKs') - // Falls back to true if trusted keys is disabled in .env - const [isKeyTrusted = !trustedKeysEnabled] = (trustedKeys || []).filter( - trustedKey => trustedKey === publicKey - ) - const walletUnlocked = health.LNDStatus.walletStatus === 'unlocked' - const { authorization = '' } = req.headers - - if (!isKeyTrusted) { - logger.warn('Untrusted public key!') - } - - if (!walletUnlocked) { - await unlockWallet(password) - } - - if (walletUnlocked && !authorization && !isKeyTrusted) { - res.status(401).json({ - field: 'alias', - errorMessage: - 'Invalid alias/password combination (Untrusted Device)', - success: false - }) - return - } - - if (walletUnlocked && !isKeyTrusted) { - const validatedToken = await validateToken( - authorization.replace('Bearer ', '') - ) - - if (!validatedToken) { - res.status(401).json({ - field: 'alias', - errorMessage: - 'Invalid alias/password combination (Untrusted Auth Token)', - success: false + if (err.message === 'unknown service lnrpc.WalletUnlocker') { + resolve({ + field: 'walletUnlocker', + message: 'Wallet already unlocked' }) return } + + logger.error('Unlock Error:', err) + + reject({ + field: 'wallet', + code: err.code, + message: sanitizeLNDError(err.message) + }) + } + }) + + const getAvailableService = () => { + return lndErrorManager.getAvailableService() + } + + // Hack to check whether or not a wallet exists + const walletExists = async () => { + try { + const availableService = await getAvailableService() + if (availableService.service === 'lightning') { + return true } - if (!isKeyTrusted) { - await Storage.set('trustedPKs', [...(trustedKeys || []), publicKey]) + if (availableService.service === 'walletUnlocker') { + const randomPassword = Crypto.randomBytes(4).toString('hex') + try { + await unlockWallet(randomPassword) + return true + } catch (err) { + if (err.message.indexOf('invalid passphrase') > -1) { + return true + } + return false + } + } + } catch (err) { + logger.error('LND error:', err) + return false + } + } + + const checkHealth = async () => { + let LNDStatus = {} + try { + const serviceStatus = await getAvailableService() + LNDStatus = { + ...serviceStatus, + walletExists: await walletExists() + } + } catch (e) { + LNDStatus = { + message: e.message, + success: false + } + } + + try { + const APIHealth = await Http.get( + `${useTLS ? 'https' : 'http'}://localhost:${serverPort}/ping` + ) + const APIStatus = { + message: APIHealth.data, + responseTime: APIHealth.headers['x-response-time'], + success: true, + encryptionPublicKey: runPublicKey.toString('base64') + } + return { + LNDStatus, + APIStatus, + deploymentType: process.env.DEPLOYMENT_TYPE || 'default' + } + } catch (err) { + logger.error(err) + const APIStatus = { + message: err?.response?.data, + responseTime: err?.response?.headers['x-response-time'], + success: false, + encryptionPublicKey: runPublicKey.toString('base64') + } + logger.warn('Failed to retrieve API status', APIStatus) + return { + LNDStatus, + APIStatus, + deploymentType: process.env.DEPLOYMENT_TYPE || 'default' + } + } + } + + const handleError = async (res, err) => { + const health = await checkHealth() + if (health.LNDStatus.success) { + if (err) { + res.json({ + errorMessage: sanitizeLNDError(err.message) + }) + } else { + res.sendStatus(403) + } + } else { + res.status(500) + res.json({ errorMessage: 'LND is down' }) + } + } + + const recreateLnServices = async () => { + await LightningServices.init() + + return true + } + + const lastSeenMiddleware = (req, res, next) => { + const { authorization } = req.headers + const { path, method } = req + if ( + !unprotectedRoutes[method][path] && + authorization && + GunDB.isAuthenticated() + ) { + GunActions.setLastSeenApp() + } + + next() + } + + app.use( + cors({ + credentials: true, + origin: '*' + }) + ) + + app.use((req, res, next) => { + res.setHeader('x-session-id', SESSION_ID) + next() + }) + + app.use(async (req, res, next) => { + const deviceId = req.headers['encryption-device-id'] + try { + if ( + nonEncryptedRoutes.includes(req.path) || + process.env.DISABLE_SHOCK_ENCRYPTION === 'true' + ) { + return next() } + if (typeof deviceId !== 'string' || !deviceId) { + const error = { + field: 'deviceId', + message: 'Please specify a device ID' + } + logger.error('Please specify a device ID') + return res.status(401).json(error) + } + + if (!ECC.isAuthorizedDevice({ deviceId })) { + const error = { + field: 'deviceId', + message: 'Please specify a device ID' + } + logger.error('Unknown Device') + return res.status(401).json(error) + } + + if (req.method === 'GET' || req.method === 'DELETE') { + return next() + } + + if (!ECC.isEncryptedMessage(req.body)) { + logger.warn('Message not encrypted!', req.body) + return next() + } + + logger.info('Decrypting ECC message...') + + const asBuffers = await ECC.convertToEncryptedMessage(req.body) + + const decryptedMessage = await ECCrypto.decrypt( + runPrivateKey, + asBuffers + ) + + // eslint-disable-next-line + req.body = JSON.parse(decryptedMessage.toString('utf8')) + + return next() + } catch (err) { + logger.error(err) + return res.status(401).json(err) + } + }) + + app.use(async (req, res, next) => { + if (!req.method) { + logger.error( + 'No req.method in unprotected routes middleware.', + 'req.path:', + req.path + ) + next() + } else if (!req.path) { + logger.error( + 'No req.path in unprotected routes middleware.', + 'req.method:', + req.method + ) + next() + } else if (unprotectedRoutes[req.method][req.path]) { + next() + } else { + try { + const response = await auth.validateToken( + (req.headers.authorization || '').replace('Bearer ', '') + ) + if (response.valid) { + next() + } else { + res.status(401).json({ + field: 'authorization', + errorMessage: "The authorization token you've supplied is invalid" + }) + } + } catch (err) { + logger.error( + !req.headers.authorization + ? 'Please add an Authorization header' + : err + ) + res + .status(401) + .json({ field: 'authorization', errorMessage: 'Please log in' }) + } + } + }) + + app.use(async (req, res, next) => { + try { + if (unprotectedRoutes[req.method][req.path]) { + next() + return + } + + if (req.path.includes('/api/lnd')) { + const walletStatus = await walletExists() + const availableService = await getAvailableService() + const statusMessage = availableService.walletStatus + if (availableService.code === 12) { + return res.status(401).json({ + field: 'lnd_locked', + errorMessage: availableService.message + ? availableService.message + : 'unknown' + }) + } + if (availableService.code === 14) { + return res.status(401).json({ + field: 'lnd_dead', + errorMessage: availableService.message + ? availableService.message + : 'unknown' + }) + } + if (walletStatus) { + if (statusMessage === 'unlocked') { + return next() + } + return res.status(401).json({ + field: 'wallet', + errorMessage: availableService.message + ? availableService.message + : 'unknown' + }) + } + + return res.status(401).json({ + field: 'wallet', + errorMessage: 'Please create a wallet before using the API' + }) + } + + if (req.path.includes('/api/gun')) { + const authenticated = GunDB.isAuthenticated() + + if (!authenticated) { + return res.status(401).json({ + field: 'gun', + errorMessage: 'Please login in order to perform this action' + }) + } + } + next() + } catch (err) { + logger.error(err) + if (err.code === 12) { + return res.status(401).json({ + field: 'lnd_locked', + errorMessage: err.message ? err.message : 'unknown' + }) + } + if (err.code === 14) { + return res.status(401).json({ + field: 'lnd_dead', + errorMessage: err.message ? err.message : 'unknown' + }) + } + res.status(500).json({ + field: 'wallet', + errorMessage: err.message ? err.message : err + }) + } + }) + + app.use(lastSeenMiddleware) + + app.use(['/ping'], responseTime()) + + /** + * health check + */ + app.get('/health', async (req, res) => { + const health = await checkHealth() + res.json(health) + }) + + app.get('/tunnel/status', async (req, res) => { + const [relayId, relayUrl] = await Promise.all([ + Storage.getItem('relay/id'), + Storage.getItem('relay/url') + ]) + res.json({ uri: `${relayId}@${relayUrl}` }) + }) + + /** + * kubernetes health check + */ + app.get('/healthz', async (req, res) => { + const health = await checkHealth() + logger.info('Healthz response:', health.APIStatus.success) + res.json(health) + }) + + app.get('/ping', (req, res) => { + logger.info('Ping completed!') + res.json({ message: 'OK' }) + }) + + app.post('/api/mobile/error', (req, res) => { + logger.debug('Mobile error:', JSON.stringify(req.body)) + res.json({ msg: 'OK' }) + }) + + app.post('/api/encryption/exchange', async (req, res) => { + try { + let { publicKey, deviceId } = req.body + + logger.info('Will decrypt public key and device ID for key exchange.') + + console.log(req.body) + + publicKey = await ECCrypto.decrypt( + accessSecret, + ECC.convertToEncryptedMessage(publicKey) + ) + deviceId = await ECCrypto.decrypt( + accessSecret, + ECC.convertToEncryptedMessage(deviceId) + ) + + publicKey = publicKey.toString('utf8') + deviceId = deviceId.toString('utf8') + + if (typeof publicKey !== 'string' || !publicKey) { + return res.status(500).json({ + field: 'publicKey', + errorMessage: 'Please provide a valid public key' + }) + } + + if ( + !deviceId || + !/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/iu.test( + deviceId + ) + ) { + return res.status(500).json({ + field: 'deviceId', + errorMessage: 'Please provide a valid device ID' + }) + } + + await ECC.authorizeDevice({ + deviceId, + publicKey + }) + res.sendStatus(200) + } catch (err) { + logger.error(err) + return res.status(401).json({ + field: 'unknown', + message: err, + errorMessage: err.message || err + }) + } + }) + + app.get('/api/lnd/wallet/status', async (req, res) => { + try { + const walletStatus = await walletExists() + const availableService = await getAvailableService() + + res.json({ + walletExists: walletStatus, + walletStatus: walletStatus ? availableService.walletStatus : null + }) + } catch (err) { + logger.error(err) + const sanitizedMessage = sanitizeLNDError(err.message) + res.status(500).json({ + field: 'LND', + errorMessage: sanitizedMessage + ? sanitizedMessage + : 'An unknown error has occurred, please try restarting your LND and API servers' + }) + } + }) + + /** + * Get the latest channel backups before subscribing. + */ + const saveChannelsBackup = async () => { + const { getUser } = require('../services/gunDB/Mediator') + const { lightning } = LightningServices.services + const SEA = require('../services/gunDB/Mediator').mySEA + await Common.Utils.makePromise((res, rej) => { + lightning.exportAllChannelBackups({}, (err, channelBackups) => { + if (err) { + return rej(new Error(err.details)) + } + + res( + GunActions.saveChannelsBackup( + JSON.stringify(channelBackups), + getUser(), + SEA + ) + ) + }) + }) + } + + /** + * Register to listen for channel backups. + */ + const onNewChannelBackup = () => { + const { getUser } = require('../services/gunDB/Mediator') + const { lightning } = LightningServices.services + const SEA = require('../services/gunDB/Mediator').mySEA + + logger.warn('Subscribing to channel backup ...') + + const stream = lightning.SubscribeChannelBackups({}) + + stream.on('data', data => { + logger.info(' New channel backup data') + GunActions.saveChannelsBackup(JSON.stringify(data), getUser(), SEA) + }) + stream.on('end', () => { + logger.info('Channel backup stream ended, starting a new one...') + // Prevents call stack overflow exceptions + //process.nextTick(onNewChannelBackup) + }) + stream.on('error', err => { + logger.error('Channel backup stream error:', err) + }) + stream.on('status', status => { + logger.error('Channel backup stream status:', status) + switch (status.code) { + case 0: { + logger.info('Channel backup stream ok') + break + } + case 2: { + //Happens to fire when the grpc client lose access to macaroon file + logger.warn('Channel backup got UNKNOWN error status') + break + } + case 12: { + logger.warn( + 'Channel backup LND locked, new registration in 60 seconds' + ) + process.nextTick(() => + setTimeout(() => onNewChannelBackup(), 60000) + ) + break + } + case 13: { + //https://grpc.github.io/grpc/core/md_doc_statuscodes.html + logger.error('Channel backup INTERNAL LND error') + break + } + case 14: { + logger.error( + 'Channel backup LND disconnected, sockets reconnecting in 30 seconds...' + ) + process.nextTick(() => + setTimeout(() => onNewChannelBackup(), 30000) + ) + break + } + default: { + logger.error('[event:transaction:new] UNKNOWN LND error') + } + } + }) + } + + app.post('/api/lnd/unlock', async (req, res) => { + try { + const health = await checkHealth() + const walletInitialized = await walletExists() + const { pass } = req.body + const lndUp = health.LNDStatus.success + const walletUnlocked = health.LNDStatus.walletStatus === 'unlocked' const { lightning } = LightningServices.services + if (!lndUp) { + throw new Error(health.LNDStatus.message) + } + + if (!walletInitialized) { + throw new Error('Please create a wallet before authenticating') + } + + await recreateLnServices() + + if (!walletUnlocked) { + await unlockWallet(pass) + } + // Generate auth token and send it as a JSON response const token = await auth.generateToken() @@ -690,8 +648,8 @@ module.exports = async ( let intervalID = null intervalID = setInterval(() => { - if (tries === 3) { - rej(new Error(`Wallet did not warm up in under 3 seconds.`)) + if (tries === 7) { + rej(new Error(`Wallet did not warm up in under 7 seconds.`)) clearInterval(intervalID) return @@ -708,89 +666,204 @@ module.exports = async ( }, 1000) }) - //get the latest channel backups before subscribing - const user = require('../services/gunDB/Mediator').getUser() - const SEA = require('../services/gunDB/Mediator').mySEA + // saveChannelsBackup() + // onNewChannelBackup() + // setTimeout(() => { + // channelRequest() + // }, 30 * 1000) - await Common.Utils.makePromise((res, rej) => { - lightning.exportAllChannelBackups({}, (err, channelBackups) => { - if (err) { - return rej(new Error(err.details)) - } - - res( - GunActions.saveChannelsBackup( - JSON.stringify(channelBackups), - user, - SEA - ) - ) - }) + res.json({ + authorization: token }) + } catch (err) { + logger.error('Unlock Error:', err) + res.status(400) + res.json({ + field: 'user', + errorMessage: err.message ? sanitizeLNDError(err.message) : err, + success: false + }) + return err + } + }) - // Send an event to update lightning's status - mySocketsEvents.emit('updateLightning') + app.post('/api/lnd/wallet', async (req, res) => { + try { + const { walletUnlocker } = LightningServices.services + const { password } = req.body + const healthResponse = await checkHealth() + const walletInitialized = await walletExists() + const isUnlocked = healthResponse.LNDStatus.service !== 'walletUnlocker' - //register to listen for channel backups - const onNewChannelBackup = () => { - logger.warn('Subscribing to channel backup ...') - const stream = lightning.SubscribeChannelBackups({}) - stream.on('data', data => { - logger.info(' New channel backup data') - GunActions.saveChannelsBackup(JSON.stringify(data), user, SEA) - }) - stream.on('end', () => { - logger.info('Channel backup stream ended, starting a new one...') - // Prevents call stack overflow exceptions - //process.nextTick(onNewChannelBackup) - }) - stream.on('error', err => { - logger.error('Channel backup stream error:', err) - }) - stream.on('status', status => { - logger.error('Channel backup stream status:', status) - switch (status.code) { - case 0: { - logger.info('Channel backup stream ok') - break - } - case 2: { - //Happens to fire when the grpc client lose access to macaroon file - logger.warn('Channel backup got UNKNOWN error status') - break - } - case 12: { - logger.warn( - 'Channel backup LND locked, new registration in 60 seconds' - ) - process.nextTick(() => - setTimeout(() => onNewChannelBackup(), 60000) - ) - break - } - case 13: { - //https://grpc.github.io/grpc/core/md_doc_statuscodes.html - logger.error('Channel backup INTERNAL LND error') - break - } - case 14: { - logger.error( - 'Channel backup LND disconnected, sockets reconnecting in 30 seconds...' - ) - process.nextTick(() => - setTimeout(() => onNewChannelBackup(), 30000) - ) - break - } - default: { - logger.error('[event:transaction:new] UNKNOWN LND error') - } - } + if (!password) { + return res.status(400).json({ + field: 'password', + errorMessage: 'Please specify a password for your new wallet' }) } - onNewChannelBackup() + if (password.length < 8) { + return res.status(400).json({ + field: 'password', + errorMessage: + "Please specify a password that's longer than 8 characters" + }) + } + if (walletInitialized || isUnlocked) { + throw new Error('A wallet already exists') + } + + const [genSeedErr, genSeedResponse] = await new Promise(res => { + walletUnlocker.genSeed({}, (_genSeedErr, _genSeedResponse) => { + res([_genSeedErr, _genSeedResponse]) + }) + }) + + if (genSeedErr) { + logger.debug('GenSeed Error:', genSeedErr) + + const healthResponse = await checkHealth() + if (healthResponse.LNDStatus.success) { + const message = genSeedErr.details + throw new Error(message) + } + + throw new Error('LND is down') + } + + logger.debug('GenSeed:', genSeedResponse) + + const mnemonicPhrase = genSeedResponse.cipher_seed_mnemonic + const walletArgs = { + wallet_password: Buffer.from(password, 'utf8'), + cipher_seed_mnemonic: mnemonicPhrase + } + + const [initWalletErr, initWalletResponse] = await new Promise(res => { + walletUnlocker.initWallet( + walletArgs, + (_initWalletErr, _initWalletResponse) => { + res([_initWalletErr, _initWalletResponse]) + } + ) + }) + + if (initWalletErr) { + logger.error('initWallet Error:', initWalletErr.message) + const healthResponse = await checkHealth() + if (healthResponse.LNDStatus.success) { + const errorMessage = initWalletErr.details + + throw new Error(errorMessage) + } + throw new Error('LND is down') + } + + logger.info('initWallet:', initWalletResponse) + + const waitUntilFileExists = seconds => { + logger.info( + `Waiting for admin.macaroon to be created. Seconds passed: ${seconds} Path: ${LightningServices.servicesConfig.macaroonPath}` + ) + setTimeout(async () => { + try { + const macaroonExists = await FS.access( + LightningServices.servicesConfig.macaroonPath + ) + + if (!macaroonExists) { + return waitUntilFileExists(seconds + 1) + } + + logger.info('admin.macaroon file created') + + await LightningServices.init() + + const token = await auth.generateToken() + setTimeout(() => { + channelRequest() + }, 30 * 1000) + return res.json({ + mnemonicPhrase, + authorization: token + }) + } catch (err) { + logger.error(err) + res.status(500).json({ + field: 'unknown', + errorMessage: sanitizeLNDError(err.message) + }) + } + }, 1000) + } + + waitUntilFileExists(1) + } catch (err) { + logger.error(err) + return res.status(500).json({ + field: 'unknown', + errorMessage: err + }) + } + }) + + app.post('/api/lnd/wallet/existing', async (req, res) => { + try { + const { password, alias } = req.body + const healthResponse = await checkHealth() + const exists = await walletExists() + const allowUnlockedLND = process.env.ALLOW_UNLOCKED_LND === 'true' + const isLocked = healthResponse.LNDStatus.service === 'walletUnlocker' + + if (!exists) { + throw new Error('LND wallet does not exist, please create a new one') + } + + if (!alias) { + return res.status(400).json({ + field: 'alias', + errorMessage: 'Please specify an alias for your wallet' + }) + } + + if (!password) { + return res.status(400).json({ + field: 'password', + errorMessage: 'Please specify a password for your wallet alias' + }) + } + + if (password.length < 8) { + return res.status(400).json({ + field: 'password', + errorMessage: + "Please specify a password that's longer than 8 characters" + }) + } + + if (!isLocked && !allowUnlockedLND) { + throw new Error( + 'Wallet is already unlocked. Please restart your LND instance and try again.' + ) + } + + try { + if (isLocked) { + await unlockWallet(password) + } + } catch (_) { + throw new Error('Invalid LND wallet password') + } + + // Register user after verifying wallet password + const publicKey = await GunDB.register(alias, password) + + // Generate Access Token + const token = await auth.generateToken() + setTimeout(() => { + channelRequest() + }, 30 * 1000) res.json({ authorization: token, user: { @@ -798,319 +871,86 @@ module.exports = async ( publicKey } }) - - return true - } - - if (!walletInitialized) { - res.status(500).json({ - field: 'wallet', - errorMessage: 'Please create a wallet before authenticating', - success: false - }) - return false - } - - res.status(500) - res.json({ - field: 'health', - errorMessage: sanitizeLNDError(health.LNDStatus.message), - success: false - }) - return false - } catch (err) { - logger.error('Unlock Error:', err) - res.status(400) - res.json({ - field: 'user', - errorMessage: err.message ? sanitizeLNDError(err.message) : err, - success: false - }) - return err - } - }) - - app.post('/api/lnd/wallet', async (req, res) => { - try { - const { walletUnlocker } = LightningServices.services - const { password, alias } = req.body - const healthResponse = await checkHealth() - if (!alias) { - return res.status(400).json({ - field: 'alias', - errorMessage: 'Please specify an alias for your new wallet' - }) - } - - if (!password) { - return res.status(400).json({ - field: 'password', - errorMessage: 'Please specify a password for your new wallet' - }) - } - - if (password.length < 8) { - return res.status(400).json({ - field: 'password', - errorMessage: - "Please specify a password that's longer than 8 characters" - }) - } - - if (healthResponse.LNDStatus.service !== 'walletUnlocker') { - return res.status(400).json({ - field: 'wallet', - errorMessage: 'Wallet is already unlocked' - }) - } - - walletUnlocker.genSeed({}, async (genSeedErr, genSeedResponse) => { - try { - if (genSeedErr) { - logger.debug('GenSeed Error:', genSeedErr) - - const healthResponse = await checkHealth() - if (healthResponse.LNDStatus.success) { - const message = genSeedErr.details - return res.status(400).json({ - field: 'GenSeed', - errorMessage: message, - success: false - }) - } - - return res.status(500).json({ - field: 'health', - errorMessage: 'LND is down', - success: false - }) - } - - logger.debug('GenSeed:', genSeedResponse) - const mnemonicPhrase = genSeedResponse.cipher_seed_mnemonic - const walletArgs = { - wallet_password: Buffer.from(password, 'utf8'), - cipher_seed_mnemonic: mnemonicPhrase - } - - // Register user before creating wallet - const publicKey = await GunDB.register(alias, password) - - await GunActions.saveSeedBackup( - mnemonicPhrase, - GunDB.getUser(), - GunDB.mySEA - ) - - const trustedKeys = await Storage.get('trustedPKs') - await Storage.setItem('trustedPKs', [ - ...(trustedKeys || []), - publicKey - ]) - - walletUnlocker.initWallet( - walletArgs, - async (initWalletErr, initWalletResponse) => { - try { - if (initWalletErr) { - logger.error('initWallet Error:', initWalletErr.message) - const healthResponse = await checkHealth() - if (healthResponse.LNDStatus.success) { - const errorMessage = initWalletErr.details - - return res.status(400).json({ - field: 'initWallet', - errorMessage, - success: false - }) - } - return res.status(500).json({ - field: 'health', - errorMessage: 'LND is down', - success: false - }) - } - logger.info('initWallet:', initWalletResponse) - - const waitUntilFileExists = seconds => { - logger.info( - `Waiting for admin.macaroon to be created. Seconds passed: ${seconds} Path: ${LightningServices.servicesConfig.macaroonPath}` - ) - setTimeout(async () => { - try { - const macaroonExists = await FS.access( - LightningServices.servicesConfig.macaroonPath - ) - - if (!macaroonExists) { - return waitUntilFileExists(seconds + 1) - } - - logger.info('admin.macaroon file created') - - await LightningServices.init() - - const token = await auth.generateToken() - return res.json({ - mnemonicPhrase, - authorization: token, - user: { - alias, - publicKey - } - }) - } catch (err) { - logger.error(err) - res.status(400).json({ - field: 'unknown', - errorMessage: sanitizeLNDError(err.message) - }) - } - }, 1000) - } - - waitUntilFileExists(1) - } catch (err) { - logger.error(err) - return res.status(500).json({ - field: 'unknown', - errorMessage: err - }) - } - } - ) - } catch (err) { - logger.error(err) - return res.status(500).json({ - field: 'unknown', - errorMessage: err.message || err - }) - } - }) - } catch (err) { - logger.error(err) - return res.status(500).json({ - field: 'unknown', - errorMessage: err - }) - } - }) - - app.post('/api/lnd/wallet/existing', async (req, res) => { - try { - const { password, alias } = req.body - const healthResponse = await checkHealth() - const exists = await walletExists() - if (!exists) { - return res.status(500).json({ - field: 'wallet', - errorMessage: 'LND wallet does not exist, please create a new one' - }) - } - - if (!alias) { - return res.status(400).json({ - field: 'alias', - errorMessage: 'Please specify an alias for your wallet' - }) - } - - if (!password) { - return res.status(400).json({ - field: 'password', - errorMessage: 'Please specify a password for your wallet alias' - }) - } - - if (password.length < 8) { - return res.status(400).json({ - field: 'password', - errorMessage: - "Please specify a password that's longer than 8 characters" - }) - } - - if (healthResponse.LNDStatus.service !== 'walletUnlocker') { - return res.status(400).json({ - field: 'wallet', - errorMessage: - 'Wallet is already unlocked. Please restart your LND instance and try again.' - }) - } - - try { - await unlockWallet(password) } catch (err) { - return res.status(401).json({ - field: 'wallet', - errorMessage: 'Invalid LND wallet password' + return res.status(500).json({ + errorMessage: err.message }) } - - // Register user after verifying wallet password - const publicKey = await GunDB.register(alias, password) - - const trustedKeys = await Storage.get('trustedPKs') - await Storage.setItem('trustedPKs', [...(trustedKeys || []), publicKey]) - - // Generate Access Token - const token = await auth.generateToken() - - res.json({ - authorization: token, - user: { - alias, - publicKey - } - }) - } catch (err) { - return res.status(500).json({ - errorMessage: err.message - }) - } - }) - - // get lnd info - app.get('/api/lnd/getinfo', (req, res) => { - const { lightning } = LightningServices.services - - lightning.getInfo({}, async (err, response) => { - if (err) { - logger.error('GetInfo Error:', err) - const health = await checkHealth() - if (health.LNDStatus.success) { - res.status(400).json({ - field: 'getInfo', - errorMessage: sanitizeLNDError(err.message) - }) - } else { - res.status(500) - res.json({ errorMessage: 'LND is down' }) - } - } - logger.info('GetInfo:', response) - if (!response.uris || response.uris.length === 0) { - if (config.lndAddress) { - response.uris = [response.identity_pubkey + '@' + config.lndAddress] - } - } - res.json(response) }) - }) - // get lnd node info - app.post('/api/lnd/getnodeinfo', (req, res) => { - const { lightning } = LightningServices.services + // get lnd info + app.get('/api/lnd/getinfo', (req, res) => { + const { lightning } = LightningServices.services - lightning.getNodeInfo( - { pub_key: req.body.pubkey }, - async (err, response) => { + lightning.getInfo({}, async (err, response) => { if (err) { - logger.debug('GetNodeInfo Error:', err) + logger.error('GetInfo Error:', err) const health = await checkHealth() if (health.LNDStatus.success) { - res.status(400) - res.json({ + res.status(400).json({ + field: 'getInfo', + errorMessage: sanitizeLNDError(err.message) + }) + } else { + res.status(500) + res.json({ errorMessage: 'LND is down' }) + } + } + if (!response.uris || response.uris.length === 0) { + if (config.lndAddress) { + response.uris = [response.identity_pubkey + '@' + config.lndAddress] + } + } + res.json(response) + }) + }) + + // get lnd node info + app.post('/api/lnd/getnodeinfo', (req, res) => { + const { lightning } = LightningServices.services + + lightning.getNodeInfo( + { pub_key: req.body.pubkey }, + async (err, response) => { + if (err) { + logger.debug('GetNodeInfo Error:', err) + const health = await checkHealth() + if (health.LNDStatus.success) { + res.status(400) + res.json({ + field: 'getNodeInfo', + errorMessage: sanitizeLNDError(err.message) + }) + } else { + res.status(500) + res.json({ errorMessage: 'LND is down' }) + } + } + logger.debug('GetNodeInfo:', response) + res.json(response) + } + ) + }) + // get lnd chan info + app.post('/api/lnd/getchaninfo', async (req, res) => { + try { + return res.json(await LV2.getChanInfo(req.body.chan_id)) + } catch (e) { + logger.error(e) + return res.status(500).json({ + errorMessage: e.message + }) + } + }) + + app.get('/api/lnd/getnetworkinfo', (req, res) => { + const { lightning } = LightningServices.services + lightning.getNetworkInfo({}, async (err, response) => { + if (err) { + logger.debug('GetNetworkInfo Error:', err) + const health = await checkHealth() + if (health.LNDStatus.success) { + res.status(400).json({ field: 'getNodeInfo', errorMessage: sanitizeLNDError(err.message) }) @@ -1119,432 +959,412 @@ module.exports = async ( res.json({ errorMessage: 'LND is down' }) } } - logger.debug('GetNodeInfo:', response) + logger.debug('GetNetworkInfo:', response) res.json(response) - } - ) - }) - // get lnd chan info - app.post('/api/lnd/getchaninfo', async (req, res) => { - try { - return res.json(await LV2.getChanInfo(req.body.chan_id)) - } catch (e) { - console.log(e) - return res.status(500).json({ - errorMessage: e.message }) - } - }) + }) - app.get('/api/lnd/getnetworkinfo', (req, res) => { - const { lightning } = LightningServices.services - lightning.getNetworkInfo({}, async (err, response) => { - if (err) { - logger.debug('GetNetworkInfo Error:', err) - const health = await checkHealth() - if (health.LNDStatus.success) { - res.status(400).json({ - field: 'getNodeInfo', + // get lnd node active channels list + app.get('/api/lnd/listpeers', async (req, res) => { + try { + return res.json({ + peers: await LV2.listPeers(req.body.latestError) + }) + } catch (e) { + logger.error(e) + return res.status(500).json({ + errorMessage: e.message + }) + } + }) + + // newaddress + app.post('/api/lnd/newaddress', async (req, res) => { + try { + return res.json({ + address: await LV2.newAddress(req.body.type) + }) + } catch (e) { + return res.status(500).json({ + errorMessage: e.message + }) + } + }) + + // connect peer to lnd node + app.post('/api/lnd/connectpeer', (req, res) => { + const { lightning } = LightningServices.services + const connectRequest = { + addr: { pubkey: req.body.pubkey, host: req.body.host }, + perm: true + } + logger.debug('ConnectPeer Request:', connectRequest) + lightning.connectPeer(connectRequest, (err, response) => { + if (err) { + logger.debug('ConnectPeer Error:', err) + res.status(500).json({ + field: 'connectPeer', errorMessage: sanitizeLNDError(err.message) }) } else { - res.status(500) - res.json({ errorMessage: 'LND is down' }) + logger.debug('ConnectPeer:', response) + res.json(response) } - } - logger.debug('GetNetworkInfo:', response) - res.json(response) + }) }) - }) - // get lnd node active channels list - app.get('/api/lnd/listpeers', async (req, res) => { - try { - return res.json({ - peers: await LV2.listPeers(req.body.latestError) + // disconnect peer from lnd node + app.post('/api/lnd/disconnectpeer', (req, res) => { + const { lightning } = LightningServices.services + const disconnectRequest = { pub_key: req.body.pubkey } + logger.debug('DisconnectPeer Request:', disconnectRequest) + lightning.disconnectPeer(disconnectRequest, (err, response) => { + if (err) { + logger.debug('DisconnectPeer Error:', err) + res.status(400).json({ + field: 'disconnectPeer', + errorMessage: sanitizeLNDError(err.message) + }) + } else { + logger.debug('DisconnectPeer:', response) + res.json(response) + } }) - } catch (e) { - console.log(e) - return res.status(500).json({ - errorMessage: e.message - }) - } - }) + }) - // newaddress - app.post('/api/lnd/newaddress', async (req, res) => { - try { - return res.json({ - address: await LV2.newAddress(req.body.type) - }) - } catch (e) { - return res.status(500).json({ - errorMessage: e.message - }) - } - }) - - // connect peer to lnd node - app.post('/api/lnd/connectpeer', (req, res) => { - const { lightning } = LightningServices.services - const connectRequest = { - addr: { pubkey: req.body.pubkey, host: req.body.host }, - perm: true - } - logger.debug('ConnectPeer Request:', connectRequest) - lightning.connectPeer(connectRequest, (err, response) => { - if (err) { - logger.debug('ConnectPeer Error:', err) - res.status(500).json({ - field: 'connectPeer', - errorMessage: sanitizeLNDError(err.message) + // get lnd node opened channels list + app.get('/api/lnd/listchannels', async (_, res) => { + try { + return res.json({ + channels: await LV2.listChannels({ active_only: false }) }) - } else { - logger.debug('ConnectPeer:', response) - res.json(response) - } - }) - }) - - // disconnect peer from lnd node - app.post('/api/lnd/disconnectpeer', (req, res) => { - const { lightning } = LightningServices.services - const disconnectRequest = { pub_key: req.body.pubkey } - logger.debug('DisconnectPeer Request:', disconnectRequest) - lightning.disconnectPeer(disconnectRequest, (err, response) => { - if (err) { - logger.debug('DisconnectPeer Error:', err) - res.status(400).json({ - field: 'disconnectPeer', - errorMessage: sanitizeLNDError(err.message) + } catch (e) { + logger.error(e) + return res.status(500).json({ + errorMessage: e.message }) - } else { - logger.debug('DisconnectPeer:', response) - res.json(response) } }) - }) - // get lnd node opened channels list - app.get('/api/lnd/listchannels', async (_, res) => { - try { - return res.json({ - channels: await LV2.listChannels({ active_only: false }) - }) - } catch (e) { - console.log(e) - return res.status(500).json({ - errorMessage: e.message - }) - } - }) - - app.get('/api/lnd/pendingchannels', async (req, res) => { - try { - return res.json(await LV2.pendingChannels()) - } catch (e) { - console.log(e) - return res.status(500).json({ - errorMessage: e.message - }) - } - }) - - app.get('/api/lnd/unifiedTrx', (req, res) => { - const { lightning } = LightningServices.services - const { itemsPerPage, page, reversed = true } = req.query - const offset = (page - 1) * itemsPerPage - lightning.listPayments({}, (err, { payments = [] } = {}) => { - if (err) { - return handleError(res, err) + app.get('/api/lnd/pendingchannels', async (req, res) => { + try { + return res.json(await LV2.pendingChannels()) + } catch (e) { + logger.error(e) + return res.status(500).json({ + errorMessage: e.message + }) } + }) - lightning.listInvoices( - { reversed, index_offset: offset, num_max_invoices: itemsPerPage }, - (err, { invoices, last_index_offset }) => { - if (err) { - return handleError(res, err) - } + app.get('/api/lnd/unifiedTrx', (req, res) => { + const { lightning } = LightningServices.services + const { itemsPerPage, page, reversed = true } = req.query + if (typeof itemsPerPage !== 'number') { + throw new TypeError('itemsPerPage not a number') + } + if (typeof page !== 'number') { + throw new TypeError('page not a number') + } + const offset = (page - 1) * itemsPerPage + lightning.listPayments({}, (err, { payments = [] } = {}) => { + if (err) { + return handleError(res, err) + } - lightning.getTransactions({}, (err, { transactions = [] } = {}) => { + lightning.listInvoices( + { reversed, index_offset: offset, num_max_invoices: itemsPerPage }, + (err, { invoices, last_index_offset }) => { if (err) { return handleError(res, err) } - res.json({ - transactions: getListPage({ - entries: transactions.reverse(), - itemsPerPage, - page - }), - payments: getListPage({ - entries: payments.reverse(), - itemsPerPage, - page - }), - invoices: { - content: invoices.filter(invoice => invoice.settled), - page, - totalPages: Math.ceil(last_index_offset / itemsPerPage), - totalItems: last_index_offset + lightning.getTransactions({}, (err, { transactions = [] } = {}) => { + if (err) { + return handleError(res, err) } + + res.json({ + transactions: getListPage({ + entries: transactions.reverse(), + itemsPerPage, + page + }), + payments: getListPage({ + entries: payments.reverse(), + itemsPerPage, + page + }), + invoices: { + content: invoices.filter(invoice => invoice.settled), + page, + totalPages: Math.ceil(last_index_offset / itemsPerPage), + totalItems: last_index_offset + } + }) }) + } + ) + }) + }) + + app.post('/api/lnd/unifiedTrx', async (req, res) => { + try { + const { type, amt, to, memo, feeLimit, ackInfo } = req.body + if ( + type !== 'spontaneousPayment' && + type !== 'tip' && + type !== 'torrentSeed' && + type !== 'contentReveal' && + type !== 'service' && + type !== 'product' && + type !== 'other' + ) { + return res.status(415).json({ + field: 'type', + errorMessage: `Only 'spontaneousPayment'| 'tip' | 'torrentSeed' | 'contentReveal' | 'service' | 'product' |'other' payments supported via this endpoint for now.` }) } + + const amount = Number(amt) + + if (!isARealUsableNumber(amount)) { + return res.status(400).json({ + field: 'amt', + errorMessage: 'Not an usable number' + }) + } + + if (amount < 1) { + return res.status(400).json({ + field: 'amt', + errorMessage: 'Must be 1 or greater.' + }) + } + + if (!isARealUsableNumber(feeLimit)) { + return res.status(400).json({ + field: 'feeLimit', + errorMessage: 'Not an usable number' + }) + } + + if (feeLimit < 1) { + return res.status(400).json({ + field: 'feeLimit', + errorMessage: 'Must be 1 or greater.' + }) + } + + if (type === 'tip' && typeof ackInfo !== 'string') { + return res.status(400).json({ + field: 'ackInfo', + errorMessage: `Send ackInfo` + }) + } + + return res.status(200).json( + await GunActions.sendSpontaneousPayment(to, amt, memo, feeLimit, { + type, + ackInfo + }) + ) + } catch (e) { + return res.status(500).json({ + errorMessage: e.message + }) + } + }) + + // get lnd node payments list + app.get('/api/lnd/listpayments', (req, res) => { + const { lightning } = LightningServices.services + const { itemsPerPage, page, paginate = true } = req.query + if (typeof itemsPerPage !== 'number') { + throw new TypeError('itemsPerPage not a number') + } + if (typeof page !== 'number') { + throw new TypeError('page not a number') + } + lightning.listPayments( + { + // TODO + include_incomplete: !!req.include_incomplete + }, + (err, { payments = [] } = {}) => { + if (err) { + logger.debug('ListPayments Error:', err) + handleError(res, err) + } else { + logger.debug('ListPayments:', payments) + if (paginate) { + res.json(getListPage({ entries: payments, itemsPerPage, page })) + } else { + res.json({ payments }) + } + } + } ) }) - }) - app.post('/api/lnd/unifiedTrx', async (req, res) => { - try { - const { type, amt, to, memo, feeLimit, ackInfo } = req.body - if ( - type !== 'spontaneousPayment' && - type !== 'tip' && - type !== 'torrentSeed' && - type !== 'streamSeed' && - type !== 'contentReveal' && - type !== 'service' && - type !== 'product' && - type !== 'other' - ) { - return res.status(415).json({ - field: 'type', - errorMessage: `Only 'spontaneousPayment'| 'tip' | 'torrentSeed' | 'contentReveal' | 'service' | 'streamSeed' | 'product' |'other' payments supported via this endpoint for now.` - }) - } - - const amount = Number(amt) - - if (!isARealUsableNumber(amount)) { - return res.status(400).json({ - field: 'amt', - errorMessage: 'Not an usable number' - }) - } - - if (amount < 1) { - return res.status(400).json({ - field: 'amt', - errorMessage: 'Must be 1 or greater.' - }) - } - - if (!isARealUsableNumber(feeLimit)) { - return res.status(400).json({ - field: 'feeLimit', - errorMessage: 'Not an usable number' - }) - } - - if (feeLimit < 1) { - return res.status(400).json({ - field: 'feeLimit', - errorMessage: 'Must be 1 or greater.' - }) - } - - if (type === 'tip' && typeof ackInfo !== 'string') { - return res.status(400).json({ - field: 'ackInfo', - errorMessage: `Send ackInfo` - }) - } - - return res.status(200).json( - await GunActions.sendSpontaneousPayment(to, amt, memo, feeLimit, { - type, - ackInfo - }) - ) - } catch (e) { - return res.status(500).json({ - errorMessage: e.message - }) - } - }) - - // get lnd node payments list - app.get('/api/lnd/listpayments', (req, res) => { - const { lightning } = LightningServices.services - const { itemsPerPage, page, paginate = true } = req.query - lightning.listPayments( - { - include_incomplete: !!req.include_incomplete - }, - (err, { payments = [] } = {}) => { - if (err) { - logger.debug('ListPayments Error:', err) - handleError(res, err) - } else { - logger.debug('ListPayments:', payments) - if (paginate) { - res.json(getListPage({ entries: payments, itemsPerPage, page })) - } else { - res.json({ payments }) - } - } - } - ) - }) - - app.get('/api/lnd/payments', async (req, res) => { - const { - include_incomplete, - index_offset, - max_payments, - reversed - } = /** @type {Common.APISchema.ListPaymentsRequest} */ (evolve( - { - include_incomplete: x => x === 'true', - index_offset: x => Number(x), - max_payments: x => Number(x), - reversed: x => x === 'true' - }, - req.query - )) - - if (typeof include_incomplete !== 'boolean') { - return res.status(400).json({ - field: 'include_incomplete', - errorMessage: 'include_incomplete not a boolean' - }) - } - - if (!isARealUsableNumber(index_offset)) { - return res.status(400).json({ - field: 'index_offset', - errorMessage: 'index_offset not a number' - }) - } - - if (!isARealUsableNumber(max_payments)) { - return res.status(400).json({ - field: 'max_payments', - errorMessage: 'max_payments not a number' - }) - } - - if (typeof reversed !== 'boolean') { - return res.status(400).json({ - field: 'reversed', - errorMessage: 'reversed not a boolean' - }) - } - - return res.status(200).json( - await LV2.listPayments({ + app.get('/api/lnd/payments', async (req, res) => { + const { include_incomplete, index_offset, max_payments, reversed - }) - ) - }) + } = /** @type {Common.APISchema.ListPaymentsRequest} */ (evolve( + { + include_incomplete: x => x === 'true', + index_offset: x => Number(x), + max_payments: x => Number(x), + reversed: x => x === 'true' + }, + // TODO Validate + /** @type {any} */ (req.query) + )) - // get lnd node invoices list - app.get('/api/lnd/listinvoices', (req, res) => { - const { lightning } = LightningServices.services - const { page, itemsPerPage, reversed = true } = req.query - const offset = (page - 1) * itemsPerPage - // const limit = page * itemsPerPage; - lightning.listInvoices( - { reversed, index_offset: offset, num_max_invoices: itemsPerPage }, - async (err, { invoices, last_index_offset } = {}) => { + if (typeof include_incomplete !== 'boolean') { + return res.status(400).json({ + field: 'include_incomplete', + errorMessage: 'include_incomplete not a boolean' + }) + } + + if (!isARealUsableNumber(index_offset)) { + return res.status(400).json({ + field: 'index_offset', + errorMessage: 'index_offset not a number' + }) + } + + if (!isARealUsableNumber(max_payments)) { + return res.status(400).json({ + field: 'max_payments', + errorMessage: 'max_payments not a number' + }) + } + + if (typeof reversed !== 'boolean') { + return res.status(400).json({ + field: 'reversed', + errorMessage: 'reversed not a boolean' + }) + } + + return res.status(200).json( + await LV2.listPayments({ + include_incomplete, + index_offset, + max_payments, + reversed + }) + ) + }) + + // get lnd node invoices list + app.get('/api/lnd/listinvoices', (req, res) => { + const { lightning } = LightningServices.services + const { page, itemsPerPage, reversed = true } = req.query + if (typeof itemsPerPage !== 'number') { + throw new TypeError('itemsPerPage not a number') + } + if (typeof page !== 'number') { + throw new TypeError('page not a number') + } + const offset = (page - 1) * itemsPerPage + // const limit = page * itemsPerPage; + lightning.listInvoices( + { reversed, index_offset: offset, num_max_invoices: itemsPerPage }, + async ( + err, + { invoices, last_index_offset } = { + invoices: [], + last_index_offset: 1 + } + ) => { + if (err) { + logger.debug('ListInvoices Error:', err) + const health = await checkHealth() + if (health.LNDStatus.success) { + res.status(400).json({ + errorMessage: sanitizeLNDError(err.message), + success: false + }) + } else { + res.status(500) + res.json({ + errorMessage: health.LNDStatus.message, + success: false + }) + } + } else { + // logger.debug("ListInvoices:", response); + res.json({ + content: invoices, + page, + totalPages: Math.ceil(last_index_offset / itemsPerPage), + success: true + }) + } + } + ) + }) + + // get lnd node forwarding history + app.get('/api/lnd/forwardinghistory', (req, res) => { + const { lightning } = LightningServices.services + lightning.forwardingHistory({}, async (err, response) => { if (err) { - logger.debug('ListInvoices Error:', err) + logger.debug('ForwardingHistory Error:', err) const health = await checkHealth() if (health.LNDStatus.success) { res.status(400).json({ - errorMessage: sanitizeLNDError(err.message), - success: false + field: 'forwardingHistory', + errorMessage: sanitizeLNDError(err.message) }) } else { res.status(500) - res.json({ errorMessage: health.LNDStatus.message, success: false }) + res.json({ errorMessage: 'LND is down' }) } - } else { - // logger.debug("ListInvoices:", response); - res.json({ - content: invoices, - page, - totalPages: Math.ceil(last_index_offset / itemsPerPage), - success: true - }) } - } - ) - }) - - // get lnd node forwarding history - app.get('/api/lnd/forwardinghistory', (req, res) => { - const { lightning } = LightningServices.services - lightning.forwardingHistory({}, async (err, response) => { - if (err) { - logger.debug('ForwardingHistory Error:', err) - const health = await checkHealth() - if (health.LNDStatus.success) { - res.status(400).json({ - field: 'forwardingHistory', - errorMessage: sanitizeLNDError(err.message) - }) - } else { - res.status(500) - res.json({ errorMessage: 'LND is down' }) - } - } - logger.debug('ForwardingHistory:', response) - res.json(response) + logger.debug('ForwardingHistory:', response) + res.json(response) + }) }) - }) - // get the lnd node wallet balance - app.get('/api/lnd/walletbalance', (req, res) => { - const { lightning } = LightningServices.services - lightning.walletBalance({}, async (err, response) => { - if (err) { - logger.debug('WalletBalance Error:', err) - const health = await checkHealth() - if (health.LNDStatus.success) { - res.status(400).json({ - field: 'walletBalance', - errorMessage: sanitizeLNDError(err.message) - }) - } else { - res.status(500) - res.json({ errorMessage: 'LND is down' }) - } - } - logger.debug('WalletBalance:', response) - res.json(response) - }) - }) - - // get the lnd node wallet balance and channel balance - app.get('/api/lnd/balance', async (req, res) => { - const { lightning } = LightningServices.services - const health = await checkHealth() - lightning.walletBalance({}, (err, walletBalance) => { - if (err) { - logger.debug('WalletBalance Error:', err) - if (health.LNDStatus.success) { - res.status(400).json({ - field: 'walletBalance', - errorMessage: sanitizeLNDError(err.message) - }) - } else { - res.status(500) - res.json(health.LNDStatus) - } - return err - } - - lightning.channelBalance({}, (err, channelBalance) => { + // get the lnd node wallet balance + app.get('/api/lnd/walletbalance', (req, res) => { + const { lightning } = LightningServices.services + lightning.walletBalance({}, async (err, response) => { if (err) { - logger.debug('ChannelBalance Error:', err) + logger.debug('WalletBalance Error:', err) + const health = await checkHealth() if (health.LNDStatus.success) { res.status(400).json({ - field: 'channelBalance', + field: 'walletBalance', + errorMessage: sanitizeLNDError(err.message) + }) + } else { + res.status(500) + res.json({ errorMessage: 'LND is down' }) + } + } + logger.debug('WalletBalance:', response) + res.json(response) + }) + }) + + // get the lnd node wallet balance and channel balance + app.get('/api/lnd/balance', async (req, res) => { + const { lightning } = LightningServices.services + const health = await checkHealth() + lightning.walletBalance({}, (err, walletBalance) => { + if (err) { + logger.debug('WalletBalance Error:', err) + if (health.LNDStatus.success) { + res.status(400).json({ + field: 'walletBalance', errorMessage: sanitizeLNDError(err.message) }) } else { @@ -1554,395 +1374,397 @@ module.exports = async ( return err } - logger.debug('ChannelBalance:', channelBalance) - res.json({ - ...walletBalance, - channel_balance: channelBalance.balance, - pending_channel_balance: channelBalance.pending_open_balance + lightning.channelBalance({}, (err, channelBalance) => { + if (err) { + logger.debug('ChannelBalance Error:', err) + if (health.LNDStatus.success) { + res.status(400).json({ + field: 'channelBalance', + errorMessage: sanitizeLNDError(err.message) + }) + } else { + res.status(500) + res.json(health.LNDStatus) + } + return err + } + + logger.debug('ChannelBalance:', channelBalance) + res.json({ + ...walletBalance, + channel_balance: channelBalance.balance, + pending_channel_balance: channelBalance.pending_open_balance + }) }) }) }) - }) - app.post('/api/lnd/decodePayReq', (req, res) => { - const { lightning } = LightningServices.services - const { payReq } = req.body - lightning.decodePayReq({ pay_req: payReq }, async (err, paymentRequest) => { - if (err) { - logger.debug('DecodePayReq Error:', err) - const health = await checkHealth() - if (health.LNDStatus.success) { - res.status(500).json({ - errorMessage: sanitizeLNDError(err.message) - }) - } else { - res.status(500).json({ errorMessage: 'LND is down' }) + app.post('/api/lnd/decodePayReq', (req, res) => { + const { lightning } = LightningServices.services + const { payReq } = req.body + lightning.decodePayReq( + { pay_req: payReq }, + async (err, paymentRequest) => { + if (err) { + logger.debug('DecodePayReq Error:', err) + const health = await checkHealth() + if (health.LNDStatus.success) { + res.status(500).json({ + errorMessage: sanitizeLNDError(err.message) + }) + } else { + res.status(500).json({ errorMessage: 'LND is down' }) + } + } else { + logger.info('DecodePayReq:', paymentRequest) + res.json({ + decodedRequest: paymentRequest + }) + } } - } else { - logger.info('DecodePayReq:', paymentRequest) - res.json({ - decodedRequest: paymentRequest - }) - } + ) }) - }) - app.get('/api/lnd/channelbalance', (req, res) => { - const { lightning } = LightningServices.services - lightning.channelBalance({}, async (err, response) => { - if (err) { - logger.debug('ChannelBalance Error:', err) - const health = await checkHealth() - if (health.LNDStatus.success) { - res.status(400).json({ - field: 'channelBalance', - errorMessage: sanitizeLNDError(err.message) - }) - } else { - res.status(500) - res.json({ errorMessage: 'LND is down' }) + app.get('/api/lnd/channelbalance', (req, res) => { + const { lightning } = LightningServices.services + lightning.channelBalance({}, async (err, response) => { + if (err) { + logger.debug('ChannelBalance Error:', err) + const health = await checkHealth() + if (health.LNDStatus.success) { + res.status(400).json({ + field: 'channelBalance', + errorMessage: sanitizeLNDError(err.message) + }) + } else { + res.status(500) + res.json({ errorMessage: 'LND is down' }) + } } - } - logger.debug('ChannelBalance:', response) - res.json(response) - }) - }) - - // openchannel - app.post('/api/lnd/openchannel', (req, res) => { - const { lightning } = LightningServices.services - - const { pubkey, channelCapacity, channelPushAmount, satPerByte } = req.body - - const openChannelRequest = { - node_pubkey: Buffer.from(pubkey, 'hex'), - local_funding_amount: channelCapacity, - push_sat: channelPushAmount === '' ? '0' : channelPushAmount, - sat_per_byte: satPerByte - } - logger.info('OpenChannelRequest', openChannelRequest) - let finalEvent = null //Object to send to the socket, depends on final event from the stream - const openedChannel = lightning.openChannel(openChannelRequest) - openedChannel.on('data', response => { - logger.debug('OpenChannelRequest:', response) - if (res.headersSent) { - //if res was already sent - if (response.update === 'chan_open') { - finalEvent = { status: 'chan_open' } - } - } else { + logger.debug('ChannelBalance:', response) res.json(response) - } + }) }) - openedChannel.on('error', async err => { - logger.info('OpenChannelRequest Error:', err) - if (res.headersSent) { - finalEvent = { error: err.details } //send error on socket if http has already finished - } else { - const health = await checkHealth() - if (health.LNDStatus.success) { - res.status(500).json({ - field: 'openChannelRequest', - errorMessage: sanitizeLNDError(err.details) - }) - } else if (!res.headersSent) { - res.status(500) - res.json({ errorMessage: 'LND is down' }) - } - } - }) - openedChannel.on('end', () => { - if (finalEvent !== null) { - //send the last event got from the stream - //TO DO send finalEvent on socket - } - }) - }) - // closechannel - app.post('/api/lnd/closechannel', (req, res) => { - const { lightning } = LightningServices.services - const { channelPoint, outputIndex, force, satPerByte } = req.body - const closeChannelRequest = { - channel_point: { - funding_txid_bytes: Buffer.from(channelPoint, 'hex'), - funding_txid_str: channelPoint, - output_index: outputIndex, + // openchannel + app.post('/api/lnd/openchannel', (req, res) => { + const { lightning } = LightningServices.services + + const { + pubkey, + channelCapacity, + channelPushAmount, + satPerByte + } = req.body + + const openChannelRequest = { + node_pubkey: Buffer.from(pubkey, 'hex'), + local_funding_amount: channelCapacity, + push_sat: channelPushAmount === '' ? '0' : channelPushAmount, sat_per_byte: satPerByte - }, - force - } - logger.info('CloseChannelRequest', closeChannelRequest) - const closedChannel = lightning.closeChannel(closeChannelRequest) - - closedChannel.on('data', response => { - if (!res.headersSent) { - logger.info('CloseChannelRequest:', response) - res.json(response) } - }) - - closedChannel.on('error', async err => { - logger.error('CloseChannelRequest Error:', err) - const health = await checkHealth() - if (!res.headersSent) { - if (health.LNDStatus.success) { - logger.debug('CloseChannelRequest Error:', err) - res.status(400).json({ - field: 'closeChannel', - errorMessage: sanitizeLNDError(err.message) - }) + logger.info('OpenChannelRequest', openChannelRequest) + let finalEvent = null //Object to send to the socket, depends on final event from the stream + const openedChannel = lightning.openChannel(openChannelRequest) + openedChannel.on('data', response => { + logger.debug('OpenChannelRequest:', response) + if (res.headersSent) { + //if res was already sent + if (response.update === 'chan_open') { + finalEvent = { status: 'chan_open' } + } } else { - res.status(500) - res.json({ errorMessage: 'LND is down' }) + res.json(response) } - } - }) - }) - - // sendpayment - app.post('/api/lnd/sendpayment', async (req, res) => { - // this is the recommended value from lightning labs - const { keysend, maxParts = 3, timeoutSeconds = 5, feeLimit } = req.body - - if (!feeLimit) { - return res.status(400).json({ - errorMessage: 'please provide a "feeLimit" to the send payment request' }) - } - - try { - if (keysend) { - const { dest, amt, finalCltvDelta = 40 } = req.body - if (!dest || !amt) { - return res.status(400).json({ - errorMessage: 'please provide "dest" and "amt" for keysend payments' - }) + openedChannel.on('error', async err => { + logger.info('OpenChannelRequest Error:', err) + if (res.headersSent) { + finalEvent = { error: err.details } //send error on socket if http has already finished + } else { + const health = await checkHealth() + if (health.LNDStatus.success) { + res.status(500).json({ + field: 'openChannelRequest', + errorMessage: sanitizeLNDError(err.details) + }) + } else if (!res.headersSent) { + res.status(500) + res.json({ errorMessage: 'LND is down' }) + } } + }) + openedChannel.on('end', () => { + if (finalEvent !== null) { + //send the last event got from the stream + //TO DO send finalEvent on socket + } + }) + }) - const payment = await LV2.sendPaymentV2Keysend({ - amt, - dest, + // closechannel + app.post('/api/lnd/closechannel', (req, res) => { + const { lightning } = LightningServices.services + const { channelPoint, outputIndex, force, satPerByte } = req.body + const closeChannelRequest = { + channel_point: { + funding_txid_bytes: Buffer.from(channelPoint, 'hex'), + funding_txid_str: channelPoint, + output_index: outputIndex, + sat_per_byte: satPerByte + }, + force + } + logger.info('CloseChannelRequest', closeChannelRequest) + const closedChannel = lightning.closeChannel(closeChannelRequest) + + closedChannel.on('data', response => { + if (!res.headersSent) { + logger.info('CloseChannelRequest:', response) + res.json(response) + } + }) + + closedChannel.on('error', async err => { + logger.error('CloseChannelRequest Error:', err) + const health = await checkHealth() + if (!res.headersSent) { + if (health.LNDStatus.success) { + logger.debug('CloseChannelRequest Error:', err) + res.status(400).json({ + field: 'closeChannel', + errorMessage: sanitizeLNDError(err.message) + }) + } else { + res.status(500) + res.json({ errorMessage: 'LND is down' }) + } + } + }) + }) + + // sendpayment + app.post('/api/lnd/sendpayment', async (req, res) => { + // this is the recommended value from lightning labs + const { keysend, maxParts = 3, timeoutSeconds = 5, feeLimit } = req.body + + if (!feeLimit) { + return res.status(400).json({ + errorMessage: + 'please provide a "feeLimit" to the send payment request' + }) + } + + try { + if (keysend) { + const { dest, amt, finalCltvDelta = 40 } = req.body + if (!dest || !amt) { + return res.status(400).json({ + errorMessage: + 'please provide "dest" and "amt" for keysend payments' + }) + } + + const payment = await LV2.sendPaymentV2Keysend({ + amt, + dest, + feeLimit, + finalCltvDelta, + maxParts, + timeoutSeconds + }) + + return res.status(200).json(payment) + } + const { payreq } = req.body + + const payment = await LV2.sendPaymentV2Invoice({ feeLimit, - finalCltvDelta, - maxParts, + payment_request: payreq, + amt: req.body.amt, + max_parts: maxParts, timeoutSeconds }) return res.status(200).json(payment) - } - const { payreq } = req.body + } catch (e) { + let msg = 'Unknown Error' - const payment = await LV2.sendPaymentV2Invoice({ - feeLimit, - payment_request: payreq, - amt: req.body.amt, - max_parts: maxParts, - timeoutSeconds + if (e.message) msg = e.message + + logger.error(e) + return res.status(500).json({ errorMessage: msg }) + } + }) + + app.post('/api/lnd/trackpayment', (req, res) => { + const { router } = LightningServices.services + const { paymentHash, inflightUpdates = true } = req.body + + logger.info('Tracking payment payment', { paymentHash, inflightUpdates }) + const trackedPayment = router.trackPaymentV2({ + payment_hash: paymentHash, + no_inflight_updates: !inflightUpdates }) - return res.status(200).json(payment) - } catch (e) { - let msg = 'Unknown Error' - - if (e.message) msg = e.message - - logger.error(e) - return res.status(500).json({ errorMessage: msg }) - } - }) - - app.post('/api/lnd/trackpayment', (req, res) => { - const { router } = LightningServices.services - const { paymentHash, inflightUpdates = true } = req.body - - logger.info('Tracking payment payment', { paymentHash, inflightUpdates }) - const trackedPayment = router.trackPaymentV2({ - payment_hash: paymentHash, - no_inflight_updates: !inflightUpdates - }) - - // only emits one event - trackedPayment.on('data', response => { - if (response.payment_error) { - logger.error('TrackPayment Info:', response) - return res.status(500).json({ - errorMessage: response.payment_error - }) - } - - logger.info('TrackPayment Data:', response) - return res.json(response) - }) - - trackedPayment.on('status', status => { - logger.info('TrackPayment Status:', status) - }) - - trackedPayment.on('error', async err => { - logger.error('TrackPayment Error:', err) - const health = await checkHealth() - if (health.LNDStatus.success) { - res.status(500).json({ - errorMessage: sanitizeLNDError(err.message) - }) - } else { - res.status(500) - res.json({ errorMessage: 'LND is down' }) - } - }) - }) - - app.post('/api/lnd/sendtoroute', (req, res) => { - const { router } = LightningServices.services - const { paymentHash, route } = req.body - - router.sendToRoute({ payment_hash: paymentHash, route }, (err, data) => { - if (err) { - logger.error('SendToRoute Error:', err) - return res.status(400).json(err) - } - - return res.json(data) - }) - }) - - app.post('/api/lnd/estimateroutefee', (req, res) => { - const { router } = LightningServices.services - const { dest, amount } = req.body - - router.estimateRouteFee({ dest, amt_sat: amount }, (err, data) => { - if (err) { - logger.error('EstimateRouteFee Error:', err) - return res.status(400).json(err) - } - - return res.json(data) - }) - }) - - // addinvoice - app.post('/api/lnd/addinvoice', async (req, res) => { - const { expiry, value, memo } = req.body - const addInvoiceRes = await LV2.addInvoice(value, memo, true, expiry) - - if (value) { - const channelsList = await LV2.listChannels({ active_only: true }) - let remoteBalance = Big(0) - channelsList.forEach(element => { - const remB = Big(element.remote_balance) - if (remB.gt(remoteBalance)) { - remoteBalance = remB + // only emits one event + trackedPayment.on('data', response => { + if (response.payment_error) { + logger.error('TrackPayment Info:', response) + return res.status(500).json({ + errorMessage: response.payment_error + }) } + + logger.info('TrackPayment Data:', response) + return res.json(response) }) - addInvoiceRes.liquidityCheck = remoteBalance > value - //newInvoice.remoteBalance = remoteBalance - } - - try { - return res.json(addInvoiceRes) - } catch (e) { - console.log(e) - return res.status(500).json({ - errorMessage: e.message + trackedPayment.on('status', status => { + logger.info('TrackPayment Status:', status) }) - } - }) - // signmessage - app.post('/api/lnd/signmessage', (req, res) => { - const { lightning } = LightningServices.services - lightning.signMessage( - { msg: Buffer.from(req.body.msg, 'utf8') }, - async (err, response) => { - if (err) { - logger.debug('SignMessage Error:', err) - const health = await checkHealth() - if (health.LNDStatus.success) { - res.status(400).json({ - field: 'signMessage', - errorMessage: sanitizeLNDError(err.message) - }) - } else { - res.status(500) - res.json({ errorMessage: 'LND is down' }) - } - } - logger.debug('SignMessage:', response) - res.json(response) - } - ) - }) - - // verifymessage - app.post('/api/lnd/verifymessage', (req, res) => { - const { lightning } = LightningServices.services - lightning.verifyMessage( - { msg: Buffer.from(req.body.msg, 'utf8'), signature: req.body.signature }, - async (err, response) => { - if (err) { - logger.debug('VerifyMessage Error:', err) - const health = await checkHealth() - if (health.LNDStatus.success) { - res.status(400).json({ - field: 'verifyMessage', - errorMessage: sanitizeLNDError(err.message) - }) - } else { - res.status(500) - res.json({ errorMessage: 'LND is down' }) - } - } - logger.debug('VerifyMessage:', response) - res.json(response) - } - ) - }) - - // sendcoins - app.post('/api/lnd/sendcoins', (req, res) => { - const { lightning } = LightningServices.services - const sendCoinsRequest = { - addr: req.body.addr, - amount: req.body.amount, - sat_per_byte: req.body.satPerByte, - send_all: req.body.send_all === true - } - logger.debug('SendCoins', sendCoinsRequest) - lightning.sendCoins(sendCoinsRequest, async (err, response) => { - if (err) { - logger.debug('SendCoins Error:', err) + trackedPayment.on('error', async err => { + logger.error('TrackPayment Error:', err) const health = await checkHealth() if (health.LNDStatus.success) { - res.status(400).json({ - field: 'sendCoins', + res.status(500).json({ errorMessage: sanitizeLNDError(err.message) }) } else { res.status(500) res.json({ errorMessage: 'LND is down' }) } - } - logger.debug('SendCoins:', response) - res.json(response) + }) }) - }) - // queryroute - app.post('/api/lnd/queryroute', (req, res) => { - const { lightning } = LightningServices.services - const numRoutes = - config.maxNumRoutesToQuery || DEFAULT_MAX_NUM_ROUTES_TO_QUERY - lightning.queryRoutes( - { pub_key: req.body.pubkey, amt: req.body.amt, num_routes: numRoutes }, - async (err, response) => { + app.post('/api/lnd/sendtoroute', (req, res) => { + const { router } = LightningServices.services + const { paymentHash, route } = req.body + + router.sendToRoute({ payment_hash: paymentHash, route }, (err, data) => { if (err) { - logger.debug('QueryRoute Error:', err) + logger.error('SendToRoute Error:', err) + return res.status(400).json(err) + } + + return res.json(data) + }) + }) + + app.post('/api/lnd/estimateroutefee', (req, res) => { + const { router } = LightningServices.services + const { dest, amount } = req.body + + router.estimateRouteFee({ dest, amt_sat: amount }, (err, data) => { + if (err) { + logger.error('EstimateRouteFee Error:', err) + return res.status(400).json(err) + } + + return res.json(data) + }) + }) + + // addinvoice + app.post('/api/lnd/addinvoice', async (req, res) => { + const { expiry, value, memo } = req.body + const addInvoiceRes = await LV2.addInvoice(value, memo, true, expiry) + + if (value) { + const channelsList = await LV2.listChannels({ active_only: true }) + let remoteBalance = Big(0) + channelsList.forEach(element => { + const remB = Big(element.remote_balance) + if (remB.gt(remoteBalance)) { + remoteBalance = remB + } + }) + + addInvoiceRes.liquidityCheck = remoteBalance > value + //newInvoice.remoteBalance = remoteBalance + } + + try { + return res.json(addInvoiceRes) + } catch (e) { + logger.error(e) + return res.status(500).json({ + errorMessage: e.message + }) + } + }) + + // signmessage + app.post('/api/lnd/signmessage', (req, res) => { + const { lightning } = LightningServices.services + lightning.signMessage( + { msg: Buffer.from(req.body.msg, 'utf8') }, + async (err, response) => { + if (err) { + logger.debug('SignMessage Error:', err) + const health = await checkHealth() + if (health.LNDStatus.success) { + res.status(400).json({ + field: 'signMessage', + errorMessage: sanitizeLNDError(err.message) + }) + } else { + res.status(500) + res.json({ errorMessage: 'LND is down' }) + } + } + logger.debug('SignMessage:', response) + res.json(response) + } + ) + }) + + // verifymessage + app.post('/api/lnd/verifymessage', (req, res) => { + const { lightning } = LightningServices.services + lightning.verifyMessage( + { + msg: Buffer.from(req.body.msg, 'utf8'), + signature: req.body.signature + }, + async (err, response) => { + if (err) { + logger.debug('VerifyMessage Error:', err) + const health = await checkHealth() + if (health.LNDStatus.success) { + res.status(400).json({ + field: 'verifyMessage', + errorMessage: sanitizeLNDError(err.message) + }) + } else { + res.status(500) + res.json({ errorMessage: 'LND is down' }) + } + } + logger.debug('VerifyMessage:', response) + res.json(response) + } + ) + }) + + // sendcoins + app.post('/api/lnd/sendcoins', (req, res) => { + const { lightning } = LightningServices.services + const sendCoinsRequest = { + addr: req.body.addr, + amount: req.body.amount, + sat_per_byte: req.body.satPerByte, + send_all: req.body.send_all === true + } + logger.debug('SendCoins', sendCoinsRequest) + lightning.sendCoins(sendCoinsRequest, async (err, response) => { + if (err) { + logger.debug('SendCoins Error:', err) const health = await checkHealth() if (health.LNDStatus.success) { res.status(400).json({ - field: 'queryRoute', + field: 'sendCoins', errorMessage: sanitizeLNDError(err.message) }) } else { @@ -1950,1121 +1772,440 @@ module.exports = async ( res.json({ errorMessage: 'LND is down' }) } } - logger.debug('QueryRoute:', response) + logger.debug('SendCoins:', response) res.json(response) - } - ) - }) - - app.post('/api/lnd/estimatefee', (req, res) => { - const { lightning } = LightningServices.services - const { amount, confirmationBlocks } = req.body - lightning.estimateFee( - { - AddrToAmount: { - tb1qnpq3vj8p6jymah6nnh6wz3p333tt360mq32dtt: amount - }, - target_conf: confirmationBlocks - }, - async (err, fee) => { - if (err) { - const health = await checkHealth() - if (health.LNDStatus.success) { - res.status(400).json({ - error: err.message - }) - } else { - res.status(500) - res.json({ errorMessage: 'LND is down' }) - } - } else { - logger.debug('EstimateFee:', fee) - res.json(fee) - } - } - ) - }) - - const listunspent = async (req, res) => { - try { - return res.status(200).json({ - utxos: await LV2.listUnspent( - req.body.minConfirmations, - req.body.maxConfirmations - ) }) - } catch (e) { - return res.status(500).json({ - errorMessage: e.message - }) - } - } - - app.get('/api/lnd/listunspent', listunspent) - - // TODO: should be GET - app.post('/api/lnd/listunspent', listunspent) - - app.get('/api/lnd/transactions', (req, res) => { - const { lightning } = LightningServices.services - const { page, paginate = true, itemsPerPage } = req.query - lightning.getTransactions({}, (err, { transactions = [] } = {}) => { - if (err) { - return handleError(res, err) - } - logger.debug('Transactions:', transactions) - if (paginate) { - res.json(getListPage({ entries: transactions, itemsPerPage, page })) - } else { - res.json({ transactions }) - } }) - }) - app.post('/api/lnd/sendmany', (req, res) => { - const { lightning } = LightningServices.services - const { addresses, satPerByte } = req.body - lightning.sendMany( - { AddrToAmount: addresses, sat_per_byte: satPerByte }, - (err, transactions) => { + // queryroute + app.post('/api/lnd/queryroute', (req, res) => { + const { lightning } = LightningServices.services + const numRoutes = + config.maxNumRoutesToQuery || DEFAULT_MAX_NUM_ROUTES_TO_QUERY + lightning.queryRoutes( + { pub_key: req.body.pubkey, amt: req.body.amt, num_routes: numRoutes }, + async (err, response) => { + if (err) { + logger.debug('QueryRoute Error:', err) + const health = await checkHealth() + if (health.LNDStatus.success) { + res.status(400).json({ + field: 'queryRoute', + errorMessage: sanitizeLNDError(err.message) + }) + } else { + res.status(500) + res.json({ errorMessage: 'LND is down' }) + } + } + logger.debug('QueryRoute:', response) + res.json(response) + } + ) + }) + + app.post('/api/lnd/estimatefee', (req, res) => { + const { lightning } = LightningServices.services + const { amount, confirmationBlocks } = req.body + lightning.estimateFee( + { + AddrToAmount: { + tb1qnpq3vj8p6jymah6nnh6wz3p333tt360mq32dtt: amount + }, + target_conf: confirmationBlocks + }, + async (err, fee) => { + if (err) { + const health = await checkHealth() + if (health.LNDStatus.success) { + res.status(400).json({ + error: err.message + }) + } else { + res.status(500) + res.json({ errorMessage: 'LND is down' }) + } + } else { + logger.debug('EstimateFee:', fee) + res.json(fee) + } + } + ) + }) + + const listunspent = async (req, res) => { + try { + return res.status(200).json({ + utxos: await LV2.listUnspent( + req.body.minConfirmations, + req.body.maxConfirmations + ) + }) + } catch (e) { + return res.status(500).json({ + errorMessage: e.message + }) + } + } + + app.get('/api/lnd/listunspent', listunspent) + + // TODO: should be GET + app.post('/api/lnd/listunspent', listunspent) + + app.get('/api/lnd/transactions', (req, res) => { + const { lightning } = LightningServices.services + const { page, paginate = true, itemsPerPage } = req.query + if (typeof page !== 'number') { + throw new TypeError('page is not a number') + } + if (typeof itemsPerPage !== 'number') { + throw new TypeError('itemsPerPage is not a number') + } + lightning.getTransactions({}, (err, { transactions = [] } = {}) => { if (err) { return handleError(res, err) } logger.debug('Transactions:', transactions) - res.json(transactions) - } - ) - }) - - app.get('/api/lnd/closedchannels', (req, res) => { - const { lightning } = LightningServices.services - const { closeTypeFilters = [] } = req.query - const lndFilters = closeTypeFilters.reduce( - (filters, filter) => ({ ...filters, [filter]: true }), - {} - ) - lightning.closedChannels(lndFilters, (err, channels) => { - if (err) { - return handleError(res, err) - } - logger.debug('Channels:', channels) - res.json(channels) + if (paginate) { + res.json(getListPage({ entries: transactions, itemsPerPage, page })) + } else { + res.json({ transactions }) + } + }) }) - }) - app.post('/api/lnd/exportchanbackup', (req, res) => { - const { lightning } = LightningServices.services - const { channelPoint } = req.body - lightning.exportChannelBackup( - { chan_point: { funding_txid_str: channelPoint } }, - (err, backup) => { + app.post('/api/lnd/sendmany', (req, res) => { + const { lightning } = LightningServices.services + const { addresses, satPerByte } = req.body + lightning.sendMany( + { AddrToAmount: addresses, sat_per_byte: satPerByte }, + (err, transactions) => { + if (err) { + return handleError(res, err) + } + logger.debug('Transactions:', transactions) + res.json(transactions) + } + ) + }) + + app.get('/api/lnd/closedchannels', (req, res) => { + const { lightning } = LightningServices.services + const { closeTypeFilters = [] } = req.query + if (!Array.isArray(closeTypeFilters)) { + throw new TypeError('closeTypeFilters not an Array') + } + // @ts-expect-error I dunno what's going on here, all arrays have reduce() + const lndFilters = closeTypeFilters.reduce( + (filters, filter) => ({ ...filters, [filter]: true }), + {} + ) + lightning.closedChannels(lndFilters, (err, channels) => { if (err) { return handleError(res, err) } - logger.debug('ExportChannelBackup:', backup) - res.json(backup) - } - ) - }) - - app.post('/api/lnd/exportallchanbackups', (req, res) => { - const { lightning } = LightningServices.services - lightning.exportAllChannelBackups({}, (err, channelBackups) => { - if (err) { - return handleError(res, err) - } - logger.debug('ExportAllChannelBackups:', channelBackups) - res.json(channelBackups) + logger.debug('Channels:', channels) + res.json(channels) + }) }) - }) - const GunEvent = Common.Constants.Event - const Key = require('../services/gunDB/contact-api/key') - app.get('/api/gun/lndchanbackups', async (req, res) => { - try { - const user = require('../services/gunDB/Mediator').getUser() - - const SEA = require('../services/gunDB/Mediator').mySEA - const mySecret = require('../services/gunDB/Mediator').getMySecret() - const encBackup = await timeout5(user.get(Key.CHANNELS_BACKUP).then()) - const backup = await SEA.decrypt(encBackup, mySecret) - logger.info(backup) - res.json({ data: backup }) - } catch (err) { - res.json({ ok: 'err' }) - } - }) - app.get('/api/gun/feedpoc', async (req, res) => { - try { - logger.warn('FEED POC') - const user = require('../services/gunDB/Mediator').getUser() - const feedObj = await timeout5(user.get('FEED_POC').then()) - logger.warn(feedObj) - - res.json({ data: feedObj }) - } catch (err) { - //res.json({ok:"err"}) - } - }) - - const Events = require('../services/gunDB/contact-api/events') - - app.get(`/api/gun/${GunEvent.ON_CHATS}`, (_, res) => { - try { - const data = Events.getChats() - const noAvatar = data.map(mex => { - return { ...mex, recipientAvatar: null } - }) - res.json({ - data: noAvatar - }) - } catch (err) { - logger.info('Error in Chats poll:') - logger.error(err) - res - .status(err.message === Common.Constants.ErrorCode.NOT_AUTH ? 401 : 500) - .json({ - errorMessage: typeof err === 'string' ? err : err.message - }) - } - }) - - app.get(`/api/gun/${GunEvent.ON_DISPLAY_NAME}`, async (_, res) => { - try { - const user = require('../services/gunDB/Mediator').getUser() - const data = await timeout5( - user - .get(Key.PROFILE) - .get(Key.DISPLAY_NAME) - .then() + app.post('/api/lnd/exportchanbackup', (req, res) => { + const { lightning } = LightningServices.services + const { channelPoint } = req.body + lightning.exportChannelBackup( + { chan_point: { funding_txid_str: channelPoint } }, + (err, backup) => { + if (err) { + return handleError(res, err) + } + logger.debug('ExportChannelBackup:', backup) + res.json(backup) + } ) - res.json({ - data - }) - } catch (err) { - logger.info('Error in Display Name poll:') - logger.error(err) - res - .status(err.message === Common.Constants.ErrorCode.NOT_AUTH ? 401 : 500) - .json({ - errorMessage: typeof err === 'string' ? err : err.message - }) - } - }) + }) - app.get(`/api/gun/${GunEvent.ON_HANDSHAKE_ADDRESS}`, async (_, res) => { - try { - const user = require('../services/gunDB/Mediator').getUser() - const data = await timeout5( - user.get(Key.CURRENT_HANDSHAKE_ADDRESS).then() - ) - res.json({ - data + app.post('/api/lnd/exportallchanbackups', (req, res) => { + const { lightning } = LightningServices.services + lightning.exportAllChannelBackups({}, (err, channelBackups) => { + if (err) { + return handleError(res, err) + } + logger.debug('ExportAllChannelBackups:', channelBackups) + res.json(channelBackups) }) - } catch (err) { - logger.info('Error in Handshake Address poll:') - logger.error(err) - res - .status(err.message === Common.Constants.ErrorCode.NOT_AUTH ? 401 : 500) - .json({ - errorMessage: typeof err === 'string' ? err : err.message - }) - } - }) + }) - app.get(`/api/gun/${GunEvent.ON_BIO}`, async (_, res) => { - try { - const user = require('../services/gunDB/Mediator').getUser() - const data = await timeout5(user.get(Key.BIO).then()) - logger.debug(data) - res.json({ - data - }) - } catch (err) { - logger.info('Error in BIO poll:') - logger.error(err) - res - .status(err.message === Common.Constants.ErrorCode.NOT_AUTH ? 401 : 500) - .json({ - errorMessage: typeof err === 'string' ? err : err.message - }) - } - }) - //////////////////////////////////////////////////////////////////////////////// + app.get('/api/gun/lndchanbackups', async (req, res) => { + try { + const user = require('../services/gunDB/Mediator').getUser() - app.post(`/api/gun/sendpayment`, async (req, res) => { - const { - recipientPub, - amount, - memo, - maxParts, - timeoutSeconds, - feeLimit, - sessionUuid - } = req.body - logger.info('handling spont pay') - if (!feeLimit) { - logger.error( - 'please provide a "feeLimit" to the send spont payment request' - ) - return res.status(500).json({ - errorMessage: - 'please provide a "feeLimit" to the send spont payment request' - }) - } - if (!recipientPub || !amount) { - logger.info( - 'please provide a "recipientPub" and "amount" to the send spont payment request' - ) - return res.status(500).json({ - errorMessage: - 'please provide a "recipientPub" and "amount" to the send spont payment request' - }) - } - try { - const preimage = await GunActions.sendPayment( + const SEA = require('../services/gunDB/Mediator').mySEA + const mySecret = require('../services/gunDB/Mediator').getMySecret() + const encBackup = await user.get(Key.CHANNELS_BACKUP).then() + if (typeof encBackup !== 'string') { + throw new TypeError( + 'Encrypted backup fetched from gun not an string.' + ) + } + const backup = await SEA.decrypt(encBackup, mySecret) + logger.info(backup) + res.json({ data: backup }) + } catch (err) { + res.json({ ok: 'err' }) + } + }) + + //////////////////////////////////////////////////////////////////////////////// + + app.post(`/api/gun/sendpayment`, async (req, res) => { + const { recipientPub, amount, memo, - feeLimit, maxParts, - timeoutSeconds - ) - res.json({ preimage, sessionUuid }) - } catch (err) { - logger.info('spont pay err:', err) - return res.status(500).json({ - errorMessage: err.message - }) - } - }) - - app.get(`/api/gun/wall/:publicKey?`, async (req, res) => { - try { - const { page } = req.query - const { publicKey } = req.params - - const pageNum = Number(page) - - if (!isARealUsableNumber(pageNum)) { - return res.status(400).json({ - field: 'page', - errorMessage: 'Not a number' + timeoutSeconds, + feeLimit, + sessionUuid + } = req.body + logger.info('handling spontaneous pay') + if (!feeLimit) { + logger.error( + 'please provide a "feeLimit" to the send spontaneous payment request' + ) + return res.status(500).json({ + errorMessage: + 'please provide a "feeLimit" to the send spontaneous payment request' }) } - - if (pageNum === 0) { - return res.status(400).json({ - field: 'page', - errorMessage: 'Page must be a non-zero integer' + if (!recipientPub || !amount) { + logger.info( + 'please provide a "recipientPub" and "amount" to the send spontaneous payment request' + ) + return res.status(500).json({ + errorMessage: + 'please provide a "recipientPub" and "amount" to the send spontaneous payment request' }) } - - const totalPages = await GunGetters.getWallTotalPages(publicKey) - const fetchedPage = await GunGetters.getWallPage(pageNum, publicKey) - - return res.status(200).json({ - ...fetchedPage, - totalPages - }) - } catch (err) { - return res.status(500).json({ - errorMessage: err.message - }) - } - }) - - app.post(`/api/gun/wall/`, async (req, res) => { - try { - const { tags, title, contentItems } = req.body - const SEA = require('../services/gunDB/Mediator').mySEA - return res - .status(200) - .json(await GunActions.createPostNew(tags, title, contentItems, SEA)) - } catch (e) { - console.log(e) - return res.status(500).json({ - errorMessage: - (typeof e === 'string' ? e : e.message) || 'Unknown error.' - }) - } - }) - - app.delete(`/api/gun/wall/:postInfo`, async (req, res) => { - try { - const { postInfo } = req.params - const parts = postInfo.split('&') - const [page, postId] = parts - if (!page || !postId) { - throw new Error(`please provide a "postId" and a "page"`) - } - await GunActions.deletePost(postId, page) - return res.status(200).json({ - ok: 'true' - }) - } catch (e) { - return res.status(500).json({ - errorMessage: - (typeof e === 'string' ? e : e.message) || 'Unknown error.' - }) - } - }) - - app.post(`/api/gun/userInfo`, async (req, res) => { - try { - const { pubs } = req.body - const reqs = pubs.map( - e => - new Promise((res, rej) => { - GunGetters.getUserInfo(e) - .then(r => res(r)) - .catch(e => rej(e)) - }) - ) - const infos = await Promise.all(reqs) - return res.status(200).json({ - pubInfos: infos - }) - } catch (err) { - return res.status(500).json({ - errorMessage: err.message - }) - } - }) - ///////////////////////////////// - /** - * @template P - * @typedef {import('express-serve-static-core').RequestHandler

} RequestHandler - */ - - const ap = /** @type {Application} */ (app) - - /** - * @typedef {object} FollowsRouteParams - * @prop {(string|undefined)=} publicKey - */ - - /** - * @type {RequestHandler} - */ - const apiGunFollowsGet = async (_, res) => { - try { - const currFollows = await GunGetters.Follows.currentFollows() - - return res.status(200).json(currFollows) - } catch (err) { - return res.status(500).json({ - errorMessage: err.message || 'Unknown ERR at GET /api/follows' - }) - } - } - - /** - * @type {RequestHandler} - */ - const apiGunFollowsPut = async (req, res) => { - try { - const { publicKey } = req.params - if (!publicKey) { - throw new Error(`Missing publicKey route param.`) - } - - await GunActions.follow(req.params.publicKey, false) - - // 201 would be extraneous here. Implement it inside app.put - return res.status(200).json({ - ok: true - }) - } catch (err) { - return res.status(500).json({ - errorMessage: err.message || 'Unknown error inside /api/gun/follows/' - }) - } - } - - /** - * @type {RequestHandler} - */ - const apiGunFollowsDelete = async (req, res) => { - try { - const { publicKey } = req.params - if (!publicKey) { - throw new Error(`Missing publicKey route param.`) - } - - await GunActions.unfollow(req.params.publicKey) - - return res.status(200).json({ - ok: true - }) - } catch (err) { - return res.status(500).json({ - errorMessage: err.message || 'Unknown error inside /api/gun/follows/' - }) - } - } - - ap.get('/api/gun/initwall', async (req, res) => { - try { - await GunActions.initWall() - res.json({ ok: true }) - } catch (err) { - logger.error(err) - return res.status(500).json({ - errorMessage: err.message - }) - } - }) - ap.get('/api/gun/follows/', apiGunFollowsGet) - ap.get('/api/gun/follows/:publicKey', apiGunFollowsGet) - ap.put(`/api/gun/follows/:publicKey`, apiGunFollowsPut) - ap.delete(`/api/gun/follows/:publicKey`, apiGunFollowsDelete) - - /** - * @type {RequestHandler<{}>} - */ - const apiGunFeedGet = async (req, res) => { - try { - const MAX_PAGES_TO_FETCH_FOR_TRY_UNTIL = 4 - - const { page: pageStr } = req.query - - /** - * Similar to a "before" query param in cursor based pagination. We call - * it "try" because it is likely that this item lies beyond - * MAX_PAGES_TO_FETCH_FOR_TRY_UNTIL in which case we gracefully just send - * 2 pages and 205 response. - */ - // eslint-disable-next-line prefer-destructuring - const before = req.query.before - - if (pageStr) { - const page = Number(pageStr) - - if (!isARealUsableNumber(page)) { - return res.status(400).json({ - field: 'page', - errorMessage: 'page must be a number' - }) - } - - if (page < 1) { - return res.status(400).json({ - field: page, - errorMessage: 'page must be a positive number' - }) - } - - return res.status(200).json({ - posts: await GunGetters.getFeedPage(page), - page + try { + const preimage = await GunActions.sendPayment( + recipientPub, + amount, + memo, + feeLimit, + // TODO + maxParts, + timeoutSeconds + ) + res.json({ preimage, sessionUuid }) + } catch (err) { + logger.info('spontaneous pay err:', err) + return res.status(500).json({ + errorMessage: err.message }) } - - if (before) { - const pages = range(1, MAX_PAGES_TO_FETCH_FOR_TRY_UNTIL) - const promises = pages.map(p => GunGetters.getFeedPage(p)) - - let results = await Promise.all(promises) - - const idxIfFound = results.findIndex(pp => - pp.some(p => p.id === before) - ) - - if (idxIfFound > -1) { - results = results.slice(0, idxIfFound + 1) - - const posts = flatten(results) - - return res.status(200).json({ - posts, - page: idxIfFound - }) - } - - // we couldn't find the posts leading up to the requested post - // (try_until) Let's just return the ones we found with together with a - // 205 code (client should refresh UI) - - return res.status(205).json({ - posts: results[0] || [], - page: 1 - }) - } - - return res.status(400).json({ - errorMessage: `Must provide at least a page or a try_until query param.` - }) - } catch (err) { - return res.status(500).json({ - errorMessage: err.message || 'Unknown error inside /api/gun/follows/' - }) - } - } - - ap.get(`/api/gun/feed`, apiGunFeedGet) - - /** - * @type {RequestHandler<{}>} - */ - const apiGunMeGet = async (_, res) => { - try { - return res.status(200).json(await GunGetters.getMyUser()) - } catch (err) { - logger.error(err) - return res.status(500).json({ - errorMessage: err.message - }) - } - } - - /** - * @type {RequestHandler<{}>} - */ - const apiGunMePut = async (req, res) => { - /** - * @typedef {Omit} UserWithoutPK - * @typedef {{ handshakeAddress: boolean }} HasHandshakeAddress - * @typedef {UserWithoutPK & HasHandshakeAddress} MePutBody - */ - try { - const { - avatar, - bio, - displayName, - handshakeAddress - } = /** @type {Partial} */ (req.body) - - if (avatar) { - await GunActions.setAvatar( - avatar, - require('../services/gunDB/Mediator').getUser() - ) - } - - if (bio) { - await GunActions.setBio( - bio, - require('../services/gunDB/Mediator').getUser() - ) - } - - if (displayName) { - await GunActions.setDisplayName( - displayName, - require('../services/gunDB/Mediator').getUser() - ) - } - - if (handshakeAddress) { - await GunActions.generateHandshakeAddress() - } - - return res.status(200).json({ - ok: true - }) - } catch (err) { - logger.error(err) - return res.status(500).json({ - errorMessage: err.message - }) - } - } - - ap.get(`/api/gun/me`, apiGunMeGet) - ap.put(`/api/gun/me`, apiGunMePut) - - /** - * @typedef {object} ChatsRouteParams - * @prop {(string|undefined)=} publicKey - */ - - /** - * @type {RequestHandler} - */ - const apiGunChatsPost = async (req, res) => { - const { publicKey } = req.params - const { body } = req.body - - if (!publicKey) { - return res.status(400).json({ - errorMessage: `Must specify a publicKey route param for POSTing a message` - }) - } - - try { - const user = GunDB.getUser() - const SEA = GunDB.mySEA - - return res - .status(200) - .json(await GunActions.sendMessageNew(publicKey, body, user, SEA)) - } catch (err) { - logger.error(err) - return res.status(500).json({ - errorMessage: err.message - }) - } - } - - /** - * @type {RequestHandler} - */ - const apiGunChatsDelete = async (req, res) => { - const { publicKey } = req.params - - if (!publicKey) { - return res.status(400).json({ - errorMessage: `Must specify a publicKey route param for DELETING a chat` - }) - } - - try { - await GunActions.disconnect(publicKey) - - return res.status(200).json({ - ok: true - }) - } catch (err) { - logger.error(err) - return res.status(500).json({ - errorMessage: err.message - }) - } - } - - ap.post(`/api/gun/chats/:publicKey?`, apiGunChatsPost) - ap.delete(`/api/gun/chats/:publicKey?`, apiGunChatsDelete) - - /** - * @typedef {object} RequestsRouteParams - * @prop {(string|undefined)=} requestID - */ - - /** - * @type {RequestHandler<{}>} - */ - const apiGunRequestsReceivedGet = (_, res) => { - try { - const data = Events.getCurrentReceivedReqs() - const noAvatar = data.map(req => { - return { ...req, recipientAvatar: null } - }) - res.json({ - data: noAvatar - }) - } catch (err) { - logger.error(err) - return res.status(500).json({ - errorMessage: err.message - }) - } - } - - /** - * @type {RequestHandler<{}>} - */ - const apiGunRequestsSentGet = (_, res) => { - try { - const data = Events.getCurrentSentReqs() - const noAvatar = data.map(req => { - return { ...req, recipientAvatar: null } - }) - res.json({ - data: noAvatar - }) - } catch (err) { - logger.error(err) - return res.status(500).json({ - errorMessage: err.message - }) - } - } - - /** - * @typedef {object} RequestsRoutePOSTBody - * @prop {string=} initialMsg - * @prop {string} publicKey - */ - - /** - * @type {RequestHandler<{}>} - */ - const apiGunRequestsPost = async (req, res) => { - const { - initialMsg, - publicKey - } = /** @type {RequestsRoutePOSTBody} */ (req.body) - - if (!publicKey) { - return res.status(400).json({ - errorMessage: `Must specify a publicKey route param for POSTing a message` - }) - } - - try { - const gun = require('../services/gunDB/Mediator').getGun() - const user = require('../services/gunDB/Mediator').getUser() - const SEA = require('../services/gunDB/Mediator').mySEA - - if (initialMsg) { - await GunActions.sendHRWithInitialMsg( - initialMsg, - publicKey, - gun, - user, - SEA - ) - } else { - await GunActions.sendHandshakeRequest(publicKey, gun, user, SEA) - } - - return res.status(200).json({ - ok: true - }) - } catch (err) { - logger.error(err) - return res.status(500).json({ - errorMessage: err.message - }) - } - } - - /** - * @typedef {object} RequestsRoutePUTBody - * @prop {boolean=} accept - */ - - /** - * @type {RequestHandler} - */ - const apiGunRequestsPut = async (req, res) => { - const { requestID } = req.params - const { accept } = /** @type {RequestsRoutePUTBody} */ (req.body) - - if (!requestID) { - return res.status(400).json({ - errorMessage: `Must specify a requestID route param for accepting a request` - }) - } - - if (!accept) { - return res.status(200).json({ - ok: true - }) - } - - try { - const gun = require('../services/gunDB/Mediator').getGun() - const user = require('../services/gunDB/Mediator').getUser() - const SEA = require('../services/gunDB/Mediator').mySEA - - await GunActions.acceptRequest(requestID, gun, user, SEA) - - return res.status(200).json({ - ok: true - }) - } catch (err) { - logger.error(err) - return res.status(500).json({ - errorMessage: err.message - }) - } - } - - ap.get(`/api/gun/${GunEvent.ON_RECEIVED_REQUESTS}`, apiGunRequestsReceivedGet) - ap.get(`/api/gun/${GunEvent.ON_SENT_REQUESTS}`, apiGunRequestsSentGet) - ap.get(`/api/gun/requests/received`, apiGunRequestsReceivedGet) - ap.get(`/api/gun/requests/sent`, apiGunRequestsSentGet) - ap.post('/api/gun/requests/', apiGunRequestsPost) - ap.put(`/api/gun/requests/:requestID?`, apiGunRequestsPut) - - ap.get(`/api/gun/dev/userToIncoming`, async (_, res) => { - try { - const { tryAndWait } = require('../services/gunDB/contact-api/utils') - - const data = await tryAndWait( - (_, u) => - new Promise(res => { - u.get(GunKey.USER_TO_INCOMING).load(data => { - res(data) - }) - }), - v => { - if (typeof v !== 'object') { - return true - } - - if (v === null) { - return true - } - - // load sometimes returns an empty set on the first try - return size(v) === 0 - } - ) - - return res.status(200).json({ - data - }) - } catch (err) { - return res.status(500).json({ - errorMessage: err.message - }) - } - }) - - ap.get(`/api/gun/dev/recipientToOutgoing`, async (_, res) => { - try { - const { tryAndWait } = require('../services/gunDB/contact-api/utils') - - const data = await tryAndWait( - (_, u) => - new Promise(res => { - u.get(GunKey.RECIPIENT_TO_OUTGOING).load(data => { - res(data) - }) - }), - v => { - if (typeof v !== 'object') { - return true - } - - if (v === null) { - return true - } - - // load sometimes returns an empty set on the first try - return size(v) === 0 - } - ) - - return res.status(200).json({ - data - }) - } catch (err) { - return res.status(500).json({ - errorMessage: err.message - }) - } - }) - - ap.get(`/api/gun/dev/outgoings`, async (_, res) => { - try { - const { tryAndWait } = require('../services/gunDB/contact-api/utils') - - const data = await tryAndWait( - (_, u) => - new Promise(res => { - u.get(GunKey.OUTGOINGS).load(data => { - res(data) - }) - }), - v => { - if (typeof v !== 'object') { - return true - } - - if (v === null) { - return true - } - - // load sometimes returns an empty set on the first try - return size(v) === 0 - } - ) - - return res.status(200).json({ - data - }) - } catch (err) { - return res.status(500).json({ - errorMessage: err.message - }) - } - }) - - ap.get(`/api/gun/dev/currentHandshakeAddress`, async (_, res) => { - try { - const { tryAndWait } = require('../services/gunDB/contact-api/utils') - - const data = await tryAndWait((_, u) => - u.get(GunKey.CURRENT_HANDSHAKE_ADDRESS).then() - ) - - return res.status(200).json({ - data - }) - } catch (err) { - return res.status(500).json({ - errorMessage: err.message - }) - } - }) - - ap.get(`/api/gun/dev/handshakeNodes/:handshakeAddress`, async (req, res) => { - try { - const { tryAndWait } = require('../services/gunDB/contact-api/utils') - - const data = await tryAndWait( - g => - new Promise(res => { - g.get(GunKey.HANDSHAKE_NODES) - .get(req.params.handshakeAddress) - .load(data => { - res(data) - }) - }), - v => { - if (typeof v !== 'object') { - return true - } - - if (v === null) { - return true - } - - // load sometimes returns an empty set on the first try - return size(v) === 0 - } - ) - - return res.status(200).json({ - data - }) - } catch (err) { - return res.status(500).json({ - errorMessage: err.message - }) - } - }) - - ap.get(`/api/gun/dev/user/:publicKey`, async (req, res) => { - try { - const { tryAndWait } = require('../services/gunDB/contact-api/utils') - - const data = await tryAndWait( - g => - new Promise(res => { - g.user(req.params.publicKey).load(data => { - res(data) - }) - }), - v => { - if (typeof v !== 'object') { - return true - } - - if (v === null) { - return true - } - - // load sometimes returns an empty set on the first try - return size(v) === 0 - } - ) - - return res.status(200).json({ - data - }) - } catch (err) { - return res.status(500).json({ - errorMessage: err.message - }) - } - }) - - ap.get(`/api/gun/dev/storedReqs`, async (req, res) => { - try { - const { tryAndWait } = require('../services/gunDB/contact-api/utils') - - const data = await tryAndWait( - (_, u) => new Promise(res => u.get(Key.STORED_REQS).load(res)), - v => { - if (typeof v !== 'object') { - return true - } - - if (v === null) { - return true - } - - // load sometimes returns an empty set on the first try - return size(v) === 0 - } - ) - - return res.status(200).json({ - data - }) - } catch (err) { - return res.status(500).json({ - errorMessage: err.message - }) - } - }) - - ap.get(`/api/gun/dev/userToLastReqSent`, async (req, res) => { - try { - const { tryAndWait } = require('../services/gunDB/contact-api/utils') - - const data = await tryAndWait( - (_, u) => - new Promise(res => u.get(Key.USER_TO_LAST_REQUEST_SENT).load(res)), - v => { - if (typeof v !== 'object') { - return true - } - - if (v === null) { - return true - } - - // load sometimes returns an empty set on the first try - return size(v) === 0 - } - ) - - return res.status(200).json({ - data - }) - } catch (err) { - return res.status(500).json({ - errorMessage: err.message - }) - } - }) - - ap.get(`/api/gun/auth`, (_, res) => { - const { isAuthenticated } = require('../services/gunDB/Mediator') - - return res.status(200).json({ - data: isAuthenticated() }) - }) - /** - * @typedef {object} HandleGunFetchParams - * @prop {'once'|'load'|'open'} type - * @prop {boolean} startFromUserGraph - * @prop {string} path - * @prop {string=} publicKey - * @prop {string=} publicKeyForDecryption - */ - /** - * @param {HandleGunFetchParams} args0 - * @returns {Promise} - */ - const handleGunFetch = ({ - type, - startFromUserGraph, - path, - publicKey, - publicKeyForDecryption - }) => { - const keys = path.split('>') - const { tryAndWait } = require('../services/gunDB/contact-api/utils') - return tryAndWait((gun, user) => { + app.post(`/api/gun/wall/`, async (req, res) => { + try { + const { tags, title, contentItems, enableTipsOverlay } = req.body + const postRes = await GunActions.createPostNew( + tags, + title, + contentItems + ) + if (enableTipsOverlay) { + const [postID] = postRes + const accessId = TipsForwarder.enablePostNotifications(postID) + return res.status(200).json([...postRes, accessId]) + } + return res.status(200).json(postRes) + } catch (e) { + logger.error(e) + return res.status(500).json({ + errorMessage: + (typeof e === 'string' ? e : e.message) || 'Unknown error.' + }) + } + }) + + app.delete(`/api/gun/wall/:postInfo`, async (req, res) => { + try { + const { postInfo } = req.params + const parts = postInfo.split('&') + const [page, postId] = parts + if (!page || !postId) { + throw new Error(`please provide a "postId" and a "page"`) + } + await GunActions.deletePost(postId, page) + return res.status(200).json({ + ok: 'true' + }) + } catch (e) { + return res.status(500).json({ + errorMessage: + (typeof e === 'string' ? e : e.message) || 'Unknown error.' + }) + } + }) + + ///////////////////////////////// + /** + * @template P + * @typedef {import('express-serve-static-core').RequestHandler

} RequestHandler + */ + + /** + * @typedef {object} FollowsRouteParams + * @prop {(string|undefined)=} publicKey + */ + + /** + * @type {RequestHandler} + */ + const apiGunFollowsPut = async (req, res) => { + try { + const { publicKey } = req.params + if (!publicKey) { + throw new Error(`Missing publicKey route param.`) + } + + await GunActions.follow(publicKey, false) + + // 201 would be extraneous here. Implement it inside app.put + res.status(200).json({ + ok: true + }) + } catch (err) { + res.status(500).json({ + errorMessage: err.message || 'Unknown error inside /api/gun/follows/' + }) + } + } + + /** + * @type {RequestHandler} + */ + const apiGunFollowsDelete = async (req, res) => { + try { + const { publicKey } = req.params + if (!publicKey) { + throw new Error(`Missing publicKey route param.`) + } + + await GunActions.unfollow(publicKey) + + res.status(200).json({ + ok: true + }) + } catch (err) { + res.status(500).json({ + errorMessage: err.message || 'Unknown error inside /api/gun/follows/' + }) + } + } + + app.get('/api/gun/initwall', async (req, res) => { + try { + await GunActions.initWall() + res.json({ ok: true }) + } catch (err) { + logger.error(err) + return res.status(500).json({ + errorMessage: err.message + }) + } + }) + app.put(`/api/gun/follows/:publicKey`, apiGunFollowsPut) + app.delete(`/api/gun/follows/:publicKey`, apiGunFollowsDelete) + + /** + * @type {RequestHandler<{}>} + */ + const apiGunMePut = async (req, res) => { + /** + * @typedef {Omit} UserWithoutPK + * @typedef {{ handshakeAddress: boolean }} HasHandshakeAddress + * @typedef {UserWithoutPK & HasHandshakeAddress} MePutBody + */ + try { + const { + avatar, + bio, + displayName, + handshakeAddress + } = /** @type {Partial} */ (req.body) + + if (avatar) { + await GunActions.setAvatar( + avatar, + require('../services/gunDB/Mediator').getUser() + ) + } + + if (bio) { + await GunActions.setBio( + bio, + require('../services/gunDB/Mediator').getUser() + ) + } + + if (displayName) { + await GunActions.setDisplayName( + displayName, + require('../services/gunDB/Mediator').getUser() + ) + } + + if (handshakeAddress) { + await GunActions.generateHandshakeAddress() + } + + res.status(200).json({ + ok: true + }) + } catch (err) { + logger.error(err) + res.status(500).json({ + errorMessage: err.message + }) + } + } + + app.put(`/api/gun/me`, apiGunMePut) + + app.get(`/api/gun/auth`, (_, res) => { + const { isAuthenticated } = require('../services/gunDB/Mediator') + + return res.status(200).json({ + data: isAuthenticated() + }) + }) + + /** + * @typedef {object} HandleGunFetchParams + * @prop {'once'|'load'|'specialOnce'} type + * @prop {boolean} startFromUserGraph + * @prop {string} path + * @prop {string=} publicKey + * @prop {string=} publicKeyForDecryption + * @prop {string=} epubForDecryption + */ + /** + * @param {HandleGunFetchParams} args0 + * @returns {Promise} + */ + const handleGunFetch = ({ + type, + startFromUserGraph, + path, + publicKey, + publicKeyForDecryption, + epubForDecryption + }) => { + const keys = path.split('>') + const { gun, user } = require('../services/gunDB/Mediator') + // eslint-disable-next-line no-nested-ternary let node = startFromUserGraph ? user @@ -3072,203 +2213,457 @@ module.exports = async ( ? gun.user(publicKey) : gun keys.forEach(key => (node = node.get(key))) - - return new Promise(res => { - const listener = async data => { + logger.info(`fetching: ${keys}`) + return new Promise((res, rej) => { + const listener = data => { + logger.info(`got res for: ${keys}`) + logger.info(data || 'falsey data (does not get logged)') if (publicKeyForDecryption) { - res( - await GunWriteRPC.deepDecryptIfNeeded( - data, - publicKeyForDecryption - ) + GunWriteRPC.deepDecryptIfNeeded( + data, + publicKeyForDecryption, + epubForDecryption ) + .then(res) + .catch(rej) } else { res(data) } } if (type === 'once') node.once(listener) - if (type === 'load') node.load(listener) - if (type === 'open') node.open(listener) - }) - }) - } - - /** - * Used decryption of incoming data. - */ - const PUBKEY_FOR_DECRYPT_HEADER = 'public-key-for-decryption' - - ap.get('/api/gun/once/:path', async (req, res) => { - const publicKeyForDecryption = req.header(PUBKEY_FOR_DECRYPT_HEADER) - const { path } = req.params - res.status(200).json({ - data: await handleGunFetch({ - path, - startFromUserGraph: false, - type: 'once', - publicKeyForDecryption - }) - }) - }) - - ap.get('/api/gun/load/:path', async (req, res) => { - const publicKeyForDecryption = req.header(PUBKEY_FOR_DECRYPT_HEADER) - const { path } = req.params - res.status(200).json({ - data: await handleGunFetch({ - path, - startFromUserGraph: false, - type: 'load', - publicKeyForDecryption - }) - }) - }) - - ap.get('/api/gun/user/once/:path', async (req, res) => { - const publicKeyForDecryption = req.header(PUBKEY_FOR_DECRYPT_HEADER) - const { path } = req.params - res.status(200).json({ - data: await handleGunFetch({ - path, - startFromUserGraph: true, - type: 'once', - publicKeyForDecryption - }) - }) - }) - - ap.get('/api/gun/user/load/:path', async (req, res) => { - const publicKeyForDecryption = req.header(PUBKEY_FOR_DECRYPT_HEADER) - const { path } = req.params - res.status(200).json({ - data: await handleGunFetch({ - path, - startFromUserGraph: true, - type: 'load', - publicKeyForDecryption - }) - }) - }) - - ap.get('/api/gun/otheruser/:publicKey/:type/:path', async (req, res) => { - const allowedTypes = ['once', 'load', 'open'] - const publicKeyForDecryption = req.header(PUBKEY_FOR_DECRYPT_HEADER) - const { path, publicKey, type } = req.params - - if (!allowedTypes.includes(type)) { - res.status(400).json({ - errorMessage: 'Invalid type specified' - }) - return - } - - res.status(200).json({ - data: await handleGunFetch({ - path, - startFromUserGraph: false, - type, - publicKey, - publicKeyForDecryption - }) - }) - }) - - ap.post('/api/lnd/cb/:methodName', (req, res) => { - try { - const { lightning } = LightningServices.services - const { methodName } = req.params - const args = req.body - - lightning[methodName](args, (err, lres) => { - if (err) { - res.status(500).json({ - errorMessage: err.details - }) - } else if (lres) { - res.status(200).json(lres) - } else { - res.status(500).json({ - errorMessage: 'Unknown error' - }) - } - }) - } catch (err) { - logger.warn(`Error inside api cb:`) - logger.error(err) - logger.error(err.message) - - return res.status(500).json({ - errorMessage: err.message + if (type === 'specialOnce') node.specialOnce(listener) }) } - }) - ap.post('/api/gun/put', async (req, res) => { - try { - const { path, value } = req.body + /** + * Used decryption of incoming data. + */ + const PUBKEY_FOR_DECRYPT_HEADER = 'public-key-for-decryption' + /** + * Used decryption of incoming data. + */ + const EPUB_FOR_DECRYPT_HEADER = 'epub-for-decryption' - await GunWriteRPC.put(path, value) - - res.status(200).json({ - ok: true - }) - } catch (err) { - res - .status(err.message === Common.Constants.ErrorCode.NOT_AUTH ? 401 : 500) - .json({ - errorMessage: err.message + app.get('/api/gun/once/:path', async (req, res) => { + try { + const publicKeyForDecryption = req.header(PUBKEY_FOR_DECRYPT_HEADER) + const epubForDecryption = req.header(EPUB_FOR_DECRYPT_HEADER) + const { path } = req.params + logger.info(`gun ONCE: ${path}`) + const data = await handleGunFetch({ + path, + startFromUserGraph: false, + type: 'once', + publicKeyForDecryption, + epubForDecryption }) - } - }) - - ap.post('/api/gun/set', async (req, res) => { - try { - const { path, value } = req.body - - const id = await GunWriteRPC.set(path, value) - - res.status(200).json({ - ok: true, - id - }) - } catch (err) { - res - .status(err.message === Common.Constants.ErrorCode.NOT_AUTH ? 401 : 500) - .json({ - errorMessage: err.message + res.status(200).json({ + data }) - } - }) - - ap.get('/api/log', async (_, res) => { - try { - // https://github.com/winstonjs/winston#querying-logs - /** - * @type {import('winston').QueryOptions} - */ - const options = { - from: new Date() - 1 * 60 * 60 * 1000, - until: new Date() - } - - const results = await Common.Utils.makePromise((res, rej) => { - logger.query(options, (err, results) => { - if (err) { - rej(err) - } else { - res(results) - } - }) - }) - - res.status(200).json(results) - } catch (e) { - res - .status(e.message === Common.Constants.ErrorCode.NOT_AUTH ? 401 : 500) - .json({ + } catch (e) { + logger.error(e) + res.status(500).json({ errorMessage: e.message }) - } - }) + } + }) + + app.get('/api/gun/specialOnce/:path', async (req, res) => { + try { + const publicKeyForDecryption = req.header(PUBKEY_FOR_DECRYPT_HEADER) + const epubForDecryption = req.header(EPUB_FOR_DECRYPT_HEADER) + const { path } = req.params + logger.info(`Gun special once: ${path}`) + const data = await handleGunFetch({ + path, + startFromUserGraph: false, + type: 'specialOnce', + publicKeyForDecryption, + epubForDecryption + }) + res.status(200).json({ + data + }) + } catch (e) { + logger.error(e) + res.status(500).json({ + errorMessage: e.message + }) + } + }) + + app.get('/api/gun/load/:path', async (req, res) => { + try { + const publicKeyForDecryption = req.header(PUBKEY_FOR_DECRYPT_HEADER) + const epubForDecryption = req.header(EPUB_FOR_DECRYPT_HEADER) + const { path } = req.params + logger.info(`gun LOAD: ${path}`) + const data = await handleGunFetch({ + path, + startFromUserGraph: false, + type: 'load', + publicKeyForDecryption, + epubForDecryption + }) + res.status(200).json({ + data + }) + } catch (e) { + logger.error(e) + res.status(500).json({ + errorMessage: e.message + }) + } + }) + + app.get('/api/gun/user/once/:path', async (req, res) => { + try { + const publicKeyForDecryption = req.header(PUBKEY_FOR_DECRYPT_HEADER) + const epubForDecryption = req.header(EPUB_FOR_DECRYPT_HEADER) + const { path } = req.params + logger.info(`gun otheruser ONCE: ${path}`) + const data = await handleGunFetch({ + path, + startFromUserGraph: true, + type: 'once', + publicKeyForDecryption, + epubForDecryption + }) + res.status(200).json({ + data + }) + } catch (e) { + logger.error(e) + res.status(500).json({ + errorMessage: e.message + }) + } + }) + + app.get('/api/gun/user/specialOnce/:path', async (req, res) => { + try { + const publicKeyForDecryption = req.header(PUBKEY_FOR_DECRYPT_HEADER) + const epubForDecryption = req.header(EPUB_FOR_DECRYPT_HEADER) + const { path } = req.params + logger.info(`Gun user special once: ${path}`) + const data = await handleGunFetch({ + path, + startFromUserGraph: true, + type: 'specialOnce', + publicKeyForDecryption, + epubForDecryption + }) + res.status(200).json({ + data + }) + } catch (e) { + logger.error(e) + res.status(500).json({ + errorMessage: e.message + }) + } + }) + + app.get('/api/gun/user/load/:path', async (req, res) => { + try { + const publicKeyForDecryption = req.header(PUBKEY_FOR_DECRYPT_HEADER) + const epubForDecryption = req.header(EPUB_FOR_DECRYPT_HEADER) + const { path } = req.params + logger.info(`gun self user LOAD: ${path}`) + const data = await handleGunFetch({ + path, + startFromUserGraph: true, + type: 'load', + publicKeyForDecryption, + epubForDecryption + }) + res.status(200).json({ + data + }) + } catch (e) { + logger.error(e) + res.status(500).json({ + errorMessage: e.message + }) + } + }) + + app.get('/api/gun/otheruser/:publicKey/:type/:path', async (req, res) => { + try { + const allowedTypes = ['once', 'open', 'specialOnce'] + const publicKeyForDecryption = req.header(PUBKEY_FOR_DECRYPT_HEADER) + const epubForDecryption = req.header(EPUB_FOR_DECRYPT_HEADER) + const { path /*:rawPath*/, publicKey, type } = req.params + logger.info(`Gun other user ${type}: ${path}`) + // const path = decodeURI(rawPath) + if (!publicKey || publicKey === 'undefined') { + res.status(400).json({ + errorMessage: 'Invalid publicKey specified' + }) + return + } + + if (!allowedTypes.includes(type)) { + res.status(400).json({ + errorMessage: 'Invalid type specified' + }) + return + } + const data = await handleGunFetch({ + path, + startFromUserGraph: false, + // @ts-expect-error Validated above + type, + publicKey, + publicKeyForDecryption, + epubForDecryption + }) + try { + res.status(200).json({ + data + }) + } catch (err) { + res + .status( + err.message === Common.Constants.ErrorCode.NOT_AUTH ? 401 : 500 + ) + .json({ + errorMessage: err.message + }) + } + } catch (e) { + logger.error(e) + res.status(500).json({ + errorMessage: e.message + }) + } + }) + + app.post('/api/lnd/cb/:methodName', (req, res) => { + try { + const { lightning } = LightningServices.services + const { methodName } = req.params + logger.info(`lnd RPC: ${methodName}`) + const args = req.body + + lightning[methodName](args, (err, lres) => { + if (err) { + res.status(500).json({ + errorMessage: err.details + }) + } else if (lres) { + res.status(200).json(lres) + } else { + res.status(500).json({ + errorMessage: 'Unknown error' + }) + } + }) + } catch (err) { + logger.warn(`Error inside api cb:`) + logger.error(err) + logger.error(err.message) + + return res.status(500).json({ + errorMessage: err.message + }) + } + }) + + app.post('/api/gun/put', async (req, res) => { + try { + const { path, value } = req.body + logger.info(`gun PUT: ${path}`) + await GunWriteRPC.put(path, value) + + res.status(200).json({ + ok: true + }) + } catch (err) { + logger.error(err) + res + .status( + err.message === Common.Constants.ErrorCode.NOT_AUTH ? 401 : 500 + ) + .json({ + errorMessage: err.message + }) + } + }) + + app.post('/api/gun/set', async (req, res) => { + try { + const { path, value } = req.body + logger.info(`gun SET: ${path}`) + const id = await GunWriteRPC.set(path, value) + + res.status(200).json({ + ok: true, + id + }) + } catch (err) { + logger.error(err) + res + .status( + err.message === Common.Constants.ErrorCode.NOT_AUTH ? 401 : 500 + ) + .json({ + errorMessage: err.message + }) + } + }) + + app.get('/api/log', async (_, res) => { + try { + // https://github.com/winstonjs/winston#querying-logs + /** + * @type {import('winston').QueryOptions} + */ + const options = { + // @ts-expect-error Winston's typings don't account for supporting + // numbers here. + from: (new Date()).valueOf() - 1 * 60 * 60 * 1000, + until: new Date() + } + + const results = await Common.Utils.makePromise((res, rej) => { + logger.query(options, (err, results) => { + if (err) { + rej(err) + } else { + res(results) + } + }) + }) + + res.status(200).json(results) + } catch (e) { + logger.error(e) + res + .status(e.message === Common.Constants.ErrorCode.NOT_AUTH ? 401 : 500) + .json({ + errorMessage: e.message + }) + } + }) + //this is for OBS notifications, not wired with UI. + app.get('/api/subscribeStream', (req, res) => { + try { + res.sendFile(path.join(__dirname, '../public/obsOverlay.html')) + } catch (e) { + logger.error(e) + res.status(500).json({ + errorMessage: e.message + }) + } + }) + app.post('/api/enableNotificationsOverlay', (req, res) => { + try { + const { postID } = req.body + if (!postID) { + return res.status(400).json({ + errorMessage: 'no post id provided' + }) + } + const accessId = TipsForwarder.enablePostNotifications(postID) + res.json({ + accessId + }) + } catch (e) { + logger.error(e) + res.status(500).json({ + errorMessage: e.message + }) + } + }) + //this is for wasLive/isLive status + app.post('/api/listenStream', (req, res) => { + try { + startedStream(req.body) + return res.status(200).json({ + ok: true + }) + } catch (e) { + logger.error(e) + return res.status(500).json({ + errorMessage: + (typeof e === 'string' ? e : e.message) || 'Unknown error.' + }) + } + }) + app.post('/api/stopStream', (req, res) => { + try { + endStream(req.body) + return res.status(200).json({ + ok: true + }) + } catch (e) { + logger.error(e) + return res.status(500).json({ + errorMessage: + (typeof e === 'string' ? e : e.message) || 'Unknown error.' + }) + } + }) + + app.get('/', (req, res) => { + try { + res.sendFile(path.join(__dirname, '../public/localHomepage.html')) + } catch (e) { + logger.error(e) + res.status(500).json({ + errorMessage: e.message + }) + } + }) + + app.get('/qrCodeGenerator', (req, res) => { + console.log('/qrCodeGenerator') + try { + res.sendFile(path.join(__dirname, '../public/qrcode.min.js')) + } catch (e) { + logger.error(e) + res.status(500).json({ + errorMessage: e.message + }) + } + }) + + app.get('/api/accessInfo', async (req, res) => { + if (req.ip !== '127.0.0.1') { + res.json({ + field: 'origin', + message: 'invalid origin, cant serve access info' + }) + return + } + try { + throw new Error('') + } catch (e) { + logger.error(e) + res.status(500).json({ + errorMessage: e.message + }) + } + }) + + app.post('/api/initUserInformation', async (req, res) => { + try { + const user = require('../services/gunDB/Mediator').getUser() + await UserInitializer.InitUserData(user) + } catch (err) { + logger.error(err) + res + .status( + err.message === Common.Constants.ErrorCode.NOT_AUTH ? 401 : 500 + ) + .json({ + errorMessage: err.message + }) + } + }) + } catch (err) { + logger.warn('Unhandled rejection:', err) + } } diff --git a/src/server.js b/src/server.js index 0c397061..1425b31e 100644 --- a/src/server.js +++ b/src/server.js @@ -1,13 +1,32 @@ /** * @prettier */ +// @ts-check +const ECCrypto = require('eccrypto') + +const ECC = require('../utils/ECC') + +/** + * This API run's private key. + */ +const runPrivateKey = ECCrypto.generatePrivate() +/** + * This API run's public key. + */ +const runPublicKey = ECCrypto.getPublic(runPrivateKey) + +process.on('uncaughtException', e => { + console.log('something bad happened!') + console.log(e) +}) /** * Module dependencies. */ const server = program => { - const localtunnel = require('localtunnel') const Http = require('http') + const Https = require('https') + const FS = require('fs') const Express = require('express') const Crypto = require('crypto') const Dotenv = require('dotenv') @@ -15,9 +34,8 @@ const server = program => { const Path = require('path') const { Logger: CommonLogger } = require('shock-common') const binaryParser = require('socket.io-msgpack-parser') - const ECC = require('../utils/ECC') + const LightningServices = require('../utils/lightningServices') - const Encryption = require('../utils/encryptionStore') const app = Express() const compression = require('compression') @@ -25,12 +43,20 @@ const server = program => { const session = require('express-session') const methodOverride = require('method-override') const qrcode = require('qrcode-terminal') + const relayClient = require('hybrid-relay-client/build') const { - unprotectedRoutes, sensitiveRoutes, nonEncryptedRoutes } = require('../utils/protectedRoutes') + /** + * An offline-only private key used for authenticating a client's key + * exchange. Neither the tunnel nor the WWW should see this private key, it + * should only be served through STDOUT (via QR or else). + */ + const accessSecret = ECCrypto.generatePrivate() + const accessSecretBase64 = accessSecret.toString('base64') + // load app default configuration data const defaults = require('../config/defaults')(program.mainnet) const rootFolder = program.rootPath || process.resourcesPath || __dirname @@ -43,10 +69,7 @@ const server = program => { const tunnelHost = process.env.LOCAL_TUNNEL_SERVER || defaults.localtunnelHost // setup winston logging ========== - const logger = require('../config/log')( - program.logfile || defaults.logfile, - program.loglevel || defaults.loglevel - ) + const logger = require('../config/log') CommonLogger.setLogger(logger) @@ -55,7 +78,7 @@ const server = program => { logger.info('Mainnet Mode:', !!program.mainnet) - if (process.env.DISABLE_SHOCK_ENCRYPTION === 'true') { + if (process.env.SHOCK_ENCRYPTION_ECC === 'false') { logger.error('Encryption Mode: false') } else { logger.info('Encryption Mode: true') @@ -80,116 +103,69 @@ const server = program => { .digest('hex') } - const cacheCheck = ({ req, res, args, send }) => { - if ( - (process.env.SHOCK_CACHE === 'true' || !process.env.SHOCK_CACHE) && - req.method === 'GET' - ) { - const dataHash = hashData(args[0]).slice(-8) - res.set('shock-cache-hash', dataHash) - - logger.debug('shock-cache-hash:', req.headers['shock-cache-hash']) - logger.debug('Data Hash:', dataHash) - if ( - !req.headers['shock-cache-hash'] && - (process.env.CACHE_HEADERS_MANDATORY === 'true' || - !process.env.CACHE_HEADERS_MANDATORY) - ) { - logger.warn( - "Request is missing 'shock-cache-hash' header, please make sure to include that in each GET request in order to benefit from reduced data usage" - ) - return { cached: false, hash: dataHash } - } - - if (req.headers['shock-cache-hash'] === dataHash) { - logger.debug('Same Hash Detected!') - args[0] = null - res.status(304) - send.apply(res, args) - return { cached: true, hash: dataHash } - } - - return { cached: false, hash: dataHash } - } - - return { cached: false, hash: null } - } - /** * @param {Express.Request} req * @param {Express.Response} res * @param {(() => void)} next */ const modifyResponseBody = (req, res, next) => { - const legacyDeviceId = req.headers['x-shockwallet-device-id'] const deviceId = req.headers['encryption-device-id'] const oldSend = res.send - if (nonEncryptedRoutes.includes(req.path)) { + console.log({ + deviceId, + encryptionDisabled: process.env.SHOCK_ENCRYPTION_ECC === 'false', + unprotectedRoute: nonEncryptedRoutes.includes(req.path) + }) + + if ( + nonEncryptedRoutes.includes(req.path) || + process.env.SHOCK_ENCRYPTION_ECC === 'false' + ) { next() return } - if (legacyDeviceId) { - res.send = (...args) => { - if (args[0] && args[0].encryptedData && args[0].encryptionKey) { - logger.warn('Response loop detected!') - oldSend.apply(res, args) - return - } - - const { cached, hash } = cacheCheck({ req, res, args, send: oldSend }) - - if (cached) { - return - } - - // arguments[0] (or `data`) contains the response body - const authorized = Encryption.isAuthorizedDevice({ - deviceId: legacyDeviceId - }) - const encryptedMessage = authorized - ? Encryption.encryptMessage({ - message: args[0] ? args[0] : {}, - deviceId: legacyDeviceId, - metadata: { - hash - } - }) - : args[0] - args[0] = JSON.stringify(encryptedMessage) + // @ts-expect-error + res.send = (...args) => { + if (args[0] && args[0].ciphertext && args[0].iv) { + logger.warn('Response loop detected!') oldSend.apply(res, args) + return } - } - if (deviceId) { - res.send = (...args) => { - if (args[0] && args[0].ciphertext && args[0].iv) { - logger.warn('Response loop detected!') - oldSend.apply(res, args) - return - } + if (typeof deviceId !== 'string' || !deviceId) { + // TODO + } - const authorized = ECC.isAuthorizedDevice({ - deviceId - }) + const authorized = ECC.devicePublicKeys.has(deviceId) - // Using classic promises syntax to avoid - // modifying res.send's return type - if (authorized) { - ECC.encryptMessage({ - deviceId, - message: args[0] - }).then(encryptedMessage => { + // Using classic promises syntax to avoid + // modifying res.send's return type + if (authorized && process.env.SHOCK_ENCRYPTION_ECC !== 'false') { + const devicePub = Buffer.from(ECC.devicePublicKeys.get(deviceId)) + + ECCrypto.encrypt(devicePub, Buffer.from(args[0], 'utf-8')).then( + encryptedMessage => { args[0] = JSON.stringify(encryptedMessage) oldSend.apply(res, args) - }) - } + } + ) + } + if (!authorized || process.env.SHOCK_ENCRYPTION_ECC === 'false') { if (!authorized) { - args[0] = JSON.stringify(args[0]) - oldSend.apply(res, args) + logger.warn( + `An unauthorized Device ID is contacting the API: ${deviceId}` + ) + logger.warn( + `Authorized Device IDs: ${[...ECC.devicePublicKeys.keys()].join( + ', ' + )}` + ) } + args[0] = JSON.stringify(args[0]) + oldSend.apply(res, args) } } @@ -203,27 +179,25 @@ const server = program => { // eslint-disable-next-line consistent-return const startServer = async () => { - /** - * @type {localtunnel.Tunnel} - */ - let tunnelRef = null try { LightningServices.setDefaults(program) if (!LightningServices.isInitialized()) { await LightningServices.init() } - await new Promise((resolve, reject) => { + await /** @type {Promise} */ (new Promise((resolve, reject) => { LightningServices.services.lightning.getInfo({}, (err, res) => { - if (err && err.code !== 12) { + if ( + err && + !err.details.includes('wallet not created') && + !err.details.includes('wallet locked') + ) { reject(err) } else { resolve() } }) - }) - - const auth = require('../services/auth/auth') + })) app.use(compression()) @@ -268,50 +242,12 @@ const server = program => { await Storage.init({ dir: storageDirectory - }) - if (program.tunnel) { - // setup localtunnel ========== - const [tunnelToken, tunnelSubdomain, tunnelUrl] = await Promise.all([ - Storage.getItem('tunnel/token'), - Storage.getItem('tunnel/subdomain'), - Storage.getItem('tunnel/url') - ]) - const tunnelOpts = { port: serverPort, host: tunnelHost } - if (tunnelToken && tunnelSubdomain) { - tunnelOpts.tunnelToken = tunnelToken - tunnelOpts.subdomain = tunnelSubdomain - logger.info('Recreating tunnel... with subdomain: ' + tunnelSubdomain) - } else { - logger.info('Creating new tunnel... ') - } - const tunnel = await localtunnel(tunnelOpts) - tunnelRef = tunnel - logger.info('Tunnel created! connect to: ' + tunnel.url) - const dataToQr = JSON.stringify({ - internalIP: tunnel.url, - walletPort: 443, - externalIP: tunnel.url - }) - qrcode.generate(dataToQr, { small: true }) - if (!tunnelToken) { - await Promise.all([ - Storage.setItem('tunnel/token', tunnel.token), - Storage.setItem('tunnel/subdomain', tunnel.clientId), - Storage.setItem('tunnel/url', tunnel.url) - ]) - } - if (tunnelUrl && tunnel.url !== tunnelUrl) { - logger.error('New tunnel URL different from OLD tunnel url') - logger.error('OLD: ' + tunnelUrl + ':80') - logger.error('NEW: ' + tunnel.url + ':80') - logger.error('New pair required') - await Promise.all([ - Storage.setItem('tunnel/token', tunnel.token), - Storage.setItem('tunnel/subdomain', tunnel.clientId), - Storage.setItem('tunnel/url', tunnel.url) - ]) - } - } + }) /* + if (false) { + await Storage.removeItem('tunnel/token') + await Storage.removeItem('tunnel/subdomain') + await Storage.removeItem('tunnel/url') + }*/ const storePersistentRandomField = async ({ fieldName, length = 16 }) => { const randomField = await Storage.getItem(fieldName) @@ -320,7 +256,7 @@ const server = program => { return randomField } - const newValue = await Encryption.generateRandomString() + const newValue = await ECC.generateRandomString(length) await Storage.setItem(fieldName, newValue) return newValue } @@ -345,7 +281,7 @@ const server = program => { }) ) app.use(bodyParser.urlencoded({ extended: 'true' })) - app.use(bodyParser.json()) + app.use(bodyParser.json({ limit: '500kb' })) app.use(bodyParser.json({ type: 'application/vnd.api+json' })) app.use(methodOverride()) // WARNING @@ -358,22 +294,21 @@ const server = program => { res.status(500).send({ status: 500, errorMessage: 'internal error' }) }) - const CA = LightningServices.servicesConfig.lndCertPath - const CA_KEY = CA.replace('cert', 'key') + const CA = program.httpsCert + const CA_KEY = program.httpsCertKey const createServer = () => { try { - // if (LightningServices.servicesConfig.lndCertPath && program.usetls) { - // const [key, cert] = await Promise.all([ - // FS.readFile(CA_KEY), - // FS.readFile(CA) - // ]) - // const httpsServer = Https.createServer({ key, cert }, app) + if (program.useTLS) { + const key = FS.readFileSync(CA_KEY, 'utf-8') + const cert = FS.readFileSync(CA, 'utf-8') - // return httpsServer - // } + const httpsServer = Https.createServer({ key, cert }, app) - const httpServer = Http.Server(app) + return httpsServer + } + + const httpServer = new Http.Server(app) return httpServer } catch (err) { logger.error(err.message) @@ -381,7 +316,7 @@ const server = program => { 'An error has occurred while finding an LND cert to use to open an HTTPS server' ) logger.warn('Falling back to opening an HTTP server...') - const httpServer = Http.Server(app) + const httpServer = new Http.Server(app) return httpServer } } @@ -392,8 +327,9 @@ const server = program => { parser: binaryParser, transports: ['websocket', 'polling'], cors: { - origin: '*', - methods: ['OPTIONS', 'POST', 'GET', 'PUT', 'DELETE'], + origin: (origin, callback) => { + callback(null, true) + }, allowedHeaders: [ 'Origin', 'X-Requested-With', @@ -407,21 +343,21 @@ const server = program => { } }) - const Sockets = require('./sockets')(io) - require('./routes')( app, { ...defaults, - lndAddress: program.lndAddress + lndAddress: program.lndAddress, + cliArgs: program }, - Sockets, { - serverHost, serverPort, - usetls: program.usetls, + useTLS: program.useTLS, CA, - CA_KEY + CA_KEY, + runPrivateKey, + runPublicKey, + accessSecret } ) @@ -430,21 +366,67 @@ const server = program => { // app.use(bodyParser.json({limit: '100000mb'})); app.use(bodyParser.json({ limit: '50mb' })) app.use(bodyParser.urlencoded({ limit: '50mb', extended: true })) - if (process.env.DISABLE_SHOCK_ENCRYPTION !== 'true') { + if (process.env.SHOCK_ENCRYPTION_ECC !== 'false') { app.use(modifyResponseBody) } + if (program.tunnel) { + const [relayToken, relayId, relayUrl] = await Promise.all([ + Storage.getItem('relay/token'), + Storage.getItem('relay/id'), + Storage.getItem('relay/url') + ]) + const opts = { + relayId, + relayToken, + address: tunnelHost, + port: serverPort + } + logger.info(opts) + relayClient.default(opts, async (connected, params) => { + if (connected) { + const noProtocolAddress = params.address.replace( + /^http(?s)?:\/\//giu, + '' + ) + await Promise.all([ + Storage.setItem('relay/token', params.relayToken), + Storage.setItem('relay/id', params.relayId), + Storage.setItem('relay/url', noProtocolAddress) + ]) + const dataToQr = JSON.stringify({ + URI: `https://${params.relayId}@${noProtocolAddress}`, + // Null-check is just to please typescript + accessSecret: accessSecretBase64 + }) + qrcode.generate(dataToQr, { small: false }) + logger.info(`connect to ${params.relayId}@${noProtocolAddress}:443`) + console.log('\n') + console.log(`Here's your access secret:`) + console.log('\n') + console.log(accessSecretBase64) + console.log('\n') + console.log('\n') + } else { + logger.error('!! Relay did not connect to server !!') + } + }) + } else { + console.log('\n') + console.log(`Here's your access secret:`) + console.log('\n') + console.log(accessSecretBase64) + console.log('\n') + console.log('\n') + } + serverInstance.listen(serverPort, serverHost) - logger.info('App listening on ' + serverHost + ' port ' + serverPort) - + // @ts-expect-error module.server = serverInstance } catch (err) { logger.error({ exception: err, message: err.message, code: err.code }) logger.info('Restarting server in 30 seconds...') - if (tunnelRef) { - tunnelRef.close() - } await wait(30) startServer() return false diff --git a/src/sockets.js b/src/sockets.js index 19fe8280..2e908de4 100644 --- a/src/sockets.js +++ b/src/sockets.js @@ -3,22 +3,16 @@ */ // @ts-check -const logger = require('winston') +const logger = require('../config/log') const Common = require('shock-common') const mapValues = require('lodash/mapValues') const auth = require('../services/auth/auth') -const Encryption = require('../utils/encryptionStore') const LightningServices = require('../utils/lightningServices') -const { - getGun, - getUser, - isAuthenticated -} = require('../services/gunDB/Mediator') -const { deepDecryptIfNeeded } = require('../services/gunDB/rpc') -const GunEvents = require('../services/gunDB/contact-api/events') -const SchemaManager = require('../services/schema') +const { isAuthenticated } = require('../services/gunDB/Mediator') +const initGunDBSocket = require('../services/gunDB/sockets') const { encryptedEmit, encryptedOn } = require('../utils/ECC/socket') +const TipsForwarder = require('../services/tipsCallback') /** * @typedef {import('../services/gunDB/Mediator').SimpleSocket} SimpleSocket * @typedef {import('../services/gunDB/contact-api/SimpleGUN').ValidDataValue} ValidDataValue @@ -28,204 +22,7 @@ module.exports = ( /** @type {import('socket.io').Server} */ io ) => { - // This should be used for encrypting and emitting your data - const encryptedEmitLegacy = ({ eventName, data, socket }) => { - try { - if (Encryption.isNonEncrypted(eventName)) { - return socket.emit(eventName, data) - } - - const deviceId = socket.handshake.auth['x-shockwallet-device-id'] - const authorized = Encryption.isAuthorizedDevice({ deviceId }) - - if (!deviceId) { - throw { - field: 'deviceId', - message: 'Please specify a device ID' - } - } - - if (!authorized) { - throw { - field: 'deviceId', - message: 'Please exchange keys with the API before using the socket' - } - } - - const encryptedMessage = Encryption.encryptMessage({ - message: data, - deviceId - }) - - return socket.emit(eventName, encryptedMessage) - } catch (err) { - logger.error( - `[SOCKET] An error has occurred while encrypting an event (${eventName}):`, - err - ) - - return socket.emit('encryption:error', err) - } - } - - const onNewInvoice = (socket, subID) => { - const { lightning } = LightningServices.services - logger.warn('Subscribing to invoices socket...' + subID) - const stream = lightning.subscribeInvoices({}) - stream.on('data', data => { - logger.info('[SOCKET] New invoice data:', data) - encryptedEmitLegacy({ eventName: 'invoice:new', data, socket }) - if (!data.settled) { - return - } - SchemaManager.AddOrder({ - type: 'invoice', - amount: parseInt(data.amt_paid_sat, 10), - coordinateHash: data.r_hash.toString('hex'), - coordinateIndex: parseInt(data.add_index, 10), - inbound: true, - toLndPub: data.payment_addr - }) - }) - stream.on('end', () => { - logger.info('New invoice stream ended, starting a new one...') - // Prevents call stack overflow exceptions - //process.nextTick(() => onNewInvoice(socket)) - }) - stream.on('error', err => { - logger.error('New invoice stream error:' + subID, err) - }) - stream.on('status', status => { - logger.warn('New invoice stream status:' + subID, status) - switch (status.code) { - case 0: { - logger.info('[event:invoice:new] stream ok') - break - } - case 1: { - logger.info( - '[event:invoice:new] stream canceled, probably socket disconnected' - ) - break - } - case 2: { - logger.warn('[event:invoice:new] got UNKNOWN error status') - break - } - case 12: { - logger.warn( - '[event:invoice:new] LND locked, new registration in 60 seconds' - ) - process.nextTick(() => - setTimeout(() => onNewInvoice(socket, subID), 60000) - ) - break - } - case 13: { - //https://grpc.github.io/grpc/core/md_doc_statuscodes.html - logger.error('[event:invoice:new] INTERNAL LND error') - break - } - case 14: { - logger.error( - '[event:invoice:new] LND disconnected, sockets reconnecting in 30 seconds...' - ) - process.nextTick(() => - setTimeout(() => onNewInvoice(socket, subID), 30000) - ) - break - } - default: { - logger.error('[event:invoice:new] UNKNOWN LND error') - } - } - }) - return () => { - stream.cancel() - } - } - - const onNewTransaction = (socket, subID) => { - const { lightning } = LightningServices.services - const stream = lightning.subscribeTransactions({}) - logger.warn('Subscribing to transactions socket...' + subID) - stream.on('data', data => { - logger.info('[SOCKET] New transaction data:', data) - - Promise.all(data.dest_addresses.map(SchemaManager.isTmpChainOrder)).then( - responses => { - const hasOrder = responses.some(res => res !== false) - if (hasOrder && data.num_confirmations > 0) { - //buddy needs to manage this - } else { - //business as usual - encryptedEmitLegacy({ eventName: 'transaction:new', data, socket }) - } - } - ) - }) - stream.on('end', () => { - logger.info('New transactions stream ended, starting a new one...') - //process.nextTick(() => onNewTransaction(socket)) - }) - stream.on('error', err => { - logger.error('New transactions stream error:' + subID, err) - }) - stream.on('status', status => { - logger.info('New transactions stream status:' + subID, status) - switch (status.code) { - case 0: { - logger.info('[event:transaction:new] stream ok') - break - } - case 1: { - logger.info( - '[event:transaction:new] stream canceled, probably socket disconnected' - ) - break - } - case 2: { - //Happens to fire when the grpc client lose access to macaroon file - logger.warn('[event:transaction:new] got UNKNOWN error status') - break - } - case 12: { - logger.warn( - '[event:transaction:new] LND locked, new registration in 60 seconds' - ) - process.nextTick(() => - setTimeout(() => onNewTransaction(socket, subID), 60000) - ) - break - } - case 13: { - //https://grpc.github.io/grpc/core/md_doc_statuscodes.html - logger.error('[event:transaction:new] INTERNAL LND error') - break - } - case 14: { - logger.error( - '[event:transaction:new] LND disconnected, sockets reconnecting in 30 seconds...' - ) - process.nextTick(() => - setTimeout(() => onNewTransaction(socket, subID), 30000) - ) - break - } - default: { - logger.error('[event:transaction:new] UNKNOWN LND error') - } - } - }) - return () => { - stream.cancel() - } - } - - io.on('connection', socket => { - logger.info(`io.onconnection`) - logger.info('socket.handshake', socket.handshake) - + io.on('connect', socket => { const isLNDSocket = !!socket.handshake.auth.IS_LND_SOCKET const isNotificationsSocket = !!socket.handshake.auth .IS_NOTIFICATIONS_SOCKET @@ -239,89 +36,6 @@ module.exports = ( const subID = Math.floor(Math.random() * 1000).toString() const isNotifications = isNotificationsSocket ? 'notifications' : '' logger.info('[LND] New LND Socket created:' + isNotifications + subID) - /* not used by wallet anymore - const cancelInvoiceStream = onNewInvoice(socket, subID) - const cancelTransactionStream = onNewTransaction(socket, subID) - socket.on('disconnect', () => { - logger.info('LND socket disconnected:' + isNotifications + subID) - cancelInvoiceStream() - cancelTransactionStream() - })*/ - } - }) - - io.of('gun').on('connect', socket => { - // TODO: off() - - try { - if (!isAuthenticated()) { - socket.emit(Common.Constants.ErrorCode.NOT_AUTH) - return - } - - const emit = encryptedEmit(socket) - - const { $shock, publicKeyForDecryption } = socket.handshake.auth - - const [root, path, method] = $shock.split('::') - - // eslint-disable-next-line init-declarations - let node - - if (root === '$gun') { - node = getGun() - } else if (root === '$user') { - node = getUser() - } else { - node = getGun().user(root) - } - - for (const bit of path.split('>')) { - node = node.get(bit) - } - - /** - * @param {ValidDataValue} data - * @param {string} key - */ - const listener = async (data, key) => { - try { - if ( - typeof publicKeyForDecryption === 'string' && - publicKeyForDecryption !== 'undefined' && - publicKeyForDecryption.length > 15 - ) { - const decData = await deepDecryptIfNeeded( - data, - publicKeyForDecryption - ) - - emit('$shock', decData, key) - } else { - emit('$shock', data, key) - } - } catch (err) { - logger.error( - `Error for gun rpc socket, query ${$shock} -> ${err.message}` - ) - } - } - - if (method === 'on') { - node.on(listener) - } else if (method === 'open') { - node.open(listener) - } else if (method === 'map.on') { - node.map().on(listener) - } else if (method === 'map.once') { - node.map().once(listener) - } else { - throw new TypeError( - `Invalid method for gun rpc call : ${method}, query: ${$shock}` - ) - } - } catch (err) { - logger.error('GUNRPC: ' + err.message) } }) @@ -333,6 +47,10 @@ module.exports = ( */ try { + logger.info( + 'Connect event for socket with handshake: ', + socket.handshake.auth + ) if (!isAuthenticated()) { socket.emit(Common.Constants.ErrorCode.NOT_AUTH) return @@ -343,7 +61,16 @@ module.exports = ( const { services } = LightningServices - const { service, method, args: unParsed } = socket.handshake.auth + const { + service, + method, + args: unParsed, + isInitial + } = socket.handshake.auth + + if (isInitial) { + return + } const args = JSON.parse(unParsed) @@ -386,10 +113,15 @@ module.exports = ( call.write(args) }) } catch (err) { + logger.error(err) logger.error('LNDRPC: ' + err.message) } }) + io.of('gun').on('connect', socket => { + initGunDBSocket(socket) + }) + /** * @param {string} token * @returns {Promise} @@ -414,7 +146,7 @@ module.exports = ( /** @type {null|NodeJS.Timeout} */ let pingIntervalID = null - + // TODO: Unused? io.of('shockping').on( 'connect', // TODO: make this sync @@ -466,225 +198,15 @@ module.exports = ( } ) - // TODO: do this through rpc - - const emptyUnsub = () => {} - - let chatsUnsub = emptyUnsub - - io.of('chats').on('connect', async socket => { - const on = encryptedOn(socket) - const emit = encryptedEmit(socket) - - try { - if (!isAuthenticated()) { - logger.info( - 'not authenticated in gun for chats socket, will send NOT_AUTH' - ) - emit(Common.Constants.ErrorCode.NOT_AUTH) - - return + io.of('streams').on('connect', socket => { + logger.info('a user connected') + socket.on('accessId', accessId => { + const err = TipsForwarder.addSocket(accessId, socket) + if (err) { + logger.info('err invalid socket for tips notifications ' + err) + socket.disconnect(true) } - - logger.info('now checking token for chats socket') - const { token } = socket.handshake.auth - const isAuth = await isValidToken(token) - - if (!isAuth) { - logger.warn('invalid token for chats socket') - emit(Common.Constants.ErrorCode.NOT_AUTH) - return - } - - if (chatsUnsub !== emptyUnsub) { - logger.error( - 'Tried to set chats socket twice, this might be due to an app restart and the old socket not being recycled by socket.io in time, will disable the older subscription, which means the old socket wont work and data will be sent to this new socket instead' - ) - chatsUnsub() - chatsUnsub = emptyUnsub - } - - /** - * @param {Common.Schema.Chat[]} chats - */ - const onChats = chats => { - const processed = chats.map( - ({ - didDisconnect, - id, - lastSeenApp, - messages, - recipientPublicKey - }) => { - /** @type {Common.Schema.Chat} */ - const stripped = { - didDisconnect, - id, - lastSeenApp, - messages, - recipientAvatar: null, - recipientDisplayName: null, - recipientPublicKey - } - - return stripped - } - ) - - emit('$shock', processed) - } - - chatsUnsub = GunEvents.onChats(onChats) - - on('disconnect', () => { - chatsUnsub() - chatsUnsub = emptyUnsub - }) - } catch (e) { - logger.error('Error inside chats socket connect: ' + e.message) - emit('$error', e.message) - } + }) }) - - let sentReqsUnsub = emptyUnsub - - io.of('sentReqs').on('connect', async socket => { - const on = encryptedOn(socket) - const emit = encryptedEmit(socket) - - try { - if (!isAuthenticated()) { - logger.info( - 'not authenticated in gun for sentReqs socket, will send NOT_AUTH' - ) - emit(Common.Constants.ErrorCode.NOT_AUTH) - - return - } - - logger.info('now checking token for sentReqs socket') - const { token } = socket.handshake.auth - const isAuth = await isValidToken(token) - - if (!isAuth) { - logger.warn('invalid token for sentReqs socket') - emit(Common.Constants.ErrorCode.NOT_AUTH) - return - } - - if (sentReqsUnsub !== emptyUnsub) { - logger.error( - 'Tried to set sentReqs socket twice, this might be due to an app restart and the old socket not being recycled by io in time, will disable the older subscription, which means the old socket wont work and data will be sent to this new socket instead' - ) - sentReqsUnsub() - sentReqsUnsub = emptyUnsub - } - - /** - * @param {Common.Schema.SimpleSentRequest[]} sentReqs - */ - const onSentReqs = sentReqs => { - const processed = sentReqs.map( - ({ - id, - recipientChangedRequestAddress, - recipientPublicKey, - timestamp - }) => { - /** - * @type {Common.Schema.SimpleSentRequest} - */ - const stripped = { - id, - recipientAvatar: null, - recipientChangedRequestAddress, - recipientDisplayName: null, - recipientPublicKey, - timestamp - } - - return stripped - } - ) - emit('$shock', processed) - } - - sentReqsUnsub = GunEvents.onSimplerSentRequests(onSentReqs) - - on('disconnect', () => { - sentReqsUnsub() - sentReqsUnsub = emptyUnsub - }) - } catch (e) { - logger.error('Error inside sentReqs socket connect: ' + e.message) - emit('$error', e.message) - } - }) - - let receivedReqsUnsub = emptyUnsub - - io.of('receivedReqs').on('connect', async socket => { - const on = encryptedOn(socket) - const emit = encryptedEmit(socket) - try { - if (!isAuthenticated()) { - logger.info( - 'not authenticated in gun for receivedReqs socket, will send NOT_AUTH' - ) - emit(Common.Constants.ErrorCode.NOT_AUTH) - - return - } - - logger.info('now checking token for receivedReqs socket') - const { token } = socket.handshake.auth - const isAuth = await isValidToken(token) - - if (!isAuth) { - logger.warn('invalid token for receivedReqs socket') - emit(Common.Constants.ErrorCode.NOT_AUTH) - return - } - - if (receivedReqsUnsub !== emptyUnsub) { - logger.error( - 'Tried to set receivedReqs socket twice, this might be due to an app restart and the old socket not being recycled by socket.io in time, will disable the older subscription, which means the old socket wont work and data will be sent to this new socket instead' - ) - receivedReqsUnsub() - receivedReqsUnsub = emptyUnsub - } - - /** - * @param {ReadonlyArray} receivedReqs - */ - const onReceivedReqs = receivedReqs => { - const processed = receivedReqs.map(({ id, requestorPK, timestamp }) => { - /** @type {Common.Schema.SimpleReceivedRequest} */ - const stripped = { - id, - requestorAvatar: null, - requestorDisplayName: null, - requestorPK, - timestamp - } - - return stripped - }) - - emit('$shock', processed) - } - - receivedReqsUnsub = GunEvents.onSimplerReceivedRequests(onReceivedReqs) - - on('disconnect', () => { - receivedReqsUnsub() - receivedReqsUnsub = emptyUnsub - }) - } catch (e) { - logger.error('Error inside receivedReqs socket connect: ' + e.message) - emit('$error', e.message) - } - }) - return io } diff --git a/src/tunnel.js b/src/tunnel.js new file mode 100644 index 00000000..4d1c2b26 --- /dev/null +++ b/src/tunnel.js @@ -0,0 +1,59 @@ +const localtunnel = require('localtunnel') +let tunnelRef = null +process.on('message', async (tunnelOpts) => { + const tunnel = await localtunnel(tunnelOpts) + tunnelRef = tunnel + console.log(tunnelOpts) + const {subdomain:tunnelSubdomain} = tunnelOpts + process.send({ type: 'info', tunnel:{ + url:tunnel.url, + token:tunnel.token, + clientId:tunnel.clientId, + } }); + if(tunnelSubdomain !== tunnel.clientId && !tunnel.token){ + console.log("AM killing it yo!") + console.log(tunnel.clientId) + tunnel.close() + // eslint-disable-next-line no-process-exit + process.exit() + } +}); + +setInterval(() => { + process.send({ type: "ping" }); +}, 1000); + + +process.on('uncaughtException', ()=> { + if(tunnelRef){ + console.log("clogin yo") + tunnelRef.close() + } + // eslint-disable-next-line no-process-exit + process.exit() +}); +process.on('SIGINT', ()=>{ + if(tunnelRef){ + console.log("clogin yo") + tunnelRef.close() + } + // eslint-disable-next-line no-process-exit + process.exit()}) +process.on('exit', ()=> { + if(tunnelRef){ + console.log("clogin yo") + tunnelRef.close() + } +}); +/* +const f = async () => { + const tunnelOpts = + { port: 9835, host: 'https://tunnel.rip' , + tunnelToken:'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7InRpbWVzdGFtcCI6MTYxODg2NTAxNjkzNywic3ViZG9tYWluIjoidGVycmlibGUtZWFyd2lnLTU2In0sImlhdCI6MTYxODg2NTAxNiwiZXhwIjo1MjE4ODY1MDE2fQ.m2H4B1NatErRqcriB9lRfusZmLdRee9-VXACfnKT-QY', + subdomain:'terrible-earwig-56' + } + const tunnel = await localtunnel(tunnelOpts) + console.log(tunnel) + tunnelRef = tunnel +} +f()*/ \ No newline at end of file diff --git a/testscript.js b/testscript.js new file mode 100644 index 00000000..4bb0446f --- /dev/null +++ b/testscript.js @@ -0,0 +1,158 @@ +/** + * @format + * Example usage: + * ```bash + * node testcript.js on [user|gun|capdog|{publicKey}].[path] [alias] [pass] + * ``` + * If no alias/pass provided, new user will be created, otherwise gun will + * authenticate with the provided credentials. + */ +// @ts-check +const Gun = require('gun') +const randomWords = require('random-words') + +/** @returns {string} */ +const randomWord = () => { + const word = randomWords() + if (typeof word !== 'string') { + throw new TypeError(`Not string`) + } + return word +} + +require('gun/nts') +require('gun/lib/open') +require('gun/lib/load') + +const args = process.argv.slice(2) + +// eslint-disable-next-line prefer-const +let [method, path, alias, pass] = args + +const fileName = randomWord() + +if (!alias) { + alias = '$$__GENERATE' +} + +if (!pass) { + pass = '$$__GENERATE' +} + +console.log('\n') +console.log(`method: ${method}`) +console.log(`path: ${path}`) +console.log(`fileName: ${fileName}`) +console.log('\n') + +// @ts-expect-error +const gun = /** @type {import('./services/gunDB/contact-api/SimpleGUN').GUNNode} */ (Gun( + { + axe: false, + multicast: false, + peers: ['https://gun.shock.network/gun', 'https://gun-eu.shock.network'], + file: `TESTSCRIPT-RADATA/${fileName}` + } +)) + +const user = gun.user() + +/** + * @param {any} data + * @param {string} key + */ +const cb = (data, key) => { + console.log('\n') + console.log(`key: ${key}`) + console.log('\n') + console.log(data) + console.log('\n') +} + +;(async () => { + try { + // gun + // .get('handshakeNodes') + // .map() + // .once(cb) + + // wait for user data to be received + // await new Promise(res => setTimeout(res, 10000)) + + const ack = await new Promise(res => { + if (alias === '$$__GENERATE' || pass === '$$__GENERATE') { + alias = randomWord() + pass = randomWord() + console.log(`alias: ${alias}`) + console.log(`pass: ${pass}`) + + user.create(alias, pass, _ack => { + res(_ack) + }) + } else { + user.auth(alias, pass, _ack => { + res(_ack) + }) + } + }) + + if (typeof ack.err === 'string') { + throw new Error(ack.err) + } else if (typeof ack.pub === 'string' || typeof user._.sea === 'object') { + console.log(`\n`) + console.log(`public key:`) + console.log(`\n`) + console.log(ack.pub || user._.sea.pub) + console.log(`\n`) + + // clock skew + await new Promise(res => setTimeout(res, 2000)) + } else { + throw new Error('unknown error, ack: ' + JSON.stringify(ack)) + } + + const [root, ...keys] = path.split('.') + + let node = (() => { + if (root === 'gun') { + return gun + } + if (root === 'user') { + return user + } + if (root === 'capdog') { + return gun.user( + 'qsgziGQS99sPUxV1CRwwRckn9cG6cJ3prbDsrbL7qko.oRbCaVKwJFQURWrS1pFhkfAzrkEvkQgBRIUz9uoWtrg' + ) + } + if (root === 'explorador') { + return gun.user( + `zBQkPb1ohbdjVp_29TKFXyv_0g3amKgRJRqKr0E-Oyk.yB1P4UmOrzkGuPEL5zUgLETJWyYpM9K3l2ycNlt8jiY` + ) + } + if (root === 'pleb') { + return gun.user( + `e1C60yZ1Cm3Mkceq7L9SmH6QQ7zsDdbibPFeQz7tNsk._1VlqJNo8BIJmzz2D5WELiMiRjBh3DBlDvzC6fNltZw` + ) + } + if (root === 'boblazar') { + return gun.user( + `g6fcZ_1zyFwV1jR1eNK1GTUr2sSlEDL1D5vBsSvKoKg.2OA9MQHO2c1wjv6L-VPBFf36EZXjgQ1nnZFbOE9_5-o` + ) + } + + return gun.user(root) + })() + + keys.forEach(key => (node = node.get(key))) + + if (method === 'once') node.once(cb) + if (method === 'load') node.load(cb) + if (method === 'on') node.on(cb) + if (method === 'map.once') node.map().once(cb) + if (method === 'map.on') node.map().on(cb) + } catch (e) { + console.log(`\nCaught error in app:\n`) + console.log(e) + } +})() diff --git a/tsconfig.json b/tsconfig.json index da9874a9..9ee816c3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,6 @@ { "include": ["./services/gunDB/**/*.*", "./utils/lightningServices/**/*.*"], + "exclude": ["./node_modules/**/*.*"], "compilerOptions": { /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ @@ -20,7 +21,7 @@ // "removeComments": true, /* Do not emit comments to output. */ "noEmit": true /* Do not emit outputs. */, // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + "downlevelIteration": true /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */, // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ /* Strict Type-Checking Options */ @@ -47,7 +48,7 @@ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ @@ -60,5 +61,6 @@ /* Experimental Options */ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + "useUnknownInCatchVariables": false } } diff --git a/utils/ECC/ECC.js b/utils/ECC/ECC.js new file mode 100644 index 00000000..e72db2e5 --- /dev/null +++ b/utils/ECC/ECC.js @@ -0,0 +1,233 @@ +/** @format */ +const Storage = require('node-persist') +const { fork } = require('child_process') + +const FieldError = require('../fieldError') +const logger = require('../../config/log') +const { + generateRandomString, + convertBufferToBase64, + processKey, + convertToEncryptedMessageResponse, + convertUTF8ToBuffer, + convertToEncryptedMessage, + convertBase64ToBuffer +} = require('./crypto') +const { invoke } = require('./subprocess') + +const cryptoSubprocess = fork('utils/ECC/subprocess') + +const nodeKeyPairs = new Map() +const devicePublicKeys = new Map() + +/** + * @typedef {object} EncryptedMessage + * @prop {string} ciphertext + * @prop {string} iv + * @prop {string} mac + * @prop {string} ephemPublicKey + */ + +/** + * Checks if the message supplied is encrypted or not + * @param {EncryptedMessage} message + */ +const isEncryptedMessage = message => + message && + message.ciphertext && + message.iv && + message.mac && + message.ephemPublicKey + +/** + * @typedef {object} Pair + * @prop {Buffer} privateKey + * @prop {Buffer} publicKey + * @prop {string} privateKeyBase64 + * @prop {string} publicKeyBase64 + */ + +/** + * Generates a new encryption key pair that will be used + * when communicating with the deviceId specified + * @param {string} deviceId + * @returns {Promise} + */ +const generateKeyPair = async deviceId => { + try { + const existingKey = nodeKeyPairs.get(deviceId) + + if (existingKey) { + logger.info('Device ID is already trusted') + return { + ...existingKey, + publicKeyBase64: convertBufferToBase64(existingKey.publicKey), + privateKeyBase64: convertBufferToBase64(existingKey.privateKey) + } + } + + const privateKey = await invoke('generatePrivate', [], cryptoSubprocess) + const publicKey = await invoke('getPublic', [privateKey], cryptoSubprocess) + const privateKeyBase64 = convertBufferToBase64(privateKey) + const publicKeyBase64 = convertBufferToBase64(publicKey) + + if (!Buffer.isBuffer(privateKey) || !Buffer.isBuffer(publicKey)) { + throw new Error('Invalid KeyPair Generated') + } + + nodeKeyPairs.set(deviceId, { + privateKey, + publicKey + }) + + return { + privateKey, + publicKey, + privateKeyBase64, + publicKeyBase64 + } + } catch (err) { + logger.error( + '[ENCRYPTION] An error has occurred while generating a new KeyPair', + err + ) + logger.error('Device ID:', deviceId) + + throw err + } +} + +/** + * Checks if the specified device has a keypair generated + * @param {{ deviceId: string }} arg0 + */ +const isAuthorizedDevice = ({ deviceId }) => devicePublicKeys.has(deviceId) + +/** + * Generates a new keypair for the deviceId specified and + * saves its publicKey locally + * @param {{ deviceId: string, publicKey: string }} arg0 + */ +const authorizeDevice = async ({ deviceId, publicKey }) => { + const hostId = await Storage.get('encryption/hostId') + devicePublicKeys.set(deviceId, convertBase64ToBuffer(publicKey)) + const keyPair = await generateKeyPair(deviceId) + + return { + success: true, + APIPublicKey: keyPair.publicKeyBase64, + hostId + } +} + +/** + * Encrypts the specified message using the specified deviceId's + * public key + * @param {{ deviceId: string, message: string | number | boolean }} arg0 + * @returns {Promise} + */ +const encryptMessage = async ({ message = '', deviceId }) => { + const parsedMessage = message.toString() + // decryptMessage checks for known devices while this one checks for + // authorized ones instead, why? + const publicKey = devicePublicKeys.get(deviceId) + + if (!publicKey) { + throw new FieldError({ + field: 'deviceId', + message: 'encryptMessage() -> Unauthorized Device ID detected' + }) + } + + const processedPublicKey = processKey(publicKey) + const messageBuffer = convertUTF8ToBuffer(parsedMessage) + const encryptedMessage = await invoke( + 'encrypt', + [processedPublicKey, messageBuffer], + cryptoSubprocess + ) + + const encryptedMessageResponse = { + ciphertext: encryptedMessage.ciphertext, + iv: encryptedMessage.iv, + mac: encryptedMessage.mac, + ephemPublicKey: encryptedMessage.ephemPublicKey, + metadata: { + _deviceId: deviceId, + _publicKey: publicKey + } + } + + return convertToEncryptedMessageResponse(encryptedMessageResponse) +} + +/** + * Decrypts the specified message using the API keypair + * associated with the specified deviceId + * @param {{ encryptedMessage: import('./crypto').EncryptedMessageResponse, deviceId: string }} arg0 + */ +const decryptMessage = async ({ encryptedMessage, deviceId }) => { + // encryptMessages checks for authorized devices while this one checks for + // known ones, why? + const keyPair = nodeKeyPairs.get(deviceId) + try { + if (!keyPair) { + throw new FieldError({ + field: 'deviceId', + message: 'decryptMessage() -> Unknown Device ID detected' + }) + } + + const processedPrivateKey = processKey(keyPair.privateKey) + const decryptedMessage = await invoke( + 'decrypt', + [processedPrivateKey, convertToEncryptedMessage(encryptedMessage)], + cryptoSubprocess + ) + const parsedMessage = decryptedMessage.toString('utf8') + + return parsedMessage + } catch (err) { + logger.error(err) + if (err.message?.toLowerCase() === 'bad mac') { + logger.error( + 'Bad Mac!', + err, + convertToEncryptedMessage(encryptedMessage), + !!keyPair + ) + } + throw err + } +} + +/** + * @returns {Promise} + */ +const generatePrivate = () => invoke('generatePrivate', [], cryptoSubprocess) + +/** + * @param {Buffer} priv + * @returns {Promise} + */ +const getPublic = priv => invoke('getPublic', [priv], cryptoSubprocess) + +module.exports = { + isAuthorizedDevice, + isEncryptedMessage, + generateKeyPair, + encryptMessage, + decryptMessage, + authorizeDevice, + generateRandomString, + nodeKeyPairs, + devicePublicKeys, + generatePrivate, + getPublic, + /** + * Used for tests. + */ + killECCCryptoSubprocess() { + cryptoSubprocess.kill() + } +} diff --git a/utils/ECC/ECC.spec.js b/utils/ECC/ECC.spec.js new file mode 100644 index 00000000..5c4bff45 --- /dev/null +++ b/utils/ECC/ECC.spec.js @@ -0,0 +1,147 @@ +/** + * @format + */ +// @ts-check +const Path = require('path') +const Storage = require('node-persist') +const expect = require('expect') +const words = require('random-words') + +const { + authorizeDevice, + decryptMessage, + encryptMessage, + generateKeyPair, + isAuthorizedDevice, + killECCCryptoSubprocess, + generatePrivate, + getPublic +} = require('./ECC') + +const uuid = () => { + const arr = /** @type {string[]} */ (words({ exactly: 24 })) + return arr.join('-') +} + +const storageDirectory = Path.resolve(__dirname, `./.test-storage`) + +console.log(`Storage directory: ${storageDirectory}`) + +describe('ECC', () => { + describe('generateKeyPair()', () => { + it('generates a keypair', async () => { + expect.hasAssertions() + const pair = await generateKeyPair(uuid()) + + expect(pair.privateKey).toBeInstanceOf(Buffer) + expect(typeof pair.privateKeyBase64 === 'string').toBeTruthy() + expect(pair.publicKey).toBeInstanceOf(Buffer) + expect(typeof pair.publicKeyBase64 === 'string').toBeTruthy() + }) + it('returns the same pair for the same device', async () => { + expect.hasAssertions() + const id = uuid() + const pair = await generateKeyPair(id) + const pairAgain = await generateKeyPair(id) + + expect(pairAgain).toStrictEqual(pair) + }) + }) + + describe('authorizeDevice()/isAuthorizedDevice()', () => { + it('authorizes a device given its ID', async () => { + expect.hasAssertions() + await Storage.init({ + dir: storageDirectory + }) + const deviceId = uuid() + const pair = await generateKeyPair(deviceId) + await authorizeDevice({ deviceId, publicKey: pair.publicKeyBase64 }) + expect(isAuthorizedDevice({ deviceId })).toBeTruthy() + }) + }) + + describe('encryptMessage()/decryptMessage()', () => { + before(() => + Storage.init({ + dir: storageDirectory + }) + ) + it('throws if provided with an unauthorized device id when encrypting', async () => { + expect.hasAssertions() + const deviceId = uuid() + + try { + await encryptMessage({ + message: uuid(), + deviceId + }) + throw new Error('encryptMessage() did not throw') + } catch (_) { + expect(true).toBeTruthy() + } + }) + it('throws if provided with an unknown device id when decrypting', async () => { + expect.hasAssertions() + const deviceId = uuid() + + try { + await decryptMessage({ + deviceId, + encryptedMessage: { + ciphertext: uuid(), + ephemPublicKey: uuid(), + iv: uuid(), + mac: uuid(), + metadata: uuid() + } + }) + throw new Error('decryptMessage() did not throw') + } catch (_) { + expect(true).toBeTruthy() + } + }) + it('encrypts and decrypts messages when given a known device id', async () => { + expect.hasAssertions() + const deviceId = uuid() + + const pair = await generateKeyPair(deviceId) + + await authorizeDevice({ deviceId, publicKey: pair.publicKeyBase64 }) + + const message = 'Bitcoin fixes this' + + const encryptedMessage = await encryptMessage({ deviceId, message }) + + const decrypted = await decryptMessage({ + deviceId, + encryptedMessage + }) + + expect(decrypted).toEqual(message) + }) + }) + + describe('generatePrivate()', () => { + it('generates a private key', async () => { + expect.hasAssertions() + + const priv = await generatePrivate() + + expect(priv).toBeInstanceOf(Buffer) + }) + }) + + describe('getPublic()', () => { + it('derives a public key from a private key', async () => { + expect.hasAssertions() + + const priv = await generatePrivate() + const pub = await getPublic(priv) + + expect(pub).toBeInstanceOf(Buffer) + }) + }) + + after(killECCCryptoSubprocess) +}) diff --git a/utils/ECC/crypto.js b/utils/ECC/crypto.js index 51acbdbe..7f17e6f8 100644 --- a/utils/ECC/crypto.js +++ b/utils/ECC/crypto.js @@ -1,5 +1,14 @@ -const { Buffer } = require("buffer"); -const FieldError = require("../fieldError") +/** + * @format + */ +const { Buffer } = require('buffer') +const { fork } = require('child_process') + +const FieldError = require('../fieldError') + +const { invoke } = require('./subprocess') + +const cryptoSubprocess = fork('utils/ECC/subprocess') /** * @typedef {object} EncryptedMessageBuffer @@ -7,6 +16,7 @@ const FieldError = require("../fieldError") * @prop {Buffer} iv * @prop {Buffer} mac * @prop {Buffer} ephemPublicKey + * @prop {any?} metadata */ /** @@ -15,96 +25,122 @@ const FieldError = require("../fieldError") * @prop {string} iv * @prop {string} mac * @prop {string} ephemPublicKey + * @prop {any?} metadata */ +const generateRandomString = async (length = 16) => { + if (length % 2 !== 0 || length < 2) { + throw new Error('Random string length must be an even number.') + } + + const res = await invoke('generateRandomString', [length], cryptoSubprocess) + + return res +} + /** * @param {string} value */ -const convertUTF8ToBuffer = (value) => Buffer.from(value, 'utf-8'); +const convertUTF8ToBuffer = value => Buffer.from(value, 'utf-8') /** * @param {string} value */ -const convertBase64ToBuffer = (value) => Buffer.from(value, 'base64'); +const convertBase64ToBuffer = value => Buffer.from(value, 'base64') /** * @param {Buffer} buffer */ -const convertBufferToBase64 = (buffer) => buffer.toString("base64"); +const convertBufferToBase64 = buffer => buffer.toString('base64') /** * @param {Buffer | string} key */ -const processKey = (key) => { - if (Buffer.isBuffer(key)) { - return key; - } - const convertedKey = convertBase64ToBuffer(key); - return convertedKey; -}; +const processKey = key => { + if (Buffer.isBuffer(key)) { + return key + } + const convertedKey = convertBase64ToBuffer(key) + return convertedKey +} /** * @param {EncryptedMessageBuffer | EncryptedMessageResponse} encryptedMessage * @returns {EncryptedMessageResponse} */ -const convertToEncryptedMessageResponse = (encryptedMessage) => { - if (Buffer.isBuffer(encryptedMessage.ciphertext) && - Buffer.isBuffer(encryptedMessage.iv) && - Buffer.isBuffer(encryptedMessage.mac) && - Buffer.isBuffer(encryptedMessage.ephemPublicKey)) { - return { - ciphertext: convertBufferToBase64(encryptedMessage.ciphertext), - iv: convertBufferToBase64(encryptedMessage.iv), - mac: convertBufferToBase64(encryptedMessage.mac), - ephemPublicKey: convertBufferToBase64(encryptedMessage.ephemPublicKey) - }; +const convertToEncryptedMessageResponse = encryptedMessage => { + if ( + Buffer.isBuffer(encryptedMessage.ciphertext) && + Buffer.isBuffer(encryptedMessage.iv) && + Buffer.isBuffer(encryptedMessage.mac) && + Buffer.isBuffer(encryptedMessage.ephemPublicKey) + ) { + return { + ciphertext: convertBufferToBase64(encryptedMessage.ciphertext), + iv: convertBufferToBase64(encryptedMessage.iv), + mac: convertBufferToBase64(encryptedMessage.mac), + ephemPublicKey: convertBufferToBase64(encryptedMessage.ephemPublicKey), + metadata: encryptedMessage.metadata } + } - if (typeof encryptedMessage.ciphertext === "string") { - // @ts-ignore - return encryptedMessage; - } + if (typeof encryptedMessage.ciphertext === 'string') { + // @ts-ignore + return encryptedMessage + } - throw new FieldError({ - field: "encryptedMessage", - message: "Unknown encrypted message format" - }); -}; + throw new FieldError({ + field: 'encryptedMessage', + message: 'Unknown encrypted message format' + }) +} /** * @param {EncryptedMessageBuffer | EncryptedMessageResponse} encryptedMessage * @returns {EncryptedMessageBuffer} */ -const convertToEncryptedMessage = (encryptedMessage) => { - if (encryptedMessage.ciphertext instanceof Buffer && - encryptedMessage.iv instanceof Buffer && - encryptedMessage.mac instanceof Buffer && - encryptedMessage.ephemPublicKey instanceof Buffer) { - // @ts-ignore - return encryptedMessage; +const convertToEncryptedMessage = encryptedMessage => { + if ( + encryptedMessage.ciphertext instanceof Buffer && + encryptedMessage.iv instanceof Buffer && + encryptedMessage.mac instanceof Buffer && + encryptedMessage.ephemPublicKey instanceof Buffer + ) { + // @ts-ignore + return encryptedMessage + } + if ( + typeof encryptedMessage.ciphertext === 'string' && + typeof encryptedMessage.iv === 'string' && + typeof encryptedMessage.mac === 'string' && + typeof encryptedMessage.ephemPublicKey === 'string' + ) { + return { + ciphertext: convertBase64ToBuffer(encryptedMessage.ciphertext), + iv: convertBase64ToBuffer(encryptedMessage.iv), + mac: convertBase64ToBuffer(encryptedMessage.mac), + ephemPublicKey: convertBase64ToBuffer(encryptedMessage.ephemPublicKey), + metadata: encryptedMessage.metadata } - if (typeof encryptedMessage.ciphertext === "string" && - typeof encryptedMessage.iv === "string" && - typeof encryptedMessage.mac === "string" && - typeof encryptedMessage.ephemPublicKey === "string") { - return { - ciphertext: convertBase64ToBuffer(encryptedMessage.ciphertext), - iv: convertBase64ToBuffer(encryptedMessage.iv), - mac: convertBase64ToBuffer(encryptedMessage.mac), - ephemPublicKey: convertBase64ToBuffer(encryptedMessage.ephemPublicKey) - }; - } - throw new FieldError({ - field: "encryptedMessage", - message: "Unknown encrypted message format" - }); -}; + } + throw new FieldError({ + field: 'encryptedMessage', + message: 'Unknown encrypted message format' + }) +} module.exports = { + generateRandomString, convertUTF8ToBuffer, convertBase64ToBuffer, convertBufferToBase64, convertToEncryptedMessage, convertToEncryptedMessageResponse, - processKey -} \ No newline at end of file + processKey, + /** + * Used for tests. + */ + killCryptoCryptoSubprocess() { + cryptoSubprocess.kill() + } +} diff --git a/utils/ECC/crypto.spec.js b/utils/ECC/crypto.spec.js new file mode 100644 index 00000000..1b9c3175 --- /dev/null +++ b/utils/ECC/crypto.spec.js @@ -0,0 +1,39 @@ +/** + * @format + */ +// @ts-check +const expect = require('expect') + +const { + generateRandomString, + convertBase64ToBuffer, + convertBufferToBase64, + killCryptoCryptoSubprocess +} = require('./crypto') + +describe('crypto', () => { + describe('generateRandomString()', () => { + it('creates a random string of the specified length', async () => { + expect.hasAssertions() + const base = Math.ceil(Math.random() * 100) + const len = base % 2 !== 0 ? base + 1 : base + const result = await generateRandomString(len) + + expect(result.length).toEqual(len) + }) + }) + + describe('Buffer <> String <> Buffer', () => { + it('preserves values', async () => { + const rnd = await generateRandomString(24) + + const asBuffer = convertBase64ToBuffer(rnd) + + const asStringAgain = convertBufferToBase64(asBuffer) + + expect(asStringAgain).toEqual(rnd) + }) + }) + + after(killCryptoCryptoSubprocess) +}) diff --git a/utils/ECC/index.js b/utils/ECC/index.js index b9bb8b61..b31f01d1 100644 --- a/utils/ECC/index.js +++ b/utils/ECC/index.js @@ -1,152 +1,8 @@ -/** @format */ -const ECCrypto = require('eccrypto') -const Storage = require('node-persist') -const FieldError = require('../fieldError') -const { - convertBufferToBase64, - processKey, - convertToEncryptedMessageResponse, - convertUTF8ToBuffer, - convertToEncryptedMessage, - convertBase64ToBuffer -} = require('./crypto') - -const nodeKeyPairs = new Map() -const devicePublicKeys = new Map() - /** - * @typedef {object} EncryptedMessage - * @prop {string} ciphertext - * @prop {string} iv - * @prop {string} mac - * @prop {string} ephemPublicKey + * @format */ +//@ts-check -/** - * Checks if the message supplied is encrypted or not - * @param {EncryptedMessage} message - */ -const isEncryptedMessage = message => - message && - message.ciphertext && - message.iv && - message.mac && - message.ephemPublicKey +module.exports = require('./ECC') -/** - * Generates a new encryption key pair that will be used - * when communicating with the deviceId specified - * @param {string} deviceId - */ -const generateKeyPair = deviceId => { - const privateKey = ECCrypto.generatePrivate() - const publicKey = ECCrypto.getPublic(privateKey) - const privateKeyBase64 = convertBufferToBase64(privateKey) - const publicKeyBase64 = convertBufferToBase64(publicKey) - - nodeKeyPairs.set(deviceId, { - privateKey, - publicKey - }) - - return { - privateKey, - publicKey, - privateKeyBase64, - publicKeyBase64 - } -} - -/** - * Checks if the specified device has a keypair generated - * @param {{ deviceId: string }} arg0 - */ -const isAuthorizedDevice = ({ deviceId }) => devicePublicKeys.has(deviceId) - -/** - * Generates a new keypair for the deviceId specified and - * saves its publicKey locally - * @param {{ deviceId: string, publicKey: string }} arg0 - */ -const authorizeDevice = async ({ deviceId, publicKey }) => { - const hostId = await Storage.get('encryption/hostId') - devicePublicKeys.set(deviceId, convertBase64ToBuffer(publicKey)) - const keyPair = generateKeyPair(deviceId) - - return { - success: true, - APIPublicKey: keyPair.publicKeyBase64, - hostId - } -} - -/** - * Encrypts the specified message using the specified deviceId's - * public key - * @param {{ deviceId: string, message: string | number | boolean }} arg0 - * @returns {Promise} - */ -const encryptMessage = async ({ message = '', deviceId }) => { - const parsedMessage = message.toString() - const publicKey = devicePublicKeys.get(deviceId) - - if (!publicKey) { - throw new FieldError({ - field: 'deviceId', - message: 'Unauthorized Device ID detected' - }) - } - - const processedPublicKey = processKey(publicKey) - const messageBuffer = convertUTF8ToBuffer(parsedMessage) - const encryptedMessage = await ECCrypto.encrypt( - processedPublicKey, - messageBuffer - ) - const encryptedMessageResponse = { - ciphertext: encryptedMessage.ciphertext, - iv: encryptedMessage.iv, - mac: encryptedMessage.mac, - ephemPublicKey: encryptedMessage.ephemPublicKey - } - - return convertToEncryptedMessageResponse(encryptedMessageResponse) -} - -/** - * Decrypts the specified message using the API keypair - * associated with the specified deviceId - * @param {{ encryptedMessage: EncryptedMessage, deviceId: string }} arg0 - */ -const decryptMessage = async ({ encryptedMessage, deviceId }) => { - try { - const keyPair = nodeKeyPairs.get(deviceId) - - if (!keyPair) { - throw new FieldError({ - field: 'deviceId', - message: 'Unauthorized Device ID detected' - }) - } - - const processedPrivateKey = processKey(keyPair.privateKey) - const decryptedMessage = await ECCrypto.decrypt( - processedPrivateKey, - convertToEncryptedMessage(encryptedMessage) - ) - const parsedMessage = decryptedMessage.toString('utf8') - return parsedMessage - } catch (err) { - console.error(err) - throw err - } -} - -module.exports = { - isAuthorizedDevice, - isEncryptedMessage, - generateKeyPair, - encryptMessage, - decryptMessage, - authorizeDevice -} +module.exports.convertToEncryptedMessage = require('./crypto').convertToEncryptedMessage diff --git a/utils/ECC/socket.js b/utils/ECC/socket.js index 771aee6d..58539a67 100644 --- a/utils/ECC/socket.js +++ b/utils/ECC/socket.js @@ -2,7 +2,7 @@ * @format */ const Common = require('shock-common') -const logger = require('winston') +const logger = require('../../config/log') const { safeParseJSON } = require('../JSON') const ECC = require('./index') @@ -20,12 +20,15 @@ const nonEncryptedEvents = [ * @typedef {import('../../services/gunDB/Mediator').EncryptedEmission} EncryptedEmission * @typedef {import('../../services/gunDB/Mediator').EncryptedEmissionLegacy} EncryptedEmissionLegacy * @typedef {import('../../services/gunDB/contact-api/SimpleGUN').ValidDataValue} ValidDataValue + * @typedef {(data: any, callback: (error?: any, data?: any) => void) => void} SocketOnListener */ /** * @param {string} eventName */ -const isNonEncrypted = eventName => nonEncryptedEvents.includes(eventName) +const isNonEncrypted = eventName => + nonEncryptedEvents.includes(eventName) || + process.env.SHOCK_ENCRYPTION_ECC === 'false' /** * @param {SimpleSocket} socket @@ -83,7 +86,7 @@ const encryptedEmit = socket => async (eventName, ...args) => { /** * @param {SimpleSocket} socket - * @returns {(eventName: string, callback: (data: any) => void) => void} + * @returns {(eventName: string, callback: SocketOnListener) => void} */ const encryptedOn = socket => (eventName, callback) => { try { @@ -110,33 +113,96 @@ const encryptedOn = socket => (eventName, callback) => { } } - socket.on(eventName, async data => { - if (isNonEncrypted(eventName)) { - callback(data) - return - } + socket.on(eventName, async (data, response) => { + try { + if (isNonEncrypted(eventName)) { + callback(data, response) + return + } - if (data) { - const decryptedMessage = await ECC.decryptMessage({ - deviceId, - encryptedMessage: data - }) + if (data) { + const decryptedMessage = await ECC.decryptMessage({ + deviceId, + encryptedMessage: data + }) - callback(safeParseJSON(decryptedMessage)) + callback(safeParseJSON(decryptedMessage), response) + return + } + + callback(data, response) + } catch (err) { + logger.error( + `[SOCKET] An error has occurred while decrypting an event (${eventName}):`, + err + ) + + socket.emit('encryption:error', err) } }) + } catch (err) { + socket.emit('encryption:error', err) + } +} + +/** + * @param {SimpleSocket} socket + * @param {(error?: any, data?: any) => void} callback + * @returns {(...args: any[]) => Promise} + */ +const encryptedCallback = (socket, callback) => async (...args) => { + try { + if (process.env.SHOCK_ENCRYPTION_ECC === 'false') { + return callback(...args) + } + + const deviceId = socket.handshake.auth.encryptionId + + if (!deviceId) { + throw { + field: 'deviceId', + message: 'Please specify a device ID' + } + } + + const authorized = ECC.isAuthorizedDevice({ deviceId }) + + if (!authorized) { + throw { + field: 'deviceId', + message: 'Please exchange keys with the API before using the socket' + } + } + + const encryptedArgs = await Promise.all( + args.map(async data => { + if (!data) { + return data + } + + const encryptedMessage = await ECC.encryptMessage({ + message: typeof data === 'object' ? JSON.stringify(data) : data, + deviceId + }) + + return encryptedMessage + }) + ) + + return callback(...encryptedArgs) } catch (err) { logger.error( - `[SOCKET] An error has occurred while decrypting an event (${eventName}):`, + `[SOCKET] An error has occurred while emitting an event response:`, err ) - socket.emit('encryption:error', err) + return socket.emit('encryption:error', err) } } module.exports = { isNonEncrypted, encryptedOn, - encryptedEmit + encryptedEmit, + encryptedCallback } diff --git a/utils/ECC/subprocess.js b/utils/ECC/subprocess.js new file mode 100644 index 00000000..987ee279 --- /dev/null +++ b/utils/ECC/subprocess.js @@ -0,0 +1,183 @@ +/** + * @format + */ +const Crypto = require('crypto') +const ECCrypto = require('eccrypto') +const uuid = require('uuid/v1') +const { Buffer } = require('buffer') +const mapValues = require('lodash/mapValues') + +const logger = require('../../config/log') + +logger.info('crypto subprocess invoked') + +process.on('uncaughtException', e => { + logger.error('Uncaught exception inside crypto subprocess:') + logger.error(e) +}) + +process.on('unhandledRejection', e => { + logger.error('Unhandled rejection inside crypto subprocess:') + logger.error(e) +}) + +/** + * @typedef {'generateRandomString' | 'convertUTF8ToBuffer' + * | 'convertBase64ToBuffer' | 'convertBufferToBase64' | 'generatePrivate' + * | 'getPublic' | 'encrypt' | 'decrypt' + * } Method + */ + +/** + * @param {any} obj + * @returns {any} + */ +const processBufferAfterSerialization = obj => { + if (typeof obj === 'object' && obj !== null) { + if (obj.type === 'Buffer') { + return Buffer.from(obj.data) + } + return mapValues(obj, processBufferAfterSerialization) + } + return obj +} + +/** + * @typedef {object} Msg + * @prop {any[]} args + * @prop {string} id + * @prop {Method} method + */ + +/** + * @param {Msg} msg + */ +const handleMsg = async msg => { + if (typeof msg !== 'object' || msg === null) { + logger.error('Msg in crypto subprocess not an object') + } + + const { id, method } = msg + const args = msg.args.map(processBufferAfterSerialization) + + try { + if (method === 'generateRandomString') { + const [length] = args + + Crypto.randomBytes(length / 2, (err, buffer) => { + if (err) { + // @ts-expect-error + process.send({ + id, + err: err.message + }) + return + } + + const token = buffer.toString('hex') + // @ts-expect-error + process.send({ + id, + payload: token + }) + }) + } + if (method === 'convertUTF8ToBuffer') { + const [value] = args + + // @ts-expect-error + process.send({ + id, + payload: Buffer.from(value, 'utf8') + }) + } + if (method === 'convertBase64ToBuffer') { + const [value] = args + + // @ts-expect-error + process.send({ + id, + payload: Buffer.from(value, 'base64') + }) + } + if (method === 'convertBufferToBase64') { + const [buffer] = args + + // @ts-expect-error + process.send({ + id, + payload: buffer.toString('base64') + }) + } + if (method === 'generatePrivate') { + // @ts-expect-error + process.send({ + id, + payload: ECCrypto.generatePrivate() + }) + } + if (method === 'getPublic') { + const [privateKey] = args + // @ts-expect-error + process.send({ + id, + payload: ECCrypto.getPublic(privateKey) + }) + } + if (method === 'encrypt') { + const [processedPublicKey, messageBuffer] = args + // @ts-expect-error + process.send({ + id, + payload: await ECCrypto.encrypt(processedPublicKey, messageBuffer) + }) + } + if (method === 'decrypt') { + const [processedPrivateKey, encryptedMessage] = args + // @ts-expect-error + process.send({ + id, + payload: await ECCrypto.decrypt(processedPrivateKey, encryptedMessage) + }) + } + } catch (e) { + // @ts-expect-error + process.send({ + err: e.message + }) + } +} + +process.on('message', handleMsg) + +/** + * @param {Method} method + * @param {any[]} args + * @param {import('child_process').ChildProcess} cryptoSubprocess + * @returns {Promise} + */ +const invoke = (method, args, cryptoSubprocess) => + new Promise((res, rej) => { + const id = uuid() + /** @param {any} msg */ + const listener = msg => { + if (msg.id === id) { + cryptoSubprocess.off('message', listener) + if (msg.err) { + rej(new Error(msg.err)) + } else { + res(processBufferAfterSerialization(msg.payload)) + } + } + } + cryptoSubprocess.on('message', listener) + cryptoSubprocess.send({ + args, + id, + method + }) + }) + +module.exports = { + invoke +} diff --git a/utils/GunSmith/GunSmith.js b/utils/GunSmith/GunSmith.js new file mode 100644 index 00000000..b755c2ab --- /dev/null +++ b/utils/GunSmith/GunSmith.js @@ -0,0 +1,761 @@ +/** + * @format + */ +/* eslint-disable no-use-before-define */ +/* eslint-disable func-style */ +// @ts-no-check TODO: Temporarily disabled TS checking due to new GunDB version +/// +/// +const uuid = require('uuid/v1') +const mapValues = require('lodash/mapValues') +const { fork } = require('child_process') + +const logger = require('../../config/log') + +const { mergePuts, isPopulated } = require('./misc') + +const gunUUID = () => { + // Copied from gun internals + let s = '' + let l = 24 // you are not going to make a 0 length random number, so no need to check type + const c = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxyz' + while (l > 0) { + s += c.charAt(Math.floor(Math.random() * c.length)) + l-- + } + return s +} + +/** + * Maps a path to `on()` listeners + * @type {Record|undefined>} + */ +const pathToListeners = {} + +/** + * Maps a path to `map().on()` listeners + * @type {Record|undefined>} + */ +const pathToMapListeners = {} + +/** @type {Record} */ +const idToLoadListener = {} + +/** + * Path to pending puts. Oldest to newest + * @type {Record} + */ +const pendingPuts = {} + +/** + * @param {Smith.GunMsg} msg + */ +const handleMsg = msg => { + if (msg.type === 'load') { + const { data, id, key } = msg + + const listener = idToLoadListener[id] + + if (listener) { + listener(data, key) + delete idToLoadListener[id] + } + } + if (msg.type === 'on') { + const { data, path } = msg + + // eslint-disable-next-line no-multi-assign + const listeners = + pathToListeners[path] || (pathToListeners[path] = new Set()) + + for (const l of listeners) { + l(data, path.split('>')[path.split('>').length - 1]) + } + } + if (msg.type === 'map.on') { + const { data, key, path } = msg + + // eslint-disable-next-line no-multi-assign + const listeners = + pathToMapListeners[path] || (pathToMapListeners[path] = new Set()) + + for (const l of listeners) { + l(data, key) + } + } + if (msg.type === 'put') { + const { ack, id, path } = msg + + const pendingPutsForPath = pendingPuts[path] || (pendingPuts[path] = []) + + const pendingPut = pendingPutsForPath.find(pp => pp.id === id) + const idx = pendingPutsForPath.findIndex(pp => pp.id === id) + + if (pendingPut) { + pendingPutsForPath.splice(idx, 1) + + if (pendingPut.cb) { + pendingPut.cb(ack) + } + } else { + logger.error( + `Could not find request for put message from gun subprocess. Data will be logged below.` + ) + console.log({ + msg, + pendingPut: pendingPut || 'No pending put found', + allPendingPuts: pendingPuts + }) + } + } + if (msg.type === 'multiPut') { + const { ack, ids, path } = msg + + const pendingPutsForPath = pendingPuts[path] || (pendingPuts[path] = []) + + const ackedPuts = pendingPutsForPath.filter(pp => ids.includes(pp.id)) + + pendingPuts[path] = pendingPuts[path].filter(pp => !ids.includes(pp.id)) + + ackedPuts.forEach(pp => { + if (pp.cb) { + pp.cb(ack) + } + }) + } +} + +/** @type {ReturnType} */ +// eslint-disable-next-line init-declarations +let currentGun + +let lastAlias = '' +let lastPass = '' +/** @type {GunT.UserPair|null} */ +let lastPair = null +/** @type {import('gun/types/gun/IGunConstructorOptions').IGunConstructorOptions} */ +let lastOpts = {} +let isAuthing = false + +/** + * @param {string} alias + * @param {string} pass + * @returns {Promise} + */ +const auth = (alias, pass) => { + logger.info(`Authing with ${alias}`) + if (isAuthing) { + throw new Error(`Double auth?`) + } + isAuthing = true + return new Promise((res, rej) => { + /** @type {Smith.SmithMsgAuth} */ + const msg = { + alias, + pass, + type: 'auth' + } + + /** @param {Smith.GunMsg} msg */ + const _cb = msg => { + if (msg.type === 'auth') { + logger.info(`Received ${msg.ack.sea ? 'ok' : 'bad'} auth reply.`) + currentGun.off('message', _cb) + + isAuthing = false + + const { ack } = msg + + if (ack.err) { + lastAlias = '' + lastPass = '' + lastPair = null + logger.info('Auth unsuccessful, cached credentials cleared.') + rej(new Error(ack.err)) + } else if (ack.sea) { + lastAlias = alias + lastPass = pass + lastPair = ack.sea + logger.info('Auth successful, credentials cached.') + res(ack.sea) + } else { + lastAlias = '' + lastPass = '' + lastPair = null + logger.info('Auth unsuccessful, cached credentials cleared.') + rej(new Error('Auth: ack.sea undefined')) + } + } + } + currentGun.on('message', _cb) + currentGun.send(msg) + logger.info('Sent auth message.') + }) +} + +const autoAuth = async () => { + if (!lastAlias || !lastPass) { + logger.info('No credentials cached, will not auto-auth') + return + } + logger.info('Credentials cached, will auth.') + await auth(lastAlias, lastPass) +} + +const flushPendingPuts = () => { + if (isAuthing || isForging) { + throw new Error('Tried to flush pending puts while authing or forging.') + } + const ids = mapValues(pendingPuts, pendingPutsForPath => + pendingPutsForPath.map(pp => pp.id) + ) + const writes = mapValues(pendingPuts, pendingPutsForPath => + pendingPutsForPath.map(pp => pp.data) + ) + const finalWrites = mapValues(writes, writesForPath => + mergePuts(writesForPath) + ) + const messages = Object.entries(ids).map(([path, ids]) => { + /** @type {Smith.SmithMsgMultiPut} */ + const msg = { + data: finalWrites[path], + ids, + path, + type: 'multiPut' + } + return msg + }) + currentGun.send(messages) + logger.info(`Sent ${messages.length} pending puts.`) +} + +let isForging = false + +/** @returns {Promise} */ +const isReady = () => + new Promise(res => { + if (isForging || isAuthing) { + setTimeout(() => { + isReady().then(res) + }, 1000) + } else { + res() + } + }) + +let procCounter = 0 + +let killed = false + +const forge = () => { + ;(async () => { + if (killed) { + throw new Error('Tried to forge after killing GunSmith') + } + logger.info(`Forging Gun # ${++procCounter}`) + if (isForging) { + throw new Error('Double forge?') + } + + /** Used only for logs. */ + const isReforge = !!currentGun + + logger.info(isReforge ? 'Will reforge' : 'Will forge') + + isForging = true + if (currentGun) { + currentGun.off('message', handleMsg) + currentGun.disconnect() + currentGun.kill() + logger.info('Destroyed current gun') + } + const newGun = fork('utils/GunSmith/gun.js') + currentGun = newGun + logger.info('Forged new gun') + + // currentGun.on('', e => { + // logger.info('event from subprocess') + // logger.info(e) + // }) + + currentGun.on('message', handleMsg) + + /** @type {Smith.SmithMsgInit} */ + const initMsg = { + // @ts-ignore TODO: Fix options typings + opts: lastOpts, + type: 'init' + } + await new Promise(res => { + currentGun.on('message', msg => { + if (msg.type === 'init') { + // @ts-ignore + res() + } + }) + currentGun.send(initMsg) + logger.info('Sent init msg') + }) + + logger.info('Received init reply') + + const lastGunListeners = Object.keys(pathToListeners).map(path => { + /** @type {Smith.SmithMsgOn} */ + const msg = { + path, + type: 'on' + } + return msg + }) + + if (lastGunListeners.length) { + currentGun.send(lastGunListeners) + + logger.info(`Sent ${lastGunListeners.length} pending on() listeners`) + } + + const lastGunMapListeners = Object.keys(pathToMapListeners).map(path => { + /** @type {Smith.SmithMsgMapOn} */ + const msg = { + path, + type: 'map.on' + } + return msg + }) + + if (lastGunMapListeners.length) { + currentGun.send(lastGunMapListeners) + + logger.info( + `Sent ${lastGunMapListeners.length} pending map().on() listeners` + ) + } + + logger.info( + isReforge + ? 'Finished reforging, will now auto-auth' + : 'Finished forging, will now auto-auth' + ) + + await autoAuth() + + // Eslint disable: This should be caught by a if (isForging) {throw} at the + // beginning of this function + + // eslint-disable-next-line require-atomic-updates + isForging = false + flushPendingPuts() + })() +} + +/** + * @param {string} path + * @param {boolean=} afterMap + * @returns {Smith.GunSmithNode} + */ +function createReplica(path, afterMap = false) { + /** @type {(GunT.Listener|GunT.LoadListener)[]} */ + const listenersForThisRef = [] + + return { + _: { + get get() { + const keys = path.split('>') + return keys[keys.length - 1] + }, + opt: { + // TODO + peers: {} + }, + put: { + // TODO + } + }, + back() { + throw new Error('Do not use back() on a GunSmith node.') + }, + get(key) { + if (afterMap) { + throw new Error( + 'Cannot call get() after map() on a GunSmith node, you should only call on() after map()' + ) + } + return createReplica(path + '>' + key) + }, + map() { + if (afterMap) { + throw new Error('Cannot call map() after map() on a GunSmith node') + } + return createReplica(path, true) + }, + off() { + for (const l of listenersForThisRef) { + // eslint-disable-next-line no-multi-assign + const listeners = + pathToListeners[path] || (pathToListeners[path] = new Set()) + + // eslint-disable-next-line no-multi-assign + const mapListeners = + pathToMapListeners[path] || (pathToMapListeners[path] = new Set()) + + // @ts-expect-error + listeners.delete(l) + // @ts-expect-error + mapListeners.delete(l) + } + }, + on(cb) { + listenersForThisRef.push(cb) + + if (afterMap) { + // eslint-disable-next-line no-multi-assign + const listeners = + pathToMapListeners[path] || (pathToMapListeners[path] = new Set()) + + listeners.add(cb) + + /** @type {Smith.SmithMsgMapOn} */ + const msg = { + path, + type: 'map.on' + } + isReady().then(() => { + currentGun.send(msg) + }) + } else { + // eslint-disable-next-line no-multi-assign + const listeners = + pathToListeners[path] || (pathToListeners[path] = new Set()) + + listeners.add(cb) + + /** @type {Smith.SmithMsgOn} */ + const msg = { + path, + type: 'on' + } + isReady().then(() => { + currentGun.send(msg) + }) + } + + return this + }, + once(cb, opts = { wait: 500 }) { + if (afterMap) { + throw new Error('Cannot call once() after map() on a GunSmith node') + } + // We could use this.on() but then we couldn't call .off() + const tmp = createReplica(path, afterMap) + + /** @type {GunT.ListenerData} */ + let lastVal = null + + tmp.on(data => { + lastVal = data + }) + + setTimeout(() => { + tmp.off() + const keys = path.split('>') + // eslint-disable-next-line no-unused-expressions + cb && cb(lastVal, keys[keys.length - 1]) + }, opts.wait) + + return this + }, + put(data, cb) { + const id = uuid() + + const pendingPutsForPath = pendingPuts[path] || (pendingPuts[path] = []) + + /** @type {Smith.PendingPut} */ + const pendingPut = { + cb: cb || (() => {}), + data, + id + } + + pendingPutsForPath.push(pendingPut) + + /** @type {Smith.SmithMsgPut} */ + const msg = { + data, + id, + path, + type: 'put' + } + isReady().then(() => { + currentGun.send(msg) + }) + return this + }, + set(data, cb) { + if (afterMap) { + throw new Error('Cannot call set() after map() on a GunSmith node') + } + + const id = gunUUID() + this.put( + { + [id]: data + }, + ack => { + // eslint-disable-next-line no-unused-expressions + cb && cb(ack) + } + ) + return this.get(id) + }, + user(pub) { + if (path !== '$root') { + throw new ReferenceError( + `Do not call user() on a non-root GunSmith node` + ) + } + if (!pub) { + return createUserReplica() + } + const replica = createReplica(pub) + // I don't know why Typescript insists on returning a UserGUNNode so here we go: + return { + ...replica, + /** @returns {GunT.UserSoul} */ + get _() { + throw new ReferenceError( + `Do not access _ on another user's graph (${pub.slice( + 0, + 8 + )}...${pub.slice(-8)})` + ) + }, + auth() { + throw new Error( + "Do not call auth() on another user's graph (gun.user(otherUserPub))" + ) + }, + create() { + throw new Error( + "Do not call create() on another user's graph (gun.user(otherUserPub))" + ) + }, + leave() { + throw new Error( + "Do not call leave() on another user's graph (gun.user(otherUserPub))" + ) + } + } + }, + then() { + return new Promise(res => { + this.once(data => { + res(data) + }) + }) + }, + specialOn(cb) { + let canaryPeep = false + + const checkCanary = () => + setTimeout(() => { + if (!canaryPeep) { + isReady() + .then(forge) + .then(isReady) + .then(checkCanary) + } + }, 30000) + + checkCanary() + return this.on((data, key) => { + canaryPeep = true + cb(data, key) + }) + }, + specialOnce(cb, _wait = 1000) { + this.once( + (data, key) => { + if (isPopulated(data) || _wait > 100000) { + cb(data, key) + } else { + isReady() + .then(forge) + .then(isReady) + .then(() => { + this.specialOnce(cb, _wait * 3) + }) + } + }, + { wait: _wait } + ) + return this + }, + specialThen() { + return new Promise((res, rej) => { + this.specialOnce(data => { + if (isPopulated(data)) { + res(data) + } else { + rej(new Error(`Could not fetch data at path ${path}`)) + } + }) + }) + }, + pPut(data) { + return new Promise((res, rej) => { + this.put(data, ack => { + if (ack.err) { + rej(new Error(ack.err)) + } else { + res() + } + }) + }) + }, + pSet(data) { + return new Promise((res, rej) => { + this.set(data, ack => { + if (ack.err) { + rej(new Error(ack.err)) + } else { + res() + } + }) + }) + } + } +} + +let userReplicaCalled = false + +/** + * @returns {Smith.UserSmithNode} + */ +function createUserReplica() { + if (userReplicaCalled) { + throw new Error('Please only call gun.user() (without a pub) once.') + } + userReplicaCalled = true + + const baseReplica = createReplica('$user') + + /** @type {Smith.UserSmithNode} */ + const completeReplica = { + ...baseReplica, + get _() { + return { + ...baseReplica._, + // TODO + sea: lastPair || { + epriv: '', + epub: '', + priv: '', + pub: '' + } + } + }, + get is() { + if (lastAlias && lastPair) { + return { + alias: lastAlias, + pub: lastPair.pub + } + } + return undefined + }, + auth(alias, pass, cb) { + auth(alias, pass) + .then(pair => { + cb({ + err: undefined, + sea: pair + }) + }) + .catch(e => { + cb({ + err: e.message, + sea: undefined + }) + }) + }, + create(alias, pass, cb) { + lastAlias = '' + lastPass = '' + lastPair = null + + /** @type {Smith.SmithMsgCreate} */ + const msg = { + alias, + pass, + type: 'create' + } + + /** @param {Smith.GunMsg} msg */ + const _cb = msg => { + if (msg.type === 'create') { + currentGun.off('message', _cb) + + const { ack } = msg + + if (ack.err) { + cb(ack) + } else if (ack.pub) { + lastAlias = alias + lastPass = pass + lastPair = msg.pair + cb(ack) + } else { + throw (new Error('Auth: ack.pub undefined')) + } + } + } + currentGun.on('message', _cb) + currentGun.send(msg) + }, + leave() { + lastAlias = '' + lastPass = '' + lastPair = null + + /** @type {Smith.SmithMsgLeave} */ + const msg = { + type: 'leave' + } + currentGun.send(msg) + } + } + + return completeReplica +} + +/** + * @param {import('gun/types/gun/IGunConstructorOptions').IGunConstructorOptions} opts + * @returns {Smith.GunSmithNode} + */ +const Gun = opts => { + lastOpts = opts + // forge() + + return createReplica('$root') +} + +module.exports = Gun + +module.exports.kill = () => { + if (currentGun) { + currentGun.send('bye') + currentGun.off('message', handleMsg) + currentGun.disconnect() + currentGun.kill() + // @ts-ignore + currentGun = null + killed = true + logger.info('Killed gunsmith.') + } +} + +module.exports._reforge = forge +module.exports._isReady = isReady +module.exports._getProcCounter = () => { + return procCounter +} diff --git a/utils/GunSmith/GunSmith.spec.js b/utils/GunSmith/GunSmith.spec.js new file mode 100644 index 00000000..a73a0efb --- /dev/null +++ b/utils/GunSmith/GunSmith.spec.js @@ -0,0 +1,411 @@ +/** + * @format + */ +// @ts-check +const Gun = require('./GunSmith') +const words = require('random-words') +const fs = require('fs') +const debounce = require('lodash/debounce') +const once = require('lodash/once') +const expect = require('expect') + +const logger = require('../../config/log') + +const { removeBuiltInGunProps } = require('./misc') + +if (!fs.existsSync('./test-radata')) { + fs.mkdirSync('./test-radata') +} + +const instance = Gun({ + axe: false, + multicast: false, + file: './test-radata/' + words({ exactly: 2 }).join('-') +}) + +const user = instance.user() +const alias = words({ exactly: 2 }).join('') +const pass = words({ exactly: 2 }).join('') + +/** + * @param {number} ms + */ +const delay = ms => new Promise(res => setTimeout(res, ms)) + +describe('gun smith', () => { + after(() => { + Gun.kill() + }) + + // ************************************************************************** + // These tests are long but we run them first to detect if the re-forging + // logic is flawed and affecting functionality. + // ************************************************************************** + + it('writes object items into sets and correctly populates item._.get with the newly created id', done => { + const node = instance.get(words()).get(words()) + + const obj = { + a: 1, + b: 'hello' + } + + const item = node.set(obj) + + node.get(item._.get).once(data => { + expect(removeBuiltInGunProps(data)).toEqual(obj) + done() + }) + }) + + it('provides an special once() that restarts gun until a value is fetched', done => { + const a = words() + const b = words() + const node = instance.get(a).get(b) + const value = words() + + node.specialOnce(data => { + expect(data).toEqual(value) + done() + }) + + setTimeout(() => { + node.put(value) + }, 30000) + }) + + it('provides an special then() that restarts gun until a value is fetched', async () => { + const a = words() + const b = words() + const node = instance.get(a).get(b) + const value = words() + + setTimeout(() => { + node.put(value) + }, 30000) + + const res = await node.specialThen() + + expect(res).toBe(value) + }) + + it('provides an special on() that restarts gun when a value has not been obtained in a determinate amount of time', done => { + const node = instance.get(words()).get(words()) + + const secondValue = words() + + const onceDone = once(done) + + node.specialOn( + debounce(data => { + if (data === secondValue) { + onceDone() + } + }) + ) + + setTimeout(() => { + node.put(secondValue) + }, 32000) + }) + + it('puts a true and reads it with once()', done => { + logger.info('puts a true and reads it with once()') + const a = words() + const b = words() + + instance + .get(a) + .get(b) + .put(true) + + instance + .get(a) + .get(b) + .once(val => { + expect(val).toBe(true) + done() + }) + }) + + it('puts a false and reads it with once()', done => { + const a = words() + const b = words() + + instance + .get(a) + .get(b) + .put(false, ack => { + if (ack.err) { + throw new Error(ack.err) + } else { + instance + .get(a) + .get(b) + .once(val => { + expect(val).toBe(false) + done() + }) + } + }) + }) + + it('puts numbers and reads them with once()', done => { + const a = words() + const b = words() + + instance + .get(a) + .get(b) + .put(5) + + instance + .get(a) + .get(b) + .once(val => { + expect(val).toBe(5) + done() + }) + }) + + it('puts strings and reads them with once()', done => { + const a = words() + const b = words() + const sentence = words({ exactly: 50 }).join(' ') + instance + .get(a) + .get(b) + .put(sentence) + + instance + .get(a) + .get(b) + .once(val => { + expect(val).toBe(sentence) + done() + }) + }) + + it('merges puts', async () => { + const a = { + a: 1 + } + const b = { + b: 1 + } + const c = { ...a, ...b } + + const node = instance.get('foo').get('bar') + + node.put(a) + node.put(b) + + const data = await node.then() + + if (typeof data !== 'object' || data === null) { + throw new Error('Data not an object') + } + expect(removeBuiltInGunProps(data)).toEqual(c) + }) + + it('writes primitive items into sets and correctly assigns the id to ._.get', done => { + const node = instance.get(words()).get(words()) + const item = node.set('hello') + + node.once(data => { + expect(removeBuiltInGunProps(data)).toEqual({ + [item._.get]: 'hello' + }) + done() + }) + }) + + // TODO: find out why this test fucks up the previous one if it runs before + // that one + it('maps over a primitive set', done => { + const node = instance.get(words()).get(words()) + + const items = words({ exactly: 50 }) + + const ids = items.map(i => node.set(i)._.get) + + let checked = 0 + + node.map().on((data, id) => { + expect(items).toContain(data) + expect(ids).toContain(id) + checked++ + if (checked === 50) { + done() + } + }) + }) + + it('maps over an object set', done => { + const node = instance.get(words()).get(words()) + + const items = words({ exactly: 50 }).map(w => ({ + word: w + })) + + const ids = items.map(i => node.set(i)._.get) + + let checked = 0 + + node.map().on((data, id) => { + expect(items).toContainEqual(removeBuiltInGunProps(data)) + expect(ids).toContain(id) + checked++ + if (checked === 50) { + done() + } + }) + }) + + it('offs `on()`s', async () => { + const node = instance.get(words()).get(words()) + + let called = false + + node.on(() => { + called = true + }) + + node.off() + + await node.pPut('return') + await delay(500) + expect(called).toBe(false) + }) + + it('offs `map().on()`s', async () => { + const node = instance.get(words()).get(words()) + + let called = false + + const iterateeNode = node.map() + + iterateeNode.on(() => { + called = true + }) + + iterateeNode.off() + + await node.pSet('return') + + await delay(500) + + expect(called).toBe(false) + }) + + it('provides an user node with create(), auth() and leave()', async () => { + const ack = await new Promise(res => user.create(alias, pass, res)) + expect(ack.err).toBeUndefined() + + const { pub } = ack + expect(pub).toBeTruthy() + expect(user.is?.pub).toEqual(pub) + + user.leave() + expect(user.is).toBeUndefined() + + /** @type {GunT.AuthAck} */ + const authAck = await new Promise(res => + user.auth(alias, pass, ack => res(ack)) + ) + expect(authAck.err).toBeUndefined() + expect(authAck.sea?.pub).toEqual(pub) + expect(user.is?.pub).toEqual(pub) + user.leave() + }) + + it('reliably provides authentication information across re-forges', async () => { + /** @type {GunT.AuthAck} */ + const authAck = await new Promise(res => + user.auth(alias, pass, ack => res(ack)) + ) + const pub = authAck.sea?.pub + expect(pub).toBeTruthy() + + Gun._reforge() + expect(user.is?.pub).toEqual(pub) + await Gun._isReady() + expect(user.is?.pub).toEqual(pub) + + user.leave() + }) + + it('provides thenables for values', async () => { + const a = words() + const b = words() + const node = instance.get(a).get(b) + const value = words() + + await new Promise((res, rej) => { + node.put(value, ack => { + if (ack.err) { + rej(new Error(ack.err)) + } else { + // @ts-ignore + res() + } + }) + }) + + const fetch = await instance + .get(a) + .get(b) + .then() + expect(fetch).toEqual(value) + }) + + it('provides an special thenable put()', async () => { + const a = words() + const b = words() + const node = instance.get(a).get(b) + const value = words() + + await node.pPut(value) + + const res = await node.then() + + expect(res).toBe(value) + }) + + it('on()s and handles object>primitive>object transitions', done => { + const a = { + one: 1 + } + const b = 'two' + const lastPut = { + three: 3 + } + const c = { ...a, ...lastPut } + + const node = instance.get(words()).get(words()) + + let checked = 0 + + node.on( + debounce(data => { + checked++ + if (checked === 1) { + expect(removeBuiltInGunProps(data)).toEqual(a) + } else if (checked === 2) { + expect(data).toEqual(b) + } else if (checked === 3) { + expect(removeBuiltInGunProps(data)).toEqual(c) + done() + } + }) + ) + + node.put(a) + setTimeout(() => { + node.put(b) + }, 800) + setTimeout(() => { + node.put(c) + }, 1200) + }) +}) diff --git a/utils/GunSmith/GunT.ts b/utils/GunSmith/GunT.ts new file mode 100644 index 00000000..bd4102e8 --- /dev/null +++ b/utils/GunSmith/GunT.ts @@ -0,0 +1,85 @@ +/** + * @prettier + */ +namespace GunT { + export type Primitive = boolean | string | number + + export interface Data { + [K: string]: ValidDataValue + } + + export type ValidDataValue = Primitive | null | Data + + export interface Ack { + err: string | undefined + } + + type ListenerObjSoul = { + '#': string + } + + export type ListenerObj = Record< + string, + ListenerObjSoul | Primitive | null + > & { + _: ListenerObjSoul + } + + export type ListenerData = Primitive | null | ListenerObj | undefined + + interface OpenListenerDataObj { + [k: string]: OpenListenerData + } + + export type Listener = (data: ListenerData, key: string) => void + + export type Callback = (ack: Ack) => void + + export interface Peer { + url: string + id: string + wire?: { + readyState: number + } + } + + export interface Soul { + get: string + put: Primitive | null | object | undefined + opt: { + peers: Record + } + } + export type OpenListenerData = Primitive | null | OpenListenerDataObj + + export type OpenListener = (data: OpenListenerData, key: string) => void + + export type LoadListenerData = OpenListenerData + + export type LoadListener = (data: LoadListenerData, key: string) => void + + export interface CreateAck { + pub: string | undefined + err: string | undefined + } + + export type CreateCB = (ack: CreateAck) => void + + export interface AuthAck { + err: string | undefined + sea: UserPair | undefined + } + + export type AuthCB = (ack: AuthAck) => void + + export interface UserPair { + epriv: string + epub: string + priv: string + pub: string + } + + export interface UserSoul extends Soul { + sea: UserPair + } +} diff --git a/utils/GunSmith/Smith.ts b/utils/GunSmith/Smith.ts new file mode 100644 index 00000000..3ee8a655 --- /dev/null +++ b/utils/GunSmith/Smith.ts @@ -0,0 +1,221 @@ +/** + * @format + */ +/// +namespace Smith { + export interface GunSmithNode { + _: GunT.Soul + /** + * Used only inside the subprocess. + */ + back( + path: 'opt' + ): { + peers: Record< + string, + { + url: string + id: string + wire?: { + readyState: number + } + } + > + } + /** + * + */ + get(key: string): GunSmithNode + /** + * + */ + map(): GunSmithNode + /** + * + */ + off(): void + /** + * + */ + on(cb: GunT.Listener): void + /** + * + */ + once(cb?: GunT.Listener, opts?: { wait?: number }): void + /** + * A promise version of put(). + * @throws + */ + pPut(data: GunT.ValidDataValue): Promise + /** + * A promise version of set(). + * @throws + */ + pSet(data: GunT.ValidDataValue): Promise + /** + * + */ + put(data: GunT.ValidDataValue, cb?: GunT.Callback): void + /** + * + */ + set(data: GunT.ValidDataValue, cb?: GunT.Callback): GunSmithNode + /** + * Gun will be restarted to force replication of data + * if needed. + * @param cb + */ + specialOn(cb: GunT.Listener): void + /** + * Gun will be restarted to force replication of data + * if needed. + * @param cb + * @param _wait + */ + specialOnce(cb: GunT.Listener, _wait?: number): GunSmithNode + /** + * Gun will be restarted to force replication of data + * if needed. + */ + specialThen(): Promise + then(): Promise + user(): UserSmithNode + user(pub: string): GunSmithNode + } + + export interface UserSmithNode extends GunSmithNode { + _: GunT.UserSoul + auth(alias: string, pass: string, cb: GunT.AuthCB): void + is?: { + alias: string + pub: string + } + create(user: string, pass: string, cb: GunT.CreateCB): void + leave(): void + } + + export interface PendingPut { + cb: GunT.Callback + data: GunT.ValidDataValue + id: string + } + + export interface SmithMsgInit { + opts: Record + type: 'init' + } + + export interface SmithMsgAuth { + alias: string + pass: string + type: 'auth' + } + + export interface SmithMsgCreate { + alias: string + pass: string + type: 'create' + } + + export interface SmithMsgLeave { + type: 'leave' + } + + export interface SmithMsgOn { + path: string + type: 'on' + } + + export interface SmithMsgLoad { + id: string + path: string + type: 'load' + } + + export interface SmithMsgMapOn { + path: string + type: 'map.on' + } + + export interface SmithMsgPut { + id: string + data: GunT.ValidDataValue + path: string + type: 'put' + } + + export interface SmithMsgMultiPut { + ids: string[] + data: GunT.ValidDataValue + path: string + type: 'multiPut' + } + + export type SmithMsg = + | SmithMsgInit + | SmithMsgAuth + | SmithMsgCreate + | SmithMsgAuth + | SmithMsgOn + | SmithMsgLoad + | SmithMsgMapOn + | SmithMsgPut + | SmithMsgMultiPut + | BatchSmithMsg + + export type BatchSmithMsg = SmithMsg[] + + export interface GunMsgAuth { + ack: GunT.AuthAck + type: 'auth' + } + + export interface GunMsgCreate { + ack: GunT.CreateAck + pair: GunT.UserPair + type: 'create' + } + + export interface GunMsgOn { + data: GunT.ListenerData + path: string + type: 'on' + } + + export interface GunMsgMapOn { + data: GunT.ListenerData + path: string + key: string + type: 'map.on' + } + + export interface GunMsgLoad { + id: string + data: GunT.LoadListenerData + key: string + type: 'load' + } + + export interface GunMsgPut { + ack: GunT.Ack + id: string + path: string + type: 'put' + } + + export interface GunMsgMultiPut { + ack: GunT.Ack + ids: string[] + path: string + type: 'multiPut' + } + + export type GunMsg = + | GunMsgAuth + | GunMsgCreate + | GunMsgOn + | GunMsgMapOn + | GunMsgLoad + | GunMsgPut + | GunMsgMultiPut +} diff --git a/utils/GunSmith/gun.js b/utils/GunSmith/gun.js new file mode 100644 index 00000000..71a44a6a --- /dev/null +++ b/utils/GunSmith/gun.js @@ -0,0 +1,251 @@ +/** + * @format + */ +// @ts-check +/// +/// +const Gun = require('gun') +require('gun/nts') +require('gun/lib/load') + +const logger = require('../../config/log') + +let dead = false + +/** + * @param {any} msg + */ +const sendMsg = msg => { + if (dead) { + return + } + if (process.send) { + process.send(msg) + } else { + logger.error( + 'Fatal error: Could not send a message from inside the gun process.' + ) + } +} + +logger.info('subprocess invoked') + +process.on('uncaughtException', e => { + logger.error('Uncaught exception inside Gun subprocess:') + logger.error(e) +}) + +process.on('unhandledRejection', e => { + logger.error('Unhandled rejection inside Gun subprocess:') + logger.error(e) +}) + +/** + * @type {Smith.GunSmithNode} + */ +// eslint-disable-next-line init-declarations +let gun + +/** + * @type {Smith.UserSmithNode} + */ +// eslint-disable-next-line init-declarations +let user + +/** + * @returns {Promise} + */ +const waitForAuth = async () => { + if (user.is && user.is.pub) { + return Promise.resolve() + } + + await new Promise(res => setTimeout(res, 1000)) + + return waitForAuth() +} + +/** + * @param {Smith.SmithMsg} msg + */ +const handleMsg = async msg => { + if (dead) { + logger.error('Dead sub-process received msg: ', msg) + return + } + // @ts-ignore + if (msg === 'bye') { + logger.info('KILLING') + dead = true + } + if (Array.isArray(msg)) { + msg.forEach(handleMsg) + return + } + if (msg.type === 'init') { + gun = /** @type {any} */ (new Gun(msg.opts)) + + // Force gun to connect to peers + gun + .get('foo') + .get('baz') + .once() + + let currentPeers = '' + setInterval(() => { + const newPeers = JSON.stringify( + Object.values(gun.back('opt').peers) + .filter(p => p.wire && p.wire.readyState) + .map(p => p.url) + ) + if (newPeers !== currentPeers) { + logger.info('Connected peers:', newPeers) + currentPeers = newPeers + } + }, 2000) + + setInterval(() => { + // Log regardless of change every 30 seconds + logger.info('Connected peers:', currentPeers) + }, 30000) + user = gun.user() + + sendMsg({ + type: 'init' + }) + } + if (msg.type === 'auth') { + const { alias, pass } = msg + user.auth(alias, pass, ack => { + /** @type {Smith.GunMsgAuth} */ + const msg = { + ack: { + err: ack.err, + sea: ack.sea + }, + type: 'auth' + } + sendMsg(msg) + }) + } + if (msg.type === 'create') { + const { alias, pass } = msg + user.create(alias, pass, ack => { + /** @type {Smith.GunMsgCreate} */ + const msg = { + ack: { + err: ack.err, + pub: ack.pub + }, + pair: user._.sea, + type: 'create' + } + sendMsg(msg) + }) + } + if (msg.type === 'on') { + const [root, ...keys] = msg.path.split('>') + + /** @type {Smith.GunSmithNode} */ + let node = + { + $root: gun, + $user: user + }[root] || gun.user(root) + + for (const key of keys) { + node = node.get(key) + } + node.on(data => { + /** @type {Smith.GunMsgOn} */ + const res = { + data, + path: msg.path, + type: 'on' + } + sendMsg(res) + }) + } + if (msg.type === 'map.on') { + const [root, ...keys] = msg.path.split('>') + + /** @type {Smith.GunSmithNode} */ + let node = + { + $root: gun, + $user: user + }[root] || gun.user(root) + + for (const key of keys) { + node = node.get(key) + } + node.map().on((data, key) => { + /** @type {Smith.GunMsgMapOn} */ + const res = { + data, + key, + path: msg.path, + type: 'map.on' + } + sendMsg(res) + }) + } + if (msg.type === 'put') { + const [root, ...keys] = msg.path.split('>') + if (root === '$user') { + await waitForAuth() + } + + /** @type {Smith.GunSmithNode} */ + let node = + { + $root: gun, + $user: user + }[root] || gun.user(root) + + for (const key of keys) { + node = node.get(key) + } + + node.put(msg.data, ack => { + /** @type {Smith.GunMsgPut} */ + const reply = { + ack: { + err: typeof ack.err === 'string' ? ack.err : undefined + }, + id: msg.id, + path: msg.path, + type: 'put' + } + sendMsg(reply) + }) + } + if (msg.type === 'multiPut') { + const [root, ...keys] = msg.path.split('>') + + /** @type {Smith.GunSmithNode} */ + let node = + { + $root: gun, + $user: user + }[root] || gun.user(root) + + for (const key of keys) { + node = node.get(key) + } + node.put(msg.data, ack => { + /** @type {Smith.GunMsgMultiPut} */ + const reply = { + ack: { + err: ack.err + }, + ids: msg.ids, + path: msg.path, + type: 'multiPut' + } + sendMsg(reply) + }) + } +} + +process.on('message', handleMsg) diff --git a/utils/GunSmith/index.js b/utils/GunSmith/index.js new file mode 100644 index 00000000..e9024186 --- /dev/null +++ b/utils/GunSmith/index.js @@ -0,0 +1 @@ +module.exports = require('./GunSmith') \ No newline at end of file diff --git a/utils/GunSmith/misc.js b/utils/GunSmith/misc.js new file mode 100644 index 00000000..ab3faaee --- /dev/null +++ b/utils/GunSmith/misc.js @@ -0,0 +1,78 @@ +/** + * @format + */ +// @ts-check + +// TODO: Check if merge() is equivalent to what gun does. But it should be. +const merge = require('lodash/merge') + +/// + +/** + * @param {GunT.ValidDataValue[]} values + * @returns {GunT.ValidDataValue} + */ +const mergePuts = values => { + /** + * @type {GunT.ValidDataValue} + * @example + * x.put({ a: 1 }) + * x.put('yo') + * assertEquals(await x.then(), 'yo') + * x.put({ b: 2 }) + * assertEquals(await x.then(), { a: 1 , b: 2 }) + */ + const lastObjectValue = {} + + /** @type {GunT.ValidDataValue} */ + let finalResult = {} + + for (const val of values) { + if (typeof val === 'object' && val !== null) { + finalResult = {} + merge(lastObjectValue, val) + merge(finalResult, lastObjectValue) + } else { + finalResult = val + } + } + + return finalResult +} + +/** + * @param {any} data + * @returns {any} + */ +const removeBuiltInGunProps = data => { + if (typeof data === 'object' && data !== null) { + const o = { ...data } + delete o._ + delete o['#'] + return o + } + + console.log(data) + throw new TypeError( + 'Non object passed to removeBuiltInGunProps: ' + JSON.stringify(data) + ) +} + +/** + * @param {GunT.ListenerData} data + */ +const isPopulated = data => { + if (data === null || typeof data === 'undefined') { + return false + } + if (typeof data === 'object') { + return Object.keys(removeBuiltInGunProps(data)).length > 0 + } + return true +} + +module.exports = { + mergePuts, + removeBuiltInGunProps, + isPopulated +} diff --git a/utils/encryptionStore.js b/utils/encryptionStore.js deleted file mode 100644 index 78745d1f..00000000 --- a/utils/encryptionStore.js +++ /dev/null @@ -1,181 +0,0 @@ -/** - * @prettier - */ -const Crypto = require('crypto') -const { Buffer } = require('buffer') -const logger = require('winston') - -const APIKeyPair = new Map() -const authorizedDevices = new Map() - -const nonEncryptedEvents = [ - 'ping', - 'disconnect', - 'IS_GUN_AUTH', - 'SET_LAST_SEEN_APP' -] - -const Encryption = { - /** - * @param {string} event - * @returns {boolean} - */ - isNonEncrypted: event => nonEncryptedEvents.includes(event), - /** - * @param {{ deviceId: string , message: string }} arg0 - */ - encryptKey: ({ deviceId, message }) => { - if (!authorizedDevices.has(deviceId)) { - throw { field: 'deviceId', message: 'Unknown Device ID' } - } - - const devicePublicKey = authorizedDevices.get(deviceId) - const data = Buffer.from(message) - const encryptedData = Crypto.publicEncrypt( - { - key: devicePublicKey, - padding: Crypto.constants.RSA_PKCS1_PADDING - }, - data - ) - - return encryptedData.toString('base64') - }, - /** - * @param {{ deviceId: string , message: string }} arg0 - */ - decryptKey: ({ deviceId, message }) => { - if (!authorizedDevices.has(deviceId)) { - throw { field: 'deviceId', message: 'Unknown Device ID' } - } - - const data = Buffer.from(message, 'base64') - const encryptedData = Crypto.privateDecrypt( - { - key: APIKeyPair.get(deviceId).privateKey, - padding: Crypto.constants.RSA_PKCS1_PADDING - }, - data - ) - - return encryptedData.toString() - }, - /** - * @param {{ deviceId: string , message: any , metadata?: any}} arg0 - */ - encryptMessage: ({ deviceId, message, metadata = {} }) => { - const parsedMessage = - typeof message === 'object' ? JSON.stringify(message) : message - const data = Buffer.from(parsedMessage) - const key = Crypto.randomBytes(32) - const iv = Crypto.randomBytes(16) - const encryptedKey = Encryption.encryptKey({ - deviceId, - message: key.toString('hex') - }) - const cipher = Crypto.createCipheriv('aes-256-cbc', key, iv) - const encryptedCipher = cipher.update(data) - const encryptedBuffer = Buffer.concat([ - Buffer.from(encryptedCipher), - Buffer.from(cipher.final()) - ]) - const encryptedData = encryptedBuffer.toString('base64') - const encryptedMessage = { - encryptedData, - encryptedKey, - iv: iv.toString('hex'), - metadata - } - - return encryptedMessage - }, - /** - * @param {{ message: string , key: string , iv: string }} arg0 - */ - decryptMessage: ({ message, key, iv }) => { - const data = Buffer.from(message, 'base64') - const cipher = Crypto.createDecipheriv( - 'aes-256-cbc', - Buffer.from(key, 'hex'), - Buffer.from(iv, 'hex') - ) - const decryptedCipher = cipher.update(data) - const decryptedBuffer = Buffer.concat([ - Buffer.from(decryptedCipher), - Buffer.from(cipher.final()) - ]) - const decryptedData = decryptedBuffer.toString() - - return decryptedData.toString() - }, - /** - * @param {{ deviceId: string }} arg0 - */ - isAuthorizedDevice: ({ deviceId }) => { - if (authorizedDevices.has(deviceId)) { - return true - } - - return false - }, - /** - * @param {{ deviceId: string , publicKey: string }} arg0 - */ - authorizeDevice: ({ deviceId, publicKey }) => - new Promise((resolve, reject) => { - authorizedDevices.set(deviceId, publicKey) - Crypto.generateKeyPair( - 'rsa', - { - modulusLength: 2048, - privateKeyEncoding: { - type: 'pkcs1', - format: 'pem' - }, - publicKeyEncoding: { - type: 'pkcs1', - format: 'pem' - } - }, - (err, publicKey, privateKey) => { - if (err) { - // @ts-ignore - logger.error(err) - reject(err) - return - } - - const exportedKey = { - publicKey, - privateKey - } - - APIKeyPair.set(deviceId, exportedKey) - resolve({ - success: true, - APIPublicKey: exportedKey.publicKey - }) - } - ) - }), - /** - * @param {{ deviceId: string }} arg0 - */ - unAuthorizeDevice: ({ deviceId }) => { - authorizedDevices.delete(deviceId) - }, - generateRandomString: (length = 16) => - new Promise((resolve, reject) => { - Crypto.randomBytes(length, (err, buffer) => { - if (err) { - reject(err) - return - } - - const token = buffer.toString('hex') - resolve(token) - }) - }) -} - -module.exports = Encryption diff --git a/utils/helpers.spec.js b/utils/helpers.spec.js index 409f2264..7a468051 100644 --- a/utils/helpers.spec.js +++ b/utils/helpers.spec.js @@ -1,6 +1,7 @@ /** * @format */ +const expect = require('expect') const { asyncFilter } = require('./helpers') diff --git a/utils/index.js b/utils/index.js index 516d762a..5b619eda 100644 --- a/utils/index.js +++ b/utils/index.js @@ -1,7 +1,6 @@ /** * @format */ -const Gun = require('gun') const { asyncFilter } = require('./helpers') @@ -9,10 +8,15 @@ const { asyncFilter } = require('./helpers') * @returns {string} */ const gunUUID = () => { - // @ts-expect-error Not typed - const uuid = Gun.Text.random() - - return uuid + // Copied from gun internals + let s = '' + let l = 24 // you are not going to make a 0 length random number, so no need to check type + const c = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxyz' + while (l > 0) { + s += c.charAt(Math.floor(Math.random() * c.length)) + l-- + } + return s } module.exports = { diff --git a/utils/lightningServices/channelRequests.js b/utils/lightningServices/channelRequests.js new file mode 100644 index 00000000..1c5db495 --- /dev/null +++ b/utils/lightningServices/channelRequests.js @@ -0,0 +1,68 @@ +const logger = require('../../config/log') +const fetch = require('node-fetch') +const Storage = require('node-persist') +const { listPeers, connectPeer,getInfo } = require('./v2') + +const handlerBaseUrl = "https://channels.shock.network:4444" + +module.exports = async () => { + logger.info("DOING CHANNEL INVITE THING: START") + /** + * @type string | undefined + */ + const invite = process.env.HOSTING_INVITE + if(!invite) { + logger.info("DOING CHANNEL INVITE THING: NVM NO INVITE") + return + } + try { + /** + * @type string[] + */ + const invites = await Storage.getItem('processedInvites') || [] + if(invites.includes(invite)){ + logger.info("DOING CHANNEL INVITE THING: INVITE PROCESSED ALREADY") + return + } + const me = await getInfo() + const {identity_pubkey} = me + //@ts-expect-error + const connectReq = await fetch(`${handlerBaseUrl}/connect`) + if(connectReq.status !== 200 ){ + logger.info("DOING CHANNEL INVITE THING: CONNECT FAILED") + return + } + const connJson = await connectReq.json() + const [uri] = connJson.uris + const [pub,host] = uri.split("@") + const peers = await listPeers() + if(peers.findIndex(peer => peer.pub_key === pub) === -1){ + await connectPeer(pub,host) + } + const channelReq = { + userPubKey:identity_pubkey, + invite, + lndTo:pub, + } + //@ts-expect-error + const res = await fetch(`${handlerBaseUrl}/channel`,{ + method:'POST', + headers: { + 'Content-Type': 'application/json' + }, + body:JSON.stringify(channelReq) + }) + if(res.status !== 200 ){ + logger.info("DOING CHANNEL INVITE THING: FAILED ") + return + } + invites.push(invite) + await Storage.setItem('processedInvites',invites) + logger.info("DOING CHANNEL INVITE THING: DONE!") + } catch(e){ + logger.error("error sending invite to channels handler") + logger.info("DOING CHANNEL INVITE THING: :(") + logger.error(e) + } + +} \ No newline at end of file diff --git a/utils/lightningServices/errors.js b/utils/lightningServices/errors.js index 434b0f9b..23c316fa 100644 --- a/utils/lightningServices/errors.js +++ b/utils/lightningServices/errors.js @@ -50,7 +50,7 @@ class LNDErrorManager { */ const listener = (err, response) => { if (err) { - if (err.code === 12) { + if (err.details.includes("wallet not created") || err.details.includes("wallet locked")) { res({ service: 'walletUnlocker', message: 'Wallet locked', diff --git a/utils/lightningServices/types.ts b/utils/lightningServices/types.ts index ca0d034f..fb180e22 100644 --- a/utils/lightningServices/types.ts +++ b/utils/lightningServices/types.ts @@ -134,15 +134,15 @@ export interface Services { } export interface ListChannelsReq { - active_only: boolean - inactive_only: boolean - public_only: boolean - private_only: boolean + active_only?: boolean + inactive_only?: boolean + public_only?: boolean + private_only?: boolean /** * Filters the response for channels with a target peer's pubkey. If peer is * empty, all channels will be returned. */ - peer: Common.Bytes + peer?: Common.Bytes } /** @@ -193,4 +193,8 @@ export interface AddInvoiceRes { * all payments for this invoice as we require it for end to end security. */ payment_addr: Common.Bytes + /** + * Custom property, by us. + */ + liquidityCheck?: boolean } diff --git a/utils/lightningServices/v2.js b/utils/lightningServices/v2.js index a32572cf..edcee251 100644 --- a/utils/lightningServices/v2.js +++ b/utils/lightningServices/v2.js @@ -2,7 +2,7 @@ * @format */ const Crypto = require('crypto') -const logger = require('winston') +const logger = require('../../config/log') const Common = require('shock-common') const Ramda = require('ramda') @@ -578,7 +578,7 @@ const addInvoice = (value, memo = '', confidential = true, expiry = 180) => * */ /** - * @param {(invoice:Common.Schema.InvoiceWhenListed & {r_hash:Buffer,payment_addr:string}) => (boolean | undefined)} dataCb + * @param {(invoice:Common.Schema.InvoiceWhenListed & {r_hash:Buffer,payment_addr:Buffer}) => (boolean | undefined)} dataCb * @param {(error:lndErr) => void} errorCb */ const subscribeInvoices = (dataCb, errorCb) => { @@ -631,6 +631,43 @@ const subscribeTransactions = (dataCb, errorCb) => { }) } +const getInfo = () => + Common.makePromise((res, rej) => { + const { lightning } = lightningServices.getServices() + + lightning.getInfo({}, (err, resp) => { + if (err) { + rej(new Error(err.message)) + } else { + // Needs cast because typescript refuses to assign Record + // to an actual object :shrugs + res(resp) + } + }) + }) +/** + * + * @param {string} pubkey + * @param {string} host + * @returns + */ +const connectPeer = (pubkey, host) => + Common.makePromise((res, rej) => { + const { lightning } = lightningServices.getServices() + const connectRequest = { + addr: { pubkey, host }, + perm: true + } + lightning.connectPeer(connectRequest, (err, resp) => { + if (err) { + rej(new Error(err.message)) + } else { + // Needs cast because typescript refuses to assign Record + // to an actual object :shrugs + res(resp) + } + }) + }) module.exports = { sendPaymentV2Keysend, sendPaymentV2Invoice, @@ -644,5 +681,7 @@ module.exports = { pendingChannels, addInvoice, subscribeInvoices, - subscribeTransactions + subscribeTransactions, + getInfo, + connectPeer } diff --git a/utils/protectedRoutes.js b/utils/protectedRoutes.js index 44d6e061..f9413d1f 100644 --- a/utils/protectedRoutes.js +++ b/utils/protectedRoutes.js @@ -1,35 +1,61 @@ module.exports = { unprotectedRoutes: { GET: { - "/healthz": true, - "/ping": true, + '/healthz': true, + '/ping': true, + '/tunnel/status': true, // Errors out when viewing an API page from the browser - "/favicon.ico": true, - "/api/lnd/connect": true, - "/api/lnd/wallet/status": true, - "/api/lnd/auth": true, + '/favicon.ico': true, + '/api/lnd/connect': true, + '/api/lnd/wallet/status': true, // - "/api/gun/auth": true + '/api/gunw': true, + '/api/subscribeStream': true, + '/': true, + '/api/accessInfo': true, + '/qrCodeGenerator': true }, POST: { - "/api/lnd/connect": true, - "/api/lnd/wallet": true, - "/api/lnd/wallet/existing": true, - "/api/lnd/auth": true, - "/api/security/exchangeKeys": true, - "/api/encryption/exchange": true + '/api/lnd/connect': true, + '/api/lnd/wallet': true, + '/api/lnd/wallet/existing': true, + '/api/lnd/unlock': true, + '/api/security/exchangeKeys': true, + '/api/encryption/exchange': true }, PUT: {}, - DELETE: {} + DELETE: {}, + // Preflight request (CORS) + get OPTIONS() { + return { + ...this.POST, + ...this.GET, + ...this.PUT, + ...this.DELETE + } + } }, sensitiveRoutes: { GET: {}, POST: { - "/api/lnd/connect": true, - "/api/lnd/wallet": true + '/api/lnd/connect': true, + '/api/lnd/wallet': true }, PUT: {}, DELETE: {} }, - nonEncryptedRoutes: ['/api/security/exchangeKeys', "/api/encryption/exchange", '/healthz', '/ping', '/api/lnd/wallet/status', '/api/gun/auth'] -} \ No newline at end of file + nonEncryptedRoutes: [ + '/api/security/exchangeKeys', + '/api/encryption/exchange', + '/healthz', + '/ping', + '/tunnel/status', + '/api/lnd/wallet/status', + '/api/gun/auth', + '/api/subscribeStream', + '/', + '/api/accessInfo', + '/qrCodeGenerator', + '/gun' + ] +} diff --git a/yarn.lock b/yarn.lock index 16f2587b..946860ca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,252 +2,176 @@ # yarn lockfile v1 -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.11", "@babel/code-frame@^7.5.5": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" - integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.0.tgz#0dfc80309beec8411e65e706461c408b0bb9b431" + integrity sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA== dependencies: - "@babel/highlight" "^7.10.4" + "@babel/highlight" "^7.16.0" -"@babel/core@^7.1.0": - version "7.6.2" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.6.2.tgz#069a776e8d5e9eefff76236bc8845566bd31dd91" - integrity sha512-l8zto/fuoZIbncm+01p8zPSDZu/VuuJhAfA7d/AbzM09WR7iVhavvfNDYCNpo1VvLk6E6xgAoP9P+/EMJHuRkQ== +"@babel/generator@^7.16.5": + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.5.tgz#26e1192eb8f78e0a3acaf3eede3c6fc96d22bedf" + integrity sha512-kIvCdjZqcdKqoDbVVdt5R99icaRtrtYhYK/xux5qiWCBmfdvEYMFZ68QCrpE5cbFM1JsuArUNs1ZkuKtTtUcZA== dependencies: - "@babel/code-frame" "^7.5.5" - "@babel/generator" "^7.6.2" - "@babel/helpers" "^7.6.2" - "@babel/parser" "^7.6.2" - "@babel/template" "^7.6.0" - "@babel/traverse" "^7.6.2" - "@babel/types" "^7.6.0" - convert-source-map "^1.1.0" - debug "^4.1.0" - json5 "^2.1.0" - lodash "^4.17.13" - resolve "^1.3.2" - semver "^5.4.1" - source-map "^0.5.0" - -"@babel/generator@^7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.12.11.tgz#98a7df7b8c358c9a37ab07a24056853016aba3af" - integrity sha512-Ggg6WPOJtSi8yYQvLVjG8F/TlpWDlKx0OpS4Kt+xMQPs5OaGYWy+v1A+1TvxI6sAMGZpKWWoAQ1DaeQbImlItA== - dependencies: - "@babel/types" "^7.12.11" + "@babel/types" "^7.16.0" jsesc "^2.5.1" source-map "^0.5.0" -"@babel/generator@^7.4.0", "@babel/generator@^7.6.2": - version "7.6.2" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.6.2.tgz#dac8a3c2df118334c2a29ff3446da1636a8f8c03" - integrity sha512-j8iHaIW4gGPnViaIHI7e9t/Hl8qLjERI6DcV9kEpAIDJsAOrcnXqRS7t+QbhL76pwbtqP+QCQLL0z1CyVmtjjQ== +"@babel/helper-annotate-as-pure@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.0.tgz#9a1f0ebcda53d9a2d00108c4ceace6a5d5f1f08d" + integrity sha512-ItmYF9vR4zA8cByDocY05o0LGUkp1zhbTQOH1NFyl5xXEqlTJQCEJjieriw+aFpxo16swMxUnUiKS7a/r4vtHg== dependencies: - "@babel/types" "^7.6.0" - jsesc "^2.5.1" - lodash "^4.17.13" - source-map "^0.5.0" + "@babel/types" "^7.16.0" -"@babel/helper-create-class-features-plugin@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.12.1.tgz#3c45998f431edd4a9214c5f1d3ad1448a6137f6e" - integrity sha512-hkL++rWeta/OVOBTRJc9a5Azh5mt5WgZUGAKMD8JM141YsE08K//bp1unBBieO6rUKkIPyUE0USQ30jAy3Sk1w== +"@babel/helper-create-class-features-plugin@^7.16.5": + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.5.tgz#5d1bcd096792c1ebec6249eebc6358eec55d0cad" + integrity sha512-NEohnYA7mkB8L5JhU7BLwcBdU3j83IziR9aseMueWGeAjblbul3zzb8UvJ3a1zuBiqCMObzCJHFqKIQE6hTVmg== dependencies: - "@babel/helper-function-name" "^7.10.4" - "@babel/helper-member-expression-to-functions" "^7.12.1" - "@babel/helper-optimise-call-expression" "^7.10.4" - "@babel/helper-replace-supers" "^7.12.1" - "@babel/helper-split-export-declaration" "^7.10.4" + "@babel/helper-annotate-as-pure" "^7.16.0" + "@babel/helper-environment-visitor" "^7.16.5" + "@babel/helper-function-name" "^7.16.0" + "@babel/helper-member-expression-to-functions" "^7.16.5" + "@babel/helper-optimise-call-expression" "^7.16.0" + "@babel/helper-replace-supers" "^7.16.5" + "@babel/helper-split-export-declaration" "^7.16.0" -"@babel/helper-function-name@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz#d2d3b20c59ad8c47112fa7d2a94bc09d5ef82f1a" - integrity sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ== +"@babel/helper-environment-visitor@^7.16.5": + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.5.tgz#f6a7f38b3c6d8b07c88faea083c46c09ef5451b8" + integrity sha512-ODQyc5AnxmZWm/R2W7fzhamOk1ey8gSguo5SGvF0zcB3uUzRpTRmM/jmLSm9bDMyPlvbyJ+PwPEK0BWIoZ9wjg== dependencies: - "@babel/helper-get-function-arity" "^7.10.4" - "@babel/template" "^7.10.4" - "@babel/types" "^7.10.4" + "@babel/types" "^7.16.0" -"@babel/helper-function-name@^7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.12.11.tgz#1fd7738aee5dcf53c3ecff24f1da9c511ec47b42" - integrity sha512-AtQKjtYNolKNi6nNNVLQ27CP6D9oFR6bq/HPYSizlzbp7uC1M59XJe8L+0uXjbIaZaUJF99ruHqVGiKXU/7ybA== +"@babel/helper-function-name@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz#b7dd0797d00bbfee4f07e9c4ea5b0e30c8bb1481" + integrity sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog== dependencies: - "@babel/helper-get-function-arity" "^7.12.10" - "@babel/template" "^7.12.7" - "@babel/types" "^7.12.11" + "@babel/helper-get-function-arity" "^7.16.0" + "@babel/template" "^7.16.0" + "@babel/types" "^7.16.0" -"@babel/helper-get-function-arity@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz#98c1cbea0e2332f33f9a4661b8ce1505b2c19ba2" - integrity sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A== +"@babel/helper-get-function-arity@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz#0088c7486b29a9cb5d948b1a1de46db66e089cfa" + integrity sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ== dependencies: - "@babel/types" "^7.10.4" + "@babel/types" "^7.16.0" -"@babel/helper-get-function-arity@^7.12.10": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.10.tgz#b158817a3165b5faa2047825dfa61970ddcc16cf" - integrity sha512-mm0n5BPjR06wh9mPQaDdXWDoll/j5UpCAPl1x8fS71GHm7HA6Ua2V4ylG1Ju8lvcTOietbPNNPaSilKj+pj+Ag== +"@babel/helper-hoist-variables@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz#4c9023c2f1def7e28ff46fc1dbcd36a39beaa81a" + integrity sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg== dependencies: - "@babel/types" "^7.12.10" + "@babel/types" "^7.16.0" -"@babel/helper-member-expression-to-functions@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.1.tgz#fba0f2fcff3fba00e6ecb664bb5e6e26e2d6165c" - integrity sha512-k0CIe3tXUKTRSoEx1LQEPFU9vRQfqHtl+kf8eNnDqb4AUJEy5pz6aIiog+YWtVm2jpggjS1laH68bPsR+KWWPQ== +"@babel/helper-member-expression-to-functions@^7.16.5": + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.5.tgz#1bc9f7e87354e86f8879c67b316cb03d3dc2caab" + integrity sha512-7fecSXq7ZrLE+TWshbGT+HyCLkxloWNhTbU2QM1NTI/tDqyf0oZiMcEfYtDuUDCo528EOlt39G1rftea4bRZIw== dependencies: - "@babel/types" "^7.12.1" + "@babel/types" "^7.16.0" -"@babel/helper-optimise-call-expression@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz#50dc96413d594f995a77905905b05893cd779673" - integrity sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg== +"@babel/helper-optimise-call-expression@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.0.tgz#cecdb145d70c54096b1564f8e9f10cd7d193b338" + integrity sha512-SuI467Gi2V8fkofm2JPnZzB/SUuXoJA5zXe/xzyPP2M04686RzFKFHPK6HDVN6JvWBIEW8tt9hPR7fXdn2Lgpw== dependencies: - "@babel/types" "^7.10.4" + "@babel/types" "^7.16.0" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375" - integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg== +"@babel/helper-plugin-utils@^7.16.5": + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.5.tgz#afe37a45f39fce44a3d50a7958129ea5b1a5c074" + integrity sha512-59KHWHXxVA9K4HNF4sbHCf+eJeFe0Te/ZFGqBT4OjXhrwvA04sGfaEGsVTdsjoszq0YTP49RC9UKe5g8uN2RwQ== -"@babel/helper-replace-supers@^7.12.1": - version "7.12.5" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.12.5.tgz#f009a17543bbbbce16b06206ae73b63d3fca68d9" - integrity sha512-5YILoed0ZyIpF4gKcpZitEnXEJ9UoDRki1Ey6xz46rxOzfNMAhVIJMoune1hmPVxh40LRv1+oafz7UsWX+vyWA== +"@babel/helper-replace-supers@^7.16.5": + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.16.5.tgz#96d3988bd0ab0a2d22c88c6198c3d3234ca25326" + integrity sha512-ao3seGVa/FZCMCCNDuBcqnBFSbdr8N2EW35mzojx3TwfIbdPmNK+JV6+2d5bR0Z71W5ocLnQp9en/cTF7pBJiQ== dependencies: - "@babel/helper-member-expression-to-functions" "^7.12.1" - "@babel/helper-optimise-call-expression" "^7.10.4" - "@babel/traverse" "^7.12.5" - "@babel/types" "^7.12.5" + "@babel/helper-environment-visitor" "^7.16.5" + "@babel/helper-member-expression-to-functions" "^7.16.5" + "@babel/helper-optimise-call-expression" "^7.16.0" + "@babel/traverse" "^7.16.5" + "@babel/types" "^7.16.0" -"@babel/helper-split-export-declaration@^7.10.4": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz#f8a491244acf6a676158ac42072911ba83ad099f" - integrity sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg== +"@babel/helper-split-export-declaration@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz#29672f43663e936df370aaeb22beddb3baec7438" + integrity sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw== dependencies: - "@babel/types" "^7.11.0" + "@babel/types" "^7.16.0" -"@babel/helper-split-export-declaration@^7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.11.tgz#1b4cc424458643c47d37022223da33d76ea4603a" - integrity sha512-LsIVN8j48gHgwzfocYUSkO/hjYAOJqlpJEc7tGXcIm4cubjVUf8LGW6eWRyxEu7gA25q02p0rQUWoCI33HNS5g== +"@babel/helper-validator-identifier@^7.15.7": + version "7.15.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" + integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== + +"@babel/highlight@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.0.tgz#6ceb32b2ca4b8f5f361fb7fd821e3fddf4a1725a" + integrity sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g== dependencies: - "@babel/types" "^7.12.11" - -"@babel/helper-validator-identifier@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2" - integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw== - -"@babel/helper-validator-identifier@^7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" - integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== - -"@babel/helpers@^7.6.2": - version "7.6.2" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.6.2.tgz#681ffe489ea4dcc55f23ce469e58e59c1c045153" - integrity sha512-3/bAUL8zZxYs1cdX2ilEE0WobqbCmKWr/889lf2SS0PpDcpEIY8pb1CCyz0pEcX3pEb+MCbks1jIokz2xLtGTA== - dependencies: - "@babel/template" "^7.6.0" - "@babel/traverse" "^7.6.2" - "@babel/types" "^7.6.0" - -"@babel/highlight@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.10.4.tgz#7d1bdfd65753538fabe6c38596cdb76d9ac60143" - integrity sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA== - dependencies: - "@babel/helper-validator-identifier" "^7.10.4" + "@babel/helper-validator-identifier" "^7.15.7" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.10.4", "@babel/parser@^7.12.11", "@babel/parser@^7.12.7", "@babel/parser@^7.4.3", "@babel/parser@^7.6.0", "@babel/parser@^7.6.2", "@babel/parser@^7.7.0": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.11.tgz#9ce3595bcd74bc5c466905e86c535b8b25011e79" - integrity sha512-N3UxG+uuF4CMYoNj8AhnbAcJF0PiuJ9KHuy1lQmkYsxTer/MAH9UBNHsBoAX/4s6NvlDD047No8mYVGGzLL4hg== +"@babel/parser@^7.16.0", "@babel/parser@^7.16.5", "@babel/parser@^7.7.0": + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.5.tgz#beb3af702e54d24796341ab9420fb329131ad658" + integrity sha512-+Ce7T5iPNWzfu9C1aB5tN3Lyafs5xb3Ic7vBWyZL2KXT3QSdD1dD3CvgOzPmQKoNNRt6uauc0XwNJTQtXC2/Mw== "@babel/plugin-proposal-class-properties@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.12.1.tgz#a082ff541f2a29a4821065b8add9346c0c16e5de" - integrity sha512-cKp3dlQsFsEs5CWKnN7BnSHOd0EOW8EKpEjkoz1pO2E5KzIDNV9Ros1b0CnmbVgAGXJubOYVBOGCT1OmJwOI7w== + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.5.tgz#3269f44b89122110f6339806e05d43d84106468a" + integrity sha512-pJD3HjgRv83s5dv1sTnDbZOaTjghKEz8KUn1Kbh2eAIRhGuyQ1XSeI4xVXU3UlIEVA3DAyIdxqT1eRn7Wcn55A== dependencies: - "@babel/helper-create-class-features-plugin" "^7.12.1" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-create-class-features-plugin" "^7.16.5" + "@babel/helper-plugin-utils" "^7.16.5" -"@babel/plugin-syntax-object-rest-spread@^7.0.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e" - integrity sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/runtime@^7.6.3": - version "7.13.10" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.13.10.tgz#47d42a57b6095f4468da440388fdbad8bebf0d7d" - integrity sha512-4QPkjJq6Ns3V/RgpEahRk+AGfL0eO6RHHtTWoNNr5mO49G6B5+X6d6THgWEAvTrznU5xYpbAlVKRYcsCgh/Akw== +"@babel/runtime@^7.6.3", "@babel/runtime@^7.9.2": + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.5.tgz#7f3e34bf8bdbbadf03fbb7b1ea0d929569c9487a" + integrity sha512-TXWihFIS3Pyv5hzR7j6ihmeLkZfrXGxAr5UfSl8CHf+6q/wpiYDkUau0czckpYG8QmnCIuPpdLtuA9VmuGGyMA== dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.10.4.tgz#3251996c4200ebc71d1a8fc405fba940f36ba278" - integrity sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA== +"@babel/template@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.0.tgz#d16a35ebf4cd74e202083356fab21dd89363ddd6" + integrity sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A== dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/parser" "^7.10.4" - "@babel/types" "^7.10.4" + "@babel/code-frame" "^7.16.0" + "@babel/parser" "^7.16.0" + "@babel/types" "^7.16.0" -"@babel/template@^7.12.7": - version "7.12.7" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.7.tgz#c817233696018e39fbb6c491d2fb684e05ed43bc" - integrity sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow== +"@babel/traverse@^7.16.5", "@babel/traverse@^7.7.0": + version "7.16.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.5.tgz#d7d400a8229c714a59b87624fc67b0f1fbd4b2b3" + integrity sha512-FOCODAzqUMROikDYLYxl4nmwiLlu85rNqBML/A5hKRVXG2LV8d0iMqgPzdYTcIpjZEBB7D6UDU9vxRZiriASdQ== dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/parser" "^7.12.7" - "@babel/types" "^7.12.7" - -"@babel/template@^7.4.0", "@babel/template@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.6.0.tgz#7f0159c7f5012230dad64cca42ec9bdb5c9536e6" - integrity sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.6.0" - "@babel/types" "^7.6.0" - -"@babel/traverse@^7.1.0", "@babel/traverse@^7.12.5", "@babel/traverse@^7.4.3", "@babel/traverse@^7.6.2", "@babel/traverse@^7.7.0": - version "7.12.12" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.12.12.tgz#d0cd87892704edd8da002d674bc811ce64743376" - integrity sha512-s88i0X0lPy45RrLM8b9mz8RPH5FqO9G9p7ti59cToE44xFm1Q+Pjh5Gq4SXBbtb88X7Uy7pexeqRIQDDMNkL0w== - dependencies: - "@babel/code-frame" "^7.12.11" - "@babel/generator" "^7.12.11" - "@babel/helper-function-name" "^7.12.11" - "@babel/helper-split-export-declaration" "^7.12.11" - "@babel/parser" "^7.12.11" - "@babel/types" "^7.12.12" + "@babel/code-frame" "^7.16.0" + "@babel/generator" "^7.16.5" + "@babel/helper-environment-visitor" "^7.16.5" + "@babel/helper-function-name" "^7.16.0" + "@babel/helper-hoist-variables" "^7.16.0" + "@babel/helper-split-export-declaration" "^7.16.0" + "@babel/parser" "^7.16.5" + "@babel/types" "^7.16.0" debug "^4.1.0" globals "^11.1.0" - lodash "^4.17.19" -"@babel/types@^7.0.0", "@babel/types@^7.10.4", "@babel/types@^7.11.0", "@babel/types@^7.12.1", "@babel/types@^7.12.10", "@babel/types@^7.12.11", "@babel/types@^7.12.12", "@babel/types@^7.12.5", "@babel/types@^7.12.7", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.6.0", "@babel/types@^7.7.0": - version "7.12.12" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.12.tgz#4608a6ec313abbd87afa55004d373ad04a96c299" - integrity sha512-lnIX7piTxOH22xE7fDXDbSHg9MM1/6ORnafpJmov5rs0kX5g4BZxeXNJLXsMRiO0U5Rb8/FvMS6xlTnTHvxonQ== +"@babel/types@^7.16.0", "@babel/types@^7.7.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.0.tgz#db3b313804f96aadd0b776c4823e127ad67289ba" + integrity sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg== dependencies: - "@babel/helper-validator-identifier" "^7.12.11" - lodash "^4.17.19" + "@babel/helper-validator-identifier" "^7.15.7" to-fast-properties "^2.0.0" -"@cnakazawa/watch@^1.0.3": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.3.tgz#099139eaec7ebf07a27c1786a3ff64f39464d2ef" - integrity sha512-r5160ogAvGyHsal38Kux7YYtodEKOj89RGb28ht1jh3SJb08VwRwAKKJL0bGb04Zd/3r9FL3BFIc3bBidYffCA== - dependencies: - exec-sh "^0.3.2" - minimist "^1.2.0" - "@dabh/diagnostics@^2.0.2": version "2.0.2" resolved "https://registry.yarnpkg.com/@dabh/diagnostics/-/diagnostics-2.0.2.tgz#290d08f7b381b8f94607dc8f471a12c675f9db31" @@ -257,198 +181,126 @@ enabled "2.0.x" kuler "^2.0.0" -"@grpc/grpc-js@^1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.2.2.tgz#ee4a7417fe15a686a8e369c36ec4c80678445c67" - integrity sha512-iK/T984Ni6VnmlQK/LJdUk+VsXSaYIWkgzJ0LyOcxN2SowAmoRjG28kS7B1ui/q/MAv42iM3051WBt5QorFxmg== +"@eslint/eslintrc@^1.3.3": + version "1.3.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.3.tgz#2b044ab39fdfa75b4688184f9e573ce3c5b0ff95" + integrity sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg== dependencies: - "@types/node" "^12.12.47" - google-auth-library "^6.1.1" - semver "^6.2.0" + ajv "^6.12.4" + debug "^4.3.2" + espree "^9.4.0" + globals "^13.15.0" + ignore "^5.2.0" + import-fresh "^3.2.1" + js-yaml "^4.1.0" + minimatch "^3.1.2" + strip-json-comments "^3.1.1" + +"@grpc/grpc-js@^1.2.2": + version "1.4.4" + resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.4.4.tgz#59336f13d77bc446bbdf2161564a32639288dc5b" + integrity sha512-a6222b7Dl6fIlMgzVl7e+NiRoLiZFbpcwvBH2Oli56Bn7W4/3Ld+86hK4ffPn5rx2DlDidmIcvIJiOQXyhv9gA== + dependencies: + "@grpc/proto-loader" "^0.6.4" + "@types/node" ">=12.12.47" "@grpc/proto-loader@^0.5.5": - version "0.5.5" - resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.5.5.tgz#6725e7a1827bdf8e92e29fbf4e9ef0203c0906a9" - integrity sha512-WwN9jVNdHRQoOBo9FDH7qU+mgfjPc8GygPYms3M+y3fbQLfnCe/Kv/E01t7JRgnrsOHH8euvSbed3mIalXhwqQ== + version "0.5.6" + resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.5.6.tgz#1dea4b8a6412b05e2d58514d507137b63a52a98d" + integrity sha512-DT14xgw3PSzPxwS13auTEwxhMMOoz33DPUKNtmYK/QYbBSpLXJy78FGGs5yVoxVobEqPm4iW9MOIoz0A3bLTRQ== dependencies: lodash.camelcase "^4.3.0" protobufjs "^6.8.6" -"@jest/console@^24.7.1", "@jest/console@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.9.0.tgz#79b1bc06fb74a8cfb01cbdedf945584b1b9707f0" - integrity sha512-Zuj6b8TnKXi3q4ymac8EQfc3ea/uhLeCGThFqXeC8H9/raaH8ARPUTdId+XyGd03Z4In0/VjD2OYFcBF09fNLQ== +"@grpc/proto-loader@^0.6.4": + version "0.6.7" + resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.6.7.tgz#e62a202f4cf5897bdd0e244dec1dbc80d84bdfa1" + integrity sha512-QzTPIyJxU0u+r2qGe8VMl3j/W2ryhEvBv7hc42OjYfthSj370fUrb7na65rG6w3YLZS/fb8p89iTBobfWGDgdw== dependencies: - "@jest/source-map" "^24.9.0" - chalk "^2.0.1" - slash "^2.0.0" + "@types/long" "^4.0.1" + lodash.camelcase "^4.3.0" + long "^4.0.0" + protobufjs "^6.10.0" + yargs "^16.1.1" -"@jest/core@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-24.9.0.tgz#2ceccd0b93181f9c4850e74f2a9ad43d351369c4" - integrity sha512-Fogg3s4wlAr1VX7q+rhV9RVnUv5tD7VuWfYy1+whMiWUrvl7U3QJSJyWcDio9Lq2prqYsZaeTv2Rz24pWGkJ2A== +"@humanwhocodes/config-array@^0.10.5": + version "0.10.7" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.10.7.tgz#6d53769fd0c222767e6452e8ebda825c22e9f0dc" + integrity sha512-MDl6D6sBsaV452/QSdX+4CXIjZhIcI0PELsxUjk4U828yd58vk3bTIvk/6w5FY+4hIy9sLW0sfrV7K7Kc++j/w== dependencies: - "@jest/console" "^24.7.1" - "@jest/reporters" "^24.9.0" - "@jest/test-result" "^24.9.0" - "@jest/transform" "^24.9.0" - "@jest/types" "^24.9.0" - ansi-escapes "^3.0.0" - chalk "^2.0.1" - exit "^0.1.2" - graceful-fs "^4.1.15" - jest-changed-files "^24.9.0" - jest-config "^24.9.0" - jest-haste-map "^24.9.0" - jest-message-util "^24.9.0" - jest-regex-util "^24.3.0" - jest-resolve "^24.9.0" - jest-resolve-dependencies "^24.9.0" - jest-runner "^24.9.0" - jest-runtime "^24.9.0" - jest-snapshot "^24.9.0" - jest-util "^24.9.0" - jest-validate "^24.9.0" - jest-watcher "^24.9.0" - micromatch "^3.1.10" - p-each-series "^1.0.0" - realpath-native "^1.1.0" - rimraf "^2.5.4" - slash "^2.0.0" - strip-ansi "^5.0.0" + "@humanwhocodes/object-schema" "^1.2.1" + debug "^4.1.1" + minimatch "^3.0.4" -"@jest/environment@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-24.9.0.tgz#21e3afa2d65c0586cbd6cbefe208bafade44ab18" - integrity sha512-5A1QluTPhvdIPFYnO3sZC3smkNeXPVELz7ikPbhUj0bQjB07EoE9qtLrem14ZUYWdVayYbsjVwIiL4WBIMV4aQ== - dependencies: - "@jest/fake-timers" "^24.9.0" - "@jest/transform" "^24.9.0" - "@jest/types" "^24.9.0" - jest-mock "^24.9.0" +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== -"@jest/fake-timers@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-24.9.0.tgz#ba3e6bf0eecd09a636049896434d306636540c93" - integrity sha512-eWQcNa2YSwzXWIMC5KufBh3oWRIijrQFROsIqt6v/NS9Io/gknw1jsAC9c+ih/RQX4A3O7SeWAhQeN0goKhT9A== - dependencies: - "@jest/types" "^24.9.0" - jest-message-util "^24.9.0" - jest-mock "^24.9.0" +"@humanwhocodes/object-schema@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" + integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== -"@jest/reporters@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-24.9.0.tgz#86660eff8e2b9661d042a8e98a028b8d631a5b43" - integrity sha512-mu4X0yjaHrffOsWmVLzitKmmmWSQ3GGuefgNscUSWNiUNcEOSEQk9k3pERKEQVBb0Cnn88+UESIsZEMH3o88Gw== - dependencies: - "@jest/environment" "^24.9.0" - "@jest/test-result" "^24.9.0" - "@jest/transform" "^24.9.0" - "@jest/types" "^24.9.0" - chalk "^2.0.1" - exit "^0.1.2" - glob "^7.1.2" - istanbul-lib-coverage "^2.0.2" - istanbul-lib-instrument "^3.0.1" - istanbul-lib-report "^2.0.4" - istanbul-lib-source-maps "^3.0.1" - istanbul-reports "^2.2.6" - jest-haste-map "^24.9.0" - jest-resolve "^24.9.0" - jest-runtime "^24.9.0" - jest-util "^24.9.0" - jest-worker "^24.6.0" - node-notifier "^5.4.2" - slash "^2.0.0" - source-map "^0.6.0" - string-length "^2.0.0" - -"@jest/source-map@^24.3.0", "@jest/source-map@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-24.9.0.tgz#0e263a94430be4b41da683ccc1e6bffe2a191714" - integrity sha512-/Xw7xGlsZb4MJzNDgB7PW5crou5JqWiBQaz6xyPd3ArOg2nfn/PunV8+olXbbEZzNl591o5rWKE9BRDaFAuIBg== - dependencies: - callsites "^3.0.0" - graceful-fs "^4.1.15" - source-map "^0.6.0" - -"@jest/test-result@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-24.9.0.tgz#11796e8aa9dbf88ea025757b3152595ad06ba0ca" - integrity sha512-XEFrHbBonBJ8dGp2JmF8kP/nQI/ImPpygKHwQ/SY+es59Z3L5PI4Qb9TQQMAEeYsThG1xF0k6tmG0tIKATNiiA== - dependencies: - "@jest/console" "^24.9.0" - "@jest/types" "^24.9.0" - "@types/istanbul-lib-coverage" "^2.0.0" - -"@jest/test-sequencer@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-24.9.0.tgz#f8f334f35b625a4f2f355f2fe7e6036dad2e6b31" - integrity sha512-6qqsU4o0kW1dvA95qfNog8v8gkRN9ph6Lz7r96IvZpHdNipP2cBcb07J1Z45mz/VIS01OHJ3pY8T5fUY38tg4A== - dependencies: - "@jest/test-result" "^24.9.0" - jest-haste-map "^24.9.0" - jest-runner "^24.9.0" - jest-runtime "^24.9.0" - -"@jest/transform@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-24.9.0.tgz#4ae2768b296553fadab09e9ec119543c90b16c56" - integrity sha512-TcQUmyNRxV94S0QpMOnZl0++6RMiqpbH/ZMccFB/amku6Uwvyb1cjYX7xkp5nGNkbX4QPH/FcB6q1HBTHynLmQ== - dependencies: - "@babel/core" "^7.1.0" - "@jest/types" "^24.9.0" - babel-plugin-istanbul "^5.1.0" - chalk "^2.0.1" - convert-source-map "^1.4.0" - fast-json-stable-stringify "^2.0.0" - graceful-fs "^4.1.15" - jest-haste-map "^24.9.0" - jest-regex-util "^24.9.0" - jest-util "^24.9.0" - micromatch "^3.1.10" - pirates "^4.0.1" - realpath-native "^1.1.0" - slash "^2.0.0" - source-map "^0.6.1" - write-file-atomic "2.4.1" - -"@jest/types@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.9.0.tgz#63cb26cb7500d069e5a389441a7c6ab5e909fc59" - integrity sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw== +"@jest/types@^27.4.2": + version "27.4.2" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.4.2.tgz#96536ebd34da6392c2b7c7737d693885b5dd44a5" + integrity sha512-j35yw0PMTPpZsUoOBiuHzr1zTYoad1cVIE0ajEjcrJONxxrko/IRGKkXx3os0Nsi4Hu3+5VmDbVfq5WhG/pWAg== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^1.1.1" - "@types/yargs" "^13.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^16.0.0" + chalk "^4.0.0" -"@peculiar/asn1-schema@^2.0.1", "@peculiar/asn1-schema@^2.0.8": - version "2.0.8" - resolved "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-2.0.8.tgz#bafb74388590f6ec3d53d1b2a4fdbe66d44224a4" - integrity sha512-D8ZqT61DdzuXfrILNvtdf7MUcTY2o9WHwmF0WgTKPEGNY5SDxNAjBY3enuwV9SXcSuCAwWac9c9v0vsswB1NIw== +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== dependencies: - "@types/asn1js" "^0.0.1" - asn1js "^2.0.26" - pvtsutils "^1.0.10" - tslib "^1.11.1" + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" -"@peculiar/json-schema@^1.1.10": +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + +"@peculiar/asn1-schema@^2.0.44": + version "2.0.44" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-schema/-/asn1-schema-2.0.44.tgz#dcb1b8f84a4dd5f07f674028beade9c3de43cc06" + integrity sha512-uaCnjQ9A9WwQSMuDJcNOCYEPXTahgKbFMvI7eMOMd8lXgx0J1eU7F3BoMsK5PFxa3dVUxjSQbaOjfgGoeHGgoQ== + dependencies: + "@types/asn1js" "^2.0.2" + asn1js "^2.1.1" + pvtsutils "^1.2.1" + tslib "^2.3.0" + +"@peculiar/json-schema@^1.1.12": version "1.1.12" - resolved "https://registry.npmjs.org/@peculiar/json-schema/-/json-schema-1.1.12.tgz#fe61e85259e3b5ba5ad566cb62ca75b3d3cd5339" + resolved "https://registry.yarnpkg.com/@peculiar/json-schema/-/json-schema-1.1.12.tgz#fe61e85259e3b5ba5ad566cb62ca75b3d3cd5339" integrity sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w== dependencies: tslib "^2.0.0" "@peculiar/webcrypto@^1.1.1": - version "1.1.2" - resolved "https://registry.npmjs.org/@peculiar/webcrypto/-/webcrypto-1.1.2.tgz#3114da877ddd9d2d0be10188371e15855aa71368" - integrity sha512-BkgD5iH2n3+Fdd/+xfhac8VbISo4MPvECPhK1kRpuYC7PnhxaJe2rpU7B4udvMeEL8lhJlvCWybo8Y7A29u/xQ== + version "1.2.3" + resolved "https://registry.yarnpkg.com/@peculiar/webcrypto/-/webcrypto-1.2.3.tgz#79268ef0a8068bed2a40fc33bc68b4d3546fe2cc" + integrity sha512-q7wDfZy3k/tpnsYB23/MyyDkjn6IdHh8w+xwoVMS5cu6CjVoFzngXDZEOOuSE4zus2yO6ciQhhHxd4XkLpwVnQ== dependencies: - "@peculiar/asn1-schema" "^2.0.8" - "@peculiar/json-schema" "^1.1.10" - pvtsutils "^1.0.10" - tslib "^2.0.0" - webcrypto-core "^1.1.2" + "@peculiar/asn1-schema" "^2.0.44" + "@peculiar/json-schema" "^1.1.12" + pvtsutils "^1.2.1" + tslib "^2.3.1" + webcrypto-core "^1.4.0" "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": version "1.1.2" @@ -547,100 +399,57 @@ resolved "https://registry.yarnpkg.com/@redux-saga/types/-/types-1.1.0.tgz#0e81ce56b4883b4b2a3001ebe1ab298b84237204" integrity sha512-afmTuJrylUU/0OtqzaRkbyYFFNgCF73Bvel/sw90pvGrWIZ+vyoIJqA6eMSoA6+nb443kTmulmBtC9NerXboNg== -"@samverschueren/stream-to-observable@^0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f" - integrity sha512-MI4Xx6LHs4Webyvi6EbspgyAb4D2Q2VtnCQ1blOJcoLS6mVa8lNN2rkIy1CVxfTUpoyIbCTkXES1rLXztFD1lg== - dependencies: - any-observable "^0.3.0" +"@sindresorhus/is@^0.14.0": + version "0.14.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" + integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== -"@types/asn1js@^0.0.1": - version "0.0.1" - resolved "https://registry.npmjs.org/@types/asn1js/-/asn1js-0.0.1.tgz#ef8b9f9708cb1632a1c3a9cd27717caabe793bc2" - integrity sha1-74uflwjLFjKhw6nNJ3F8qr55O8I= +"@szmarczak/http-timer@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" + integrity sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA== dependencies: - "@types/pvutils" "*" + defer-to-connect "^1.0.1" -"@types/babel__core@^7.1.0": - version "7.1.3" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.3.tgz#e441ea7df63cd080dfcd02ab199e6d16a735fc30" - integrity sha512-8fBo0UR2CcwWxeX7WIIgJ7lXjasFxoYgRnFHUj+hRvKkpiBJbxhdAPTCY6/ZKM0uxANFVzt4yObSLuTiTnazDA== - dependencies: - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" - "@types/babel__generator" "*" - "@types/babel__template" "*" - "@types/babel__traverse" "*" - -"@types/babel__generator@*": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.0.tgz#f1ec1c104d1bb463556ecb724018ab788d0c172a" - integrity sha512-c1mZUu4up5cp9KROs/QAw0gTeHrw/x7m52LcnvMxxOZ03DmLwPV0MlGmlgzV3cnSdjhJOZsj7E7FHeioai+egw== - dependencies: - "@babel/types" "^7.0.0" - -"@types/babel__template@*": - version "7.0.2" - resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.0.2.tgz#4ff63d6b52eddac1de7b975a5223ed32ecea9307" - integrity sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg== - dependencies: - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" - -"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.0.7" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.7.tgz#2496e9ff56196cc1429c72034e07eab6121b6f3f" - integrity sha512-CeBpmX1J8kWLcDEnI3Cl2Eo6RfbGvzUctA+CjZUhOKDFbLfcr7fc4usEqLNWetrlJd7RhAkyYe2czXop4fICpw== - dependencies: - "@babel/types" "^7.3.0" +"@types/asn1js@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@types/asn1js/-/asn1js-2.0.2.tgz#bb1992291381b5f06e22a829f2ae009267cdf8c5" + integrity sha512-t4YHCgtD+ERvH0FyxvNlYwJ2ezhqw7t+Ygh4urQ7dJER8i185JPv6oIM3ey5YQmGN6Zp9EMbpohkjZi9t3UxwA== "@types/bluebird@^3.5.32": - version "3.5.32" - resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.32.tgz#381e7b59e39f010d20bbf7e044e48f5caf1ab620" - integrity sha512-dIOxFfI0C+jz89g6lQ+TqhGgPQ0MxSnh/E4xuC0blhFtyW269+mPG5QeLgbdwst/LvdP8o1y0o/Gz5EHXLec/g== + version "3.5.36" + resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.36.tgz#00d9301d4dc35c2f6465a8aec634bb533674c652" + integrity sha512-HBNx4lhkxN7bx6P0++W8E289foSu8kO8GCk2unhuVggO+cE7rh9DhZUyPhUxNRG9m+5B5BTKxZQ5ZP92x/mx9Q== "@types/body-parser@*": - version "1.17.1" - resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.17.1.tgz#18fcf61768fb5c30ccc508c21d6fd2e8b3bf7897" - integrity sha512-RoX2EZjMiFMjZh9lmYrwgoP9RTpAjSHiJxdp4oidAQVO02T7HER3xj9UKue5534ULWeqVEkujhWcyvUce+d68w== + version "1.19.2" + resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0" + integrity sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g== dependencies: "@types/connect" "*" "@types/node" "*" -"@types/bytebuffer@^5.0.40": - version "5.0.40" - resolved "https://registry.yarnpkg.com/@types/bytebuffer/-/bytebuffer-5.0.40.tgz#d6faac40dcfb09cd856cdc4c01d3690ba536d3ee" - integrity sha512-h48dyzZrPMz25K6Q4+NCwWaxwXany2FhQg/ErOcdZS1ZpsaDnDMZg8JYLMTGz7uvXKrcKGJUZJlZObyfgdaN9g== - dependencies: - "@types/long" "*" - "@types/node" "*" - -"@types/color-name@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" - integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== - "@types/component-emitter@^1.2.10": - version "1.2.10" - resolved "https://registry.yarnpkg.com/@types/component-emitter/-/component-emitter-1.2.10.tgz#ef5b1589b9f16544642e473db5ea5639107ef3ea" - integrity sha512-bsjleuRKWmGqajMerkzox19aGbscQX5rmmvvXl3wlIp5gMG1HgkiwPxsN5p070fBDKTNSPgojVbuY1+HWMbFhg== + version "1.2.11" + resolved "https://registry.yarnpkg.com/@types/component-emitter/-/component-emitter-1.2.11.tgz#50d47d42b347253817a39709fef03ce66a108506" + integrity sha512-SRXjM+tfsSlA9VuG8hGO2nft2p8zjXCK1VcC6N4NXbBbYbSia9kzCChYQajIjzIqOOOuh5Ock6MmV2oux4jDZQ== "@types/connect@*": - version "3.4.32" - resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.32.tgz#aa0e9616b9435ccad02bc52b5b454ffc2c70ba28" - integrity sha512-4r8qa0quOvh7lGD0pre62CAb1oni1OO6ecJLGCezTmhQ8Fz50Arx9RUszryR8KlgK6avuSXvviL6yWyViQABOg== + version "3.4.35" + resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" + integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== dependencies: "@types/node" "*" "@types/cookie@^0.4.0": - version "0.4.0" - resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.4.0.tgz#14f854c0f93d326e39da6e3b6f34f7d37513d108" - integrity sha512-y7mImlc/rNkvCRmg8gC3/lj87S7pTUIJ6QGjwHR9WQJcFs+ZMTOaoPrkdFA/YdbuqVEmEbb5RdhVxMkAcgOnpg== + version "0.4.1" + resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.4.1.tgz#bfd02c1f2224567676c1545199f87c3a861d878d" + integrity sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q== "@types/cors@^2.8.8": - version "2.8.10" - resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.10.tgz#61cc8469849e5bcdd0c7044122265c39cec10cf4" - integrity sha512-C7srjHiVG3Ey1nR6d511dtDkCEjxuN9W1HWAEjGq8kpcwmNM6JJkpC0xvabM7BXTG2wDq8Eu33iH9aQKa7IvLQ== + version "2.8.12" + resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.12.tgz#6b2c510a7ad7039e98e7b8d3d6598f4359e5c080" + integrity sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw== "@types/dotenv@^6.1.1": version "6.1.1" @@ -650,9 +459,9 @@ "@types/node" "*" "@types/eccrypto@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@types/eccrypto/-/eccrypto-1.1.2.tgz#49c452e78c02f890036b8cbee7c18bd77aa16ce1" - integrity sha512-qmB/iGIoqDdCMHAcJiOKI4ZBI1Z3kBQGYQCkgNP/Z9ge5w/EVx5uxQYkGOFpllm6l2N/B3qXcn9vjqXGaV1vRQ== + version "1.1.3" + resolved "https://registry.yarnpkg.com/@types/eccrypto/-/eccrypto-1.1.3.tgz#e46e872f6b519297b560c492988c28958dcfda5c" + integrity sha512-3O0qER6JMYReqVbcQTGmXeMHdw3O+rVps63tlo5g5zoB3altJS8yzSvboSivwVWeYO9o5jSATu7P0UIqYZPgow== dependencies: "@types/expect" "^1.20.4" "@types/node" "*" @@ -662,121 +471,95 @@ resolved "https://registry.yarnpkg.com/@types/expect/-/expect-1.20.4.tgz#8288e51737bf7e3ab5d7c77bfa695883745264e5" integrity sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg== -"@types/express-serve-static-core@*": - version "4.16.9" - resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.16.9.tgz#69e00643b0819b024bdede95ced3ff239bb54558" - integrity sha512-GqpaVWR0DM8FnRUJYKlWgyARoBUAVfRIeVDZQKOttLFp5SmhhF9YFIYeTPwMd/AXfxlP7xVO2dj1fGu0Q+krKQ== +"@types/express-serve-static-core@^4.17.18": + version "4.17.26" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.26.tgz#5d9a8eeecb9d5f9d7fc1d85f541512a84638ae88" + integrity sha512-zeu3tpouA043RHxW0gzRxwCHchMgftE8GArRsvYT0ByDMbn19olQHx5jLue0LxWY6iYtXb7rXmuVtSkhy9YZvQ== dependencies: "@types/node" "*" + "@types/qs" "*" "@types/range-parser" "*" "@types/express@^4.17.1": - version "4.17.1" - resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.1.tgz#4cf7849ae3b47125a567dfee18bfca4254b88c5c" - integrity sha512-VfH/XCP0QbQk5B5puLqTLEeFgR8lfCJHZJKkInZ9mkYd+u8byX0kztXEQxEk4wZXJs8HI+7km2ALXjn4YKcX9w== + version "4.17.13" + resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.13.tgz#a76e2995728999bab51a33fabce1d705a3709034" + integrity sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA== dependencies: "@types/body-parser" "*" - "@types/express-serve-static-core" "*" + "@types/express-serve-static-core" "^4.17.18" + "@types/qs" "*" "@types/serve-static" "*" "@types/gun@^0.9.2": - version "0.9.2" - resolved "https://registry.yarnpkg.com/@types/gun/-/gun-0.9.2.tgz#72493631c5e7fb3fae9a195b1ea8bf3d727fd19d" - integrity sha512-s3O5tnnXtWaZqA2yjfN+Ty3OINRxV51lUevNVldAeky4lk3/6QHSc8hkfPTc0f44JrJCidILrU5bMBGN0SWz1A== + version "0.9.3" + resolved "https://registry.yarnpkg.com/@types/gun/-/gun-0.9.3.tgz#cdc1116e4a43323733a577e7bc330fdf731a7446" + integrity sha512-ydC8P4EHbVUqSK4+BhVQW1b4DCksLVKdnLJENJYuiBQDvk2UfA79vTcKxG7hnpyHPas/7yT6pMviMSDp5m7rmg== "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" - integrity sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg== + version "2.0.3" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762" + integrity sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw== "@types/istanbul-lib-report@*": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz#e5471e7fa33c61358dd38426189c037a58433b8c" - integrity sha512-3BUTyMzbZa2DtDI2BkERNC6jJw2Mr2Y0oGI7mRxYNBPxppbtEK1F66u3bKwU2g+wxwWI7PAoRpJnOY1grJqzHg== + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686" + integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg== dependencies: "@types/istanbul-lib-coverage" "*" -"@types/istanbul-reports@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz#7a8cbf6a406f36c8add871625b278eaf0b0d255a" - integrity sha512-UpYjBi8xefVChsCoBpKShdxTllC9pwISirfoZsUa2AAdQg/Jd2KQGtSbw+ya7GPo7x/wAPlH6JBhKhAsXUEZNA== +"@types/istanbul-reports@^3.0.0": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff" + integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw== dependencies: - "@types/istanbul-lib-coverage" "*" "@types/istanbul-lib-report" "*" -"@types/jest-diff@*": - version "20.0.1" - resolved "https://registry.yarnpkg.com/@types/jest-diff/-/jest-diff-20.0.1.tgz#35cc15b9c4f30a18ef21852e255fdb02f6d59b89" - integrity sha512-yALhelO3i0hqZwhjtcr6dYyaLoCHbAMshwtj6cGxTvHZAKXHsYGdff6E8EPw3xLKY0ELUTQ69Q1rQiJENnccMA== - -"@types/jest@^24.0.18": - version "24.0.18" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.18.tgz#9c7858d450c59e2164a8a9df0905fc5091944498" - integrity sha512-jcDDXdjTcrQzdN06+TSVsPPqxvsZA/5QkYfIZlq1JMw7FdP5AZylbOc+6B/cuDurctRe+MziUMtQ3xQdrbjqyQ== - dependencies: - "@types/jest-diff" "*" - -"@types/json-schema@^7.0.3": - version "7.0.3" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.3.tgz#bdfd69d61e464dcc81b25159c270d75a73c1a636" - integrity sha512-Il2DtDVRGDcqjDtE+rF8iqg1CArehSK84HZJCT7AMITlyXRBpuPhqGLDQMowraqqu1coEaimg4ZOqggt6L6L+A== - "@types/jsonwebtoken@^8.3.7": - version "8.3.7" - resolved "https://registry.yarnpkg.com/@types/jsonwebtoken/-/jsonwebtoken-8.3.7.tgz#ab79ad55b9435834d24cca3112f42c08eedb1a54" - integrity sha512-B5SSifLkjB0ns7VXpOOtOUlynE78/hKcY8G8pOAhkLJZinwofIBYqz555nRj2W9iDWZqFhK5R+7NZDaRmKWAoQ== + version "8.5.6" + resolved "https://registry.yarnpkg.com/@types/jsonwebtoken/-/jsonwebtoken-8.5.6.tgz#1913e5a61e70a192c5a444623da4901a7b1a9d42" + integrity sha512-+P3O/xC7nzVizIi5VbF34YtqSonFsdnbXBnWUCYRiKOi1f9gA4sEFvXkrGr/QVV23IbMYvcoerI7nnhDUiWXRQ== dependencies: "@types/node" "*" -"@types/lodash@^4.14.141": - version "4.14.141" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.141.tgz#d81f4d0c562abe28713406b571ffb27692a82ae6" - integrity sha512-v5NYIi9qEbFEUpCyikmnOYe4YlP8BMUdTcNCAquAKzu+FA7rZ1onj9x80mbnDdOW/K5bFf3Tv5kJplP33+gAbQ== +"@types/lodash@^4.14.168": + version "4.14.178" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.178.tgz#341f6d2247db528d4a13ddbb374bcdc80406f4f8" + integrity sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw== -"@types/long@*", "@types/long@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.0.tgz#719551d2352d301ac8b81db732acb6bdc28dbdef" - integrity sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q== +"@types/long@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.1.tgz#459c65fa1867dafe6a8f322c4c51695663cc55e9" + integrity sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w== -"@types/mime@*": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@types/mime/-/mime-2.0.1.tgz#dc488842312a7f075149312905b5e3c0b054c79d" - integrity sha512-FwI9gX75FgVBJ7ywgnq/P7tw+/o1GUbtP0KzbtusLigAOgIgNISRK0ZPl4qertvXSIE8YbsVJueQ90cDt9YYyw== +"@types/mime@^1": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" + integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw== + +"@types/mocha@^9.0.0": + version "9.0.0" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.0.0.tgz#3205bcd15ada9bc681ac20bef64e9e6df88fd297" + integrity sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA== "@types/node-fetch@^2.5.8": - version "2.5.8" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.8.tgz#e199c835d234c7eb0846f6618012e558544ee2fb" - integrity sha512-fbjI6ja0N5ZA8TV53RUqzsKNkl9fv8Oj3T7zxW7FGv1GSH7gwJaNF8dzCjrqKaxKeUpTz4yT1DaJFq/omNpGfw== + version "2.5.12" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.12.tgz#8a6f779b1d4e60b7a57fb6fd48d84fb545b9cc66" + integrity sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw== dependencies: "@types/node" "*" form-data "^3.0.0" "@types/node-persist@^3.1.1": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@types/node-persist/-/node-persist-3.1.1.tgz#de444e87561e8ad022e1f31ad4fee377d9db1b13" - integrity sha512-4PRvgEWkKrWWCZR5Hp/aoAu13z3+e99d9KtbXEDbcJPe84yDoRz3d2IEhiVcSe8fJubYMpXJhyGOdqJ8yoGZsA== + version "3.1.2" + resolved "https://registry.yarnpkg.com/@types/node-persist/-/node-persist-3.1.2.tgz#88020628a0124836e98e5c1060591b2dade2bb4a" + integrity sha512-aLFUB1951wOfR+tZ4f3TudLPblo9+PfnduMh6feuOTijD0Q6YkMdqPXSgQIjI23FGmCuoZaIZ9x6cvEG/TdiSg== dependencies: "@types/node" "*" -"@types/node@*": - version "12.7.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.7.4.tgz#64db61e0359eb5a8d99b55e05c729f130a678b04" - integrity sha512-W0+n1Y+gK/8G2P/piTkBBN38Qc5Q1ZSO6B5H3QmPCUewaiXOo2GCAWZ4ElZCcNhjJuBSUSLGFUJnmlCn5+nxOQ== - -"@types/node@>=10.0.0": - version "14.14.37" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.37.tgz#a3dd8da4eb84a996c36e331df98d82abd76b516e" - integrity sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw== - -"@types/node@^10.1.0": - version "10.14.17" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.17.tgz#b96d4dd3e427382482848948041d3754d40fd5ce" - integrity sha512-p/sGgiPaathCfOtqu2fx5Mu1bcjuP8ALFg4xpGgNkcin7LwRyzUKniEHBKdcE1RPsenq5JVPIpMTJSygLboygQ== - -"@types/node@^12.12.47": - version "12.19.8" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.19.8.tgz#efd6d1a90525519fc608c9db16c8a78f7693a978" - integrity sha512-D4k2kNi0URNBxIRCb1khTnkWNHv8KSL1owPmS/K5e5t8B2GzMReY7AsJIY1BnP5KdlgC4rj9jk2IkDMasIE7xg== +"@types/node@*", "@types/node@>=10.0.0", "@types/node@>=12.12.47", "@types/node@>=13.7.0": + version "16.11.13" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.13.tgz#6b71641b81a98c6a538d89892440c06f147edddc" + integrity sha512-eUXZzHLHoZqj1frtUetNkUetYoJ6X55UmrVnFD4DMhVeAmwLjniZhtBmsRiemQh4uq4G3vUra/Ws/hs9vEvL3Q== "@types/parse-json@^4.0.0": version "4.0.0" @@ -784,44 +567,55 @@ integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== "@types/prop-types@*": - version "15.7.3" - resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" - integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== + version "15.7.4" + resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.4.tgz#fcf7205c25dff795ee79af1e30da2c9790808f11" + integrity sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ== -"@types/pvutils@*": - version "0.0.2" - resolved "https://registry.npmjs.org/@types/pvutils/-/pvutils-0.0.2.tgz#e21684962cfa58ac920fd576d90556032dc86009" - integrity sha512-CgQAm7pjyeF3Gnv78ty4RBVIfluB+Td+2DR8iPaU0prF18pkzptHHP+DoKPfpsJYknKsVZyVsJEu5AuGgAqQ5w== +"@types/qs@*": + version "6.9.7" + resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" + integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== "@types/ramda@types/npm-ramda#dist": version "0.25.0" resolved "https://codeload.github.com/types/npm-ramda/tar.gz/9529aa3c8ff70ff84afcbc0be83443c00f30ea90" +"@types/random-words@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@types/random-words/-/random-words-1.1.2.tgz#4ffe4da4817b4629d8802c8ac16466783e745c6e" + integrity sha512-gULpJ68bNovfBWPWNNhwJgd/GcKdfkPpXXQGgACQWffgy6LRiJB4+4s/IslhFJKQvb5wBlnlOwFJ6RawHU5z3A== + "@types/range-parser@*": - version "1.2.3" - resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.3.tgz#7ee330ba7caafb98090bece86a5ee44115904c2c" - integrity sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA== + version "1.2.4" + resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" + integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== "@types/react@16.x.x": - version "16.14.2" - resolved "https://registry.yarnpkg.com/@types/react/-/react-16.14.2.tgz#85dcc0947d0645349923c04ccef6018a1ab7538c" - integrity sha512-BzzcAlyDxXl2nANlabtT4thtvbbnhee8hMmH/CcJrISDBVcJS1iOsP1f0OAgSdGE0MsY9tqcrb9YoZcOFv9dbQ== + version "16.14.21" + resolved "https://registry.yarnpkg.com/@types/react/-/react-16.14.21.tgz#35199b21a278355ec7a3c40003bd6a334bd4ae4a" + integrity sha512-rY4DzPKK/4aohyWiDRHS2fotN5rhBSK6/rz1X37KzNna9HJyqtaGAbq9fVttrEPWF5ywpfIP1ITL8Xi2QZn6Eg== dependencies: "@types/prop-types" "*" + "@types/scheduler" "*" csstype "^3.0.2" -"@types/serve-static@*": - version "1.13.3" - resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.3.tgz#eb7e1c41c4468272557e897e9171ded5e2ded9d1" - integrity sha512-oprSwp094zOglVrXdlo/4bAHtKTAxX6VT8FOZlBKrmyLbNvE1zxZyJ6yikMVtHIvwP45+ZQGJn+FdXGKTozq0g== - dependencies: - "@types/express-serve-static-core" "*" - "@types/mime" "*" +"@types/scheduler@*": + version "0.16.2" + resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" + integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew== -"@types/stack-utils@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" - integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== +"@types/serve-static@*": + version "1.13.10" + resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.10.tgz#f5e0ce8797d2d7cc5ebeda48a52c96c4fa47a8d9" + integrity sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ== + dependencies: + "@types/mime" "^1" + "@types/node" "*" + +"@types/stack-utils@^2.0.0": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" + integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== "@types/uuid@^8.3.0": version "8.3.0" @@ -829,51 +623,27 @@ integrity sha512-eQ9qFW/fhfGJF8WKHGEHZEyVWfZxrT+6CLIJGBcZPfxUh/+BnEj+UCGYMlr9qZuX/2AltsvwrGqp0LhEW8D0zQ== "@types/yargs-parser@*": - version "13.1.0" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-13.1.0.tgz#c563aa192f39350a1d18da36c5a8da382bbd8228" - integrity sha512-gCubfBUZ6KxzoibJ+SCUc/57Ms1jz5NjHe4+dI2krNmU5zCPAphyLJYyTOg06ueIyfj+SaCUqmzun7ImlxDcKg== + version "20.2.1" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129" + integrity sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw== -"@types/yargs@^13.0.0": - version "13.0.3" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-13.0.3.tgz#76482af3981d4412d65371a318f992d33464a380" - integrity sha512-K8/LfZq2duW33XW/tFwEAfnZlqIfVsoyRB3kfXdPXYhl0nfM8mmh7GS0jg7WrX2Dgq/0Ha/pR1PaR+BvmWwjiQ== +"@types/yargs@^16.0.0": + version "16.0.4" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.4.tgz#26aad98dd2c2a38e421086ea9ad42b9e51642977" + integrity sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw== dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/experimental-utils@^1.13.0": - version "1.13.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-1.13.0.tgz#b08c60d780c0067de2fb44b04b432f540138301e" - integrity sha512-zmpS6SyqG4ZF64ffaJ6uah6tWWWgZ8m+c54XXgwFtUv0jNz8aJAVx8chMCvnk7yl6xwn8d+d96+tWp7fXzTuDg== - dependencies: - "@types/json-schema" "^7.0.3" - "@typescript-eslint/typescript-estree" "1.13.0" - eslint-scope "^4.0.0" - -"@typescript-eslint/typescript-estree@1.13.0": - version "1.13.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.13.0.tgz#8140f17d0f60c03619798f1d628b8434913dc32e" - integrity sha512-b5rCmd2e6DCC6tCTN9GSUAuxdYwCM/k/2wdjHGrIRGPSJotWMCe/dGpi66u42bhuh8q3QBzqM4TMA1GUUCJvdw== - dependencies: - lodash.unescape "4.0.1" - semver "5.5.0" - -abab@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.2.tgz#a2fba1b122c69a85caa02d10f9270c7219709a9d" - integrity sha512-2scffjvioEmNz0OyDSLGWDfKCVwaKc6l9Pm9kOIREU13ClXZvHpg/nRL5xyjSSSLhOnXqft2HpsAzNEEA8cFFg== +"@ungap/promise-all-settled@1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" + integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== -abort-controller@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" - integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== - dependencies: - event-target-shim "^5.0.0" - accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7: version "1.3.7" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" @@ -882,114 +652,67 @@ accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7: mime-types "~2.1.24" negotiator "0.6.2" -acorn-globals@^4.1.0: - version "4.3.4" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.4.tgz#9fa1926addc11c97308c4e66d7add0d40c3272e7" - integrity sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A== - dependencies: - acorn "^6.0.1" - acorn-walk "^6.0.1" - -acorn-jsx@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.1.0.tgz#294adb71b57398b0680015f0a38c563ee1db5384" - integrity sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw== - -acorn-walk@^6.0.1: - version "6.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.2.0.tgz#123cb8f3b84c2171f1f7fb252615b1c78a6b1a8c" - integrity sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA== +acorn-jsx@^5.3.2: + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== acorn@7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.1.tgz#e35668de0b402f359de515c5482a1ab9f89a69bf" integrity sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg== -acorn@^5.5.3: - version "5.7.4" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.4.tgz#3e8d8a9947d0599a1796d10225d7432f4a4acf5e" - integrity sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg== - -acorn@^6.0.1: - version "6.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.3.0.tgz#0087509119ffa4fc0a0041d1e93a417e68cb856e" - integrity sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA== - -acorn@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.0.tgz#949d36f2c292535da602283586c2477c57eb2d6c" - integrity sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ== +acorn@^8.8.0: + version "8.8.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" + integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== addressparser@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/addressparser/-/addressparser-0.3.2.tgz#59873f35e8fcf6c7361c10239261d76e15348bb2" integrity sha1-WYc/Nej89sc2HBAjkmHXbhU0i7I= -agent-base@6: - version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - aggregate-error@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.0.1.tgz#db2fe7246e536f40d9b5442a39e117d7dd6a24e0" - integrity sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA== + version "3.1.0" + resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" + integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== dependencies: clean-stack "^2.0.0" indent-string "^4.0.0" -ajv@^6.10.0, ajv@^6.10.2: - version "6.10.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" - integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== - dependencies: - fast-deep-equal "^2.0.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ajv@^6.12.3: - version "6.12.4" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.4.tgz#0614facc4522127fa713445c6bfd3ebd376e2234" - integrity sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ== +ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== dependencies: fast-deep-equal "^3.1.1" fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ansi-align@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f" - integrity sha1-w2rsy6VjuJzrVW82kPCx2eNUf38= +ansi-align@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" + integrity sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w== dependencies: - string-width "^2.0.0" + string-width "^4.1.0" -ansi-colors@^3.2.1: - version "3.2.4" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf" - integrity sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA== +ansi-colors@3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" + integrity sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== -ansi-escapes@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" - integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== - -ansi-escapes@^4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.2.1.tgz#4dccdb846c3eee10f6d64dea66273eab90c37228" - integrity sha512-Cg3ymMAdN10wOk/VYfLV7KCQyv7EDirJ64500sU7n9UlmioEtDuU5Gd+hj73hXSU/ex7tHJSssmyftDdkMLO8Q== - dependencies: - type-fest "^0.5.2" +ansi-colors@4.1.1, ansi-colors@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== ansi-escapes@^4.3.0: - version "4.3.1" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.1.tgz#a5c47cc43181f1f38ffd7076837700d395522a61" - integrity sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA== + version "4.3.2" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== dependencies: - type-fest "^0.11.0" + type-fest "^0.21.3" ansi-regex@^2.0.0: version "2.1.1" @@ -1001,15 +724,15 @@ ansi-regex@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= -ansi-regex@^4.0.0, ansi-regex@^4.1.0: +ansi-regex@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== -ansi-regex@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" - integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== ansi-styles@^2.2.1: version "2.2.1" @@ -1024,38 +747,24 @@ ansi-styles@^3.2.0, ansi-styles@^3.2.1: color-convert "^1.9.0" ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359" - integrity sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA== + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== dependencies: - "@types/color-name" "^1.1.1" color-convert "^2.0.1" -any-observable@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.3.0.tgz#af933475e5806a67d0d7df090dd5e8bef65d119b" - integrity sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog== +ansi-styles@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" + integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== -anymatch@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" - integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== +anymatch@~3.1.1, anymatch@~3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== dependencies: - micromatch "^3.1.4" - normalize-path "^2.1.1" - -aproba@^1.0.3: - version "1.2.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" - integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== - -are-we-there-yet@~1.1.2: - version "1.1.5" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" - integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" + normalize-path "^3.0.0" + picomatch "^2.0.4" arg@^4.1.0: version "4.1.3" @@ -1069,65 +778,37 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= - -arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= - -array-equal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" - integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM= +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= - -arrify@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" - integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== asap@~2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= -ascli@~1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" - integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= - dependencies: - colour "~0.7.1" - optjs "~3.2.2" - asn1@~0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + version "0.2.6" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" + integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== dependencies: safer-buffer "~2.1.0" -asn1js@^2.0.26: - version "2.0.26" - resolved "https://registry.yarnpkg.com/asn1js/-/asn1js-2.0.26.tgz#0a6d435000f556a96c6012969d9704d981b71251" - integrity sha512-yG89F0j9B4B0MKIcFyWWxnpZPLaNTjCj4tkE3fjbAoo0qmpGw0PYYqSbX/4ebnd9Icn8ZgK4K1fvDyEtW1JYtQ== +asn1js@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/asn1js/-/asn1js-2.1.1.tgz#bb3896191ebb5fb1caeda73436a6c6e20a2eedff" + integrity sha512-t9u0dU0rJN4ML+uxgN6VM2Z4H5jWIYm0w8LsZLzMJaQsgL3IJNbxHgmbWDvJAwspyHpDFuzUaUFh4c05UB4+6g== dependencies: pvutils latest @@ -1141,55 +822,30 @@ assert-plus@1.0.0, assert-plus@^1.0.0: resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= - -astral-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" - integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== - astral-regex@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== -async-each@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" - integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== - -async-limiter@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" - integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== - async@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/async/-/async-3.2.0.tgz#b3a2685c5ebb641d3de02d161002c60fc9f85720" - integrity sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw== + version "3.2.2" + resolved "https://registry.yarnpkg.com/async/-/async-3.2.2.tgz#2eb7671034bb2194d45d30e31e24ec7e7f9670cd" + integrity sha512-H0E+qZaDEfx/FY4t7iLRv1W2fFI6+pyCeTw1uN20AQPiwqwM6ojPxHxdLv4z8hi2DtnW9BOckSspLucW7pIE5g== asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= -atob@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= aws4@^1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" - integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== + version "1.11.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" + integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== axios@0.19.0: version "0.19.0" @@ -1199,12 +855,14 @@ axios@0.19.0: follow-redirects "1.5.10" is-buffer "^2.0.2" -axios@^0.21.1: - version "0.21.1" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" - integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA== +axios@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.1.2.tgz#8b6f6c540abf44ab98d9904e8daf55351ca4a331" + integrity sha512-bznQyETwElsXl2RK7HLLwb5GPpOLlycxHCtrpDR/4RqqBzjARaOTo3jz4IgtntWUYee7Ne4S8UHd92VCuzPaWA== dependencies: - follow-redirects "^1.10.0" + follow-redirects "^1.15.0" + form-data "^4.0.0" + proxy-from-env "^1.1.0" babel-code-frame@^6.26.0: version "6.26.0" @@ -1227,19 +885,6 @@ babel-eslint@^10.1.0: eslint-visitor-keys "^1.0.0" resolve "^1.12.0" -babel-jest@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.9.0.tgz#3fc327cb8467b89d14d7bc70e315104a783ccd54" - integrity sha512-ntuddfyiN+EhMw58PTNL1ph4C9rECiQXjI4nMMBKBaNjXvqLdkXpPRcMSr4iyBrJg/+wz9brFUD6RhOAT6r4Iw== - dependencies: - "@jest/transform" "^24.9.0" - "@jest/types" "^24.9.0" - "@types/babel__core" "^7.1.0" - babel-plugin-istanbul "^5.1.0" - babel-preset-jest "^24.9.0" - chalk "^2.4.2" - slash "^2.0.0" - babel-messages@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" @@ -1247,23 +892,6 @@ babel-messages@^6.23.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-istanbul@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.2.0.tgz#df4ade83d897a92df069c4d9a25cf2671293c854" - integrity sha512-5LphC0USA8t4i1zCtjbbNb6jJj/9+X6P37Qfirc/70EQ34xKlMW+a1RHGwxGI+SwWpNwZ27HqvzAobeqaXwiZw== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - find-up "^3.0.0" - istanbul-lib-instrument "^3.3.0" - test-exclude "^5.2.3" - -babel-plugin-jest-hoist@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.9.0.tgz#4f837091eb407e01447c8843cbec546d0002d756" - integrity sha512-2EMA2P8Vp7lG0RAzr4HXqtYwacfMErOuv1U3wrvxHX6rD1sV6xS3WXG3r8TRQ2r6w8OhvSdWt+z41hQNwNm3Xw== - dependencies: - "@types/babel__traverse" "^7.0.6" - babel-plugin-transform-es2015-modules-commonjs@^6.26.2: version "6.26.2" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3" @@ -1282,14 +910,6 @@ babel-plugin-transform-strict-mode@^6.24.1: babel-runtime "^6.22.0" babel-types "^6.24.1" -babel-preset-jest@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.9.0.tgz#192b521e2217fb1d1f67cf73f70c336650ad3cdc" - integrity sha512-izTUuhE4TMfTRPF92fFwD2QfdXaZW08qvWTFCI51V8rW5x00UuPgc3ajRoWofXOuxjfcOM5zzSYsQS3H8KGCAg== - dependencies: - "@babel/plugin-syntax-object-rest-spread" "^7.0.0" - babel-plugin-jest-hoist "^24.9.0" - babel-runtime@^6.22.0, babel-runtime@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" @@ -1340,14 +960,14 @@ babylon@^6.18.0: integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== base-x@^3.0.2: - version "3.0.7" - resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.7.tgz#1c5a7fafe8f66b4114063e8da102799d4e7c408f" - integrity sha512-zAKJGuQPihXW22fkrfOclUUZXM2g92z5GzlSMHxhO6r6Qj+Nm0ccaGNBzDZojzwOMkpjAv4J0fOv1U4go+a4iw== + version "3.0.9" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" + integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== dependencies: safe-buffer "^5.0.1" @@ -1356,34 +976,11 @@ base64-arraybuffer@0.1.4: resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.4.tgz#9818c79e059b1355f97e0428a017c838e90ba812" integrity sha1-mBjHngWbE1X5fgQooBfIOOkLqBI= -base64-js@^1.0.2: - version "1.3.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" - integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g== - -base64-js@^1.3.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" - integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== - base64id@2.0.0, base64id@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/base64id/-/base64id-2.0.0.tgz#2770ac6bc47d312af97a8bf9a634342e0cd25cb6" integrity sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog== -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - basic-auth@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/basic-auth/-/basic-auth-2.0.1.tgz#b998279bf47ce38344b4f3cf916d4679bbf51e3a" @@ -1398,20 +995,20 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" +bech32@=1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.3.tgz#bd47a8986bbb3eec34a56a097a84b8d3e9a2dfcd" + integrity sha512-yuVFUvrNcoJi0sv5phmqc6P+Fl1HjRDRNOOkHY2X/3LBy2bIGNSFx4fZ95HMaXHupuS7cZR15AsvtmCIF4UEyg== + big.js@^5.2.2: version "5.2.2" resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== -bignumber.js@^9.0.0: - version "9.0.1" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.1.tgz#8d7ba124c882bfd8e43260c67475518d0689e4e5" - integrity sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA== - -binary-extensions@^1.0.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" - integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== +binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== bindings@^1.5.0: version "1.5.0" @@ -1427,24 +1024,25 @@ bip66@^1.1.5: dependencies: safe-buffer "^5.0.1" -bitcore-lib@^0.15.0: - version "0.15.0" - resolved "https://registry.yarnpkg.com/bitcore-lib/-/bitcore-lib-0.15.0.tgz#f924be13869f2aab7e04aeec5642ad3359b6cec2" - integrity sha512-AeXLWhiivF6CDFzrABZHT4jJrflyylDWTi32o30rF92HW9msfuKpjzrHtFKYGa9w0kNVv5HABQjCB3OEav4PhQ== +bitcore-lib@^8.25.8: + version "8.25.8" + resolved "https://registry.yarnpkg.com/bitcore-lib/-/bitcore-lib-8.25.8.tgz#b4a9d6cd715596297d958d2ad12fdf09e54a16d7" + integrity sha512-vxNJ+DLAeC2V8iPa6dRvUbb/Nm3Vr/cXKhCKSIxj8YPU2tP0QiwEz2Lu9sbqhtsmIerS+F1eeHulzS21MpS2GQ== dependencies: + bech32 "=1.1.3" bn.js "=4.11.8" - bs58 "=4.0.1" + bs58 "^4.0.1" buffer-compare "=1.1.1" - elliptic "=6.4.0" + elliptic "^6.5.3" inherits "=2.0.1" - lodash "=4.17.4" + lodash "^4.17.20" bluebird@^3.5.0, bluebird@^3.7.2: version "3.7.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== -bn.js@=4.11.8, bn.js@^4.4.0: +bn.js@=4.11.8: version "4.11.8" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== @@ -1454,7 +1052,7 @@ bn.js@^4.11.8, bn.js@^4.11.9: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== -body-parser@1.19.0, body-parser@^1.16.0: +body-parser@1.19.0: version "1.19.0" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== @@ -1470,18 +1068,35 @@ body-parser@1.19.0, body-parser@^1.16.0: raw-body "2.4.0" type-is "~1.6.17" -boxen@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b" - integrity sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw== +body-parser@^1.16.0: + version "1.19.1" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.1.tgz#1499abbaa9274af3ecc9f6f10396c995943e31d4" + integrity sha512-8ljfQi5eBk8EJfECMrgqNGWPEY5jWP+1IzkzkGdFFEwFQZZyaZ21UqdaHktgiMlH0xLHqIFtE/u2OYE5dOtViA== dependencies: - ansi-align "^2.0.0" - camelcase "^4.0.0" - chalk "^2.0.1" - cli-boxes "^1.0.0" - string-width "^2.0.0" - term-size "^1.2.0" - widest-line "^2.0.0" + bytes "3.1.1" + content-type "~1.0.4" + debug "2.6.9" + depd "~1.1.2" + http-errors "1.8.1" + iconv-lite "0.4.24" + on-finished "~2.3.0" + qs "6.9.6" + raw-body "2.4.2" + type-is "~1.6.18" + +boxen@^5.0.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50" + integrity sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ== + dependencies: + ansi-align "^3.0.0" + camelcase "^6.2.0" + chalk "^4.1.0" + cli-boxes "^2.2.1" + string-width "^4.2.2" + type-fest "^0.20.2" + widest-line "^3.1.0" + wrap-ansi "^7.0.0" brace-expansion@^1.1.7: version "1.1.11" @@ -1491,45 +1106,22 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^2.3.1, braces@^2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - -braces@^3.0.1: +braces@^3.0.1, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== dependencies: fill-range "^7.0.1" -brorand@^1.0.1, brorand@^1.1.0: +brorand@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= -browser-process-hrtime@^0.1.2: - version "0.1.3" - resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz#616f00faef1df7ec1b5bf9cfe2bdc3170f26c7b4" - integrity sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw== - -browser-resolve@^1.11.3: - version "1.11.3" - resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" - integrity sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ== - dependencies: - resolve "1.1.7" +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== browserify-aes@^1.0.6: version "1.2.0" @@ -1543,24 +1135,17 @@ browserify-aes@^1.0.6: inherits "^2.0.1" safe-buffer "^5.0.1" -bs58@=4.0.1: +bs58@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" integrity sha1-vhYedsNU9veIrkBx9j806MTwpCo= dependencies: base-x "^3.0.2" -bser@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.0.tgz#65fc784bf7f87c009b973c12db6546902fa9c7b5" - integrity sha512-8zsjWrQkkBoLK6uxASk1nJ2SKv97ltiGDo6A3wA0/yRPz+CwmEyDo0hUrhIuukG2JHpAl3bvFIixw2/3Hi0DOg== - dependencies: - node-int64 "^0.4.0" - bson@^1.0.4: - version "1.1.1" - resolved "https://registry.yarnpkg.com/bson/-/bson-1.1.1.tgz#4330f5e99104c4e751e7351859e2d408279f2f13" - integrity sha512-jCGVYLoYMHDkOsbwJZBCqwMHyH4c+wzgI9hG7Z6SZJRXWr+x58pdIbm2i9a/jFGCkRJqRUr8eoI7lDWa0hTkxg== + version "1.1.6" + resolved "https://registry.yarnpkg.com/bson/-/bson-1.1.6.tgz#fb819be9a60cd677e0853aee4ca712a785d6618a" + integrity sha512-EvVNVeGo4tHxwi8L6bPj3y3itEvStdwvvlojVxxbyYfoaxJ6keLgrTuKdyfEAszFK+H3olzBuafE0yoh0D1gdg== buffer-compare@=1.1.1: version "1.1.1" @@ -1573,33 +1158,18 @@ buffer-equal-constant-time@1.0.1: integrity sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk= buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== buffer-xor@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= -buffer@^5.4.3: - version "5.4.3" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.4.3.tgz#3fbc9c69eb713d323e3fc1a895eee0710c072115" - integrity sha512-zvj65TkFeIt3i6aj5bIvJDzjjQQGs4o/sNoezg1F1kYap9Nu2jcUdpwzRSJTHMMzG0H7bZkn4rNQpImhuxWX2A== - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - -bytebuffer@~5: - version "5.0.1" - resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" - integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= - dependencies: - long "~3" - bytes@3.0.0: version "3.0.0" - resolved "https://registry.npm.taobao.org/bytes/download/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= bytes@3.1.0: @@ -1607,52 +1177,46 @@ bytes@3.1.0: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== +bytes@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.1.tgz#3f018291cb4cbad9accb6e6970bca9c8889e879a" + integrity sha512-dWe4nWO/ruEOY7HkUJ5gFt1DCFV9zPRoJr8pV0/ASQermOZjtq8jMjOprC0Kd10GLN+l7xaUPvxzJFWtxGu8Fg== + +cacheable-request@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" + integrity sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg== dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" + clone-response "^1.0.2" + get-stream "^5.1.0" + http-cache-semantics "^4.0.0" + keyv "^3.0.0" + lowercase-keys "^2.0.0" + normalize-url "^4.1.0" + responselike "^1.0.2" + +call-bind@^1.0.0, call-bind@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -camelcase@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= - -camelcase@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" - integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= - -camelcase@^5.0.0, camelcase@^5.3.1: +camelcase@^5.0.0: version "5.3.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -capture-exit@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" - integrity sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g== - dependencies: - rsvp "^4.8.4" - -capture-stack-trace@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz#a6c0bbe1f38f3aa0b92238ecb6ff42c344d4135d" - integrity sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw== +camelcase@^6.0.0, camelcase@^6.2.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.1.tgz#250fd350cfd555d0d2160b1d51510eaf8326e86e" + integrity sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA== caseless@~0.12.0: version "0.12.0" @@ -1670,7 +1234,7 @@ chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.2: +chalk@^2.0.0, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -1679,55 +1243,43 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" - integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== +chalk@^4.0.0, chalk@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.0.0.tgz#6e98081ed2d17faab615eb52ac66ec1fe6209e72" - integrity sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A== +chokidar@3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.3.0.tgz#12c0714668c55800f659e262d4962a97faf554a6" + integrity sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A== dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -chardet@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" - integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== - -chokidar@^2.1.5: - version "2.1.8" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" - integrity sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg== - dependencies: - anymatch "^2.0.0" - async-each "^1.0.1" - braces "^2.3.2" - glob-parent "^3.1.0" - inherits "^2.0.3" - is-binary-path "^1.0.0" - is-glob "^4.0.0" - normalize-path "^3.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.2.1" - upath "^1.1.1" + anymatch "~3.1.1" + braces "~3.0.2" + glob-parent "~5.1.0" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.2.0" optionalDependencies: - fsevents "^1.2.7" + fsevents "~2.1.1" -chownr@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.2.tgz#a18f1e0b269c8a6a5d3c86eb298beb14c3dd7bf6" - integrity sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A== - -ci-info@^1.5.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.6.0.tgz#2ca20dbb9ceb32d4524a683303313f0304b1e497" - integrity sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A== +chokidar@3.5.2, chokidar@^3.5.2: + version "3.5.2" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" + integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" ci-info@^2.0.0: version "2.0.0" @@ -1742,25 +1294,15 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: inherits "^2.0.1" safe-buffer "^5.0.1" -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - clean-stack@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== -cli-boxes@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" - integrity sha1-T6kXw+WclKAEzWH47lCdplFocUM= +cli-boxes@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" + integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== cli-cursor@^3.1.0: version "3.1.0" @@ -1777,20 +1319,6 @@ cli-truncate@^2.1.0: slice-ansi "^3.0.0" string-width "^4.2.0" -cli-width@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" - integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= - -cliui@^3.0.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - cliui@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" @@ -1800,30 +1328,23 @@ cliui@^5.0.0: strip-ansi "^5.2.0" wrap-ansi "^5.1.0" -clone@^1.0.2: - version "1.0.4" - resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" - integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" -color-convert@^1.9.0, color-convert@^1.9.1: +clone-response@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" + integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= + dependencies: + mimic-response "^1.0.0" + +color-convert@^1.9.0, color-convert@^1.9.3: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== @@ -1847,21 +1368,26 @@ color-name@^1.0.0, color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -color-string@^1.5.2: - version "1.5.3" - resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.5.3.tgz#c9bbc5f01b58b5492f3d6857459cb6590ce204cc" - integrity sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw== +color-string@^1.6.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.9.0.tgz#63b6ebd1bec11999d1df3a79a7569451ac2be8aa" + integrity sha512-9Mrz2AQLefkH1UvASKj6v6hj/7eWgjnT/cVsR8CumieLoT+g900exWeNogqtweI8dxloXN9BDQTYro1oWu/5CQ== dependencies: color-name "^1.0.0" simple-swizzle "^0.2.2" -color@3.0.x: - version "3.0.0" - resolved "https://registry.yarnpkg.com/color/-/color-3.0.0.tgz#d920b4328d534a3ac8295d68f7bd4ba6c427be9a" - integrity sha512-jCpd5+s0s0t7p3pHQKpnJ0TpQKKdleP71LWcA0aqiljpiuAkOSUFN/dyH8ZwF0hRmFlrIuRhufds1QyEP9EB+w== +color@^3.1.3: + version "3.2.1" + resolved "https://registry.yarnpkg.com/color/-/color-3.2.1.tgz#3544dc198caf4490c3ecc9a790b54fe9ff45e164" + integrity sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA== dependencies: - color-convert "^1.9.1" - color-string "^1.5.2" + color-convert "^1.9.3" + color-string "^1.6.0" + +colorette@^2.0.16: + version "2.0.16" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.16.tgz#713b9af84fdb000139f04546bd4a93f62a5085da" + integrity sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g== colors@^1.2.1, colors@^1.4.0: version "1.4.0" @@ -1869,18 +1395,13 @@ colors@^1.2.1, colors@^1.4.0: integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== colorspace@1.1.x: - version "1.1.2" - resolved "https://registry.yarnpkg.com/colorspace/-/colorspace-1.1.2.tgz#e0128950d082b86a2168580796a0aa5d6c68d8c5" - integrity sha512-vt+OoIP2d76xLhjwbBaucYlNSpPsrJWPlBTtwCpQKIu6/CSMutyzX93O/Do0qzpH3YoHEes8YEFXyZ797rEhzQ== + version "1.1.4" + resolved "https://registry.yarnpkg.com/colorspace/-/colorspace-1.1.4.tgz#8d442d1186152f60453bf8070cd66eb364e59243" + integrity sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w== dependencies: - color "3.0.x" + color "^3.1.3" text-hex "1.0.x" -colour@~0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" - integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= - combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" @@ -1889,41 +1410,41 @@ combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: delayed-stream "~1.0.0" command-exists@^1.2.6: - version "1.2.8" - resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.8.tgz#715acefdd1223b9c9b37110a149c6392c2852291" - integrity sha512-PM54PkseWbiiD/mMsbvW351/u+dafwTJ0ye2qB60G1aGQP9j3xK2gmMDc+R34L3nDtx4qMCitXT75mkbkGJDLw== + version "1.2.9" + resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" + integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w== commander@^2.9.0: - version "2.20.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" - integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -commander@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" - integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg== +commander@^6.2.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" + integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== compare-versions@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.6.0.tgz#1a5689913685e5a87637b8d3ffca75514ec41d62" integrity sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA== -component-emitter@^1.2.1, component-emitter@~1.3.0: +component-emitter@~1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== compressible@~2.0.16: version "2.0.18" - resolved "https://registry.npm.taobao.org/compressible/download/compressible-2.0.18.tgz#af53cca6b070d4c3c0750fbd77286a6d7cc46fba" - integrity sha1-r1PMprBw1MPAdQ+9dyhqbXzEb7o= + resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.18.tgz#af53cca6b070d4c3c0750fbd77286a6d7cc46fba" + integrity sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg== dependencies: mime-db ">= 1.43.0 < 2" compression@^1.7.4: version "1.7.4" - resolved "https://registry.npm.taobao.org/compression/download/compression-1.7.4.tgz#95523eff170ca57c29a0ca41e6fe131f41e5bb8f" - integrity sha1-lVI+/xcMpXwpoMpB5v4TH0Hlu48= + resolved "https://registry.yarnpkg.com/compression/-/compression-1.7.4.tgz#95523eff170ca57c29a0ca41e6fe131f41e5bb8f" + integrity sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ== dependencies: accepts "~1.3.5" bytes "3.0.0" @@ -1938,22 +1459,17 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= -configstore@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.1.2.tgz#c6f25defaeef26df12dd33414b001fe81a543f8f" - integrity sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw== +configstore@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/configstore/-/configstore-5.0.1.tgz#d365021b5df4b98cdd187d6a3b0e3f6a7cc5ed96" + integrity sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA== dependencies: - dot-prop "^4.1.0" + dot-prop "^5.2.0" graceful-fs "^4.1.2" - make-dir "^1.0.0" - unique-string "^1.0.0" - write-file-atomic "^2.0.0" - xdg-basedir "^3.0.0" - -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= + make-dir "^3.0.0" + unique-string "^2.0.0" + write-file-atomic "^3.0.0" + xdg-basedir "^4.0.0" content-disposition@0.5.3: version "0.5.3" @@ -1967,13 +1483,6 @@ content-type@~1.0.4: resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== -convert-source-map@^1.1.0, convert-source-map@^1.4.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" - integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== - dependencies: - safe-buffer "~5.1.1" - cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" @@ -1984,27 +1493,22 @@ cookie@0.4.0: resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== -cookie@~0.4.1: +cookie@0.4.1, cookie@~0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= - core-js@^2.4.0: - version "2.6.9" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2" - integrity sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A== + version "2.6.12" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" + integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== -core-util-is@1.0.2, core-util-is@~1.0.0: +core-util-is@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= -cors@^2.8.4, cors@~2.8.5: +cors@^2.8.5, cors@~2.8.5: version "2.8.5" resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29" integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g== @@ -2012,23 +1516,16 @@ cors@^2.8.4, cors@~2.8.5: object-assign "^4" vary "^1" -cosmiconfig@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-6.0.0.tgz#da4fee853c52f6b1e6935f41c1a2fc50bd4a9982" - integrity sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg== +cosmiconfig@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.1.tgz#714d756522cace867867ccb4474c5d01bbae5d6d" + integrity sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ== dependencies: "@types/parse-json" "^4.0.0" - import-fresh "^3.1.0" + import-fresh "^3.2.1" parse-json "^5.0.0" path-type "^4.0.0" - yaml "^1.7.2" - -create-error-class@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" - integrity sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y= - dependencies: - capture-stack-trace "^1.0.0" + yaml "^1.10.0" create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: version "1.2.0" @@ -2058,56 +1555,24 @@ create-require@^1.1.0: resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== -cross-spawn@^5.0.1: - version "5.1.0" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" - integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= - dependencies: - lru-cache "^4.0.1" - shebang-command "^1.2.0" - which "^1.2.9" - -cross-spawn@^6.0.0, cross-spawn@^6.0.5: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - -cross-spawn@^7.0.0: - version "7.0.2" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.2.tgz#d0d7dcfa74e89115c7619f4f721a94e1fdb716d6" - integrity sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw== +cross-spawn@^7.0.0, cross-spawn@^7.0.2: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" which "^2.0.1" -crypto-random-string@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" - integrity sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4= - -cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": - version "0.3.8" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" - integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== - -cssstyle@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.4.0.tgz#9d31328229d3c565c61e586b02041a28fccdccf1" - integrity sha512-GBrLZYZ4X4x6/QEoBnIrqb8B/f5l4+8me2dkom/j1Gtbxy0kBv6OGzKuAsGM75bkGwGAFkt56Iwg28S3XTZgSA== - dependencies: - cssom "0.3.x" +crypto-random-string@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" + integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== csstype@^3.0.2: - version "3.0.6" - resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.6.tgz#865d0b5833d7d8d40f4e5b8a6d76aea3de4725ef" - integrity sha512-+ZAmfyWMT7TiIlzdqJgjMb7S4f1beorDbWbsocyK4RaiqA5RTX3K14bnBWmmA9QEM0gRdsjyyrEmcyga8Zsxmw== + version "3.0.10" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.10.tgz#2ad3a7bed70f35b965707c092e5f30b327c290e5" + integrity sha512-2u44ZG2OcNUO9HDp/Jl8C07x6pU/eTR3ncV91SiK3dhG9TWvRVsCoJw14Ckx5DgWkzGA3waZWO3d7pgqpUI/XA== dashdash@^1.12.0: version "1.14.1" @@ -2116,28 +1581,31 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -data-urls@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" - integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ== - dependencies: - abab "^2.0.0" - whatwg-mimetype "^2.2.0" - whatwg-url "^7.0.0" +data-uri-to-buffer@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz#b5db46aea50f6176428ac05b73be39a57701a64b" + integrity sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA== -debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8: +debug@2.6.9, debug@^2.6.8: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" -debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@~4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" - integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== +debug@3.1.0, debug@=3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== dependencies: - ms "2.1.2" + ms "2.0.0" + +debug@3.2.6, debug@^3.1.0: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" debug@4.1.1: version "4.1.1" @@ -2146,29 +1614,43 @@ debug@4.1.1: dependencies: ms "^2.1.1" -debug@=3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== +debug@4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" + integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== dependencies: - ms "2.0.0" + ms "2.1.2" -debug@^3.1.0, debug@^3.2.6: - version "3.2.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== +debug@^3.2.7: + version "3.2.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== dependencies: ms "^2.1.1" -decamelize@^1.1.1, decamelize@^1.2.0: +debug@^4.1.0, debug@^4.1.1, debug@^4.2.0, debug@^4.3.2, debug@~4.3.1: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= +decamelize@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" + integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== + +decompress-response@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" + integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M= + dependencies: + mimic-response "^1.0.0" dedent@^0.7.0: version "0.7.0" @@ -2180,17 +1662,15 @@ deep-extend@^0.6.0: resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== -deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= +deep-is@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== -defaults@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" - integrity sha1-xlYFHpgX2f8I7YgUd/P+QBnz730= - dependencies: - clone "^1.0.2" +defer-to-connect@^1.0.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" + integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== define-properties@^1.1.2, define-properties@^1.1.3: version "1.1.3" @@ -2199,38 +1679,11 @@ define-properties@^1.1.2, define-properties@^1.1.3: dependencies: object-keys "^1.0.12" -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= - depd@~1.1.0, depd@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" @@ -2246,26 +1699,33 @@ destroy@~1.0.4: resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= -detect-libc@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= +diff-sequences@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.4.0.tgz#d783920ad8d06ec718a060d00196dfef25b132a5" + integrity sha512-YqiQzkrsmHMH5uuh8OdQFU9/ZpADnwzml8z0O5HvRNda+5UZsaX/xN+AAxfR2hWq1Y7HZnAzO9J5lJXOuDz2Ww== -detect-newline@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" - integrity sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I= +diff@3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== -diff-sequences@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.9.0.tgz#5715d6244e2aa65f48bba0bc972db0b0b11e95b5" - integrity sha512-Dj6Wk3tWyTE+Fo1rW8v0Xhwk80um6yFYKbuAxc9c3EZxIHFDYwbi34Uk42u1CdnIiVorvt4RmlSDjIPyzGC2ew== +diff@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" + integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== diff@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + doctrine@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" @@ -2273,24 +1733,17 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -domexception@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" - integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug== +dot-prop@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" + integrity sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q== dependencies: - webidl-conversions "^4.0.2" - -dot-prop@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.1.tgz#45884194a71fc2cda71cbb4bceb3a4dd2f433ba4" - integrity sha512-l0p4+mIuJIua0mhxGoh4a+iNL9bmeK5DvnSVQa6T0OhrVmaEa1XScX5Etc673FePCJOArq/4Pa2cLGODUWTPOQ== - dependencies: - is-obj "^1.0.0" + is-obj "^2.0.0" dotenv@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.1.0.tgz#d811e178652bfb8a1e593c6dd704ec7e90d85ea2" - integrity sha512-GUE3gqcDCaMltj2++g6bRQ5rBJWtkWTmqmD0fo1RnnMuUqHNCt2oTPeDnS9n6fKYvlhn7AeBkb38lymBtWBQdA== + version "8.6.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b" + integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g== drbg.js@^1.0.1: version "1.0.1" @@ -2326,7 +1779,7 @@ eccrypto@^1.1.6: optionalDependencies: secp256k1 "3.7.1" -ecdsa-sig-formatter@1.0.11, ecdsa-sig-formatter@^1.0.11: +ecdsa-sig-formatter@1.0.11: version "1.0.11" resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf" integrity sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ== @@ -2338,12 +1791,7 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= -elegant-spinner@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-2.0.0.tgz#f236378985ecd16da75488d166be4b688fd5af94" - integrity sha512-5YRYHhvhYzV/FC4AiMdeSIg3jAYGq9xFvbhZMpPlJoBsfYgrw2DSCYeXfat6tYBu45PWiyRr3+flaCPPmviPaA== - -elliptic@6.5.4, elliptic@^6.4.1: +elliptic@6.5.4, elliptic@^6.4.1, elliptic@^6.5.3: version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== @@ -2356,19 +1804,6 @@ elliptic@6.5.4, elliptic@^6.4.1: minimalistic-assert "^1.0.1" minimalistic-crypto-utils "^1.0.1" -elliptic@=6.4.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df" - integrity sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8= - dependencies: - bn.js "^4.4.0" - brorand "^1.0.1" - hash.js "^1.0.0" - hmac-drbg "^1.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.0" - emailjs-base64@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/emailjs-base64/-/emailjs-base64-1.1.4.tgz#392fa38cb6aa35dccd3af3637ffc14c1c7ce9612" @@ -2419,9 +1854,9 @@ end-of-stream@^1.1.0: once "^1.4.0" engine.io-parser@~4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-4.0.2.tgz#e41d0b3fb66f7bf4a3671d2038a154024edb501e" - integrity sha512-sHfEQv6nmtJrq6TKuIz5kyEKH/qSdK56H/A+7DnAuUPWosnIZAS2NHNcPLmyjtY3cGS/MqJdZbUjW97JU72iYg== + version "4.0.3" + resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-4.0.3.tgz#83d3a17acfd4226f19e721bb22a1ee8f7662d2f6" + integrity sha512-xEAAY0msNnESNPc00e19y5heTPX4y/TJ36gr8t1voOaNmTojP9b3oK3BbJLFufW2XFPQaaijpFewm2g2Um3uqA== dependencies: base64-arraybuffer "0.1.4" @@ -2438,12 +1873,12 @@ engine.io@~5.0.0: engine.io-parser "~4.0.0" ws "~7.4.2" -enquirer@^2.3.4: - version "2.3.5" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.5.tgz#3ab2b838df0a9d8ab9e7dff235b0e8712ef92381" - integrity sha512-BNT1C08P9XD0vNg3J475yIUG+mVdp9T6towYFHUv897X0KoHBjB1shyrNmhmtHWKP17iSWgo7Gqh7BBuzLZMSA== +enquirer@^2.3.6: + version "2.3.6" + resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" + integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== dependencies: - ansi-colors "^3.2.1" + ansi-colors "^4.1.1" error-ex@^1.3.1: version "1.3.2" @@ -2452,26 +1887,36 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.5.1: - version "1.14.2" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.14.2.tgz#7ce108fad83068c8783c3cdf62e504e084d8c497" - integrity sha512-DgoQmbpFNOofkjJtKwr87Ma5EW4Dc8fWhD0R+ndq7Oc456ivUfGOOP6oAZTTKl5/CcNMP+EN+e3/iUzgE0veZg== +es-abstract@^1.19.1: + version "1.19.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3" + integrity sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w== dependencies: - es-to-primitive "^1.2.0" + call-bind "^1.0.2" + es-to-primitive "^1.2.1" function-bind "^1.1.1" + get-intrinsic "^1.1.1" + get-symbol-description "^1.0.0" has "^1.0.3" - has-symbols "^1.0.0" - is-callable "^1.1.4" - is-regex "^1.0.4" - object-inspect "^1.6.0" + has-symbols "^1.0.2" + internal-slot "^1.0.3" + is-callable "^1.2.4" + is-negative-zero "^2.0.1" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.1" + is-string "^1.0.7" + is-weakref "^1.0.1" + object-inspect "^1.11.0" object-keys "^1.1.1" - string.prototype.trimleft "^2.0.0" - string.prototype.trimright "^2.0.0" + object.assign "^4.1.2" + string.prototype.trimend "^1.0.4" + string.prototype.trimstart "^1.0.4" + unbox-primitive "^1.0.1" -es-to-primitive@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" - integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== dependencies: is-callable "^1.1.4" is-date-object "^1.0.1" @@ -2482,32 +1927,40 @@ es6-promise@4.2.8: resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-goat@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/escape-goat/-/escape-goat-2.1.1.tgz#1b2dc77003676c457ec760b2dc68edb648188675" + integrity sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q== + escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= -escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -escodegen@^1.9.1: - version "1.12.0" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.12.0.tgz#f763daf840af172bb3a2b6dd7219c0e17f7ff541" - integrity sha512-TuA+EhsanGcme5T3R0L80u4t8CpbXQjegRmf7+FPTJrtCTErXFeelblRgHQa1FofEzqYYJmJ/OqjTwREp9qgmg== - dependencies: - esprima "^3.1.3" - estraverse "^4.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" +escape-string-regexp@4.0.0, escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +escape-string-regexp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" + integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== eslint-config-prettier@^6.5.0: - version "6.5.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.5.0.tgz#aaf9a495e2a816865e541bfdbb73a65cc162b3eb" - integrity sha512-cjXp8SbO9VFGW/Z7mbTydqS9to8Z58E5aYhj3e1+Hx7lS9s6gL5ILKNpCqZAFOVYRcSkWPFYljHrEh8QFEK5EQ== + version "6.15.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz#7f93f6cb7d45a92f1537a70ecc06366e1ac6fed9" + integrity sha512-a1+kOYLR8wMGustcgAjdydMsQ2A/2ipRPwRKUmfYaSxc9ZPcrku080Ctl6zrZzZNs/U82MjSv+qKREkoq3bJaw== dependencies: get-stdin "^6.0.0" @@ -2518,17 +1971,18 @@ eslint-plugin-babel@^5.3.1: dependencies: eslint-rule-composer "^0.3.0" -eslint-plugin-jest@^22.20.1: - version "22.20.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-22.20.1.tgz#183688ec8bd65dec043552fcd2fa63b7e54f326f" - integrity sha512-bNkII1QUmb7P9KHXqRoDWwFrY1hkxI2bAXCvuZbKuzywcxjPNrCzRqsOEUe9T4fHVfhat2zRN7dS5n61C8rhoA== +eslint-plugin-mocha@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-mocha/-/eslint-plugin-mocha-9.0.0.tgz#b4457d066941eecb070dc06ed301c527d9c61b60" + integrity sha512-d7knAcQj1jPCzZf3caeBIn3BnW6ikcvfz0kSqQpwPYcVGLoJV5sz0l0OJB2LR8I7dvTDbqq1oV6ylhSgzA10zg== dependencies: - "@typescript-eslint/experimental-utils" "^1.13.0" + eslint-utils "^3.0.0" + ramda "^0.27.1" -eslint-plugin-prettier@^3.1.4: - version "3.1.4" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.4.tgz#168ab43154e2ea57db992a2cd097c828171f75c2" - integrity sha512-jZDa8z76klRqo+TdGDTFJSavwbnWK2ZpqGKNZ+VvweMW516pDUMmQ2koXvxEE4JhzNvTv+radye/bWGBmA6jmg== +eslint-plugin-prettier@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.0.tgz#cdbad3bf1dbd2b177e9825737fe63b476a08f0c7" + integrity sha512-UDK6rJT6INSfcOo545jiaOwB701uAIt2/dR7WnFQoGCVl1/EMqdANBmwUaqqQ45aXprsTGzSa39LI1PyuRBxxw== dependencies: prettier-linter-helpers "^1.0.0" @@ -2537,114 +1991,112 @@ eslint-rule-composer@^0.3.0: resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9" integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg== -eslint-scope@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" - integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== +eslint-scope@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.1.tgz#fff34894c2f65e5226d3041ac480b4513a163642" + integrity sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw== dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" + esrecurse "^4.3.0" + estraverse "^5.2.0" -eslint-scope@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.0.0.tgz#e87c8887c73e8d1ec84f1ca591645c358bfc8fb9" - integrity sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw== +eslint-utils@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" + integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" + eslint-visitor-keys "^2.0.0" -eslint-utils@^1.4.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" - integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== +eslint-visitor-keys@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" + integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== + +eslint-visitor-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" + integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== + +eslint-visitor-keys@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" + integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== + +eslint@^8.25.0: + version "8.25.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.25.0.tgz#00eb962f50962165d0c4ee3327708315eaa8058b" + integrity sha512-DVlJOZ4Pn50zcKW5bYH7GQK/9MsoQG2d5eDH0ebEkE8PbgzTTmtt/VTH9GGJ4BfeZCpBLqFfvsjX35UacUL83A== dependencies: - eslint-visitor-keys "^1.1.0" - -eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" - integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== - -eslint@^6.6.0: - version "6.6.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.6.0.tgz#4a01a2fb48d32aacef5530ee9c5a78f11a8afd04" - integrity sha512-PpEBq7b6qY/qrOmpYQ/jTMDYfuQMELR4g4WI1M/NaSDDD/bdcMb+dj4Hgks7p41kW2caXsPsEZAEAyAgjVVC0g== - dependencies: - "@babel/code-frame" "^7.0.0" + "@eslint/eslintrc" "^1.3.3" + "@humanwhocodes/config-array" "^0.10.5" + "@humanwhocodes/module-importer" "^1.0.1" ajv "^6.10.0" - chalk "^2.1.0" - cross-spawn "^6.0.5" - debug "^4.0.1" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.3.2" doctrine "^3.0.0" - eslint-scope "^5.0.0" - eslint-utils "^1.4.3" - eslint-visitor-keys "^1.1.0" - espree "^6.1.2" - esquery "^1.0.1" + escape-string-regexp "^4.0.0" + eslint-scope "^7.1.1" + eslint-utils "^3.0.0" + eslint-visitor-keys "^3.3.0" + espree "^9.4.0" + esquery "^1.4.0" esutils "^2.0.2" - file-entry-cache "^5.0.1" - functional-red-black-tree "^1.0.1" - glob-parent "^5.0.0" - globals "^11.7.0" - ignore "^4.0.6" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + find-up "^5.0.0" + glob-parent "^6.0.1" + globals "^13.15.0" + globby "^11.1.0" + grapheme-splitter "^1.0.4" + ignore "^5.2.0" import-fresh "^3.0.0" imurmurhash "^0.1.4" - inquirer "^7.0.0" is-glob "^4.0.0" - js-yaml "^3.13.1" + js-sdsl "^4.1.4" + js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.14" - minimatch "^3.0.4" - mkdirp "^0.5.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.1.2" natural-compare "^1.4.0" - optionator "^0.8.2" - progress "^2.0.0" - regexpp "^2.0.1" - semver "^6.1.2" - strip-ansi "^5.2.0" - strip-json-comments "^3.0.1" - table "^5.2.3" + optionator "^0.9.1" + regexpp "^3.2.0" + strip-ansi "^6.0.1" + strip-json-comments "^3.1.0" text-table "^0.2.0" - v8-compile-cache "^2.0.3" -espree@^6.1.2: - version "6.1.2" - resolved "https://registry.yarnpkg.com/espree/-/espree-6.1.2.tgz#6c272650932b4f91c3714e5e7b5f5e2ecf47262d" - integrity sha512-2iUPuuPP+yW1PZaMSDM9eyVf8D5P0Hi8h83YtZ5bPc/zHYjII5khoixIUTMO794NOY8F/ThF1Bo8ncZILarUTA== +espree@^9.4.0: + version "9.4.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.0.tgz#cd4bc3d6e9336c433265fc0aa016fc1aaf182f8a" + integrity sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw== dependencies: - acorn "^7.1.0" - acorn-jsx "^5.1.0" - eslint-visitor-keys "^1.1.0" - -esprima@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" - integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= + acorn "^8.8.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^3.3.0" esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esquery@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" - integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== +esquery@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" + integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== dependencies: - estraverse "^4.0.0" + estraverse "^5.1.0" -esrecurse@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" - integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== - dependencies: - estraverse "^4.1.0" - -estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: +esrecurse@^4.3.0: version "4.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^5.1.0, estraverse@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== esutils@^2.0.2: version "2.0.3" @@ -2656,11 +2108,6 @@ etag@~1.8.1: resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= -event-target-shim@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" - integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== - evp_bytestokey@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" @@ -2669,41 +2116,10 @@ evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" -exec-sh@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.2.tgz#6738de2eb7c8e671d0366aea0b0db8c6f7d7391b" - integrity sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg== - -execa@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" - integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= - dependencies: - cross-spawn "^5.0.1" - get-stream "^3.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - -execa@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" - integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== - dependencies: - cross-spawn "^6.0.0" - get-stream "^4.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - -execa@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/execa/-/execa-4.0.1.tgz#988488781f1f0238cd156f7aaede11c3e853b4c1" - integrity sha512-SCjM/zlBdOK8Q5TIjOn6iEHZaPHFsMoTxXQ2nvUvtPnuohz3H2dIozSg+etNR98dGoYUp2ENSKLL/XaMmbxVgw== +execa@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" + integrity sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA== dependencies: cross-spawn "^7.0.0" get-stream "^5.0.0" @@ -2715,48 +2131,30 @@ execa@^4.0.0: signal-exit "^3.0.2" strip-final-newline "^2.0.0" -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= - -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= +expect@^27.2.1: + version "27.4.2" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.4.2.tgz#4429b0f7e307771d176de9bdf23229b101db6ef6" + integrity sha512-BjAXIDC6ZOW+WBFNg96J22D27Nq5ohn+oGcuP2rtOtcjuxNoV9McpQ60PcQWhdFOSBIQdR72e+4HdnbZTFSTyg== dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expect@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-24.9.0.tgz#b75165b4817074fa4a157794f46fe9f1ba15b6ca" - integrity sha512-wvVAx8XIol3Z5m9zvZXiyZOQ+sRJqNTIm6sGjdWlaZIeupQGO3WbYI+15D/AmEwZywL6wtJkbAbJtzkOfBuR0Q== - dependencies: - "@jest/types" "^24.9.0" - ansi-styles "^3.2.0" - jest-get-type "^24.9.0" - jest-matcher-utils "^24.9.0" - jest-message-util "^24.9.0" - jest-regex-util "^24.9.0" + "@jest/types" "^27.4.2" + ansi-styles "^5.0.0" + jest-get-type "^27.4.0" + jest-matcher-utils "^27.4.2" + jest-message-util "^27.4.2" + jest-regex-util "^27.4.0" express-session@^1.17.1: - version "1.17.1" - resolved "https://registry.yarnpkg.com/express-session/-/express-session-1.17.1.tgz#36ecbc7034566d38c8509885c044d461c11bf357" - integrity sha512-UbHwgqjxQZJiWRTMyhvWGvjBQduGCSBDhhZXYenziMFjxst5rMV+aJZ6hKPHZnPyHGsrqRICxtX8jtEbm/z36Q== + version "1.17.2" + resolved "https://registry.yarnpkg.com/express-session/-/express-session-1.17.2.tgz#397020374f9bf7997f891b85ea338767b30d0efd" + integrity sha512-mPcYcLA0lvh7D4Oqr5aNJFMtBMKPLl++OKKxkHzZ0U0oDq1rpKBnkR5f5vCHR26VeArlTOEF9td4x5IjICksRQ== dependencies: - cookie "0.4.0" + cookie "0.4.1" cookie-signature "1.0.6" debug "2.6.9" depd "~2.0.0" on-headers "~1.0.2" parseurl "~1.3.3" - safe-buffer "5.2.0" + safe-buffer "5.2.1" uid-safe "~2.1.5" express@^4.14.1: @@ -2795,65 +2193,22 @@ express@^4.14.1: utils-merge "1.0.1" vary "~1.1.2" -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extend@^3.0.2, extend@~3.0.2: +extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== -external-editor@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" - integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + version "1.4.1" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" + integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== -fast-deep-equal@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" - integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= - -fast-deep-equal@^3.1.1: +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== @@ -2863,58 +2218,53 @@ fast-diff@^1.1.2: resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== -fast-json-stable-stringify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" - integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= +fast-glob@^3.2.9: + version "3.2.12" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" + integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" -fast-levenshtein@~2.0.4: +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fast-levenshtein@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== -fast-safe-stringify@^2.0.4: - version "2.0.7" - resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz#124aa885899261f68aedb42a7c080de9da608743" - integrity sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA== - -fast-text-encoding@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz#ec02ac8e01ab8a319af182dae2681213cfe9ce53" - integrity sha512-dtm4QZH9nZtcDt8qJiOH9fcQd1NAgi+K1O2DbE6GG1PPCK/BWfOH3idCTRQ4ImXRUOyopDEgDEnVEE7Y/2Wrig== - -fb-watchman@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" - integrity sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg= +fastq@^1.6.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" + integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== dependencies: - bser "^2.0.0" + reusify "^1.0.4" fecha@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/fecha/-/fecha-4.2.0.tgz#3ffb6395453e3f3efff850404f0a59b6747f5f41" - integrity sha512-aN3pcx/DSmtyoovUudctc8+6Hl4T+hI9GBBHLjA76jdZl7+b1sgh5g4k+u/GL3dTy1/pnYzKp69FpJ0OicE3Wg== + version "4.2.1" + resolved "https://registry.yarnpkg.com/fecha/-/fecha-4.2.1.tgz#0a83ad8f86ef62a091e22bb5a039cd03d23eecce" + integrity sha512-MMMQ0ludy/nBs1/o0zVOiKTpG7qMbonKUzjJgQFEuvq6INZ1OraKPRAWkBq5vlKLOUMpmNYG1JoN3oDPUQ9m3Q== -figures@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-3.1.0.tgz#4b198dd07d8d71530642864af2d45dd9e459c4ec" - integrity sha512-ravh8VRXqHuMvZt/d8GblBeqDMkdJMBdv/2KntFH+ra5MXkO7nxNKpzQ3n6QD/2da1kH0aWmNISdvhM7gl2gVg== - dependencies: - escape-string-regexp "^1.0.5" - -figures@^3.2.0: +fetch-blob@^3.1.2, fetch-blob@^3.1.4: version "3.2.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" - integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== + resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.2.0.tgz#f09b8d4bbd45adc6f0c20b7e787e793e309dcce9" + integrity sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ== dependencies: - escape-string-regexp "^1.0.5" + node-domexception "^1.0.0" + web-streams-polyfill "^3.0.3" -file-entry-cache@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" - integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== +file-entry-cache@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" + integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== dependencies: - flat-cache "^2.0.1" + flat-cache "^3.0.4" file-stream-rotator@^0.5.7: version "0.5.7" @@ -2928,16 +2278,6 @@ file-uri-to-path@1.0.0: resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - fill-range@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" @@ -2958,41 +2298,52 @@ finalhandler@~1.1.2: statuses "~1.5.0" unpipe "~1.0.0" -find-up@^3.0.0: +find-up@3.0.0, find-up@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== dependencies: locate-path "^3.0.0" -find-up@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== +find-up@5.0.0, find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== dependencies: - locate-path "^5.0.0" + locate-path "^6.0.0" path-exists "^4.0.0" -find-versions@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/find-versions/-/find-versions-3.2.0.tgz#10297f98030a786829681690545ef659ed1d254e" - integrity sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww== +find-versions@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/find-versions/-/find-versions-4.0.0.tgz#3c57e573bf97769b8cb8df16934b627915da4965" + integrity sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ== dependencies: - semver-regex "^2.0.0" + semver-regex "^3.1.2" -flat-cache@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" - integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== +flat-cache@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" + integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== dependencies: - flatted "^2.0.0" - rimraf "2.6.3" - write "1.0.3" + flatted "^3.1.0" + rimraf "^3.0.2" -flatted@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08" - integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg== +flat@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.1.tgz#a392059cc382881ff98642f5da4dde0a959f309b" + integrity sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA== + dependencies: + is-buffer "~2.0.3" + +flat@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== + +flatted@^3.1.0: + version "3.2.7" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" + integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== fn.name@1.x.x: version "1.1.0" @@ -3006,15 +2357,10 @@ follow-redirects@1.5.10: dependencies: debug "=3.1.0" -follow-redirects@^1.10.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db" - integrity sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA== - -for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= +follow-redirects@^1.15.0: + version "1.15.2" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== forever-agent@~0.6.1: version "0.6.1" @@ -3030,6 +2376,15 @@ form-data@^3.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + form-data@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" @@ -3039,91 +2394,57 @@ form-data@~2.3.2: combined-stream "^1.0.6" mime-types "^2.1.12" -forwarded@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" - integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= +formdata-polyfill@^4.0.10: + version "4.0.10" + resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423" + integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g== dependencies: - map-cache "^0.2.2" + fetch-blob "^3.1.2" + +forwarded@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" + integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== fresh@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= -fs-minipass@^1.2.5: - version "1.2.6" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.6.tgz#2c5cc30ded81282bfe8a0d7c7c1853ddeb102c07" - integrity sha512-crhvyXcMejjv3Z5d2Fa9sf5xLYVCF5O1c71QxbVnbLsmYMBEvDAftewesN/HhY03YRoA7zOMxjNGrF5svGaaeQ== - dependencies: - minipass "^2.2.1" - fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -fsevents@^1.2.7: - version "1.2.9" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.9.tgz#3f5ed66583ccd6f400b5a00db6f7e861363e388f" - integrity sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw== - dependencies: - nan "^2.12.1" - node-pre-gyp "^0.12.0" +fsevents@~2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" + integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== + +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= - -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - -gaxios@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/gaxios/-/gaxios-4.0.1.tgz#bc7b205a89d883452822cc75e138620c35e3291e" - integrity sha512-jOin8xRZ/UytQeBpSXFqIzqU7Fi5TqgPNLlUsSB8kjJ76+FiGBfImF8KJu++c6J4jOldfJUtt0YmkRj2ZpSHTQ== - dependencies: - abort-controller "^3.0.0" - extend "^3.0.2" - https-proxy-agent "^5.0.0" - is-stream "^2.0.0" - node-fetch "^2.3.0" - -gcp-metadata@^4.2.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/gcp-metadata/-/gcp-metadata-4.2.1.tgz#31849fbcf9025ef34c2297c32a89a1e7e9f2cd62" - integrity sha512-tSk+REe5iq/N+K+SK1XjZJUrFPuDqGZVzCy2vocIHIGmPlTGsa8owXMJwGkrXr73NO0AzhPW4MF2DEHz7P2AVw== - dependencies: - gaxios "^4.0.0" - json-bigint "^1.0.0" - -get-caller-file@^2.0.1: +get-caller-file@^2.0.1, get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" + integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + get-own-enumerable-property-symbols@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz#b5fde77f22cbe35f390b4e089922c50bce6ef664" @@ -3134,29 +2455,27 @@ get-stdin@^6.0.0: resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== -get-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" - integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= - -get-stream@^4.0.0: +get-stream@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== dependencies: pump "^3.0.0" -get-stream@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.1.0.tgz#01203cdc92597f9b909067c3e656cc1f4d3c4dc9" - integrity sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw== +get-stream@^5.0.0, get-stream@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" + integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== dependencies: pump "^3.0.0" -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= +get-symbol-description@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" + integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" getpass@^0.1.1: version "0.1.7" @@ -3165,25 +2484,24 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" -glob-parent@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" - integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= - dependencies: - is-glob "^3.1.0" - path-dirname "^1.0.0" - -glob-parent@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.0.tgz#5f4c1d1e748d30cd73ad2944b3577a81b081e8c2" - integrity sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw== +glob-parent@^5.1.2, glob-parent@~5.1.0, glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" -glob@^7.0.0, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: - version "7.1.4" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" - integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== +glob-parent@^6.0.1: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + +glob@7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -3192,74 +2510,100 @@ glob@^7.0.0, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -global-dirs@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" - integrity sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU= +glob@7.1.7: + version "7.1.7" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" + integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== dependencies: - ini "^1.3.4" + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" -globals@^11.1.0, globals@^11.7.0: +glob@^7.0.0, glob@^7.1.3: + version "7.2.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" + integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +global-dirs@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-3.0.0.tgz#70a76fe84ea315ab37b1f5576cbde7d48ef72686" + integrity sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA== + dependencies: + ini "2.0.0" + +globals@^11.1.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== +globals@^13.15.0: + version "13.17.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.17.0.tgz#902eb1e680a41da93945adbdcb5a9f361ba69bd4" + integrity sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw== + dependencies: + type-fest "^0.20.2" + globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== -google-auth-library@^6.1.1: - version "6.1.3" - resolved "https://registry.yarnpkg.com/google-auth-library/-/google-auth-library-6.1.3.tgz#39d868140b70d0c4b32c6f6d8f4ccc1400d84dca" - integrity sha512-m9mwvY3GWbr7ZYEbl61isWmk+fvTmOt0YNUfPOUY2VH8K5pZlAIWJjxEi0PqR3OjMretyiQLI6GURMrPSwHQ2g== +globby@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== dependencies: - arrify "^2.0.0" - base64-js "^1.3.0" - ecdsa-sig-formatter "^1.0.11" - fast-text-encoding "^1.0.0" - gaxios "^4.0.0" - gcp-metadata "^4.2.0" - gtoken "^5.0.4" - jws "^4.0.0" - lru-cache "^6.0.0" + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^3.0.0" -google-p12-pem@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/google-p12-pem/-/google-p12-pem-3.0.3.tgz#673ac3a75d3903a87f05878f3c75e06fc151669e" - integrity sha512-wS0ek4ZtFx/ACKYF3JhyGe5kzH7pgiQ7J5otlumqR9psmWMYc+U9cErKlCYVYHoUaidXHdZ2xbo34kB+S+24hA== +google-proto-files@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/google-proto-files/-/google-proto-files-3.0.2.tgz#4f49bf1b8e846b3763ccbc96685ea89fa0545d19" + integrity sha512-NJOCeNrhH4cScdi+XdCGaqNclqOrt+Qsc8xzOjgwYfcksg1HXBnTCxBhiFvqbavv2vIYmHpm3Ri1QL9xW+UgoQ== dependencies: - node-forge "^0.10.0" - -google-proto-files@^1.0.3: - version "1.1.0" - resolved "https://registry.yarnpkg.com/google-proto-files/-/google-proto-files-1.1.0.tgz#3d96148ddd07dd3facd016e5191966776c3f5897" - integrity sha512-qTDf5LYu112GFMrqBzMp1SDN3wvie42Qg2PugH9tWqnO0F1kRAX4BSAzFJbSpeHDI1tqr8ec7x7xQIGoiHHjEw== - dependencies: - protobufjs "^6.8.0" + protobufjs "^7.0.0" walkdir "^0.4.0" -got@^6.7.1: - version "6.7.1" - resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" - integrity sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA= +got@^9.6.0: + version "9.6.0" + resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" + integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q== dependencies: - create-error-class "^3.0.0" + "@sindresorhus/is" "^0.14.0" + "@szmarczak/http-timer" "^1.1.2" + cacheable-request "^6.0.0" + decompress-response "^3.3.0" duplexer3 "^0.1.4" - get-stream "^3.0.0" - is-redirect "^1.0.0" - is-retry-allowed "^1.0.0" - is-stream "^1.0.0" - lowercase-keys "^1.0.0" - safe-buffer "^5.0.1" - timed-out "^4.0.0" - unzip-response "^2.0.1" - url-parse-lax "^1.0.0" + get-stream "^4.1.0" + lowercase-keys "^1.0.1" + mimic-response "^1.0.1" + p-cancelable "^1.0.0" + to-readable-stream "^1.0.0" + url-parse-lax "^3.0.0" -graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6: - version "4.2.2" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.2.tgz#6f0952605d0140c1cfdb138ed005775b92d67b02" - integrity sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q== +graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.4: + version "4.2.8" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" + integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== + +grapheme-splitter@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" + integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== graphviz@0.0.8: version "0.0.8" @@ -3268,55 +2612,19 @@ graphviz@0.0.8: dependencies: temp "~0.4.0" -growly@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" - integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= +growl@1.10.5: + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== -grpc@1.24.4: - version "1.24.4" - resolved "https://registry.yarnpkg.com/grpc/-/grpc-1.24.4.tgz#9240a3ea33cfaf04cd32ce8346798709bbd6782d" - integrity sha512-mHRAwuitCMuSHo1tp1+Zc0sz3cYa7pkhVJ77pkIXD5gcVORtkRiyW6msXYqTDT+35jazg98lbO3XzuTo2+XrcA== - dependencies: - "@types/bytebuffer" "^5.0.40" - lodash.camelcase "^4.3.0" - lodash.clone "^4.5.0" - nan "^2.13.2" - node-pre-gyp "^0.16.0" - protobufjs "^5.0.3" - -gtoken@^5.0.4: - version "5.1.0" - resolved "https://registry.yarnpkg.com/gtoken/-/gtoken-5.1.0.tgz#4ba8d2fc9a8459098f76e7e8fd7beaa39fda9fe4" - integrity sha512-4d8N6Lk8TEAHl9vVoRVMh9BNOKWVgl2DdNtr3428O75r3QFrF/a5MMu851VmK0AA8+iSvbwRv69k5XnMLURGhg== - dependencies: - gaxios "^4.0.0" - google-p12-pem "^3.0.3" - jws "^4.0.0" - mime "^2.2.0" - -"gun@git://github.com/amark/gun#97aa976c97e6219a9f93095d32c220dcd371ca62": - version "0.2020.520" - resolved "git://github.com/amark/gun#97aa976c97e6219a9f93095d32c220dcd371ca62" +gun@amark/gun#77162fcb68eb61f24d980fa3f3653598f56ee593: + version "0.2020.1235" + resolved "https://codeload.github.com/amark/gun/tar.gz/77162fcb68eb61f24d980fa3f3653598f56ee593" dependencies: ws "^7.2.1" optionalDependencies: "@peculiar/webcrypto" "^1.1.1" - buffer "^5.4.3" emailjs "^2.2.0" - text-encoding "^0.7.0" - -handlebars@^4.1.2: - version "4.7.6" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.6.tgz#d4c05c1baf90e9945f77aa68a7a219aa4a7df74e" - integrity sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA== - dependencies: - minimist "^1.2.5" - neo-async "^2.6.0" - source-map "^0.6.1" - wordwrap "^1.0.0" - optionalDependencies: - uglify-js "^3.1.4" har-schema@^2.0.0: version "2.0.0" @@ -3338,6 +2646,11 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" +has-bigints@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" + integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -3348,48 +2661,24 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-symbols@^1.0.0: +has-symbols@^1.0.0, has-symbols@^1.0.1, has-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" + integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== + +has-tostringtag@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" - integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= - -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= - -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" + has-symbols "^1.0.2" -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" +has-yarn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/has-yarn/-/has-yarn-2.1.0.tgz#137e11354a7b5bf11aa5cb649cf0c6f3ff2b2e77" + integrity sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw== -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -has@^1.0.1, has@^1.0.3: +has@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== @@ -3413,7 +2702,12 @@ hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.1" -hmac-drbg@^1.0.0, hmac-drbg@^1.0.1: +he@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + +hmac-drbg@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= @@ -3422,17 +2716,10 @@ hmac-drbg@^1.0.0, hmac-drbg@^1.0.1: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" -hosted-git-info@^2.1.4: - version "2.8.4" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.4.tgz#44119abaf4bc64692a16ace34700fed9c03e2546" - integrity sha512-pzXIvANXEFrc5oFFXRMkbLPQ2rXRoDERwDLyrcUxGhaZhgP54BBSl9Oheh7Vv0T090cszWBxPjkQQ5Sq1PbBRQ== - -html-encoding-sniffer@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" - integrity sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw== - dependencies: - whatwg-encoding "^1.0.1" +http-cache-semantics@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" + integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== http-errors@1.7.2: version "1.7.2" @@ -3445,6 +2732,17 @@ http-errors@1.7.2: statuses ">= 1.5.0 < 2" toidentifier "1.0.0" +http-errors@1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.1.tgz#7c3f28577cbc8a207388455dbd62295ed07bd68c" + integrity sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g== + dependencies: + depd "~1.1.2" + inherits "2.0.4" + setprototypeof "1.2.0" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.1" + http-errors@~1.7.2: version "1.7.3" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" @@ -3465,81 +2763,53 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" -https-proxy-agent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" - integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== - dependencies: - agent-base "6" - debug "4" - human-signals@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== husky@^4.2.5: - version "4.2.5" - resolved "https://registry.yarnpkg.com/husky/-/husky-4.2.5.tgz#2b4f7622673a71579f901d9885ed448394b5fa36" - integrity sha512-SYZ95AjKcX7goYVZtVZF2i6XiZcHknw50iXvY7b0MiGoj5RwdgRQNEHdb+gPDPCXKlzwrybjFjkL6FOj8uRhZQ== + version "4.3.8" + resolved "https://registry.yarnpkg.com/husky/-/husky-4.3.8.tgz#31144060be963fd6850e5cc8f019a1dfe194296d" + integrity sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow== dependencies: chalk "^4.0.0" ci-info "^2.0.0" compare-versions "^3.6.0" - cosmiconfig "^6.0.0" - find-versions "^3.2.0" + cosmiconfig "^7.0.0" + find-versions "^4.0.0" opencollective-postinstall "^2.0.2" - pkg-dir "^4.2.0" + pkg-dir "^5.0.0" please-upgrade-node "^3.2.0" slash "^3.0.0" which-pm-runs "^1.0.0" -iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4: +iconv-lite@0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== dependencies: safer-buffer ">= 2.1.2 < 3" -ieee754@^1.1.4: - version "1.1.13" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" - integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== - ignore-by-default@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" integrity sha1-SMptcvbGo68Aqa1K5odr44ieKwk= -ignore-walk@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.2.tgz#99d83a246c196ea5c93ef9315ad7b0819c35069b" - integrity sha512-EXyErtpHbn75ZTsOADsfx6J/FPo6/5cjev46PXrcTpd8z3BoRkXgYu9/JVqrI7tusjmwCZutGeRJeU0Wo1e4Cw== - dependencies: - minimatch "^3.0.4" - -ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== +ignore@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" + integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== immer@^6.0.6: version "6.0.9" resolved "https://registry.yarnpkg.com/immer/-/immer-6.0.9.tgz#b9dd69b8e69b3a12391e87db1e3ff535d1b26485" integrity sha512-SyCYnAuiRf67Lvk0VkwFvwtDoEiCMjeamnHvRfnVDyc7re1/rQrNxuL+jJ7lA3WvdC4uznrvbmm+clJ9+XXatg== -import-fresh@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.1.0.tgz#6d33fa1dcef6df930fae003446f33415af905118" - integrity sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - -import-fresh@^3.1.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.2.1.tgz#633ff618506e793af5ac91bf48b72677e15cbe66" - integrity sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ== +import-fresh@^3.0.0, import-fresh@^3.2.1: + version "3.3.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" + integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== dependencies: parent-module "^1.0.0" resolve-from "^4.0.0" @@ -3549,14 +2819,6 @@ import-lazy@^2.1.0: resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM= -import-local@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d" - integrity sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ== - dependencies: - pkg-dir "^3.0.0" - resolve-cwd "^2.0.0" - imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -3575,7 +2837,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -3590,65 +2852,41 @@ inherits@=2.0.1: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= -ini@^1.3.4, ini@~1.3.0: +ini@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ini/-/ini-2.0.0.tgz#e5fd556ecdd5726be978fa1001862eacb0a94bc5" + integrity sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA== + +ini@~1.3.0: version "1.3.8" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== -inquirer@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.0.0.tgz#9e2b032dde77da1db5db804758b8fea3a970519a" - integrity sha512-rSdC7zelHdRQFkWnhsMu2+2SO41mpv2oF2zy4tMhmiLWkcKbOAs87fWAJhVXttKVwhdZvymvnuM95EyEXg2/tQ== +internal-slot@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" + integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== dependencies: - ansi-escapes "^4.2.1" - chalk "^2.4.2" - cli-cursor "^3.1.0" - cli-width "^2.0.0" - external-editor "^3.0.3" - figures "^3.0.0" - lodash "^4.17.15" - mute-stream "0.0.8" - run-async "^2.2.0" - rxjs "^6.4.0" - string-width "^4.1.0" - strip-ansi "^5.1.0" - through "^2.3.6" + get-intrinsic "^1.1.0" + has "^1.0.3" + side-channel "^1.0.4" interpret@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" - integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw== + version "1.4.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" + integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== -invariant@^2.2.2, invariant@^2.2.4: +invariant@^2.2.2: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== dependencies: loose-envify "^1.0.0" -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= - -ipaddr.js@1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.0.tgz#37df74e430a0e47550fe54a2defe30d8acd95f65" - integrity sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA== - -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== - dependencies: - kind-of "^6.0.0" +ipaddr.js@1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" + integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== is-arrayish@^0.2.1: version "0.2.1" @@ -3660,34 +2898,37 @@ is-arrayish@^0.3.1: resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03" integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= +is-bigint@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" + integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== dependencies: - binary-extensions "^1.0.0" + has-bigints "^1.0.1" -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - -is-buffer@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725" - integrity sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw== - -is-callable@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" - integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== - -is-ci@^1.0.10: - version "1.2.1" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c" - integrity sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg== +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== dependencies: - ci-info "^1.5.0" + binary-extensions "^2.0.0" + +is-boolean-object@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" + integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-buffer@^2.0.2, is-buffer@~2.0.3: + version "2.0.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" + integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== + +is-callable@^1.1.4, is-callable@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" + integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== is-ci@^2.0.0: version "2.0.0" @@ -3696,67 +2937,25 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= +is-core-module@^2.2.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.0.tgz#0321336c3d0925e497fd97f5d95cb114a5ccd548" + integrity sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw== dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== - dependencies: - kind-of "^6.0.0" + has "^1.0.3" is-date-object@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" - integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= - -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" + integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" + has-tostringtag "^1.0.0" -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^2.1.0, is-extglob@^2.1.1: +is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" @@ -3767,553 +2966,181 @@ is-fullwidth-code-point@^3.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== -is-generator-fn@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" - integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== - -is-glob@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= - dependencies: - is-extglob "^2.1.0" - -is-glob@^4.0.0, is-glob@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" -is-installed-globally@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.1.0.tgz#0dfd98f5a9111716dd535dda6492f67bf3d25a80" - integrity sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA= +is-installed-globally@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.4.0.tgz#9a0fd407949c30f86eb6959ef1b7994ed0b7b520" + integrity sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ== dependencies: - global-dirs "^0.1.0" - is-path-inside "^1.0.0" + global-dirs "^3.0.0" + is-path-inside "^3.0.2" -is-npm@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" - integrity sha1-8vtjpl5JBbQGyGBydloaTceTufQ= +is-negative-zero@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" + integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= +is-npm@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-5.0.0.tgz#43e8d65cc56e1b67f8d47262cf667099193f45a8" + integrity sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA== + +is-number-object@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.6.tgz#6a7aaf838c7f0686a50b4553f7e54a96494e89f0" + integrity sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g== dependencies: - kind-of "^3.0.2" + has-tostringtag "^1.0.0" is-number@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-obj@^1.0.0, is-obj@^1.0.1: +is-obj@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= -is-path-inside@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" - integrity sha1-jvW33lBDej/cprToZe96pVy0gDY= - dependencies: - path-is-inside "^1.0.1" +is-obj@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" + integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== -is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" +is-path-inside@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" + integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== -is-promise@^2.1.0: +is-plain-obj@^2.1.0: version "2.1.0" - resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" - integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== -is-redirect@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" - integrity sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ= - -is-regex@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" - integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= +is-regex@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== dependencies: - has "^1.0.1" + call-bind "^1.0.2" + has-tostringtag "^1.0.0" is-regexp@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk= -is-retry-allowed@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz#d778488bd0a4666a3be8a1482b9f2baafedea8b4" - integrity sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg== - -is-stream@^1.0.0, is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= +is-shared-array-buffer@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz#97b0c85fbdacb59c9c446fe653b82cf2b5b7cfe6" + integrity sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA== is-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" - integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" + integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== -is-symbol@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" - integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw== +is-string@^1.0.5, is-string@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" + integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== dependencies: - has-symbols "^1.0.0" + has-tostringtag "^1.0.0" -is-typedarray@~1.0.0: +is-symbol@^1.0.2, is-symbol@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" + integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== + dependencies: + has-symbols "^1.0.2" + +is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= -is-windows@^1.0.2: +is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + +is-weakref@^1.0.1: version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" + integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== + dependencies: + call-bind "^1.0.2" -is-wsl@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" - integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= - -isarray@1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= +is-yarn-global@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232" + integrity sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw== isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= - isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= -istanbul-lib-coverage@^2.0.2, istanbul-lib-coverage@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49" - integrity sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA== - -istanbul-lib-instrument@^3.0.1, istanbul-lib-instrument@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz#a5f63d91f0bbc0c3e479ef4c5de027335ec6d630" - integrity sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA== +jest-diff@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.4.2.tgz#786b2a5211d854f848e2dcc1e324448e9481f36f" + integrity sha512-ujc9ToyUZDh9KcqvQDkk/gkbf6zSaeEg9AiBxtttXW59H/AcqEYp1ciXAtJp+jXWva5nAf/ePtSsgWwE5mqp4Q== dependencies: - "@babel/generator" "^7.4.0" - "@babel/parser" "^7.4.3" - "@babel/template" "^7.4.0" - "@babel/traverse" "^7.4.3" - "@babel/types" "^7.4.0" - istanbul-lib-coverage "^2.0.5" - semver "^6.0.0" + chalk "^4.0.0" + diff-sequences "^27.4.0" + jest-get-type "^27.4.0" + pretty-format "^27.4.2" -istanbul-lib-report@^2.0.4: - version "2.0.8" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz#5a8113cd746d43c4889eba36ab10e7d50c9b4f33" - integrity sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ== +jest-get-type@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.4.0.tgz#7503d2663fffa431638337b3998d39c5e928e9b5" + integrity sha512-tk9o+ld5TWq41DkK14L4wox4s2D9MtTpKaAVzXfr5CUKm5ZK2ExcaFE0qls2W71zE/6R2TxxrK9w2r6svAFDBQ== + +jest-matcher-utils@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.4.2.tgz#d17c5038607978a255e0a9a5c32c24e984b6c60b" + integrity sha512-jyP28er3RRtMv+fmYC/PKG8wvAmfGcSNproVTW2Y0P/OY7/hWUOmsPfxN1jOhM+0u2xU984u2yEagGivz9OBGQ== dependencies: - istanbul-lib-coverage "^2.0.5" - make-dir "^2.1.0" - supports-color "^6.1.0" + chalk "^4.0.0" + jest-diff "^27.4.2" + jest-get-type "^27.4.0" + pretty-format "^27.4.2" -istanbul-lib-source-maps@^3.0.1: - version "3.0.6" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz#284997c48211752ec486253da97e3879defba8c8" - integrity sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw== +jest-message-util@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.4.2.tgz#07f3f1bf207d69cf798ce830cc57f1a849f99388" + integrity sha512-OMRqRNd9E0DkBLZpFtZkAGYOXl6ZpoMtQJWTAREJKDOFa0M6ptB7L67tp+cszMBkvSgKOhNtQp2Vbcz3ZZKo/w== dependencies: - debug "^4.1.1" - istanbul-lib-coverage "^2.0.5" - make-dir "^2.1.0" - rimraf "^2.6.3" - source-map "^0.6.1" + "@babel/code-frame" "^7.12.13" + "@jest/types" "^27.4.2" + "@types/stack-utils" "^2.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.4" + micromatch "^4.0.4" + pretty-format "^27.4.2" + slash "^3.0.0" + stack-utils "^2.0.3" -istanbul-reports@^2.2.6: - version "2.2.6" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.2.6.tgz#7b4f2660d82b29303a8fe6091f8ca4bf058da1af" - integrity sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA== - dependencies: - handlebars "^4.1.2" +jest-regex-util@^27.4.0: + version "27.4.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.4.0.tgz#e4c45b52653128843d07ad94aec34393ea14fbca" + integrity sha512-WeCpMpNnqJYMQoOjm1nTtsgbR4XHAk1u00qDoNBQoykM280+/TmgA5Qh5giC1ecy6a5d4hbSsHzpBtu5yvlbEg== -jest-changed-files@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.9.0.tgz#08d8c15eb79a7fa3fc98269bc14b451ee82f8039" - integrity sha512-6aTWpe2mHF0DhL28WjdkO8LyGjs3zItPET4bMSeXU6T3ub4FPMw+mcOcbdGXQOAfmLcxofD23/5Bl9Z4AkFwqg== - dependencies: - "@jest/types" "^24.9.0" - execa "^1.0.0" - throat "^4.0.0" - -jest-cli@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.9.0.tgz#ad2de62d07472d419c6abc301fc432b98b10d2af" - integrity sha512-+VLRKyitT3BWoMeSUIHRxV/2g8y9gw91Jh5z2UmXZzkZKpbC08CSehVxgHUwTpy+HwGcns/tqafQDJW7imYvGg== - dependencies: - "@jest/core" "^24.9.0" - "@jest/test-result" "^24.9.0" - "@jest/types" "^24.9.0" - chalk "^2.0.1" - exit "^0.1.2" - import-local "^2.0.0" - is-ci "^2.0.0" - jest-config "^24.9.0" - jest-util "^24.9.0" - jest-validate "^24.9.0" - prompts "^2.0.1" - realpath-native "^1.1.0" - yargs "^13.3.0" - -jest-config@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.9.0.tgz#fb1bbc60c73a46af03590719efa4825e6e4dd1b5" - integrity sha512-RATtQJtVYQrp7fvWg6f5y3pEFj9I+H8sWw4aKxnDZ96mob5i5SD6ZEGWgMLXQ4LE8UurrjbdlLWdUeo+28QpfQ== - dependencies: - "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^24.9.0" - "@jest/types" "^24.9.0" - babel-jest "^24.9.0" - chalk "^2.0.1" - glob "^7.1.1" - jest-environment-jsdom "^24.9.0" - jest-environment-node "^24.9.0" - jest-get-type "^24.9.0" - jest-jasmine2 "^24.9.0" - jest-regex-util "^24.3.0" - jest-resolve "^24.9.0" - jest-util "^24.9.0" - jest-validate "^24.9.0" - micromatch "^3.1.10" - pretty-format "^24.9.0" - realpath-native "^1.1.0" - -jest-diff@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.9.0.tgz#931b7d0d5778a1baf7452cb816e325e3724055da" - integrity sha512-qMfrTs8AdJE2iqrTp0hzh7kTd2PQWrsFyj9tORoKmu32xjPjeE4NyjVRDz8ybYwqS2ik8N4hsIpiVTyFeo2lBQ== - dependencies: - chalk "^2.0.1" - diff-sequences "^24.9.0" - jest-get-type "^24.9.0" - pretty-format "^24.9.0" - -jest-docblock@^24.3.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.9.0.tgz#7970201802ba560e1c4092cc25cbedf5af5a8ce2" - integrity sha512-F1DjdpDMJMA1cN6He0FNYNZlo3yYmOtRUnktrT9Q37njYzC5WEaDdmbynIgy0L/IvXvvgsG8OsqhLPXTpfmZAA== - dependencies: - detect-newline "^2.1.0" - -jest-each@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.9.0.tgz#eb2da602e2a610898dbc5f1f6df3ba86b55f8b05" - integrity sha512-ONi0R4BvW45cw8s2Lrx8YgbeXL1oCQ/wIDwmsM3CqM/nlblNCPmnC3IPQlMbRFZu3wKdQ2U8BqM6lh3LJ5Bsog== - dependencies: - "@jest/types" "^24.9.0" - chalk "^2.0.1" - jest-get-type "^24.9.0" - jest-util "^24.9.0" - pretty-format "^24.9.0" - -jest-environment-jsdom@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.9.0.tgz#4b0806c7fc94f95edb369a69cc2778eec2b7375b" - integrity sha512-Zv9FV9NBRzLuALXjvRijO2351DRQeLYXtpD4xNvfoVFw21IOKNhZAEUKcbiEtjTkm2GsJ3boMVgkaR7rN8qetA== - dependencies: - "@jest/environment" "^24.9.0" - "@jest/fake-timers" "^24.9.0" - "@jest/types" "^24.9.0" - jest-mock "^24.9.0" - jest-util "^24.9.0" - jsdom "^11.5.1" - -jest-environment-node@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.9.0.tgz#333d2d2796f9687f2aeebf0742b519f33c1cbfd3" - integrity sha512-6d4V2f4nxzIzwendo27Tr0aFm+IXWa0XEUnaH6nU0FMaozxovt+sfRvh4J47wL1OvF83I3SSTu0XK+i4Bqe7uA== - dependencies: - "@jest/environment" "^24.9.0" - "@jest/fake-timers" "^24.9.0" - "@jest/types" "^24.9.0" - jest-mock "^24.9.0" - jest-util "^24.9.0" - -jest-get-type@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.9.0.tgz#1684a0c8a50f2e4901b6644ae861f579eed2ef0e" - integrity sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q== - -jest-haste-map@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.9.0.tgz#b38a5d64274934e21fa417ae9a9fbeb77ceaac7d" - integrity sha512-kfVFmsuWui2Sj1Rp1AJ4D9HqJwE4uwTlS/vO+eRUaMmd54BFpli2XhMQnPC2k4cHFVbB2Q2C+jtI1AGLgEnCjQ== - dependencies: - "@jest/types" "^24.9.0" - anymatch "^2.0.0" - fb-watchman "^2.0.0" - graceful-fs "^4.1.15" - invariant "^2.2.4" - jest-serializer "^24.9.0" - jest-util "^24.9.0" - jest-worker "^24.9.0" - micromatch "^3.1.10" - sane "^4.0.3" - walker "^1.0.7" - optionalDependencies: - fsevents "^1.2.7" - -jest-jasmine2@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.9.0.tgz#1f7b1bd3242c1774e62acabb3646d96afc3be6a0" - integrity sha512-Cq7vkAgaYKp+PsX+2/JbTarrk0DmNhsEtqBXNwUHkdlbrTBLtMJINADf2mf5FkowNsq8evbPc07/qFO0AdKTzw== - dependencies: - "@babel/traverse" "^7.1.0" - "@jest/environment" "^24.9.0" - "@jest/test-result" "^24.9.0" - "@jest/types" "^24.9.0" - chalk "^2.0.1" - co "^4.6.0" - expect "^24.9.0" - is-generator-fn "^2.0.0" - jest-each "^24.9.0" - jest-matcher-utils "^24.9.0" - jest-message-util "^24.9.0" - jest-runtime "^24.9.0" - jest-snapshot "^24.9.0" - jest-util "^24.9.0" - pretty-format "^24.9.0" - throat "^4.0.0" - -jest-leak-detector@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.9.0.tgz#b665dea7c77100c5c4f7dfcb153b65cf07dcf96a" - integrity sha512-tYkFIDsiKTGwb2FG1w8hX9V0aUb2ot8zY/2nFg087dUageonw1zrLMP4W6zsRO59dPkTSKie+D4rhMuP9nRmrA== - dependencies: - jest-get-type "^24.9.0" - pretty-format "^24.9.0" - -jest-matcher-utils@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.9.0.tgz#f5b3661d5e628dffe6dd65251dfdae0e87c3a073" - integrity sha512-OZz2IXsu6eaiMAwe67c1T+5tUAtQyQx27/EMEkbFAGiw52tB9em+uGbzpcgYVpA8wl0hlxKPZxrly4CXU/GjHA== - dependencies: - chalk "^2.0.1" - jest-diff "^24.9.0" - jest-get-type "^24.9.0" - pretty-format "^24.9.0" - -jest-message-util@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.9.0.tgz#527f54a1e380f5e202a8d1149b0ec872f43119e3" - integrity sha512-oCj8FiZ3U0hTP4aSui87P4L4jC37BtQwUMqk+zk/b11FR19BJDeZsZAvIHutWnmtw7r85UmR3CEWZ0HWU2mAlw== - dependencies: - "@babel/code-frame" "^7.0.0" - "@jest/test-result" "^24.9.0" - "@jest/types" "^24.9.0" - "@types/stack-utils" "^1.0.1" - chalk "^2.0.1" - micromatch "^3.1.10" - slash "^2.0.0" - stack-utils "^1.0.1" - -jest-mock@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.9.0.tgz#c22835541ee379b908673ad51087a2185c13f1c6" - integrity sha512-3BEYN5WbSq9wd+SyLDES7AHnjH9A/ROBwmz7l2y+ol+NtSFO8DYiEBzoO1CeFc9a8DYy10EO4dDFVv/wN3zl1w== - dependencies: - "@jest/types" "^24.9.0" - -jest-pnp-resolver@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a" - integrity sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ== - -jest-regex-util@^24.3.0, jest-regex-util@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.9.0.tgz#c13fb3380bde22bf6575432c493ea8fe37965636" - integrity sha512-05Cmb6CuxaA+Ys6fjr3PhvV3bGQmO+2p2La4hFbU+W5uOc479f7FdLXUWXw4pYMAhhSZIuKHwSXSu6CsSBAXQA== - -jest-resolve-dependencies@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.9.0.tgz#ad055198959c4cfba8a4f066c673a3f0786507ab" - integrity sha512-Fm7b6AlWnYhT0BXy4hXpactHIqER7erNgIsIozDXWl5dVm+k8XdGVe1oTg1JyaFnOxarMEbax3wyRJqGP2Pq+g== - dependencies: - "@jest/types" "^24.9.0" - jest-regex-util "^24.3.0" - jest-snapshot "^24.9.0" - -jest-resolve@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.9.0.tgz#dff04c7687af34c4dd7e524892d9cf77e5d17321" - integrity sha512-TaLeLVL1l08YFZAt3zaPtjiVvyy4oSA6CRe+0AFPPVX3Q/VI0giIWWoAvoS5L96vj9Dqxj4fB5p2qrHCmTU/MQ== - dependencies: - "@jest/types" "^24.9.0" - browser-resolve "^1.11.3" - chalk "^2.0.1" - jest-pnp-resolver "^1.2.1" - realpath-native "^1.1.0" - -jest-runner@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.9.0.tgz#574fafdbd54455c2b34b4bdf4365a23857fcdf42" - integrity sha512-KksJQyI3/0mhcfspnxxEOBueGrd5E4vV7ADQLT9ESaCzz02WnbdbKWIf5Mkaucoaj7obQckYPVX6JJhgUcoWWg== - dependencies: - "@jest/console" "^24.7.1" - "@jest/environment" "^24.9.0" - "@jest/test-result" "^24.9.0" - "@jest/types" "^24.9.0" - chalk "^2.4.2" - exit "^0.1.2" - graceful-fs "^4.1.15" - jest-config "^24.9.0" - jest-docblock "^24.3.0" - jest-haste-map "^24.9.0" - jest-jasmine2 "^24.9.0" - jest-leak-detector "^24.9.0" - jest-message-util "^24.9.0" - jest-resolve "^24.9.0" - jest-runtime "^24.9.0" - jest-util "^24.9.0" - jest-worker "^24.6.0" - source-map-support "^0.5.6" - throat "^4.0.0" - -jest-runtime@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.9.0.tgz#9f14583af6a4f7314a6a9d9f0226e1a781c8e4ac" - integrity sha512-8oNqgnmF3v2J6PVRM2Jfuj8oX3syKmaynlDMMKQ4iyzbQzIG6th5ub/lM2bCMTmoTKM3ykcUYI2Pw9xwNtjMnw== - dependencies: - "@jest/console" "^24.7.1" - "@jest/environment" "^24.9.0" - "@jest/source-map" "^24.3.0" - "@jest/transform" "^24.9.0" - "@jest/types" "^24.9.0" - "@types/yargs" "^13.0.0" - chalk "^2.0.1" - exit "^0.1.2" - glob "^7.1.3" - graceful-fs "^4.1.15" - jest-config "^24.9.0" - jest-haste-map "^24.9.0" - jest-message-util "^24.9.0" - jest-mock "^24.9.0" - jest-regex-util "^24.3.0" - jest-resolve "^24.9.0" - jest-snapshot "^24.9.0" - jest-util "^24.9.0" - jest-validate "^24.9.0" - realpath-native "^1.1.0" - slash "^2.0.0" - strip-bom "^3.0.0" - yargs "^13.3.0" - -jest-serializer@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.9.0.tgz#e6d7d7ef96d31e8b9079a714754c5d5c58288e73" - integrity sha512-DxYipDr8OvfrKH3Kel6NdED3OXxjvxXZ1uIY2I9OFbGg+vUkkg7AGvi65qbhbWNPvDckXmzMPbK3u3HaDO49bQ== - -jest-snapshot@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.9.0.tgz#ec8e9ca4f2ec0c5c87ae8f925cf97497b0e951ba" - integrity sha512-uI/rszGSs73xCM0l+up7O7a40o90cnrk429LOiK3aeTvfC0HHmldbd81/B7Ix81KSFe1lwkbl7GnBGG4UfuDew== - dependencies: - "@babel/types" "^7.0.0" - "@jest/types" "^24.9.0" - chalk "^2.0.1" - expect "^24.9.0" - jest-diff "^24.9.0" - jest-get-type "^24.9.0" - jest-matcher-utils "^24.9.0" - jest-message-util "^24.9.0" - jest-resolve "^24.9.0" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - pretty-format "^24.9.0" - semver "^6.2.0" - -jest-util@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.9.0.tgz#7396814e48536d2e85a37de3e4c431d7cb140162" - integrity sha512-x+cZU8VRmOJxbA1K5oDBdxQmdq0OIdADarLxk0Mq+3XS4jgvhG/oKGWcIDCtPG0HgjxOYvF+ilPJQsAyXfbNOg== - dependencies: - "@jest/console" "^24.9.0" - "@jest/fake-timers" "^24.9.0" - "@jest/source-map" "^24.9.0" - "@jest/test-result" "^24.9.0" - "@jest/types" "^24.9.0" - callsites "^3.0.0" - chalk "^2.0.1" - graceful-fs "^4.1.15" - is-ci "^2.0.0" - mkdirp "^0.5.1" - slash "^2.0.0" - source-map "^0.6.0" - -jest-validate@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.9.0.tgz#0775c55360d173cd854e40180756d4ff52def8ab" - integrity sha512-HPIt6C5ACwiqSiwi+OfSSHbK8sG7akG8eATl+IPKaeIjtPOeBUd/g3J7DghugzxrGjI93qS/+RPKe1H6PqvhRQ== - dependencies: - "@jest/types" "^24.9.0" - camelcase "^5.3.1" - chalk "^2.0.1" - jest-get-type "^24.9.0" - leven "^3.1.0" - pretty-format "^24.9.0" - -jest-watcher@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.9.0.tgz#4b56e5d1ceff005f5b88e528dc9afc8dd4ed2b3b" - integrity sha512-+/fLOfKPXXYJDYlks62/4R4GoT+GU1tYZed99JSCOsmzkkF7727RqKrjNAxtfO4YpGv11wybgRvCjR73lK2GZw== - dependencies: - "@jest/test-result" "^24.9.0" - "@jest/types" "^24.9.0" - "@types/yargs" "^13.0.0" - ansi-escapes "^3.0.0" - chalk "^2.0.1" - jest-util "^24.9.0" - string-length "^2.0.0" - -jest-worker@^24.6.0, jest-worker@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.9.0.tgz#5dbfdb5b2d322e98567898238a9697bcce67b3e5" - integrity sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw== - dependencies: - merge-stream "^2.0.0" - supports-color "^6.1.0" - -jest@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-24.9.0.tgz#987d290c05a08b52c56188c1002e368edb007171" - integrity sha512-YvkBL1Zm7d2B1+h5fHEOdyjCG+sGMz4f8D86/0HiqJ6MB4MnDc8FgP5vdWsGnemOQro7lnYo8UakZ3+5A0jxGw== - dependencies: - import-local "^2.0.0" - jest-cli "^24.9.0" +js-sdsl@^4.1.4: + version "4.1.5" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.1.5.tgz#1ff1645e6b4d1b028cd3f862db88c9d887f26e2a" + integrity sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q== "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" @@ -4325,7 +3152,7 @@ js-tokens@^3.0.2: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= -js-yaml@^3.13.1: +js-yaml@3.13.1: version "3.13.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== @@ -4333,69 +3160,42 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@4.1.0, js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= -jsdom@^11.5.1: - version "11.12.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8" - integrity sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw== - dependencies: - abab "^2.0.0" - acorn "^5.5.3" - acorn-globals "^4.1.0" - array-equal "^1.0.0" - cssom ">= 0.3.2 < 0.4.0" - cssstyle "^1.0.0" - data-urls "^1.0.0" - domexception "^1.0.1" - escodegen "^1.9.1" - html-encoding-sniffer "^1.0.2" - left-pad "^1.3.0" - nwsapi "^2.0.7" - parse5 "4.0.0" - pn "^1.1.0" - request "^2.87.0" - request-promise-native "^1.0.5" - sax "^1.2.4" - symbol-tree "^3.2.2" - tough-cookie "^2.3.4" - w3c-hr-time "^1.0.1" - webidl-conversions "^4.0.2" - whatwg-encoding "^1.0.3" - whatwg-mimetype "^2.1.0" - whatwg-url "^6.4.1" - ws "^5.2.0" - xml-name-validator "^3.0.0" - jsesc@^2.5.1: version "2.5.2" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== -json-bigint@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/json-bigint/-/json-bigint-1.0.0.tgz#ae547823ac0cad8398667f8cd9ef4730f5b01ff1" - integrity sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ== - dependencies: - bignumber.js "^9.0.0" +json-buffer@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" + integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= -json-parse-better-errors@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" - integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== +json-parse-even-better-errors@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= +json-schema@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" + integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" @@ -4407,17 +3207,12 @@ json-stringify-safe@~5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= -json5@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850" - integrity sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ== +jsonfile@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" + integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== dependencies: - minimist "^1.2.0" - -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= + universalify "^2.0.0" optionalDependencies: graceful-fs "^4.1.6" @@ -4438,13 +3233,13 @@ jsonwebtoken@^8.3.0: semver "^5.6.0" jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= + version "1.4.2" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" + integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== dependencies: assert-plus "1.0.0" extsprintf "1.3.0" - json-schema "0.2.3" + json-schema "0.4.0" verror "1.10.0" jwa@^1.4.1: @@ -4456,15 +3251,6 @@ jwa@^1.4.1: ecdsa-sig-formatter "1.0.11" safe-buffer "^5.0.1" -jwa@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/jwa/-/jwa-2.0.0.tgz#a7e9c3f29dae94027ebcaf49975c9345593410fc" - integrity sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA== - dependencies: - buffer-equal-constant-time "1.0.1" - ecdsa-sig-formatter "1.0.11" - safe-buffer "^5.0.1" - jws@^3.2.2: version "3.2.2" resolved "https://registry.yarnpkg.com/jws/-/jws-3.2.2.tgz#001099f3639468c9414000e99995fa52fb478304" @@ -4473,133 +3259,72 @@ jws@^3.2.2: jwa "^1.4.1" safe-buffer "^5.0.1" -jws@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jws/-/jws-4.0.0.tgz#2d4e8cf6a318ffaa12615e9dec7e86e6c97310f4" - integrity sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg== +keyv@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" + integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA== dependencies: - jwa "^2.0.0" - safe-buffer "^5.0.1" - -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - -kind-of@^6.0.0, kind-of@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" - integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== - -kleur@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" - integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== + json-buffer "3.0.0" kuler@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/kuler/-/kuler-2.0.0.tgz#e2c570a3800388fb44407e851531c1d670b061b3" integrity sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A== -latest-version@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15" - integrity sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU= +latest-version@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-5.1.0.tgz#119dfe908fe38d15dfa43ecd13fa12ec8832face" + integrity sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA== dependencies: - package-json "^4.0.0" + package-json "^6.3.0" -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== dependencies: - invert-kv "^1.0.0" - -left-pad@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" - integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA== - -leven@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" - integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== - -levn@^0.3.0, levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" + prelude-ls "^1.2.1" + type-check "~0.4.0" lines-and-columns@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" - integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= + version "1.2.4" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" + integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== lint-staged@^10.2.2: - version "10.2.2" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-10.2.2.tgz#901403c120eb5d9443a0358b55038b04c8a7db9b" - integrity sha512-78kNqNdDeKrnqWsexAmkOU3Z5wi+1CsQmUmfCuYgMTE8E4rAIX8RHW7xgxwAZ+LAayb7Cca4uYX4P3LlevzjVg== + version "10.5.4" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-10.5.4.tgz#cd153b5f0987d2371fc1d2847a409a2fe705b665" + integrity sha512-EechC3DdFic/TdOPgj/RB3FicqE6932LTHCUm0Y2fsD9KGlLB+RwJl2q1IYBIvEsKzDOgn0D4gll+YxG5RsrKg== dependencies: - chalk "^4.0.0" - commander "^5.0.0" - cosmiconfig "^6.0.0" - debug "^4.1.1" + chalk "^4.1.0" + cli-truncate "^2.1.0" + commander "^6.2.0" + cosmiconfig "^7.0.0" + debug "^4.2.0" dedent "^0.7.0" - execa "^4.0.0" - listr2 "1.3.8" - log-symbols "^3.0.0" + enquirer "^2.3.6" + execa "^4.1.0" + listr2 "^3.2.2" + log-symbols "^4.0.0" micromatch "^4.0.2" normalize-path "^3.0.0" please-upgrade-node "^3.2.0" string-argv "0.3.1" stringify-object "^3.3.0" -listr2@1.3.8: - version "1.3.8" - resolved "https://registry.yarnpkg.com/listr2/-/listr2-1.3.8.tgz#30924d79de1e936d8c40af54b6465cb814a9c828" - integrity sha512-iRDRVTgSDz44tBeBBg/35TQz4W+EZBWsDUq7hPpqeUHm7yLPNll0rkwW3lIX9cPAK7l+x95mGWLpxjqxftNfZA== +listr2@^3.2.2: + version "3.13.5" + resolved "https://registry.yarnpkg.com/listr2/-/listr2-3.13.5.tgz#105a813f2eb2329c4aae27373a281d610ee4985f" + integrity sha512-3n8heFQDSk+NcwBn3CgxEibZGaRzx+pC64n3YjpMD1qguV4nWus3Al+Oo3KooqFKTQEJ1v7MmnbnyyNspgx3NA== dependencies: - "@samverschueren/stream-to-observable" "^0.3.0" - chalk "^3.0.0" - cli-cursor "^3.1.0" cli-truncate "^2.1.0" - elegant-spinner "^2.0.0" - enquirer "^2.3.4" - figures "^3.2.0" - indent-string "^4.0.0" + colorette "^2.0.16" log-update "^4.0.0" p-map "^4.0.0" - pad "^3.2.0" - rxjs "^6.3.3" + rfdc "^1.3.0" + rxjs "^7.4.0" through "^2.3.8" - uuid "^7.0.2" - -load-json-file@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" - integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= - dependencies: - graceful-fs "^4.1.2" - parse-json "^4.0.0" - pify "^3.0.0" - strip-bom "^3.0.0" + wrap-ansi "^7.0.0" "localtunnel@git://github.com/shocknet/localtunnel#40cc2c2a46b05da2217bf2e20da11a5343a5cce7": version "2.0.0" @@ -4618,23 +3343,18 @@ locate-path@^3.0.0: p-locate "^3.0.0" path-exists "^3.0.0" -locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== dependencies: - p-locate "^4.1.0" + p-locate "^5.0.0" lodash.camelcase@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" integrity sha1-soqmKIorn8ZRA1x3EfZathkDMaY= -lodash.clone@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.clone/-/lodash.clone-4.5.0.tgz#195870450f5a13192478df4bc3d23d2dea1907b6" - integrity sha1-GVhwRQ9aExkkeN9Lw9I9LeoZB7Y= - lodash.includes@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f" @@ -4665,38 +3385,36 @@ lodash.isstring@^4.0.1: resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" integrity sha1-1SfftUVuynzJu5XV2ur4i6VKVFE= +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + lodash.once@^4.0.0: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" integrity sha1-DdOXEhPHxW34gJd9UEyI+0cal6w= -lodash.sortby@^4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" - integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= +lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -lodash.unescape@4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" - integrity sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw= - -lodash@=4.17.4: - version "4.17.4" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" - integrity sha1-eCA6TRwyiuHYbcpkYONptX9AVa4= - -lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.4, lodash@^4.17.5: - version "4.17.20" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" - integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== - -log-symbols@^3.0.0: +log-symbols@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== dependencies: chalk "^2.4.2" +log-symbols@4.1.0, log-symbols@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== + dependencies: + chalk "^4.1.0" + is-unicode-supported "^0.1.0" + log-update@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/log-update/-/log-update-4.0.0.tgz#589ecd352471f2a1c0c570287543a64dfd20e0a1" @@ -4708,14 +3426,14 @@ log-update@^4.0.0: wrap-ansi "^6.2.0" logform@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/logform/-/logform-2.2.0.tgz#40f036d19161fc76b68ab50fdc7fe495544492f2" - integrity sha512-N0qPlqfypFx7UHNn4B3lzS/b0uLqt2hmuoa+PpuXNYgozdJYAyauF5Ky0BWVjrxDlMWiT3qN4zPq3vVAfZy7Yg== + version "2.3.0" + resolved "https://registry.yarnpkg.com/logform/-/logform-2.3.0.tgz#a3997a05985de2ebd325ae0d166dffc9c6fe6b57" + integrity sha512-graeoWUH2knKbGthMtuG1EfaSPMZFZBIrhuJHhkS5ZseFBrc7DupCzihOQAzsK/qIKPQaPJ/lFQFctILUY5ARQ== dependencies: colors "^1.2.1" - fast-safe-stringify "^2.0.4" fecha "^4.2.0" ms "^2.1.1" + safe-stable-stringify "^1.1.0" triple-beam "^1.3.0" long@^4.0.0: @@ -4723,30 +3441,27 @@ long@^4.0.0: resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== -long@~3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" - integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= +long@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/long/-/long-5.2.0.tgz#2696dadf4b4da2ce3f6f6b89186085d94d52fd61" + integrity sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w== -loose-envify@^1.0.0, loose-envify@^1.4.0: +loose-envify@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== dependencies: js-tokens "^3.0.0 || ^4.0.0" -lowercase-keys@^1.0.0: +lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== -lru-cache@^4.0.1: - version "4.1.5" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" - integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" +lowercase-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" + integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== lru-cache@^6.0.0: version "6.0.0" @@ -4755,45 +3470,18 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -make-dir@^1.0.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" - integrity sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ== +make-dir@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== dependencies: - pify "^3.0.0" - -make-dir@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" - integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== - dependencies: - pify "^4.0.1" - semver "^5.6.0" + semver "^6.0.0" make-error@^1.1.1: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== -makeerror@1.0.x: - version "1.0.11" - resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" - integrity sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw= - dependencies: - tmpl "1.0.x" - -map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= - dependencies: - object-visit "^1.0.0" - md5.js@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" @@ -4818,12 +3506,17 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -method-override@^2.3.7: - version "2.3.10" - resolved "https://registry.yarnpkg.com/method-override/-/method-override-2.3.10.tgz#e3daf8d5dee10dd2dce7d4ae88d62bbee77476b4" - integrity sha1-49r41d7hDdLc59SuiNYrvud0drQ= +merge2@^1.3.0, merge2@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + +method-override@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/method-override/-/method-override-3.0.0.tgz#6ab0d5d574e3208f15b0c9cf45ab52000468d7a2" + integrity sha512-IJ2NNN/mSl9w3kzWB92rcdHpz+HjkxhDJWNDBqSlas+zQdP8wBiJzITPg08M/k2uVvMow7Sk41atndNtt/PHSA== dependencies: - debug "2.6.9" + debug "3.1.0" methods "~1.1.2" parseurl "~1.3.2" vary "~1.1.2" @@ -4833,141 +3526,141 @@ methods@~1.1.2: resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= -micromatch@^3.1.10, micromatch@^3.1.4: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - -micromatch@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" - integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== +micromatch@^4.0.2, micromatch@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" + integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== dependencies: braces "^3.0.1" - picomatch "^2.0.5" + picomatch "^2.2.3" -mime-db@1.40.0: - version "1.40.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" - integrity sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA== - -"mime-db@>= 1.43.0 < 2": - version "1.43.0" - resolved "https://registry.npm.taobao.org/mime-db/download/mime-db-1.43.0.tgz#0a12e0502650e473d735535050e7c8f4eb4fae58" - integrity sha1-ChLgUCZQ5HPXNVNQUOfI9OtPrlg= +mime-db@1.51.0, "mime-db@>= 1.43.0 < 2": + version "1.51.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" + integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== mime-types@^2.1.12, mime-types@~2.1.19, mime-types@~2.1.24: - version "2.1.24" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.24.tgz#b6f8d0b3e951efb77dedeca194cff6d16f676f81" - integrity sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ== + version "2.1.34" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" + integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== dependencies: - mime-db "1.40.0" + mime-db "1.51.0" mime@1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== -mime@^2.2.0: - version "2.4.6" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.6.tgz#e5b407c90db442f2beb5b162373d07b69affa4d1" - integrity sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA== - mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== +mimic-response@^1.0.0, mimic-response@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" + integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== + minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== -minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: +minimalistic-crypto-utils@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= -minimatch@^3.0.4: +minimatch@3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== dependencies: brace-expansion "^1.1.7" -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - -minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== - -minipass@^2.2.1, minipass@^2.3.5: - version "2.5.1" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.5.1.tgz#cf435a9bf9408796ca3a3525a8b851464279c9b8" - integrity sha512-dmpSnLJtNQioZFI5HfQ55Ad0DzzsMAb+HfokwRTNXwEQjepbTkl5mtIlSVxGIkOkxlpX7wIn5ET/oAd9fZ/Y/Q== +minimatch@^3.0.4, minimatch@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" + brace-expansion "^1.1.7" -minipass@^2.8.6: - version "2.9.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" - integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" +minimist@^1.2.0, minimist@^1.2.5: + version "1.2.7" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" + integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== -minizlib@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" - integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== - dependencies: - minipass "^2.2.1" - -mixin-deep@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" - integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - -mkdirp@^0.5.0, mkdirp@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= - dependencies: - minimist "0.0.8" - -mkdirp@^0.5.3: +mkdirp@0.5.5: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== dependencies: minimist "^1.2.5" +mocha@^7.1.1: + version "7.2.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.2.0.tgz#01cc227b00d875ab1eed03a75106689cfed5a604" + integrity sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ== + dependencies: + ansi-colors "3.2.3" + browser-stdout "1.3.1" + chokidar "3.3.0" + debug "3.2.6" + diff "3.5.0" + escape-string-regexp "1.0.5" + find-up "3.0.0" + glob "7.1.3" + growl "1.10.5" + he "1.2.0" + js-yaml "3.13.1" + log-symbols "3.0.0" + minimatch "3.0.4" + mkdirp "0.5.5" + ms "2.1.1" + node-environment-flags "1.0.6" + object.assign "4.1.0" + strip-json-comments "2.0.1" + supports-color "6.0.0" + which "1.3.1" + wide-align "1.1.3" + yargs "13.3.2" + yargs-parser "13.1.2" + yargs-unparser "1.6.0" + +mocha@^9.1.1: + version "9.1.3" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.1.3.tgz#8a623be6b323810493d8c8f6f7667440fa469fdb" + integrity sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw== + dependencies: + "@ungap/promise-all-settled" "1.1.2" + ansi-colors "4.1.1" + browser-stdout "1.3.1" + chokidar "3.5.2" + debug "4.3.2" + diff "5.0.0" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "7.1.7" + growl "1.10.5" + he "1.2.0" + js-yaml "4.1.0" + log-symbols "4.1.0" + minimatch "3.0.4" + ms "2.1.3" + nanoid "3.1.25" + serialize-javascript "6.0.0" + strip-json-comments "3.1.1" + supports-color "8.1.1" + which "2.0.2" + workerpool "6.1.5" + yargs "16.2.0" + yargs-parser "20.2.4" + yargs-unparser "2.0.0" + moment@^2.11.2: - version "2.27.0" - resolved "https://registry.yarnpkg.com/moment/-/moment-2.27.0.tgz#8bff4e3e26a236220dfe3e36de756b6ebaa0105d" - integrity sha512-al0MUK7cpIcglMv3YF13qSgdAIqxHTO7brRtaz3DlSULbqfazqkc5kEjNrLDOM7fsjshoFIihnU8snrP7zUvhQ== + version "2.29.1" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3" + integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ== ms@2.0.0: version "2.0.0" @@ -4979,172 +3672,90 @@ ms@2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== -ms@2.1.2, ms@^2.1.1: +ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -mute-stream@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" - integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== +ms@2.1.3, ms@^2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -nan@2.14.0, nan@^2.12.1, nan@^2.13.2: +nan@2.14.0: version "2.14.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== nan@^2.14.0: - version "2.14.2" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19" - integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ== + version "2.15.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.15.0.tgz#3f34a473ff18e15c1b5626b62903b5ad6e665fee" + integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ== -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" +nanoid@3.1.25: + version "3.1.25" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.25.tgz#09ca32747c0e543f0e1814b7d3793477f9c8e152" + integrity sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q== natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -needle@^2.2.1: - version "2.4.0" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.4.0.tgz#6833e74975c444642590e15a750288c5f939b57c" - integrity sha512-4Hnwzr3mi5L97hMYeNl8wRW/Onhy4nUKR/lVemJ8gJedxxUyBLm9kkrDColJvoSfwi0jCNhD+xCdOtiGDQiRZg== - dependencies: - debug "^3.2.6" - iconv-lite "^0.4.4" - sax "^1.2.4" - -needle@^2.5.0: - version "2.5.2" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.5.2.tgz#cf1a8fce382b5a280108bba90a14993c00e4010a" - integrity sha512-LbRIwS9BfkPvNwNHlsA41Q29kL2L/6VaOJ0qisM5lLWsTV3nP15abO5ITL6L81zqFhzjRKDAYjpcBcwM0AVvLQ== - dependencies: - debug "^3.2.6" - iconv-lite "^0.4.4" - sax "^1.2.4" - negotiator@0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== -neo-async@^2.6.0: - version "2.6.2" - resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" - integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== - -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - -node-fetch@^2.3.0, node-fetch@^2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== - -node-forge@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.10.0.tgz#32dea2afb3e9926f02ee5ce8794902691a676bf3" - integrity sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA== - -node-int64@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" - integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= - -node-modules-regexp@^1.0.0: +node-domexception@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" - integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= + resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" + integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== -node-notifier@^5.4.2: - version "5.4.3" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.4.3.tgz#cb72daf94c93904098e28b9c590fd866e464bd50" - integrity sha512-M4UBGcs4jeOK9CjTsYwkvH6/MzuUmGCyTW+kCY7uO+1ZVr0+FHGdPdIf5CCLqAaxnRrWidyoQlNkMIIVwbKB8Q== +node-environment-flags@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.6.tgz#a30ac13621f6f7d674260a54dede048c3982c088" + integrity sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw== dependencies: - growly "^1.3.0" - is-wsl "^1.1.0" - semver "^5.5.0" - shellwords "^0.1.1" - which "^1.3.0" + object.getownpropertydescriptors "^2.0.3" + semver "^5.7.0" + +node-fetch@^2.6.1: + version "2.6.6" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.6.tgz#1751a7c01834e8e1697758732e9efb6eeadfaf89" + integrity sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA== + dependencies: + whatwg-url "^5.0.0" + +node-fetch@^3.2.10: + version "3.2.10" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.2.10.tgz#e8347f94b54ae18b57c9c049ef641cef398a85c8" + integrity sha512-MhuzNwdURnZ1Cp4XTazr69K0BTizsBroX7Zx3UgDSVcZYKF/6p0CBe4EUb/hLqmzVhl0UpYfgRljQ4yxE+iCxA== + dependencies: + data-uri-to-buffer "^4.0.0" + fetch-blob "^3.1.4" + formdata-polyfill "^4.0.10" node-persist@^3.1.0: version "3.1.0" - resolved "https://registry.npmjs.org/node-persist/-/node-persist-3.1.0.tgz#9d4b03950bba70d37d13d3d3551840e25fd17e09" + resolved "https://registry.yarnpkg.com/node-persist/-/node-persist-3.1.0.tgz#9d4b03950bba70d37d13d3d3551840e25fd17e09" integrity sha512-/j+fd/u71wNgKf3V2bx4tnDm+3GvLnlCuvf2MXbJ3wern+67IAb6zN9Leu1tCWPlPNZ+v1hLSibVukkPK2HqJw== -node-pre-gyp@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz#39ba4bb1439da030295f899e3b520b7785766149" - integrity sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A== +nodemon@^2.0.7: + version "2.0.15" + resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-2.0.15.tgz#504516ce3b43d9dc9a955ccd9ec57550a31a8d4e" + integrity sha512-gdHMNx47Gw7b3kWxJV64NI+Q5nfl0y5DgDbiVtShiwa7Z0IZ07Ll4RLFo6AjrhzMtoEZn5PDE3/c2AbVsiCkpA== dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.1" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.2.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4" - -node-pre-gyp@^0.16.0: - version "0.16.0" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.16.0.tgz#238fa540364784e5015dfcdba78da3937e18dbdc" - integrity sha512-4efGA+X/YXAHLi1hN8KaPrILULaUn2nWecFrn1k2I+99HpoyvcOGEbtcOxpDiUwPF2ZANMJDh32qwOUPenuR1g== - dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.3" - needle "^2.5.0" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.2.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4.4.2" - -nodemon@^1.19.3: - version "1.19.3" - resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-1.19.3.tgz#db71b3e62aef2a8e1283a9fa00164237356102c0" - integrity sha512-TBNKRmJykEbxpTniZBusqRrUTHIEqa2fpecbTQDQj1Gxjth7kKAPP296ztR0o5gPUWsiYbuEbt73/+XMYab1+w== - dependencies: - chokidar "^2.1.5" - debug "^3.1.0" + chokidar "^3.5.2" + debug "^3.2.7" ignore-by-default "^1.0.1" minimatch "^3.0.4" - pstree.remy "^1.1.6" - semver "^5.5.0" - supports-color "^5.2.0" + pstree.remy "^1.1.8" + semver "^5.7.1" + supports-color "^5.5.0" touch "^3.1.0" - undefsafe "^2.0.2" - update-notifier "^2.5.0" - -nopt@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= - dependencies: - abbrev "1" - osenv "^0.1.4" + undefsafe "^2.0.5" + update-notifier "^5.1.0" nopt@~1.0.10: version "1.0.10" @@ -5153,28 +3764,16 @@ nopt@~1.0.10: dependencies: abbrev "1" -normalize-package-data@^2.3.2: - version "2.5.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= - dependencies: - remove-trailing-separator "^1.0.1" - -normalize-path@^3.0.0: +normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== +normalize-url@^4.1.0: + version "4.5.1" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" + integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== + normalizr@^3.6.0: version "3.6.1" resolved "https://registry.yarnpkg.com/normalizr/-/normalizr-3.6.1.tgz#d367ab840e031ff382141b8d81ce279292ff69fe" @@ -5185,26 +3784,6 @@ notepack.io@~2.2.0: resolved "https://registry.yarnpkg.com/notepack.io/-/notepack.io-2.2.0.tgz#d7ea71d1cb90094f88c6f3c8d84277c2d0cd101c" integrity sha512-9b5w3t5VSH6ZPosoYnyDONnUTF8o0UkBw7JLA6eBlYJWyGT1Q3vQa8Hmuj1/X6RYvHjjygBDgw6fJhe0JEojfw== -npm-bundled@^1.0.1: - version "1.0.6" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd" - integrity sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g== - -npm-packlist@^1.1.6: - version "1.4.4" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.4.tgz#866224233850ac534b63d1a6e76050092b5d2f44" - integrity sha512-zTLo8UcVYtDU3gdeaFu2Xu0n0EvelfHDGuqtNIn5RO7yQj4H1TqNdBc/yZjxnWA0PVB8D3Woyp0i5B43JwQ6Vw== - dependencies: - ignore-walk "^3.0.1" - npm-bundled "^1.0.1" - -npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= - dependencies: - path-key "^2.0.0" - npm-run-path@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" @@ -5212,81 +3791,59 @@ npm-run-path@^4.0.0: dependencies: path-key "^3.0.0" -npmlog@^4.0.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - -nwsapi@^2.0.7: - version "2.1.4" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.1.4.tgz#e006a878db23636f8e8a67d33ca0e4edf61a842f" - integrity sha512-iGfd9Y6SFdTNldEy2L0GUhcarIutFmk+MPWIn9dmj8NMIup03G08uUF2KGbbmv/Ux4RT0VZJoP/sVbWA6d/VIw== - oauth-sign@~0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== -object-assign@^4, object-assign@^4.1.0: +object-assign@^4: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - object-hash@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-2.0.3.tgz#d12db044e03cd2ca3d77c0570d87225b02e1e6ea" - integrity sha512-JPKn0GMu+Fa3zt3Bmr66JhokJU5BaNBIh4ZeTlaCBzrBsOeXzwcKKAK1tbLiPKgvwmPXsDvvLHoWh5Bm7ofIYg== + version "2.2.0" + resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-2.2.0.tgz#5ad518581eefc443bd763472b8ff2e9c2c0d54a5" + integrity sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw== -object-inspect@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b" - integrity sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ== +object-inspect@^1.11.0, object-inspect@^1.9.0: + version "1.11.1" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.1.tgz#d4bd7d7de54b9a75599f59a00bd698c1f1c6549b" + integrity sha512-If7BjFlpkzzBeV1cqgT3OSWT3azyoxDGajR+iGnFBfVV2EWyDyWaZZW2ERDjUaY2QM8i5jI3Sj7mhsM4DDAqWA== -object-keys@^1.0.12, object-keys@^1.1.1: +object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= - dependencies: - isobject "^3.0.0" - -object.getownpropertydescriptors@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" - integrity sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY= +object.assign@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" + integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== dependencies: define-properties "^1.1.2" - es-abstract "^1.5.1" + function-bind "^1.1.1" + has-symbols "^1.0.0" + object-keys "^1.0.11" -object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= +object.assign@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" + integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== dependencies: - isobject "^3.0.1" + call-bind "^1.0.0" + define-properties "^1.1.3" + has-symbols "^1.0.1" + object-keys "^1.1.1" + +object.getownpropertydescriptors@^2.0.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.3.tgz#b223cf38e17fefb97a63c10c91df72ccb386df9e" + integrity sha512-VdDoCwvJI4QdC6ndjpqFmoL3/+HxffFBbcJzKi5hwLLqqx3mdbedRpfZDdK0SrOSauj8X4GzBvnDZl4vTN7dOw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.1" on-finished@~2.3.0: version "2.3.0" @@ -5315,83 +3872,53 @@ one-time@^1.0.0: fn.name "1.x.x" onetime@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.0.tgz#fff0f3c91617fe62bb50189636e99ac8a6df7be5" - integrity sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q== + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== dependencies: mimic-fn "^2.1.0" opencollective-postinstall@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz#5657f1bede69b6e33a45939b061eb53d3c6c3a89" - integrity sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw== + version "2.0.3" + resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz#7a0fff978f6dbfa4d006238fbac98ed4198c3259" + integrity sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q== openurl@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/openurl/-/openurl-1.1.1.tgz#3875b4b0ef7a52c156f0db41d4609dbb0f94b387" integrity sha1-OHW0sO96UsFW8NtB1GCduw+Us4c= -optionator@^0.8.1, optionator@^0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" - integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= +optionator@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" + integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.4" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - wordwrap "~1.0.0" + deep-is "^0.1.3" + fast-levenshtein "^2.0.6" + levn "^0.4.1" + prelude-ls "^1.2.1" + type-check "^0.4.0" + word-wrap "^1.2.3" -optjs@~3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" - integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= +p-cancelable@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" + integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= - -os-locale@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= - dependencies: - lcid "^1.0.0" - -os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= - -osenv@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" - integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" - -p-each-series@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-1.0.0.tgz#930f3d12dd1f50e7434457a22cd6f04ac6ad7f71" - integrity sha1-kw89Et0fUOdDRFeiLNbwSsatf3E= - dependencies: - p-reduce "^1.0.0" - -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= - -p-limit@^2.0.0, p-limit@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.1.tgz#aa07a788cc3151c939b5131f63570f0dd2009537" - integrity sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg== +p-limit@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== dependencies: p-try "^2.0.0" +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + p-locate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" @@ -5399,12 +3926,12 @@ p-locate@^3.0.0: dependencies: p-limit "^2.0.0" -p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== dependencies: - p-limit "^2.2.0" + p-limit "^3.0.2" p-map@^4.0.0: version "4.0.0" @@ -5413,32 +3940,20 @@ p-map@^4.0.0: dependencies: aggregate-error "^3.0.0" -p-reduce@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa" - integrity sha1-GMKw3ZNqRpClKfgjH1ig/bakffo= - p-try@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== -package-json@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/package-json/-/package-json-4.0.1.tgz#8869a0401253661c4c4ca3da6c2121ed555f5eed" - integrity sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0= +package-json@^6.3.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/package-json/-/package-json-6.5.0.tgz#6feedaca35e75725876d0b0e64974697fed145b0" + integrity sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ== dependencies: - got "^6.7.1" - registry-auth-token "^3.0.1" - registry-url "^3.0.3" - semver "^5.1.0" - -pad@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/pad/-/pad-3.2.0.tgz#be7a1d1cb6757049b4ad5b70e71977158fea95d1" - integrity sha512-2u0TrjcGbOjBTJpyewEl4hBO3OeX5wWue7eIFPzQTg6wFSvoaHcBTTUY5m+n0hd04gmTCPuY0kCpVIVuw5etwg== - dependencies: - wcwidth "^1.0.1" + got "^9.6.0" + registry-auth-token "^4.0.0" + registry-url "^5.0.0" + semver "^6.2.0" parent-module@^1.0.0: version "1.0.1" @@ -5447,44 +3962,21 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" -parse-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= - dependencies: - error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" - parse-json@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.0.0.tgz#73e5114c986d143efa3712d4ea24db9a4266f60f" - integrity sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw== + version "5.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" + integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== dependencies: "@babel/code-frame" "^7.0.0" error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" + json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" -parse5@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" - integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA== - parseurl@~1.3.2, parseurl@~1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= - -path-dirname@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" - integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= - path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" @@ -5500,38 +3992,21 @@ path-is-absolute@^1.0.0: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= -path-is-inside@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= - -path-key@^2.0.0, path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= - path-key@^3.0.0, path-key@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= -path-type@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" - integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== - dependencies: - pify "^3.0.0" - path-type@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" @@ -5542,41 +4017,17 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= -picomatch@^2.0.5: - version "2.2.2" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" - integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: + version "2.3.0" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" + integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= - -pify@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" - integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== - -pirates@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" - integrity sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA== +pkg-dir@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-5.0.0.tgz#a02d6aebe6ba133a928f74aec20bafdfe6b8e760" + integrity sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA== dependencies: - node-modules-regexp "^1.0.0" - -pkg-dir@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" - integrity sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw== - dependencies: - find-up "^3.0.0" - -pkg-dir@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" - integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== - dependencies: - find-up "^4.0.0" + find-up "^5.0.0" please-upgrade-node@^3.2.0: version "3.2.0" @@ -5585,25 +4036,15 @@ please-upgrade-node@^3.2.0: dependencies: semver-compare "^1.0.0" -pn@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" - integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= - -prepend-http@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" - integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= +prepend-http@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" + integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= prettier-linter-helpers@^1.0.0: version "1.0.0" @@ -5613,29 +4054,19 @@ prettier-linter-helpers@^1.0.0: fast-diff "^1.1.2" prettier@^1.18.2: - version "1.18.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea" - integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw== + version "1.19.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" + integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== -pretty-format@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.9.0.tgz#12fac31b37019a4eea3c11aa9a959eb7628aa7c9" - integrity sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA== +pretty-format@^27.4.2: + version "27.4.2" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.4.2.tgz#e4ce92ad66c3888423d332b40477c87d1dac1fb8" + integrity sha512-p0wNtJ9oLuvgOQDEIZ9zQjZffK7KtyR6Si0jnXULIDwrlNF8Cuir3AZP0hHv0jmKuNN/edOnbMjnzd4uTcmWiw== dependencies: - "@jest/types" "^24.9.0" - ansi-regex "^4.0.0" - ansi-styles "^3.2.0" - react-is "^16.8.4" - -process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - -progress@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + "@jest/types" "^27.4.2" + ansi-regex "^5.0.1" + ansi-styles "^5.0.0" + react-is "^17.0.1" promise@^8.1.0: version "8.1.0" @@ -5644,28 +4075,10 @@ promise@^8.1.0: dependencies: asap "~2.0.6" -prompts@^2.0.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.2.1.tgz#f901dd2a2dfee080359c0e20059b24188d75ad35" - integrity sha512-VObPvJiWPhpZI6C5m60XOzTfnYg/xc/an+r9VYymj9WJW3B/DIH+REzjpAACPf8brwPeP+7vz3bIim3S+AaMjw== - dependencies: - kleur "^3.0.3" - sisteransi "^1.0.3" - -protobufjs@^5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" - integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^7.0.5" - yargs "^3.10.0" - -protobufjs@^6.8.0, protobufjs@^6.8.6: - version "6.8.8" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.8.8.tgz#c8b4f1282fd7a90e6f5b109ed11c84af82908e7c" - integrity sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw== +protobufjs@^6.10.0, protobufjs@^6.8.6: + version "6.11.2" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.2.tgz#de39fabd4ed32beaa08e9bb1e30d08544c1edf8b" + integrity sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw== dependencies: "@protobufjs/aspromise" "^1.1.2" "@protobufjs/base64" "^1.1.2" @@ -5677,32 +4090,50 @@ protobufjs@^6.8.0, protobufjs@^6.8.6: "@protobufjs/path" "^1.1.2" "@protobufjs/pool" "^1.1.0" "@protobufjs/utf8" "^1.1.0" - "@types/long" "^4.0.0" - "@types/node" "^10.1.0" + "@types/long" "^4.0.1" + "@types/node" ">=13.7.0" long "^4.0.0" -proxy-addr@~2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.5.tgz#34cbd64a2d81f4b1fd21e76f9f06c8a45299ee34" - integrity sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ== +protobufjs@^7.0.0: + version "7.1.2" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.1.2.tgz#a0cf6aeaf82f5625bffcf5a38b7cd2a7de05890c" + integrity sha512-4ZPTPkXCdel3+L81yw3dG6+Kq3umdWKh7Dc7GW/CpNk4SX3hK58iPCWeCyhVTDrbkNeKrYNZ7EojM5WDaEWTLQ== dependencies: - forwarded "~0.1.2" - ipaddr.js "1.9.0" + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/node" ">=13.7.0" + long "^5.0.0" -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= +proxy-addr@~2.0.5: + version "2.0.7" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" + integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== + dependencies: + forwarded "0.2.0" + ipaddr.js "1.9.1" + +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== psl@^1.1.28: - version "1.4.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.4.0.tgz#5dd26156cdb69fa1fdb8ab1991667d3f80ced7c2" - integrity sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw== + version "1.8.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" + integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== -pstree.remy@^1.1.6: - version "1.1.7" - resolved "https://registry.yarnpkg.com/pstree.remy/-/pstree.remy-1.1.7.tgz#c76963a28047ed61542dc361aa26ee55a7fa15f3" - integrity sha512-xsMgrUwRpuGskEzBFkH8NmTimbZ5PcPup0LA8JJkHIm2IMUbQcpo3yeLNWVrufEYjh8YwtSVh0xz6UeWc5Oh5A== +pstree.remy@^1.1.8: + version "1.1.8" + resolved "https://registry.yarnpkg.com/pstree.remy/-/pstree.remy-1.1.8.tgz#c242224f4a67c21f686839bbdb4ac282b8373d3a" + integrity sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w== pump@^3.0.0: version "3.0.0" @@ -5717,12 +4148,19 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -pvtsutils@^1.0.10: - version "1.0.10" - resolved "https://registry.npmjs.org/pvtsutils/-/pvtsutils-1.0.10.tgz#157d0fcb853f570d32e0f8788179f3057eacdf38" - integrity sha512-8ZKQcxnZKTn+fpDh7wL4yKax5fdl3UJzT8Jv49djZpB/dzPxacyN1Sez90b6YLdOmvIr9vaySJ5gw4aUA1EdSw== +pupa@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/pupa/-/pupa-2.1.1.tgz#f5e8fd4afc2c5d97828faa523549ed8744a20d62" + integrity sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A== dependencies: - tslib "^1.10.0" + escape-goat "^2.0.0" + +pvtsutils@^1.2.0, pvtsutils@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/pvtsutils/-/pvtsutils-1.2.1.tgz#8212e846ca9afb21e40cebb0691755649f9f498a" + integrity sha512-Q867jEr30lBR2YSFFLZ0/XsEvpweqH6Kj096wmlRAFXrdRGPCNq2iz9B5Tk085EZ+OBZyYAVA5UhPkjSHGrUzQ== + dependencies: + tslib "^2.3.1" pvutils@latest: version "1.0.17" @@ -5739,11 +4177,21 @@ qs@6.7.0: resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== +qs@6.9.6: + version "6.9.6" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.6.tgz#26ed3c8243a431b2924aca84cc90471f35d5a0ee" + integrity sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ== + qs@~6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + ramda@^0.26.1: version "0.26.1" resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.26.1.tgz#8d41351eb8111c55353617fc3bbffad8e4d35d06" @@ -5759,6 +4207,20 @@ random-bytes@~1.0.0: resolved "https://registry.yarnpkg.com/random-bytes/-/random-bytes-1.0.0.tgz#4f68a1dc0ae58bd3fb95848c30324db75d64360b" integrity sha1-T2ih3Arli9P7lYSMMDJNt11kNgs= +random-words@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/random-words/-/random-words-1.1.1.tgz#62e34be74c7cd5e5f78b537875d30e2eab258ecc" + integrity sha512-Rdk5EoQePyt9Tz3RjeMELi2BSaCI+jDiOkBr4U+3fyBRiiW3qqEuaegGAUMOZ4yGWlQscFQGqQpdic3mAbNkrw== + dependencies: + mocha "^7.1.1" + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + range-parser@~1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" @@ -5774,7 +4236,17 @@ raw-body@2.4.0: iconv-lite "0.4.24" unpipe "1.0.0" -rc@^1.0.1, rc@^1.1.6, rc@^1.2.7: +raw-body@2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.2.tgz#baf3e9c21eebced59dd6533ac872b71f7b61cb32" + integrity sha512-RPMAFUJP19WIet/99ngh6Iv8fzAbqum4Li7AD6DtGaW2RpMB/11xDoalPiJMTbu6I3hkbMVkATvZrqb9EEqeeQ== + dependencies: + bytes "3.1.1" + http-errors "1.8.1" + iconv-lite "0.4.24" + unpipe "1.0.0" + +rc@^1.2.8: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== @@ -5784,53 +4256,10 @@ rc@^1.0.1, rc@^1.1.6, rc@^1.2.7: minimist "^1.2.0" strip-json-comments "~2.0.1" -react-is@^16.8.4: - version "16.10.1" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.10.1.tgz#0612786bf19df406502d935494f0450b40b8294f" - integrity sha512-BXUMf9sIOPXXZWqr7+c5SeOKJykyVr2u0UDzEf4LNGc6taGkQe1A9DFD07umCIXz45RLr9oAAwZbAJ0Pkknfaw== - -read-pkg-up@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" - integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA== - dependencies: - find-up "^3.0.0" - read-pkg "^3.0.0" - -read-pkg@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" - integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= - dependencies: - load-json-file "^4.0.0" - normalize-package-data "^2.3.2" - path-type "^3.0.0" - -readable-stream@^2.0.2, readable-stream@^2.0.6: - version "2.3.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" - integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readable-stream@^2.3.7: - version "2.3.7" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" +react-is@^17.0.1: + version "17.0.2" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" + integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== readable-stream@^3.4.0, readable-stream@^3.6.0: version "3.6.0" @@ -5841,21 +4270,19 @@ readable-stream@^3.4.0, readable-stream@^3.6.0: string_decoder "^1.1.1" util-deprecate "^1.0.1" -readdirp@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== +readdirp@~3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.2.0.tgz#c30c33352b12c96dfb4b895421a49fd5a9593839" + integrity sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ== dependencies: - graceful-fs "^4.1.11" - micromatch "^3.1.10" - readable-stream "^2.0.2" + picomatch "^2.0.4" -realpath-native@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c" - integrity sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA== +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== dependencies: - util.promisify "^1.0.0" + picomatch "^2.2.1" rechoir@^0.6.2: version "0.6.2" @@ -5872,17 +4299,16 @@ redux-saga@^1.1.3: "@redux-saga/core" "^1.1.3" redux-thunk@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622" - integrity sha512-km6dclyFnmcvxhAcrQV2AkZmPQjzPDjgVlQtR0EQjxZPyJ0BnMf3in1ryuR8A2qU0HldVRfxYXbFSKlI3N7Slw== + version "2.4.1" + resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.4.1.tgz#0dd8042cf47868f4b29699941de03c9301a75714" + integrity sha512-OOYGNY5Jy2TWvTL1KgAlVy6dcx3siPJ1wTq741EPyUKfn6W6nChdICjZwCd0p8AZBs5kWpZlbkXW2nE/zjUa+Q== redux@^4.0.4, redux@^4.0.5: - version "4.0.5" - resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.5.tgz#4db5de5816e17891de8a80c424232d06f051d93f" - integrity sha512-VSz1uMAH24DM6MF72vcojpYPtrTUu3ByVWfPL1nPfVRb5mZVTve5GnNCUV53QM/BZ66xfWrm0CTWoM+Xlz8V1w== + version "4.1.2" + resolved "https://registry.yarnpkg.com/redux/-/redux-4.1.2.tgz#140f35426d99bb4729af760afcf79eaaac407104" + integrity sha512-SH8PglcebESbd/shgf6mii6EIoRM0zrQyjcuQ+ojmfxjTtE0z9Y8pa62iA/OJ58qjP6j27uyW4kUF4jl/jd6sw== dependencies: - loose-envify "^1.4.0" - symbol-observable "^1.2.0" + "@babel/runtime" "^7.9.2" regenerator-runtime@^0.11.0: version "0.11.1" @@ -5890,59 +4316,28 @@ regenerator-runtime@^0.11.0: integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== regenerator-runtime@^0.13.4: - version "0.13.7" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" - integrity sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew== + version "0.13.9" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" + integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== +regexpp@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== + +registry-auth-token@^4.0.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-4.2.1.tgz#6d7b4006441918972ccd5fedcd41dc322c79b250" + integrity sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw== dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" + rc "^1.2.8" -regexpp@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" - integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== - -registry-auth-token@^3.0.1: - version "3.4.0" - resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.4.0.tgz#d7446815433f5d5ed6431cd5dca21048f66b397e" - integrity sha512-4LM6Fw8eBQdwMYcES4yTnn2TqIasbXuwDx3um+QRs7S55aMKCBKBxvPXl2RiUjHwuJLTyYfxSpmfSAjQpcuP+A== +registry-url@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-5.1.0.tgz#e98334b50d5434b81136b44ec638d9c2009c5009" + integrity sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw== dependencies: - rc "^1.1.6" - safe-buffer "^5.0.1" - -registry-url@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-3.1.0.tgz#3d4ef870f73dde1d77f0cf9a381432444e174942" - integrity sha1-PU74cPc93h138M+aOBQyRE4XSUI= - dependencies: - rc "^1.0.1" - -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= - -repeat-element@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" - integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== - -repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= - -request-promise-core@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.2.tgz#339f6aababcafdb31c799ff158700336301d3346" - integrity sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag== - dependencies: - lodash "^4.17.11" + rc "^1.2.8" request-promise-core@1.1.4: version "1.1.4" @@ -5951,15 +4346,6 @@ request-promise-core@1.1.4: dependencies: lodash "^4.17.19" -request-promise-native@^1.0.5: - version "1.0.7" - resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.7.tgz#a49868a624bdea5069f1251d0a836e0d89aa2c59" - integrity sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w== - dependencies: - request-promise-core "1.1.2" - stealthy-require "^1.1.1" - tough-cookie "^2.3.3" - request-promise@^4.2.6: version "4.2.6" resolved "https://registry.yarnpkg.com/request-promise/-/request-promise-4.2.6.tgz#7e7e5b9578630e6f598e3813c0f8eb342a27f0a2" @@ -5970,7 +4356,7 @@ request-promise@^4.2.6: stealthy-require "^1.1.1" tough-cookie "^2.3.3" -request@^2.87.0, request@^2.88.2: +request@^2.88.2: version "2.88.2" resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== @@ -6006,38 +4392,17 @@ require-main-filename@^2.0.0: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== -resolve-cwd@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" - integrity sha1-AKn3OHVW4nA46uIyyqNypqWbZlo= - dependencies: - resolve-from "^3.0.0" - -resolve-from@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" - integrity sha1-six699nWiBvItuZTM17rywoYh0g= - resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= - -resolve@1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" - integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= - -resolve@^1.1.6, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.3.2: - version "1.12.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6" - integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w== +resolve@^1.1.6, resolve@^1.12.0: + version "1.20.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" + integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== dependencies: + is-core-module "^2.2.0" path-parse "^1.0.6" response-time@^2.3.2: @@ -6048,6 +4413,13 @@ response-time@^2.3.2: depd "~1.1.0" on-headers "~1.0.1" +responselike@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" + integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec= + dependencies: + lowercase-keys "^1.0.0" + restore-cursor@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" @@ -6056,24 +4428,15 @@ restore-cursor@^3.1.0: onetime "^5.1.0" signal-exit "^3.0.2" -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rimraf@2.6.3: - version "2.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== - dependencies: - glob "^7.1.3" - -rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.3: - version "2.7.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" - integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== - dependencies: - glob "^7.1.3" +rfdc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" + integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== rimraf@^3.0.2: version "3.0.2" @@ -6090,84 +4453,45 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -rsvp@^4.8.4: - version "4.8.5" - resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" - integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== - -run-async@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" - integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== dependencies: - is-promise "^2.1.0" + queue-microtask "^1.2.2" -rxjs@^6.3.3: - version "6.5.5" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.5.tgz#c5c884e3094c8cfee31bf27eb87e54ccfc87f9ec" - integrity sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ== +rxjs@^7.4.0: + version "7.4.0" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.4.0.tgz#a12a44d7eebf016f5ff2441b87f28c9a51cebc68" + integrity sha512-7SQDi7xeTMCJpqViXh8gL/lebcwlp3d831F05+9B44A4B0WfsEwUQHR64gsH1kvJ+Ep/J9K2+n1hVl1CsGN23w== dependencies: - tslib "^1.9.0" + tslib "~2.1.0" -rxjs@^6.4.0: - version "6.5.3" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.3.tgz#510e26317f4db91a7eb1de77d9dd9ba0a4899a3a" - integrity sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA== - dependencies: - tslib "^1.9.0" - -safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: +safe-buffer@5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" - integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== - -safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: +safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= - dependencies: - ret "~0.1.10" +safe-stable-stringify@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-1.1.1.tgz#c8a220ab525cd94e60ebf47ddc404d610dc5d84a" + integrity sha512-ERq4hUjKDbJfE4+XtZLFPCDi8Vb1JqaxAPTxWFLBx8XcAlf9Bda/ZJdVezs/NAfsMQScyIlUMx+Yeu7P7rx5jw== safe@^0.4.5: - version "0.4.6" - resolved "https://registry.yarnpkg.com/safe/-/safe-0.4.6.tgz#1d5580cf2635c5cb940ea48fb5081ae3c25b1be1" - integrity sha1-HVWAzyY1xcuUDqSPtQga48JbG+E= + version "0.4.7" + resolved "https://registry.yarnpkg.com/safe/-/safe-0.4.7.tgz#97355985a6be13f24b53b44e1ee42ba708c225f0" + integrity sha512-zmEbKfM7YmdRtHj95dK8mdLNwwsYMq+JUSLwHDKC7Ikbu4COEhEPTuFPswwIj4g6acr18/uasBTBlU/YTyhKbg== "safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -sane@^4.0.3: - version "4.1.0" - resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" - integrity sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA== - dependencies: - "@cnakazawa/watch" "^1.0.3" - anymatch "^2.0.0" - capture-exit "^2.0.0" - exec-sh "^0.3.2" - execa "^1.0.0" - fb-watchman "^2.0.0" - micromatch "^3.1.4" - minimist "^1.1.1" - walker "~1.0.5" - -sax@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" - integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== - secp256k1@3.7.1: version "3.7.1" resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-3.7.1.tgz#12e473e0e9a7c2f2d4d4818e722ad0e14cc1e2f1" @@ -6187,33 +4511,35 @@ semver-compare@^1.0.0: resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= -semver-diff@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" - integrity sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY= +semver-diff@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-3.1.1.tgz#05f77ce59f325e00e2706afd67bb506ddb1ca32b" + integrity sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg== dependencies: - semver "^5.0.3" + semver "^6.3.0" -semver-regex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-2.0.0.tgz#a93c2c5844539a770233379107b38c7b4ac9d338" - integrity sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw== +semver-regex@^3.1.2: + version "3.1.3" + resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-3.1.3.tgz#b2bcc6f97f63269f286994e297e229b6245d0dc3" + integrity sha512-Aqi54Mk9uYTjVexLnR67rTyBusmwd04cLkHy9hNvk3+G3nT2Oyg7E0l4XVbOaNwIvQ3hHeYxGcyEy+mKreyBFQ== -"semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0: +semver@^5.6.0, semver@^5.7.0, semver@^5.7.1: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" - integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA== - -semver@^6.0.0, semver@^6.1.2, semver@^6.2.0: +semver@^6.0.0, semver@^6.2.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^7.3.4: + version "7.3.5" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" + integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== + dependencies: + lru-cache "^6.0.0" + send@0.17.1: version "0.17.1" resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" @@ -6233,6 +4559,13 @@ send@0.17.1: range-parser "~1.2.1" statuses "~1.5.0" +serialize-javascript@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== + dependencies: + randombytes "^2.1.0" + serve-static@1.14.1: version "1.14.1" resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" @@ -6243,26 +4576,21 @@ serve-static@1.14.1: parseurl "~1.3.3" send "0.17.1" -set-blocking@^2.0.0, set-blocking@~2.0.0: +set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= -set-value@^2.0.0, set-value@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" - integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - setprototypeof@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== +setprototypeof@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== + sha.js@^2.4.0, sha.js@^2.4.8: version "2.4.11" resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" @@ -6271,13 +4599,6 @@ sha.js@^2.4.0, sha.js@^2.4.8: inherits "^2.0.1" safe-buffer "^5.0.1" -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= - dependencies: - shebang-regex "^1.0.0" - shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -6285,34 +4606,24 @@ shebang-command@^2.0.0: dependencies: shebang-regex "^3.0.0" -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= - shebang-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== shelljs@^0.8.2: - version "0.8.3" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.3.tgz#a7f3319520ebf09ee81275b2368adb286659b097" - integrity sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A== + version "0.8.4" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2" + integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ== dependencies: glob "^7.0.0" interpret "^1.0.0" rechoir "^0.6.2" -shellwords@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" - integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== - -shock-common@^34.0.0: - version "34.0.0" - resolved "https://registry.yarnpkg.com/shock-common/-/shock-common-34.0.0.tgz#30ffbcb136af9bc04b936999a7eebee4e18c67f0" - integrity sha512-i+io2YBh/GLXBz4YURdxg0t//gm2H3dmpkdU8gnEVe7i/ZdabYGhyBgEnUOMy1ZTMunvv/20U8wan9W4VrOaVQ== +shock-common@^37.0.0: + version "37.0.0" + resolved "https://registry.yarnpkg.com/shock-common/-/shock-common-37.0.0.tgz#936ddb1e8ca94bb2b877d46f707fdcbdf9187071" + integrity sha512-Yr/iY3TPcZy4kEPcxafMx8dRCKpHqmz4yNUUtV3/eM2mJ38JW0MwQ7gHNngsIRL7wSrudUMwkt8NTDft8NoExw== dependencies: immer "^6.0.6" lodash "^4.17.19" @@ -6322,10 +4633,19 @@ shock-common@^34.0.0: redux-thunk "^2.3.0" uuid "3.x.x" -signal-exit@^3.0.0, signal-exit@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= +side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" + +signal-exit@^3.0.2: + version "3.0.6" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.6.tgz#24e630c4b0f03fea446a2bd299e62b4a6ca8d0af" + integrity sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ== simple-swizzle@^0.2.2: version "0.2.2" @@ -6334,30 +4654,11 @@ simple-swizzle@^0.2.2: dependencies: is-arrayish "^0.3.1" -sisteransi@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.3.tgz#98168d62b79e3a5e758e27ae63c4a053d748f4eb" - integrity sha512-SbEG75TzH8G7eVXFSN5f9EExILKfly7SUvVY5DhhYLvfhKqhDFY0OzevWa/zwak0RLRfWS5AvfMWpd9gJvr5Yg== - -slash@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" - integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== - slash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slice-ansi@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" - integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== - dependencies: - ansi-styles "^3.2.0" - astral-regex "^1.0.0" - is-fullwidth-code-point "^2.0.0" - slice-ansi@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-3.0.0.tgz#31ddc10930a1b7e0b67b08c96c2f49b77a789787" @@ -6376,36 +4677,6 @@ slice-ansi@^4.0.0: astral-regex "^2.0.0" is-fullwidth-code-point "^3.0.0" -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - socket.io-adapter@~2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-2.2.0.tgz#43af9157c4609e74b8addc6867873ac7eb48fda2" @@ -6443,81 +4714,24 @@ socket.io@4.0.1: socket.io-adapter "~2.2.0" socket.io-parser "~4.0.3" -source-map-resolve@^0.5.0: - version "0.5.2" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" - integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== - dependencies: - atob "^2.1.1" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - source-map-support@^0.5.17: - version "0.5.19" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" - integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" -source-map-support@^0.5.6: - version "0.5.13" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" - integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map-url@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" - integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= - -source-map@^0.5.0, source-map@^0.5.6: +source-map@^0.5.0: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= -source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: +source-map@^0.6.0: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -spdx-correct@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" - integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - -spdx-exceptions@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" - integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== - -spdx-expression-parse@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" - integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.5" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz#3694b5804567a458d3c8045842a6358632f62654" - integrity sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q== - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" - sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -6543,18 +4757,12 @@ stack-trace@0.0.x: resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA= -stack-utils@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8" - integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA== - -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= +stack-utils@^2.0.3: + version "2.0.5" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5" + integrity sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA== dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" + escape-string-regexp "^2.0.0" "statuses@>= 1.5.0 < 2", statuses@~1.5.0: version "1.5.0" @@ -6571,24 +4779,7 @@ string-argv@0.3.1: resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg== -string-length@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" - integrity sha1-1A27aGo6zpYMHP/KVivyxF+DY+0= - dependencies: - astral-regex "^1.0.0" - strip-ansi "^4.0.0" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1: +"string-width@^1.0.2 || 2": version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== @@ -6605,39 +4796,30 @@ string-width@^3.0.0, string-width@^3.1.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" -string-width@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.1.0.tgz#ba846d1daa97c3c596155308063e075ed1c99aff" - integrity sha512-NrX+1dVVh+6Y9dnQ19pR0pP4FiEIlUvdTGn8pw6CKTNq5sgib2nIhmUNT5TAmhWmvKr3WcxBcP3E8nWezuipuQ== +string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== dependencies: emoji-regex "^8.0.0" is-fullwidth-code-point "^3.0.0" - strip-ansi "^5.2.0" + strip-ansi "^6.0.1" -string-width@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" - integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.0" - -string.prototype.trimleft@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz#6cc47f0d7eb8d62b0f3701611715a3954591d634" - integrity sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw== +string.prototype.trimend@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" + integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== dependencies: + call-bind "^1.0.2" define-properties "^1.1.3" - function-bind "^1.1.1" -string.prototype.trimright@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz#669d164be9df9b6f7559fa8e89945b168a5a6c58" - integrity sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg== +string.prototype.trimstart@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" + integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== dependencies: + call-bind "^1.0.2" define-properties "^1.1.3" - function-bind "^1.1.1" string_decoder@^1.1.1: version "1.3.0" @@ -6646,13 +4828,6 @@ string_decoder@^1.1.1: dependencies: safe-buffer "~5.2.0" -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - stringify-object@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" @@ -6662,7 +4837,7 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -strip-ansi@^3.0.0, strip-ansi@^3.0.1: +strip-ansi@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= @@ -6683,132 +4858,66 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" - integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: - ansi-regex "^5.0.0" - -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= - -strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= + ansi-regex "^5.0.1" strip-final-newline@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== -strip-json-comments@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.0.1.tgz#85713975a91fb87bf1b305cca77395e40d2a64a7" - integrity sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw== - -strip-json-comments@~2.0.1: +strip-json-comments@2.0.1, strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= +strip-json-comments@3.1.1, strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +supports-color@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.0.0.tgz#76cfe742cf1f41bb9b1c29ad03068c05b4c0e40a" + integrity sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg== + dependencies: + has-flag "^3.0.0" + +supports-color@8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= -supports-color@^5.2.0, supports-color@^5.3.0: +supports-color@^5.3.0, supports-color@^5.5.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== dependencies: has-flag "^3.0.0" -supports-color@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" - integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== - dependencies: - has-flag "^3.0.0" - supports-color@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1" - integrity sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g== + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== dependencies: has-flag "^4.0.0" -symbol-observable@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" - integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== - -symbol-tree@^3.2.2: - version "3.2.4" - resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" - integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== - -table@^5.2.3: - version "5.4.6" - resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" - integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== - dependencies: - ajv "^6.10.2" - lodash "^4.17.14" - slice-ansi "^2.1.0" - string-width "^3.0.0" - -tar@^4: - version "4.4.10" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.10.tgz#946b2810b9a5e0b26140cf78bea6b0b0d689eba1" - integrity sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA== - dependencies: - chownr "^1.1.1" - fs-minipass "^1.2.5" - minipass "^2.3.5" - minizlib "^1.2.1" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.3" - -tar@^4.4.2: - version "4.4.13" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" - integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA== - dependencies: - chownr "^1.1.1" - fs-minipass "^1.2.5" - minipass "^2.8.6" - minizlib "^1.2.1" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.3" - temp@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/temp/-/temp-0.4.0.tgz#671ad63d57be0fe9d7294664b3fc400636678a60" integrity sha1-ZxrWPVe+D+nXKUZks/xABjZnimA= -term-size@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/term-size/-/term-size-1.2.0.tgz#458b83887f288fc56d6fffbfad262e26638efa69" - integrity sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk= - dependencies: - execa "^0.7.0" - -test-exclude@^5.2.3: - version "5.2.3" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0" - integrity sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g== - dependencies: - glob "^7.1.3" - minimatch "^3.0.4" - read-pkg-up "^4.0.0" - require-main-filename "^2.0.0" - text-encoding@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.7.0.tgz#f895e836e45990624086601798ea98e8f36ee643" @@ -6824,21 +4933,11 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= -throat@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" - integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo= - -through@^2.3.6, through@^2.3.8: +through@^2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= -timed-out@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" - integrity sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8= - tingodb@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/tingodb/-/tingodb-0.6.1.tgz#f63336259af7dfa6c90dfe2556a0dfb0d4eede59" @@ -6850,18 +4949,6 @@ tingodb@^0.6.1: optionalDependencies: bson "^1.0.4" -tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" - -tmpl@1.0.x: - version "1.0.4" - resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" - integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= - to-fast-properties@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" @@ -6872,20 +4959,10 @@ to-fast-properties@^2.0.0: resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" +to-readable-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771" + integrity sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q== to-regex-range@^5.0.1: version "5.0.1" @@ -6894,21 +4971,16 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - toidentifier@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== +toidentifier@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" + integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== + touch@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b" @@ -6916,7 +4988,7 @@ touch@^3.1.0: dependencies: nopt "~1.0.10" -tough-cookie@^2.3.3, tough-cookie@^2.3.4, tough-cookie@~2.5.0: +tough-cookie@^2.3.3, tough-cookie@~2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== @@ -6924,12 +4996,10 @@ tough-cookie@^2.3.3, tough-cookie@^2.3.4, tough-cookie@~2.5.0: psl "^1.1.28" punycode "^2.1.1" -tr46@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" - integrity sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk= - dependencies: - punycode "^2.1.0" +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= triple-beam@^1.2.0, triple-beam@^1.3.0: version "1.3.0" @@ -6948,33 +5018,24 @@ ts-node@^9.1.1: source-map-support "^0.5.17" yn "3.1.1" -ts-toolbelt@^6.6.2: - version "6.7.7" - resolved "https://registry.yarnpkg.com/ts-toolbelt/-/ts-toolbelt-6.7.7.tgz#4d7f34cafd519bf0f1d6da5a4b07889db6ba0184" - integrity sha512-GrgXML3KOnYymiyFNEohhizPtO+ZgTwEN9oIR+SvP6EPP5cj4qH1Xi5CU4iobgMUNYMEVhXqnBLY1tSonXwE+g== - -ts-type@^1.2.16: - version "1.2.16" - resolved "https://registry.yarnpkg.com/ts-type/-/ts-type-1.2.16.tgz#32f1bb1415cf05221689805f4f170087e44ec005" - integrity sha512-cCX7SvNzUHewUbIrzdbQsrOubB55bszwksFNcWOQkd6LwkFqn1wts0iTpW+hMsSX6UIbPcsMJOC4WRmZMStExg== +ts-type@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ts-type/-/ts-type-3.0.1.tgz#b52e7623065e0beb43c77c426347d85cf81dff84" + integrity sha512-cleRydCkBGBFQ4KAvLH0ARIkciduS745prkGVVxPGvcRGhMMoSJUB7gNR1ByKhFTEYrYRg2CsMRGYnqp+6op+g== dependencies: - ts-toolbelt "^6.6.2" + "@types/node" "*" + tslib ">=2" typedarray-dts "^1.0.0" -tslib@^1.10.0, tslib@^1.9.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" - integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== +tslib@>=2, tslib@^2.0.0, tslib@^2.3.0, tslib@^2.3.1: + version "2.4.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" + integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== -tslib@^1.11.1, tslib@^1.11.2: - version "1.13.0" - resolved "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043" - integrity sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q== - -tslib@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/tslib/-/tslib-2.0.0.tgz#18d13fc2dce04051e20f074cc8387fd8089ce4f3" - integrity sha512-lTqkx847PI7xEDYJntxZH89L2/aXInsyF2luSafe/+0fHOMjlBNXdH6th7f70qxLDhul7KZK0zC8V5ZIyHl0/g== +tslib@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a" + integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A== tunnel-agent@^0.6.0: version "0.6.0" @@ -6988,22 +5049,22 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0: resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== dependencies: - prelude-ls "~1.1.2" + prelude-ls "^1.2.1" -type-fest@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" - integrity sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ== +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== -type-fest@^0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.5.2.tgz#d6ef42a0356c6cd45f49485c3b6281fc148e48a2" - integrity sha512-DWkS49EQKVX//Tbupb9TFa19c7+MK1XmzkrZUR8TAktmE/DizXoaoJV6TZ/tSIPXipqNiRI6CyAe7x69Jb6RSw== +type-fest@^0.21.3: + version "0.21.3" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== type-is@~1.6.17, type-is@~1.6.18: version "1.6.18" @@ -7018,6 +5079,13 @@ typedarray-dts@^1.0.0: resolved "https://registry.yarnpkg.com/typedarray-dts/-/typedarray-dts-1.0.0.tgz#9dec9811386dbfba964c295c2606cf9a6b982d06" integrity sha512-Ka0DBegjuV9IPYFT1h0Qqk5U4pccebNIJCGl8C5uU7xtOs+jpJvKGAY4fHGK25hTmXZOEUl9Cnsg5cS6K/b5DA== +typedarray-to-buffer@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" + integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== + dependencies: + is-typedarray "^1.0.0" + typescript-compare@^0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/typescript-compare/-/typescript-compare-0.0.2.tgz#7ee40a400a406c2ea0a7e551efd3309021d5f425" @@ -7037,15 +5105,10 @@ typescript-tuple@^2.2.1: dependencies: typescript-compare "^0.0.2" -typescript@latest: - version "4.1.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.5.tgz#123a3b214aaff3be32926f0d8f1f6e704eb89a72" - integrity sha512-6OSu9PTIzmn9TCDiovULTnET6BgXtDYL4Gg4szY+cGsc3JP1dQL8qvE8kShTRx1NIw4Q9IBHlwODjkjWEtMUyA== - -uglify-js@^3.1.4: - version "3.10.2" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.10.2.tgz#8cfa1209fd04199cc8a7f9930ddedb30b0f1912d" - integrity sha512-GXCYNwqoo0MbLARghYjxVBxDCnU0tLqN7IPLdHHbibCb1NI5zBkU2EPcy/GaVxc0BtTjqyGXJCINe6JMR2Dpow== +typescript@^4.5.4: + version "4.5.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.4.tgz#a17d3a0263bf5c8723b9c52f43c5084edf13c2e8" + integrity sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg== uid-safe@~2.1.5: version "2.1.5" @@ -7054,106 +5117,77 @@ uid-safe@~2.1.5: dependencies: random-bytes "~1.0.0" -undefsafe@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.2.tgz#225f6b9e0337663e0d8e7cfd686fc2836ccace76" - integrity sha1-Il9rngM3Zj4Njnz9aG/Cg2zKznY= - dependencies: - debug "^2.2.0" - -union-value@^1.0.0: +unbox-primitive@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" - integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471" + integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw== dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^2.0.1" + function-bind "^1.1.1" + has-bigints "^1.0.1" + has-symbols "^1.0.2" + which-boxed-primitive "^1.0.2" -unique-string@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-1.0.0.tgz#9e1057cca851abb93398f8b33ae187b99caec11a" - integrity sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo= +undefsafe@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.5.tgz#38733b9327bdcd226db889fb723a6efd162e6e2c" + integrity sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA== + +unique-string@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-2.0.0.tgz#39c6451f81afb2749de2b233e3f7c5e8843bd89d" + integrity sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg== dependencies: - crypto-random-string "^1.0.0" + crypto-random-string "^2.0.0" + +universalify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" + integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= +update-notifier@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-5.1.0.tgz#4ab0d7c7f36a231dd7316cf7729313f0214d9ad9" + integrity sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw== dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -unzip-response@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" - integrity sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c= - -upath@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894" - integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg== - -update-notifier@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.5.0.tgz#d0744593e13f161e406acb1d9408b72cad08aff6" - integrity sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw== - dependencies: - boxen "^1.2.1" - chalk "^2.0.1" - configstore "^3.0.0" + boxen "^5.0.0" + chalk "^4.1.0" + configstore "^5.0.1" + has-yarn "^2.1.0" import-lazy "^2.1.0" - is-ci "^1.0.10" - is-installed-globally "^0.1.0" - is-npm "^1.0.0" - latest-version "^3.0.0" - semver-diff "^2.0.0" - xdg-basedir "^3.0.0" + is-ci "^2.0.0" + is-installed-globally "^0.4.0" + is-npm "^5.0.0" + is-yarn-global "^0.3.0" + latest-version "^5.1.0" + pupa "^2.1.1" + semver "^7.3.4" + semver-diff "^3.1.1" + xdg-basedir "^4.0.0" uri-js@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" - integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== dependencies: punycode "^2.1.0" -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= - -url-parse-lax@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" - integrity sha1-evjzA2Rem9eaJy56FKxovAYJ2nM= +url-parse-lax@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" + integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww= dependencies: - prepend-http "^1.0.1" + prepend-http "^2.0.0" -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - -util-deprecate@^1.0.1, util-deprecate@~1.0.1: +util-deprecate@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= -util.promisify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" - integrity sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA== - dependencies: - define-properties "^1.1.2" - object.getownpropertydescriptors "^2.0.3" - utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" @@ -7164,24 +5198,6 @@ uuid@3.x.x, uuid@^3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== -uuid@^7.0.2: - version "7.0.3" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-7.0.3.tgz#c5c9f2c8cf25dc0a372c4df1441c41f5bd0c680b" - integrity sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg== - -v8-compile-cache@^2.0.3: - version "2.1.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e" - integrity sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g== - -validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - vary@^1, vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" @@ -7196,77 +5212,50 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -w3c-hr-time@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" - integrity sha1-gqwr/2PZUOqeMYmlimViX+3xkEU= - dependencies: - browser-process-hrtime "^0.1.2" - walkdir@^0.4.0: version "0.4.1" resolved "https://registry.yarnpkg.com/walkdir/-/walkdir-0.4.1.tgz#dc119f83f4421df52e3061e514228a2db20afa39" integrity sha512-3eBwRyEln6E1MSzcxcVpQIhRG8Q1jLvEqRmCZqS3dsfXEDR/AhOF4d+jHg1qvDCpYaVRZjENPQyrVxAkQqxPgQ== -walker@^1.0.7, walker@~1.0.5: - version "1.0.7" - resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" - integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= +web-streams-polyfill@^3.0.3: + version "3.2.1" + resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz#71c2718c52b45fd49dbeee88634b3a60ceab42a6" + integrity sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q== + +webcrypto-core@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/webcrypto-core/-/webcrypto-core-1.4.0.tgz#9a395920792bcfa4605dc64aaf264156f79e873e" + integrity sha512-HY3Zo0GcRIQUUDnlZ/shGjN+4f7LVMkdJZoGPog+oHhJsJdMz6iM8Za5xZ0t6qg7Fx/JXXz+oBv2J2p982hGTQ== dependencies: - makeerror "1.0.x" + "@peculiar/asn1-schema" "^2.0.44" + "@peculiar/json-schema" "^1.1.12" + asn1js "^2.1.1" + pvtsutils "^1.2.0" + tslib "^2.3.1" -wcwidth@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" - integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g= +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= + +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= dependencies: - defaults "^1.0.3" + tr46 "~0.0.3" + webidl-conversions "^3.0.0" -webcrypto-core@^1.1.2: - version "1.1.2" - resolved "https://registry.npmjs.org/webcrypto-core/-/webcrypto-core-1.1.2.tgz#c522a9e5596688f2b6bb19e2d336f68efa8bdd57" - integrity sha512-LxM/dTcXr/ZnwwKLox0tGEOIqvP7KIJ4Hk/fFPX20tr1EgqTmpEFZinmu4FzoGVbs6e4jI1priQKCDrOBD3L6w== +which-boxed-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== dependencies: - "@peculiar/asn1-schema" "^2.0.1" - "@peculiar/json-schema" "^1.1.10" - asn1js "^2.0.26" - pvtsutils "^1.0.10" - tslib "^1.11.2" - -webidl-conversions@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" - integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== - -whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: - version "1.0.5" - resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" - integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== - dependencies: - iconv-lite "0.4.24" - -whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" - integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== - -whatwg-url@^6.4.1: - version "6.5.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" - integrity sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ== - dependencies: - lodash.sortby "^4.7.0" - tr46 "^1.0.1" - webidl-conversions "^4.0.2" - -whatwg-url@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd" - integrity sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ== - dependencies: - lodash.sortby "^4.7.0" - tr46 "^1.0.1" - webidl-conversions "^4.0.2" + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" which-module@^2.0.0: version "2.0.0" @@ -7278,55 +5267,51 @@ which-pm-runs@^1.0.0: resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.0.0.tgz#670b3afbc552e0b55df6b7780ca74615f23ad1cb" integrity sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs= -which@^1.2.9, which@^1.3.0: +which@1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== dependencies: isexe "^2.0.0" -which@^2.0.1: +which@2.0.2, which@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== dependencies: isexe "^2.0.0" -wide-align@^1.1.0: +wide-align@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== dependencies: string-width "^1.0.2 || 2" -widest-line@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-2.0.1.tgz#7438764730ec7ef4381ce4df82fb98a53142a3fc" - integrity sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA== +widest-line@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" + integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg== dependencies: - string-width "^2.1.1" - -window-size@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= + string-width "^4.0.0" winston-daily-rotate-file@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/winston-daily-rotate-file/-/winston-daily-rotate-file-4.5.0.tgz#3914ac57c4bdae1138170bec85af0c2217b253b1" - integrity sha512-/HqeWiU48dzGqcrABRlxYWVMdL6l3uKCtFSJyrqK+E2rLnSFNsgYpvwx15EgTitBLNzH69lQd/+z2ASryV2aqw== + version "4.5.5" + resolved "https://registry.yarnpkg.com/winston-daily-rotate-file/-/winston-daily-rotate-file-4.5.5.tgz#cfa3a89f4eb0e4126917592b375759b772bcd972" + integrity sha512-ds0WahIjiDhKCiMXmY799pDBW+58ByqIBtUcsqr4oDoXrAI3Zn+hbgFdUxzMfqA93OG0mPLYVMiotqTgE/WeWQ== dependencies: file-stream-rotator "^0.5.7" object-hash "^2.0.1" triple-beam "^1.3.0" - winston-transport "^4.2.0" + winston-transport "^4.4.0" -winston-transport@^4.2.0, winston-transport@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/winston-transport/-/winston-transport-4.4.0.tgz#17af518daa690d5b2ecccaa7acf7b20ca7925e59" - integrity sha512-Lc7/p3GtqtqPBYYtS6KCN3c77/2QCev51DvcJKbkFPQNoj1sinkGwLGFDxkXY9J6p9+EPnYs+D90uwbnaiURTw== +winston-transport@^4.4.0: + version "4.4.1" + resolved "https://registry.yarnpkg.com/winston-transport/-/winston-transport-4.4.1.tgz#42a830e07363719c13c12bd2fb87a226f692dc75" + integrity sha512-ciZRlU4CSjHqHe8RQG1iPxKMRVwv6ZJ0RC7DxStKWd0KjpAhPDy5gVYSCpIUq+5CUsP+IyNOTZy1X0tO2QZqjg== dependencies: - readable-stream "^2.3.7" + logform "^2.2.0" + readable-stream "^3.4.0" triple-beam "^1.2.0" winston@^3.3.3: @@ -7344,18 +5329,15 @@ winston@^3.3.3: triple-beam "^1.3.0" winston-transport "^4.4.0" -wordwrap@^1.0.0, wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= +word-wrap@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" +workerpool@6.1.5: + version "6.1.5" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.1.5.tgz#0f7cf076b6215fd7e1da903ff6f22ddd1886b581" + integrity sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw== wrap-ansi@^5.1.0: version "5.1.0" @@ -7375,94 +5357,66 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -write-file-atomic@2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.1.tgz#d0b05463c188ae804396fd5ab2a370062af87529" - integrity sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg== +write-file-atomic@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" + integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== dependencies: - graceful-fs "^4.1.11" imurmurhash "^0.1.4" + is-typedarray "^1.0.0" signal-exit "^3.0.2" - -write-file-atomic@^2.0.0: - version "2.4.3" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.3.tgz#1fd2e9ae1df3e75b8d8c367443c692d4ca81f481" - integrity sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ== - dependencies: - graceful-fs "^4.1.11" - imurmurhash "^0.1.4" - signal-exit "^3.0.2" - -write@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" - integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== - dependencies: - mkdirp "^0.5.1" - -ws@^5.2.0: - version "5.2.2" - resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" - integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== - dependencies: - async-limiter "~1.0.0" + typedarray-to-buffer "^3.1.5" ws@^7.2.1: - version "7.3.1" - resolved "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz#d0547bf67f7ce4f12a72dfe31262c68d7dc551c8" - integrity sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA== + version "7.5.6" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.6.tgz#e59fc509fb15ddfb65487ee9765c5a51dec5fe7b" + integrity sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA== ws@~7.4.2: - version "7.4.4" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.4.tgz#383bc9742cb202292c9077ceab6f6047b17f2d59" - integrity sha512-Qm8k8ojNQIMx7S+Zp8u/uHOx7Qazv3Yv4q68MiWWWOJhiwG5W3x7iqmRtJo8xxrciZUY4vRxUTJCKuRnF28ZZw== + version "7.4.6" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" + integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== -xdg-basedir@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" - integrity sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ= - -xml-name-validator@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" - integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== - -y18n@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.2.tgz#85c901bd6470ce71fc4bb723ad209b70f7f28696" - integrity sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ== +xdg-basedir@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13" + integrity sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q== y18n@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" - integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== + version "4.0.3" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" + integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= - -yallist@^3.0.0, yallist@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" - integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== yallist@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yaml@^1.7.2: - version "1.10.0" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.0.tgz#3b593add944876077d4d683fee01081bd9fff31e" - integrity sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg== +yaml@^1.10.0: + version "1.10.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" + integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== -yargs-parser@^13.1.1: +yargs-parser@13.1.2, yargs-parser@^13.1.1, yargs-parser@^13.1.2: version "13.1.2" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== @@ -7470,7 +5424,36 @@ yargs-parser@^13.1.1: camelcase "^5.0.0" decamelize "^1.2.0" -yargs@13.3.0, yargs@^13.3.0: +yargs-parser@20.2.4: + version "20.2.4" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + +yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + +yargs-unparser@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.6.0.tgz#ef25c2c769ff6bd09e4b0f9d7c605fb27846ea9f" + integrity sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw== + dependencies: + flat "^4.1.0" + lodash "^4.17.15" + yargs "^13.3.0" + +yargs-unparser@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" + integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== + dependencies: + camelcase "^6.0.0" + decamelize "^4.0.0" + flat "^5.0.2" + is-plain-obj "^2.1.0" + +yargs@13.3.0: version "13.3.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.0.tgz#4c657a55e07e5f2cf947f8a366567c04a0dedc83" integrity sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA== @@ -7486,20 +5469,41 @@ yargs@13.3.0, yargs@^13.3.0: y18n "^4.0.0" yargs-parser "^13.1.1" -yargs@^3.10.0: - version "3.32.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" - integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= +yargs@13.3.2, yargs@^13.3.0: + version "13.3.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" + integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" + cliui "^5.0.0" + find-up "^3.0.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^3.0.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^13.1.2" + +yargs@16.2.0, yargs@^16.1.1: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" yn@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==