From 715943ec77b3501ff42b1a045c1ad2c8628ffb96 Mon Sep 17 00:00:00 2001 From: Ladd Hoffman Date: Mon, 7 Nov 2022 17:44:57 -0600 Subject: [PATCH] Work in progress: prototyping forum network --- README.md | 93 +- forum-network/.eslintrc.js | 15 + forum-network/.gitignore | 3 + forum-network/package-lock.json | 1404 +++++++++++++++++ forum-network/package.json | 17 + forum-network/public/classes/actor.js | 53 + forum-network/public/classes/blockchain.js | 72 + forum-network/public/classes/crypto.js | 58 + forum-network/public/classes/display-value.js | 65 + forum-network/public/classes/forum-network.js | 14 + forum-network/public/classes/forum-node.js | 106 ++ forum-network/public/classes/forum-view.js | 122 ++ forum-network/public/classes/graph.js | 85 + forum-network/public/classes/member.js | 26 + forum-network/public/classes/message.js | 69 + forum-network/public/classes/post.js | 46 + .../public/classes/prioritized-queue.js | 24 + forum-network/public/classes/reputation.js | 3 + forum-network/public/classes/scene.js | 33 + forum-network/public/favicon.ico | Bin 0 -> 3630 bytes forum-network/public/forum-test.html | 9 + forum-network/public/forum-test.js | 40 + forum-network/public/graph-test.html | 9 + forum-network/public/graph-test.js | 23 + forum-network/public/index.css | 24 + forum-network/public/index.html | 14 + forum-network/public/index.js | 188 +++ 27 files changed, 2526 insertions(+), 89 deletions(-) create mode 100644 forum-network/.eslintrc.js create mode 100644 forum-network/.gitignore create mode 100644 forum-network/package-lock.json create mode 100644 forum-network/package.json create mode 100644 forum-network/public/classes/actor.js create mode 100644 forum-network/public/classes/blockchain.js create mode 100644 forum-network/public/classes/crypto.js create mode 100644 forum-network/public/classes/display-value.js create mode 100644 forum-network/public/classes/forum-network.js create mode 100644 forum-network/public/classes/forum-node.js create mode 100644 forum-network/public/classes/forum-view.js create mode 100644 forum-network/public/classes/graph.js create mode 100644 forum-network/public/classes/member.js create mode 100644 forum-network/public/classes/message.js create mode 100644 forum-network/public/classes/post.js create mode 100644 forum-network/public/classes/prioritized-queue.js create mode 100644 forum-network/public/classes/reputation.js create mode 100644 forum-network/public/classes/scene.js create mode 100644 forum-network/public/favicon.ico create mode 100644 forum-network/public/forum-test.html create mode 100644 forum-network/public/forum-test.js create mode 100644 forum-network/public/graph-test.html create mode 100644 forum-network/public/graph-test.js create mode 100644 forum-network/public/index.css create mode 100644 forum-network/public/index.html create mode 100644 forum-network/public/index.js diff --git a/README.md b/README.md index ea2a204..0429180 100644 --- a/README.md +++ b/README.md @@ -1,92 +1,7 @@ # Science Publishing DAO +## Subprojects - -## Getting started - -To make it easy for you to get started with GitLab, here's a list of recommended next steps. - -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! - -## Add your files - -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: - -``` -cd existing_repo -git remote add origin https://gitlab.com/dao-governance-framework/science-publishing-dao.git -git branch -M main -git push -uf origin main -``` - -## Integrate with your tools - -- [ ] [Set up project integrations](https://gitlab.com/dao-governance-framework/science-publishing-dao/-/settings/integrations) - -## Collaborate with your team - -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) - -## Test and Deploy - -Use the built-in continuous integration in GitLab. - -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) - -*** - -# Editing this README - -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template. - -## Suggestions for a good README -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. - -## Name -Choose a self-explaining name for your project. - -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. - -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. - -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. - -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. - -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. - -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. - -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. - -## Contributing -State if you are open to contributions and what your requirements are for accepting them. - -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. - -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. - -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. - -## License -For open source projects, say how it is licensed. - -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. +| Name | Description | +| --- | --- | +| [forum-network](./forum-network) | Javascript prototyping forum architecture | diff --git a/forum-network/.eslintrc.js b/forum-network/.eslintrc.js new file mode 100644 index 0000000..154c765 --- /dev/null +++ b/forum-network/.eslintrc.js @@ -0,0 +1,15 @@ +module.exports = { + env: { + browser: true, + es2021: true, + }, + extends: 'airbnb-base', + overrides: [ + ], + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + }, + rules: { + }, +}; diff --git a/forum-network/.gitignore b/forum-network/.gitignore new file mode 100644 index 0000000..9ae7f1d --- /dev/null +++ b/forum-network/.gitignore @@ -0,0 +1,3 @@ +ssl/ +node_modules/ +git/ diff --git a/forum-network/package-lock.json b/forum-network/package-lock.json new file mode 100644 index 0000000..6943bee --- /dev/null +++ b/forum-network/package-lock.json @@ -0,0 +1,1404 @@ +{ + "name": "forum-network", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@eslint/eslintrc": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", + "integrity": "sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==", + "dev": true, + "requires": { + "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" + } + }, + "@humanwhocodes/config-array": { + "version": "0.11.7", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.7.tgz", + "integrity": "sha512-kBbPWzN8oVMLb0hOUYXhmxggL/1cJE6ydvjDIGi9EnAGUyA7cLVKQg+d/Dsm+KZwx2czGHrCmMVLiyg8s5JPKw==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.5" + } + }, + "@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true + }, + "@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true + }, + "acorn": { + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", + "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "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-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "array-includes": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.5.tgz", + "integrity": "sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5", + "get-intrinsic": "^1.1.1", + "is-string": "^1.0.7" + } + }, + "array.prototype.flat": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", + "integrity": "sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0" + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "confusing-browser-globals": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz", + "integrity": "sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "define-properties": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", + "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "dev": true, + "requires": { + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + } + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "es-abstract": { + "version": "1.20.4", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.4.tgz", + "integrity": "sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "function.prototype.name": "^1.1.5", + "get-intrinsic": "^1.1.3", + "get-symbol-description": "^1.0.0", + "has": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.3", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.2", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.4.3", + "safe-regex-test": "^1.0.0", + "string.prototype.trimend": "^1.0.5", + "string.prototype.trimstart": "^1.0.5", + "unbox-primitive": "^1.0.2" + } + }, + "es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "eslint": { + "version": "8.27.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.27.0.tgz", + "integrity": "sha512-0y1bfG2ho7mty+SiILVf9PfuRA49ek4Nc60Wmmu62QlobNR+CeXa4xXIJgcuwSQgZiWaPH+5BDsctpIW0PR/wQ==", + "dev": true, + "requires": { + "@eslint/eslintrc": "^1.3.3", + "@humanwhocodes/config-array": "^0.11.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "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", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.15.0", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-sdsl": "^4.1.4", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0" + } + }, + "eslint-config-airbnb-base": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz", + "integrity": "sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==", + "dev": true, + "requires": { + "confusing-browser-globals": "^1.0.10", + "object.assign": "^4.1.2", + "object.entries": "^1.1.5", + "semver": "^6.3.0" + } + }, + "eslint-import-resolver-node": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", + "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", + "dev": true, + "requires": { + "debug": "^3.2.7", + "resolve": "^1.20.0" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "eslint-module-utils": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz", + "integrity": "sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==", + "dev": true, + "requires": { + "debug": "^3.2.7" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "eslint-plugin-import": { + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", + "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", + "dev": true, + "requires": { + "array-includes": "^3.1.4", + "array.prototype.flat": "^1.2.5", + "debug": "^2.6.9", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-module-utils": "^2.7.3", + "has": "^1.0.3", + "is-core-module": "^2.8.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.values": "^1.1.5", + "resolve": "^1.22.0", + "tsconfig-paths": "^3.14.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + } + } + }, + "eslint-scope": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + } + }, + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + } + } + }, + "eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "dev": true + }, + "espree": { + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", + "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", + "dev": true, + "requires": { + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" + } + }, + "esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + } + }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + } + }, + "flatted": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "function.prototype.name": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", + "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" + } + }, + "functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true + }, + "get-intrinsic": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", + "integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.3" + } + }, + "get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + } + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "requires": { + "is-glob": "^4.0.3" + } + }, + "globals": { + "version": "13.17.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", + "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.1" + } + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true + }, + "has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.2" + } + }, + "ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "internal-slot": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", + "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + } + }, + "is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "requires": { + "has-bigints": "^1.0.1" + } + }, + "is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true + }, + "is-core-module": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", + "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-negative-zero": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "dev": true + }, + "is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true + }, + "is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-shared-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2" + } + }, + "is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "requires": { + "has-symbols": "^1.0.2" + } + }, + "is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2" + } + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "js-sdsl": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz", + "integrity": "sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q==", + "dev": true + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "object-inspect": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", + "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + } + }, + "object.entries": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.6.tgz", + "integrity": "sha512-leTPzo4Zvg3pmbQ3rDK69Rl8GQvIqMWubrkxONG9/ojtFE2rD9fjMKfSI5BxW3osRH1m6VdzmqK8oAY9aT4x5w==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + } + }, + "object.values": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz", + "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "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" + } + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "prettier": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, + "regexp.prototype.flags": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", + "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "functions-have-names": "^1.2.2" + } + }, + "regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true + }, + "resolve": { + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "dev": true, + "requires": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + } + }, + "string.prototype.trimend": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", + "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" + } + }, + "string.prototype.trimstart": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", + "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "tsconfig-paths": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", + "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + }, + "unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + } + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "requires": { + "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" + } + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true + } + } +} diff --git a/forum-network/package.json b/forum-network/package.json new file mode 100644 index 0000000..6c518cf --- /dev/null +++ b/forum-network/package.json @@ -0,0 +1,17 @@ +{ + "name": "forum-network", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "devDependencies": { + "eslint": "^8.27.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-plugin-import": "^2.26.0", + "prettier": "^2.7.1" + } +} diff --git a/forum-network/public/classes/actor.js b/forum-network/public/classes/actor.js new file mode 100644 index 0000000..4b7aa84 --- /dev/null +++ b/forum-network/public/classes/actor.js @@ -0,0 +1,53 @@ +export class Action { + constructor(name, scene) { + this.name = name; + this.scene = scene; + } + + log(src, dest, msg, obj, symbol = '->>') { + const logObj = false; + this.scene.log( + `${src.name} ${symbol} ${dest.name} : ${this.name} ${msg ?? ''} ${ + logObj && obj ? JSON.stringify(obj) : '' + }`, + ); + } +} + +export class Actor { + constructor(name, scene) { + this.name = name; + this.scene = scene; + this.callbacks = new Map(); + this.status = this.scene.addDisplayValue(`${this.name} status`); + this.status.set('New'); + this.scene.log(`participant ${this.name}`); + } + + send(dest, action, detail) { + action.log(this, dest, detail ? JSON.stringify(detail) : ''); + dest.recv(this, action, detail); + return this; + } + + recv(src, action, detail) { + const cb = this.callbacks.get(action.name); + if (!cb) { + throw new Error( + `[${this.scene.name} actor ${this.name} does not have a callback registered for ${action.name}`, + ); + } + cb(src, detail); + return this; + } + + on(action, cb) { + this.callbacks.set(action.name, cb); + return this; + } + + setStatus(status) { + this.status.set(status); + return this; + } +} diff --git a/forum-network/public/classes/blockchain.js b/forum-network/public/classes/blockchain.js new file mode 100644 index 0000000..02655df --- /dev/null +++ b/forum-network/public/classes/blockchain.js @@ -0,0 +1,72 @@ +class Blockchain { + constructor() { + this.posts = new CollectionWithReputation(); + this.authors = new CollectionWithReputation(); + this.nodes = new CollectionWithReputation(); + } + + vote(voter, batch) { + if (!this.activeVote) { + this.activeVote = new VoteInstance(batch); + this.activeVote.vote(voter, true); + return; + } + if (this.activeVote.matches(batch)) { + this.activeVote.vote(voter, true); + } else { + this.activeVote.vote(voter, false); + } + } + + applyBatch(batch) {} +} + +class CollectionWithReputation { + constructor() { + this.collection = new Map(); + this.reputations = new Map(); + } + + set(id, value) { + this.collection.set(id, value); + } + + get(id) { + this.collection.get(id); + } + + setReputation(id, value) { + this.reputations.set(id, value); + } + + get(id) { + this.reputations.get(id); + } +} + +class VoteInstance { + constructor(content) { + this.content = content; + this.votes = new Map(); + } + + matches(content) { + return JSON.stringify(content) === JSON.stringify(this.content); + } + + vote(voter, opinion) { + this.votes.set(voter.id, { voter, opinion }); + } + + finalize() { + const count = { for: 0, against: 0 }; + for (const vote of this.votes) { + if (vote.opinion === true) { + count.for++; + } else { + count.against++; + } + } + return count.for > count.against; + } +} diff --git a/forum-network/public/classes/crypto.js b/forum-network/public/classes/crypto.js new file mode 100644 index 0000000..431a60c --- /dev/null +++ b/forum-network/public/classes/crypto.js @@ -0,0 +1,58 @@ +export class CryptoUtil { + static algorithm = 'RSASSA-PKCS1-v1_5'; + + static hash = 'SHA-256'; + + static async generateSigningKey() { + return await window.crypto.subtle.generateKey( + { + name: CryptoUtil.algorithm, + hash: CryptoUtil.hash, + modulusLength: 2048, + publicExponent: new Uint8Array([1, 0, 1]), + }, + true, + ['sign', 'verify'], + ); + } + + static async sign(content, privateKey) { + const encoder = new TextEncoder(); + const encoded = encoder.encode(content); + const signature = await window.crypto.subtle.sign(CryptoUtil.algorithm, privateKey, encoded); + // Return base64-encoded signature + return btoa(String.fromCharCode(...new Uint8Array(signature))); + } + + static async verify(content, b64publicKey, b64signature) { + // Convert base64 javascript web key to CryptoKey + const publicKey = await CryptoUtil.importKey(b64publicKey); + // Convert base64 signature to an ArrayBuffer + const signature = Uint8Array.from(atob(b64signature), (c) => c.charCodeAt(0)); + // TODO: make a single TextEncoder instance and reuse it + const encoder = new TextEncoder(); + const encoded = encoder.encode(content); + return await window.crypto.subtle.verify(CryptoUtil.algorithm, publicKey, signature, encoded); + } + + static async exportKey(publicKey) { + // Store public key as base64 javascript web key + const jwk = await window.crypto.subtle.exportKey('jwk', publicKey); + return btoa(JSON.stringify(jwk)); + } + + static async importKey(b64jwk) { + // Convert base64 javascript web key to CryptoKey + const jwk = JSON.parse(atob(b64jwk)); + return await window.crypto.subtle.importKey( + 'jwk', + jwk, + { + name: CryptoUtil.algorithm, + hash: CryptoUtil.hash, + }, + false, + ['verify'], + ); + } +} diff --git a/forum-network/public/classes/display-value.js b/forum-network/public/classes/display-value.js new file mode 100644 index 0000000..265911f --- /dev/null +++ b/forum-network/public/classes/display-value.js @@ -0,0 +1,65 @@ +export class DisplayValue { + constructor(name, box) { + this.value = undefined; + this.name = name; + this.box = box; + this.nameBox = this.box.addBox(`${this.name}-name`).addClass('name'); + this.valueBox = this.box.addBox(`${this.name}-value`).addClass('value'); + this.nameBox.setInnerHTML(this.name); + } + + render() { + this.valueBox.setInnerHTML(this.value); + } + + set(value) { + this.value = value; + this.render(); + } + + get() { + return this.value; + } +} + +export class Box { + constructor(name, parentEl) { + this.el = document.createElement('div'); + this.el.classList.add('box'); + this.el.setAttribute('box-name', name); + if (parentEl) { + parentEl.appendChild(this.el); + } + } + + flex() { + this.el.classList.add('flex'); + return this; + } + + monospace() { + this.el.classList.add('monospace'); + return this; + } + + addClass(className) { + this.el.classList.add(className); + return this; + } + + addBox(name) { + const box = new Box(name); + this.el.appendChild(box.el); + return box; + } + + addDisplayValue(value) { + const box = this.addBox(value.name).flex(); + return new DisplayValue(value, box); + } + + setInnerHTML(html) { + this.el.innerHTML = html; + return this; + } +} diff --git a/forum-network/public/classes/forum-network.js b/forum-network/public/classes/forum-network.js new file mode 100644 index 0000000..46ce92f --- /dev/null +++ b/forum-network/public/classes/forum-network.js @@ -0,0 +1,14 @@ +export class ForumNetwork { + constructor() { + this.nodes = new Map(); + } + + addNode(node) { + this.nodes.set(node.keyPair.publicKey, node); + return this; + } + + listNodes() { + return Array.from(this.nodes.values()); + } +} diff --git a/forum-network/public/classes/forum-node.js b/forum-network/public/classes/forum-node.js new file mode 100644 index 0000000..731fd57 --- /dev/null +++ b/forum-network/public/classes/forum-node.js @@ -0,0 +1,106 @@ +import { Actor, Action } from './actor.js'; +import { Message, PostMessage, PeerMessage } from './message.js'; +import { CryptoUtil } from './crypto.js'; +import { ForumView } from './forum-view.js'; +import { PrioritizedQueue } from './prioritized-queue.js'; + +export class ForumNode extends Actor { + constructor(name, scene) { + super(name, scene); + this.forumView = new ForumView(); + this.queue = new PrioritizedQueue(); + this.actions = { + storePost: new Action('store post', scene), + peerMessage: new Action('peer message', scene), + }; + } + + // Generate a signing key pair and connect to the network + async initialize(forumNetwork) { + this.keyPair = await CryptoUtil.generateSigningKey(); + this.forumNetwork = forumNetwork.addNode(this); + this.status.set('Initialized'); + return this; + } + + // Send a message to all other nodes in the network + async broadcast(message) { + await message.sign(this.keyPair); + const otherForumNodes = this.forumNetwork + .listNodes() + .filter((forumNode) => forumNode.keyPair.publicKey !== this.keyPair.publicKey); + for (const forumNode of otherForumNodes) { + // For now just call receiveMessage on the target node + this.actions.peerMessage.log(this, forumNode, null, message.content); + await forumNode.receiveMessage(JSON.stringify(message.toJSON())); + } + } + + // Perform minimal processing to ingest a message. + // Enqueue it for further processing. + async receiveMessage(messageStr) { + const messageJson = JSON.parse(messageStr); + const senderReputation = this.forumView.getReputation(messageJson.publicKey) || 0; + this.queue.add(messageJson, senderReputation); + } + + // Process next highest priority message in the queue + async processNextMessage() { + const messageJson = this.queue.pop(); + if (!messageJson) { + return null; + } + await this.processMessage(messageJson); + } + + // Process a message from the queue + async processMessage(messageJson) { + try { + await Message.verify(messageJson); + } catch (e) { + this.actions.processMessage.log(this, this, 'invalid signature', messageJson, '-x'); + console.log(`${this.name}: received message with invalid signature`); + return; + } + + const { publicKey } = messageJson; + const message = Message.fromJSON(messageJson); + console.log(`${this.name}: processMessage`, message); + + if (message instanceof PostMessage) { + await this.processPostMessage(publicKey, message.content); + } else if (message instanceof PeerMessage) { + await this.processPeerMessage(publicKey, message.content); + } else { + // Unknown message type + // Penalize sender for wasting our time + console.log(`${this.name}: penalizing sender for unknown message type ${message.type}`); + this.forumView.incrementReputation(message.publicKey, -1); + } + } + + // Process an incoming post, received by whatever means + processPost(authorId, post, stake) { + this.actions.storePost.log(this, this, null, { authorId, post, stake }); + this.forumView.addPost(authorId, post.id, post, stake); + } + + // Process a post we received in a message + async processPostMessage(authorId, { post, stake }) { + this.processPost(authorId, post, stake); + await this.broadcast( + new PeerMessage({ + posts: [{ authorId, post, stake }], + }), + ); + } + + // Process a message we receive from a peer + async processPeerMessage(peerId, { posts }) { + // We are trusting that the peer verified the signatures of the posts they're forwarding. + // We could instead have the peer forward the signed messages and re-verify them. + for (const { authorId, post, stake } of posts) { + this.processPost(authorId, post, stake); + } + } +} diff --git a/forum-network/public/classes/forum-view.js b/forum-network/public/classes/forum-view.js new file mode 100644 index 0000000..3abb07a --- /dev/null +++ b/forum-network/public/classes/forum-view.js @@ -0,0 +1,122 @@ +import { Graph } from './graph.js'; + +class Author { + constructor() { + this.posts = new Map(); + this.reputation = 0; + } +} + +// TODO: Consider merging with "client-side" Post class in `./post.js` +class Post { + constructor(id, author, stake, content, citations) { + this.id = id; + this.author = author; + this.content = content; + this.stake = stake; + this.citations = citations; + this.reputation = 0; + } +} + +export class ForumView { + constructor() { + this.reputations = new Map(); + this.posts = new Graph(); + this.authors = new Map(); + } + + getReputation(publicKey) { + return this.reputations.get(publicKey); + } + + incrementReputation(publicKey, increment, reason) { + const reputation = this.getReputation(publicKey) || 0; + return this.reputations.set(publicKey, reputation + increment); + } + + getOrInitializeAuthor(authorId) { + let author = this.authors.get(authorId); + if (!author) { + author = new Author(authorId); + this.authors.set(authorId, author); + } + return author; + } + + addPost(authorId, postId, { citations = [], content }, stake) { + const author = this.getOrInitializeAuthor(authorId); + const post = new Post(postId, author, stake, content, citations); + this.posts.addVertex(postId, post); + for (const citation of citations) { + this.posts.addEdge('citation', postId, citation.postId, citation); + } + this.applyNonbindingReputationEffects(post); + } + + getPost(postId) { + return this.posts.getVertexData(postId); + } + + getPosts() { + return this.posts.getVertices(); + } + + // We'll start with naieve implementations of the computations we need. + + // We want to derive a value -- maybe call it a reputation score -- for each post. + // This value is a recursive sum of contributions from citations. + + // There should be a diminishment of effect upon each recursion, + // perhaps following a geometric progression. + + // Each post gets some initial score due to the reputation that the author stakes. + + // Citations are weighted, and can be positive or negative. + + // So each post has a reputation score. Each author also has a reputation score. + // The value of the author's reputation score could be a factor in the magnitude of the effects of their citations. + // Post_rep = (Author_rep * stake); + // + + // Options: + // - update a state model incrementally with each action in the history (/unfolding present) of the forum, + // in order to arrive at the current view. + + // When an author stakes reputation on a post, if it's a non-binding stake, then it merely expresses opinion. + // If it's a binding stake, then they may lose the staked reputation as a result of other posts staking reputation against theirs. + + citationFraction = 0.3; + + applyNonbindingReputationEffects(newPost) { + this.distributeNonbindingReputation(newPost, newPost, newPost.stake); + } + + distributeNonbindingReputation(newPost, post, amount, depth = 0) { + console.log('distributeNonbindingReputation', { post, amount, depth }); + // Some of the incoming reputation goes to this post + post.reputation += amount * (1 - this.citationFraction); + // Some of the incoming reputation gets distributed among cited posts + const distributeAmongCitations = amount * this.citationFraction; + + // citation weights can be interpreted as a ratio, or we can somehow constrain the input to add up to some specified total. + // It's easy enough to let them be on any arbitrary scale and just compute the ratios here. + const totalWeight = post.citations + ?.map(({ weight }) => weight) + .reduce((acc, cur) => (acc += cur), 0); + + post.citations?.forEach((citation) => { + const citedPost = this.getPost(citation.postId); + if (!citedPost) { + // TODO: Here is where we may want to engage our peer protocol to query for possible missing records + throw new Error(`Post ${post.postId} cites unknown post ${citation.postId}`); + } + this.distributeNonbindingReputation( + newPost, + citedPost, + (citation.weight / totalWeight) * distributeAmongCitations, + depth + 1, + ); + }); + } +} diff --git a/forum-network/public/classes/graph.js b/forum-network/public/classes/graph.js new file mode 100644 index 0000000..dfb68fc --- /dev/null +++ b/forum-network/public/classes/graph.js @@ -0,0 +1,85 @@ +export class Vertex { + constructor(data) { + this.data = data; + this.edges = { + from: [], + to: [], + }; + } +} + +export class Edge { + constructor(label, from, to, data) { + this.from = from; + this.to = to; + this.label = label; + this.data = data; + } +} +export class Graph { + constructor() { + this.vertices = new Map(); + this.edgeLabels = new Map(); + this.nextVertexId = 0; + } + + addVertex(id, data) { + // Support simple case of auto-incremented numeric ids + if (typeof id === 'object') { + data = id; + id = this.nextVertexId++; + } + const vertex = new Vertex(data); + this.vertices.set(id, vertex); + return this; + } + + getVertex(id) { + return this.vertices.get(id); + } + + getVertexData(id) { + return this.getVertex(id)?.data; + } + + getVertices() { + return Array.from(this.vertices.values()).map(({ data }) => data); + } + + getEdge(label, from, to) { + const edges = this.edgeLabels.get(label); + return edges?.get(JSON.stringify({ from, to })); + } + + setEdge(label, from, to, edge) { + let edges = this.edgeLabels.get(label); + if (!edges) { + edges = new Map(); + this.edgeLabels.set(label, edges); + } + edges.set(JSON.stringify({ from, to }), edge); + } + + addEdge(label, from, to, data) { + if (this.getEdge(label, from, to)) { + throw new Error(`Edge ${label} from ${from} to ${to} already exists`); + } + const edge = new Edge(label, from, to, data); + this.setEdge(label, from, to, edge); + this.getVertex(from).edges.from.push(edge); + this.getVertex(to).edges.to.push(edge); + return this; + } + + getEdges(label, from, to) { + const edgeLabels = label ? [label] : Array.from(this.edgeLabels.keys()); + return edgeLabels.flatMap((edgeLabel) => { + const edges = this.edgeLabels.get(edgeLabel); + return Array.from(edges?.values() || []).filter((edge) => { + const matchFrom = from === null || from === undefined || from === edge.from; + const matchTo = to === null || to === undefined || to === edge.to; + return matchFrom && matchTo; + }); + }); + } +} diff --git a/forum-network/public/classes/member.js b/forum-network/public/classes/member.js new file mode 100644 index 0000000..4a9591a --- /dev/null +++ b/forum-network/public/classes/member.js @@ -0,0 +1,26 @@ +import { Actor, Action } from './actor.js'; +import { PostMessage } from './message.js'; +import { CryptoUtil } from './crypto.js'; + +export class Member extends Actor { + constructor(name, scene) { + super(name, scene); + this.actions = { + submitPost: new Action('submit post', scene), + }; + } + + async initialize() { + this.keyPair = await CryptoUtil.generateSigningKey(); + this.status.set('Initialized'); + return this; + } + + async submitPost(forumNode, post, stake) { + const postMessage = new PostMessage({ post, stake }); + await postMessage.sign(this.keyPair); + this.actions.submitPost.log(this, forumNode, null, { id: post.id }); + // For now, directly call forumNode.receiveMessage(); + await forumNode.receiveMessage(JSON.stringify(postMessage.toJSON())); + } +} diff --git a/forum-network/public/classes/message.js b/forum-network/public/classes/message.js new file mode 100644 index 0000000..d505f9f --- /dev/null +++ b/forum-network/public/classes/message.js @@ -0,0 +1,69 @@ +import { CryptoUtil } from './crypto.js'; +import { Post } from './post.js'; + +export class Message { + constructor(content) { + this.content = content; + } + + async sign({ publicKey, privateKey }) { + this.publicKey = await CryptoUtil.exportKey(publicKey); + // Call toJSON before signing, to match what we'll later send + this.signature = await CryptoUtil.sign(this.contentToJSON(this.content), privateKey); + return this; + } + + static async verify({ content, publicKey, signature }) { + return await CryptoUtil.verify(content, publicKey, signature); + } + + static contentFromJSON(data) { + return data; + } + + contentToJSON(content) { + return content; + } + + static fromJSON({ type, content }) { + const messageType = messageTypes.get(type) || Message; + const messageContent = messageType.contentFromJSON(content); + return new messageType(messageContent); + } + + toJSON() { + return { + type: this.type, + content: this.contentToJSON(this.content), + publicKey: this.publicKey, + signature: this.signature, + }; + } +} + +export class PostMessage extends Message { + type = 'post'; + + static contentFromJSON({ post, stake }) { + return { + post: Post.fromJSON(post), + stake, + }; + } + + contentToJSON({ post, stake }) { + return { + post: post.toJSON(), + stake, + }; + } +} + +export class PeerMessage extends Message { + type = 'peer'; +} + +const messageTypes = new Map([ + ['post', PostMessage], + ['peer', PeerMessage], +]); diff --git a/forum-network/public/classes/post.js b/forum-network/public/classes/post.js new file mode 100644 index 0000000..7768d68 --- /dev/null +++ b/forum-network/public/classes/post.js @@ -0,0 +1,46 @@ +export class Post { + constructor(content) { + this.id = crypto.randomUUID(); + this.content = content; + this.citations = []; + } + + addCitation(postId, weight) { + const citation = new Citation(postId, weight); + this.citations.push(citation); + return this; + } + + toJSON() { + return { + id: this.id, + content: this.content, + citations: this.citations.map((citation) => citation.toJSON()), + }; + } + + static fromJSON({ id, content, citations }) { + const post = new Post(content); + post.id = id; + post.citations = citations.map((citation) => Citation.fromJSON(citation)); + return post; + } +} + +export class Citation { + constructor(postId, weight) { + this.postId = postId; + this.weight = weight; + } + + toJSON() { + return { + postId: this.postId, + weight: this.weight, + }; + } + + static fromJSON({ postId, weight }) { + return new Citation(postId, weight); + } +} diff --git a/forum-network/public/classes/prioritized-queue.js b/forum-network/public/classes/prioritized-queue.js new file mode 100644 index 0000000..79b5851 --- /dev/null +++ b/forum-network/public/classes/prioritized-queue.js @@ -0,0 +1,24 @@ +export class PrioritizedQueue { + constructor() { + this.buffer = []; + } + + // Add an item to the buffer, ahead of the next lowest priority item + add(message, priority) { + const idx = this.buffer.findIndex((item) => item.priority < priority); + if (idx < 0) { + this.buffer.push({ message, priority }); + } else { + this.buffer.splice(idx, 0, { message, priority }); + } + } + + // Return the highest priority item in the buffer + pop() { + if (!this.buffer.length) { + return null; + } + const item = this.buffer.shift(); + return item.message; + } +} diff --git a/forum-network/public/classes/reputation.js b/forum-network/public/classes/reputation.js new file mode 100644 index 0000000..e81dd24 --- /dev/null +++ b/forum-network/public/classes/reputation.js @@ -0,0 +1,3 @@ +class Reputation { + constructor() {} +} diff --git a/forum-network/public/classes/scene.js b/forum-network/public/classes/scene.js new file mode 100644 index 0000000..8712714 --- /dev/null +++ b/forum-network/public/classes/scene.js @@ -0,0 +1,33 @@ +import { Actor, Action } from './actor.js'; + +export class Scene { + constructor(name, rootBox) { + this.name = name; + this.box = rootBox.addBox(name); + this.titleBox = this.box.addBox().setInnerHTML(name); + this.box.addBox('Spacer').setInnerHTML(' '); + this.displayValuesBox = this.box.addBox(`${this.name}-values`); + this.box.addBox('Spacer').setInnerHTML(' '); + this.logBox = this.box.addBox(`${this.name}-log`); + } + + addActor(name) { + const actor = new Actor(name, this); + return actor; + } + + addAction(name) { + const action = new Action(name, this); + return action; + } + + addDisplayValue(name) { + const dv = this.displayValuesBox.addDisplayValue(name); + return dv; + } + + log(msg) { + this.logBox.addBox().setInnerHTML(msg).monospace(); + return this; + } +} diff --git a/forum-network/public/favicon.ico b/forum-network/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..28aeaa7dc112a5b36b660cfdbcb7162a010bfccf GIT binary patch literal 3630 zcmeH~ze>bF5XL8Wh>eYnSezs_Vwpn0Lcu4n5IY}2JGsh$f@Pk;UORgmYim0#M6la{ z!l`HC_i-7_E!ksB1<9?MIH15i35=wzGe6j zB5Qzgt+f?sE8txLd_huxdyg3!%Xnpg_9M6gM<4`~Omj5VQ(b+&Kx}VL7jb7&(666$18XPu|0_Xck5B&5O9yD>{#{_dUMct2Tx$?7xXA`3%JLS zor>xHIObxdjMv!ed8wotYhIW6R>!=b@6V-0e-pjCQg6|r=d)(t{mnyz?~iu@zn7}{ z=HMLP*ki=9F6W$NnQsnG^NHO>+z@bo8^AW796F~imh}q3Hn;$K4o=XnGtHrKuID-? z`^55YIj9pVeLgw3hB`gomCxV-T!IAH=Mk>f+6w&r3KT_QT%@LJQWKaoOTb`1&4wgS kvph~_M~wRPb38GL1fc88$^V)NYy$r8xD0D@4gD+s2RTgWi~s-t literal 0 HcmV?d00001 diff --git a/forum-network/public/forum-test.html b/forum-network/public/forum-test.html new file mode 100644 index 0000000..ea3145e --- /dev/null +++ b/forum-network/public/forum-test.html @@ -0,0 +1,9 @@ + + + Forum + + + + +
+ diff --git a/forum-network/public/forum-test.js b/forum-network/public/forum-test.js new file mode 100644 index 0000000..6109ffa --- /dev/null +++ b/forum-network/public/forum-test.js @@ -0,0 +1,40 @@ +import { Box } from './classes/display-value.js'; +import { Scene } from './classes/scene.js'; +import { Post } from './classes/post.js'; +import { Member } from './classes/member.js'; +import { ForumNode } from './classes/forum-node.js'; +import { ForumNetwork } from './classes/forum-network.js'; + +const delay = async (ms) => { + await new Promise((resolve) => setTimeout(resolve, ms)); +}; + +const rootElement = document.getElementById('forum-network'); +const rootBox = new Box('rootBox', rootElement).flex(); + +window.scene = new Scene('Forum test', rootBox).log('sequenceDiagram'); + +window.author1 = await new Member('author1', window.scene).initialize(); +window.author2 = await new Member('author2', window.scene).initialize(); + +window.forumNetwork = new ForumNetwork(); + +window.forumNode1 = await new ForumNode('node1', window.scene).initialize(window.forumNetwork); +window.forumNode2 = await new ForumNode('node2', window.scene).initialize(window.forumNetwork); +window.forumNode3 = await new ForumNode('node3', window.scene).initialize(window.forumNetwork); + +setInterval(async () => { + await window.forumNode1.processNextMessage(); + await window.forumNode2.processNextMessage(); + await window.forumNode3.processNextMessage(); +}, 100); + +// const blockchain = new Blockchain(); + +window.post1 = new Post({ message: 'hi' }); +window.post2 = new Post({ message: 'hello' }).addCitation(window.post1.id, 1.0); + +await delay(1000); +await window.author1.submitPost(window.forumNode1, window.post1, 50); +await delay(1000); +await window.author2.submitPost(window.forumNode2, window.post2, 100); diff --git a/forum-network/public/graph-test.html b/forum-network/public/graph-test.html new file mode 100644 index 0000000..2907cc2 --- /dev/null +++ b/forum-network/public/graph-test.html @@ -0,0 +1,9 @@ + + + Forum Graph + + + + +
+ diff --git a/forum-network/public/graph-test.js b/forum-network/public/graph-test.js new file mode 100644 index 0000000..bebddf5 --- /dev/null +++ b/forum-network/public/graph-test.js @@ -0,0 +1,23 @@ +import { Box } from './classes/display-value.js'; +import { Scene } from './classes/scene.js'; +import { Graph } from './classes/graph.js'; + +const rootElement = document.getElementById('graph-test'); +const rootBox = new Box('rootBox', rootElement).flex(); + +window.scene = new Scene('Graph test', rootBox); + +window.graph = new Graph(); + +window.v = []; +function addVertex() { + const vertex = window.graph.addVertex({ seq: window.v.length }); + window.v.push(vertex); +} +addVertex(); +addVertex(); +addVertex(); +addVertex(); +addVertex(); + +window.graph.addEdge('e1', 0, 1); diff --git a/forum-network/public/index.css b/forum-network/public/index.css new file mode 100644 index 0000000..c038721 --- /dev/null +++ b/forum-network/public/index.css @@ -0,0 +1,24 @@ +.box { + // border: 1px #eee solid; + width: fit-content; + font-family: sans-serif; + font-size: 12pt; +} +.box .name { + width: 10em; + font-weight: bold; + text-align: right; + margin-right: 6pt; +} +.box .value { + width: fit-content; + // border: 0px; +} +.flex { + display: flex; +} +.monospace { + // border: 0px; + font-family: monospace; + font-size: 11pt; +} diff --git a/forum-network/public/index.html b/forum-network/public/index.html new file mode 100644 index 0000000..71c301f --- /dev/null +++ b/forum-network/public/index.html @@ -0,0 +1,14 @@ + + + Forum Network + + + + + + + + + +
+ diff --git a/forum-network/public/index.js b/forum-network/public/index.js new file mode 100644 index 0000000..3d36526 --- /dev/null +++ b/forum-network/public/index.js @@ -0,0 +1,188 @@ +const rootElement = document.getElementById('forum-network'); +const rootBox = new Box('rootBox', rootElement).flex(); + +function randomDelay(min, max) { + const delayMs = min + Math.random() * max; + return delayMs; +} + +function delay(min, max = min) { + const delayMs = min + Math.random() * (max - min); + return new Promise((resolve) => setTimeout(resolve, delayMs)); +} + +if (true) { + const scene = new Scene('Scene 1', rootBox); + const webClientStatus = scene.addDisplayValue('WebClient Status'); + const node1Status = scene.addDisplayValue('Node 1 Status'); + const blockchainStatus = scene.addDisplayValue('Blockchain Status'); + + const webClient = scene.addActor('web client'); + const node1 = scene.addActor('node 1'); + const blockchain = scene.addActor('blockchain'); + const requestForumPage = scene.addAction('requestForumPage'); + const readBlockchainData = scene.addAction('readBlockchainData'); + const blockchainData = scene.addAction('blockchainData'); + const forumPage = scene.addAction('forumPage'); + + webClientStatus.set('Initialized'); + node1Status.set('Idle'); + blockchainStatus.set('Idle'); + + node1.on(requestForumPage, (src, detail) => { + node1Status.set('Processing request'); + node1.on(blockchainData, (_src, data) => { + node1Status.set('Processing response'); + setTimeout(() => { + node1.send(src, forumPage, data); + node1Status.set('Idle'); + }, randomDelay(500, 1000)); + }); + setTimeout(() => { + node1.send(blockchain, readBlockchainData, detail); + }, randomDelay(500, 1500)); + }); + + blockchain.on(readBlockchainData, (src, detail) => { + blockchainStatus.set('Processing request'); + setTimeout(() => { + blockchain.send(src, blockchainData, {}); + blockchainStatus.set('Idle'); + }, randomDelay(500, 1500)); + }); + + webClient.on(forumPage, (_src, _detail) => { + webClientStatus.set('Received forum page'); + }); + + setInterval(() => { + webClient.send(node1, requestForumPage); + webClientStatus.set('Requested forum page'); + }, randomDelay(6000, 12000)); +} + +(async function () { + const scene = new Scene('Scene 2', rootBox); + + const webClient = scene.addActor('webClient'); + + const nodes = []; + const memories = []; + const storages = []; + + function addNode() { + const idx = nodes.length; + const node = scene.addActor(`node${idx}`); + const memory = scene.addActor(`memory${idx}`); + const storage = scene.addActor(`storage${idx}`); + node.memory = memory; + node.storage = storage; + nodes.push(node); + memories.push(memory); + storages.push(storage); + return node; + } + + function getPeer(node) { + const peers = nodes.filter((peer) => peer !== node); + const idx = Math.floor(Math.random() * peers.length); + return peers[idx]; + } + + addNode(); + addNode(); + + const [ + seekTruth, + considerInfo, + evaluateConfidence, + chooseResponse, + qualifiedOpinions, + requestMemoryData, + memoryData, + requestStorageData, + storageData, + ] = [ + 'seek truth', + 'consider available information', + 'evaluate confidence', + 'choose response', + 'qualified opinions', + 'request in-memory data', + 'in-memory data', + 'request storage data', + 'storage data', + ].map((name) => scene.addAction(name)); + + memories.forEach((memory) => { + memory.setStatus('Idle'); + memory.on(requestMemoryData, async (src, _detail) => { + memory.setStatus('Retrieving data'); + await delay(1000); + memory.send(src, memoryData, {}); + memory.setStatus('Idle'); + }); + }); + + storages.forEach((storage) => { + storage.setStatus('Idle'); + storage.on(requestStorageData, async (src, _detail) => { + storage.setStatus('Retrieving data'); + await delay(1000); + storage.send(src, storageData, {}); + storage.setStatus('Idle'); + }); + }); + + nodes.forEach((node) => { + node.setStatus('Idle'); + node.on(seekTruth, async (seeker, detail) => { + node.setStatus('Processing request'); + + node.on(chooseResponse, async (_src, _info) => { + node.setStatus('Choosing response'); + await delay(1000); + node.send(seeker, qualifiedOpinions, {}); + node.setStatus('Idle'); + }); + + node.on(evaluateConfidence, async (_src, _info) => { + node.setStatus('Evaluating confidence'); + await delay(1000); + node.send(node, chooseResponse); + }); + + node.on(considerInfo, async (_src, _info) => { + node.setStatus('Considering info'); + await delay(1000); + node.send(node, evaluateConfidence); + }); + + node.on(memoryData, (_src, _data) => { + node.on(storageData, (_src, _data) => { + if (detail?.readConcern === 'single') { + node.send(node, considerInfo, {}); + } else { + const peer = getPeer(node); + node.on(qualifiedOpinions, (_src, info) => { + node.send(node, considerInfo, info); + }); + node.send(peer, seekTruth, { readConcern: 'single' }); + } + }); + node.send(node.storage, requestStorageData); + }); + + await delay(1000); + node.send(node.memory, requestMemoryData); + }); + }); + + webClient.on(qualifiedOpinions, (_src, _detail) => { + webClient.setStatus('Received opinions and qualifications'); + }); + + await delay(1000); + webClient.setStatus('Seek truth'); + webClient.send(nodes[0], seekTruth); +}());