From a7bda7e91fdc40c9a06e864b673f145b26c256a6 Mon Sep 17 00:00:00 2001 From: gabe Date: Fri, 6 Oct 2023 12:11:42 -0700 Subject: [PATCH] fix build --- package-lock.json | 1735 +++++++++++++++++++++++---- package.json | 5 + packages/dids/src/dht.ts | 156 +-- packages/dids/src/did-dht.ts | 328 ++--- packages/dids/src/types.ts | 2 +- packages/dids/tests/dht.spec.ts | 89 +- packages/dids/tests/did-dht.spec.ts | 414 +++---- 7 files changed, 2020 insertions(+), 709 deletions(-) diff --git a/package-lock.json b/package-lock.json index 567088f40..987024307 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,13 +17,17 @@ "packages/api", "packages/identity-agent" ], + "dependencies": { + "@typescript-eslint/eslint-plugin": "^6.7.4", + "@typescript-eslint/parser": "^6.7.4", + "eslint-plugin-mocha": "^10.2.0" + }, "devDependencies": { "@npmcli/package-json": "5.0.0" } }, "node_modules/@aashutoshrathi/word-wrap": { "version": "1.2.6", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -99,7 +103,6 @@ }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", - "dev": true, "license": "MIT", "dependencies": { "eslint-visitor-keys": "^3.3.0" @@ -113,7 +116,6 @@ }, "node_modules/@eslint-community/regexpp": { "version": "4.8.0", - "dev": true, "license": "MIT", "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -121,7 +123,6 @@ }, "node_modules/@eslint/eslintrc": { "version": "2.1.2", - "dev": true, "license": "MIT", "dependencies": { "ajv": "^6.12.4", @@ -143,7 +144,6 @@ }, "node_modules/@eslint/eslintrc/node_modules/ajv": { "version": "6.12.6", - "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", @@ -158,7 +158,6 @@ }, "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { "version": "1.1.11", - "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -167,12 +166,10 @@ }, "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { "version": "0.4.1", - "dev": true, "license": "MIT" }, "node_modules/@eslint/eslintrc/node_modules/minimatch": { "version": "3.1.2", - "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -183,7 +180,6 @@ }, "node_modules/@eslint/js": { "version": "8.48.0", - "dev": true, "license": "MIT", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -191,7 +187,6 @@ }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.10", - "dev": true, "license": "Apache-2.0", "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", @@ -204,7 +199,6 @@ }, "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { "version": "1.1.11", - "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -213,7 +207,6 @@ }, "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { "version": "3.1.2", - "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -224,7 +217,6 @@ }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", - "dev": true, "license": "Apache-2.0", "engines": { "node": ">=12.22" @@ -236,7 +228,6 @@ }, "node_modules/@humanwhocodes/object-schema": { "version": "1.2.1", - "dev": true, "license": "BSD-3-Clause" }, "node_modules/@ipld/dag-cbor": { @@ -441,7 +432,6 @@ }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", - "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", @@ -453,7 +443,6 @@ }, "node_modules/@nodelib/fs.stat": { "version": "2.0.5", - "dev": true, "license": "MIT", "engines": { "node": ">= 8" @@ -461,7 +450,6 @@ }, "node_modules/@nodelib/fs.walk": { "version": "1.2.8", - "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", @@ -806,7 +794,6 @@ }, "node_modules/@types/json-schema": { "version": "7.0.12", - "dev": true, "license": "MIT" }, "node_modules/@types/mocha": { @@ -833,9 +820,9 @@ } }, "node_modules/@types/semver": { - "version": "7.5.0", - "dev": true, - "license": "MIT" + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-OxepLK9EuNEIPxWNME+C6WwbRAOOI2o2BaQEGzz5Lu2e4Z5eDnEo+/aVEDMIXywoJitJ7xWd641wrGLZdtwRyw==" }, "node_modules/@types/sinon": { "version": "10.0.15", @@ -856,15 +843,15 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.4.0", - "dev": true, - "license": "MIT", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.4.tgz", + "integrity": "sha512-DAbgDXwtX+pDkAHwiGhqP3zWUGpW49B7eqmgpPtg+BKJXwdct79ut9+ifqOFPJGClGKSHXn2PTBatCnldJRUoA==", "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.4.0", - "@typescript-eslint/type-utils": "6.4.0", - "@typescript-eslint/utils": "6.4.0", - "@typescript-eslint/visitor-keys": "6.4.0", + "@typescript-eslint/scope-manager": "6.7.4", + "@typescript-eslint/type-utils": "6.7.4", + "@typescript-eslint/utils": "6.7.4", + "@typescript-eslint/visitor-keys": "6.7.4", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -889,15 +876,59 @@ } } }, - "node_modules/@typescript-eslint/parser": { - "version": "6.4.0", - "dev": true, - "license": "BSD-2-Clause", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.4.tgz", + "integrity": "sha512-SdGqSLUPTXAXi7c3Ob7peAGVnmMoGzZ361VswK2Mqf8UOYcODiYvs8rs5ILqEdfvX1lE7wEZbLyELCW+Yrql1A==", "dependencies": { - "@typescript-eslint/scope-manager": "6.4.0", - "@typescript-eslint/types": "6.4.0", - "@typescript-eslint/typescript-estree": "6.4.0", - "@typescript-eslint/visitor-keys": "6.4.0", + "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/visitor-keys": "6.7.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.4.tgz", + "integrity": "sha512-o9XWK2FLW6eSS/0r/tgjAGsYasLAnOWg7hvZ/dGYSSNjCh+49k5ocPN8OmG5aZcSJ8pclSOyVKP2x03Sj+RrCA==", + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.4.tgz", + "integrity": "sha512-pOW37DUhlTZbvph50x5zZCkFn3xzwkGtNoJHzIM3svpiSkJzwOYr/kVBaXmf+RAQiUDs1AHEZVNPg6UJCJpwRA==", + "dependencies": { + "@typescript-eslint/types": "6.7.4", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.7.4.tgz", + "integrity": "sha512-I5zVZFY+cw4IMZUeNCU7Sh2PO5O57F7Lr0uyhgCJmhN/BuTlnc55KxPonR4+EM3GBdfiCyGZye6DgMjtubQkmA==", + "dependencies": { + "@typescript-eslint/scope-manager": "6.7.4", + "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/typescript-estree": "6.7.4", + "@typescript-eslint/visitor-keys": "6.7.4", "debug": "^4.3.4" }, "engines": { @@ -916,6 +947,76 @@ } } }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.4.tgz", + "integrity": "sha512-SdGqSLUPTXAXi7c3Ob7peAGVnmMoGzZ361VswK2Mqf8UOYcODiYvs8rs5ILqEdfvX1lE7wEZbLyELCW+Yrql1A==", + "dependencies": { + "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/visitor-keys": "6.7.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.4.tgz", + "integrity": "sha512-o9XWK2FLW6eSS/0r/tgjAGsYasLAnOWg7hvZ/dGYSSNjCh+49k5ocPN8OmG5aZcSJ8pclSOyVKP2x03Sj+RrCA==", + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.4.tgz", + "integrity": "sha512-ty8b5qHKatlNYd9vmpHooQz3Vki3gG+3PchmtsA4TgrZBKWHNjWfkQid7K7xQogBqqc7/BhGazxMD5vr6Ha+iQ==", + "dependencies": { + "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/visitor-keys": "6.7.4", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.4.tgz", + "integrity": "sha512-pOW37DUhlTZbvph50x5zZCkFn3xzwkGtNoJHzIM3svpiSkJzwOYr/kVBaXmf+RAQiUDs1AHEZVNPg6UJCJpwRA==", + "dependencies": { + "@typescript-eslint/types": "6.7.4", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@typescript-eslint/scope-manager": { "version": "6.4.0", "dev": true, @@ -933,12 +1034,12 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.4.0", - "dev": true, - "license": "MIT", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.7.4.tgz", + "integrity": "sha512-n+g3zi1QzpcAdHFP9KQF+rEFxMb2KxtnJGID3teA/nxKHOVi3ylKovaqEzGBbVY2pBttU6z85gp0D00ufLzViQ==", "dependencies": { - "@typescript-eslint/typescript-estree": "6.4.0", - "@typescript-eslint/utils": "6.4.0", + "@typescript-eslint/typescript-estree": "6.7.4", + "@typescript-eslint/utils": "6.7.4", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -958,6 +1059,60 @@ } } }, + "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.4.tgz", + "integrity": "sha512-o9XWK2FLW6eSS/0r/tgjAGsYasLAnOWg7hvZ/dGYSSNjCh+49k5ocPN8OmG5aZcSJ8pclSOyVKP2x03Sj+RrCA==", + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.4.tgz", + "integrity": "sha512-ty8b5qHKatlNYd9vmpHooQz3Vki3gG+3PchmtsA4TgrZBKWHNjWfkQid7K7xQogBqqc7/BhGazxMD5vr6Ha+iQ==", + "dependencies": { + "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/visitor-keys": "6.7.4", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.4.tgz", + "integrity": "sha512-pOW37DUhlTZbvph50x5zZCkFn3xzwkGtNoJHzIM3svpiSkJzwOYr/kVBaXmf+RAQiUDs1AHEZVNPg6UJCJpwRA==", + "dependencies": { + "@typescript-eslint/types": "6.7.4", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@typescript-eslint/types": { "version": "6.4.0", "dev": true, @@ -997,16 +1152,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.4.0", - "dev": true, - "license": "MIT", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.7.4.tgz", + "integrity": "sha512-PRQAs+HUn85Qdk+khAxsVV+oULy3VkbH3hQ8hxLRJXWBEd7iI+GbQxH5SEUSH7kbEoTp6oT1bOwyga24ELALTA==", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.4.0", - "@typescript-eslint/types": "6.4.0", - "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/scope-manager": "6.7.4", + "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/typescript-estree": "6.7.4", "semver": "^7.5.4" }, "engines": { @@ -1020,6 +1175,76 @@ "eslint": "^7.0.0 || ^8.0.0" } }, + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/scope-manager": { + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.4.tgz", + "integrity": "sha512-SdGqSLUPTXAXi7c3Ob7peAGVnmMoGzZ361VswK2Mqf8UOYcODiYvs8rs5ILqEdfvX1lE7wEZbLyELCW+Yrql1A==", + "dependencies": { + "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/visitor-keys": "6.7.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.4.tgz", + "integrity": "sha512-o9XWK2FLW6eSS/0r/tgjAGsYasLAnOWg7hvZ/dGYSSNjCh+49k5ocPN8OmG5aZcSJ8pclSOyVKP2x03Sj+RrCA==", + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": { + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.4.tgz", + "integrity": "sha512-ty8b5qHKatlNYd9vmpHooQz3Vki3gG+3PchmtsA4TgrZBKWHNjWfkQid7K7xQogBqqc7/BhGazxMD5vr6Ha+iQ==", + "dependencies": { + "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/visitor-keys": "6.7.4", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/visitor-keys": { + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.4.tgz", + "integrity": "sha512-pOW37DUhlTZbvph50x5zZCkFn3xzwkGtNoJHzIM3svpiSkJzwOYr/kVBaXmf+RAQiUDs1AHEZVNPg6UJCJpwRA==", + "dependencies": { + "@typescript-eslint/types": "6.7.4", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@typescript-eslint/visitor-keys": { "version": "6.4.0", "dev": true, @@ -1275,7 +1500,6 @@ }, "node_modules/acorn": { "version": "8.10.0", - "dev": true, "license": "MIT", "bin": { "acorn": "bin/acorn" @@ -1295,7 +1519,6 @@ }, "node_modules/acorn-jsx": { "version": "5.3.2", - "dev": true, "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" @@ -1374,7 +1597,6 @@ }, "node_modules/argparse": { "version": "2.0.1", - "dev": true, "license": "Python-2.0" }, "node_modules/array-buffer-byte-length": { @@ -1390,7 +1612,6 @@ }, "node_modules/array-union": { "version": "2.1.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -1466,7 +1687,6 @@ }, "node_modules/balanced-match": { "version": "1.0.2", - "dev": true, "license": "MIT" }, "node_modules/base64-arraybuffer": { @@ -1656,7 +1876,6 @@ }, "node_modules/braces": { "version": "3.0.2", - "dev": true, "license": "MIT", "dependencies": { "fill-range": "^7.0.1" @@ -2005,7 +2224,6 @@ }, "node_modules/callsites": { "version": "3.1.0", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -2091,7 +2309,6 @@ }, "node_modules/chalk": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -2106,7 +2323,6 @@ }, "node_modules/chalk/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -2349,7 +2565,6 @@ }, "node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -2360,7 +2575,6 @@ }, "node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/commander": { @@ -2371,7 +2585,6 @@ }, "node_modules/concat-map": { "version": "0.0.1", - "dev": true, "license": "MIT" }, "node_modules/connect": { @@ -2496,7 +2709,6 @@ }, "node_modules/cross-spawn": { "version": "7.0.3", - "dev": true, "license": "MIT", "dependencies": { "path-key": "^3.1.0", @@ -2509,7 +2721,6 @@ }, "node_modules/cross-spawn/node_modules/which": { "version": "2.0.2", - "dev": true, "license": "ISC", "dependencies": { "isexe": "^2.0.0" @@ -2696,7 +2907,6 @@ }, "node_modules/dir-glob": { "version": "3.0.1", - "dev": true, "license": "MIT", "dependencies": { "path-type": "^4.0.0" @@ -2707,7 +2917,6 @@ }, "node_modules/doctrine": { "version": "3.0.0", - "dev": true, "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" @@ -2984,7 +3193,6 @@ }, "node_modules/escape-string-regexp": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -3064,7 +3272,6 @@ }, "node_modules/eslint": { "version": "8.47.0", - "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", @@ -3116,12 +3323,12 @@ } }, "node_modules/eslint-plugin-mocha": { - "version": "10.1.0", - "dev": true, - "license": "MIT", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.2.0.tgz", + "integrity": "sha512-ZhdxzSZnd1P9LqDPF0DBcFLpRIGdh1zkF2JHnQklKQOvrQtT73kdP5K9V2mzvbLR+cCAO9OI48NXK/Ax9/ciCQ==", "dependencies": { "eslint-utils": "^3.0.0", - "rambda": "^7.1.0" + "rambda": "^7.4.0" }, "engines": { "node": ">=14.0.0" @@ -3132,7 +3339,6 @@ }, "node_modules/eslint-scope": { "version": "7.2.2", - "dev": true, "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", @@ -3147,7 +3353,6 @@ }, "node_modules/eslint-utils": { "version": "3.0.0", - "dev": true, "license": "MIT", "dependencies": { "eslint-visitor-keys": "^2.0.0" @@ -3164,7 +3369,6 @@ }, "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { "version": "2.1.0", - "dev": true, "license": "Apache-2.0", "engines": { "node": ">=10" @@ -3172,7 +3376,6 @@ }, "node_modules/eslint-visitor-keys": { "version": "3.4.3", - "dev": true, "license": "Apache-2.0", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -3183,7 +3386,6 @@ }, "node_modules/eslint/node_modules/ajv": { "version": "6.12.6", - "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", @@ -3198,7 +3400,6 @@ }, "node_modules/eslint/node_modules/ansi-regex": { "version": "5.0.1", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -3206,7 +3407,6 @@ }, "node_modules/eslint/node_modules/brace-expansion": { "version": "1.1.11", - "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -3215,12 +3415,10 @@ }, "node_modules/eslint/node_modules/json-schema-traverse": { "version": "0.4.1", - "dev": true, "license": "MIT" }, "node_modules/eslint/node_modules/minimatch": { "version": "3.1.2", - "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -3231,7 +3429,6 @@ }, "node_modules/eslint/node_modules/strip-ansi": { "version": "6.0.1", - "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -3242,7 +3439,6 @@ }, "node_modules/espree": { "version": "9.6.1", - "dev": true, "license": "BSD-2-Clause", "dependencies": { "acorn": "^8.9.0", @@ -3269,7 +3465,6 @@ }, "node_modules/esquery": { "version": "1.5.0", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "estraverse": "^5.1.0" @@ -3280,7 +3475,6 @@ }, "node_modules/esrecurse": { "version": "4.3.0", - "dev": true, "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" @@ -3291,7 +3485,6 @@ }, "node_modules/estraverse": { "version": "5.3.0", - "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">=4.0" @@ -3342,7 +3535,6 @@ }, "node_modules/fast-glob": { "version": "3.3.1", - "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -3357,7 +3549,6 @@ }, "node_modules/fast-glob/node_modules/glob-parent": { "version": "5.1.2", - "dev": true, "license": "ISC", "dependencies": { "is-glob": "^4.0.1" @@ -3368,7 +3559,6 @@ }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", - "dev": true, "license": "MIT" }, "node_modules/fast-levenshtein": { @@ -3377,7 +3567,6 @@ }, "node_modules/fastq": { "version": "1.15.0", - "dev": true, "license": "ISC", "dependencies": { "reusify": "^1.0.4" @@ -3385,7 +3574,6 @@ }, "node_modules/file-entry-cache": { "version": "6.0.1", - "dev": true, "license": "MIT", "dependencies": { "flat-cache": "^3.0.4" @@ -3396,7 +3584,6 @@ }, "node_modules/fill-range": { "version": "7.0.1", - "dev": true, "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" @@ -3448,7 +3635,6 @@ }, "node_modules/find-up": { "version": "5.0.0", - "dev": true, "license": "MIT", "dependencies": { "locate-path": "^6.0.0", @@ -3470,7 +3656,6 @@ }, "node_modules/flat-cache": { "version": "3.0.4", - "dev": true, "license": "MIT", "dependencies": { "flatted": "^3.1.0", @@ -3482,7 +3667,6 @@ }, "node_modules/flat-cache/node_modules/brace-expansion": { "version": "1.1.11", - "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -3491,7 +3675,6 @@ }, "node_modules/flat-cache/node_modules/glob": { "version": "7.2.3", - "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -3510,7 +3693,6 @@ }, "node_modules/flat-cache/node_modules/minimatch": { "version": "3.1.2", - "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -3521,7 +3703,6 @@ }, "node_modules/flat-cache/node_modules/rimraf": { "version": "3.0.2", - "dev": true, "license": "ISC", "dependencies": { "glob": "^7.1.3" @@ -3535,7 +3716,6 @@ }, "node_modules/flatted": { "version": "3.2.7", - "dev": true, "license": "ISC" }, "node_modules/follow-redirects": { @@ -3594,7 +3774,6 @@ }, "node_modules/fs.realpath": { "version": "1.0.0", - "dev": true, "license": "ISC" }, "node_modules/fsevents": { @@ -3703,7 +3882,6 @@ }, "node_modules/glob-parent": { "version": "6.0.2", - "dev": true, "license": "ISC", "dependencies": { "is-glob": "^4.0.3" @@ -3720,7 +3898,6 @@ }, "node_modules/globals": { "version": "13.21.0", - "dev": true, "license": "MIT", "dependencies": { "type-fest": "^0.20.2" @@ -3747,7 +3924,6 @@ }, "node_modules/globby": { "version": "11.1.0", - "dev": true, "license": "MIT", "dependencies": { "array-union": "^2.1.0", @@ -3781,7 +3957,6 @@ }, "node_modules/graphemer": { "version": "1.4.0", - "dev": true, "license": "MIT" }, "node_modules/hamt-sharding": { @@ -3815,7 +3990,6 @@ }, "node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -4028,7 +4202,6 @@ }, "node_modules/ignore": { "version": "5.2.4", - "dev": true, "license": "MIT", "engines": { "node": ">= 4" @@ -4036,7 +4209,6 @@ }, "node_modules/import-fresh": { "version": "3.3.0", - "dev": true, "license": "MIT", "dependencies": { "parent-module": "^1.0.0", @@ -4051,7 +4223,6 @@ }, "node_modules/imurmurhash": { "version": "0.1.4", - "dev": true, "license": "MIT", "engines": { "node": ">=0.8.19" @@ -4059,7 +4230,6 @@ }, "node_modules/inflight": { "version": "1.0.6", - "dev": true, "license": "ISC", "dependencies": { "once": "^1.3.0", @@ -4324,7 +4494,6 @@ }, "node_modules/is-extglob": { "version": "2.1.1", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -4354,7 +4523,6 @@ }, "node_modules/is-glob": { "version": "4.0.3", - "dev": true, "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" @@ -4390,7 +4558,6 @@ }, "node_modules/is-number": { "version": "7.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=0.12.0" @@ -4411,7 +4578,6 @@ }, "node_modules/is-path-inside": { "version": "3.0.3", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -4538,7 +4704,6 @@ }, "node_modules/isexe": { "version": "2.0.0", - "dev": true, "license": "ISC" }, "node_modules/isomorphic-timers-promises": { @@ -4717,7 +4882,6 @@ }, "node_modules/js-yaml": { "version": "4.1.0", - "dev": true, "license": "MIT", "dependencies": { "argparse": "^2.0.1" @@ -4744,7 +4908,6 @@ }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", - "dev": true, "license": "MIT" }, "node_modules/jsonfile": { @@ -5224,7 +5387,6 @@ }, "node_modules/levn": { "version": "0.4.1", - "dev": true, "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1", @@ -5245,7 +5407,6 @@ }, "node_modules/locate-path": { "version": "6.0.0", - "dev": true, "license": "MIT", "dependencies": { "p-locate": "^5.0.0" @@ -5268,7 +5429,6 @@ }, "node_modules/lodash.merge": { "version": "4.6.2", - "dev": true, "license": "MIT" }, "node_modules/log-symbols": { @@ -5432,7 +5592,6 @@ }, "node_modules/merge2": { "version": "1.4.1", - "dev": true, "license": "MIT", "engines": { "node": ">= 8" @@ -5440,7 +5599,6 @@ }, "node_modules/micromatch": { "version": "4.0.5", - "dev": true, "license": "MIT", "dependencies": { "braces": "^3.0.2", @@ -5865,7 +6023,6 @@ }, "node_modules/natural-compare": { "version": "1.4.0", - "dev": true, "license": "MIT" }, "node_modules/negotiator": { @@ -6143,7 +6300,6 @@ }, "node_modules/once": { "version": "1.4.0", - "dev": true, "license": "ISC", "dependencies": { "wrappy": "1" @@ -6151,7 +6307,6 @@ }, "node_modules/optionator": { "version": "0.9.3", - "dev": true, "license": "MIT", "dependencies": { "@aashutoshrathi/word-wrap": "^1.2.3", @@ -6182,7 +6337,6 @@ }, "node_modules/p-limit": { "version": "3.1.0", - "dev": true, "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" @@ -6196,7 +6350,6 @@ }, "node_modules/p-locate": { "version": "5.0.0", - "dev": true, "license": "MIT", "dependencies": { "p-limit": "^3.0.2" @@ -6239,7 +6392,6 @@ }, "node_modules/parent-module": { "version": "1.0.1", - "dev": true, "license": "MIT", "dependencies": { "callsites": "^3.0.0" @@ -6275,7 +6427,6 @@ }, "node_modules/path-exists": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -6283,7 +6434,6 @@ }, "node_modules/path-is-absolute": { "version": "1.0.1", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -6291,7 +6441,6 @@ }, "node_modules/path-key": { "version": "3.1.1", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -6327,7 +6476,6 @@ }, "node_modules/path-type": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -6364,7 +6512,6 @@ }, "node_modules/picomatch": { "version": "2.3.1", - "dev": true, "license": "MIT", "engines": { "node": ">=8.6" @@ -6412,7 +6559,6 @@ }, "node_modules/prelude-ls": { "version": "1.2.1", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.8.0" @@ -6590,7 +6736,6 @@ }, "node_modules/rambda": { "version": "7.5.0", - "dev": true, "license": "MIT" }, "node_modules/randombytes": { @@ -6743,7 +6888,6 @@ }, "node_modules/resolve-from": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=4" @@ -6759,7 +6903,6 @@ }, "node_modules/reusify": { "version": "1.0.4", - "dev": true, "license": "MIT", "engines": { "iojs": ">=1.0.0", @@ -6838,7 +6981,6 @@ }, "node_modules/run-parallel": { "version": "1.2.0", - "dev": true, "funding": [ { "type": "github", @@ -6990,7 +7132,6 @@ }, "node_modules/semver": { "version": "7.5.4", - "dev": true, "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" @@ -7004,7 +7145,6 @@ }, "node_modules/semver/node_modules/lru-cache": { "version": "6.0.0", - "dev": true, "license": "ISC", "dependencies": { "yallist": "^4.0.0" @@ -7045,7 +7185,6 @@ }, "node_modules/shebang-command": { "version": "2.0.0", - "dev": true, "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" @@ -7056,7 +7195,6 @@ }, "node_modules/shebang-regex": { "version": "3.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -7112,7 +7250,6 @@ }, "node_modules/slash": { "version": "3.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -7498,7 +7635,6 @@ }, "node_modules/strip-json-comments": { "version": "3.1.1", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -7509,7 +7645,6 @@ }, "node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -7653,7 +7788,6 @@ }, "node_modules/text-table": { "version": "0.2.0", - "dev": true, "license": "MIT" }, "node_modules/timers-browserify": { @@ -7733,7 +7867,6 @@ }, "node_modules/to-regex-range": { "version": "5.0.1", - "dev": true, "license": "MIT", "dependencies": { "is-number": "^7.0.0" @@ -7756,7 +7889,6 @@ }, "node_modules/ts-api-utils": { "version": "1.0.2", - "dev": true, "license": "MIT", "engines": { "node": ">=16.13.0" @@ -7781,7 +7913,6 @@ }, "node_modules/type-check": { "version": "0.4.0", - "dev": true, "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1" @@ -7800,7 +7931,6 @@ }, "node_modules/type-fest": { "version": "0.20.2", - "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" @@ -7880,7 +8010,6 @@ }, "node_modules/typescript": { "version": "5.1.6", - "dev": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -8376,7 +8505,6 @@ }, "node_modules/wrappy": { "version": "1.0.2", - "dev": true, "license": "ISC" }, "node_modules/ws": { @@ -8417,7 +8545,6 @@ }, "node_modules/yallist": { "version": "4.0.0", - "dev": true, "license": "ISC" }, "node_modules/yargs": { @@ -8498,7 +8625,6 @@ }, "node_modules/yocto-queue": { "version": "0.1.0", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -8609,6 +8735,121 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "packages/agent/node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.0.tgz", + "integrity": "sha512-62o2Hmc7Gs3p8SLfbXcipjWAa6qk2wZGChXG2JbBtYpwSRmti/9KHLqfbLs9uDigOexG+3PaQ9G2g3201FWLKg==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/type-utils": "6.4.0", + "@typescript-eslint/utils": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/agent/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.0.tgz", + "integrity": "sha512-TvqrUFFyGY0cX3WgDHcdl2/mMCWCDv/0thTtx/ODMY1QhEiyFtv/OlLaNIiYLwRpAxAtOLOY9SUf1H3Q3dlwAg==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/utils": "6.4.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/agent/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.0.tgz", + "integrity": "sha512-BvvwryBQpECPGo8PwF/y/q+yacg8Hn/2XS+DqL/oRsOPK+RPt29h5Ui5dqOKHDlbXrAeHUTnyG3wZA0KTDxRZw==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/typescript-estree": "6.4.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "packages/agent/node_modules/@typescript-eslint/parser": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", + "integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "packages/agent/node_modules/cross-fetch": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", @@ -8617,6 +8858,22 @@ "node-fetch": "^2.6.12" } }, + "packages/agent/node_modules/eslint-plugin-mocha": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.1.0.tgz", + "integrity": "sha512-xLqqWUF17llsogVOC+8C6/jvQ+4IoOREbN7ZCHuOHuD6cT5cDD4h7f2LgsZuzMAiwswWE21tO7ExaknHVDrSkw==", + "dev": true, + "dependencies": { + "eslint-utils": "^3.0.0", + "rambda": "^7.1.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "packages/agent/node_modules/lru-cache": { "version": "9.1.2", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-9.1.2.tgz", @@ -8744,50 +9001,181 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "packages/api/node_modules/cross-fetch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", - "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", + "packages/api/node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.0.tgz", + "integrity": "sha512-62o2Hmc7Gs3p8SLfbXcipjWAa6qk2wZGChXG2JbBtYpwSRmti/9KHLqfbLs9uDigOexG+3PaQ9G2g3201FWLKg==", + "dev": true, "dependencies": { - "node-fetch": "^2.6.12" - } - }, - "packages/api/node_modules/lru-cache": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-9.1.2.tgz", - "integrity": "sha512-ERJq3FOzJTxBbFjZ7iDs+NiK4VI9Wz+RdrrAB8dio1oV+YvdPzUEE4QNiT2VD51DkIbCYRUUzCRkssXCHqSnKQ==", + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/type-utils": "6.4.0", + "@typescript-eslint/utils": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, "engines": { - "node": "14 || >=16.14" + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "packages/api/node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "packages/api/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.0.tgz", + "integrity": "sha512-TvqrUFFyGY0cX3WgDHcdl2/mMCWCDv/0thTtx/ODMY1QhEiyFtv/OlLaNIiYLwRpAxAtOLOY9SUf1H3Q3dlwAg==", + "dev": true, "dependencies": { - "whatwg-url": "^5.0.0" + "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/utils": "6.4.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "4.x || >=6.0.0" + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "encoding": "^0.1.0" + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { - "encoding": { + "typescript": { "optional": true } } }, - "packages/common": { - "name": "@web5/common", - "version": "0.2.0", - "license": "Apache-2.0", + "packages/api/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.0.tgz", + "integrity": "sha512-BvvwryBQpECPGo8PwF/y/q+yacg8Hn/2XS+DqL/oRsOPK+RPt29h5Ui5dqOKHDlbXrAeHUTnyG3wZA0KTDxRZw==", + "dev": true, "dependencies": { - "level": "8.0.0", - "multiformats": "11.0.2" + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/typescript-estree": "6.4.0", + "semver": "^7.5.4" }, - "devDependencies": { + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "packages/api/node_modules/@typescript-eslint/parser": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", + "integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/api/node_modules/cross-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", + "dependencies": { + "node-fetch": "^2.6.12" + } + }, + "packages/api/node_modules/eslint-plugin-mocha": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.1.0.tgz", + "integrity": "sha512-xLqqWUF17llsogVOC+8C6/jvQ+4IoOREbN7ZCHuOHuD6cT5cDD4h7f2LgsZuzMAiwswWE21tO7ExaknHVDrSkw==", + "dev": true, + "dependencies": { + "eslint-utils": "^3.0.0", + "rambda": "^7.1.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "packages/api/node_modules/lru-cache": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-9.1.2.tgz", + "integrity": "sha512-ERJq3FOzJTxBbFjZ7iDs+NiK4VI9Wz+RdrrAB8dio1oV+YvdPzUEE4QNiT2VD51DkIbCYRUUzCRkssXCHqSnKQ==", + "engines": { + "node": "14 || >=16.14" + } + }, + "packages/api/node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "packages/common": { + "name": "@web5/common", + "version": "0.2.0", + "license": "Apache-2.0", + "dependencies": { + "level": "8.0.0", + "multiformats": "11.0.2" + }, + "devDependencies": { "@playwright/test": "1.36.2", "@types/chai": "4.3.6", "@types/chai-as-promised": "7.1.5", @@ -8818,6 +9206,137 @@ "node": ">=18.0.0" } }, + "packages/common/node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.0.tgz", + "integrity": "sha512-62o2Hmc7Gs3p8SLfbXcipjWAa6qk2wZGChXG2JbBtYpwSRmti/9KHLqfbLs9uDigOexG+3PaQ9G2g3201FWLKg==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/type-utils": "6.4.0", + "@typescript-eslint/utils": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/common/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.0.tgz", + "integrity": "sha512-TvqrUFFyGY0cX3WgDHcdl2/mMCWCDv/0thTtx/ODMY1QhEiyFtv/OlLaNIiYLwRpAxAtOLOY9SUf1H3Q3dlwAg==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/utils": "6.4.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/common/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.0.tgz", + "integrity": "sha512-BvvwryBQpECPGo8PwF/y/q+yacg8Hn/2XS+DqL/oRsOPK+RPt29h5Ui5dqOKHDlbXrAeHUTnyG3wZA0KTDxRZw==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/typescript-estree": "6.4.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "packages/common/node_modules/@typescript-eslint/parser": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", + "integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/common/node_modules/eslint-plugin-mocha": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.1.0.tgz", + "integrity": "sha512-xLqqWUF17llsogVOC+8C6/jvQ+4IoOREbN7ZCHuOHuD6cT5cDD4h7f2LgsZuzMAiwswWE21tO7ExaknHVDrSkw==", + "dev": true, + "dependencies": { + "eslint-utils": "^3.0.0", + "rambda": "^7.1.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "packages/credentials": { "name": "@web5/credentials", "version": "0.3.0", @@ -8859,6 +9378,121 @@ "node": ">=18.0.0" } }, + "packages/credentials/node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.0.tgz", + "integrity": "sha512-62o2Hmc7Gs3p8SLfbXcipjWAa6qk2wZGChXG2JbBtYpwSRmti/9KHLqfbLs9uDigOexG+3PaQ9G2g3201FWLKg==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/type-utils": "6.4.0", + "@typescript-eslint/utils": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/credentials/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.0.tgz", + "integrity": "sha512-TvqrUFFyGY0cX3WgDHcdl2/mMCWCDv/0thTtx/ODMY1QhEiyFtv/OlLaNIiYLwRpAxAtOLOY9SUf1H3Q3dlwAg==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/utils": "6.4.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/credentials/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.0.tgz", + "integrity": "sha512-BvvwryBQpECPGo8PwF/y/q+yacg8Hn/2XS+DqL/oRsOPK+RPt29h5Ui5dqOKHDlbXrAeHUTnyG3wZA0KTDxRZw==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/typescript-estree": "6.4.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "packages/credentials/node_modules/@typescript-eslint/parser": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", + "integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "packages/credentials/node_modules/@web5/common": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/@web5/common/-/common-0.1.1.tgz", @@ -8904,6 +9538,22 @@ "node": ">=18.0.0" } }, + "packages/credentials/node_modules/eslint-plugin-mocha": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.1.0.tgz", + "integrity": "sha512-xLqqWUF17llsogVOC+8C6/jvQ+4IoOREbN7ZCHuOHuD6cT5cDD4h7f2LgsZuzMAiwswWE21tO7ExaknHVDrSkw==", + "dev": true, + "dependencies": { + "eslint-utils": "^3.0.0", + "rambda": "^7.1.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "packages/credentials/node_modules/uuid": { "version": "9.0.0", "license": "MIT", @@ -8916,45 +9566,176 @@ "version": "0.2.0", "license": "Apache-2.0", "dependencies": { - "@noble/ciphers": "0.1.4", - "@noble/curves": "1.1.0", - "@noble/hashes": "1.3.1", - "@web5/common": "0.2.0" - }, - "devDependencies": { - "@playwright/test": "1.36.2", - "@types/chai": "4.3.6", - "@types/chai-as-promised": "7.1.5", - "@types/ed2curve": "0.2.2", - "@types/eslint": "8.44.2", - "@types/mocha": "10.0.1", - "@types/sinon": "10.0.15", - "@types/uuid": "9.0.1", - "@typescript-eslint/eslint-plugin": "6.4.0", - "@typescript-eslint/parser": "6.4.0", - "c8": "8.0.1", - "chai": "4.3.10", - "chai-as-promised": "7.1.1", - "esbuild": "0.16.17", - "eslint": "8.47.0", - "eslint-plugin-mocha": "10.1.0", - "karma": "6.4.1", - "karma-chai": "0.1.0", - "karma-chrome-launcher": "3.1.1", - "karma-esbuild": "2.2.5", - "karma-firefox-launcher": "2.1.2", - "karma-mocha": "2.0.1", - "karma-mocha-reporter": "2.2.5", - "karma-webkit-launcher": "2.1.0", - "mocha": "10.2.0", - "playwright": "1.36.2", - "rimraf": "4.4.0", - "sinon": "15.0.2", - "source-map-loader": "4.0.1", - "typescript": "5.1.6" + "@noble/ciphers": "0.1.4", + "@noble/curves": "1.1.0", + "@noble/hashes": "1.3.1", + "@web5/common": "0.2.0" + }, + "devDependencies": { + "@playwright/test": "1.36.2", + "@types/chai": "4.3.6", + "@types/chai-as-promised": "7.1.5", + "@types/ed2curve": "0.2.2", + "@types/eslint": "8.44.2", + "@types/mocha": "10.0.1", + "@types/sinon": "10.0.15", + "@types/uuid": "9.0.1", + "@typescript-eslint/eslint-plugin": "6.4.0", + "@typescript-eslint/parser": "6.4.0", + "c8": "8.0.1", + "chai": "4.3.10", + "chai-as-promised": "7.1.1", + "esbuild": "0.16.17", + "eslint": "8.47.0", + "eslint-plugin-mocha": "10.1.0", + "karma": "6.4.1", + "karma-chai": "0.1.0", + "karma-chrome-launcher": "3.1.1", + "karma-esbuild": "2.2.5", + "karma-firefox-launcher": "2.1.2", + "karma-mocha": "2.0.1", + "karma-mocha-reporter": "2.2.5", + "karma-webkit-launcher": "2.1.0", + "mocha": "10.2.0", + "playwright": "1.36.2", + "rimraf": "4.4.0", + "sinon": "15.0.2", + "source-map-loader": "4.0.1", + "typescript": "5.1.6" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "packages/crypto/node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.0.tgz", + "integrity": "sha512-62o2Hmc7Gs3p8SLfbXcipjWAa6qk2wZGChXG2JbBtYpwSRmti/9KHLqfbLs9uDigOexG+3PaQ9G2g3201FWLKg==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/type-utils": "6.4.0", + "@typescript-eslint/utils": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/crypto/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.0.tgz", + "integrity": "sha512-TvqrUFFyGY0cX3WgDHcdl2/mMCWCDv/0thTtx/ODMY1QhEiyFtv/OlLaNIiYLwRpAxAtOLOY9SUf1H3Q3dlwAg==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/utils": "6.4.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/crypto/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.0.tgz", + "integrity": "sha512-BvvwryBQpECPGo8PwF/y/q+yacg8Hn/2XS+DqL/oRsOPK+RPt29h5Ui5dqOKHDlbXrAeHUTnyG3wZA0KTDxRZw==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/typescript-estree": "6.4.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "packages/crypto/node_modules/@typescript-eslint/parser": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", + "integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/crypto/node_modules/eslint-plugin-mocha": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.1.0.tgz", + "integrity": "sha512-xLqqWUF17llsogVOC+8C6/jvQ+4IoOREbN7ZCHuOHuD6cT5cDD4h7f2LgsZuzMAiwswWE21tO7ExaknHVDrSkw==", + "dev": true, + "dependencies": { + "eslint-utils": "^3.0.0", + "rambda": "^7.1.0" }, "engines": { - "node": ">=18.0.0" + "node": ">=14.0.0" + }, + "peerDependencies": { + "eslint": ">=7.0.0" } }, "packages/dids": { @@ -9010,6 +9791,137 @@ "node": ">=18.0.0" } }, + "packages/dids/node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.0.tgz", + "integrity": "sha512-62o2Hmc7Gs3p8SLfbXcipjWAa6qk2wZGChXG2JbBtYpwSRmti/9KHLqfbLs9uDigOexG+3PaQ9G2g3201FWLKg==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/type-utils": "6.4.0", + "@typescript-eslint/utils": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/dids/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.0.tgz", + "integrity": "sha512-TvqrUFFyGY0cX3WgDHcdl2/mMCWCDv/0thTtx/ODMY1QhEiyFtv/OlLaNIiYLwRpAxAtOLOY9SUf1H3Q3dlwAg==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/utils": "6.4.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/dids/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.0.tgz", + "integrity": "sha512-BvvwryBQpECPGo8PwF/y/q+yacg8Hn/2XS+DqL/oRsOPK+RPt29h5Ui5dqOKHDlbXrAeHUTnyG3wZA0KTDxRZw==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/typescript-estree": "6.4.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "packages/dids/node_modules/@typescript-eslint/parser": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", + "integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/dids/node_modules/eslint-plugin-mocha": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.1.0.tgz", + "integrity": "sha512-xLqqWUF17llsogVOC+8C6/jvQ+4IoOREbN7ZCHuOHuD6cT5cDD4h7f2LgsZuzMAiwswWE21tO7ExaknHVDrSkw==", + "dev": true, + "dependencies": { + "eslint-utils": "^3.0.0", + "rambda": "^7.1.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "packages/identity-agent": { "name": "@web5/identity-agent", "version": "0.2.1", @@ -9047,7 +9959,138 @@ "typescript": "5.1.6" }, "engines": { - "node": ">=18.0.0" + "node": ">=18.0.0" + } + }, + "packages/identity-agent/node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.0.tgz", + "integrity": "sha512-62o2Hmc7Gs3p8SLfbXcipjWAa6qk2wZGChXG2JbBtYpwSRmti/9KHLqfbLs9uDigOexG+3PaQ9G2g3201FWLKg==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/type-utils": "6.4.0", + "@typescript-eslint/utils": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/identity-agent/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.0.tgz", + "integrity": "sha512-TvqrUFFyGY0cX3WgDHcdl2/mMCWCDv/0thTtx/ODMY1QhEiyFtv/OlLaNIiYLwRpAxAtOLOY9SUf1H3Q3dlwAg==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/utils": "6.4.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/identity-agent/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.0.tgz", + "integrity": "sha512-BvvwryBQpECPGo8PwF/y/q+yacg8Hn/2XS+DqL/oRsOPK+RPt29h5Ui5dqOKHDlbXrAeHUTnyG3wZA0KTDxRZw==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/typescript-estree": "6.4.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "packages/identity-agent/node_modules/@typescript-eslint/parser": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", + "integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/identity-agent/node_modules/eslint-plugin-mocha": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.1.0.tgz", + "integrity": "sha512-xLqqWUF17llsogVOC+8C6/jvQ+4IoOREbN7ZCHuOHuD6cT5cDD4h7f2LgsZuzMAiwswWE21tO7ExaknHVDrSkw==", + "dev": true, + "dependencies": { + "eslint-utils": "^3.0.0", + "rambda": "^7.1.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "eslint": ">=7.0.0" } }, "packages/proxy-agent": { @@ -9092,6 +10135,137 @@ "node": ">=18.0.0" } }, + "packages/proxy-agent/node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.0.tgz", + "integrity": "sha512-62o2Hmc7Gs3p8SLfbXcipjWAa6qk2wZGChXG2JbBtYpwSRmti/9KHLqfbLs9uDigOexG+3PaQ9G2g3201FWLKg==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/type-utils": "6.4.0", + "@typescript-eslint/utils": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/proxy-agent/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.0.tgz", + "integrity": "sha512-TvqrUFFyGY0cX3WgDHcdl2/mMCWCDv/0thTtx/ODMY1QhEiyFtv/OlLaNIiYLwRpAxAtOLOY9SUf1H3Q3dlwAg==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/utils": "6.4.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/proxy-agent/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.0.tgz", + "integrity": "sha512-BvvwryBQpECPGo8PwF/y/q+yacg8Hn/2XS+DqL/oRsOPK+RPt29h5Ui5dqOKHDlbXrAeHUTnyG3wZA0KTDxRZw==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/typescript-estree": "6.4.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "packages/proxy-agent/node_modules/@typescript-eslint/parser": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", + "integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/proxy-agent/node_modules/eslint-plugin-mocha": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.1.0.tgz", + "integrity": "sha512-xLqqWUF17llsogVOC+8C6/jvQ+4IoOREbN7ZCHuOHuD6cT5cDD4h7f2LgsZuzMAiwswWE21tO7ExaknHVDrSkw==", + "dev": true, + "dependencies": { + "eslint-utils": "^3.0.0", + "rambda": "^7.1.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "packages/user-agent": { "name": "@web5/user-agent", "version": "0.2.1", @@ -9133,6 +10307,137 @@ "engines": { "node": ">=18.0.0" } + }, + "packages/user-agent/node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.0.tgz", + "integrity": "sha512-62o2Hmc7Gs3p8SLfbXcipjWAa6qk2wZGChXG2JbBtYpwSRmti/9KHLqfbLs9uDigOexG+3PaQ9G2g3201FWLKg==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/type-utils": "6.4.0", + "@typescript-eslint/utils": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/user-agent/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.0.tgz", + "integrity": "sha512-TvqrUFFyGY0cX3WgDHcdl2/mMCWCDv/0thTtx/ODMY1QhEiyFtv/OlLaNIiYLwRpAxAtOLOY9SUf1H3Q3dlwAg==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/utils": "6.4.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/user-agent/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.0.tgz", + "integrity": "sha512-BvvwryBQpECPGo8PwF/y/q+yacg8Hn/2XS+DqL/oRsOPK+RPt29h5Ui5dqOKHDlbXrAeHUTnyG3wZA0KTDxRZw==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/typescript-estree": "6.4.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "packages/user-agent/node_modules/@typescript-eslint/parser": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", + "integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.4.0", + "@typescript-eslint/types": "6.4.0", + "@typescript-eslint/typescript-estree": "6.4.0", + "@typescript-eslint/visitor-keys": "6.4.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/user-agent/node_modules/eslint-plugin-mocha": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.1.0.tgz", + "integrity": "sha512-xLqqWUF17llsogVOC+8C6/jvQ+4IoOREbN7ZCHuOHuD6cT5cDD4h7f2LgsZuzMAiwswWE21tO7ExaknHVDrSkw==", + "dev": true, + "dependencies": { + "eslint-utils": "^3.0.0", + "rambda": "^7.1.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } } } } diff --git a/package.json b/package.json index 86600ac3d..aabfc4fc9 100644 --- a/package.json +++ b/package.json @@ -24,5 +24,10 @@ "license": "Apache-2.0", "devDependencies": { "@npmcli/package-json": "5.0.0" + }, + "dependencies": { + "@typescript-eslint/eslint-plugin": "^6.7.4", + "@typescript-eslint/parser": "^6.7.4", + "eslint-plugin-mocha": "^10.2.0" } } diff --git a/packages/dids/src/dht.ts b/packages/dids/src/dht.ts index 0be93a9bb..351bd3266 100644 --- a/packages/dids/src/dht.ts +++ b/packages/dids/src/dht.ts @@ -1,20 +1,20 @@ +import {Web5Crypto} from '@web5/crypto'; import DHT from 'bittorrent-dht'; import ed from 'bittorrent-dht-sodium'; -import {DidDocument} from '@web5/dids'; -import {Web5Crypto} from '@web5/crypto'; import brotli from 'brotli-compress'; import b4a from 'b4a'; +import {DidDocument} from "./types.js"; const DEFAULT_BOOTSTRAP = [ - 'router.magnets.im:6881', - 'router.bittorrent.com:6881', - 'router.utorrent.com:6881', - 'dht.transmissionbt.com:6881', - 'router.nuh.dev:6881' + 'router.magnets.im:6881', + 'router.bittorrent.com:6881', + 'router.utorrent.com:6881', + 'dht.transmissionbt.com:6881', + 'router.nuh.dev:6881' ].map(addr => { - const [host, port] = addr.split(':'); - return {host, port: Number(port)}; + const [host, port] = addr.split(':'); + return {host, port: Number(port)}; }); export type PutRequest = { @@ -29,85 +29,85 @@ export type PutRequest = { }; export class DidDht { - private dht: DHT; - - constructor() { - this.dht = new DHT({bootstrap: DEFAULT_BOOTSTRAP, verify: ed.verify}); + private dht: DHT; - this.dht.listen(0, () => { - console.debug('DHT is listening...'); - }); - } + constructor() { + this.dht = new DHT({bootstrap: DEFAULT_BOOTSTRAP, verify: ed.verify}); - public async createPutDidRequest(keypair: Web5Crypto.CryptoKeyPair, did: DidDocument): Promise { - const seq = Math.ceil(Date.now() / 1000); - const records: string[][] = [['did', JSON.stringify(did)]]; - const v = await DidDht.compress(records); - return { - seq: seq, - v: Buffer.from(v), - k: Buffer.from(keypair.publicKey.material), - sk: Buffer.concat([keypair.privateKey.material, keypair.publicKey.material]) - }; - } + this.dht.listen(0, () => { + console.debug('DHT is listening...'); + }); + } - public async put(request: PutRequest): Promise { - const opts = { - k: request.k, - v: request.v, - seq: request.seq, - sign: function (buf: Buffer) { - return ed.sign(buf, request.sk); - } - }; - return new Promise((resolve, reject) => { - this.dht.put(opts, (err, hash) => { - if (err) { - reject(err); - } else { - resolve(hash.toString('hex')); - } - }); - }); - } + public async createPutDidRequest(keypair: Web5Crypto.CryptoKeyPair, did: DidDocument): Promise { + const seq = Math.ceil(Date.now() / 1000); + const records: string[][] = [['did', JSON.stringify(did)]]; + const v = await DidDht.compress(records); + return { + seq : seq, + v : Buffer.from(v), + k : Buffer.from(keypair.publicKey.material), + sk : Buffer.concat([keypair.privateKey.material, keypair.publicKey.material]) + }; + } - public async parseGetDidResponse(response: Buffer): Promise { - const records = await DidDht.decompress(response); - const didRecord = records.find(record => record[0] === 'did'); - if (!didRecord) { - throw new Error('No DID record found'); + public async put(request: PutRequest): Promise { + const opts = { + k : request.k, + v : request.v, + seq : request.seq, + sign : function (buf: Buffer) { + return ed.sign(buf, request.sk); + } + }; + return new Promise((resolve, reject) => { + this.dht.put(opts, (err, hash) => { + if (err) { + reject(err); + } else { + resolve(hash.toString('hex')); } - return JSON.parse(didRecord[1]); - } + }); + }); + } - public async get(keyHash: string): Promise { - return new Promise((resolve, reject) => { - this.dht.get(keyHash, (err, res) => { - if (err) { - reject(err); - } else { - resolve(res.v); - } - }); - }); + public async parseGetDidResponse(response: Buffer): Promise { + const records = await DidDht.decompress(response); + const didRecord = records.find(record => record[0] === 'did'); + if (!didRecord) { + throw new Error('No DID record found'); } + return JSON.parse(didRecord[1]); + } - public static async compress(records: string[][]): Promise { - const string = JSON.stringify(records); - const toCompress = b4a.from(string); - return await brotli.compress(toCompress); - } + public async get(keyHash: string): Promise { + return new Promise((resolve, reject) => { + this.dht.get(keyHash, (err, res) => { + if (err) { + reject(err); + } else { + resolve(res.v); + } + }); + }); + } - /** + public static async compress(records: string[][]): Promise { + const string = JSON.stringify(records); + const toCompress = b4a.from(string); + return await brotli.compress(toCompress); + } + + /** * @param compressed A Uint8Array containing the compressed data */ - public static async decompress(compressed: Uint8Array): Promise { - const decompressed = await brotli.decompress(compressed); - const string = b4a.toString(b4a.from(decompressed)); - return JSON.parse(string); - } + public static async decompress(compressed: Uint8Array): Promise { + const decompressed = await brotli.decompress(compressed); + const string = b4a.toString(b4a.from(decompressed)); + return JSON.parse(string); + } - public destroy(): void { - this.dht.destroy(); - } + public destroy(): void { + this.dht.destroy(); + } } diff --git a/packages/dids/src/did-dht.ts b/packages/dids/src/did-dht.ts index ce779f382..d0f247212 100644 --- a/packages/dids/src/did-dht.ts +++ b/packages/dids/src/did-dht.ts @@ -1,19 +1,19 @@ import z32 from 'z32'; -import {DidDht} from './dht.js'; import crypto from 'crypto'; import { - DidDocument, - DidKeySetVerificationMethodKey, - DidMethod, - DidResolutionResult, - DidService, PortableDid, - VerificationRelationship -} from "./types.js"; -import {EcdsaAlgorithm, EdDsaAlgorithm, Jose, JwkKeyPair, PublicKeyJwk, Web5Crypto} from "@web5/crypto"; + DidDocument, + DidKeySetVerificationMethodKey, + DidMethod, + DidResolutionResult, + DidService, PortableDid, + VerificationRelationship +} from './types.js'; +import {EcdsaAlgorithm, EdDsaAlgorithm, Jose, JwkKeyPair, PublicKeyJwk, Web5Crypto} from '@web5/crypto'; +import {DidDht} from './dht.js'; const SupportedCryptoKeyTypes = [ - 'Ed25519', - 'secp256k1' + 'Ed25519', + 'secp256k1' ] as const; export type DidDhtCreateOptions = { @@ -29,185 +29,185 @@ export type DidDhtKeySet = { export class DidDhtMethod implements DidMethod { - public static methodName = 'dht'; - - public static async create(options?: DidDhtCreateOptions): Promise { - const {publish, keySet: initialKeySet, services} = options ?? {}; - - // Generate missing keys if not provided in the options - const keySet = await this.generateKeySet({keySet: initialKeySet}); - - // Get the identifier and set it - const id = await this.getDidIdentifier({key: keySet.identityKey.publicKeyJwk}); - - // add all other keys to the verificationMethod and relationship arrays - const relationshipsMap: Partial> = {}; - const verificationMethods = keySet.verificationMethodKeys.map(key => { - for (const relationship of key.relationships) { - if (relationshipsMap[relationship]) { - relationshipsMap[relationship].push(`#${key.publicKeyJwk.kid}`); - } else { - relationshipsMap[relationship] = [`#${key.publicKeyJwk.kid}`]; - } - } - - return { - id: `${id}#${key.publicKeyJwk.kid}`, - type: 'JsonWebKey2020', - controller: id, - publicKeyJwk: key.publicKeyJwk - }; - }); + public static methodName = 'dht'; - const document: DidDocument = { - id, - verificationMethod: [...verificationMethods], - ...relationshipsMap, - ...services && {service: services} - }; + public static async create(options?: DidDhtCreateOptions): Promise { + const {publish, keySet: initialKeySet, services} = options ?? {}; - if (publish) { - await this.publish(keySet, document); - } - return { - did: document.id, - document: document, - keySet: keySet - }; - } + // Generate missing keys if not provided in the options + const keySet = await this.generateKeySet({keySet: initialKeySet}); + + // Get the identifier and set it + const id = await this.getDidIdentifier({key: keySet.identityKey.publicKeyJwk}); - public static async publish(keySet: DidDhtKeySet, didDocument: DidDocument): Promise { - const dht = new DidDht(); - const publicCryptoKey = await Jose.jwkToCryptoKey({key: keySet.identityKey.publicKeyJwk}); - const privateCryptoKey = await Jose.jwkToCryptoKey({key: keySet.identityKey.privateKeyJwk}); - - const request = await dht.createPutDidRequest({ - publicKey: publicCryptoKey, - privateKey: privateCryptoKey - }, didDocument); - - const hash = await dht.put(request); - if (hash) { - return { - didDocumentMetadata: undefined, - didDocument, - didResolutionMetadata: { - contentType: 'application/json' - } - }; + // add all other keys to the verificationMethod and relationship arrays + const relationshipsMap: Partial> = {}; + const verificationMethods = keySet.verificationMethodKeys.map(key => { + for (const relationship of key.relationships) { + if (relationshipsMap[relationship]) { + relationshipsMap[relationship].push(`#${key.publicKeyJwk.kid}`); } else { - throw new Error('Failed to publish to DHT'); + relationshipsMap[relationship] = [`#${key.publicKeyJwk.kid}`]; } + } + + return { + id : `${id}#${key.publicKeyJwk.kid}`, + type : 'JsonWebKey2020', + controller : id, + publicKeyJwk : key.publicKeyJwk + }; + }); + + const document: DidDocument = { + id, + verificationMethod: [...verificationMethods], + ...relationshipsMap, + ...services && {service: services} + }; + + if (publish) { + await this.publish(keySet, document); } - - public static async resolve(did: string): Promise { - const dht = new DidDht(); - const hash = did.replace('did:dht:', ''); - const decoded = z32.decode(hash); - const identifier = this.hash(decoded); - const retrievedValue = await dht.get(identifier.toString('hex')); - return await dht.parseGetDidResponse(retrievedValue).finally(() => dht.destroy()); - } - - private static hash(input: crypto.BinaryLike) { - return crypto.createHash('sha1').update(input).digest(); + return { + did : document.id, + document : document, + keySet : keySet + }; + } + + public static async publish(keySet: DidDhtKeySet, didDocument: DidDocument): Promise { + const dht = new DidDht(); + const publicCryptoKey = await Jose.jwkToCryptoKey({key: keySet.identityKey.publicKeyJwk}); + const privateCryptoKey = await Jose.jwkToCryptoKey({key: keySet.identityKey.privateKeyJwk}); + + const request = await dht.createPutDidRequest({ + publicKey : publicCryptoKey, + privateKey : privateCryptoKey + }, didDocument); + + const hash = await dht.put(request); + if (hash) { + return { + didDocumentMetadata : undefined, + didDocument, + didResolutionMetadata : { + contentType: 'application/json' + } + }; + } else { + throw new Error('Failed to publish to DHT'); } - - public static async getDidIdentifier(options: { + } + + public static async resolve(did: string): Promise { + const dht = new DidDht(); + const hash = did.replace('did:dht:', ''); + const decoded = z32.decode(hash); + const identifier = this.hash(decoded); + const retrievedValue = await dht.get(identifier.toString('hex')); + return await dht.parseGetDidResponse(retrievedValue).finally(() => dht.destroy()); + } + + private static hash(input: crypto.BinaryLike) { + return crypto.createHash('sha1').update(input).digest(); + } + + public static async getDidIdentifier(options: { key: PublicKeyJwk }): Promise { - const {key} = options; + const {key} = options; - const cryptoKey = await Jose.jwkToCryptoKey({key}); - const identifier = z32.encode(cryptoKey.material); - return 'did:dht:' + identifier; - } + const cryptoKey = await Jose.jwkToCryptoKey({key}); + const identifier = z32.encode(cryptoKey.material); + return 'did:dht:' + identifier; + } - public static async generateJwkKeyPair(options: { + public static async generateJwkKeyPair(options: { keyAlgorithm: typeof SupportedCryptoKeyTypes[number], keyId?: string }): Promise { - const {keyAlgorithm, keyId} = options; - - let cryptoKeyPair: Web5Crypto.CryptoKeyPair; - - switch (keyAlgorithm) { - case 'Ed25519': { - cryptoKeyPair = await new EdDsaAlgorithm().generateKey({ - algorithm: {name: 'EdDSA', namedCurve: 'Ed25519'}, - extractable: true, - keyUsages: ['sign', 'verify'] - }); - break; - } - - case 'secp256k1': { - cryptoKeyPair = await new EcdsaAlgorithm().generateKey({ - algorithm: {name: 'ECDSA', namedCurve: 'secp256k1'}, - extractable: true, - keyUsages: ['sign', 'verify'] - }); - break; - } - - default: { - throw new Error(`Unsupported crypto algorithm: '${keyAlgorithm}'`); - } - } + const {keyAlgorithm, keyId} = options; - // Convert the CryptoKeyPair to JwkKeyPair. - const jwkKeyPair = await Jose.cryptoKeyToJwkPair({keyPair: cryptoKeyPair}); + let cryptoKeyPair: Web5Crypto.CryptoKeyPair; - // Set kid values. - if (keyId) { - jwkKeyPair.privateKeyJwk.kid = keyId; - jwkKeyPair.publicKeyJwk.kid = keyId; - } else { - // If a key ID is not specified, generate RFC 7638 JWK thumbprint. - const jwkThumbprint = await Jose.jwkThumbprint({key: jwkKeyPair.publicKeyJwk}); - jwkKeyPair.privateKeyJwk.kid = jwkThumbprint; - jwkKeyPair.publicKeyJwk.kid = jwkThumbprint; - } + switch (keyAlgorithm) { + case 'Ed25519': { + cryptoKeyPair = await new EdDsaAlgorithm().generateKey({ + algorithm : {name: 'EdDSA', namedCurve: 'Ed25519'}, + extractable : true, + keyUsages : ['sign', 'verify'] + }); + break; + } + + case 'secp256k1': { + cryptoKeyPair = await new EcdsaAlgorithm().generateKey({ + algorithm : {name: 'ECDSA', namedCurve: 'secp256k1'}, + extractable : true, + keyUsages : ['sign', 'verify'] + }); + break; + } - return jwkKeyPair; + default: { + throw new Error(`Unsupported crypto algorithm: '${keyAlgorithm}'`); + } } - public static async generateKeySet(options?: { + // Convert the CryptoKeyPair to JwkKeyPair. + const jwkKeyPair = await Jose.cryptoKeyToJwkPair({keyPair: cryptoKeyPair}); + + // Set kid values. + if (keyId) { + jwkKeyPair.privateKeyJwk.kid = keyId; + jwkKeyPair.publicKeyJwk.kid = keyId; + } else { + // If a key ID is not specified, generate RFC 7638 JWK thumbprint. + const jwkThumbprint = await Jose.jwkThumbprint({key: jwkKeyPair.publicKeyJwk}); + jwkKeyPair.privateKeyJwk.kid = jwkThumbprint; + jwkKeyPair.publicKeyJwk.kid = jwkThumbprint; + } + + return jwkKeyPair; + } + + public static async generateKeySet(options?: { keySet?: DidDhtKeySet }): Promise { - let {keySet = {}} = options ?? {}; + let {keySet = {}} = options ?? {}; - if (!keySet.identityKey) { - keySet.identityKey = await this.generateJwkKeyPair({ - keyAlgorithm: 'Ed25519', - keyId: '0' - }); + if (!keySet.identityKey) { + keySet.identityKey = await this.generateJwkKeyPair({ + keyAlgorithm : 'Ed25519', + keyId : '0' + }); - } else if (keySet.identityKey.publicKeyJwk.kid !== '0') { - throw new Error('The identity key must have a kid of 0'); - } - - // add verificationMethodKeys for the identity key - const identityKeySetVerificationMethod: DidKeySetVerificationMethodKey = { - ...keySet.identityKey, - relationships: ['authentication', 'assertionMethod', 'capabilityInvocation', 'capabilityDelegation'] - }; + } else if (keySet.identityKey.publicKeyJwk.kid !== '0') { + throw new Error('The identity key must have a kid of 0'); + } - if (!keySet.verificationMethodKeys) { - keySet.verificationMethodKeys = [identityKeySetVerificationMethod]; - } else if (keySet.verificationMethodKeys.filter(key => key.publicKeyJwk.kid === '0').length === 0) { - keySet.verificationMethodKeys.push(identityKeySetVerificationMethod); - } + // add verificationMethodKeys for the identity key + const identityKeySetVerificationMethod: DidKeySetVerificationMethodKey = { + ...keySet.identityKey, + relationships: ['authentication', 'assertionMethod', 'capabilityInvocation', 'capabilityDelegation'] + }; - // Generate RFC 7638 JWK thumbprints if `kid` is missing from any key. - if (keySet.verificationMethodKeys) { - for (const key of keySet.verificationMethodKeys) { - if (key.publicKeyJwk) key.publicKeyJwk.kid ??= await Jose.jwkThumbprint({key: key.publicKeyJwk}); - if (key.privateKeyJwk) key.privateKeyJwk.kid ??= await Jose.jwkThumbprint({key: key.privateKeyJwk}); - } - } + if (!keySet.verificationMethodKeys) { + keySet.verificationMethodKeys = [identityKeySetVerificationMethod]; + } else if (keySet.verificationMethodKeys.filter(key => key.publicKeyJwk.kid === '0').length === 0) { + keySet.verificationMethodKeys.push(identityKeySetVerificationMethod); + } - return keySet; + // Generate RFC 7638 JWK thumbprints if `kid` is missing from any key. + if (keySet.verificationMethodKeys) { + for (const key of keySet.verificationMethodKeys) { + if (key.publicKeyJwk) key.publicKeyJwk.kid ??= await Jose.jwkThumbprint({key: key.publicKeyJwk}); + if (key.privateKeyJwk) key.privateKeyJwk.kid ??= await Jose.jwkThumbprint({key: key.privateKeyJwk}); + } } + + return keySet; + } } diff --git a/packages/dids/src/types.ts b/packages/dids/src/types.ts index 5f45acd45..682aed912 100644 --- a/packages/dids/src/types.ts +++ b/packages/dids/src/types.ts @@ -3,7 +3,7 @@ import type { PrivateKeyJwk, PublicKeyJwk } from '@web5/crypto'; import { DidKeyKeySet } from './did-key.js'; import { DidIonKeySet } from './did-ion.js'; -import {DidDhtKeySet} from "./did-dht.js"; +import {DidDhtKeySet} from './did-dht.js'; export type DidDocument = { '@context'?: 'https://www.w3.org/ns/did/v1' | string | string[]; diff --git a/packages/dids/tests/dht.spec.ts b/packages/dids/tests/dht.spec.ts index c794dcd7a..5dae849ee 100644 --- a/packages/dids/tests/dht.spec.ts +++ b/packages/dids/tests/dht.spec.ts @@ -1,56 +1,57 @@ -import {expect} from "chai"; -import {DidDht} from "../src/dht.js"; -import {DidDhtKeySet, DidDhtMethod} from "../src/did-dht.js"; -import {Jose} from "@web5/crypto"; +import {expect} from 'chai'; +import {DidDht} from '../src/dht.js'; +import {DidDhtKeySet, DidDhtMethod} from '../src/did-dht.js'; +import {Jose} from '@web5/crypto'; describe('DHT', function () { - this.timeout(20000); // 20 seconds + this.timeout(20000); // 20 seconds - const dht = new DidDht(); - after(() => { - dht.destroy(); - }); + const dht = new DidDht(); + after(() => { + dht.destroy(); + }); - it('should put and get data from DHT', async () => { - const {document, keySet} = await DidDhtMethod.create(); - const ks = keySet as DidDhtKeySet; - const publicCryptoKey = await Jose.jwkToCryptoKey({key: ks.identityKey.publicKeyJwk}); - const privateCryptoKey = await Jose.jwkToCryptoKey({key: ks.identityKey.privateKeyJwk}); + it('should put and get data from DHT', async () => { + const {document, keySet} = await DidDhtMethod.create(); + const ks = keySet as DidDhtKeySet; + const publicCryptoKey = await Jose.jwkToCryptoKey({key: ks.identityKey.publicKeyJwk}); + const privateCryptoKey = await Jose.jwkToCryptoKey({key: ks.identityKey.privateKeyJwk}); - const request = await dht.createPutDidRequest({ - publicKey : publicCryptoKey, - privateKey : privateCryptoKey - }, document); + const request = await dht.createPutDidRequest({ + publicKey : publicCryptoKey, + privateKey : privateCryptoKey + }, document); - const hash = await dht.put(request); + const hash = await dht.put(request); - const retrievedValue = await dht.get(hash); + const retrievedValue = await dht.get(hash); - const gotDid = await dht.parseGetDidResponse(retrievedValue); - expect(gotDid).to.deep.equal(document); - }); + const gotDid = await dht.parseGetDidResponse(retrievedValue); + expect(gotDid).to.deep.equal(document); + }); }); + describe('Codec', async () => { - it('compresses and decompresses an uncompressable value', async () => { - const uncompressable = [['2'], ['3']]; - const compressed = await DidDht.compress(uncompressable); - const decompressed = await DidDht.decompress(compressed); - - const uncompressableBuffer = Buffer.from(JSON.stringify(uncompressable)); - const compressedBuffer = Buffer.from(compressed); - expect(compressedBuffer.length).to.be.greaterThanOrEqual(uncompressableBuffer.length); - expect(decompressed).to.deep.equal(uncompressable); - }); - - it('compresses and decompresses a compressable value', async () => { - const records = [['did', '{"@context":"https://w3id.org/did/v1", "id": "did:example:123"}']]; - const compressed = await DidDht.compress(records); - const decompressed = await DidDht.decompress(compressed); - - const uncompressableBuffer = Buffer.from(JSON.stringify(records)); - const compressedBuffer = Buffer.from(compressed); - expect(compressedBuffer.length).to.be.lessThan(uncompressableBuffer.length); - expect(decompressed).to.deep.equal(records); - }); + it('compresses and decompresses an uncompressable value', async () => { + const uncompressable = [['2'], ['3']]; + const compressed = await DidDht.compress(uncompressable); + const decompressed = await DidDht.decompress(compressed); + + const uncompressableBuffer = Buffer.from(JSON.stringify(uncompressable)); + const compressedBuffer = Buffer.from(compressed); + expect(compressedBuffer.length).to.be.greaterThanOrEqual(uncompressableBuffer.length); + expect(decompressed).to.deep.equal(uncompressable); + }); + + it('compresses and decompresses a compressable value', async () => { + const records = [['did', '{"@context":"https://w3id.org/did/v1", "id": "did:example:123"}']]; + const compressed = await DidDht.compress(records); + const decompressed = await DidDht.decompress(compressed); + + const uncompressableBuffer = Buffer.from(JSON.stringify(records)); + const compressedBuffer = Buffer.from(compressed); + expect(compressedBuffer.length).to.be.lessThan(uncompressableBuffer.length); + expect(decompressed).to.deep.equal(records); + }); }); diff --git a/packages/dids/tests/did-dht.spec.ts b/packages/dids/tests/did-dht.spec.ts index 6d9935849..5f819fb33 100644 --- a/packages/dids/tests/did-dht.spec.ts +++ b/packages/dids/tests/did-dht.spec.ts @@ -7,218 +7,218 @@ import {DidKeySetVerificationMethodKey, DidService} from '@web5/dids'; chai.use(chaiAsPromised); describe('did-dht', () => { - describe('keypairs', () => { - it('should generate a keypair', async () => { - const ed25519KeyPair = await DidDhtMethod.generateJwkKeyPair({keyAlgorithm: 'Ed25519'}); - - expect(ed25519KeyPair).to.exist; - expect(ed25519KeyPair).to.have.property('privateKeyJwk'); - expect(ed25519KeyPair).to.have.property('publicKeyJwk'); - expect(ed25519KeyPair.publicKeyJwk.kid).to.exist; - expect(ed25519KeyPair.publicKeyJwk.alg).to.equal('EdDSA'); - expect(ed25519KeyPair.publicKeyJwk.kty).to.equal('OKP'); - - const secp256k1KeyPair = await DidDhtMethod.generateJwkKeyPair({keyAlgorithm: 'secp256k1'}); - - expect(secp256k1KeyPair).to.exist; - expect(secp256k1KeyPair).to.have.property('privateKeyJwk'); - expect(secp256k1KeyPair).to.have.property('publicKeyJwk'); - expect(secp256k1KeyPair.publicKeyJwk.kid).to.exist; - expect(secp256k1KeyPair.publicKeyJwk.alg).to.equal('ES256K'); - expect(secp256k1KeyPair.publicKeyJwk.kty).to.equal('EC'); - - }); + describe('keypairs', () => { + it('should generate a keypair', async () => { + const ed25519KeyPair = await DidDhtMethod.generateJwkKeyPair({keyAlgorithm: 'Ed25519'}); + + expect(ed25519KeyPair).to.exist; + expect(ed25519KeyPair).to.have.property('privateKeyJwk'); + expect(ed25519KeyPair).to.have.property('publicKeyJwk'); + expect(ed25519KeyPair.publicKeyJwk.kid).to.exist; + expect(ed25519KeyPair.publicKeyJwk.alg).to.equal('EdDSA'); + expect(ed25519KeyPair.publicKeyJwk.kty).to.equal('OKP'); + + const secp256k1KeyPair = await DidDhtMethod.generateJwkKeyPair({keyAlgorithm: 'secp256k1'}); + + expect(secp256k1KeyPair).to.exist; + expect(secp256k1KeyPair).to.have.property('privateKeyJwk'); + expect(secp256k1KeyPair).to.have.property('publicKeyJwk'); + expect(secp256k1KeyPair.publicKeyJwk.kid).to.exist; + expect(secp256k1KeyPair.publicKeyJwk.alg).to.equal('ES256K'); + expect(secp256k1KeyPair.publicKeyJwk.kty).to.equal('EC'); + + }); + }); + + describe('keysets', () => { + it('should generate a keyset with no keyset passed in', async () => { + const keySet = await DidDhtMethod.generateKeySet(); + + expect(keySet).to.exist; + expect(keySet).to.have.property('identityKey'); + expect(keySet).to.have.property('verificationMethodKeys'); + expect(keySet).to.not.have.property('recoveryKey'); + expect(keySet).to.not.have.property('updateKey'); + expect(keySet).to.not.have.property('signingKey'); + expect(keySet.verificationMethodKeys).to.have.lengthOf(1); + expect(keySet.verificationMethodKeys[0].publicKeyJwk.kid).to.equal('0'); + }); + + it('should generate a keyset with an identity keyset passed in (wrong kid)', async () => { + const ed25519KeyPair = await DidDhtMethod.generateJwkKeyPair({keyAlgorithm: 'Ed25519'}); + + expect(DidDhtMethod.generateKeySet({keySet: {identityKey: ed25519KeyPair}})).to.be.rejectedWith('The identity key must have a kid of 0'); + }); + + it('should generate a keyset with an identity keyset passed in (correct kid)', async () => { + const ed25519KeyPair = await DidDhtMethod.generateJwkKeyPair({keyId: '0', keyAlgorithm: 'Ed25519'}); + const keySet = await DidDhtMethod.generateKeySet({keySet: {identityKey: ed25519KeyPair}}); + + expect(keySet).to.exist; + expect(keySet).to.have.property('identityKey'); + expect(keySet).to.have.property('verificationMethodKeys'); + expect(keySet).to.not.have.property('recoveryKey'); + expect(keySet).to.not.have.property('updateKey'); + expect(keySet).to.not.have.property('signingKey'); + expect(keySet.verificationMethodKeys).to.have.lengthOf(1); + expect(keySet.verificationMethodKeys[0].publicKeyJwk.kid).to.equal('0'); }); - describe('keysets', () => { - it('should generate a keyset with no keyset passed in', async () => { - const keySet = await DidDhtMethod.generateKeySet(); - - expect(keySet).to.exist; - expect(keySet).to.have.property('identityKey'); - expect(keySet).to.have.property('verificationMethodKeys'); - expect(keySet).to.not.have.property('recoveryKey'); - expect(keySet).to.not.have.property('updateKey'); - expect(keySet).to.not.have.property('signingKey'); - expect(keySet.verificationMethodKeys).to.have.lengthOf(1); - expect(keySet.verificationMethodKeys[0].publicKeyJwk.kid).to.equal('0'); - }); - - it('should generate a keyset with an identity keyset passed in (wrong kid)', async () => { - const ed25519KeyPair = await DidDhtMethod.generateJwkKeyPair({keyAlgorithm: 'Ed25519'}); - - expect(DidDhtMethod.generateKeySet({keySet: {identityKey: ed25519KeyPair}})).to.be.rejectedWith('The identity key must have a kid of 0'); - }); - - it('should generate a keyset with an identity keyset passed in (correct kid)', async () => { - const ed25519KeyPair = await DidDhtMethod.generateJwkKeyPair({keyId: '0', keyAlgorithm: 'Ed25519'}); - const keySet = await DidDhtMethod.generateKeySet({keySet: {identityKey: ed25519KeyPair}}); - - expect(keySet).to.exist; - expect(keySet).to.have.property('identityKey'); - expect(keySet).to.have.property('verificationMethodKeys'); - expect(keySet).to.not.have.property('recoveryKey'); - expect(keySet).to.not.have.property('updateKey'); - expect(keySet).to.not.have.property('signingKey'); - expect(keySet.verificationMethodKeys).to.have.lengthOf(1); - expect(keySet.verificationMethodKeys[0].publicKeyJwk.kid).to.equal('0'); - }); - - it('should generate a keyset with a non identity keyset passed in', async () => { - const ed25519KeyPair = await DidDhtMethod.generateJwkKeyPair({keyAlgorithm: 'Ed25519'}); - const vm: DidKeySetVerificationMethodKey = { - publicKeyJwk : ed25519KeyPair.publicKeyJwk, - privateKeyJwk : ed25519KeyPair.privateKeyJwk, - relationships : ['authentication', 'assertionMethod', 'capabilityInvocation', 'capabilityDelegation'] - }; - - const keySet = await DidDhtMethod.generateKeySet({keySet: {verificationMethodKeys: [vm]}}); - - expect(keySet).to.exist; - expect(keySet).to.have.property('identityKey'); - expect(keySet).to.have.property('verificationMethodKeys'); - expect(keySet).to.not.have.property('recoveryKey'); - expect(keySet).to.not.have.property('updateKey'); - expect(keySet).to.not.have.property('signingKey'); - expect(keySet.verificationMethodKeys).to.have.lengthOf(2); - - if (keySet.verificationMethodKeys[0].publicKeyJwk.kid === '0') { - expect(keySet.verificationMethodKeys[1].publicKeyJwk.kid).to.not.equal('0'); - } else { - expect(keySet.verificationMethodKeys[1].publicKeyJwk.kid).to.equal('0'); - } - }); + it('should generate a keyset with a non identity keyset passed in', async () => { + const ed25519KeyPair = await DidDhtMethod.generateJwkKeyPair({keyAlgorithm: 'Ed25519'}); + const vm: DidKeySetVerificationMethodKey = { + publicKeyJwk : ed25519KeyPair.publicKeyJwk, + privateKeyJwk : ed25519KeyPair.privateKeyJwk, + relationships : ['authentication', 'assertionMethod', 'capabilityInvocation', 'capabilityDelegation'] + }; + + const keySet = await DidDhtMethod.generateKeySet({keySet: {verificationMethodKeys: [vm]}}); + + expect(keySet).to.exist; + expect(keySet).to.have.property('identityKey'); + expect(keySet).to.have.property('verificationMethodKeys'); + expect(keySet).to.not.have.property('recoveryKey'); + expect(keySet).to.not.have.property('updateKey'); + expect(keySet).to.not.have.property('signingKey'); + expect(keySet.verificationMethodKeys).to.have.lengthOf(2); + + if (keySet.verificationMethodKeys[0].publicKeyJwk.kid === '0') { + expect(keySet.verificationMethodKeys[1].publicKeyJwk.kid).to.not.equal('0'); + } else { + expect(keySet.verificationMethodKeys[1].publicKeyJwk.kid).to.equal('0'); + } }); + }); + + describe('dids', () => { + it('should generate a did identifier given a public key jwk', async () => { + const ed25519KeyPair = await DidDhtMethod.generateJwkKeyPair({keyAlgorithm: 'Ed25519'}); + const did = await DidDhtMethod.getDidIdentifier({key: ed25519KeyPair.publicKeyJwk}); - describe('dids', () => { - it('should generate a did identifier given a public key jwk', async () => { - const ed25519KeyPair = await DidDhtMethod.generateJwkKeyPair({keyAlgorithm: 'Ed25519'}); - const did = await DidDhtMethod.getDidIdentifier({key: ed25519KeyPair.publicKeyJwk}); - - expect(did).to.exist; - expect(did).to.contain('did:dht:'); - }); - - it('should create a did document without options', async () => { - const {document, keySet} = await DidDhtMethod.create(); - - expect(document).to.exist; - expect(document.id).to.contain('did:dht:'); - expect(document.verificationMethod).to.exist; - expect(document.verificationMethod).to.have.lengthOf(1); - expect(document.verificationMethod[0].id).to.equal(`${document.id}#0`); - expect(document.verificationMethod[0].publicKeyJwk).to.exist; - expect(document.verificationMethod[0].publicKeyJwk.kid).to.equal('0'); - - expect(document.service).to.not.exist; - expect(document.assertionMethod.length).to.equal(1); - expect(document.assertionMethod[0]).to.equal(`#0`); - expect(document.authentication.length).to.equal(1); - expect(document.authentication[0]).to.equal(`#0`); - expect(document.capabilityDelegation.length).to.equal(1); - expect(document.capabilityDelegation[0]).to.equal(`#0`); - expect(document.capabilityInvocation.length).to.equal(1); - expect(document.capabilityInvocation[0]).to.equal(`#0`); - - const ks = keySet as DidDhtKeySet; - expect(ks).to.exist; - expect(ks.identityKey).to.exist; - expect(ks.identityKey.publicKeyJwk).to.exist; - expect(ks.identityKey.privateKeyJwk).to.exist; - expect(ks.identityKey.publicKeyJwk.kid).to.equal('0'); - }); - - it('should create a did document with a non identity key option', async () => { - const ed25519KeyPair = await DidDhtMethod.generateJwkKeyPair({keyAlgorithm: 'Ed25519'}); - const vm: DidKeySetVerificationMethodKey = { - publicKeyJwk : ed25519KeyPair.publicKeyJwk, - privateKeyJwk : ed25519KeyPair.privateKeyJwk, - relationships : ['authentication', 'assertionMethod', 'capabilityInvocation', 'capabilityDelegation'] - }; - - const keySet = await DidDhtMethod.generateKeySet({keySet: {verificationMethodKeys: [vm]}}); - const {document} = await DidDhtMethod.create({keySet}); - - expect(document).to.exist; - expect(document.id).to.contain('did:dht:'); - expect(document.verificationMethod).to.exist; - expect(document.verificationMethod).to.have.lengthOf(2); - expect(document.verificationMethod[1].id).to.equal(`${document.id}#0`); - expect(document.verificationMethod[1].publicKeyJwk).to.exist; - expect(document.verificationMethod[1].publicKeyJwk.kid).to.equal('0'); - - expect(document.service).to.not.exist; - expect(document.assertionMethod.length).to.equal(2); - expect(document.assertionMethod[1]).to.equal(`#0`); - expect(document.authentication.length).to.equal(2); - expect(document.authentication[1]).to.equal(`#0`); - expect(document.capabilityDelegation.length).to.equal(2); - expect(document.capabilityDelegation[1]).to.equal(`#0`); - expect(document.capabilityInvocation.length).to.equal(2); - expect(document.capabilityInvocation[1]).to.equal(`#0`); - - expect(keySet).to.exist; - expect(keySet.identityKey).to.exist; - expect(keySet.identityKey.publicKeyJwk).to.exist; - expect(keySet.identityKey.privateKeyJwk).to.exist; - expect(keySet.identityKey.publicKeyJwk.kid).to.equal('0'); - }); - - it('should create a did document with services', async () => { - const services: DidService[] = [{ - id : 'did:dht:123456789abcdefghi#agent', - type : 'agent', - serviceEndpoint : 'https://example.com/agent' - }]; - const {document} = await DidDhtMethod.create({services}); - - expect(document).to.exist; - expect(document.id).to.contain('did:dht:'); - expect(document.verificationMethod).to.exist; - expect(document.verificationMethod).to.have.lengthOf(1); - expect(document.verificationMethod[0].id).to.equal(`${document.id}#0`); - expect(document.verificationMethod[0].publicKeyJwk).to.exist; - expect(document.verificationMethod[0].publicKeyJwk.kid).to.equal('0'); - - expect(document.service).to.exist; - expect(document.service).to.have.lengthOf(1); - expect(document.service[0].id).to.equal('did:dht:123456789abcdefghi#agent'); - expect(document.assertionMethod.length).to.equal(1); - expect(document.assertionMethod[0]).to.equal(`#0`); - expect(document.authentication.length).to.equal(1); - expect(document.authentication[0]).to.equal(`#0`); - expect(document.capabilityDelegation.length).to.equal(1); - expect(document.capabilityDelegation[0]).to.equal(`#0`); - expect(document.capabilityInvocation.length).to.equal(1); - expect(document.capabilityInvocation[0]).to.equal(`#0`); - }); + expect(did).to.exist; + expect(did).to.contain('did:dht:'); + }); + + it('should create a did document without options', async () => { + const {document, keySet} = await DidDhtMethod.create(); + + expect(document).to.exist; + expect(document.id).to.contain('did:dht:'); + expect(document.verificationMethod).to.exist; + expect(document.verificationMethod).to.have.lengthOf(1); + expect(document.verificationMethod[0].id).to.equal(`${document.id}#0`); + expect(document.verificationMethod[0].publicKeyJwk).to.exist; + expect(document.verificationMethod[0].publicKeyJwk.kid).to.equal('0'); + + expect(document.service).to.not.exist; + expect(document.assertionMethod.length).to.equal(1); + expect(document.assertionMethod[0]).to.equal(`#0`); + expect(document.authentication.length).to.equal(1); + expect(document.authentication[0]).to.equal(`#0`); + expect(document.capabilityDelegation.length).to.equal(1); + expect(document.capabilityDelegation[0]).to.equal(`#0`); + expect(document.capabilityInvocation.length).to.equal(1); + expect(document.capabilityInvocation[0]).to.equal(`#0`); + + const ks = keySet as DidDhtKeySet; + expect(ks).to.exist; + expect(ks.identityKey).to.exist; + expect(ks.identityKey.publicKeyJwk).to.exist; + expect(ks.identityKey.privateKeyJwk).to.exist; + expect(ks.identityKey.publicKeyJwk.kid).to.equal('0'); + }); + + it('should create a did document with a non identity key option', async () => { + const ed25519KeyPair = await DidDhtMethod.generateJwkKeyPair({keyAlgorithm: 'Ed25519'}); + const vm: DidKeySetVerificationMethodKey = { + publicKeyJwk : ed25519KeyPair.publicKeyJwk, + privateKeyJwk : ed25519KeyPair.privateKeyJwk, + relationships : ['authentication', 'assertionMethod', 'capabilityInvocation', 'capabilityDelegation'] + }; + + const keySet = await DidDhtMethod.generateKeySet({keySet: {verificationMethodKeys: [vm]}}); + const {document} = await DidDhtMethod.create({keySet}); + + expect(document).to.exist; + expect(document.id).to.contain('did:dht:'); + expect(document.verificationMethod).to.exist; + expect(document.verificationMethod).to.have.lengthOf(2); + expect(document.verificationMethod[1].id).to.equal(`${document.id}#0`); + expect(document.verificationMethod[1].publicKeyJwk).to.exist; + expect(document.verificationMethod[1].publicKeyJwk.kid).to.equal('0'); + + expect(document.service).to.not.exist; + expect(document.assertionMethod.length).to.equal(2); + expect(document.assertionMethod[1]).to.equal(`#0`); + expect(document.authentication.length).to.equal(2); + expect(document.authentication[1]).to.equal(`#0`); + expect(document.capabilityDelegation.length).to.equal(2); + expect(document.capabilityDelegation[1]).to.equal(`#0`); + expect(document.capabilityInvocation.length).to.equal(2); + expect(document.capabilityInvocation[1]).to.equal(`#0`); + + expect(keySet).to.exist; + expect(keySet.identityKey).to.exist; + expect(keySet.identityKey.publicKeyJwk).to.exist; + expect(keySet.identityKey.privateKeyJwk).to.exist; + expect(keySet.identityKey.publicKeyJwk.kid).to.equal('0'); + }); + + it('should create a did document with services', async () => { + const services: DidService[] = [{ + id : 'did:dht:123456789abcdefghi#agent', + type : 'agent', + serviceEndpoint : 'https://example.com/agent' + }]; + const {document} = await DidDhtMethod.create({services}); + + expect(document).to.exist; + expect(document.id).to.contain('did:dht:'); + expect(document.verificationMethod).to.exist; + expect(document.verificationMethod).to.have.lengthOf(1); + expect(document.verificationMethod[0].id).to.equal(`${document.id}#0`); + expect(document.verificationMethod[0].publicKeyJwk).to.exist; + expect(document.verificationMethod[0].publicKeyJwk.kid).to.equal('0'); + + expect(document.service).to.exist; + expect(document.service).to.have.lengthOf(1); + expect(document.service[0].id).to.equal('did:dht:123456789abcdefghi#agent'); + expect(document.assertionMethod.length).to.equal(1); + expect(document.assertionMethod[0]).to.equal(`#0`); + expect(document.authentication.length).to.equal(1); + expect(document.authentication[0]).to.equal(`#0`); + expect(document.capabilityDelegation.length).to.equal(1); + expect(document.capabilityDelegation[0]).to.equal(`#0`); + expect(document.capabilityInvocation.length).to.equal(1); + expect(document.capabilityInvocation[0]).to.equal(`#0`); + }); + }); + + describe('did publishing and resolving', function () { + this.timeout(20000); // 20 seconds + + it('should publish and get a did document', async () => { + const {document, keySet} = await DidDhtMethod.create(); + const didResolutionResult = await DidDhtMethod.publish(keySet, document); + + expect(didResolutionResult).to.exist; + expect(didResolutionResult.didDocument).to.exist; + expect(didResolutionResult.didDocument.id).to.equal(document.id); + expect(didResolutionResult.didDocument.verificationMethod).to.exist; + expect(didResolutionResult.didDocument.verificationMethod).to.have.lengthOf(1); + expect(didResolutionResult.didDocument.verificationMethod[0].id).to.equal(`${document.id}#0`); + expect(didResolutionResult.didDocument.verificationMethod[0].publicKeyJwk).to.exist; + expect(didResolutionResult.didDocument.verificationMethod[0].publicKeyJwk.kid).to.equal('0'); + expect(didResolutionResult.didDocument.service).to.not.exist; + + const gotDid = await DidDhtMethod.resolve(document.id); + expect(gotDid).to.deep.equal(document); }); - describe('did publishing and resolving', function () { - this.timeout(20000); // 20 seconds - - it('should publish and get a did document', async () => { - const {document, keySet} = await DidDhtMethod.create(); - const didResolutionResult = await DidDhtMethod.publish(keySet, document); - - expect(didResolutionResult).to.exist; - expect(didResolutionResult.didDocument).to.exist; - expect(didResolutionResult.didDocument.id).to.equal(document.id); - expect(didResolutionResult.didDocument.verificationMethod).to.exist; - expect(didResolutionResult.didDocument.verificationMethod).to.have.lengthOf(1); - expect(didResolutionResult.didDocument.verificationMethod[0].id).to.equal(`${document.id}#0`); - expect(didResolutionResult.didDocument.verificationMethod[0].publicKeyJwk).to.exist; - expect(didResolutionResult.didDocument.verificationMethod[0].publicKeyJwk.kid).to.equal('0'); - expect(didResolutionResult.didDocument.service).to.not.exist; - - const gotDid = await DidDhtMethod.resolve(document.id); - expect(gotDid).to.deep.equal(document); - }); - - it('should create with publish and get a did document', async () => { - const {document} = await DidDhtMethod.create({publish: true}); - const gotDid = await DidDhtMethod.resolve(document.id); - expect(gotDid).to.deep.equal(document); - }); + it('should create with publish and get a did document', async () => { + const {document} = await DidDhtMethod.create({publish: true}); + const gotDid = await DidDhtMethod.resolve(document.id); + expect(gotDid).to.deep.equal(document); }); + }); });