From 0230f32aabd39db1b4b6fda7f9df5804472c5e66 Mon Sep 17 00:00:00 2001 From: proteriax <8125011+proteriax@users.noreply.github.com> Date: Thu, 8 Jul 2021 02:05:41 -0400 Subject: [PATCH] Refactor codebase --- .eslintignore | 2 +- .eslintrc | 131 +++++++- .gitignore | 1 + .mocharc.json | 7 + .vscode/launch.json | 25 ++ .vscode/settings.json | 11 +- README.md | 8 + package.json | 17 +- pnpm-lock.yaml | 731 ++++++++++++++++++++++++++++++++++++++---- repl.ts | 1 + rollup.config.js | 5 +- src/i18n/index.ts | 26 ++ src/i18n/res.json | 16 + src/index.ts | 3 +- src/models.ts | 2 +- src/vault.ts | 93 ++++-- test/.prettierrc | 3 + test/before.ts | 5 + test/profile.test.ts | 42 +++ 19 files changed, 1010 insertions(+), 119 deletions(-) create mode 100644 .mocharc.json create mode 100644 .vscode/launch.json create mode 100644 src/i18n/index.ts create mode 100644 src/i18n/res.json create mode 100644 test/.prettierrc create mode 100644 test/before.ts create mode 100644 test/profile.test.ts diff --git a/.eslintignore b/.eslintignore index 2c7df9d..cc2fe9e 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,2 @@ -onepassword_data +*.opvault lib \ No newline at end of file diff --git a/.eslintrc b/.eslintrc index 7f017db..84e8400 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,7 +1,7 @@ { "root": true, "parser": "@typescript-eslint/parser", - "plugins": ["@typescript-eslint"], + "plugins": ["@typescript-eslint", "import"], "env": { "node": true, "browser": true @@ -9,11 +9,57 @@ "extends": [ "eslint:recommended", "plugin:@typescript-eslint/recommended", - "plugin:react/recommended" + "plugin:react/recommended", + "plugin:import/errors", + "plugin:import/typescript", + "plugin:react-hooks/recommended", + "prettier" ], + "settings": { + "react": { + "version": "detect" + }, + "import/parsers": { + "@typescript-eslint/parser": [".ts", ".tsx"] + }, + "import/resolver": { + "typescript": { + "alwaysTryTypes": true + } + } + }, "rules": { "@typescript-eslint/ban-ts-comment": "off", - "@typescript-eslint/ban-types": "off", + "@typescript-eslint/consistent-type-imports": [ + "error", + { + "disallowTypeAnnotations": false + } + ], + "@typescript-eslint/ban-types": [ + "error", + { + "extendDefaults": false, + "types": { + "String": { + "message": "Use string instead", + "fixWith": "string" + }, + "Number": { + "message": "Use number instead", + "fixWith": "number" + }, + "Boolean": { + "message": "Use boolean instead", + "fixWith": "boolean" + }, + "Symbol": { + "message": "Use symbol instead", + "fixWith": "symbol" + } + } + } + ], "@typescript-eslint/explicit-function-return-type": "off", "@typescript-eslint/explicit-module-boundary-types": "off", "@typescript-eslint/no-empty-function": "off", @@ -23,22 +69,70 @@ "@typescript-eslint/no-use-before-define": "off", "@typescript-eslint/no-var-requires": "off", "@typescript-eslint/triple-slash-reference": "off", + "@typescript-eslint/no-empty-interface": "off", "arrow-body-style": ["error", "as-needed"], - "class-methods-use-this": ["warn", { "exceptMethods": ["toString"] }], - "complexity": ["warn", { "max": 100 }], + "class-methods-use-this": [ + "warn", + { + "exceptMethods": ["toString", "shouldComponentUpdate"] + } + ], + "complexity": [ + "warn", + { + "max": 100 + } + ], "curly": ["error", "multi-line", "consistent"], "eqeqeq": ["error", "smart"], "no-async-promise-executor": "off", "no-case-declarations": "off", - "no-constant-condition": ["error", { "checkLoops": false }], - "no-empty": ["error", { "allowEmptyCatch": true }], + "no-constant-condition": [ + "error", + { + "checkLoops": false + } + ], + "no-debugger": "off", + "no-empty": [ + "error", + { + "allowEmptyCatch": true + } + ], "no-inner-declarations": "off", "no-lonely-if": "error", + "no-template-curly-in-string": "error", "no-var": "error", - "object-shorthand": "error", - "one-var": ["error", { "var": "never", "let": "never" }], + "import/export": "off", + "import/order": [ + "error", + { + "groups": ["builtin", "external"] + } + ], + "object-shorthand": [ + "error", + "always", + { + "ignoreConstructors": true + } + ], + "one-var": [ + "error", + { + "var": "never", + "let": "never" + } + ], "prefer-arrow-callback": "error", - "prefer-const": ["error", { "destructuring": "all" }], + "prefer-const": [ + "error", + { + "destructuring": "all" + } + ], + "prefer-destructuring": "warn", "prefer-object-spread": "error", "prefer-rest-params": "warn", "prefer-spread": "warn", @@ -46,7 +140,20 @@ "react/display-name": "off", "react/no-children-prop": "off", "react/prop-types": "off", - "spaced-comment": "error", - "yoda": ["error", "never", { "exceptRange": true }] + "react/react-in-jsx-scope": "off", + "spaced-comment": [ + "error", + "always", + { + "markers": ["/"] + } + ], + "yoda": [ + "error", + "never", + { + "exceptRange": true + } + ] } } diff --git a/.gitignore b/.gitignore index 096a22f..2552f9f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules +mochawesome-report lib docs ref diff --git a/.mocharc.json b/.mocharc.json new file mode 100644 index 0000000..53b4d85 --- /dev/null +++ b/.mocharc.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json.schemastore.org/mocharc", + "reporter": "mochawesome", + "extension": [".ts"], + "require": ["ts-node/register", "tsconfig-paths/register", "./test/before.ts"], + "timeout": 10000 +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..2ac57e5 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,25 @@ +{ + // Utilisez IntelliSense pour en savoir plus sur les attributs possibles. + // Pointez pour afficher la description des attributs existants. + // Pour plus d'informations, visitez : https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "pwa-node", + "request": "launch", + "name": "REPL", + "skipFiles": ["/**"], + "program": "repl.ts" + }, + { + "type": "node", + "request": "launch", + "name": "Mocha", + "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", + "args": ["test/**/*.test.ts"], + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen", + "protocol": "inspector" + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index ad92582..0ba05fa 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,12 @@ { - "editor.formatOnSave": true + "editor.formatOnSave": true, + "cSpell.ignorePaths": [ + "**/package-lock.json", + "**/node_modules/**", + "**/vscode-extension/**", + "**/.git/objects/**", + ".vscode", + ".vscode-insiders", + "i18n.json" + ] } diff --git a/README.md b/README.md index 97da8d9..c94389e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,13 @@ # opvault.js +## Testing + +```sh +wget -qO- https://cache.agilebits.com/security-kb/freddy-2013-12-04.tar.gz | tar xvz - +mv onepassword_data freddy-2013-12-04.opvault +pnpm run test +``` + ## Security ### Reporting Security Issues diff --git a/package.json b/package.json index 9d9a0ee..f81af51 100644 --- a/package.json +++ b/package.json @@ -7,27 +7,38 @@ "scripts": { "build": "rollup -c; prettier --write lib >/dev/null", "build:docs": "typedoc --out docs src/index.ts --excludePrivate", + "test": "mocha test/**/*.test.ts", "repl": "node -r ts-node/register/transpile-only src/repl.ts" }, "devDependencies": { + "@rollup/plugin-json": "^4.1.0", "@types/chai": "^4.2.19", + "@types/chai-as-promised": "^7.1.4", "@types/fs-extra": "^9.0.11", "@types/mocha": "github:whitecolor/mocha-types#da22474cf43f48a56c86f8c23a5a0ea36e295768", "@types/node": "^16.0.0", "@types/prompts": "^2.0.13", - "@typescript-eslint/eslint-plugin": "4.28.1", - "@typescript-eslint/parser": "4.28.1", + "@typescript-eslint/eslint-plugin": "4.28.2", + "@typescript-eslint/parser": "4.28.2", "chai": "^4.3.4", + "chai-as-promised": "^7.1.1", "chalk": "^4.1.1", "eslint": "7.30.0", + "eslint-config-prettier": "8.3.0", + "eslint-import-resolver-typescript": "2.4.0", + "eslint-plugin-import": "2.23.4", "eslint-plugin-react": "7.24.0", + "eslint-plugin-react-hooks": "4.2.0", "fs-extra": "^10.0.0", + "memfs": "^3.2.2", "mocha": "^9.0.2", + "mochawesome": "^6.2.2", "prettier": "^2.3.2", "prompts": "^2.4.1", "rollup": "^2.52.7", "rollup-plugin-ts": "^1.4.0", "ts-node": "^10.0.0", + "tsconfig-paths": "^3.9.0", "typedoc": "^0.21.2", "typescript": "^4.3.5" }, @@ -43,4 +54,4 @@ "tiny-invariant": "1.1.0", "tslib": "2.3.0" } -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3d5bcfd..6e26eb2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,25 +1,35 @@ lockfileVersion: 5.3 specifiers: + '@rollup/plugin-json': ^4.1.0 '@types/chai': ^4.2.19 + '@types/chai-as-promised': ^7.1.4 '@types/fs-extra': ^9.0.11 '@types/mocha': github:whitecolor/mocha-types#da22474cf43f48a56c86f8c23a5a0ea36e295768 '@types/node': ^16.0.0 '@types/prompts': ^2.0.13 - '@typescript-eslint/eslint-plugin': 4.28.1 - '@typescript-eslint/parser': 4.28.1 + '@typescript-eslint/eslint-plugin': 4.28.2 + '@typescript-eslint/parser': 4.28.2 chai: ^4.3.4 + chai-as-promised: ^7.1.1 chalk: ^4.1.1 eslint: 7.30.0 + eslint-config-prettier: 8.3.0 + eslint-import-resolver-typescript: 2.4.0 + eslint-plugin-import: 2.23.4 eslint-plugin-react: 7.24.0 + eslint-plugin-react-hooks: 4.2.0 fs-extra: ^10.0.0 + memfs: ^3.2.2 mocha: ^9.0.2 + mochawesome: ^6.2.2 prettier: ^2.3.2 prompts: ^2.4.1 rollup: ^2.52.7 rollup-plugin-ts: ^1.4.0 tiny-invariant: 1.1.0 ts-node: ^10.0.0 + tsconfig-paths: ^3.9.0 tslib: 2.3.0 typedoc: ^0.21.2 typescript: ^4.3.5 @@ -29,24 +39,34 @@ dependencies: tslib: 2.3.0 devDependencies: + '@rollup/plugin-json': 4.1.0_rollup@2.52.7 '@types/chai': 4.2.19 + '@types/chai-as-promised': 7.1.4 '@types/fs-extra': 9.0.11 '@types/mocha': github.com/whitecolor/mocha-types/da22474cf43f48a56c86f8c23a5a0ea36e295768 '@types/node': 16.0.0 '@types/prompts': 2.0.13 - '@typescript-eslint/eslint-plugin': 4.28.1_37ea0521d4014002f404f9b7c2b7f3d2 - '@typescript-eslint/parser': 4.28.1_eslint@7.30.0+typescript@4.3.5 + '@typescript-eslint/eslint-plugin': 4.28.2_5031fffb45dfb7117e61c1d8ea1ef3ff + '@typescript-eslint/parser': 4.28.2_eslint@7.30.0+typescript@4.3.5 chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 chalk: 4.1.1 eslint: 7.30.0 + eslint-config-prettier: 8.3.0_eslint@7.30.0 + eslint-import-resolver-typescript: 2.4.0_4c70df12079b6173ad687cb79f8506b8 + eslint-plugin-import: 2.23.4_eslint@7.30.0 eslint-plugin-react: 7.24.0_eslint@7.30.0 + eslint-plugin-react-hooks: 4.2.0_eslint@7.30.0 fs-extra: 10.0.0 + memfs: 3.2.2 mocha: 9.0.2 + mochawesome: 6.2.2_mocha@9.0.2 prettier: 2.3.2 prompts: 2.4.1 rollup: 2.52.7 rollup-plugin-ts: 1.4.0_rollup@2.52.7+typescript@4.3.5 ts-node: 10.0.0_488376d43314e2606bceb2872a37d0ef + tsconfig-paths: 3.9.0 typedoc: 0.21.2_typescript@4.3.5 typescript: 4.3.5 @@ -1246,6 +1266,27 @@ packages: fastq: 1.8.0 dev: true + /@rollup/plugin-json/4.1.0_rollup@2.52.7: + resolution: {integrity: sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==} + peerDependencies: + rollup: ^1.20.0 || ^2.0.0 + dependencies: + '@rollup/pluginutils': 3.1.0_rollup@2.52.7 + rollup: 2.52.7 + dev: true + + /@rollup/pluginutils/3.1.0_rollup@2.52.7: + resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} + engines: {node: '>= 8.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0 + dependencies: + '@types/estree': 0.0.39 + estree-walker: 1.0.1 + picomatch: 2.3.0 + rollup: 2.52.7 + dev: true + /@rollup/pluginutils/4.1.0_rollup@2.52.7: resolution: {integrity: sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ==} engines: {node: '>= 8.0.0'} @@ -1302,10 +1343,24 @@ packages: '@babel/types': 7.14.5 dev: true + /@types/chai-as-promised/7.1.4: + resolution: {integrity: sha512-1y3L1cHePcIm5vXkh1DSGf/zQq5n5xDKG1fpCvf18+uOkpce0Z1ozNFPkyWsVswK7ntN1sZBw3oU6gmN+pDUcA==} + dependencies: + '@types/chai': 4.2.20 + dev: true + /@types/chai/4.2.19: resolution: {integrity: sha512-jRJgpRBuY+7izT7/WNXP/LsMO9YonsstuL+xuvycDyESpoDoIAsMd7suwpB4h9oEWB+ZlPTqJJ8EHomzNhwTPQ==} dev: true + /@types/chai/4.2.20: + resolution: {integrity: sha512-E121rHk/4BlcEwANZOwcHl8L/Sl0zyIFXJoyggXkl7FCT/4MTf5u25f+qiphe0V5ELaFIkCptgvbf4whCJUVMA==} + dev: true + + /@types/estree/0.0.39: + resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==} + dev: true + /@types/fs-extra/9.0.11: resolution: {integrity: sha512-mZsifGG4QeQ7hlkhO56u7zt/ycBgGxSVsFI/6lGTU34VtwkiqrrSDgw0+ygs8kFGWcXnFQWMrzF2h7TtDFNixA==} dependencies: @@ -1316,6 +1371,10 @@ packages: resolution: {integrity: sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==} dev: true + /@types/json5/0.0.29: + resolution: {integrity: sha1-7ihweulOEdK4J7y+UnC86n8+ce4=} + dev: true + /@types/node/15.14.1: resolution: {integrity: sha512-wF6hazbsnwaW3GhK4jFuw5NaLDQVRQ6pWQUGAUrJzxixFkTaODSiAKMPXuHwPEPkAKQWHAzj6uJ5h+3zU9gQxg==} dev: true @@ -1342,8 +1401,8 @@ packages: resolution: {integrity: sha512-N1rW+njavs70y2cApeIw1vLMYXRwfBy+7trgavGuuTfOd7j1Yh7QTRc/yqsPl6ncokt72ZXuxEU0PiCp9bSwNQ==} dev: true - /@typescript-eslint/eslint-plugin/4.28.1_37ea0521d4014002f404f9b7c2b7f3d2: - resolution: {integrity: sha512-9yfcNpDaNGQ6/LQOX/KhUFTR1sCKH+PBr234k6hI9XJ0VP5UqGxap0AnNwBnWFk1MNyWBylJH9ZkzBXC+5akZQ==} + /@typescript-eslint/eslint-plugin/4.28.2_5031fffb45dfb7117e61c1d8ea1ef3ff: + resolution: {integrity: sha512-PGqpLLzHSxq956rzNGasO3GsAPf2lY9lDUBXhS++SKonglUmJypaUtcKzRtUte8CV7nruwnDxtLUKpVxs0wQBw==} engines: {node: ^10.12.0 || >=12.0.0} peerDependencies: '@typescript-eslint/parser': ^4.0.0 @@ -1353,10 +1412,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/experimental-utils': 4.28.1_eslint@7.30.0+typescript@4.3.5 - '@typescript-eslint/parser': 4.28.1_eslint@7.30.0+typescript@4.3.5 - '@typescript-eslint/scope-manager': 4.28.1 - debug: 4.3.1 + '@typescript-eslint/experimental-utils': 4.28.2_eslint@7.30.0+typescript@4.3.5 + '@typescript-eslint/parser': 4.28.2_eslint@7.30.0+typescript@4.3.5 + '@typescript-eslint/scope-manager': 4.28.2 + debug: 4.3.2 eslint: 7.30.0 functional-red-black-tree: 1.0.1 regexpp: 3.1.0 @@ -1367,16 +1426,16 @@ packages: - supports-color dev: true - /@typescript-eslint/experimental-utils/4.28.1_eslint@7.30.0+typescript@4.3.5: - resolution: {integrity: sha512-n8/ggadrZ+uyrfrSEchx3jgODdmcx7MzVM2sI3cTpI/YlfSm0+9HEUaWw3aQn2urL2KYlWYMDgn45iLfjDYB+Q==} + /@typescript-eslint/experimental-utils/4.28.2_eslint@7.30.0+typescript@4.3.5: + resolution: {integrity: sha512-MwHPsL6qo98RC55IoWWP8/opTykjTp4JzfPu1VfO2Z0MshNP0UZ1GEV5rYSSnZSUI8VD7iHvtIPVGW5Nfh7klQ==} engines: {node: ^10.12.0 || >=12.0.0} peerDependencies: eslint: '*' dependencies: '@types/json-schema': 7.0.7 - '@typescript-eslint/scope-manager': 4.28.1 - '@typescript-eslint/types': 4.28.1 - '@typescript-eslint/typescript-estree': 4.28.1_typescript@4.3.5 + '@typescript-eslint/scope-manager': 4.28.2 + '@typescript-eslint/types': 4.28.2 + '@typescript-eslint/typescript-estree': 4.28.2_typescript@4.3.5 eslint: 7.30.0 eslint-scope: 5.1.1 eslint-utils: 3.0.0_eslint@7.30.0 @@ -1385,8 +1444,8 @@ packages: - typescript dev: true - /@typescript-eslint/parser/4.28.1_eslint@7.30.0+typescript@4.3.5: - resolution: {integrity: sha512-UjrMsgnhQIIK82hXGaD+MCN8IfORS1CbMdu7VlZbYa8LCZtbZjJA26De4IPQB7XYZbL8gJ99KWNj0l6WD0guJg==} + /@typescript-eslint/parser/4.28.2_eslint@7.30.0+typescript@4.3.5: + resolution: {integrity: sha512-Q0gSCN51eikAgFGY+gnd5p9bhhCUAl0ERMiDKrTzpSoMYRubdB8MJrTTR/BBii8z+iFwz8oihxd0RAdP4l8w8w==} engines: {node: ^10.12.0 || >=12.0.0} peerDependencies: eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 @@ -1395,31 +1454,31 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 4.28.1 - '@typescript-eslint/types': 4.28.1 - '@typescript-eslint/typescript-estree': 4.28.1_typescript@4.3.5 - debug: 4.3.1 + '@typescript-eslint/scope-manager': 4.28.2 + '@typescript-eslint/types': 4.28.2 + '@typescript-eslint/typescript-estree': 4.28.2_typescript@4.3.5 + debug: 4.3.2 eslint: 7.30.0 typescript: 4.3.5 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/scope-manager/4.28.1: - resolution: {integrity: sha512-o95bvGKfss6705x7jFGDyS7trAORTy57lwJ+VsYwil/lOUxKQ9tA7Suuq+ciMhJc/1qPwB3XE2DKh9wubW8YYA==} + /@typescript-eslint/scope-manager/4.28.2: + resolution: {integrity: sha512-MqbypNjIkJFEFuOwPWNDjq0nqXAKZvDNNs9yNseoGBB1wYfz1G0WHC2AVOy4XD7di3KCcW3+nhZyN6zruqmp2A==} engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} dependencies: - '@typescript-eslint/types': 4.28.1 - '@typescript-eslint/visitor-keys': 4.28.1 + '@typescript-eslint/types': 4.28.2 + '@typescript-eslint/visitor-keys': 4.28.2 dev: true - /@typescript-eslint/types/4.28.1: - resolution: {integrity: sha512-4z+knEihcyX7blAGi7O3Fm3O6YRCP+r56NJFMNGsmtdw+NCdpG5SgNz427LS9nQkRVTswZLhz484hakQwB8RRg==} + /@typescript-eslint/types/4.28.2: + resolution: {integrity: sha512-Gr15fuQVd93uD9zzxbApz3wf7ua3yk4ZujABZlZhaxxKY8ojo448u7XTm/+ETpy0V0dlMtj6t4VdDvdc0JmUhA==} engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} dev: true - /@typescript-eslint/typescript-estree/4.28.1_typescript@4.3.5: - resolution: {integrity: sha512-GhKxmC4sHXxHGJv8e8egAZeTZ6HI4mLU6S7FUzvFOtsk7ZIDN1ksA9r9DyOgNqowA9yAtZXV0Uiap61bIO81FQ==} + /@typescript-eslint/typescript-estree/4.28.2_typescript@4.3.5: + resolution: {integrity: sha512-86lLstLvK6QjNZjMoYUBMMsULFw0hPHJlk1fzhAVoNjDBuPVxiwvGuPQq3fsBMCxuDJwmX87tM/AXoadhHRljg==} engines: {node: ^10.12.0 || >=12.0.0} peerDependencies: typescript: '*' @@ -1427,9 +1486,9 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 4.28.1 - '@typescript-eslint/visitor-keys': 4.28.1 - debug: 4.3.1 + '@typescript-eslint/types': 4.28.2 + '@typescript-eslint/visitor-keys': 4.28.2 + debug: 4.3.2 globby: 11.0.4 is-glob: 4.0.1 semver: 7.3.5 @@ -1439,11 +1498,11 @@ packages: - supports-color dev: true - /@typescript-eslint/visitor-keys/4.28.1: - resolution: {integrity: sha512-K4HMrdFqr9PFquPu178SaSb92CaWe2yErXyPumc8cYWxFmhgJsNY9eSePmO05j0JhBvf2Cdhptd6E6Yv9HVHcg==} + /@typescript-eslint/visitor-keys/4.28.2: + resolution: {integrity: sha512-aT2B4PLyyRDUVUafXzpZFoc0C9t0za4BJAKP5sgWIhG+jHECQZUEjuQSCIwZdiJJ4w4cgu5r3Kh20SOdtEBl0w==} engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} dependencies: - '@typescript-eslint/types': 4.28.1 + '@typescript-eslint/types': 4.28.2 eslint-visitor-keys: 2.0.0 dev: true @@ -1498,6 +1557,11 @@ packages: engines: {node: '>=4'} dev: true + /ansi-regex/4.1.0: + resolution: {integrity: sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==} + engines: {node: '>=6'} + dev: true + /ansi-regex/5.0.0: resolution: {integrity: sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==} engines: {node: '>=8'} @@ -1522,7 +1586,7 @@ packages: engines: {node: '>= 8'} dependencies: normalize-path: 3.0.0 - picomatch: 2.2.2 + picomatch: 2.3.0 dev: true /arg/4.1.3: @@ -1555,6 +1619,15 @@ packages: engines: {node: '>=8'} dev: true + /array.prototype.flat/1.2.4: + resolution: {integrity: sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.3 + es-abstract: 1.18.3 + dev: true + /array.prototype.flatmap/1.2.4: resolution: {integrity: sha512-r9Z0zYoxqHz60vvQbWEdXIEtCwHF0yxaWfno9qzXeNHvfyl3BZqygmGzb84dsubyaXLH4husF+NFgMSdpZhk2Q==} engines: {node: '>= 0.4'} @@ -1616,19 +1689,19 @@ packages: - supports-color dev: true - /balanced-match/1.0.0: - resolution: {integrity: sha1-ibTRmasr7kneFk6gK4nORi1xt2c=} + /balanced-match/1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} dev: true - /binary-extensions/2.1.0: - resolution: {integrity: sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==} + /binary-extensions/2.2.0: + resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} engines: {node: '>=8'} dev: true /brace-expansion/1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} dependencies: - balanced-match: 1.0.0 + balanced-match: 1.0.2 concat-map: 0.0.1 dev: true @@ -1687,8 +1760,13 @@ packages: engines: {node: '>=6'} dev: true - /camelcase/6.1.0: - resolution: {integrity: sha512-WCMml9ivU60+8rEJgELlFp1gxFcEGxwYleE3bziHEDeqsqAWGHdimB7beBFGjLzVNgPGyDsfgXLQEYMpmIFnVQ==} + /camelcase/5.3.1: + resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} + engines: {node: '>=6'} + dev: true + + /camelcase/6.2.0: + resolution: {integrity: sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==} engines: {node: '>=10'} dev: true @@ -1696,6 +1774,15 @@ packages: resolution: {integrity: sha512-KvNuZ/duufelMB3w2xtf9gEWCSxJwUgoxOx5b6ScLXC4kPc9xsczUVCPrQU26j5kOsHM4pSUL54tAZt5THQKug==} dev: true + /chai-as-promised/7.1.1_chai@4.3.4: + resolution: {integrity: sha512-azL6xMoi+uxu6z4rhWQ1jbdUhOMhis2PvscD/xjLqNMkv3BPPp2JyyuTHOrf9BOosGpNQ11v6BKv/g57RXbiaA==} + peerDependencies: + chai: '>= 2.1.2 < 5' + dependencies: + chai: 4.3.4 + check-error: 1.0.2 + dev: true + /chai/4.3.4: resolution: {integrity: sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==} engines: {node: '>=4'} @@ -1752,6 +1839,14 @@ packages: fsevents: 2.3.2 dev: true + /cliui/5.0.0: + resolution: {integrity: sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==} + dependencies: + string-width: 3.1.0 + strip-ansi: 5.2.0 + wrap-ansi: 5.1.0 + dev: true + /cliui/7.0.4: resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} dependencies: @@ -1842,6 +1937,22 @@ packages: '@types/node': 15.14.1 dev: true + /dateformat/3.0.3: + resolution: {integrity: sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==} + dev: true + + /debug/2.6.9: + resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + dependencies: + ms: 2.0.0 + dev: true + + /debug/3.2.7: + resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} + dependencies: + ms: 2.1.3 + dev: true + /debug/4.2.0: resolution: {integrity: sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==} engines: {node: '>=6.0'} @@ -1892,6 +2003,11 @@ packages: ms: 2.1.2 dev: true + /decamelize/1.2.0: + resolution: {integrity: sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=} + engines: {node: '>=0.10.0'} + dev: true + /decamelize/4.0.0: resolution: {integrity: sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==} engines: {node: '>=10'} @@ -1950,6 +2066,10 @@ packages: resolution: {integrity: sha512-u2quJ862q9reRKh/je3GXis3w38+RoXH1J9N3XjtsS6NzmUAosNsyZgUVFZPN/ZlJ3v6T0rTyZR3q/J5c6Sy5w==} dev: true + /emoji-regex/7.0.3: + resolution: {integrity: sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==} + dev: true + /emoji-regex/8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} dev: true @@ -1961,6 +2081,12 @@ packages: ansi-colors: 4.1.1 dev: true + /error-ex/1.3.2: + resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} + dependencies: + is-arrayish: 0.2.1 + dev: true + /es-abstract/1.18.0-next.1: resolution: {integrity: sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==} engines: {node: '>= 0.4'} @@ -2006,8 +2132,8 @@ packages: engines: {node: '>= 0.4'} dependencies: is-callable: 1.2.3 - is-date-object: 1.0.2 - is-symbol: 1.0.3 + is-date-object: 1.0.4 + is-symbol: 1.0.4 dev: true /escalade/3.1.1: @@ -2015,6 +2141,10 @@ packages: engines: {node: '>=6'} dev: true + /escape-html/1.0.3: + resolution: {integrity: sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=} + dev: true + /escape-string-regexp/1.0.5: resolution: {integrity: sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=} engines: {node: '>=0.8.0'} @@ -2025,6 +2155,81 @@ packages: engines: {node: '>=10'} dev: true + /eslint-config-prettier/8.3.0_eslint@7.30.0: + resolution: {integrity: sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==} + hasBin: true + peerDependencies: + eslint: '>=7.0.0' + dependencies: + eslint: 7.30.0 + dev: true + + /eslint-import-resolver-node/0.3.4: + resolution: {integrity: sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==} + dependencies: + debug: 2.6.9 + resolve: 1.20.0 + dev: true + + /eslint-import-resolver-typescript/2.4.0_4c70df12079b6173ad687cb79f8506b8: + resolution: {integrity: sha512-useJKURidCcldRLCNKWemr1fFQL1SzB3G4a0li6lFGvlc5xGe1hY343bvG07cbpCzPuM/lK19FIJB3XGFSkplA==} + engines: {node: '>=4'} + peerDependencies: + eslint: '*' + eslint-plugin-import: '*' + dependencies: + debug: 4.3.2 + eslint: 7.30.0 + eslint-plugin-import: 2.23.4_eslint@7.30.0 + glob: 7.1.7 + is-glob: 4.0.1 + resolve: 1.20.0 + tsconfig-paths: 3.9.0 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-module-utils/2.6.1: + resolution: {integrity: sha512-ZXI9B8cxAJIH4nfkhTwcRTEAnrVfobYqwjWy/QMCZ8rHkZHFjf9yO4BzpiF9kCSfNlMG54eKigISHpX0+AaT4A==} + engines: {node: '>=4'} + dependencies: + debug: 3.2.7 + pkg-dir: 2.0.0 + dev: true + + /eslint-plugin-import/2.23.4_eslint@7.30.0: + resolution: {integrity: sha512-6/wP8zZRsnQFiR3iaPFgh5ImVRM1WN5NUWfTIRqwOdeiGJlBcSk82o1FEVq8yXmy4lkIzTo7YhHCIxlU/2HyEQ==} + engines: {node: '>=4'} + peerDependencies: + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 + dependencies: + array-includes: 3.1.3 + array.prototype.flat: 1.2.4 + debug: 2.6.9 + doctrine: 2.1.0 + eslint: 7.30.0 + eslint-import-resolver-node: 0.3.4 + eslint-module-utils: 2.6.1 + find-up: 2.1.0 + has: 1.0.3 + is-core-module: 2.4.0 + minimatch: 3.0.4 + object.values: 1.1.4 + pkg-up: 2.0.0 + read-pkg-up: 3.0.0 + resolve: 1.20.0 + tsconfig-paths: 3.9.0 + dev: true + + /eslint-plugin-react-hooks/4.2.0_eslint@7.30.0: + resolution: {integrity: sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ==} + engines: {node: '>=10'} + peerDependencies: + eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 + dependencies: + eslint: 7.30.0 + dev: true + /eslint-plugin-react/7.24.0_eslint@7.30.0: resolution: {integrity: sha512-KJJIx2SYx7PBx3ONe/mEeMz4YE0Lcr7feJTCMyyKb/341NcjuAgim3Acgan89GfPv7nxXK2+0slu0CWXYM4x+Q==} engines: {node: '>=4'} @@ -2169,6 +2374,10 @@ packages: engines: {node: '>=4.0'} dev: true + /estree-walker/1.0.1: + resolution: {integrity: sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==} + dev: true + /estree-walker/2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} dev: true @@ -2191,7 +2400,7 @@ packages: glob-parent: 5.1.2 merge2: 1.4.1 micromatch: 4.0.2 - picomatch: 2.2.2 + picomatch: 2.3.0 dev: true /fast-json-stable-stringify/2.1.0: @@ -2222,6 +2431,20 @@ packages: to-regex-range: 5.0.1 dev: true + /find-up/2.1.0: + resolution: {integrity: sha1-RdG35QbHF93UgndaK3eSCjwMV6c=} + engines: {node: '>=4'} + dependencies: + locate-path: 2.0.0 + dev: true + + /find-up/3.0.0: + resolution: {integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==} + engines: {node: '>=6'} + dependencies: + locate-path: 3.0.0 + dev: true + /find-up/5.0.0: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} @@ -2256,6 +2479,19 @@ packages: universalify: 2.0.0 dev: true + /fs-extra/7.0.1: + resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} + engines: {node: '>=6 <7 || >=8'} + dependencies: + graceful-fs: 4.2.6 + jsonfile: 4.0.0 + universalify: 0.1.2 + dev: true + + /fs-monkey/1.0.3: + resolution: {integrity: sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q==} + dev: true + /fs.realpath/1.0.0: resolution: {integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8=} dev: true @@ -2267,6 +2503,10 @@ packages: dev: true optional: true + /fsu/1.1.1: + resolution: {integrity: sha512-xQVsnjJ/5pQtcKh+KjUoZGzVWn4uNkchxTF6Lwjr4Gf7nQr8fmUfhKJ62zE77+xQg9xnxi5KUps7XGs+VC986A==} + dev: true + /function-bind/1.1.1: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} dev: true @@ -2343,6 +2583,10 @@ packages: resolution: {integrity: sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==} dev: true + /graceful-fs/4.2.6: + resolution: {integrity: sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==} + dev: true + /growl/1.10.5: resolution: {integrity: sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==} engines: {node: '>=4.x'} @@ -2402,6 +2646,10 @@ packages: engines: {node: '>=10.0.0'} dev: true + /hosted-git-info/2.8.9: + resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} + dev: true + /ignore/4.0.6: resolution: {integrity: sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==} engines: {node: '>= 4'} @@ -2445,6 +2693,10 @@ packages: side-channel: 1.0.4 dev: true + /is-arrayish/0.2.1: + resolution: {integrity: sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=} + dev: true + /is-bigint/1.0.2: resolution: {integrity: sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==} dev: true @@ -2453,7 +2705,7 @@ packages: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} engines: {node: '>=8'} dependencies: - binary-extensions: 2.1.0 + binary-extensions: 2.2.0 dev: true /is-boolean-object/1.1.1: @@ -2479,8 +2731,8 @@ packages: has: 1.0.3 dev: true - /is-date-object/1.0.2: - resolution: {integrity: sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==} + /is-date-object/1.0.4: + resolution: {integrity: sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A==} engines: {node: '>= 0.4'} dev: true @@ -2556,8 +2808,8 @@ packages: engines: {node: '>= 0.4'} dev: true - /is-symbol/1.0.3: - resolution: {integrity: sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==} + /is-symbol/1.0.4: + resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} engines: {node: '>= 0.4'} dependencies: has-symbols: 1.0.2 @@ -2607,6 +2859,10 @@ packages: hasBin: true dev: true + /json-parse-better-errors/1.0.2: + resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==} + dev: true + /json-schema-traverse/0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} dev: true @@ -2619,6 +2875,17 @@ packages: resolution: {integrity: sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=} dev: true + /json-stringify-safe/5.0.1: + resolution: {integrity: sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=} + dev: true + + /json5/1.0.1: + resolution: {integrity: sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==} + hasBin: true + dependencies: + minimist: 1.2.5 + dev: true + /json5/2.2.0: resolution: {integrity: sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==} engines: {node: '>=6'} @@ -2627,6 +2894,12 @@ packages: minimist: 1.2.5 dev: true + /jsonfile/4.0.0: + resolution: {integrity: sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=} + optionalDependencies: + graceful-fs: 4.2.6 + dev: true + /jsonfile/6.0.1: resolution: {integrity: sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==} dependencies: @@ -2656,6 +2929,32 @@ packages: type-check: 0.4.0 dev: true + /load-json-file/4.0.0: + resolution: {integrity: sha1-L19Fq5HjMhYjT9U62rZo607AmTs=} + engines: {node: '>=4'} + dependencies: + graceful-fs: 4.2.6 + parse-json: 4.0.0 + pify: 3.0.0 + strip-bom: 3.0.0 + dev: true + + /locate-path/2.0.0: + resolution: {integrity: sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=} + engines: {node: '>=4'} + dependencies: + p-locate: 2.0.0 + path-exists: 3.0.0 + dev: true + + /locate-path/3.0.0: + resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==} + engines: {node: '>=6'} + dependencies: + p-locate: 3.0.0 + path-exists: 3.0.0 + dev: true + /locate-path/6.0.0: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} @@ -2671,6 +2970,22 @@ packages: resolution: {integrity: sha1-gteb/zCmfEAF/9XiUVMArZyk168=} dev: true + /lodash.isempty/4.4.0: + resolution: {integrity: sha1-b4bL7di+TsmHvpqvM8loTbGzHn4=} + dev: true + + /lodash.isfunction/3.0.9: + resolution: {integrity: sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==} + dev: true + + /lodash.isobject/3.0.2: + resolution: {integrity: sha1-PI+41bW/S/kK4G4U8qUwpO2TXh0=} + dev: true + + /lodash.isstring/4.0.1: + resolution: {integrity: sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=} + dev: true + /lodash.merge/4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} dev: true @@ -2687,7 +3002,7 @@ packages: resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} engines: {node: '>=10'} dependencies: - chalk: 4.1.0 + chalk: 4.1.1 is-unicode-supported: 0.1.0 dev: true @@ -2731,6 +3046,13 @@ packages: hasBin: true dev: true + /memfs/3.2.2: + resolution: {integrity: sha512-RE0CwmIM3CEvpcdK3rZ19BC4E6hv9kADkMN5rPduRak58cNArWLi/9jFLsa4rhsjfVxMP3v0jO7FHXq7SvFY5Q==} + engines: {node: '>= 4.0.0'} + dependencies: + fs-monkey: 1.0.3 + dev: true + /merge2/1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} @@ -2741,7 +3063,7 @@ packages: engines: {node: '>=8'} dependencies: braces: 3.0.2 - picomatch: 2.2.2 + picomatch: 2.3.0 dev: true /minimatch/3.0.4: @@ -2786,6 +3108,46 @@ packages: yargs-unparser: 2.0.0 dev: true + /mochawesome-report-generator/5.2.0: + resolution: {integrity: sha512-DDY/3jSkM/VrWy0vJtdYOf6qBLdaPaLcI7rQmBVbnclIX7AKniE1Rhz3T/cMT/7u54W5EHNo1z84z7efotq/Eg==} + hasBin: true + dependencies: + chalk: 2.4.2 + dateformat: 3.0.3 + escape-html: 1.0.3 + fs-extra: 7.0.1 + fsu: 1.1.1 + lodash.isfunction: 3.0.9 + opener: 1.5.2 + prop-types: 15.7.2 + tcomb: 3.2.29 + tcomb-validation: 3.4.1 + validator: 10.11.0 + yargs: 13.3.2 + dev: true + + /mochawesome/6.2.2_mocha@9.0.2: + resolution: {integrity: sha512-NuIxYo8zczmL5XWLNFiud21OsAJHXrflt2lcRY2u8a3TilGwglhzTPjUHZCLqJvbqj2CnIHX2ueqOh1ViUNDPw==} + peerDependencies: + mocha: '>=7' + dependencies: + chalk: 4.1.1 + diff: 5.0.0 + json-stringify-safe: 5.0.1 + lodash.isempty: 4.4.0 + lodash.isfunction: 3.0.9 + lodash.isobject: 3.0.2 + lodash.isstring: 4.0.1 + mocha: 9.0.2 + mochawesome-report-generator: 5.2.0 + strip-ansi: 6.0.0 + uuid: 8.3.2 + dev: true + + /ms/2.0.0: + resolution: {integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=} + dev: true + /ms/2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} dev: true @@ -2812,6 +3174,15 @@ packages: resolution: {integrity: sha512-uW7fodD6pyW2FZNZnp/Z3hvWKeEW1Y8R1+1CnErE8cXFXzl5blBOoVB41CvMer6P6Q0S5FXDwcHgFd1Wj0U9zg==} dev: true + /normalize-package-data/2.5.0: + resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} + dependencies: + hosted-git-info: 2.8.9 + resolve: 1.20.0 + semver: 5.7.1 + validate-npm-package-license: 3.0.4 + dev: true + /normalize-path/3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} @@ -2900,6 +3271,11 @@ packages: lru-cache: 5.1.1 dev: true + /opener/1.5.2: + resolution: {integrity: sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==} + hasBin: true + dev: true + /optionator/0.9.1: resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==} engines: {node: '>= 0.8.0'} @@ -2912,18 +3288,51 @@ packages: word-wrap: 1.2.3 dev: true - /p-limit/3.0.2: - resolution: {integrity: sha512-iwqZSOoWIW+Ew4kAGUlN16J4M7OB3ysMLSZtnhmqx7njIHFPlxWBX8xo3lVTyFVq6mI/lL9qt2IsN1sHwaxJkg==} - engines: {node: '>=10'} + /p-limit/1.3.0: + resolution: {integrity: sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==} + engines: {node: '>=4'} + dependencies: + p-try: 1.0.0 + dev: true + + /p-limit/2.3.0: + resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} + engines: {node: '>=6'} dependencies: p-try: 2.2.0 dev: true + /p-limit/3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + dependencies: + yocto-queue: 0.1.0 + dev: true + + /p-locate/2.0.0: + resolution: {integrity: sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=} + engines: {node: '>=4'} + dependencies: + p-limit: 1.3.0 + dev: true + + /p-locate/3.0.0: + resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==} + engines: {node: '>=6'} + dependencies: + p-limit: 2.3.0 + dev: true + /p-locate/5.0.0: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} dependencies: - p-limit: 3.0.2 + p-limit: 3.1.0 + dev: true + + /p-try/1.0.0: + resolution: {integrity: sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=} + engines: {node: '>=4'} dev: true /p-try/2.2.0: @@ -2938,6 +3347,19 @@ packages: callsites: 3.1.0 dev: true + /parse-json/4.0.0: + resolution: {integrity: sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=} + engines: {node: '>=4'} + dependencies: + error-ex: 1.3.2 + json-parse-better-errors: 1.0.2 + dev: true + + /path-exists/3.0.0: + resolution: {integrity: sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=} + engines: {node: '>=4'} + dev: true + /path-exists/4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -2961,6 +3383,13 @@ packages: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} dev: true + /path-type/3.0.0: + resolution: {integrity: sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==} + engines: {node: '>=4'} + dependencies: + pify: 3.0.0 + dev: true + /path-type/4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} @@ -2970,16 +3399,30 @@ packages: resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} dev: true - /picomatch/2.2.2: - resolution: {integrity: sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==} - engines: {node: '>=8.6'} - dev: true - /picomatch/2.3.0: resolution: {integrity: sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==} engines: {node: '>=8.6'} dev: true + /pify/3.0.0: + resolution: {integrity: sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=} + engines: {node: '>=4'} + dev: true + + /pkg-dir/2.0.0: + resolution: {integrity: sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=} + engines: {node: '>=4'} + dependencies: + find-up: 2.1.0 + dev: true + + /pkg-up/2.0.0: + resolution: {integrity: sha1-yBmscoBZpGHKscOImivjxJoATX8=} + engines: {node: '>=4'} + dependencies: + find-up: 2.1.0 + dev: true + /prelude-ls/1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -3027,11 +3470,28 @@ packages: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} dev: true + /read-pkg-up/3.0.0: + resolution: {integrity: sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=} + engines: {node: '>=4'} + dependencies: + find-up: 2.1.0 + read-pkg: 3.0.0 + dev: true + + /read-pkg/3.0.0: + resolution: {integrity: sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=} + engines: {node: '>=4'} + dependencies: + load-json-file: 4.0.0 + normalize-package-data: 2.5.0 + path-type: 3.0.0 + dev: true + /readdirp/3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} dependencies: - picomatch: 2.2.2 + picomatch: 2.3.0 dev: true /regenerate-unicode-properties/8.2.0: @@ -3101,6 +3561,10 @@ packages: engines: {node: '>=0.10.0'} dev: true + /require-main-filename/2.0.0: + resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} + dev: true + /resolve-from/4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -3186,6 +3650,11 @@ packages: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} dev: true + /semver/5.7.1: + resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} + hasBin: true + dev: true + /semver/6.3.0: resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} hasBin: true @@ -3216,6 +3685,10 @@ packages: randombytes: 2.1.0 dev: true + /set-blocking/2.0.0: + resolution: {integrity: sha1-BF+XgtARrppoA93TgrJDkrPYkPc=} + dev: true + /shebang-command/2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} @@ -3283,6 +3756,28 @@ packages: resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==} dev: true + /spdx-correct/3.1.1: + resolution: {integrity: sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==} + dependencies: + spdx-expression-parse: 3.0.1 + spdx-license-ids: 3.0.9 + dev: true + + /spdx-exceptions/2.3.0: + resolution: {integrity: sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==} + dev: true + + /spdx-expression-parse/3.0.1: + resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} + dependencies: + spdx-exceptions: 2.3.0 + spdx-license-ids: 3.0.9 + dev: true + + /spdx-license-ids/3.0.9: + resolution: {integrity: sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==} + dev: true + /sprintf-js/1.0.3: resolution: {integrity: sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=} dev: true @@ -3295,6 +3790,15 @@ packages: strip-ansi: 4.0.0 dev: true + /string-width/3.1.0: + resolution: {integrity: sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==} + engines: {node: '>=6'} + dependencies: + emoji-regex: 7.0.3 + is-fullwidth-code-point: 2.0.0 + strip-ansi: 5.2.0 + dev: true + /string-width/4.2.2: resolution: {integrity: sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==} engines: {node: '>=8'} @@ -3352,6 +3856,13 @@ packages: ansi-regex: 3.0.0 dev: true + /strip-ansi/5.2.0: + resolution: {integrity: sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==} + engines: {node: '>=6'} + dependencies: + ansi-regex: 4.1.0 + dev: true + /strip-ansi/6.0.0: resolution: {integrity: sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==} engines: {node: '>=8'} @@ -3359,6 +3870,11 @@ packages: ansi-regex: 5.0.0 dev: true + /strip-bom/3.0.0: + resolution: {integrity: sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=} + engines: {node: '>=4'} + dev: true + /strip-json-comments/3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} @@ -3397,6 +3913,16 @@ packages: strip-ansi: 6.0.0 dev: true + /tcomb-validation/3.4.1: + resolution: {integrity: sha512-urVVMQOma4RXwiVCa2nM2eqrAomHROHvWPuj6UkDGz/eb5kcy0x6P0dVt6kzpUZtYMNoAqJLWmz1BPtxrtjtrA==} + dependencies: + tcomb: 3.2.29 + dev: true + + /tcomb/3.2.29: + resolution: {integrity: sha512-di2Hd1DB2Zfw6StGv861JoAF5h/uQVu/QJp2g8KVbtfKnoHdBQl5M32YWq6mnSYBQ1vFFrns5B1haWJL7rKaOQ==} + dev: true + /text-table/0.2.0: resolution: {integrity: sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=} dev: true @@ -3456,6 +3982,15 @@ packages: yn: 3.1.1 dev: true + /tsconfig-paths/3.9.0: + resolution: {integrity: sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==} + dependencies: + '@types/json5': 0.0.29 + json5: 1.0.1 + minimist: 1.2.5 + strip-bom: 3.0.0 + dev: true + /tslib/1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true @@ -3563,6 +4098,11 @@ packages: engines: {node: '>=4'} dev: true + /universalify/0.1.2: + resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} + engines: {node: '>= 4.0.0'} + dev: true + /universalify/1.0.0: resolution: {integrity: sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==} engines: {node: '>= 10.0.0'} @@ -3579,10 +4119,27 @@ packages: punycode: 2.1.1 dev: true + /uuid/8.3.2: + resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} + hasBin: true + dev: true + /v8-compile-cache/2.1.1: resolution: {integrity: sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==} dev: true + /validate-npm-package-license/3.0.4: + resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} + dependencies: + spdx-correct: 3.1.1 + spdx-expression-parse: 3.0.1 + dev: true + + /validator/10.11.0: + resolution: {integrity: sha512-X/p3UZerAIsbBfN/IwahhYaBbY68EN/UQBWHtsbXGT5bfrH/p4NQzUCG1kF/rtKaNpnJ7jAu6NGTdSNtyNIXMw==} + engines: {node: '>= 0.10'} + dev: true + /vscode-textmate/5.2.0: resolution: {integrity: sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==} dev: true @@ -3594,7 +4151,11 @@ packages: is-boolean-object: 1.1.1 is-number-object: 1.0.5 is-string: 1.0.6 - is-symbol: 1.0.3 + is-symbol: 1.0.4 + dev: true + + /which-module/2.0.0: + resolution: {integrity: sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=} dev: true /which/2.0.2: @@ -3624,6 +4185,15 @@ packages: resolution: {integrity: sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw==} dev: true + /wrap-ansi/5.1.0: + resolution: {integrity: sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==} + engines: {node: '>=6'} + dependencies: + ansi-styles: 3.2.1 + string-width: 3.1.0 + strip-ansi: 5.2.0 + dev: true + /wrap-ansi/7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} @@ -3637,6 +4207,10 @@ packages: resolution: {integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=} dev: true + /y18n/4.0.3: + resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} + dev: true + /y18n/5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} @@ -3650,6 +4224,13 @@ packages: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} dev: true + /yargs-parser/13.1.2: + resolution: {integrity: sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==} + dependencies: + camelcase: 5.3.1 + decamelize: 1.2.0 + dev: true + /yargs-parser/20.2.4: resolution: {integrity: sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==} engines: {node: '>=10'} @@ -3659,12 +4240,27 @@ packages: resolution: {integrity: sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==} engines: {node: '>=10'} dependencies: - camelcase: 6.1.0 + camelcase: 6.2.0 decamelize: 4.0.0 flat: 5.0.2 is-plain-obj: 2.1.0 dev: true + /yargs/13.3.2: + resolution: {integrity: sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==} + dependencies: + cliui: 5.0.0 + find-up: 3.0.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + require-main-filename: 2.0.0 + set-blocking: 2.0.0 + string-width: 3.1.0 + which-module: 2.0.0 + y18n: 4.0.3 + yargs-parser: 13.1.2 + dev: true + /yargs/16.2.0: resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} engines: {node: '>=10'} @@ -3683,6 +4279,11 @@ packages: engines: {node: '>=6'} dev: true + /yocto-queue/0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + dev: true + github.com/whitecolor/mocha-types/da22474cf43f48a56c86f8c23a5a0ea36e295768: resolution: {tarball: https://codeload.github.com/whitecolor/mocha-types/tar.gz/da22474cf43f48a56c86f8c23a5a0ea36e295768} name: '@types/mocha' diff --git a/repl.ts b/repl.ts index d9a5a7a..ef29dfd 100755 --- a/repl.ts +++ b/repl.ts @@ -24,6 +24,7 @@ async function main(args: string[]) { }) vault.unlock(password) + console.log(vault.overviews.values()) } main(process.argv.slice(2)) diff --git a/rollup.config.js b/rollup.config.js index 2b4602e..1778179 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,5 +1,6 @@ -import ts from "rollup-plugin-ts" import { builtinModules } from "module" +import ts from "rollup-plugin-ts" +import json from "@rollup/plugin-json" import { dependencies } from "./package.json" /** @returns {import("rollup").RollupOptions} */ @@ -10,5 +11,5 @@ export default () => ({ file: "lib/index.js", format: "cjs", }, - plugins: [ts()], + plugins: [ts(), json()], }) diff --git a/src/i18n/index.ts b/src/i18n/index.ts new file mode 100644 index 0000000..bc39d3d --- /dev/null +++ b/src/i18n/index.ts @@ -0,0 +1,26 @@ +import json from "./res.json" + +const locale = + process.env.LOCALE || Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0] + +const mapValue = ( + object: Record, + fn: (value: T, key: string) => R +): Record => { + const res = Object.create(null) + Object.entries(object).forEach(([key, value]) => { + res[key] = fn(value, key) + }) + return res +} + +type json = typeof json +type i18n = { + [K in keyof json]: { + [L in keyof json[K]]: string + } +} + +export const i18n: i18n = mapValue(json, dict => + mapValue(dict, (value: any) => value[locale] ?? value.en) +) as any diff --git a/src/i18n/res.json b/src/i18n/res.json new file mode 100644 index 0000000..578dd41 --- /dev/null +++ b/src/i18n/res.json @@ -0,0 +1,16 @@ +{ + "error": { + "invalidPassword": { + "en": "Invalid password", + "fr": "Mot de passe invalide" + }, + "vaultIsLocked": { + "en": "This vault is locked", + "fr": "Ce coffre est verrouillé." + }, + "cannotDecryptOverviewItem": { + "en": "Failed to decrypt overview item", + "fr": "Impossible de déchiffrer cet aperçu" + } + } +} diff --git a/src/index.ts b/src/index.ts index 81faf08..5cae43a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,6 @@ import { resolve } from "path" -import { getDefaultFileSystem, IFileSystem } from "./fs" +import type { IFileSystem } from "./fs" +import { getDefaultFileSystem } from "./fs" import { Vault } from "./vault" export type { Vault } from "./vault" diff --git a/src/models.ts b/src/models.ts index bc6789a..b9c89b6 100644 --- a/src/models.ts +++ b/src/models.ts @@ -17,7 +17,7 @@ export enum Category { Rewards = 107, SSN = 108, Router = 109, - Server = 100, + Server = 110, Email = 111, } diff --git a/src/vault.ts b/src/vault.ts index 83fa92c..c172625 100644 --- a/src/vault.ts +++ b/src/vault.ts @@ -1,5 +1,7 @@ import * as crypto from "crypto" -import { IFileSystem, OnePasswordFileManager } from "./fs" +import type { IFileSystem } from "./fs" +import { OnePasswordFileManager } from "./fs" +import { i18n } from "./i18n" import type { Profile, Band, Overview, EncryptedItem, Item } from "./types" @@ -10,8 +12,8 @@ type FoldersMap = { [uuid: string]: Band } */ export class Vault { // Ciphers - #master: Cipher - #overview: Cipher + #master?: Cipher + #overview?: Cipher // File system interface #files: OnePasswordFileManager @@ -35,10 +37,6 @@ export class Vault { this.#profile = profile this.#folders = folders this.#bands = bands - - this.#files - this.#folders - this.#items } /** @@ -59,6 +57,24 @@ export class Vault { return new Vault(files, profile, folders, bands) } + readonly overviews = Object.freeze({ + get: (condition: string | ((overview: Overview) => boolean)) => { + this.#assertUnlocked() + + if (typeof condition === "string") { + const title = condition + condition = overview => overview.title === title + } + for (const value of this.#overviews.values()) { + if (condition(value)) { + return value + } + } + }, + + values: () => Array.from(this.#overviews.values()), + }) + /** * Unlock this OnePassword vault. * @param masterPassword User provided master password. Only the derived @@ -82,10 +98,13 @@ export class Vault { this.#overview = decryptKeys(profile.overviewKey, cipher) } catch (e) { if (e instanceof HMACAssertionError) { - throw new Error("Invalid password.") + throw new Error(i18n.error.invalidPassword) } throw e } + + this.#readOverviews() + return this } /** @@ -95,10 +114,17 @@ export class Vault { this.#master = null! this.#overview = null! this.#overviews.clear() + return this } get isLocked() { - return Boolean(this.#master.key) + return this.#master?.key == null + } + + #assertUnlocked() { + if (this.isLocked) { + throw new Error(i18n.error.vaultIsLocked) + } } getOverview(title: string): Overview @@ -117,43 +143,44 @@ export class Vault { } getItem(uuid: string) { + this.#assertUnlocked() const encrypted = uuid ? this.#bands.get(uuid[0])![uuid] : undefined - return encrypted && this.decryptItem(encrypted) + return encrypted && decryptItem(encrypted, this.#master!) } - readItems() { + #readOverviews() { + this.#assertUnlocked() this.#bands.forEach(value => { for (const [uuid, item] of Object.entries(value)) { - const overview = this.decryptOverview(item) + const overview = decryptOverview(item, this.#overview!) overview.uuid = uuid this.#overviews.set(uuid, overview) } }) - return this } +} - private decryptOverview(item: EncryptedItem) { - try { - const overview = decryptOPData(toBuffer(item.o), this.#overview) - return JSON.parse(overview.toString("utf8")) as Overview - } catch (e) { - console.error("Failed to decrypt overview item.") - throw e - } +function decryptOverview(item: EncryptedItem, overviewCipher: Cipher) { + try { + const overview = decryptOPData(toBuffer(item.o), overviewCipher) + return JSON.parse(overview.toString("utf8")) as Overview + } catch (e) { + console.error(i18n.error.cannotDecryptOverviewItem) + throw e } +} - private decryptItem(item: EncryptedItem): Item { - const k = toBuffer(item.k) - const data = k.slice(0, -32) - assertHMac(data, this.#master.hmac, k.slice(-32)) - const derivedKey = decryptData(this.#master.key, data.slice(0, 16), data.slice(16)) +function decryptItem(item: EncryptedItem, master: Cipher): Item { + const k = toBuffer(item.k) + const data = k.slice(0, -32) + assertHMac(data, master.hmac, k.slice(-32)) + const derivedKey = decryptData(master.key, data.slice(0, 16), data.slice(16)) - const detail = decryptOPData( - /* cipherText */ toBuffer(item.d), - /* cipher */ splitPlainText(derivedKey) - ) - return JSON.parse(detail.toString("utf-8")) - } + const detail = decryptOPData( + /* cipherText */ toBuffer(item.d), + /* cipher */ splitPlainText(derivedKey) + ) + return JSON.parse(detail.toString("utf-8")) } /** Encryption and MAC */ @@ -189,7 +216,7 @@ function decryptOPData(cipherText: Buffer, cipher: Cipher) { function assertHMac(data: Buffer, key: Buffer, expected: Buffer) { const actual = crypto.createHmac("sha256", key).update(data).digest() if (!actual.equals(expected)) { - throw new HMACAssertionError("HMAC assertion failed.") + throw new HMACAssertionError() } } diff --git a/test/.prettierrc b/test/.prettierrc new file mode 100644 index 0000000..732e220 --- /dev/null +++ b/test/.prettierrc @@ -0,0 +1,3 @@ +{ + "semi": true +} diff --git a/test/before.ts b/test/before.ts new file mode 100644 index 0000000..cfc0184 --- /dev/null +++ b/test/before.ts @@ -0,0 +1,5 @@ +import chai from "chai"; +import chaiAsPromised from "chai-as-promised"; + +process.env.LOCALE = "en"; +chai.use(chaiAsPromised); diff --git a/test/profile.test.ts b/test/profile.test.ts new file mode 100644 index 0000000..36ae3ee --- /dev/null +++ b/test/profile.test.ts @@ -0,0 +1,42 @@ +import { resolve } from "path"; +import { describe, it, beforeEach } from "mocha"; +import { expect } from "chai"; +// import { fs, vol } from "memfs" + +import type { Vault } from "../src/index"; +import { OnePassword } from "../src/index"; + +describe("OnePassword", () => { + const freddy = resolve(__dirname, "../freddy-2013-12-04.opvault"); + + describe("getProfileNames", () => { + it("freddy", async () => { + const instance = new OnePassword({ path: freddy }); + expect(await instance.getProfileNames()).to.deep.equal(["default"]); + }); + + it.skip("ignores faulty folders", async () => {}); + }); + + describe("unlock", () => { + let vault: Vault; + + beforeEach(async () => { + vault = await new OnePassword({ path: freddy }).getProfile("default"); + }); + + it("accepts correct password", () => { + expect(() => vault.unlock("freddy")).to.not.throw(); + expect(vault.isLocked).to.be.false; + }); + + it("rejects wrong password", () => { + ["Freddy", "_freddy", ""].forEach((password) => { + expect(() => vault.unlock(password)).to.throw("Invalid password"); + expect(vault.isLocked).to.be.true; + }); + }); + }); + + describe("lock", () => {}); +});