From 8eae13ac3ee513fcd8c49f1abd94467aed12dec5 Mon Sep 17 00:00:00 2001 From: Jost Schulte Date: Mon, 6 Jun 2022 14:34:37 -0600 Subject: [PATCH] feat(all): switch to ES module --- .eslintrc.cjs | 18 + .eslintrc.js | 25 - .github/workflows/test.yml | 80 +- .gitignore | 5 +- Cargo.lock | 245 ++--- Makefile | 58 - default.nix | 8 +- nix/sources.json | 14 + nix/sources.nix | 174 +++ package-lock.json | 1453 +++++++++++++------------ package.json | 50 +- run-test.sh | 2 - src/api/admin/index.ts | 2 + src/api/{admin.ts => admin/types.ts} | 102 +- src/api/admin/websocket.ts | 193 ++++ src/api/app/index.ts | 2 + src/api/{app.ts => app/types.ts} | 14 +- src/api/app/websocket.ts | 141 +++ src/{websocket => api}/client.ts | 118 +- src/api/common.ts | 68 +- src/api/index.ts | 2 + src/api/state-dump.ts | 54 - src/api/types.ts | 45 - src/bundle.ts | 43 +- src/environments/launcher.ts | 38 +- src/hdk/capabilities.ts | 30 + src/{types => hdk}/dht-ops.ts | 48 +- src/{types => hdk}/entry.ts | 6 +- src/{types => hdk}/header.ts | 11 +- src/hdk/index.ts | 4 + src/index.ts | 11 +- src/tsconfig.es.json | 13 - src/tsconfig.json | 11 - src/{types/common.ts => types.ts} | 2 +- src/types/capabilities.ts | 30 - src/types/index.ts | 5 - src/websocket/admin.ts | 153 --- src/websocket/app.ts | 86 -- src/websocket/common.ts | 32 - test/e2e/fixture/zomes/foo/Cargo.toml | 8 +- test/e2e/fixture/zomes/foo/src/lib.rs | 19 +- test/e2e/index.ts | 573 +++++----- test/e2e/util.ts | 176 +-- test/index.ts | 2 +- tryout.ts | 14 + tsconfig.build.json | 9 + tsconfig.json | 28 +- 47 files changed, 2160 insertions(+), 2065 deletions(-) create mode 100644 .eslintrc.cjs delete mode 100644 .eslintrc.js delete mode 100644 Makefile create mode 100644 nix/sources.json create mode 100644 nix/sources.nix create mode 100644 src/api/admin/index.ts rename src/api/{admin.ts => admin/types.ts} (81%) create mode 100644 src/api/admin/websocket.ts create mode 100644 src/api/app/index.ts rename src/api/{app.ts => app/types.ts} (78%) create mode 100644 src/api/app/websocket.ts rename src/{websocket => api}/client.ts (63%) create mode 100644 src/api/index.ts delete mode 100644 src/api/state-dump.ts delete mode 100644 src/api/types.ts create mode 100644 src/hdk/capabilities.ts rename src/{types => hdk}/dht-ops.ts (70%) rename src/{types => hdk}/entry.ts (75%) rename src/{types => hdk}/header.ts (96%) create mode 100644 src/hdk/index.ts delete mode 100644 src/tsconfig.es.json delete mode 100644 src/tsconfig.json rename src/{types/common.ts => types.ts} (99%) delete mode 100644 src/types/capabilities.ts delete mode 100644 src/types/index.ts delete mode 100644 src/websocket/admin.ts delete mode 100644 src/websocket/app.ts delete mode 100644 src/websocket/common.ts create mode 100644 tryout.ts create mode 100644 tsconfig.build.json diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 00000000..3de48dfe --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,18 @@ +module.exports = { + root: true, + env: { + es2021: true, + node: true, + }, + parser: "@typescript-eslint/parser", + parserOptions: { + ecmaVersion: "latest", + sourceType: "module", + }, + plugins: ["@typescript-eslint", "eslint-plugin-tsdoc", "prettier"], + extends: [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:prettier/recommended", + ], +}; diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index bf7b1067..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,25 +0,0 @@ -module.exports = { - 'env': { - 'node': true, - }, - 'extends': [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended' - ], - 'parser': '@typescript-eslint/parser', - 'parserOptions': { - 'ecmaVersion': 12, - 'sourceType': 'module', - }, - 'plugins': ['@typescript-eslint'], - 'rules': { - 'comma-dangle': ['error', { 'objects': 'always-multiline', 'functions': 'never', 'arrays': 'never', 'imports': 'never' }], - 'indent': ['error', 2], - 'linebreak-style': ['error', 'unix'], - 'no-inner-declarations': 'off', - 'semi': ['error', 'never'], - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/explicit-module-boundary-types': 'off', - '@typescript-eslint/no-empty-function': 'off', - }, -} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3232f0e3..a5d38a44 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,42 +1,48 @@ name: Test on: - pull_request: - push: - branches: - - 'develop' + pull_request: + push: + branches: + - "develop" jobs: - test: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ - ubuntu-latest, - # macos-latest re-enable later, too slow. - ] - node: [ 16.x ] # '10', '12', '14' to speed up CI for now - steps: - - name: Fetch source code - uses: actions/checkout@v2 - - name: Use Nix - uses: cachix/install-nix-action@v16 - with: - nix_path: nixpkgs=channel:nixos-21.11 - - name: Use Node.js ${{ matrix.node }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node }} - - name: Configure Nix substituters - run: | - set -xe - mkdir -p ~/.config/nix/ - cp ./.github/nix.conf ~/.config/nix/ - - name: Use cachix - uses: cachix/cachix-action@v10 - with: - name: holochain-ci - - name: Prepare Nix environment - run: nix-shell --command "echo Completed" - - name: Run all tests - run: nix-shell --run './run-test.sh' + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + node: [14.x, 16.x] + + steps: + - name: Check out source code + uses: actions/checkout@v3 + + - name: Use Node.js ${{ matrix.node }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + + - name: Install nix + uses: cachix/install-nix-action@v16 + with: + nix_path: nixpkgs=channel:nixos-21.11 + + - name: Set up cachix + uses: cachix/cachix-action@v10 + with: + name: holochain-ci + + - name: Cache test zome build + uses: actions/cache@v3 + env: + cache-name: cache-test-zome + with: + path: | + .cargo + target + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Cargo.lock') }} + restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Cargo.lock') }} + + - name: Run all tests + run: nix-shell --run './run-test.sh' diff --git a/.gitignore b/.gitignore index 582263ab..4d78d355 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ +.vscode .cargo target node_modules /lib -.tsbuildinfo -/lib.es \ No newline at end of file +/lib.es +.tsbuildinfo \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 90969d41..5fbfc9c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,15 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - [[package]] name = "autocfg" version = "1.0.1" @@ -59,6 +50,7 @@ dependencies = [ "libc", "num-integer", "num-traits", + "serde", "time", "winapi", ] @@ -102,12 +94,13 @@ checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" [[package]] name = "hdk" -version = "0.0.118" +version = "0.0.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1ba1a9a438586f0f7334feacc2ef03471be47f78de600bf7d5fe7d01231aaa0" +checksum = "7514629250b637a2e623630dacd38ebe98c4f5221d5ad68c74e89d52d480ba06" dependencies = [ "hdk_derive", "holo_hash", + "holochain_deterministic_integrity", "holochain_wasmer_guest", "holochain_zome_types", "paste", @@ -116,16 +109,15 @@ dependencies = [ "thiserror", "tracing", "tracing-core", - "tracing-subscriber", ] [[package]] name = "hdk_derive" -version = "0.0.20" +version = "0.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97ae132bc4b151655185d7611d37ce042301880fb1848ea7e9721bdd36d40cb" +checksum = "3b4de645eee248c529ed2079003ef8d46c0377523ab51e8dde0605a868f48ed3" dependencies = [ - "holochain_zome_types", + "holochain_integrity_types", "paste", "proc-macro2", "quote", @@ -134,9 +126,9 @@ dependencies = [ [[package]] name = "holo_hash" -version = "0.0.15" +version = "0.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5397a0aa6c6cac2846b26baf1b705b6add5713268a89e4377d55d577f88368f6" +checksum = "8a26d28040245acbfc9b4960926cb7c07a2788f8713e6ef1b28e01bd5d1e2734" dependencies = [ "holochain_serialized_bytes", "kitsune_p2p_dht_arc", @@ -145,6 +137,38 @@ dependencies = [ "thiserror", ] +[[package]] +name = "holochain_deterministic_integrity" +version = "0.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7646630f2cded1e5c67f5acf258615e19afb8af632b87b86a6e1528907696df3" +dependencies = [ + "hdk_derive", + "holo_hash", + "holochain_integrity_types", + "holochain_wasmer_guest", + "paste", + "serde", + "serde_bytes", + "tracing", + "tracing-core", +] + +[[package]] +name = "holochain_integrity_types" +version = "0.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0ecc9e05ed493a30298d5d05fb65fbc3d14f211aabaa466388368f78490405f" +dependencies = [ + "holo_hash", + "holochain_serialized_bytes", + "kitsune_p2p_timestamp", + "serde", + "serde_bytes", + "subtle", + "tracing", +] + [[package]] name = "holochain_serialized_bytes" version = "0.0.51" @@ -172,9 +196,9 @@ dependencies = [ [[package]] name = "holochain_wasmer_common" -version = "0.0.73" +version = "0.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5af45652fd4b0e5b1ed2a721e5b0007d6334ee1e11677e918d7252c4f5a95bd0" +checksum = "a6de9bda7e1b991ce453ef55601405e43d7ef0cafb0108ed0b4755a1398dae05" dependencies = [ "holochain_serialized_bytes", "serde", @@ -184,9 +208,9 @@ dependencies = [ [[package]] name = "holochain_wasmer_guest" -version = "0.0.73" +version = "0.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "265c2dec85c91d10b01473d8163f3a841a14b47d78d764b7f6625a53f1dc1868" +checksum = "becdd2a6c662ac81a1c1aeae04eb39a8c6d987d79415fc9f6fff609bb106a90e" dependencies = [ "holochain_serialized_bytes", "holochain_wasmer_common", @@ -197,12 +221,12 @@ dependencies = [ [[package]] name = "holochain_zome_types" -version = "0.0.20" +version = "0.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08ade77e6cf5a17261a4a46ea583813701c9e917ef23962434a0a26512a27cc6" +checksum = "015444f90fdef25867210eb8b672089eb6a567c25156c20ddc1c0a9277b5a0e0" dependencies = [ - "chrono", "holo_hash", + "holochain_integrity_types", "holochain_serialized_bytes", "holochain_wasmer_common", "kitsune_p2p_timestamp", @@ -254,9 +278,9 @@ checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" [[package]] name = "kitsune_p2p_dht_arc" -version = "0.0.7" +version = "0.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1baec5c5af951a43851ade291e6c6056580ee1ab56e687da8414cd9ac919b95b" +checksum = "0b0d6fde19d44b897fc73b7ecd37ffbfd5d4641ad4f60e7e2bf8104d2012292b" dependencies = [ "derive_more", "gcollections", @@ -267,13 +291,12 @@ dependencies = [ [[package]] name = "kitsune_p2p_timestamp" -version = "0.0.5" +version = "0.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbac5369262b970c3a966c29502f17689da917678c9d60bdbaa9695d1b1c57fb" +checksum = "fed720caad6a76cf53300d2a138035930e2a01b85429e93e643fbd960ef93b44" dependencies = [ "chrono", "serde", - "thiserror", ] [[package]] @@ -288,12 +311,6 @@ version = "0.2.112" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125" -[[package]] -name = "linked-hash-map" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" - [[package]] name = "lock_api" version = "0.4.5" @@ -303,24 +320,6 @@ dependencies = [ "scopeguard", ] -[[package]] -name = "log" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "matchers" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" -dependencies = [ - "regex-automata", -] - [[package]] name = "num-integer" version = "0.1.44" @@ -340,12 +339,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" - [[package]] name = "parking_lot" version = "0.11.2" @@ -385,11 +378,11 @@ checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" [[package]] name = "proc-macro2" -version = "1.0.36" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] @@ -410,30 +403,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "regex" -version = "1.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" -dependencies = [ - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" - [[package]] name = "rmp" version = "0.8.10" @@ -484,9 +453,9 @@ checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" [[package]] name = "serde" -version = "1.0.123" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d5161132722baa40d802cc70b15262b98258453e85e5d1d365c757c73869ae" +checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" dependencies = [ "serde_derive", ] @@ -511,9 +480,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.123" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9391c295d64fc0abb2c556bad848f33cb8296276b1ad2677d1ae1ace4f258f31" +checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" dependencies = [ "proc-macro2", "quote", @@ -532,27 +501,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_yaml" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a521f2940385c165a24ee286aa8599633d162077a54bdcae2a6fd5a7bfa7a0" -dependencies = [ - "indexmap", - "ryu", - "serde", - "yaml-rust", -] - -[[package]] -name = "sharded-slab" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" -dependencies = [ - "lazy_static", -] - [[package]] name = "smallvec" version = "1.7.0" @@ -567,13 +515,13 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.85" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a684ac3dcd8913827e18cd09a68384ee66c1de24157e3c556c9ab16d85695fb7" +checksum = "0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] @@ -581,9 +529,7 @@ name = "test_wasm_foo" version = "0.0.1" dependencies = [ "hdk", - "rmp-serde", "serde", - "serde_yaml", ] [[package]] @@ -606,15 +552,6 @@ dependencies = [ "syn", ] -[[package]] -name = "thread_local" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" -dependencies = [ - "once_cell", -] - [[package]] name = "time" version = "0.1.44" @@ -658,49 +595,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "tracing-log" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" -dependencies = [ - "lazy_static", - "log", - "tracing-core", -] - -[[package]] -name = "tracing-serde" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb65ea441fbb84f9f6748fd496cf7f63ec9af5bca94dd86456978d055e8eb28b" -dependencies = [ - "serde", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" -dependencies = [ - "ansi_term", - "chrono", - "lazy_static", - "matchers", - "regex", - "serde", - "serde_json", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", - "tracing-serde", -] - [[package]] name = "trilean" version = "1.1.0" @@ -708,10 +602,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683ba5022fe6dbd7133cad150478ccf51bdb6d861515181e5fc6b4323d4fa424" [[package]] -name = "unicode-xid" -version = "0.2.2" +name = "unicode-ident" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee" [[package]] name = "wasi" @@ -740,12 +634,3 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "yaml-rust" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" -dependencies = [ - "linked-hash-map", -] diff --git a/Makefile b/Makefile deleted file mode 100644 index 4b96feff..00000000 --- a/Makefile +++ /dev/null @@ -1,58 +0,0 @@ -.PHONY: test - -VERSION:=$(shell npm view '@holochain/conductor-api' version) - -get-version: - @echo 'Version: '${VERSION} - -test: - make test-all - -test-all: - ./run-test.sh - -############################# -# █░█ █▀█ █▀▄ ▄▀█ ▀█▀ █▀▀ ▄▄ █▀ █▀▀ █▀█ █ █▀█ ▀█▀ █▀ -# █▄█ █▀▀ █▄▀ █▀█ ░█░ ██▄ ░░ ▄█ █▄▄ █▀▄ █ █▀▀ ░█░ ▄█ -############################# -# How to update holochain? -# make HC_REV="HC_REV" update-hc -# Example use: make HC_REV="fbbe611fd19e50637ee5725a5c2e7f0616a6073c" update-hc -# Note: After running this we should run the tests and check - -update-hc: - make HC_REV=$(HC_REV) update-hc-sha - git add nixpkgs.nix - git commit -m hc-rev:$(HC_REV) - git push origin HEAD - -update-hc-sha: - @if [ $(HC_REV) ]; then\ - echo "⚙️ Updating conductor-api using holochain rev: $(HC_REV)";\ - echo "✔ Replacing rev...";\ - sed -i '3s/.*/REV=$(HC_REV)/' ./install-holochain.sh;\ - sed -i -e 's/^hdk = .*/hdk = {git ="https:\/\/github.com\/holochain\/holochain", rev = "$(HC_REV)", package = "hdk"}/' test/e2e/fixture/zomes/foo/Cargo.toml;\ - sed -i -e 's/^- `holochain\/holochain` at commit: .*/- `holochain\/holochain` at commit: [$(HC_REV)](https:\/\/github.com\/holochain\/holochain\/commit\/$(HC_REV))/' README.md;\ - else \ - echo "No holochain rev provided"; \ - fi - -############################# -# █▀█ █▀▀ █░░ █▀▀ ▄▀█ █▀ █▀▀ -# █▀▄ ██▄ █▄▄ ██▄ █▀█ ▄█ ██▄ -############################# - -release: - make release-minor - git checkout -b release-${VERSION} - git add . - git commit -m release-${VERSION} - git push origin HEAD - -# use this to make a minor release 1.1 to 1.2 -release-minor: - npm version minor --force && npm publish - -# use this to make a major release 1.1 to 2.1 -release-major: - npm version major --force && npm publish diff --git a/default.nix b/default.nix index cc162c39..040500b1 100644 --- a/default.nix +++ b/default.nix @@ -1,12 +1,14 @@ let - holonixPath = builtins.fetchTarball "https://github.com/holochain/holonix/archive/main.tar.gz"; + holonixPath = (import ./nix/sources.nix).holonix; holonix = import (holonixPath) { - holochainVersionId = "v0_0_122"; + holochainVersionId = "v0_0_142"; }; nixpkgs = holonix.pkgs; -in nixpkgs.mkShell { +in +nixpkgs.mkShell { inputsFrom = [ holonix.main ]; packages = with nixpkgs; [ + niv nodejs-16_x ]; } diff --git a/nix/sources.json b/nix/sources.json new file mode 100644 index 00000000..1ebecc55 --- /dev/null +++ b/nix/sources.json @@ -0,0 +1,14 @@ +{ + "holonix": { + "branch": "main", + "description": "NixOS && Holochain", + "homepage": "", + "owner": "holochain", + "repo": "holonix", + "rev": "4cd2c3f375aec8762d1a5a9dfdbbe2ecec5c36c3", + "sha256": "17zk205hbmif6ynja6j0isdbcys8f5ndjhrs0rbfyf3inf99siaq", + "type": "tarball", + "url": "https://github.com/holochain/holonix/archive/4cd2c3f375aec8762d1a5a9dfdbbe2ecec5c36c3.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + } +} diff --git a/nix/sources.nix b/nix/sources.nix new file mode 100644 index 00000000..1938409d --- /dev/null +++ b/nix/sources.nix @@ -0,0 +1,174 @@ +# This file has been generated by Niv. + +let + + # + # The fetchers. fetch_ fetches specs of type . + # + + fetch_file = pkgs: name: spec: + let + name' = sanitizeName name + "-src"; + in + if spec.builtin or true then + builtins_fetchurl { inherit (spec) url sha256; name = name'; } + else + pkgs.fetchurl { inherit (spec) url sha256; name = name'; }; + + fetch_tarball = pkgs: name: spec: + let + name' = sanitizeName name + "-src"; + in + if spec.builtin or true then + builtins_fetchTarball { name = name'; inherit (spec) url sha256; } + else + pkgs.fetchzip { name = name'; inherit (spec) url sha256; }; + + fetch_git = name: spec: + let + ref = + if spec ? ref then spec.ref else + if spec ? branch then "refs/heads/${spec.branch}" else + if spec ? tag then "refs/tags/${spec.tag}" else + abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!"; + in + builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; }; + + fetch_local = spec: spec.path; + + fetch_builtin-tarball = name: throw + ''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`. + $ niv modify ${name} -a type=tarball -a builtin=true''; + + fetch_builtin-url = name: throw + ''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`. + $ niv modify ${name} -a type=file -a builtin=true''; + + # + # Various helpers + # + + # https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695 + sanitizeName = name: + ( + concatMapStrings (s: if builtins.isList s then "-" else s) + ( + builtins.split "[^[:alnum:]+._?=-]+" + ((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name) + ) + ); + + # The set of packages used when specs are fetched using non-builtins. + mkPkgs = sources: system: + let + sourcesNixpkgs = + import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; }; + hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; + hasThisAsNixpkgsPath = == ./.; + in + if builtins.hasAttr "nixpkgs" sources + then sourcesNixpkgs + else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then + import {} + else + abort + '' + Please specify either (through -I or NIX_PATH=nixpkgs=...) or + add a package called "nixpkgs" to your sources.json. + ''; + + # The actual fetching function. + fetch = pkgs: name: spec: + + if ! builtins.hasAttr "type" spec then + abort "ERROR: niv spec ${name} does not have a 'type' attribute" + else if spec.type == "file" then fetch_file pkgs name spec + else if spec.type == "tarball" then fetch_tarball pkgs name spec + else if spec.type == "git" then fetch_git name spec + else if spec.type == "local" then fetch_local spec + else if spec.type == "builtin-tarball" then fetch_builtin-tarball name + else if spec.type == "builtin-url" then fetch_builtin-url name + else + abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; + + # If the environment variable NIV_OVERRIDE_${name} is set, then use + # the path directly as opposed to the fetched source. + replace = name: drv: + let + saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name; + ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}"; + in + if ersatz == "" then drv else + # this turns the string into an actual Nix path (for both absolute and + # relative paths) + if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}"; + + # Ports of functions for older nix versions + + # a Nix version of mapAttrs if the built-in doesn't exist + mapAttrs = builtins.mapAttrs or ( + f: set: with builtins; + listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)) + ); + + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 + range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1); + + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 + stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); + + # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269 + stringAsChars = f: s: concatStrings (map f (stringToCharacters s)); + concatMapStrings = f: list: concatStrings (map f list); + concatStrings = builtins.concatStringsSep ""; + + # https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331 + optionalAttrs = cond: as: if cond then as else {}; + + # fetchTarball version that is compatible between all the versions of Nix + builtins_fetchTarball = { url, name ? null, sha256 }@attrs: + let + inherit (builtins) lessThan nixVersion fetchTarball; + in + if lessThan nixVersion "1.12" then + fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) + else + fetchTarball attrs; + + # fetchurl version that is compatible between all the versions of Nix + builtins_fetchurl = { url, name ? null, sha256 }@attrs: + let + inherit (builtins) lessThan nixVersion fetchurl; + in + if lessThan nixVersion "1.12" then + fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) + else + fetchurl attrs; + + # Create the final "sources" from the config + mkSources = config: + mapAttrs ( + name: spec: + if builtins.hasAttr "outPath" spec + then abort + "The values in sources.json should not have an 'outPath' attribute" + else + spec // { outPath = replace name (fetch config.pkgs name spec); } + ) config.sources; + + # The "config" used by the fetchers + mkConfig = + { sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null + , sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile) + , system ? builtins.currentSystem + , pkgs ? mkPkgs sources system + }: rec { + # The sources, i.e. the attribute set of spec name to spec + inherit sources; + + # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers + inherit pkgs; + }; + +in +mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); } diff --git a/package-lock.json b/package-lock.json index 5ed1b41e..60ac2e83 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,66 +1,63 @@ { "name": "@holochain/client", - "version": "0.3.2", + "version": "0.3.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@holochain/client", - "version": "0.3.2", - "license": "CAL 1.0", + "version": "0.3.3", + "license": "CAL-1.0", "dependencies": { - "@msgpack/msgpack": "^2.7.1", - "cross-fetch": "^3.1.4", - "isomorphic-ws": "^4.0.1" + "@msgpack/msgpack": "^2.7.2", + "cross-fetch": "^3.1.5", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-tsdoc": "^0.2.16", + "isomorphic-ws": "^4.0.1", + "prettier": "^2.6.2" }, "devDependencies": { "@types/js-yaml": "^3.12.7", "@types/tape": "^4.13.2", - "@typescript-eslint/eslint-plugin": "^5.9.0", - "@typescript-eslint/parser": "^5.9.0", - "eslint": "^8.6.0", + "@typescript-eslint/eslint-plugin": "^5.27.0", + "@typescript-eslint/parser": "^5.27.0", + "eslint": "^8.16.0", "js-yaml": "^3.14.1", "rimraf": "^3.0.2", - "tape": "^5.4.0", - "ts-node": "^10.4.0", - "typescript": "^4.5.4" - } - }, - "node_modules/@cspotcode/source-map-consumer": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", - "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", - "dev": true, + "tape": "^5.5.3", + "ts-node": "^10.8.1", + "typescript": "^4.7.2" + }, "engines": { - "node": ">= 12" + "node": "^14.13.1 || >=16.0.0" } }, "node_modules/@cspotcode/source-map-support": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", - "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, "dependencies": { - "@cspotcode/source-map-consumer": "0.8.0" + "@jridgewell/trace-mapping": "0.3.9" }, "engines": { "node": ">=12" } }, "node_modules/@eslint/eslintrc": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", - "integrity": "sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==", - "dev": true, + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", + "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.2.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", + "espree": "^9.3.2", + "globals": "^13.15.0", + "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "engines": { @@ -70,14 +67,12 @@ "node_modules/@eslint/eslintrc/node_modules/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 + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "node_modules/@eslint/eslintrc/node_modules/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, "dependencies": { "argparse": "^2.0.1" }, @@ -89,7 +84,6 @@ "version": "0.9.2", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.2.tgz", "integrity": "sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA==", - "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", @@ -102,13 +96,65 @@ "node_modules/@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==", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==" + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz", + "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.13", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz", + "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==", "dev": true }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@microsoft/tsdoc": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.14.1.tgz", + "integrity": "sha512-6Wci+Tp3CgPt/B9B0a3J4s3yMgLNSku6w5TV6mN+61C71UqsRBv2FUibBf3tPGlNxebgPHMEUzKpb1ggE8KCKw==" + }, + "node_modules/@microsoft/tsdoc-config": { + "version": "0.16.1", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.16.1.tgz", + "integrity": "sha512-2RqkwiD4uN6MLnHFljqBlZIXlt/SaUT6cuogU1w2ARw4nKuuppSmR0+s+NC+7kXBQykd9zzu0P4HtBpZT5zBpQ==", + "dependencies": { + "@microsoft/tsdoc": "0.14.1", + "ajv": "~6.12.6", + "jju": "~1.4.0", + "resolve": "~1.19.0" + } + }, + "node_modules/@microsoft/tsdoc-config/node_modules/resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dependencies": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/@msgpack/msgpack": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/@msgpack/msgpack/-/msgpack-2.7.1.tgz", - "integrity": "sha512-ApwiSL2c9ObewdOE/sqt788P1C5lomBOHyO8nUBCr4ofErBCnYQ003NtJ8lS9OQZc11ximkbmgAZJjB8y6cCdA==", + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/@msgpack/msgpack/-/msgpack-2.7.2.tgz", + "integrity": "sha512-rYEi46+gIzufyYUAoHDnRzkWGxajpD9vVXFQ3g1vbjrBm6P7MBmm+s/fqPa46sxa+8FOUdEuRQKaugo5a4JWpw==", "engines": { "node": ">= 10" } @@ -179,9 +225,9 @@ "dev": true }, "node_modules/@types/json-schema": { - "version": "7.0.9", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", - "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, "node_modules/@types/node": { @@ -200,19 +246,19 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.9.0.tgz", - "integrity": "sha512-qT4lr2jysDQBQOPsCCvpPUZHjbABoTJW8V9ZzIYKHMfppJtpdtzszDYsldwhFxlhvrp7aCHeXD1Lb9M1zhwWwQ==", + "version": "5.27.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.27.0.tgz", + "integrity": "sha512-DDrIA7GXtmHXr1VCcx9HivA39eprYBIFxbQEHI6NyraRDxCGpxAFiYQAT/1Y0vh1C+o2vfBiy4IuPoXxtTZCAQ==", "dev": true, "dependencies": { - "@typescript-eslint/experimental-utils": "5.9.0", - "@typescript-eslint/scope-manager": "5.9.0", - "@typescript-eslint/type-utils": "5.9.0", - "debug": "^4.3.2", + "@typescript-eslint/scope-manager": "5.27.0", + "@typescript-eslint/type-utils": "5.27.0", + "@typescript-eslint/utils": "5.27.0", + "debug": "^4.3.4", "functional-red-black-tree": "^1.0.1", - "ignore": "^5.1.8", + "ignore": "^5.2.0", "regexpp": "^3.2.0", - "semver": "^7.3.5", + "semver": "^7.3.7", "tsutils": "^3.21.0" }, "engines": { @@ -232,71 +278,16 @@ } } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/@typescript-eslint/experimental-utils": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.9.0.tgz", - "integrity": "sha512-ZnLVjBrf26dn7ElyaSKa6uDhqwvAi4jBBmHK1VxuFGPRAxhdi18ubQYSGA7SRiFiES3q9JiBOBHEBStOFkwD2g==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.9.0", - "@typescript-eslint/types": "5.9.0", - "@typescript-eslint/typescript-estree": "5.9.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/@typescript-eslint/experimental-utils/node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/@typescript-eslint/experimental-utils/node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/@typescript-eslint/parser": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.9.0.tgz", - "integrity": "sha512-/6pOPz8yAxEt4PLzgbFRDpZmHnXCeZgPDrh/1DaVKOjvn/UPMlWhbx/gA96xRi2JxY1kBl2AmwVbyROUqys5xQ==", + "version": "5.27.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.27.0.tgz", + "integrity": "sha512-8oGjQF46c52l7fMiPPvX4It3u3V3JipssqDfHQ2hcR0AeR8Zge+OYyKUCm5b70X72N1qXt0qgHenwN6Gc2SXZA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.9.0", - "@typescript-eslint/types": "5.9.0", - "@typescript-eslint/typescript-estree": "5.9.0", - "debug": "^4.3.2" + "@typescript-eslint/scope-manager": "5.27.0", + "@typescript-eslint/types": "5.27.0", + "@typescript-eslint/typescript-estree": "5.27.0", + "debug": "^4.3.4" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -315,13 +306,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.9.0.tgz", - "integrity": "sha512-DKtdIL49Qxk2a8icF6whRk7uThuVz4A6TCXfjdJSwOsf+9ree7vgQWcx0KOyCdk0i9ETX666p4aMhrRhxhUkyg==", + "version": "5.27.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.27.0.tgz", + "integrity": "sha512-VnykheBQ/sHd1Vt0LJ1JLrMH1GzHO+SzX6VTXuStISIsvRiurue/eRkTqSrG0CexHQgKG8shyJfR4o5VYioB9g==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.9.0", - "@typescript-eslint/visitor-keys": "5.9.0" + "@typescript-eslint/types": "5.27.0", + "@typescript-eslint/visitor-keys": "5.27.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -332,13 +323,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.9.0.tgz", - "integrity": "sha512-uVCb9dJXpBrK1071ri5aEW7ZHdDHAiqEjYznF3HSSvAJXyrkxGOw2Ejibz/q6BXdT8lea8CMI0CzKNFTNI6TEQ==", + "version": "5.27.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.27.0.tgz", + "integrity": "sha512-vpTvRRchaf628Hb/Xzfek+85o//zEUotr1SmexKvTfs7czXfYjXVT/a5yDbpzLBX1rhbqxjDdr1Gyo0x1Fc64g==", "dev": true, "dependencies": { - "@typescript-eslint/experimental-utils": "5.9.0", - "debug": "^4.3.2", + "@typescript-eslint/utils": "5.27.0", + "debug": "^4.3.4", "tsutils": "^3.21.0" }, "engines": { @@ -358,9 +349,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.9.0.tgz", - "integrity": "sha512-mWp6/b56Umo1rwyGCk8fPIzb9Migo8YOniBGPAQDNC6C52SeyNGN4gsVwQTAR+RS2L5xyajON4hOLwAGwPtUwg==", + "version": "5.27.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.27.0.tgz", + "integrity": "sha512-lY6C7oGm9a/GWhmUDOs3xAVRz4ty/XKlQ2fOLr8GAIryGn0+UBOoJDWyHer3UgrHkenorwvBnphhP+zPmzmw0A==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -371,17 +362,17 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.0.tgz", - "integrity": "sha512-kxo3xL2mB7XmiVZcECbaDwYCt3qFXz99tBSuVJR4L/sR7CJ+UNAPrYILILktGj1ppfZ/jNt/cWYbziJUlHl1Pw==", + "version": "5.27.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.27.0.tgz", + "integrity": "sha512-QywPMFvgZ+MHSLRofLI7BDL+UczFFHyj0vF5ibeChDAJgdTV8k4xgEwF0geFhVlPc1p8r70eYewzpo6ps+9LJQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.9.0", - "@typescript-eslint/visitor-keys": "5.9.0", - "debug": "^4.3.2", - "globby": "^11.0.4", + "@typescript-eslint/types": "5.27.0", + "@typescript-eslint/visitor-keys": "5.27.0", + "debug": "^4.3.4", + "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.5", + "semver": "^7.3.7", "tsutils": "^3.21.0" }, "engines": { @@ -397,14 +388,38 @@ } } }, + "node_modules/@typescript-eslint/utils": { + "version": "5.27.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.27.0.tgz", + "integrity": "sha512-nZvCrkIJppym7cIbP3pOwIkAefXOmfGPnCM0LQfzNaKxJHI6VjI8NC662uoiPlaf5f6ymkTy9C3NQXev2mdXmA==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.27.0", + "@typescript-eslint/types": "5.27.0", + "@typescript-eslint/typescript-estree": "5.27.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.0.tgz", - "integrity": "sha512-6zq0mb7LV0ThExKlecvpfepiB+XEtFv/bzx7/jKSgyXTFD7qjmSu1FoiS0x3OZaiS+UIXpH2vd9O89f02RCtgw==", + "version": "5.27.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.27.0.tgz", + "integrity": "sha512-46cYrteA2MrIAjv9ai44OQDUoCZyHeGIc4lsjCUX2WT6r4C+kidz1bNiR4017wHOPUythYeH+Sc7/cFP97KEAA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.9.0", - "eslint-visitor-keys": "^3.0.0" + "@typescript-eslint/types": "5.27.0", + "eslint-visitor-keys": "^3.3.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -415,10 +430,9 @@ } }, "node_modules/acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", - "dev": true, + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", "bin": { "acorn": "bin/acorn" }, @@ -430,7 +444,6 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -448,7 +461,6 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -460,20 +472,10 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/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, "engines": { "node": ">=8" } @@ -482,7 +484,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -517,6 +518,24 @@ "node": ">=8" } }, + "node_modules/array.prototype.every": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/array.prototype.every/-/array.prototype.every-1.1.3.tgz", + "integrity": "sha512-vWnriJI//SOMOWtXbU/VXhJ/InfnNHPF6BLKn5WfY8xXy+NWql0fUy20GO3sdqBhCAO+qw8S/E5nJiZX+QFdCA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/available-typed-arrays": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", @@ -532,14 +551,12 @@ "node_modules/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 + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/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, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -574,7 +591,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, "engines": { "node": ">=6" } @@ -583,7 +599,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -599,7 +614,6 @@ "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, "dependencies": { "color-name": "~1.1.4" }, @@ -610,14 +624,12 @@ "node_modules/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 + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "node_modules/create-require": { "version": "1.1.1", @@ -626,18 +638,17 @@ "dev": true }, "node_modules/cross-fetch": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz", - "integrity": "sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", + "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", "dependencies": { - "node-fetch": "2.6.1" + "node-fetch": "2.6.7" } }, "node_modules/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, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -648,10 +659,9 @@ } }, "node_modules/debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", - "dev": true, + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dependencies": { "ms": "2.1.2" }, @@ -699,8 +709,7 @@ "node_modules/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 + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" }, "node_modules/define-properties": { "version": "1.1.3", @@ -745,7 +754,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, "dependencies": { "esutils": "^2.0.2" }, @@ -765,18 +773,6 @@ "ignored": "bin/ignored" } }, - "node_modules/enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "dependencies": { - "ansi-colors": "^4.1.1" - }, - "engines": { - "node": ">=8.6" - } - }, "node_modules/es-abstract": { "version": "1.19.1", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", @@ -857,7 +853,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, "engines": { "node": ">=10" }, @@ -866,32 +861,30 @@ } }, "node_modules/eslint": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.6.0.tgz", - "integrity": "sha512-UvxdOJ7mXFlw7iuHZA4jmzPaUqIw54mZrv+XPYKNbKdLR0et4rf60lIZUU9kiNtnzzMzGWxMV+tQ7uG7JG8DPw==", - "dev": true, + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.16.0.tgz", + "integrity": "sha512-MBndsoXY/PeVTDJeWsYj7kLZ5hQpJOfMYLsF6LicLHQWbRDG19lK5jOix4DPl8yY4SUFcE3txy86OzFLWT+yoA==", "dependencies": { - "@eslint/eslintrc": "^1.0.5", + "@eslint/eslintrc": "^1.3.0", "@humanwhocodes/config-array": "^0.9.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", - "enquirer": "^2.3.5", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.0", + "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.1.0", - "espree": "^9.3.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.3.2", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", "glob-parent": "^6.0.1", - "globals": "^13.6.0", - "ignore": "^4.0.6", + "globals": "^13.15.0", + "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", @@ -899,12 +892,10 @@ "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", - "progress": "^2.0.0", "regexpp": "^3.2.0", - "semver": "^7.2.1", "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", "text-table": "^0.2.0", @@ -920,24 +911,72 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-config-prettier": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz", + "integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-prettier": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz", + "integrity": "sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==", + "dependencies": { + "prettier-linter-helpers": "^1.0.0" + }, + "engines": { + "node": ">=6.0.0" + }, + "peerDependencies": { + "eslint": ">=7.28.0", + "prettier": ">=2.0.0" + }, + "peerDependenciesMeta": { + "eslint-config-prettier": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-tsdoc": { + "version": "0.2.16", + "resolved": "https://registry.npmjs.org/eslint-plugin-tsdoc/-/eslint-plugin-tsdoc-0.2.16.tgz", + "integrity": "sha512-F/RWMnyDQuGlg82vQEFHQtGyWi7++XJKdYNn0ulIbyMOFqYIjoJOUdE6olORxgwgLkpJxsCJpJbTHgxJ/ggfXw==", + "dependencies": { + "@microsoft/tsdoc": "0.14.1", + "@microsoft/tsdoc-config": "0.16.1" + } + }, "node_modules/eslint-scope": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz", - "integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" + "estraverse": "^4.1.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=8.0.0" + } + }, + "node_modules/eslint-scope/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" } }, "node_modules/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, "dependencies": { "eslint-visitor-keys": "^2.0.0" }, @@ -955,16 +994,14 @@ "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, "engines": { "node": ">=10" } }, "node_modules/eslint-visitor-keys": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz", - "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==", - "dev": true, + "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==", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } @@ -972,14 +1009,24 @@ "node_modules/eslint/node_modules/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 + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/eslint/node_modules/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==", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } }, "node_modules/eslint/node_modules/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, "dependencies": { "argparse": "^2.0.1" }, @@ -988,14 +1035,13 @@ } }, "node_modules/espree": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.0.tgz", - "integrity": "sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ==", - "dev": true, + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", + "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", "dependencies": { - "acorn": "^8.7.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^3.1.0" + "acorn": "^8.7.1", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1018,7 +1064,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, "dependencies": { "estraverse": "^5.1.0" }, @@ -1030,7 +1075,6 @@ "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, "dependencies": { "estraverse": "^5.2.0" }, @@ -1042,7 +1086,6 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, "engines": { "node": ">=4.0" } @@ -1051,7 +1094,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -1059,13 +1101,17 @@ "node_modules/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 + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==" }, "node_modules/fast-glob": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.8.tgz", - "integrity": "sha512-UsiHHXoDbC3iS7vBOFvld7Q9XqBu318xztdHiL10Fjov3AK5GI5bek2ZJkxZcjPguOYH39UL1W4A6w+l7tpNtw==", + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", + "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -1075,7 +1121,7 @@ "micromatch": "^4.0.4" }, "engines": { - "node": ">=8" + "node": ">=8.6.0" } }, "node_modules/fast-glob/node_modules/glob-parent": { @@ -1093,14 +1139,12 @@ "node_modules/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 + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" }, "node_modules/fastq": { "version": "1.13.0", @@ -1115,7 +1159,6 @@ "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, "dependencies": { "flat-cache": "^3.0.4" }, @@ -1139,7 +1182,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, "dependencies": { "flatted": "^3.1.0", "rimraf": "^3.0.2" @@ -1151,8 +1193,7 @@ "node_modules/flatted": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz", - "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==", - "dev": true + "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==" }, "node_modules/for-each": { "version": "0.3.3", @@ -1172,20 +1213,17 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "node_modules/functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" }, "node_modules/get-intrinsic": { "version": "1.1.1", @@ -1230,7 +1268,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -1250,7 +1287,6 @@ "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, "dependencies": { "is-glob": "^4.0.3" }, @@ -1259,10 +1295,9 @@ } }, "node_modules/globals": { - "version": "13.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", - "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", - "dev": true, + "version": "13.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", + "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", "dependencies": { "type-fest": "^0.20.2" }, @@ -1274,16 +1309,16 @@ } }, "node_modules/globby": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", - "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", "slash": "^3.0.0" }, "engines": { @@ -1293,20 +1328,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globby/node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, "dependencies": { "function-bind": "^1.1.1" }, @@ -1340,7 +1365,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, "engines": { "node": ">=8" } @@ -1373,10 +1397,9 @@ } }, "node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "engines": { "node": ">= 4" } @@ -1385,7 +1408,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -1401,7 +1423,6 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true, "engines": { "node": ">=0.8.19" } @@ -1410,7 +1431,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -1419,8 +1439,7 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/internal-slot": { "version": "1.0.3", @@ -1496,7 +1515,6 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", - "dev": true, "dependencies": { "has": "^1.0.3" }, @@ -1523,7 +1541,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -1532,7 +1549,6 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -1705,8 +1721,7 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "node_modules/isomorphic-ws": { "version": "4.0.1", @@ -1716,6 +1731,11 @@ "ws": "*" } }, + "node_modules/jju": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", + "integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==" + }, "node_modules/js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", @@ -1732,20 +1752,17 @@ "node_modules/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 + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, "node_modules/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": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" }, "node_modules/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, "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -1757,8 +1774,7 @@ "node_modules/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 + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, "node_modules/lru-cache": { "version": "6.0.0", @@ -1788,23 +1804,22 @@ } }, "node_modules/micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "braces": "^3.0.2", + "picomatch": "^2.3.1" }, "engines": { "node": ">=8.6" } }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -1813,29 +1828,38 @@ } }, "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "node_modules/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 + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" }, "node_modules/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, "engines": { "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } } }, "node_modules/object-inspect": { @@ -1894,7 +1918,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "dependencies": { "wrappy": "1" } @@ -1903,7 +1926,6 @@ "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", @@ -1920,7 +1942,6 @@ "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, "dependencies": { "callsites": "^3.0.0" }, @@ -1932,7 +1953,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -1941,7 +1961,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, "engines": { "node": ">=8" } @@ -1949,8 +1968,7 @@ "node_modules/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 + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-type": { "version": "4.0.0", @@ -1977,25 +1995,39 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, "engines": { "node": ">= 0.8.0" } }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, + "node_modules/prettier": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", + "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", + "bin": { + "prettier": "bin-prettier.js" + }, "engines": { - "node": ">=0.4.0" + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" } }, "node_modules/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, "engines": { "node": ">=6" } @@ -2040,7 +2072,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, "engines": { "node": ">=8" }, @@ -2065,7 +2096,6 @@ "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, "engines": { "node": ">=4" } @@ -2093,7 +2123,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, "dependencies": { "glob": "^7.1.3" }, @@ -2128,9 +2157,9 @@ } }, "node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -2146,7 +2175,6 @@ "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, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -2158,7 +2186,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, "engines": { "node": ">=8" } @@ -2239,7 +2266,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -2251,7 +2277,6 @@ "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, "engines": { "node": ">=8" }, @@ -2263,7 +2288,6 @@ "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, "dependencies": { "has-flag": "^4.0.0" }, @@ -2272,11 +2296,12 @@ } }, "node_modules/tape": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.4.0.tgz", - "integrity": "sha512-8Cq4mql6oZVO7zkMcen+2AZoJyICsHjJqTiWk1kVub6C/EsS4o9zBVWWbvBBLzx10okW3SKCoNN9XfwfTAIR2w==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", "dev": true, "dependencies": { + "array.prototype.every": "^1.1.3", "call-bind": "^1.0.2", "deep-equal": "^2.0.5", "defined": "^1.0.0", @@ -2288,9 +2313,10 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "object-inspect": "^1.12.0", "object-is": "^1.1.5", + "object-keys": "^1.1.1", "object.assign": "^4.1.2", "resolve": "^2.0.0-next.3", "resumer": "^0.0.0", @@ -2304,8 +2330,7 @@ "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" }, "node_modules/through": { "version": "2.3.8", @@ -2325,13 +2350,18 @@ "node": ">=8.0" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, "node_modules/ts-node": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.4.0.tgz", - "integrity": "sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==", + "version": "10.8.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.8.1.tgz", + "integrity": "sha512-Wwsnao4DQoJsN034wePSg5nZiw4YKXf56mPIAeD6wVmiv+RytNSWqc2f3fKvcUoV+Yn2+yocD71VOfQHbmVX4g==", "dev": true, "dependencies": { - "@cspotcode/source-map-support": "0.7.0", + "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", "@tsconfig/node12": "^1.0.7", "@tsconfig/node14": "^1.0.0", @@ -2342,11 +2372,13 @@ "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", "yn": "3.1.1" }, "bin": { "ts-node": "dist/bin.js", "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", "ts-node-script": "dist/bin-script.js", "ts-node-transpile-only": "dist/bin-transpile.js", "ts-script": "dist/bin-script-deprecated.js" @@ -2391,7 +2423,6 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, "dependencies": { "prelude-ls": "^1.2.1" }, @@ -2403,7 +2434,6 @@ "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, "engines": { "node": ">=10" }, @@ -2412,9 +2442,9 @@ } }, "node_modules/typescript": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", - "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.2.tgz", + "integrity": "sha512-Mamb1iX2FDUpcTRzltPxgWMKy3fhg0TN378ylbktPGPK/99KbDtMQ4W1hwgsbPAsG3a0xKa1vmw4VKZQbkvz5A==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -2443,7 +2473,6 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, "dependencies": { "punycode": "^2.1.0" } @@ -2451,14 +2480,32 @@ "node_modules/v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==" + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "dependencies": { "isexe": "^2.0.0" }, @@ -2524,7 +2571,6 @@ "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, "engines": { "node": ">=0.10.0" } @@ -2532,8 +2578,7 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "node_modules/ws": { "version": "8.4.0", @@ -2573,49 +2618,40 @@ } }, "dependencies": { - "@cspotcode/source-map-consumer": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", - "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", - "dev": true - }, "@cspotcode/source-map-support": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", - "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, "requires": { - "@cspotcode/source-map-consumer": "0.8.0" + "@jridgewell/trace-mapping": "0.3.9" } }, "@eslint/eslintrc": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", - "integrity": "sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==", - "dev": true, + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", + "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.2.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", + "espree": "^9.3.2", + "globals": "^13.15.0", + "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "dependencies": { "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 + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "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" } @@ -2626,7 +2662,6 @@ "version": "0.9.2", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.2.tgz", "integrity": "sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA==", - "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", @@ -2636,13 +2671,61 @@ "@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==", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==" + }, + "@jridgewell/resolve-uri": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz", + "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==", + "dev": true + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.13", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz", + "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==", "dev": true }, + "@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "@microsoft/tsdoc": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.14.1.tgz", + "integrity": "sha512-6Wci+Tp3CgPt/B9B0a3J4s3yMgLNSku6w5TV6mN+61C71UqsRBv2FUibBf3tPGlNxebgPHMEUzKpb1ggE8KCKw==" + }, + "@microsoft/tsdoc-config": { + "version": "0.16.1", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.16.1.tgz", + "integrity": "sha512-2RqkwiD4uN6MLnHFljqBlZIXlt/SaUT6cuogU1w2ARw4nKuuppSmR0+s+NC+7kXBQykd9zzu0P4HtBpZT5zBpQ==", + "requires": { + "@microsoft/tsdoc": "0.14.1", + "ajv": "~6.12.6", + "jju": "~1.4.0", + "resolve": "~1.19.0" + }, + "dependencies": { + "resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "requires": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + } + } + } + }, "@msgpack/msgpack": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/@msgpack/msgpack/-/msgpack-2.7.1.tgz", - "integrity": "sha512-ApwiSL2c9ObewdOE/sqt788P1C5lomBOHyO8nUBCr4ofErBCnYQ003NtJ8lS9OQZc11ximkbmgAZJjB8y6cCdA==" + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/@msgpack/msgpack/-/msgpack-2.7.2.tgz", + "integrity": "sha512-rYEi46+gIzufyYUAoHDnRzkWGxajpD9vVXFQ3g1vbjrBm6P7MBmm+s/fqPa46sxa+8FOUdEuRQKaugo5a4JWpw==" }, "@nodelib/fs.scandir": { "version": "2.1.5", @@ -2701,9 +2784,9 @@ "dev": true }, "@types/json-schema": { - "version": "7.0.9", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", - "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, "@types/node": { @@ -2722,137 +2805,109 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.9.0.tgz", - "integrity": "sha512-qT4lr2jysDQBQOPsCCvpPUZHjbABoTJW8V9ZzIYKHMfppJtpdtzszDYsldwhFxlhvrp7aCHeXD1Lb9M1zhwWwQ==", + "version": "5.27.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.27.0.tgz", + "integrity": "sha512-DDrIA7GXtmHXr1VCcx9HivA39eprYBIFxbQEHI6NyraRDxCGpxAFiYQAT/1Y0vh1C+o2vfBiy4IuPoXxtTZCAQ==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "5.9.0", - "@typescript-eslint/scope-manager": "5.9.0", - "@typescript-eslint/type-utils": "5.9.0", - "debug": "^4.3.2", + "@typescript-eslint/scope-manager": "5.27.0", + "@typescript-eslint/type-utils": "5.27.0", + "@typescript-eslint/utils": "5.27.0", + "debug": "^4.3.4", "functional-red-black-tree": "^1.0.1", - "ignore": "^5.1.8", + "ignore": "^5.2.0", "regexpp": "^3.2.0", - "semver": "^7.3.5", + "semver": "^7.3.7", "tsutils": "^3.21.0" - }, - "dependencies": { - "ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true - } - } - }, - "@typescript-eslint/experimental-utils": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.9.0.tgz", - "integrity": "sha512-ZnLVjBrf26dn7ElyaSKa6uDhqwvAi4jBBmHK1VxuFGPRAxhdi18ubQYSGA7SRiFiES3q9JiBOBHEBStOFkwD2g==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.9.0", - "@typescript-eslint/types": "5.9.0", - "@typescript-eslint/typescript-estree": "5.9.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" - }, - "dependencies": { - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - } } }, "@typescript-eslint/parser": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.9.0.tgz", - "integrity": "sha512-/6pOPz8yAxEt4PLzgbFRDpZmHnXCeZgPDrh/1DaVKOjvn/UPMlWhbx/gA96xRi2JxY1kBl2AmwVbyROUqys5xQ==", + "version": "5.27.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.27.0.tgz", + "integrity": "sha512-8oGjQF46c52l7fMiPPvX4It3u3V3JipssqDfHQ2hcR0AeR8Zge+OYyKUCm5b70X72N1qXt0qgHenwN6Gc2SXZA==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.9.0", - "@typescript-eslint/types": "5.9.0", - "@typescript-eslint/typescript-estree": "5.9.0", - "debug": "^4.3.2" + "@typescript-eslint/scope-manager": "5.27.0", + "@typescript-eslint/types": "5.27.0", + "@typescript-eslint/typescript-estree": "5.27.0", + "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.9.0.tgz", - "integrity": "sha512-DKtdIL49Qxk2a8icF6whRk7uThuVz4A6TCXfjdJSwOsf+9ree7vgQWcx0KOyCdk0i9ETX666p4aMhrRhxhUkyg==", + "version": "5.27.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.27.0.tgz", + "integrity": "sha512-VnykheBQ/sHd1Vt0LJ1JLrMH1GzHO+SzX6VTXuStISIsvRiurue/eRkTqSrG0CexHQgKG8shyJfR4o5VYioB9g==", "dev": true, "requires": { - "@typescript-eslint/types": "5.9.0", - "@typescript-eslint/visitor-keys": "5.9.0" + "@typescript-eslint/types": "5.27.0", + "@typescript-eslint/visitor-keys": "5.27.0" } }, "@typescript-eslint/type-utils": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.9.0.tgz", - "integrity": "sha512-uVCb9dJXpBrK1071ri5aEW7ZHdDHAiqEjYznF3HSSvAJXyrkxGOw2Ejibz/q6BXdT8lea8CMI0CzKNFTNI6TEQ==", + "version": "5.27.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.27.0.tgz", + "integrity": "sha512-vpTvRRchaf628Hb/Xzfek+85o//zEUotr1SmexKvTfs7czXfYjXVT/a5yDbpzLBX1rhbqxjDdr1Gyo0x1Fc64g==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "5.9.0", - "debug": "^4.3.2", + "@typescript-eslint/utils": "5.27.0", + "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.9.0.tgz", - "integrity": "sha512-mWp6/b56Umo1rwyGCk8fPIzb9Migo8YOniBGPAQDNC6C52SeyNGN4gsVwQTAR+RS2L5xyajON4hOLwAGwPtUwg==", + "version": "5.27.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.27.0.tgz", + "integrity": "sha512-lY6C7oGm9a/GWhmUDOs3xAVRz4ty/XKlQ2fOLr8GAIryGn0+UBOoJDWyHer3UgrHkenorwvBnphhP+zPmzmw0A==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.0.tgz", - "integrity": "sha512-kxo3xL2mB7XmiVZcECbaDwYCt3qFXz99tBSuVJR4L/sR7CJ+UNAPrYILILktGj1ppfZ/jNt/cWYbziJUlHl1Pw==", + "version": "5.27.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.27.0.tgz", + "integrity": "sha512-QywPMFvgZ+MHSLRofLI7BDL+UczFFHyj0vF5ibeChDAJgdTV8k4xgEwF0geFhVlPc1p8r70eYewzpo6ps+9LJQ==", "dev": true, "requires": { - "@typescript-eslint/types": "5.9.0", - "@typescript-eslint/visitor-keys": "5.9.0", - "debug": "^4.3.2", - "globby": "^11.0.4", + "@typescript-eslint/types": "5.27.0", + "@typescript-eslint/visitor-keys": "5.27.0", + "debug": "^4.3.4", + "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.5", + "semver": "^7.3.7", "tsutils": "^3.21.0" } }, + "@typescript-eslint/utils": { + "version": "5.27.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.27.0.tgz", + "integrity": "sha512-nZvCrkIJppym7cIbP3pOwIkAefXOmfGPnCM0LQfzNaKxJHI6VjI8NC662uoiPlaf5f6ymkTy9C3NQXev2mdXmA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.27.0", + "@typescript-eslint/types": "5.27.0", + "@typescript-eslint/typescript-estree": "5.27.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + } + }, "@typescript-eslint/visitor-keys": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.0.tgz", - "integrity": "sha512-6zq0mb7LV0ThExKlecvpfepiB+XEtFv/bzx7/jKSgyXTFD7qjmSu1FoiS0x3OZaiS+UIXpH2vd9O89f02RCtgw==", + "version": "5.27.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.27.0.tgz", + "integrity": "sha512-46cYrteA2MrIAjv9ai44OQDUoCZyHeGIc4lsjCUX2WT6r4C+kidz1bNiR4017wHOPUythYeH+Sc7/cFP97KEAA==", "dev": true, "requires": { - "@typescript-eslint/types": "5.9.0", - "eslint-visitor-keys": "^3.0.0" + "@typescript-eslint/types": "5.27.0", + "eslint-visitor-keys": "^3.3.0" } }, "acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", - "dev": true + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==" }, "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, "requires": {} }, "acorn-walk": { @@ -2865,7 +2920,6 @@ "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", @@ -2873,23 +2927,15 @@ "uri-js": "^4.2.2" } }, - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true - }, "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 + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "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" } @@ -2915,6 +2961,18 @@ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, + "array.prototype.every": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/array.prototype.every/-/array.prototype.every-1.1.3.tgz", + "integrity": "sha512-vWnriJI//SOMOWtXbU/VXhJ/InfnNHPF6BLKn5WfY8xXy+NWql0fUy20GO3sdqBhCAO+qw8S/E5nJiZX+QFdCA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "is-string": "^1.0.7" + } + }, "available-typed-arrays": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", @@ -2924,14 +2982,12 @@ "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 + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "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" @@ -2959,14 +3015,12 @@ "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" }, "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" @@ -2976,7 +3030,6 @@ "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" } @@ -2984,14 +3037,12 @@ "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 + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "create-require": { "version": "1.1.1", @@ -3000,18 +3051,17 @@ "dev": true }, "cross-fetch": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz", - "integrity": "sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", + "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", "requires": { - "node-fetch": "2.6.1" + "node-fetch": "2.6.7" } }, "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", @@ -3019,10 +3069,9 @@ } }, "debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", - "dev": true, + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "requires": { "ms": "2.1.2" } @@ -3061,8 +3110,7 @@ "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 + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" }, "define-properties": { "version": "1.1.3", @@ -3098,7 +3146,6 @@ "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" } @@ -3112,15 +3159,6 @@ "minimatch": "^3.0.4" } }, - "enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "requires": { - "ansi-colors": "^4.1.1" - } - }, "es-abstract": { "version": "1.19.1", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", @@ -3187,36 +3225,33 @@ "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 + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" }, "eslint": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.6.0.tgz", - "integrity": "sha512-UvxdOJ7mXFlw7iuHZA4jmzPaUqIw54mZrv+XPYKNbKdLR0et4rf60lIZUU9kiNtnzzMzGWxMV+tQ7uG7JG8DPw==", - "dev": true, + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.16.0.tgz", + "integrity": "sha512-MBndsoXY/PeVTDJeWsYj7kLZ5hQpJOfMYLsF6LicLHQWbRDG19lK5jOix4DPl8yY4SUFcE3txy86OzFLWT+yoA==", "requires": { - "@eslint/eslintrc": "^1.0.5", + "@eslint/eslintrc": "^1.3.0", "@humanwhocodes/config-array": "^0.9.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", - "enquirer": "^2.3.5", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.0", + "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.1.0", - "espree": "^9.3.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.3.2", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", "glob-parent": "^6.0.1", - "globals": "^13.6.0", - "ignore": "^4.0.6", + "globals": "^13.15.0", + "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", @@ -3224,12 +3259,10 @@ "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", - "progress": "^2.0.0", "regexpp": "^3.2.0", - "semver": "^7.2.1", "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", "text-table": "^0.2.0", @@ -3239,35 +3272,72 @@ "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 + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "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==", + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + } }, "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" } } } }, + "eslint-config-prettier": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz", + "integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==", + "requires": {} + }, + "eslint-plugin-prettier": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz", + "integrity": "sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==", + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, + "eslint-plugin-tsdoc": { + "version": "0.2.16", + "resolved": "https://registry.npmjs.org/eslint-plugin-tsdoc/-/eslint-plugin-tsdoc-0.2.16.tgz", + "integrity": "sha512-F/RWMnyDQuGlg82vQEFHQtGyWi7++XJKdYNn0ulIbyMOFqYIjoJOUdE6olORxgwgLkpJxsCJpJbTHgxJ/ggfXw==", + "requires": { + "@microsoft/tsdoc": "0.14.1", + "@microsoft/tsdoc-config": "0.16.1" + } + }, "eslint-scope": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz", - "integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, "requires": { "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" + "estraverse": "^4.1.1" + }, + "dependencies": { + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + } } }, "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" }, @@ -3275,26 +3345,23 @@ "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 + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==" } } }, "eslint-visitor-keys": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz", - "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==", - "dev": true + "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==" }, "espree": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.0.tgz", - "integrity": "sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ==", - "dev": true, + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", + "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", "requires": { - "acorn": "^8.7.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^3.1.0" + "acorn": "^8.7.1", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" } }, "esprima": { @@ -3307,7 +3374,6 @@ "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" } @@ -3316,7 +3382,6 @@ "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" } @@ -3324,25 +3389,27 @@ "estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" }, "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" }, "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 + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==" }, "fast-glob": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.8.tgz", - "integrity": "sha512-UsiHHXoDbC3iS7vBOFvld7Q9XqBu318xztdHiL10Fjov3AK5GI5bek2ZJkxZcjPguOYH39UL1W4A6w+l7tpNtw==", + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", + "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", @@ -3366,14 +3433,12 @@ "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 + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" }, "fastq": { "version": "1.13.0", @@ -3388,7 +3453,6 @@ "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" } @@ -3406,7 +3470,6 @@ "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" @@ -3415,8 +3478,7 @@ "flatted": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz", - "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==", - "dev": true + "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==" }, "for-each": { "version": "0.3.3", @@ -3436,20 +3498,17 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" }, "get-intrinsic": { "version": "1.1.1", @@ -3482,7 +3541,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -3496,47 +3554,36 @@ "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.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", - "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", - "dev": true, + "version": "13.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", + "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", "requires": { "type-fest": "^0.20.2" } }, "globby": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", - "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, "requires": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", "slash": "^3.0.0" - }, - "dependencies": { - "ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "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" } @@ -3560,8 +3607,7 @@ "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 + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, "has-symbols": { "version": "1.0.2", @@ -3579,16 +3625,14 @@ } }, "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==" }, "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" @@ -3597,14 +3641,12 @@ "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -3613,8 +3655,7 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "internal-slot": { "version": "1.0.3", @@ -3666,7 +3707,6 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", - "dev": true, "requires": { "has": "^1.0.3" } @@ -3683,14 +3723,12 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" }, "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" } @@ -3803,8 +3841,7 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "isomorphic-ws": { "version": "4.0.1", @@ -3812,6 +3849,11 @@ "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", "requires": {} }, + "jju": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", + "integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==" + }, "js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", @@ -3825,20 +3867,17 @@ "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 + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, "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": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" }, "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" @@ -3847,8 +3886,7 @@ "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 + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, "lru-cache": { "version": "6.0.0", @@ -3872,46 +3910,46 @@ "dev": true }, "micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "braces": "^3.0.2", + "picomatch": "^2.3.1" } }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "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 + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" }, "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } }, "object-inspect": { "version": "1.12.0", @@ -3951,7 +3989,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "requires": { "wrappy": "1" } @@ -3960,7 +3997,6 @@ "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", @@ -3974,7 +4010,6 @@ "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" } @@ -3982,20 +4017,17 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "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 + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" }, "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 + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "path-type": { "version": "4.0.0", @@ -4012,20 +4044,25 @@ "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 + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true + "prettier": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", + "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==" + }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "requires": { + "fast-diff": "^1.1.2" + } }, "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 + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" }, "queue-microtask": { "version": "1.2.3", @@ -4046,8 +4083,7 @@ "regexpp": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==" }, "resolve": { "version": "2.0.0-next.3", @@ -4062,8 +4098,7 @@ "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 + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" }, "resumer": { "version": "0.0.0", @@ -4084,7 +4119,6 @@ "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" } @@ -4099,9 +4133,9 @@ } }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -4111,7 +4145,6 @@ "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" } @@ -4119,8 +4152,7 @@ "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 + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" }, "side-channel": { "version": "1.0.4", @@ -4180,7 +4212,6 @@ "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" } @@ -4188,24 +4219,23 @@ "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 + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" }, "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" } }, "tape": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/tape/-/tape-5.4.0.tgz", - "integrity": "sha512-8Cq4mql6oZVO7zkMcen+2AZoJyICsHjJqTiWk1kVub6C/EsS4o9zBVWWbvBBLzx10okW3SKCoNN9XfwfTAIR2w==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.5.3.tgz", + "integrity": "sha512-hPBJZBL9S7bH9vECg/KSM24slGYV589jJr4dmtiJrLD71AL66+8o4b9HdZazXZyvnilqA7eE8z5/flKiy0KsBg==", "dev": true, "requires": { + "array.prototype.every": "^1.1.3", "call-bind": "^1.0.2", "deep-equal": "^2.0.5", "defined": "^1.0.0", @@ -4217,9 +4247,10 @@ "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "object-inspect": "^1.12.0", "object-is": "^1.1.5", + "object-keys": "^1.1.1", "object.assign": "^4.1.2", "resolve": "^2.0.0-next.3", "resumer": "^0.0.0", @@ -4230,8 +4261,7 @@ "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" }, "through": { "version": "2.3.8", @@ -4248,13 +4278,18 @@ "is-number": "^7.0.0" } }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, "ts-node": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.4.0.tgz", - "integrity": "sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==", + "version": "10.8.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.8.1.tgz", + "integrity": "sha512-Wwsnao4DQoJsN034wePSg5nZiw4YKXf56mPIAeD6wVmiv+RytNSWqc2f3fKvcUoV+Yn2+yocD71VOfQHbmVX4g==", "dev": true, "requires": { - "@cspotcode/source-map-support": "0.7.0", + "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", "@tsconfig/node12": "^1.0.7", "@tsconfig/node14": "^1.0.0", @@ -4265,6 +4300,7 @@ "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", "yn": "3.1.1" } }, @@ -4287,7 +4323,6 @@ "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" } @@ -4295,13 +4330,12 @@ "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 + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" }, "typescript": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", - "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.2.tgz", + "integrity": "sha512-Mamb1iX2FDUpcTRzltPxgWMKy3fhg0TN378ylbktPGPK/99KbDtMQ4W1hwgsbPAsG3a0xKa1vmw4VKZQbkvz5A==", "dev": true }, "unbox-primitive": { @@ -4320,7 +4354,6 @@ "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" } @@ -4328,14 +4361,32 @@ "v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==" + }, + "v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.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" } @@ -4382,14 +4433,12 @@ "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 + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "ws": { "version": "8.4.0", diff --git a/package.json b/package.json index 83564882..43cc4b78 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name": "@holochain/client", - "version": "0.3.2", - "description": "A Nodejs client for the Holochain conductor API", + "version": "0.3.3", + "description": "A JavaScript client for the Holochain Conductor API", "author": "Holochain Foundation (http://holochain.org)", - "license": "CAL 1.0", + "license": "CAL-1.0", "repository": { "type": "git", "url": "git+https://github.com/holochain/holochain-client-js.git" @@ -17,33 +17,41 @@ "url": "https://github.com/holochain/holochain-client-js/issues" }, "homepage": "https://github.com/holochain/holochain-client-js#readme", + "engines": { + "node": "^14.13.1 || >=16.0.0" + }, + "type": "module", + "exports": { + ".": "./lib/index.js" + }, + "types": "lib/index.d.ts", "files": [ - "lib", - "lib.es" + "lib" ], - "main": "lib/index.js", - "module": "lib.es/index.js", - "types": "lib/index.d.ts", "scripts": { - "lint": "eslint src/**/*.ts test/**/*.ts --fix", - "test": "RUST_LOG=error RUST_BACKTRACE=1 ts-node test", - "build": "rimraf ./lib ./lib.es .tsbuildinfo && tsc -b" + "lint": "eslint --fix --ext .ts src test .eslintrc.cjs", + "test": "RUST_LOG=error RUST_BACKTRACE=1 node --loader ts-node/esm test/index.ts", + "build": "rimraf ./lib && tsc -p tsconfig.build.json" }, "dependencies": { - "@msgpack/msgpack": "^2.7.1", - "cross-fetch": "^3.1.4", - "isomorphic-ws": "^4.0.1" + "@msgpack/msgpack": "^2.7.2", + "cross-fetch": "^3.1.5", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-tsdoc": "^0.2.16", + "isomorphic-ws": "^4.0.1", + "prettier": "^2.6.2" }, "devDependencies": { "@types/js-yaml": "^3.12.7", "@types/tape": "^4.13.2", - "@typescript-eslint/eslint-plugin": "^5.9.0", - "@typescript-eslint/parser": "^5.9.0", - "eslint": "^8.6.0", + "@typescript-eslint/eslint-plugin": "^5.27.0", + "@typescript-eslint/parser": "^5.27.0", + "eslint": "^8.16.0", "js-yaml": "^3.14.1", "rimraf": "^3.0.2", - "tape": "^5.4.0", - "ts-node": "^10.4.0", - "typescript": "^4.5.4" + "tape": "^5.5.3", + "ts-node": "^10.8.1", + "typescript": "^4.7.2" } -} +} \ No newline at end of file diff --git a/run-test.sh b/run-test.sh index ddee198a..5a6dc904 100755 --- a/run-test.sh +++ b/run-test.sh @@ -1,7 +1,5 @@ #!/bin/bash -set -exo pipefail - cd test/e2e/fixture/zomes/foo cargo build --release --target wasm32-unknown-unknown --target-dir ./target cd ../.. # into fixtures diff --git a/src/api/admin/index.ts b/src/api/admin/index.ts new file mode 100644 index 00000000..5ed2d6dd --- /dev/null +++ b/src/api/admin/index.ts @@ -0,0 +1,2 @@ +export * from "./types.js"; +export * from "./websocket.js"; diff --git a/src/api/admin.ts b/src/api/admin/types.ts similarity index 81% rename from src/api/admin.ts rename to src/api/admin/types.ts index 5ae8b89a..270750cb 100644 --- a/src/api/admin.ts +++ b/src/api/admin/types.ts @@ -1,14 +1,19 @@ -import { Requester } from "./common" import { - HoloHash, AgentPubKey, + CellId, + DnaHash, DnaProperties, + HeaderHash, + HoloHash, InstalledAppId, - CellId, - RoleId -} from "../types/common" -import { InstalledAppInfo, MembraneProof } from "./types" -import { FullStateDump } from "./state-dump" + InstalledCell, + KitsuneAgent, + KitsuneSpace, + RoleId, + Signature, +} from "../../types.js"; +import { DhtOp, Entry, Header } from "../../hdk/index.js"; +import { Requester } from "../common.js"; export type AttachAppInterfaceRequest = { port: number }; export type AttachAppInterfaceResponse = { port: number }; @@ -29,6 +34,43 @@ export type EnableAppResponse = { errors: Array<[CellId, string]>; }; +export type DeactivationReason = + | { never_activated: null } + | { normal: null } + | { quarantined: { error: string } }; + +export type PausedAppReason = { + error: string; +}; + +export type DisabledAppReason = + | { + never_started: null; + } + | { user: null } + | { error: string }; + +export type InstalledAppInfoStatus = + | { + paused: { reason: PausedAppReason }; + } + | { + disabled: { + reason: DisabledAppReason; + }; + } + | { + running: null; + }; + +export type InstalledAppInfo = { + installed_app_id: InstalledAppId; + cell_data: Array; + status: InstalledAppInfoStatus; +}; + +export type MembraneProof = Buffer; + export type DisableAppRequest = { installed_app_id: InstalledAppId }; export type DisableAppResponse = null; @@ -162,7 +204,7 @@ export type InstallAppBundleRequest = { installed_app_id?: InstalledAppId; /// Include proof-of-membrane-membership data for cells that require it, - /// keyed by the role ID specified in the app bundle manifest. + /// keyed by the CellNick specified in the app bundle manifest. membrane_proofs: { [key: string]: MembraneProof }; /// Optional global UID override. If set will override the UID value for all DNAs in the bundle. @@ -310,6 +352,48 @@ export type DnaSource = bundle: DnaBundle; }; - export type Zomes = Array<[string, { wasm_hash: Array }]>; export type WasmCode = [HoloHash, { code: Array }]; + +export interface AgentInfoDump { + kitsune_agent: KitsuneAgent; + kitsune_space: KitsuneSpace; + dump: string; +} + +export interface P2pAgentsDump { + /// The info of this agent's cell. + this_agent_info: AgentInfoDump | undefined; + /// The dna as a [`DnaHash`] and [`kitsune_p2p::KitsuneSpace`]. + this_dna: [DnaHash, KitsuneSpace] | undefined; + /// The agent as [`AgentPubKey`] and [`kitsune_p2p::KitsuneAgent`]. + this_agent: [AgentPubKey, KitsuneAgent] | undefined; + /// All other agent info. + peers: Array; +} + +export interface FullIntegrationStateDump { + validation_limbo: Array; + integration_limbo: Array; + integrated: Array; + + dht_ops_cursor: number; +} + +export interface SourceChainJsonElement { + signature: Signature; + header_address: HeaderHash; + header: Header; + entry: Entry | undefined; +} + +export interface SourceChainJsonDump { + elements: Array; + published_ops_count: number; +} + +export interface FullStateDump { + peer_dump: P2pAgentsDump; + source_chain_dump: SourceChainJsonDump; + integration_dump: FullIntegrationStateDump; +} diff --git a/src/api/admin/websocket.ts b/src/api/admin/websocket.ts new file mode 100644 index 00000000..f8dd6c17 --- /dev/null +++ b/src/api/admin/websocket.ts @@ -0,0 +1,193 @@ +/** + * Defines AdminWebsocket, an easy-to-use websocket implementation of the + * Conductor Admin API + * + * const client = AdminWebsocket.connect( + * 'ws://localhost:9000' + * ) + * + * client.generateAgentPubKey() + * .then(agentPubKey => { + * console.log('Agent successfully generated:', agentPubKey) + * }) + * .catch(err => { + * console.error('problem generating agent:', err) + * }) + */ + +import * as Api from "./types.js"; +import { WsClient } from "../client.js"; +import { catchError, promiseTimeout, DEFAULT_TIMEOUT } from "../common.js"; +import { Transformer, requesterTransformer, Requester } from "../common.js"; +import { getLauncherEnvironment } from "../../environments/launcher.js"; + +export class AdminWebsocket implements Api.AdminApi { + client: WsClient; + defaultTimeout: number; + + constructor(client: WsClient, defaultTimeout?: number) { + this.client = client; + this.defaultTimeout = + defaultTimeout === undefined ? DEFAULT_TIMEOUT : defaultTimeout; + } + + static async connect( + url: string, + defaultTimeout?: number + ): Promise { + // Check if we are in the launcher's environment, and if so, redirect the url to connect to + const env = await getLauncherEnvironment(); + + if (env) { + url = `ws://localhost:${env.ADMIN_INTERFACE_PORT}`; + } + + const wsClient = await WsClient.connect(url); + return new AdminWebsocket(wsClient, defaultTimeout); + } + + _requester = ( + tag: string, + transformer?: Transformer + ) => + requesterTransformer( + (req, timeout) => + promiseTimeout( + this.client.request(req), + tag, + timeout || this.defaultTimeout + ).then(catchError), + tag, + transformer + ); + + // the specific request/response types come from the Interface + // which this class implements + attachAppInterface: Requester< + Api.AttachAppInterfaceRequest, + Api.AttachAppInterfaceResponse + > = this._requester("attach_app_interface"); + // Deprecated + activateApp: Requester = + this._requester("activate_app"); + // Deprecated + deactivateApp: Requester< + Api.DeactivateAppRequest, + Api.DeactivateAppResponse + > = this._requester("deactivate_app"); + enableApp: Requester = + this._requester("enable_app"); + disableApp: Requester = + this._requester("disable_app"); + startApp: Requester = + this._requester("start_app"); + dumpState: Requester = + this._requester("dump_state", dumpStateTransform); + dumpFullState: Requester< + Api.DumpFullStateRequest, + Api.DumpFullStateResponse + > = this._requester("dump_full_state"); + generateAgentPubKey: Requester< + Api.GenerateAgentPubKeyRequest, + Api.GenerateAgentPubKeyResponse + > = this._requester("generate_agent_pub_key"); + registerDna: Requester = + this._requester("register_dna"); + installApp: Requester = + this._requester("install_app"); + uninstallApp: Requester = + this._requester("uninstall_app"); + installAppBundle: Requester< + Api.InstallAppBundleRequest, + Api.InstallAppBundleResponse + > = this._requester("install_app_bundle"); + createCloneCell: Requester< + Api.CreateCloneCellRequest, + Api.CreateCloneCellResponse + > = this._requester("create_clone_cell"); + listDnas: Requester = + this._requester("list_dnas"); + listCellIds: Requester = + this._requester("list_cell_ids"); + // Deprecated + listActiveApps: Requester< + Api.ListActiveAppsRequest, + Api.ListActiveAppsResponse + > = this._requester("list_active_apps"); + listApps: Requester = + this._requester("list_apps", listAppsTransform); + listAppInterfaces: Requester< + Api.ListAppInterfacesRequest, + Api.ListAppInterfacesResponse + > = this._requester("list_app_interfaces"); + requestAgentInfo: Requester< + Api.RequestAgentInfoRequest, + Api.RequestAgentInfoResponse + > = this._requester("request_agent_info"); + addAgentInfo: Requester = + this._requester("add_agent_info"); +} + +interface InternalListAppsRequest { + status_filter?: + | { Running: null } + | { Enabled: null } + | { Paused: null } + | { Disabled: null } + | { Stopped: null }; +} + +const listAppsTransform: Transformer< + Api.ListAppsRequest, + InternalListAppsRequest, + Api.ListAppsResponse, + Api.ListAppsResponse +> = { + input: (req) => { + const args: InternalListAppsRequest = {}; + + if (req.status_filter) { + args.status_filter = getAppStatusInApiForm(req.status_filter); + } + + return args; + }, + output: (res) => res, +}; + +const dumpStateTransform: Transformer< + Api.DumpStateRequest, + Api.DumpStateRequest, + string, + Api.DumpStateResponse +> = { + input: (req) => req, + output: (res: string): Api.DumpStateResponse => { + return JSON.parse(res); + }, +}; + +function getAppStatusInApiForm(status_filter: Api.AppStatusFilter) { + switch (status_filter) { + case Api.AppStatusFilter.Running: + return { + Running: null, + }; + case Api.AppStatusFilter.Enabled: + return { + Enabled: null, + }; + case Api.AppStatusFilter.Paused: + return { + Paused: null, + }; + case Api.AppStatusFilter.Disabled: + return { + Disabled: null, + }; + case Api.AppStatusFilter.Stopped: + return { + Stopped: null, + }; + } +} diff --git a/src/api/app/index.ts b/src/api/app/index.ts new file mode 100644 index 00000000..5ed2d6dd --- /dev/null +++ b/src/api/app/index.ts @@ -0,0 +1,2 @@ +export * from "./types.js"; +export * from "./websocket.js"; diff --git a/src/api/app.ts b/src/api/app/types.ts similarity index 78% rename from src/api/app.ts rename to src/api/app/types.ts index 3a7640e1..3bdae2f2 100644 --- a/src/api/app.ts +++ b/src/api/app/types.ts @@ -1,11 +1,7 @@ -import { Requester } from "./common" -import { - CellId, - AgentPubKey, - InstalledAppId -} from "../types/common" -import { InstalledAppInfo } from "./types" -import { CapSecret } from "../types/capabilities" +import { CapSecret } from "../../hdk/capabilities.js"; +import { AgentPubKey, CellId, InstalledAppId } from "../../types.js"; +import { Requester } from "../common.js"; +import { InstalledAppInfo } from "../admin/index.js"; export type CallZomeRequestGeneric = { cap_secret: CapSecret | null; @@ -37,4 +33,4 @@ export type SignalResponseGeneric = Payload; export interface AppApi { appInfo: Requester; callZome: Requester; -} \ No newline at end of file +} diff --git a/src/api/app/websocket.ts b/src/api/app/websocket.ts new file mode 100644 index 00000000..02099ac0 --- /dev/null +++ b/src/api/app/websocket.ts @@ -0,0 +1,141 @@ +/** + * Defines AppWebsocket, an easy-to-use websocket implementation of the + * Conductor API for apps + * + * const client = AppWebsocket.connect( + * 'ws://localhost:9000', + * signal => console.log('got a signal:', signal) + * ) + * + * client.callZome({...}) // TODO: show what's in here + * .then(() => { + * console.log('DNA successfully installed') + * }) + * .catch(err => { + * console.error('problem installing DNA:', err) + * }) + */ +import { decode, encode } from "@msgpack/msgpack"; +import { getLauncherEnvironment } from "../../environments/launcher.js"; +import { InstalledAppId } from "../../types.js"; +import { WsClient } from "../client.js"; +import { + catchError, + DEFAULT_TIMEOUT, + promiseTimeout, + Requester, + requesterTransformer, + Transformer, +} from "../common.js"; +import { + AppApi, + AppInfoRequest, + AppInfoResponse, + AppSignalCb, + CallZomeRequestGeneric, + CallZomeResponseGeneric, +} from "./types.js"; + +export class AppWebsocket implements AppApi { + client: WsClient; + defaultTimeout: number; + protected overrideInstalledAppId?: InstalledAppId; + + constructor( + client: WsClient, + defaultTimeout?: number, + overrideInstalledAppId?: InstalledAppId + ) { + this.client = client; + this.defaultTimeout = + defaultTimeout === undefined ? DEFAULT_TIMEOUT : defaultTimeout; + this.overrideInstalledAppId = overrideInstalledAppId; + } + + static async connect( + url: string, + defaultTimeout?: number, + signalCb?: AppSignalCb + ): Promise { + // Check if we are in the launcher's environment, and if so, redirect the url to connect to + const env = await getLauncherEnvironment(); + + if (env) { + url = `ws://localhost:${env.APP_INTERFACE_PORT}`; + } + + const wsClient = await WsClient.connect(url, signalCb); + return new AppWebsocket( + wsClient, + defaultTimeout, + env ? env.INSTALLED_APP_ID : undefined + ); + } + + _requester = ( + tag: string, + transformer?: Transformer + ) => + requesterTransformer( + (req, timeout) => + promiseTimeout( + this.client.request(req), + tag, + timeout || this.defaultTimeout + ).then(catchError), + tag, + transformer + ); + + appInfo: Requester = this._requester( + "app_info", + appInfoTransform(this.overrideInstalledAppId) + ); + callZome: Requester< + CallZomeRequestGeneric, + CallZomeResponseGeneric + > = this._requester("zome_call", callZomeTransform); +} + +const callZomeTransform: Transformer< + CallZomeRequestGeneric, + CallZomeRequestGeneric, + CallZomeResponseGeneric, + CallZomeResponseGeneric +> = { + input: ( + req: CallZomeRequestGeneric + ): CallZomeRequestGeneric => { + return { + ...req, + payload: encode(req.payload), + }; + }, + output: ( + res: CallZomeResponseGeneric + ): CallZomeResponseGeneric => { + return decode(res); + }, +}; + +const appInfoTransform = ( + overrideInstalledAppId?: InstalledAppId +): Transformer< + AppInfoRequest, + AppInfoRequest, + AppInfoResponse, + AppInfoResponse +> => ({ + input: (req: AppInfoRequest): AppInfoRequest => { + if (overrideInstalledAppId) { + return { + installed_app_id: overrideInstalledAppId, + }; + } + + return req; + }, + output: (res: AppInfoResponse): AppInfoResponse => { + return res; + }, +}); diff --git a/src/websocket/client.ts b/src/api/client.ts similarity index 63% rename from src/websocket/client.ts rename to src/api/client.ts index c44255f7..8baab6c3 100644 --- a/src/websocket/client.ts +++ b/src/api/client.ts @@ -1,6 +1,6 @@ -import Websocket from "isomorphic-ws" -import { encode, decode } from "@msgpack/msgpack" -import { AppSignal, AppSignalCb, SignalResponseGeneric } from "../api/app" +import { decode, encode } from "@msgpack/msgpack"; +import Websocket from "isomorphic-ws"; +import { AppSignal, AppSignalCb, SignalResponseGeneric } from "./app/types.js"; /** * A Websocket client which can make requests and receive responses, @@ -9,119 +9,123 @@ import { AppSignal, AppSignalCb, SignalResponseGeneric } from "../api/app" * Uses Holochain's websocket WireMessage for communication. */ export class WsClient { - socket: Websocket - pendingRequests: Record ReturnType; reject: (error: Error) => void }> - index: number - alreadyWarnedNoSignalCb: boolean + socket: Websocket; + pendingRequests: Record< + number, + { + fulfill: (msg: unknown) => ReturnType; + reject: (error: Error) => void; + } + >; + index: number; + alreadyWarnedNoSignalCb: boolean; constructor(socket: any, signalCb?: AppSignalCb) { - this.socket = socket - this.pendingRequests = {} - this.index = 0 + this.socket = socket; + this.pendingRequests = {}; + this.index = 0; // TODO: allow adding signal handlers later - this.alreadyWarnedNoSignalCb = false + this.alreadyWarnedNoSignalCb = false; socket.onmessage = async (encodedMsg: any) => { - let data = encodedMsg.data + let data = encodedMsg.data; // If data is not a buffer (nodejs), it will be a blob (browser) if (typeof Buffer === "undefined" || !Buffer.isBuffer(data)) { - data = await data.arrayBuffer() + data = await data.arrayBuffer(); } - const msg: any = decode(data) + const msg: any = decode(data); if (msg.type === "Signal") { if (signalCb) { - const decodedMessage: SignalResponseGeneric = decode( - msg.data - ) + const decodedMessage: SignalResponseGeneric = decode(msg.data); if (!decodedMessage.App) { // We have received a system signal, do nothing - return + return; } // Note: holochain currently returns signals as an array of two values: cellId and the serialized signal payload // and this array is nested within the App key within the returned message. - const decodedCellId = decodedMessage.App[0] + const decodedCellId = decodedMessage.App[0]; // Note:In order to return readible content to the UI, the signal payload must also be decoded. - const decodedPayload = signalTransform(decodedMessage.App[1]) + const decodedPayload = signalTransform(decodedMessage.App[1]); // Return a uniform format to UI (ie: { type, data } - the same format as with callZome and appInfo...) const signal: AppSignal = { type: msg.type, data: { cellId: decodedCellId, payload: decodedPayload }, - } - signalCb(signal) + }; + signalCb(signal); } else { if (!this.alreadyWarnedNoSignalCb) console.log( - 'Received signal but no signal callback was set in constructor' - ) - this.alreadyWarnedNoSignalCb = true + "Received signal but no signal callback was set in constructor" + ); + this.alreadyWarnedNoSignalCb = true; } - } else if (msg.type === 'Response') { - this.handleResponse(msg) + } else if (msg.type === "Response") { + this.handleResponse(msg); } else { - console.error(`Got unrecognized Websocket message type: ${msg.type}`) + console.error(`Got unrecognized Websocket message type: ${msg.type}`); } - } + }; } emitSignal(data: any) { const encodedMsg = encode({ - type: 'Signal', + type: "Signal", data: encode(data), - }) - this.socket.send(encodedMsg) + }); + this.socket.send(encodedMsg); } request(data: Req): Promise { - const id = this.index - this.index += 1 + const id = this.index; + this.index += 1; const encodedMsg = encode({ id, - type: 'Request', + type: "Request", data: encode(data), - }) + }); const promise = new Promise((fulfill, reject) => { - this.pendingRequests[id] = { fulfill, reject } - }) + this.pendingRequests[id] = { fulfill, reject }; + }); if (this.socket.readyState === this.socket.OPEN) { - this.socket.send(encodedMsg) + this.socket.send(encodedMsg); } else { - return Promise.reject(new Error('Socket is not open')) + return Promise.reject(new Error("Socket is not open")); } - return promise as Promise + return promise as Promise; } handleResponse(msg: any) { - const id = msg.id + const id = msg.id; if (this.pendingRequests[id]) { // resolve response if (msg.data === null || msg.data === undefined) { this.pendingRequests[id].reject( - new Error('Response canceled by responder') - ) + new Error("Response canceled by responder") + ); } else { - this.pendingRequests[id].fulfill(decode(msg.data)) + this.pendingRequests[id].fulfill(decode(msg.data)); } } else { - console.error(`Got response with no matching request. id=${id}`) + console.error(`Got response with no matching request. id=${id}`); } } close(): Promise { - this.socket.close() - return this.awaitClose() + this.socket.close(); + return this.awaitClose(); } awaitClose(): Promise { - return new Promise((resolve) => this.socket.on('close', resolve)) + return new Promise((resolve) => this.socket.on("close", resolve)); } static connect(url: string, signalCb?: AppSignalCb): Promise { return new Promise((resolve, reject) => { - const socket = new Websocket(url) + const socket = new Websocket(url); // make sure that there are no uncaught connection // errors because that causes nodejs thread to crash // with uncaught exception @@ -130,17 +134,17 @@ export class WsClient { new Error( `could not connect to holochain conductor, please check that a conductor service is running and available at ${url}` ) - ) - } + ); + }; socket.onopen = () => { - resolve(new WsClient(socket, signalCb)) - } - }) + resolve(new WsClient(socket, signalCb)); + }; + }); } } const signalTransform = ( res: SignalResponseGeneric ): SignalResponseGeneric => { - return decode(res) -} + return decode(res); +}; diff --git a/src/api/common.ts b/src/api/common.ts index 51071c2d..f3bf7443 100644 --- a/src/api/common.ts +++ b/src/api/common.ts @@ -1,3 +1,14 @@ +const ERROR_TYPE = "error"; +export const DEFAULT_TIMEOUT = 15000; + +export type Transformer = { + input: (req: ReqO) => ReqI; + output: (res: ResI) => ResO; +}; + +export type Requester = (req: Req, timeout?: number) => Promise; +export type RequesterUnit = () => Promise; +export type Tagged = { type: string; data: T }; /** * Take a Requester function which deals with tagged requests and responses, @@ -9,26 +20,45 @@ export const requesterTransformer = requester: Requester, Tagged>, tag: string, transform: Transformer = identityTransformer - ) => ( - async (req: ReqO, timeout?: number) => { - const input = { type: tag, data: transform.input(req) } - const response = await requester(input, timeout) - const output = transform.output(response.data) - return output - } - ) - -export type Transformer = { - input: (req: ReqO) => ReqI, - output: (res: ResI) => ResO, -} - -const identity = (x: any) => x + ) => + async (req: ReqO, timeout?: number) => { + const input = { type: tag, data: transform.input(req) }; + const response = await requester(input, timeout); + const output = transform.output(response.data); + return output; + }; +const identity = (x: any) => x; const identityTransformer = { input: identity, output: identity, -} +}; + +export const catchError = (res: any) => { + return res.type === ERROR_TYPE ? Promise.reject(res) : Promise.resolve(res); +}; + +export const promiseTimeout = ( + promise: Promise, + tag: string, + ms: number +) => { + let id: NodeJS.Timeout; + + const timeout = new Promise((_, reject) => { + id = setTimeout(() => { + clearTimeout(id); + reject(new Error(`Timed out in ${ms}ms: ${tag}`)); + }, ms); + }); -export type Requester = (req: Req, timeout?: number) => Promise -export type RequesterUnit = () => Promise -export type Tagged = { type: string, data: T } + return new Promise((res, rej) => { + Promise.race([promise, timeout]) + .then((a) => { + clearTimeout(id); + return res(a); + }) + .catch((e) => { + return rej(e); + }); + }); +}; diff --git a/src/api/index.ts b/src/api/index.ts new file mode 100644 index 00000000..95d2ce7c --- /dev/null +++ b/src/api/index.ts @@ -0,0 +1,2 @@ +export * from "./admin/index.js"; +export * from "./app/index.js"; diff --git a/src/api/state-dump.ts b/src/api/state-dump.ts deleted file mode 100644 index 43e699fa..00000000 --- a/src/api/state-dump.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { - AgentPubKey, - DnaHash, - HeaderHash, - KitsuneAgent, - KitsuneSpace, - Signature -} from "../types/common" -import { DhtOp } from "../types/dht-ops" -import { Entry } from "../types/entry" -import { Header } from "../types/header" - -export interface AgentInfoDump { - kitsune_agent: KitsuneAgent; - kitsune_space: KitsuneSpace; - dump: string; -} - -export interface P2pAgentsDump { - /// The info of this agent's cell. - this_agent_info: AgentInfoDump | undefined; - /// The dna as a [`DnaHash`] and [`kitsune_p2p::KitsuneSpace`]. - this_dna: [DnaHash, KitsuneSpace] | undefined; - /// The agent as [`AgentPubKey`] and [`kitsune_p2p::KitsuneAgent`]. - this_agent: [AgentPubKey, KitsuneAgent] | undefined; - /// All other agent info. - peers: Array; -} - -export interface FullIntegrationStateDump { - validation_limbo: Array; - integration_limbo: Array; - integrated: Array; - - dht_ops_cursor: number; -} - -export interface SourceChainJsonElement { - signature: Signature; - header_address: HeaderHash; - header: Header; - entry: Entry | undefined; -} - -export interface SourceChainJsonDump { - elements: Array; - published_ops_count: number; -} - -export interface FullStateDump { - peer_dump: P2pAgentsDump; - source_chain_dump: SourceChainJsonDump; - integration_dump: FullIntegrationStateDump; -} \ No newline at end of file diff --git a/src/api/types.ts b/src/api/types.ts deleted file mode 100644 index f06578b3..00000000 --- a/src/api/types.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { InstalledAppId, InstalledCell } from "../types/common" - -export type DeactivationReason = - | { never_activated: null } - | { normal: null } - | { quarantined: { error: string } }; - -export type PausedAppReason = { - error: string; -}; -export type DisabledAppReason = - | { - never_started: null; - } - | { user: null } - | { error: string }; - -export type InstalledAppInfoStatus = - | { - paused: { reason: PausedAppReason }; - } - | { - disabled: { - reason: DisabledAppReason; - }; - } - | { - running: null; - }; - -export type InstalledAppInfo = { - installed_app_id: InstalledAppId; - cell_data: Array; - status: InstalledAppInfoStatus; -}; -export type MembraneProof = Buffer; - -export const fakeAgentPubKey = () => - Buffer.from( - [0x84, 0x20, 0x24].concat( - "000000000000000000000000000000000000" - .split("") - .map((x) => parseInt(x, 10)) - ) - ) diff --git a/src/bundle.ts b/src/bundle.ts index ecde6cec..266e0281 100644 --- a/src/bundle.ts +++ b/src/bundle.ts @@ -1,24 +1,27 @@ -import { decode } from '@msgpack/msgpack' -import { AppBundle, AppBundleSource, DnaProperties } from '.' +import { decode } from "@msgpack/msgpack"; +import { AppBundle, AppBundleSource } from "./api/index.js"; +import { DnaProperties } from "./types.js"; -export type HappProperties = { [role_id: string]: DnaProperties } +export type HappProperties = { [role_id: string]: DnaProperties }; const readAppBundleFromPath = async (path: string): Promise => { - const isBrowser = typeof window !== 'undefined' + const isBrowser = typeof window !== "undefined"; if (isBrowser) { - throw new Error('Cannot read app bundle from path in browser context') + throw new Error("Cannot read app bundle from path in browser context"); } - const { promises: { readFile } } = await import('fs') - const { gunzip } = await import('zlib') + const { + promises: { readFile }, + } = await import("fs"); + const { gunzip } = await import("zlib"); - const compressed = await readFile(path) + const compressed = await readFile(path); const encoded: Uint8Array = await new Promise((resolve, reject) => gunzip(compressed, (err, bytes) => err === null ? resolve(bytes) : reject(err) ) - ) - return decode(encoded) as AppBundle -} + ); + return decode(encoded) as AppBundle; +}; /// Adds properties to app bundle. Requires node if passed a path. export const appBundleWithProperties = async ( @@ -26,20 +29,20 @@ export const appBundleWithProperties = async ( properties: HappProperties ): Promise => { const originalBundle = - 'path' in source ? await readAppBundleFromPath(source.path) : source.bundle + "path" in source ? await readAppBundleFromPath(source.path) : source.bundle; return { bundle: { ...originalBundle, manifest: { ...originalBundle.manifest, - roles: originalBundle.manifest.roles.map(roleManifest => ({ + roles: originalBundle.manifest.roles.map((roleManifest) => ({ ...roleManifest, dna: { ...roleManifest.dna, - properties: properties[roleManifest.id] - } - })) - } - } - } -} + properties: properties[roleManifest.id], + }, + })), + }, + }, + }; +}; diff --git a/src/environments/launcher.ts b/src/environments/launcher.ts index de1873ab..196f44de 100644 --- a/src/environments/launcher.ts +++ b/src/environments/launcher.ts @@ -1,8 +1,8 @@ -import { InstalledAppId } from "../types/common" -import fetch from "cross-fetch" +import { InstalledAppId } from "../types.js"; +import fetch from "cross-fetch"; // This is coupled with https://github.com/holochain/launcher/blob/develop/src-tauri/src/uis/caddy.rs#L13 -export const LAUNCHER_ENV_URL = "/.launcher-env.json" +export const LAUNCHER_ENV_URL = "/.launcher-env.json"; export interface LauncherEnvironment { APP_INTERFACE_PORT: number; @@ -12,43 +12,45 @@ export interface LauncherEnvironment { async function fetchLauncherEnvironment(): Promise< LauncherEnvironment | undefined - > { - const env = await fetch(LAUNCHER_ENV_URL) +> { + const env = await fetch(LAUNCHER_ENV_URL); if (env.ok) { - const launcherEnvironment = await env.json() - return launcherEnvironment + const launcherEnvironment = await env.json(); + return launcherEnvironment; } else { // We are not in the launcher environment if (env.status === 404) { console.warn( "[@holochain/conductor-api]: you are in a development environment. When this UI is run in the Holochain Launcher, `AppWebsocket.connect()`, `AdminWebsocket.connect()` and `appWebsocket.appInfo()` will have their parameters ignored and substituted by the ones provided by the Holochain Launcher." - ) - return undefined + ); + return undefined; } else { throw new Error( `Error trying to fetch the launcher environment: ${env.statusText}` - ) + ); } } } -const isBrowser = typeof window !== "undefined" +const isBrowser = typeof window !== "undefined"; const isJest = - typeof process !== "undefined" && process.env && process.env.JEST_WORKER_ID !== undefined + typeof process !== "undefined" && + process.env && + process.env.JEST_WORKER_ID !== undefined; -let promise: Promise +let promise: Promise; if (isBrowser && !isJest) { - promise = fetchLauncherEnvironment().catch(console.error) + promise = fetchLauncherEnvironment().catch(console.error); } export async function getLauncherEnvironment(): Promise< LauncherEnvironment | undefined - > { +> { if (isBrowser) { - return promise + return promise; } else { - return undefined + return undefined; } -} \ No newline at end of file +} diff --git a/src/hdk/capabilities.ts b/src/hdk/capabilities.ts new file mode 100644 index 00000000..5f4b7d19 --- /dev/null +++ b/src/hdk/capabilities.ts @@ -0,0 +1,30 @@ +import { AgentPubKey } from "../types.js"; + +export type CapSecret = Uint8Array; + +export interface CapClaim { + tag: string; + grantor: AgentPubKey; + secret: CapSecret; +} + +export interface ZomeCallCapGrant { + tag: string; + access: CapAccess; + functions: Array<{ zome: string; fn_name: string }>; +} + +export type CapAccess = + | "Unrestricted" + | { + Transferable: { secret: CapSecret }; + } + | { Assigned: { secret: CapSecret; assignees: AgentPubKey[] } }; + +export type CapGrant = + | { + ChainAuthor: AgentPubKey; + } + | { + RemoteAgent: ZomeCallCapGrant; + }; diff --git a/src/types/dht-ops.ts b/src/hdk/dht-ops.ts similarity index 70% rename from src/types/dht-ops.ts rename to src/hdk/dht-ops.ts index fafb6d5b..fa6c0586 100644 --- a/src/types/dht-ops.ts +++ b/src/hdk/dht-ops.ts @@ -1,13 +1,13 @@ +import { Signature } from "../types.js"; +import { Entry } from "./entry.js"; import { CreateLink, Delete, DeleteLink, Header, NewEntryHeader, - Update -} from "./header" -import { Entry } from "./entry" -import { Signature } from "./common" + Update, +} from "./header.js"; // https://github.com/holochain/holochain/blob/develop/crates/types/src/dht_op.rs @@ -28,45 +28,45 @@ export type DhtOp = | { [DhtOpType.StoreEntry]: [Signature, NewEntryHeader, Entry] } | { [DhtOpType.RegisterAgentActivity]: [Signature, Header] } | { - [DhtOpType.RegisterUpdatedContent]: [ - Signature, - Update, - Entry | undefined - ]; - } + [DhtOpType.RegisterUpdatedContent]: [ + Signature, + Update, + Entry | undefined + ]; + } | { - [DhtOpType.RegisterUpdatedElement]: [ - Signature, - Update, - Entry | undefined - ]; - } + [DhtOpType.RegisterUpdatedElement]: [ + Signature, + Update, + Entry | undefined + ]; + } | { [DhtOpType.RegisterDeletedBy]: [Signature, Delete] } | { [DhtOpType.RegisterDeletedEntryHeader]: [Signature, Delete] } | { [DhtOpType.RegisterAddLink]: [Signature, CreateLink] } | { [DhtOpType.RegisterRemoveLink]: [Signature, DeleteLink] }; export function getDhtOpType(op: DhtOp): DhtOpType { - return Object.keys(op)[0] as DhtOpType + return Object.keys(op)[0] as DhtOpType; } export function getDhtOpHeader(op: DhtOp): Header { - const header = Object.values(op)[0][1] + const header = Object.values(op)[0][1]; - if (header.author) return header + if (header.author) return header; else { - const headerType = Object.keys(header)[0] + const headerType = Object.keys(header)[0]; return { type: headerType, ...header[headerType], - } + }; } } export function getDhtOpEntry(op: DhtOp): Entry | undefined { - return Object.values(op)[0][2] + return Object.values(op)[0][2]; } export function getDhtOpSignature(op: DhtOp): Signature { - return Object.values(op)[0][1] -} \ No newline at end of file + return Object.values(op)[0][1]; +} diff --git a/src/types/entry.ts b/src/hdk/entry.ts similarity index 75% rename from src/types/entry.ts rename to src/hdk/entry.ts index 9362cbc1..7273920d 100644 --- a/src/types/entry.ts +++ b/src/hdk/entry.ts @@ -1,5 +1,5 @@ -import { CapClaim, ZomeCallCapGrant } from "./capabilities" -import { AgentPubKey } from "./common" +import { CapClaim, ZomeCallCapGrant } from "./capabilities.js"; +import { AgentPubKey } from "../types.js"; export type EntryVisibility = "Public" | "Private"; export type AppEntryType = { @@ -23,4 +23,4 @@ export type Entry = | EntryContent<"Agent", AgentPubKey> | EntryContent<"App", any> | EntryContent<"CapGrant", ZomeCallCapGrant> - | EntryContent<"CapClaim", CapClaim>; \ No newline at end of file + | EntryContent<"CapClaim", CapClaim>; diff --git a/src/types/header.ts b/src/hdk/header.ts similarity index 96% rename from src/types/header.ts rename to src/hdk/header.ts index 27776f67..747997e2 100644 --- a/src/types/header.ts +++ b/src/hdk/header.ts @@ -3,10 +3,11 @@ import { DnaHash, EntryHash, HeaderHash, - Signature -} from "./common" -import { EntryType } from "./entry" -import { HoloHashed, Timestamp } from "./common" + HoloHashed, + Signature, + Timestamp, +} from "../types.js"; +import { EntryType } from "./entry.js"; export interface SignedHeaderHashed { header: HoloHashed; @@ -154,4 +155,4 @@ export interface Create { entry_type: EntryType; entry_hash: EntryHash; -} \ No newline at end of file +} diff --git a/src/hdk/index.ts b/src/hdk/index.ts new file mode 100644 index 00000000..f5e35f1e --- /dev/null +++ b/src/hdk/index.ts @@ -0,0 +1,4 @@ +export * from "./capabilities.js"; +export * from "./dht-ops.js"; +export * from "./entry.js"; +export * from "./header.js"; diff --git a/src/index.ts b/src/index.ts index e95ff0bc..7ba599ef 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,4 @@ -export * from './api/admin' -export * from './api/app' -export * from './api/types' -export * from './websocket/admin' -export * from './websocket/app' -export * from './types' -export * from './bundle' +export * from "./api/index.js"; +export * from "./hdk/index.js"; +export * from "./bundle.js"; +export * from "./types.js"; diff --git a/src/tsconfig.es.json b/src/tsconfig.es.json deleted file mode 100644 index ad63b4d9..00000000 --- a/src/tsconfig.es.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "../tsconfig", - "compilerOptions": { - "outDir": "../lib.es", - "module": "es2015", - "sourceMap": true, - "moduleResolution": "node", - "tsBuildInfoFile": "../.tsbuildinfo" - }, - "include": [ - "**/*" - ] -} \ No newline at end of file diff --git a/src/tsconfig.json b/src/tsconfig.json deleted file mode 100644 index e6b602f4..00000000 --- a/src/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../tsconfig", - "compilerOptions": { - "outDir": "../lib", - "sourceMap": true, - "tsBuildInfoFile": "../.tsbuildinfo" - }, - "include": [ - "**/*" - ] -} \ No newline at end of file diff --git a/src/types/common.ts b/src/types.ts similarity index 99% rename from src/types/common.ts rename to src/types.ts index 8ced5b61..e45ad49d 100644 --- a/src/types/common.ts +++ b/src/types.ts @@ -27,4 +27,4 @@ export type Timestamp = number; export interface HoloHashed { hash: HoloHash; content: T; -} \ No newline at end of file +} diff --git a/src/types/capabilities.ts b/src/types/capabilities.ts deleted file mode 100644 index 388fcdc8..00000000 --- a/src/types/capabilities.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { AgentPubKey } from "./common" - -export type CapSecret = Uint8Array; - -export interface CapClaim { - tag: string; - grantor: AgentPubKey; - secret: CapSecret; -} - -export interface ZomeCallCapGrant { - tag: string; - access: CapAccess; - functions: Array<{ zome: string; fn_name: string }>; -} - -export type CapAccess = - | "Unrestricted" - | { - Transferable: { secret: CapSecret }; - } - | { Assigned: { secret: CapSecret; assignees: AgentPubKey[] } }; - -export type CapGrant = - | { - ChainAuthor: AgentPubKey; - } - | { - RemoteAgent: ZomeCallCapGrant; - }; \ No newline at end of file diff --git a/src/types/index.ts b/src/types/index.ts deleted file mode 100644 index 4dd0ba24..00000000 --- a/src/types/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./capabilities" -export * from "./common" -export * from "./dht-ops" -export * from "./entry" -export * from "./header" \ No newline at end of file diff --git a/src/websocket/admin.ts b/src/websocket/admin.ts deleted file mode 100644 index a8df78f0..00000000 --- a/src/websocket/admin.ts +++ /dev/null @@ -1,153 +0,0 @@ -/** - * Defines AdminWebsocket, an easy-to-use websocket implementation of the - * Conductor Admin API - * - * const client = AdminWebsocket.connect( - * 'ws://localhost:9000' - * ) - * - * client.generateAgentPubKey() - * .then(agentPubKey => { - * console.log('Agent successfully generated:', agentPubKey) - * }) - * .catch(err => { - * console.error('problem generating agent:', err) - * }) - */ - -import * as Api from '../api/admin' -import { WsClient } from './client' -import { catchError, promiseTimeout, DEFAULT_TIMEOUT } from './common' -import { Transformer, requesterTransformer, Requester } from '../api/common' -import { getLauncherEnvironment } from '../environments/launcher' - -export class AdminWebsocket implements Api.AdminApi { - client: WsClient - defaultTimeout: number - - constructor(client: WsClient, defaultTimeout?: number) { - this.client = client - this.defaultTimeout = defaultTimeout === undefined ? DEFAULT_TIMEOUT : defaultTimeout - } - - static async connect(url: string, defaultTimeout?: number): Promise { - // Check if we are in the launcher's environment, and if so, redirect the url to connect to - const env = await getLauncherEnvironment() - - if (env) { - url = `ws://localhost:${env.ADMIN_INTERFACE_PORT}` - } - - const wsClient = await WsClient.connect(url) - return new AdminWebsocket(wsClient, defaultTimeout) - } - - _requester = (tag: string, transformer?: Transformer) => - requesterTransformer( - (req, timeout) => promiseTimeout(this.client.request(req), tag, timeout || this.defaultTimeout).then(catchError), - tag, - transformer - ) - - // the specific request/response types come from the Interface - // which this class implements - attachAppInterface: Requester - = this._requester('attach_app_interface') - // Deprecated - activateApp: Requester - = this._requester('activate_app') - // Deprecated - deactivateApp: Requester - = this._requester('deactivate_app') - enableApp: Requester - = this._requester('enable_app') - disableApp: Requester - = this._requester('disable_app') - startApp: Requester - = this._requester('start_app') - dumpState: Requester - = this._requester('dump_state', dumpStateTransform) - dumpFullState: Requester - = this._requester('dump_full_state') - generateAgentPubKey: Requester - = this._requester('generate_agent_pub_key') - registerDna: Requester - = this._requester('register_dna') - installApp: Requester - = this._requester('install_app') - uninstallApp: Requester - = this._requester('uninstall_app') - installAppBundle: Requester - = this._requester('install_app_bundle') - createCloneCell: Requester - = this._requester('create_clone_cell') - listDnas: Requester - = this._requester('list_dnas') - listCellIds: Requester - = this._requester('list_cell_ids') - // Deprecated - listActiveApps: Requester - = this._requester('list_active_apps') - listApps: Requester - = this._requester('list_apps', listAppsTransform) - listAppInterfaces: Requester - = this._requester('list_app_interfaces') - requestAgentInfo: Requester - = this._requester('request_agent_info') - addAgentInfo: Requester - = this._requester('add_agent_info') -} - -interface InternalListAppsRequest { - status_filter?: - { Running: null } - | { Enabled: null } - | { Paused: null } - | { Disabled: null } - | { Stopped: null } -} - -const listAppsTransform: Transformer = { - input: (req) => { - const args: InternalListAppsRequest = {} - - if (req.status_filter) { - args.status_filter = getAppStatusInApiForm(req.status_filter) - } - - return args - }, - output: (res) => res, -} - -const dumpStateTransform: Transformer = { - input: (req) => req, - output: (res: string): Api.DumpStateResponse => { - return JSON.parse(res) - }, -} - -function getAppStatusInApiForm(status_filter: Api.AppStatusFilter) { - switch (status_filter) { - case Api.AppStatusFilter.Running: - return { - Running: null, - } - case Api.AppStatusFilter.Enabled: - return { - Enabled: null, - } - case Api.AppStatusFilter.Paused: - return { - Paused: null, - } - case Api.AppStatusFilter.Disabled: - return { - Disabled: null, - } - case Api.AppStatusFilter.Stopped: - return { - Stopped: null, - } - } -} \ No newline at end of file diff --git a/src/websocket/app.ts b/src/websocket/app.ts deleted file mode 100644 index 1eb4bff3..00000000 --- a/src/websocket/app.ts +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Defines AppWebsocket, an easy-to-use websocket implementation of the - * Conductor API for apps - * - * const client = AppWebsocket.connect( - * 'ws://localhost:9000', - * signal => console.log('got a signal:', signal) - * ) - * - * client.callZome({...}) // TODO: show what's in here - * .then(() => { - * console.log('DNA successfully installed') - * }) - * .catch(err => { - * console.error('problem installing DNA:', err) - * }) - */ -import { encode, decode } from '@msgpack/msgpack' - -import { AppApi, AppInfoRequest, AppInfoResponse, CallZomeRequestGeneric, CallZomeResponseGeneric, AppSignalCb } from '../api/app' -import { WsClient } from './client' -import { catchError, promiseTimeout, DEFAULT_TIMEOUT } from './common' -import { Transformer, requesterTransformer, Requester } from '../api/common' -import { getLauncherEnvironment } from '../environments/launcher' -import { InstalledAppId } from '../types/common' - -export class AppWebsocket implements AppApi { - client: WsClient - defaultTimeout: number - - constructor(client: WsClient, defaultTimeout?: number, protected overrideInstalledAppId?: InstalledAppId) { - this.client = client - this.defaultTimeout = defaultTimeout === undefined ? DEFAULT_TIMEOUT : defaultTimeout - } - - static async connect(url: string, defaultTimeout?: number, signalCb?: AppSignalCb): Promise { - // Check if we are in the launcher's environment, and if so, redirect the url to connect to - const env = await getLauncherEnvironment() - - if (env) { - url = `ws://localhost:${env.APP_INTERFACE_PORT}` - } - - const wsClient = await WsClient.connect(url, signalCb) - return new AppWebsocket(wsClient, defaultTimeout, env ? env.INSTALLED_APP_ID : undefined) - } - - _requester = (tag: string, transformer?: Transformer) => - requesterTransformer( - (req, timeout) => promiseTimeout(this.client.request(req), tag, timeout || this.defaultTimeout).then(catchError), - tag, - transformer - ) - - appInfo: Requester - = this._requester('app_info', appInfoTransform(this.overrideInstalledAppId)) - callZome: Requester, CallZomeResponseGeneric> - = this._requester('zome_call', callZomeTransform) -} - -const callZomeTransform: Transformer, CallZomeRequestGeneric, CallZomeResponseGeneric, CallZomeResponseGeneric> = { - input: (req: CallZomeRequestGeneric): CallZomeRequestGeneric => { - return { - ...req, - payload: encode(req.payload), - } - }, - output: (res: CallZomeResponseGeneric): CallZomeResponseGeneric => { - return decode(res) - }, -} - -const appInfoTransform = (overrideInstalledAppId?: InstalledAppId): Transformer => ({ - input: (req: AppInfoRequest): AppInfoRequest => { - if (overrideInstalledAppId) { - return { - installed_app_id: overrideInstalledAppId, - } - } - - return req - }, - output: (res: AppInfoResponse): AppInfoResponse => { - return res - }, -}) \ No newline at end of file diff --git a/src/websocket/common.ts b/src/websocket/common.ts deleted file mode 100644 index 2b9a0c9b..00000000 --- a/src/websocket/common.ts +++ /dev/null @@ -1,32 +0,0 @@ -const ERROR_TYPE = 'error' -export const DEFAULT_TIMEOUT = 15000 - -export const catchError = (res: any) => { - return res.type === ERROR_TYPE - ? Promise.reject(res) - : Promise.resolve(res) -} - -export const promiseTimeout = (promise: Promise, tag: string, ms: number) => { - let id: NodeJS.Timeout - - const timeout = new Promise((_, reject) => { - id = setTimeout(() => { - clearTimeout(id) - reject(new Error(`Timed out in ${ms}ms: ${tag}`)) - }, ms) - }) - - return new Promise((res, rej) => { - Promise.race([ - promise, - timeout - ]).then((a) => { - clearTimeout(id) - return res(a) - }) - .catch(e => { - return rej(e) - }) - }) -} diff --git a/test/e2e/fixture/zomes/foo/Cargo.toml b/test/e2e/fixture/zomes/foo/Cargo.toml index a52be6e0..ba63dcdf 100644 --- a/test/e2e/fixture/zomes/foo/Cargo.toml +++ b/test/e2e/fixture/zomes/foo/Cargo.toml @@ -2,14 +2,12 @@ name = "test_wasm_foo" version = "0.0.1" authors = [ "thedavidmeister", "thedavidmeister@gmail.com" ] -edition = "2018" +edition = "2021" [lib] name = "test_wasm_foo" crate-type = [ "cdylib", "rlib" ] [dependencies] -serde = "=1.0.123" -serde_yaml = "0.8.0" -rmp-serde = "0.15.0" -hdk = "=0.0.118" +serde = "1" +hdk = "0.0.135" diff --git a/test/e2e/fixture/zomes/foo/src/lib.rs b/test/e2e/fixture/zomes/foo/src/lib.rs index f0c02208..c7c28685 100644 --- a/test/e2e/fixture/zomes/foo/src/lib.rs +++ b/test/e2e/fixture/zomes/foo/src/lib.rs @@ -28,7 +28,7 @@ fn init(_: ()) -> ExternResult { access: ().into(), functions: foo_functions, })?; - // NB: ideally we want to simply create a single CapGrant with all three functions exposed, + // NB: ideally we want to simply create a single CapGrant with both functions exposed, // but there is a bug in Holochain which currently prevents this. After this bug is fixed, // this can be collapsed to a single CapGrantEntry with two functions. // see: https://github.com/holochain/holochain/issues/418 @@ -40,14 +40,6 @@ fn init(_: ()) -> ExternResult { access: ().into(), functions: emitter_functions, })?; - let mut properties_functions = BTreeSet::new(); - properties_functions.insert((zome_info()?.name, "properties".into())); - create_cap_grant(CapGrantEntry { - tag: "".into(), - // empty access converts to unrestricted - access: ().into(), - functions: properties_functions, - })?; Ok(InitCallbackResult::Pass) } @@ -69,12 +61,3 @@ fn emitter(_: ()) -> ExternResult { Err(e) => Err(e), } } - -#[derive(Debug, Deserialize, Serialize, SerializedBytes)] -struct DnaProperties(serde_yaml::Value); - -#[hdk_extern] -fn properties(_: ()) -> ExternResult { - let properties = dna_info()?.properties; - Ok(properties.try_into()?) -} diff --git a/test/e2e/index.ts b/test/e2e/index.ts index 182cda4e..4afd30ae 100644 --- a/test/e2e/index.ts +++ b/test/e2e/index.ts @@ -1,292 +1,302 @@ -import test, { Test } from "tape" - -import { AdminWebsocket } from "../../src/websocket/admin" -import { AppWebsocket } from "../../src/websocket/app" -import { WsClient } from "../../src/websocket/client" +import { decode } from "@msgpack/msgpack"; +import fs from "node:fs"; +import test, { Test } from "tape"; +import zlib from "zlib"; +import { + AdminWebsocket, + AppStatusFilter, + DnaBundle, + EnableAppResponse, + InstalledAppInfoStatus, +} from "../../src/api/admin/index.js"; +import { + AppSignal, + CallZomeRequest, + AppWebsocket, +} from "../../src/api/app/index.js"; +import { WsClient } from "../../src/api/client.js"; import { - installAppAndDna, - withConductor, - launch, CONFIG_PATH, CONFIG_PATH_1, - FIXTURE_PATH -} from "./util" -import { fakeAgentPubKey, InstalledAppInfoStatus } from "../../src/api/types" -import { AppSignal, CallZomeRequest } from "../../src/api/app" -import { appBundleWithProperties } from "../../src/bundle" -import zlib from "zlib" -import fs from "fs" -import { - DnaBundle, - AppStatusFilter, - EnableAppResponse -} from "../../src/api/admin" -import { decode } from "@msgpack/msgpack" + FIXTURE_PATH, + installAppAndDna, + launch, + withConductor, +} from "./util.js"; + +const delay = (ms: number) => new Promise((r) => setTimeout(r, ms)); -const delay = (ms: number) => new Promise((r) => setTimeout(r, ms)) +const fakeAgentPubKey = () => + Buffer.from( + [0x84, 0x20, 0x24].concat( + "000000000000000000000000000000000000" + .split("") + .map((x) => parseInt(x, 10)) + ) + ); -const ADMIN_PORT = 33001 -const ADMIN_PORT_1 = 33002 +const ADMIN_PORT = 33001; +const ADMIN_PORT_1 = 33002; -const TEST_ZOME_NAME = "foo" +const TEST_ZOME_NAME = "foo"; test( "admin smoke test: registerDna + installApp + uninstallApp", withConductor(ADMIN_PORT, async (t: Test) => { - const installed_app_id = "app" + const installed_app_id = "app"; const admin = await AdminWebsocket.connect( `ws://localhost:${ADMIN_PORT}`, 12000 - ) + ); - const agent_key = await admin.generateAgentPubKey() - t.ok(agent_key) + const agent_key = await admin.generateAgentPubKey(); + t.ok(agent_key); - const path = `${FIXTURE_PATH}/test.dna` + const path = `${FIXTURE_PATH}/test.dna`; const hash = await admin.registerDna({ path, - }) + }); - t.ok(hash) - const cell_role = "thedna" + t.ok(hash); + const cell_role = "thedna"; const installedApp = await admin.installApp({ installed_app_id, agent_key, dnas: [{ hash, role_id: cell_role }], - }) + }); - const status: InstalledAppInfoStatus = installedApp.status - t.deepEqual(status, { disabled: { reason: { never_started: null } } }) + const status: InstalledAppInfoStatus = installedApp.status; + t.deepEqual(status, { disabled: { reason: { never_started: null } } }); const runningApps = await admin.listApps({ status_filter: AppStatusFilter.Running, - }) - console.log("running", runningApps) - t.equal(runningApps.length, 0) + }); + console.log("running", runningApps); + t.equal(runningApps.length, 0); - const startApp1 = await admin.startApp({ installed_app_id }) - t.notOk(startApp1) + const startApp1 = await admin.startApp({ installed_app_id }); + t.notOk(startApp1); - let allAppsInfo = await admin.listApps({}) - console.log("allAppsInfo", allAppsInfo) - t.equal(allAppsInfo.length, 1) + let allAppsInfo = await admin.listApps({}); + console.log("allAppsInfo", allAppsInfo); + t.equal(allAppsInfo.length, 1); const runningAppsInfo = await admin.listApps({ status_filter: AppStatusFilter.Running, - }) + }); const disabledAppsInfo = await admin.listApps({ status_filter: AppStatusFilter.Disabled, - }) + }); const pausedAppsInfo = await admin.listApps({ status_filter: AppStatusFilter.Paused, - }) - t.equal(runningAppsInfo.length, 0) - t.equal(pausedAppsInfo.length, 0) - t.equal(disabledAppsInfo.length, 1) - t.equal(disabledAppsInfo[0].cell_data.length, 1) + }); + t.equal(runningAppsInfo.length, 0); + t.equal(pausedAppsInfo.length, 0); + t.equal(disabledAppsInfo.length, 1); + t.equal(disabledAppsInfo[0].cell_data.length, 1); t.deepEqual(disabledAppsInfo[0].status, { disabled: { reason: { never_started: null } }, - }) + }); - const { app, errors } = await admin.enableApp({ installed_app_id }) - t.deepEqual(app.status, { running: null }) - t.equal(app.cell_data[0].role_id, cell_role) - t.equal(app.installed_app_id, installed_app_id) - t.equal(errors.length, 0) + const { app, errors } = await admin.enableApp({ installed_app_id }); + t.deepEqual(app.status, { running: null }); + t.equal(app.cell_data[0].role_id, cell_role); + t.equal(app.installed_app_id, installed_app_id); + t.equal(errors.length, 0); const activeApps2 = await admin.listApps({ status_filter: AppStatusFilter.Running, - }) - t.equal(activeApps2.length, 1) - t.equal(activeApps2[0].installed_app_id, installed_app_id) + }); + t.equal(activeApps2.length, 1); + t.equal(activeApps2[0].installed_app_id, installed_app_id); const runningAppsInfo2 = await admin.listApps({ status_filter: AppStatusFilter.Running, - }) + }); const disabledAppsInfo2 = await admin.listApps({ status_filter: AppStatusFilter.Disabled, - }) + }); const pausedAppsInfo2 = await admin.listApps({ status_filter: AppStatusFilter.Paused, - }) - t.equal(pausedAppsInfo2.length, 0) - t.equal(disabledAppsInfo2.length, 0) - t.equal(runningAppsInfo2.length, 1) - t.equal(runningAppsInfo2[0].cell_data.length, 1) - t.deepEqual(runningAppsInfo2[0].status, { running: null }) + }); + t.equal(pausedAppsInfo2.length, 0); + t.equal(disabledAppsInfo2.length, 0); + t.equal(runningAppsInfo2.length, 1); + t.equal(runningAppsInfo2[0].cell_data.length, 1); + t.deepEqual(runningAppsInfo2[0].status, { running: null }); - await admin.attachAppInterface({ port: 0 }) - await admin.disableApp({ installed_app_id }) + await admin.attachAppInterface({ port: 0 }); + await admin.disableApp({ installed_app_id }); const runningAppsInfo3 = await admin.listApps({ status_filter: AppStatusFilter.Running, - }) + }); const disabledAppsInfo3 = await admin.listApps({ status_filter: AppStatusFilter.Disabled, - }) + }); const pausedAppsInfo3 = await admin.listApps({ status_filter: AppStatusFilter.Paused, - }) - t.equal(runningAppsInfo3.length, 0) - t.equal(pausedAppsInfo3.length, 0) - t.equal(disabledAppsInfo3.length, 1) + }); + t.equal(runningAppsInfo3.length, 0); + t.equal(pausedAppsInfo3.length, 0); + t.equal(disabledAppsInfo3.length, 1); t.deepEqual(disabledAppsInfo3[0].status, { disabled: { reason: { user: null } }, - }) + }); - let dnas = await admin.listDnas() - t.equal(dnas.length, 1) + let dnas = await admin.listDnas(); + t.equal(dnas.length, 1); const activeApps3 = await admin.listApps({ status_filter: AppStatusFilter.Running, - }) - t.equal(activeApps3.length, 0) + }); + t.equal(activeApps3.length, 0); // NB: missing dumpState because it requires a valid cell_id // install from hash and uid const newHash = await admin.registerDna({ hash, uid: "123456", - }) - t.ok(newHash) + }); + t.ok(newHash); - dnas = await admin.listDnas() - t.equal(dnas.length, 2) + dnas = await admin.listDnas(); + t.equal(dnas.length, 2); - await admin.uninstallApp({ installed_app_id }) - allAppsInfo = await admin.listApps({}) - console.log("allAppsInfo", allAppsInfo) - t.equal(allAppsInfo.length, 0) + await admin.uninstallApp({ installed_app_id }); + allAppsInfo = await admin.listApps({}); + console.log("allAppsInfo", allAppsInfo); + t.equal(allAppsInfo.length, 0); }) -) +); test( "admin smoke test: installBundle", withConductor(ADMIN_PORT, async (t: Test) => { - const installed_app_id = "app" + const installed_app_id = "app"; const admin = await AdminWebsocket.connect( `ws://localhost:${ADMIN_PORT}`, 12000 - ) + ); - const agent_key = await admin.generateAgentPubKey() - t.ok(agent_key) + const agent_key = await admin.generateAgentPubKey(); + t.ok(agent_key); - const path = `${FIXTURE_PATH}/test.happ` + const path = `${FIXTURE_PATH}/test.happ`; const installedApp = await admin.installAppBundle({ path, agent_key, installed_app_id, membrane_proofs: {}, - }) - t.ok(installedApp) + }); + t.ok(installedApp); t.deepEqual(installedApp.status, { disabled: { reason: { never_started: null } }, - }) + }); const runningApps1 = await admin.listApps({ status_filter: AppStatusFilter.Running, - }) - t.equal(runningApps1.length, 0) + }); + t.equal(runningApps1.length, 0); - const enabledAppInfo = await admin.enableApp({ installed_app_id }) - t.deepEqual(enabledAppInfo.app.status, { running: null }) - t.equal(enabledAppInfo.app.installed_app_id, installed_app_id) - t.equal(enabledAppInfo.errors.length, 0) + const enabledAppInfo = await admin.enableApp({ installed_app_id }); + t.deepEqual(enabledAppInfo.app.status, { running: null }); + t.equal(enabledAppInfo.app.installed_app_id, installed_app_id); + t.equal(enabledAppInfo.errors.length, 0); const runningApps2 = await admin.listApps({ status_filter: AppStatusFilter.Running, - }) - t.equal(runningApps2.length, 1) - t.equal(runningApps2[0].installed_app_id, installed_app_id) + }); + t.equal(runningApps2.length, 1); + t.equal(runningApps2[0].installed_app_id, installed_app_id); - const cellIds = await admin.listCellIds() - t.equal(cellIds.length, 1) - t.deepEqual(cellIds[0], installedApp.cell_data[0].cell_id) + const cellIds = await admin.listCellIds(); + t.equal(cellIds.length, 1); + t.deepEqual(cellIds[0], installedApp.cell_data[0].cell_id); - await admin.attachAppInterface({ port: 0 }) - await admin.disableApp({ installed_app_id }) + await admin.attachAppInterface({ port: 0 }); + await admin.disableApp({ installed_app_id }); - const dnas = await admin.listDnas() - t.equal(dnas.length, 1) + const dnas = await admin.listDnas(); + t.equal(dnas.length, 1); const activeApps3 = await admin.listApps({ status_filter: AppStatusFilter.Running, - }) - t.equal(activeApps3.length, 0) + }); + t.equal(activeApps3.length, 0); }) -) +); test( "admin register dna with full binary bundle", withConductor(ADMIN_PORT, async (t: Test) => { - const installed_app_id = "app" + const installed_app_id = "app"; const admin = await AdminWebsocket.connect( `ws://localhost:${ADMIN_PORT}`, 12000 - ) + ); - const agent_key = await admin.generateAgentPubKey() - t.ok(agent_key) + const agent_key = await admin.generateAgentPubKey(); + t.ok(agent_key); - const path = `${FIXTURE_PATH}/test.dna` + const path = `${FIXTURE_PATH}/test.dna`; - const zippedDnaBundle = fs.readFileSync(path) - const encodedDnaBundle = zlib.gunzipSync(zippedDnaBundle) + const zippedDnaBundle = fs.readFileSync(path); + const encodedDnaBundle = zlib.gunzipSync(zippedDnaBundle); - const dnaBundle: DnaBundle = decode(encodedDnaBundle.buffer) as DnaBundle + const dnaBundle: DnaBundle = decode(encodedDnaBundle.buffer) as DnaBundle; const hash = await admin.registerDna({ bundle: dnaBundle, - }) - t.ok(hash) - const role_id = "thedna" + }); + t.ok(hash); + const role_id = "thedna"; await admin.installApp({ installed_app_id, agent_key, dnas: [{ hash, role_id: "thedna" }], - }) + }); const runningApps1 = await admin.listApps({ status_filter: AppStatusFilter.Running, - }) - t.equal(runningApps1.length, 0) + }); + t.equal(runningApps1.length, 0); const enabledAppInfo: EnableAppResponse = await admin.enableApp({ installed_app_id, - }) - t.deepEqual(enabledAppInfo.app.status, { running: null }) - t.equal(enabledAppInfo.app.cell_data[0].role_id, role_id) - t.equal(enabledAppInfo.app.installed_app_id, installed_app_id) - t.equal(enabledAppInfo.errors.length, 0) + }); + t.deepEqual(enabledAppInfo.app.status, { running: null }); + t.equal(enabledAppInfo.app.cell_data[0].role_id, role_id); + t.equal(enabledAppInfo.app.installed_app_id, installed_app_id); + t.equal(enabledAppInfo.errors.length, 0); const runningApps2 = await admin.listApps({ status_filter: AppStatusFilter.Running, - }) - t.equal(runningApps2.length, 1) - t.equal(runningApps2[0].installed_app_id, installed_app_id) + }); + t.equal(runningApps2.length, 1); + t.equal(runningApps2[0].installed_app_id, installed_app_id); - await admin.attachAppInterface({ port: 0 }) - await admin.disableApp({ installed_app_id }) + await admin.attachAppInterface({ port: 0 }); + await admin.disableApp({ installed_app_id }); - const dnas = await admin.listDnas() - t.equal(dnas.length, 1) + const dnas = await admin.listDnas(); + t.equal(dnas.length, 1); const runningApps3 = await admin.listApps({ status_filter: AppStatusFilter.Running, - }) - t.equal(runningApps3.length, 0) + }); + t.equal(runningApps3.length, 0); }) -) +); test( "can call a zome function and then deactivate", withConductor(ADMIN_PORT, async (t: Test) => { const { installed_app_id, cell_id, role_id, client, admin } = - await installAppAndDna(ADMIN_PORT) - let info = await client.appInfo({ installed_app_id }, 1000) - t.deepEqual(info.cell_data[0].cell_id, cell_id) - t.equal(info.cell_data[0].role_id, role_id) - t.deepEqual(info.status, { running: null }) + await installAppAndDna(ADMIN_PORT); + let info = await client.appInfo({ installed_app_id }, 1000); + t.deepEqual(info.cell_data[0].cell_id, cell_id); + t.equal(info.cell_data[0].role_id, role_id); + t.deepEqual(info.status, { running: null }); const response = await client.callZome( { // TODO: write a test with a real capability secret. @@ -298,23 +308,23 @@ test( payload: null, }, 30000 - ) - t.equal(response, "foo") + ); + t.equal(response, "foo"); - await admin.disableApp({ installed_app_id }) - info = await client.appInfo({ installed_app_id }, 1000) - t.deepEqual(info.status, { disabled: { reason: { user: null } } }) + await admin.disableApp({ installed_app_id }); + info = await client.appInfo({ installed_app_id }, 1000); + t.deepEqual(info.status, { disabled: { reason: { user: null } } }); }) -) +); test( "can call a zome function twice, reusing args", withConductor(ADMIN_PORT, async (t: Test) => { const { installed_app_id, cell_id, role_id, client } = - await installAppAndDna(ADMIN_PORT) - const info = await client.appInfo({ installed_app_id }, 1000) - t.deepEqual(info.cell_data[0].cell_id, cell_id) - t.equal(info.cell_data[0].role_id, role_id) + await installAppAndDna(ADMIN_PORT); + const info = await client.appInfo({ installed_app_id }, 1000); + t.deepEqual(info.cell_data[0].cell_id, cell_id); + t.equal(info.cell_data[0].role_id, role_id); const args: CallZomeRequest = { // TODO: write a test with a real capability secret. cap_secret: null, @@ -323,13 +333,13 @@ test( fn_name: "foo", provenance: fakeAgentPubKey(), payload: null, - } - const response = await client.callZome(args, 30000) - t.equal(response, "foo") - const response2 = await client.callZome(args, 30000) - t.equal(response2, "foo") + }; + const response = await client.callZome(args, 30000); + t.equal(response, "foo"); + const response2 = await client.callZome(args, 30000); + t.equal(response2, "foo"); }) -) +); test( "can handle canceled response", @@ -339,24 +349,24 @@ test( send: () => { /* do nothing */ }, - }) - const prom = client.request("blah") - client.handleResponse({ id: 0 }) + }); + const prom = client.request("blah"); + client.handleResponse({ id: 0 }); try { - await prom + await prom; } catch (e) { - t.deepEqual(e, new Error("Response canceled by responder")) + t.deepEqual(e, new Error("Response canceled by responder")); } }) -) +); test( "can receive a signal", withConductor(ADMIN_PORT, async (t: Test) => { - let resolveSignalPromise: (value?: unknown) => void | undefined + let resolveSignalPromise: (value?: unknown) => void | undefined; const signalReceivedPromise = new Promise( (resolve) => (resolveSignalPromise = resolve) - ) + ); const signalCb = (signal: AppSignal) => { t.deepEqual(signal, { type: "Signal", @@ -364,11 +374,11 @@ test( cellId: cell_id, payload: "i am a signal", }, - }) - resolveSignalPromise() - } + }); + resolveSignalPromise(); + }; - const { cell_id, client } = await installAppAndDna(ADMIN_PORT, signalCb) + const { cell_id, client } = await installAppAndDna(ADMIN_PORT, signalCb); // trigger an emit_signal await client.callZome({ cap_secret: null, @@ -377,15 +387,15 @@ test( fn_name: "emitter", provenance: fakeAgentPubKey(), payload: null, - }) - await signalReceivedPromise + }); + await signalReceivedPromise; }) -) +); test( "callZome rejects appropriately for ZomeCallUnauthorized", withConductor(ADMIN_PORT, async (t: Test) => { - const { cell_id, client } = await installAppAndDna(ADMIN_PORT) + const { cell_id, client } = await installAppAndDna(ADMIN_PORT); try { await client.callZome( { @@ -403,193 +413,138 @@ test( payload: null, }, 30000 - ) + ); } catch (e) { - t.equal(e.type, "error") - t.equal(e.data.type, "zome_call_unauthorized") + t.equal(e.type, "error"); + t.equal(e.data.type, "zome_call_unauthorized"); } }) -) +); // no conductor test("error is catchable when holochain socket is unavailable", async (t: Test) => { - const url = `ws://localhost:${ADMIN_PORT}` + const url = `ws://localhost:${ADMIN_PORT}`; try { - await AdminWebsocket.connect(url) + await AdminWebsocket.connect(url); } catch (e) { t.equal( e.message, `could not connect to holochain conductor, please check that a conductor service is running and available at ${url}` - ) + ); } try { - await AppWebsocket.connect(url) + await AppWebsocket.connect(url); } catch (e) { t.equal( e.message, `could not connect to holochain conductor, please check that a conductor service is running and available at ${url}` - ) + ); } -}) +}); test("can inject agents", async (t: Test) => { - const [conductor1, l1] = await launch(ADMIN_PORT, CONFIG_PATH) - const [conductor2, l2] = await launch(ADMIN_PORT_1, CONFIG_PATH_1) + const [conductor1, l1] = await launch(ADMIN_PORT, CONFIG_PATH); + const [conductor2, l2] = await launch(ADMIN_PORT_1, CONFIG_PATH_1); try { - const installed_app_id = "app" - const admin1 = await AdminWebsocket.connect( - `ws://localhost:${ADMIN_PORT}` - ) + const installed_app_id = "app"; + const admin1 = await AdminWebsocket.connect(`ws://localhost:${ADMIN_PORT}`); const admin2 = await AdminWebsocket.connect( `ws://localhost:${ADMIN_PORT_1}` - ) - const agent_key_1 = await admin1.generateAgentPubKey() - t.ok(agent_key_1) - const agent_key_2 = await admin2.generateAgentPubKey() - t.ok(agent_key_2) - const role = "thedna" - const path = `${FIXTURE_PATH}/test.dna` - const hash = await admin1.registerDna({ path }) - t.ok(hash) + ); + const agent_key_1 = await admin1.generateAgentPubKey(); + t.ok(agent_key_1); + const agent_key_2 = await admin2.generateAgentPubKey(); + t.ok(agent_key_2); + const role = "thedna"; + const path = `${FIXTURE_PATH}/test.dna`; + const hash = await admin1.registerDna({ path }); + t.ok(hash); let result = await admin1.installApp({ installed_app_id, agent_key: agent_key_1, dnas: [{ hash, role_id: role }], - }) - t.ok(result) - const app1_cell = result.cell_data[0].cell_id - const activeApp1Info = await admin1.enableApp({ installed_app_id }, 1000) - t.deepEqual(activeApp1Info.app.status, { running: null }) - t.equal(activeApp1Info.app.cell_data[0].role_id, role) - t.equal(activeApp1Info.app.installed_app_id, installed_app_id) - t.equal(activeApp1Info.errors.length, 0) + }); + t.ok(result); + const app1_cell = result.cell_data[0].cell_id; + const activeApp1Info = await admin1.enableApp({ installed_app_id }, 1000); + t.deepEqual(activeApp1Info.app.status, { running: null }); + t.equal(activeApp1Info.app.cell_data[0].role_id, role); + t.equal(activeApp1Info.app.installed_app_id, installed_app_id); + t.equal(activeApp1Info.errors.length, 0); - await delay(500) + await delay(500); // after activating an app requestAgentInfo should return the agentid // requesting info with null cell_id should return all agents known about. // otherwise it's just agents know about for that cell const conductor1_agentInfo = await admin1.requestAgentInfo({ cell_id: null, - }) - t.equal(conductor1_agentInfo.length, 1) + }); + t.equal(conductor1_agentInfo.length, 1); // agent2 with no activated apps there are no agents - let conductor2_agentInfo = await admin2.requestAgentInfo({ cell_id: null }) - t.equal(conductor2_agentInfo.length, 0) + let conductor2_agentInfo = await admin2.requestAgentInfo({ cell_id: null }); + t.equal(conductor2_agentInfo.length, 0); // but, after explicitly injecting an agent, we should see it - await admin2.addAgentInfo({ agent_infos: conductor1_agentInfo }) - conductor2_agentInfo = await admin2.requestAgentInfo({ cell_id: null }) - t.equal(conductor2_agentInfo.length, 1) - t.deepEqual(conductor1_agentInfo, conductor2_agentInfo) + await admin2.addAgentInfo({ agent_infos: conductor1_agentInfo }); + conductor2_agentInfo = await admin2.requestAgentInfo({ cell_id: null }); + t.equal(conductor2_agentInfo.length, 1); + t.deepEqual(conductor1_agentInfo, conductor2_agentInfo); // now install the app and activate it on agent 2. await admin2.registerDna({ path, - }) - t.ok(hash) + }); + t.ok(hash); result = await admin2.installApp({ installed_app_id, agent_key: agent_key_2, dnas: [{ hash, role_id: role }], - }) - t.ok(result) - const app2_cell = result.cell_data[0].cell_id - const activeApp2Info = await admin2.enableApp({ installed_app_id }) - t.deepEqual(activeApp2Info.app.status, { running: null }) - t.equal(activeApp2Info.app.cell_data[0].role_id, role) - t.equal(activeApp2Info.app.installed_app_id, installed_app_id) - t.equal(activeApp2Info.errors.length, 0) - - await delay(500) + }); + t.ok(result); + const app2_cell = result.cell_data[0].cell_id; + const activeApp2Info = await admin2.enableApp({ installed_app_id }); + t.deepEqual(activeApp2Info.app.status, { running: null }); + t.equal(activeApp2Info.app.cell_data[0].role_id, role); + t.equal(activeApp2Info.app.installed_app_id, installed_app_id); + t.equal(activeApp2Info.errors.length, 0); + + await delay(500); // observe 2 agent infos - conductor2_agentInfo = await admin2.requestAgentInfo({ cell_id: null }) - t.equal(conductor2_agentInfo.length, 2) + conductor2_agentInfo = await admin2.requestAgentInfo({ cell_id: null }); + t.equal(conductor2_agentInfo.length, 2); // now confirm that we can ask for just one cell - await admin1.addAgentInfo({ agent_infos: conductor2_agentInfo }) + await admin1.addAgentInfo({ agent_infos: conductor2_agentInfo }); const app1_agentInfo = await admin1.requestAgentInfo({ cell_id: app1_cell, - }) - t.equal(app1_agentInfo.length, 1) + }); + t.equal(app1_agentInfo.length, 1); const app2_agentInfo = await admin2.requestAgentInfo({ cell_id: app2_cell, - }) - t.equal(app2_agentInfo.length, 1) + }); + t.equal(app2_agentInfo.length, 1); } finally { - conductor1.kill() - conductor2.kill() - l1.kill() - l2.kill() + conductor1.kill(); + conductor2.kill(); + l1.kill(); + l2.kill(); } -}) +}); test( "admin smoke test: listAppInterfaces + attachAppInterface", withConductor(ADMIN_PORT, async (t: Test) => { - const admin = await AdminWebsocket.connect( - `ws://localhost:${ADMIN_PORT}` - ) + const admin = await AdminWebsocket.connect(`ws://localhost:${ADMIN_PORT}`); - let interfaces = await admin.listAppInterfaces() - t.equal(interfaces.length, 0) + let interfaces = await admin.listAppInterfaces(); + t.equal(interfaces.length, 0); - await admin.attachAppInterface({ port: 21212 }) + await admin.attachAppInterface({ port: 21212 }); - interfaces = await admin.listAppInterfaces() - t.equal(interfaces.length, 1) - }) -) - -test("can install app bundle with custom properties", withConductor(ADMIN_PORT, async (t: Test) => { - const admin = await AdminWebsocket.connect( - `ws://localhost:${ADMIN_PORT}`, - 12000 - ) - - const agent_key = await admin.generateAgentPubKey() - t.ok(agent_key) - - const path = `${FIXTURE_PATH}/test.happ` - const installed_app_id = "app" - const properties = "specialProperties" - const appSource = await appBundleWithProperties({ path }, { foo: properties }) - const installedApp = await admin.installAppBundle({ - ...appSource, - agent_key, - installed_app_id, - membrane_proofs: {}, + interfaces = await admin.listAppInterfaces(); + t.equal(interfaces.length, 1); }) - t.ok(installedApp) - t.deepEqual(installedApp.status, { - disabled: { reason: { never_started: null } }, - }) - - const cell_id = installedApp.cell_data[0].cell_id - - const enabledAppInfo = await admin.enableApp({ installed_app_id }) - t.deepEqual(enabledAppInfo.app.status, { running: null }) - t.equal(enabledAppInfo.app.installed_app_id, installed_app_id) - t.equal(enabledAppInfo.errors.length, 0) - - const { port: appPort} = await admin.attachAppInterface({ port: 0 }) - const app = await AppWebsocket.connect( - `ws://localhost:${appPort}`, - 12000 - ) - - const response = await app.callZome( - { - cap_secret: null, - cell_id, - zome_name: TEST_ZOME_NAME, - fn_name: "properties", - provenance: fakeAgentPubKey(), - payload: null, - }, - 30000 - ) - t.deepEqual(response, properties) -})) +); diff --git a/test/e2e/util.ts b/test/e2e/util.ts index fafb9119..e90d27b4 100644 --- a/test/e2e/util.ts +++ b/test/e2e/util.ts @@ -1,20 +1,24 @@ -import { spawn, ChildProcessWithoutNullStreams } from "child_process" -import fs from "fs" -import os from "os" -import { InstalledAppId, CellId, RoleId } from "../../src/types/common" -import { AppWebsocket } from "../../src/websocket/app" -import { AdminWebsocket } from "../../src/websocket/admin" -import yaml from "js-yaml" -import { Test } from "tape" -export const FIXTURE_PATH = "./test/e2e/fixture" -export const CONFIG_PATH = `${FIXTURE_PATH}/test-config.yml` -export const CONFIG_PATH_1 = `${FIXTURE_PATH}/test-config-1.yml` +import { ChildProcessWithoutNullStreams, spawn } from "node:child_process"; +import fs from "node:fs"; +import yaml from "js-yaml"; +import os from "node:os"; +import { Test } from "tape"; +import { AppSignalCb } from "../../src/api/app/types.js"; +import { CellId, InstalledAppId, RoleId } from "../../src/types.js"; +import { AdminWebsocket } from "../../src/api/admin/websocket.js"; +import { AppWebsocket } from "../../src/api/app/websocket.js"; +export const FIXTURE_PATH = "./test/e2e/fixture"; +export const CONFIG_PATH = `${FIXTURE_PATH}/test-config.yml`; +export const CONFIG_PATH_1 = `${FIXTURE_PATH}/test-config-1.yml`; -const writeConfig = (port: number, configPath: fs.PathOrFileDescriptor): string => { - const dir = fs.mkdtempSync(`${os.tmpdir()}/holochain-test-`) - const lairDir = `${dir}/keystore` +const writeConfig = ( + port: number, + configPath: fs.PathOrFileDescriptor +): string => { + const dir = fs.mkdtempSync(`${os.tmpdir()}/holochain-test-`); + const lairDir = `${dir}/keystore`; if (!fs.existsSync(lairDir)) { - fs.mkdirSync(lairDir) + fs.mkdirSync(lairDir); } const yamlStr = yaml.safeDump({ @@ -30,84 +34,90 @@ const writeConfig = (port: number, configPath: fs.PathOrFileDescriptor): string type: "websocket", port, }, - } + }, ], - }) - fs.writeFileSync(configPath, yamlStr, "utf8") - console.info(`using database environment path: ${dir}`) - return lairDir -} + }); + fs.writeFileSync(configPath, yamlStr, "utf8"); + console.info(`using database environment path: ${dir}`); + return lairDir; +}; -const awaitInterfaceReady = (handle: ChildProcessWithoutNullStreams): Promise => +const awaitInterfaceReady = ( + handle: ChildProcessWithoutNullStreams +): Promise => new Promise((fulfill, reject) => { - const pattern = "Conductor ready." - let resolved = false + const pattern = "Conductor ready."; + let resolved = false; handle.on("close", (code) => { - resolved = true - console.info(`Conductor exited with code ${code}`) - reject(`Conductor exited before starting interface (code ${code})`) - }) + resolved = true; + console.info(`Conductor exited with code ${code}`); + reject(`Conductor exited before starting interface (code ${code})`); + }); handle.stdout.on("data", (data) => { if (resolved) { - return + return; } - const line = data.toString("utf8") + const line = data.toString("utf8"); if (line.match(pattern)) { - console.info(`Conductor process spawning completed.`) - resolved = true - fulfill(null) + console.info(`Conductor process spawning completed.`); + resolved = true; + fulfill(null); } - }) - }) + }); + }); -const HOLOCHAIN_BIN = "holochain" -const LAIR_BIN = "lair-keystore" +const HOLOCHAIN_BIN = "holochain"; +const LAIR_BIN = "lair-keystore"; -export const launch = async (port: number, configPath: fs.PathOrFileDescriptor) => { - const lairDir = await writeConfig(port, configPath) - console.log(`Spawning lair for test with keystore at: ${lairDir}`) +export const launch = async ( + port: number, + configPath: fs.PathOrFileDescriptor +) => { + const lairDir = await writeConfig(port, configPath); + console.log(`Spawning lair for test with keystore at: ${lairDir}`); const lairHandle = spawn(LAIR_BIN, ["-d", lairDir], { env: { // TODO: maybe put this behind a flag? RUST_BACKTRACE: "1", ...process.env, }, - }) + }); // Wait for lair to output data such as "#lair-keystore-ready#" before starting holochain await new Promise((resolve) => { - lairHandle.stdout.once("data", resolve) - }) + lairHandle.stdout.once("data", resolve); + }); - const handle = spawn(HOLOCHAIN_BIN, ["-c", configPath.toString()]) + const handle = spawn(HOLOCHAIN_BIN, ["-c", configPath.toString()]); handle.stdout.on("data", (data) => { - console.info("conductor: ", data.toString("utf8")) - }) + console.info("conductor: ", data.toString("utf8")); + }); handle.stderr.on("data", (data) => { - console.info("conductor> ", data.toString("utf8")) - }) - await awaitInterfaceReady(handle) - return [handle, lairHandle] -} + console.info("conductor> ", data.toString("utf8")); + }); + await awaitInterfaceReady(handle); + return [handle, lairHandle]; +}; -export const withConductor = (port: number, f: (t: Test) => Promise) => async (t: Test) => { - const [handle, lairHandle] = await launch(port, CONFIG_PATH) - try { - await f(t) - } catch (e) { - console.error("Test caught exception: ", e) - lairHandle.kill() - handle.kill() - throw e - } finally { - lairHandle.kill() - handle.kill() - } - t.end() -} +export const withConductor = + (port: number, f: (t: Test) => Promise) => async (t: Test) => { + const [handle, lairHandle] = await launch(port, CONFIG_PATH); + try { + await f(t); + } catch (e) { + console.error("Test caught exception: ", e); + lairHandle.kill(); + handle.kill(); + throw e; + } finally { + lairHandle.kill(); + handle.kill(); + } + t.end(); + }; export const installAppAndDna = async ( adminPort: number, - signalCb: (signal: any) => void = () => {} + signalCb?: AppSignalCb ): Promise<{ installed_app_id: InstalledAppId; cell_id: CellId; @@ -115,18 +125,18 @@ export const installAppAndDna = async ( client: AppWebsocket; admin: AdminWebsocket; }> => { - const installed_app_id = "app" - const role_id = "mydna" - const admin = await AdminWebsocket.connect(`ws://localhost:${adminPort}`) + const installed_app_id = "app"; + const role_id = "mydna"; + const admin = await AdminWebsocket.connect(`ws://localhost:${adminPort}`); - const path = `${FIXTURE_PATH}/test.dna` + const path = `${FIXTURE_PATH}/test.dna`; const hash = await admin.registerDna({ path, - }) + }); - console.log("THE HASH:", hash) + console.log("THE HASH:", hash); - const agent = await admin.generateAgentPubKey() + const agent = await admin.generateAgentPubKey(); const app = await admin.installApp({ installed_app_id, agent_key: agent, @@ -134,18 +144,18 @@ export const installAppAndDna = async ( { hash, role_id, - } + }, ], - }) - console.log("THE INSTALL RESULT:", app) - const cell_id = app.cell_data[0].cell_id - await admin.activateApp({ installed_app_id }) + }); + console.log("THE INSTALL RESULT:", app); + const cell_id = app.cell_data[0].cell_id; + await admin.activateApp({ installed_app_id }); // destructure to get whatever open port was assigned to the interface - const { port: appPort } = await admin.attachAppInterface({ port: 0 }) + const { port: appPort } = await admin.attachAppInterface({ port: 0 }); const client = await AppWebsocket.connect( `ws://localhost:${appPort}`, 12000, signalCb - ) - return { installed_app_id, cell_id, role_id, client, admin } -} + ); + return { installed_app_id, cell_id, role_id, client, admin }; +}; diff --git a/test/index.ts b/test/index.ts index 69bda07e..1b09e7cd 100644 --- a/test/index.ts +++ b/test/index.ts @@ -1 +1 @@ -import ('./e2e') +import "./e2e/index.js"; diff --git a/tryout.ts b/tryout.ts new file mode 100644 index 00000000..7bf0254f --- /dev/null +++ b/tryout.ts @@ -0,0 +1,14 @@ +import {AdminWebsocket} from './src/websocket/admin' + +const connect = async () => { + const ws = await AdminWebsocket.connect('ws://localhost:49677') + const cells = await ws.listCellIds() + const dnaHash = cells[0][0] + console.log('cells', dnaHash) + await ws.client.close() +} + +connect() +// const a = Uint8Array.from([257]) +// console.log('a', a) +// const agentInfo = await ws.requestAgentInfo({cell_id:}) \ No newline at end of file diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 00000000..d2bba3ca --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "lib" + }, + "exclude": [ + "test/**/*" + ] + } \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index b5c21fb9..ea621b3e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,25 +1,17 @@ { "compilerOptions": { - "target": "ES2020", - "module": "CommonJS", - - "composite": true, - "esModuleInterop": true, - + "module": "ESNext", + "target": "ESNext", + "moduleResolution": "Node", + "sourceMap": true, + "declaration": true, "forceConsistentCasingInFileNames": true, + "allowSyntheticDefaultImports": true, "useUnknownInCatchVariables": false, - "strict": true, "skipLibCheck": true, - - "types": [ - "node" - ] + "strict": true }, - - "files": [], - - "references": [ - { "path": "./src/tsconfig.json" }, - { "path": "./src/tsconfig.es.json" } + "include": [ + "src/**/*" ] -} \ No newline at end of file +}