From 61fee2bbf36748555a2a1bcd5cefc8777ed10206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= Date: Thu, 27 Apr 2023 09:33:09 +0000 Subject: [PATCH] refactor: mapping generation for `Elasticsearch 8.4 --- .eslintignore | 0 .eslintrc | 3 + .gitignore | 3 + package-lock.json | 1389 ++++++++++++++--- package.json | 18 +- src/cli.ts | 39 +- src/config/fieldmap.ts | 24 +- src/config/premap.ts | 14 +- src/config/settings.ts | 51 +- src/config/typemap.ts | 4 +- src/mapping.ts | 441 ++++-- src/project-reflection.ts | 28 +- src/types/aggregation.d.ts | 7 +- src/types/mapping.d.ts | 22 +- test/aggregations.spec.ts | 23 +- .../aggregations/src/agg-array.agg-test.ts | 2 +- .../src/agg-global-nested.agg-test.ts | 2 +- .../aggregations/src/agg-global.agg-test.ts | 2 +- .../src/agg-inherited-global.agg-test.ts | 3 +- .../src/agg-inherited-overwritten.agg-test.ts | 3 +- .../src/agg-inherited.agg-test.ts | 3 +- .../aggregations/src/agg-nested.agg-test.ts | 2 +- ...TestOptions.ts => map-agg-test-options.ts} | 2 +- .../{MapAggTest.ts => map-agg-test.ts} | 66 +- .../mappings/src/any-unknown.mapping-test.ts | 15 +- .../mappings/src/date.mapping-test.ts | 10 +- .../src/default-generics.mapping-test.ts | 16 +- .../src/double-type-conflict.mapping-test.ts | 14 +- .../mappings/src/enum.mapping-test.ts | 17 +- .../src/filterable-tag.mapping-test.ts | 38 +- .../mappings/src/generics.mapping-test.ts | 22 +- .../src/impossible-union.mapping-test.ts | 14 +- .../src/incompatible-type.mapping-test.ts | 17 +- .../src/index-signature.mapping-test.ts | 28 +- .../inferred-type-filterable.mapping-test.ts | 14 +- .../mappings/src/inherit-tags.mapping-test.ts | 20 +- .../src/inherited-property.mapping-test.ts | 18 +- .../mappings/src/invalid-tag.mapping-test.ts | 13 +- .../src/map-explicit-types.mapping-test.ts | 22 +- .../src/missing-premap.mapping-test.ts | 12 +- .../mappings/src/nested.mapping-test.ts | 32 +- .../mappings/src/object-union.mapping-test.ts | 20 +- .../mappings/src/paired-tags.mapping-test.ts | 27 +- .../src/sensible-defaults.mapping-test.ts | 20 +- .../mappings/src/sortable-tag.mapping-test.ts | 43 +- .../src/tags-ignore-case.mapping-test.ts | 26 +- .../mappings/src/type-alias.mapping-test.ts | 12 +- .../src/type-overrides.mapping-test.ts | 8 +- .../src/type-query.mapping-test.disabled.ts | 12 +- ...apper-inheritance.mapping-test.disabled.ts | 20 +- test/mapping.spec.ts | 27 +- tslint.json | 143 -- 52 files changed, 1859 insertions(+), 972 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc rename test/mapping-model/{MapAggTestOptions.ts => map-agg-test-options.ts} (99%) rename test/mapping-model/{MapAggTest.ts => map-agg-test.ts} (75%) delete mode 100644 tslint.json diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..e69de29b diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 00000000..31d47702 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,3 @@ +{ + "extends": "@openstapps" +} diff --git a/.gitignore b/.gitignore index 9e8635ea..062b8e7e 100644 --- a/.gitignore +++ b/.gitignore @@ -96,3 +96,6 @@ docs/ # ignore openapi resources openapi/ + +# generated mappings +/mappings diff --git a/package-lock.json b/package-lock.json index 94f96ef7..c6893749 100644 --- a/package-lock.json +++ b/package-lock.json @@ -91,6 +91,57 @@ "@jridgewell/trace-mapping": "0.3.9" } }, + "@es-joy/jsdoccomment": { + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.31.0.tgz", + "integrity": "sha512-tc1/iuQcnaiSIUVad72PBierDFpsxdUHtEF/OrfqvM1CBAsIoMP51j52jTMb3dXriwhieTo289InzZj72jL3EQ==", + "dev": true, + "requires": { + "comment-parser": "1.3.1", + "esquery": "^1.4.0", + "jsdoc-type-pratt-parser": "~3.1.0" + } + }, + "@eslint/eslintrc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", + "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.4.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + } + }, + "@humanwhocodes/config-array": { + "version": "0.10.7", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.7.tgz", + "integrity": "sha512-MDl6D6sBsaV452/QSdX+4CXIjZhIcI0PELsxUjk4U828yd58vk3bTIvk/6w5FY+4hIy9sLW0sfrV7K7Kc++j/w==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + } + }, + "@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true + }, + "@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, "@hutson/parse-repository-url": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz", @@ -119,6 +170,38 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "@openstapps/eslint-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@openstapps/eslint-config/-/eslint-config-1.1.0.tgz", + "integrity": "sha512-yhSWgzKB5cU3kTtWdAOEO6y4PjLDBnyJc+Dpmz9Rxg97WSViOiz3Bv9BWTSl0TR56GAnFi0NI8K56RfCqjpk5w==", + "dev": true + }, "@openstapps/logger": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@openstapps/logger/-/logger-1.1.1.tgz", @@ -230,6 +313,12 @@ "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==" }, + "@types/json-schema": { + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "dev": true + }, "@types/keyv": { "version": "3.1.4", "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", @@ -315,6 +404,226 @@ "@types/node": "*" } }, + "@typescript-eslint/eslint-plugin": { + "version": "5.40.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.40.0.tgz", + "integrity": "sha512-FIBZgS3DVJgqPwJzvZTuH4HNsZhHMa9SjxTKAZTlMsPw/UzpEjcf9f4dfgDJEHjK+HboUJo123Eshl6niwEm/Q==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "5.40.0", + "@typescript-eslint/type-utils": "5.40.0", + "@typescript-eslint/utils": "5.40.0", + "debug": "^4.3.4", + "ignore": "^5.2.0", + "regexpp": "^3.2.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + } + } + }, + "@typescript-eslint/parser": { + "version": "5.40.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.40.0.tgz", + "integrity": "sha512-Ah5gqyX2ySkiuYeOIDg7ap51/b63QgWZA7w6AHtFrag7aH0lRQPbLzUjk0c9o5/KZ6JRkTTDKShL4AUrQa6/hw==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "5.40.0", + "@typescript-eslint/types": "5.40.0", + "@typescript-eslint/typescript-estree": "5.40.0", + "debug": "^4.3.4" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "@typescript-eslint/scope-manager": { + "version": "5.40.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.40.0.tgz", + "integrity": "sha512-d3nPmjUeZtEWRvyReMI4I1MwPGC63E8pDoHy0BnrYjnJgilBD3hv7XOiETKLY/zTwI7kCnBDf2vWTRUVpYw0Uw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.40.0", + "@typescript-eslint/visitor-keys": "5.40.0" + } + }, + "@typescript-eslint/type-utils": { + "version": "5.40.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.40.0.tgz", + "integrity": "sha512-nfuSdKEZY2TpnPz5covjJqav+g5qeBqwSHKBvz7Vm1SAfy93SwKk/JeSTymruDGItTwNijSsno5LhOHRS1pcfw==", + "dev": true, + "requires": { + "@typescript-eslint/typescript-estree": "5.40.0", + "@typescript-eslint/utils": "5.40.0", + "debug": "^4.3.4", + "tsutils": "^3.21.0" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + } + } + }, + "@typescript-eslint/types": { + "version": "5.40.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.40.0.tgz", + "integrity": "sha512-V1KdQRTXsYpf1Y1fXCeZ+uhjW48Niiw0VGt4V8yzuaDTU8Z1Xl7yQDyQNqyAFcVhpYXIVCEuxSIWTsLDpHgTbw==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "5.40.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.40.0.tgz", + "integrity": "sha512-b0GYlDj8TLTOqwX7EGbw2gL5EXS2CPEWhF9nGJiGmEcmlpNBjyHsTwbqpyIEPVpl6br4UcBOYlcI2FJVtJkYhg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.40.0", + "@typescript-eslint/visitor-keys": "5.40.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + } + } + }, + "@typescript-eslint/utils": { + "version": "5.40.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.40.0.tgz", + "integrity": "sha512-MO0y3T5BQ5+tkkuYZJBjePewsY+cQnfkYeRqS6tPh28niiIwPnQ1t59CSRcs1ZwJJNOdWw7rv9pF8aP58IMihA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.40.0", + "@typescript-eslint/types": "5.40.0", + "@typescript-eslint/typescript-estree": "5.40.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0", + "semver": "^7.3.7" + }, + "dependencies": { + "semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "@typescript-eslint/visitor-keys": { + "version": "5.40.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.40.0.tgz", + "integrity": "sha512-ijJ+6yig+x9XplEpG2K6FUdJeQGGj/15U3S56W9IqXKJqleuD7zJ2AX/miLezwxpd7ZxDAqO87zWufKg+RPZyQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.40.0", + "eslint-visitor-keys": "^3.3.0" + } + }, "@ungap/promise-all-settled": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", @@ -337,6 +646,12 @@ "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", "dev": true }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true + }, "acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", @@ -346,9 +661,21 @@ "add-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/add-stream/-/add-stream-1.0.0.tgz", - "integrity": "sha512-qQLMr+8o0WC4FZGQTcJiKBVC59JylcPSrTtk6usvmIDFUOCKegapy1VHQwRbFMOFyb/inzUVqHs+eMYKDM1YeQ==", + "integrity": "sha1-anmQQ3ynNtXhKI25K9MmbV9csqo=", "dev": true }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, "ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", @@ -394,13 +721,19 @@ "array-ify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", - "integrity": "sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==", + "integrity": "sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=", + "dev": true + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, "assertion-error": { @@ -449,12 +782,6 @@ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ==", - "dev": true - }, "cacheable-lookup": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", @@ -474,6 +801,12 @@ "responselike": "^2.0.0" } }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -526,7 +859,7 @@ "check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", "dev": true }, "chokidar": { @@ -545,6 +878,21 @@ "readdirp": "~3.6.0" } }, + "ci-info": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.7.1.tgz", + "integrity": "sha512-4jYS4MOAaCIStSRwiuxc4B8MYhIe676yO1sYGzARnjXkWpmzZMMYxY6zu8WYWDhSuth5zhrQ1rhNSibyyvv4/w==", + "dev": true + }, + "clean-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clean-regexp/-/clean-regexp-1.0.0.tgz", + "integrity": "sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, "cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -582,6 +930,12 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==" }, + "comment-parser": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.3.1.tgz", + "integrity": "sha512-B52sN2VNghyq5ofvUsqZjmk6YkihBX5vMSChmSK9v4ShjKf3Vk5Xcmgpw4o+iIgtrnM/u5FiMpz9VKb8lpBveA==", + "dev": true + }, "compare-func": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", @@ -595,7 +949,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "conventional-changelog": { "version": "3.1.25", @@ -795,6 +1149,17 @@ "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "dev": true }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, "dargs": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz", @@ -827,7 +1192,7 @@ "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, "decamelize-keys": { @@ -872,6 +1237,12 @@ "type-detect": "^4.0.0" } }, + "deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, "deepmerge": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", @@ -888,20 +1259,19 @@ "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true }, - "doctrine": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-0.7.2.tgz", - "integrity": "sha512-qiB/Rir6Un6Ad/TIgTRzsremsTGWzs8j7woXvp14jgq00676uBiBT5eUOi+FgRywZFVy5Us/c04ISRpZhRbS6w==", + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, "requires": { - "esutils": "^1.1.6", - "isarray": "0.0.1" + "path-type": "^4.0.0" }, "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true } } @@ -947,21 +1317,437 @@ "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "eslint": { + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.25.0.tgz", + "integrity": "sha512-DVlJOZ4Pn50zcKW5bYH7GQK/9MsoQG2d5eDH0ebEkE8PbgzTTmtt/VTH9GGJ4BfeZCpBLqFfvsjX35UacUL83A==", + "dev": true, + "requires": { + "@eslint/eslintrc": "^1.3.3", + "@humanwhocodes/config-array": "^0.10.5", + "@humanwhocodes/module-importer": "^1.0.1", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.4.0", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.1", + "globals": "^13.15.0", + "globby": "^11.1.0", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-sdsl": "^4.1.4", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0" + }, + "dependencies": { + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "eslint-scope": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + } + }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "requires": { + "is-glob": "^4.0.3" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + } + } + }, + "eslint-config-prettier": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz", + "integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==", "dev": true }, - "esutils": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-1.1.6.tgz", - "integrity": "sha512-RG1ZkUT7iFJG9LSHr7KDuuMSlujfeTtMNIcInURxKAxhMtwQhI3NrQhz26gZQYlsYZQKzsnwtpKrFKj9K9Qu1A==", + "eslint-plugin-jsdoc": { + "version": "39.3.6", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-39.3.6.tgz", + "integrity": "sha512-R6dZ4t83qPdMhIOGr7g2QII2pwCjYyKP+z0tPOfO1bbAbQyKC20Y2Rd6z1te86Lq3T7uM8bNo+VD9YFpE8HU/g==", + "dev": true, + "requires": { + "@es-joy/jsdoccomment": "~0.31.0", + "comment-parser": "1.3.1", + "debug": "^4.3.4", + "escape-string-regexp": "^4.0.0", + "esquery": "^1.4.0", + "semver": "^7.3.7", + "spdx-expression-parse": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "eslint-plugin-prettier": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", + "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", + "dev": true, + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, + "eslint-plugin-unicorn": { + "version": "44.0.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-44.0.2.tgz", + "integrity": "sha512-GLIDX1wmeEqpGaKcnMcqRvMVsoabeF0Ton0EX4Th5u6Kmf7RM9WBl705AXFEsns56ESkEs0uyelLuUTvz9Tr0w==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.19.1", + "ci-info": "^3.4.0", + "clean-regexp": "^1.0.0", + "eslint-utils": "^3.0.0", + "esquery": "^1.4.0", + "indent-string": "^4.0.0", + "is-builtin-module": "^3.2.0", + "lodash": "^4.17.21", + "pluralize": "^8.0.0", + "read-pkg-up": "^7.0.1", + "regexp-tree": "^0.1.24", + "safe-regex": "^2.1.1", + "semver": "^7.3.7", + "strip-indent": "^3.0.0" + }, + "dependencies": { + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "dependencies": { + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true + } + } + }, + "read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "requires": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + } + }, + "semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + } + } + }, + "eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", "dev": true }, + "espree": { + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", + "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", + "dev": true, + "requires": { + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" + } + }, + "esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, + "fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + } + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -987,6 +1773,16 @@ "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true }, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + } + }, "flatted": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", @@ -1006,7 +1802,7 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { "version": "2.3.2", @@ -1029,7 +1825,7 @@ "get-func-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", "dev": true }, "get-pkg-repo": { @@ -1110,7 +1906,7 @@ "git-remote-origin-url": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz", - "integrity": "sha512-eU+GGrZgccNJcsDH5LkXR3PB9M958hxc7sbA8DFJjrv9j4L2P/eZfKhM+QD6wyzpiv+b1BpK0XrYCxkovtjSLw==", + "integrity": "sha1-UoJlna4hBxRaERJhEq0yFuxfpl8=", "dev": true, "requires": { "gitconfiglocal": "^1.0.0", @@ -1130,7 +1926,7 @@ "gitconfiglocal": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz", - "integrity": "sha512-spLUXeTAVHxDtKsJc8FkFVgFtMdEN9qPGpL23VfSHx4fP4+Ds097IXLvymbnDH8FnmxX5Nr9bPw3A+AQ6mWEaQ==", + "integrity": "sha1-QdBF84UaXqiPA/JMocYXgRRGS5s=", "dev": true, "requires": { "ini": "^1.3.2" @@ -1158,6 +1954,37 @@ "is-glob": "^4.0.1" } }, + "globals": { + "version": "13.19.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", + "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + }, + "dependencies": { + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + } + } + }, + "globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + } + }, "got": { "version": "11.8.6", "resolved": "https://registry.npmjs.org/got/-/got-11.8.6.tgz", @@ -1181,6 +2008,12 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" }, + "grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, "growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", @@ -1252,6 +2085,28 @@ "resolve-alpn": "^1.0.0" } }, + "ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true + }, "indent-string": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", @@ -1261,7 +2116,7 @@ "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "requires": { "once": "^1.3.0", "wrappy": "1" @@ -1286,7 +2141,7 @@ "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, "is-binary-path": { @@ -1298,6 +2153,23 @@ "binary-extensions": "^2.0.0" } }, + "is-builtin-module": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.0.tgz", + "integrity": "sha512-phDA4oSGt7vl1n5tJvTWooWWAsXLY+2xCnxNqvKhGEzujg+A43wPlPOyDg3C8XQHN+6k/JTQWJ/j0dQh/qr+Hw==", + "dev": true, + "requires": { + "builtin-modules": "^3.3.0" + }, + "dependencies": { + "builtin-modules": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", + "dev": true + } + } + }, "is-core-module": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", @@ -1309,7 +2181,7 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, "is-fullwidth-code-point": { @@ -1342,13 +2214,13 @@ "is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", "dev": true }, "is-text-path": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz", - "integrity": "sha512-xFuJpne9oFz5qDaodwmmG08e3CawH/2ZV8Qqza1Ko7Sk8POWbkRdwIoAWVhqvq0XeUzANEhKo2n0IXUGBm7A/w==", + "integrity": "sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4=", "dev": true, "requires": { "text-extensions": "^1.0.0" @@ -1369,7 +2241,13 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "js-sdsl": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", + "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==", "dev": true }, "js-tokens": { @@ -1387,6 +2265,12 @@ "argparse": "^2.0.1" } }, + "jsdoc-type-pratt-parser": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-3.1.0.tgz", + "integrity": "sha512-MgtD0ZiCDk9B+eI73BextfRrVQl0oyzRG8B2BjORts6jbunj4ScKPcyXGTbB6eXL4y9TzxCm6hyeLq/2ASzNdw==", + "dev": true + }, "json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -1404,10 +2288,22 @@ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, "jsonfile": { @@ -1422,7 +2318,7 @@ "jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", "dev": true }, "keyv": { @@ -1439,6 +2335,16 @@ "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, "lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -1448,7 +2354,7 @@ "load-json-file": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", "dev": true, "requires": { "graceful-fs": "^4.1.2", @@ -1460,7 +2366,7 @@ "parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", "dev": true, "requires": { "error-ex": "^1.3.1", @@ -1470,7 +2376,7 @@ "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true } } @@ -1492,7 +2398,13 @@ "lodash.ismatch": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", - "integrity": "sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g==", + "integrity": "sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc=", + "dev": true + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, "log-symbols": { @@ -1634,6 +2546,22 @@ } } }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, "mimic-response": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", @@ -1669,15 +2597,6 @@ "kind-of": "^6.0.3" } }, - "mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, - "requires": { - "minimist": "^1.2.6" - } - }, "mocha": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", @@ -1827,6 +2746,12 @@ "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", "dev": true }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, "neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -1886,15 +2811,29 @@ "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { "wrappy": "1" } }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, "p-cancelable": { @@ -1926,6 +2865,15 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, "parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -1947,7 +2895,13 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true }, "path-parse": { "version": "1.0.7", @@ -1966,7 +2920,7 @@ "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true } } @@ -1986,13 +2940,25 @@ "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pluralize": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", + "dev": true + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, "prepend-file": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/prepend-file/-/prepend-file-1.3.1.tgz", - "integrity": "sha512-NFKEPDka08hvbVUZOu5JtFKJuWkZhWOJ/Odz6tsMlHWDtg6aUncrbu/BV3uTPRNa5T69SzbWIucg11e2kr4vBA==", + "integrity": "sha1-g7FuC0rBkB/OiNvZRaIvTMgd9Xk=", "dev": true, "requires": { "tmp": "0.0.31" @@ -2001,13 +2967,28 @@ "prepend-file-cli": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/prepend-file-cli/-/prepend-file-cli-1.0.6.tgz", - "integrity": "sha512-znOwErOOemRkN945G6enA0voH5t2g8ow8JMw2XUJDezbsA2TxATIDTaOeh5J1QM7caV6O2xtgQ7il98MmHCgSw==", + "integrity": "sha1-/34RbJMU24XCLEOioH8/k4epp08=", "dev": true, "requires": { "minimist": "^1.2.0", "prepend-file": "1.3.1" } }, + "prettier": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "dev": true + }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "requires": { + "fast-diff": "^1.1.2" + } + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -2034,10 +3015,22 @@ "once": "^1.3.1" } }, + "punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "dev": true + }, "q": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", + "dev": true + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true }, "quick-lru": { @@ -2057,7 +3050,7 @@ "read-pkg": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", "dev": true, "requires": { "load-json-file": "^4.0.0", @@ -2094,7 +3087,7 @@ "read-pkg-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha512-YFzFrVvpC6frF1sz8psoHDBGF7fLPc+llq/8NB43oagqWkx8ar5zYtsTORtOjw9W2RHLpWP+zTWwBvf1bCmcSw==", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", "dev": true, "requires": { "find-up": "^2.0.0", @@ -2104,7 +3097,7 @@ "find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { "locate-path": "^2.0.0" @@ -2113,7 +3106,7 @@ "locate-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, "requires": { "p-locate": "^2.0.0", @@ -2132,7 +3125,7 @@ "p-locate": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, "requires": { "p-limit": "^1.1.0" @@ -2141,13 +3134,13 @@ "p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", "dev": true }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true } } @@ -2175,7 +3168,7 @@ "rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "requires": { "resolve": "^1.1.6" } @@ -2190,10 +3183,22 @@ "strip-indent": "^3.0.0" } }, + "regexp-tree": { + "version": "0.1.24", + "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.24.tgz", + "integrity": "sha512-s2aEVuLhvnVJW6s/iPgEGK6R+/xngd2jNQ+xy4bXNDKxZKJH6jpPHY6kVeVv1IeLCHgswRj+Kl3ELaDjG6V1iw==", + "dev": true + }, + "regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true + }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, "resolve": { @@ -2211,6 +3216,12 @@ "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==" }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, "responselike": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", @@ -2219,6 +3230,12 @@ "lowercase-keys": "^2.0.0" } }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -2228,12 +3245,30 @@ "glob": "^7.1.3" } }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "dev": true }, + "safe-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-2.1.1.tgz", + "integrity": "sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==", + "dev": true, + "requires": { + "regexp-tree": "~0.1.1" + } + }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -2249,6 +3284,21 @@ "randombytes": "^2.1.0" } }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, "shelljs": { "version": "0.8.5", "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", @@ -2259,6 +3309,12 @@ "rechoir": "^0.6.2" } }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -2314,12 +3370,6 @@ "readable-stream": "^3.0.0" } }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true - }, "string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -2352,7 +3402,7 @@ "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true }, "strip-indent": { @@ -2405,10 +3455,16 @@ "integrity": "sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==", "dev": true }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, "through2": { @@ -2423,7 +3479,7 @@ "tmp": { "version": "0.0.31", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.31.tgz", - "integrity": "sha512-lfyEfOppKvWNeId5CArFLwgwef+iCnbEIy0JWYf1httIEXnx4ndL4Dr1adw7hPgeQfSlTbc/gqn6iaKcROpw5Q==", + "integrity": "sha1-jzirlDjhcxXl29izZX6L+yd65Kc=", "dev": true, "requires": { "os-tmpdir": "~1.0.1" @@ -2479,151 +3535,13 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, - "tslint": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz", - "integrity": "sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg==", + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "requires": { - "@babel/code-frame": "^7.0.0", - "builtin-modules": "^1.1.1", - "chalk": "^2.3.0", - "commander": "^2.12.1", - "diff": "^4.0.1", - "glob": "^7.1.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.3", - "resolve": "^1.3.2", - "semver": "^5.3.0", - "tslib": "^1.13.0", - "tsutils": "^2.29.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true - }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "tslint-eslint-rules": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/tslint-eslint-rules/-/tslint-eslint-rules-5.4.0.tgz", - "integrity": "sha512-WlSXE+J2vY/VPgIcqQuijMQiel+UtmXS+4nvK4ZzlDiqBfXse8FAvkNnTcYhnQyOTW5KFM+uRRGXxYhFpuBc6w==", - "dev": true, - "requires": { - "doctrine": "0.7.2", - "tslib": "1.9.0", - "tsutils": "^3.0.0" - }, - "dependencies": { - "tslib": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz", - "integrity": "sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ==", - "dev": true - }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - } - } - }, - "tsutils": { - "version": "2.29.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", - "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" + "prelude-ls": "^1.2.1" } }, "type-detect": { @@ -2679,10 +3597,19 @@ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, "uuid": { @@ -2716,10 +3643,16 @@ "isexe": "^2.0.0" } }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==" + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" }, "workerpool": { "version": "6.2.0", @@ -2741,7 +3674,7 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "xtend": { "version": "4.0.2", diff --git a/package.json b/package.json index bb0466e7..0374dfd3 100644 --- a/package.json +++ b/package.json @@ -8,9 +8,9 @@ "bin": { "openstapps-es-mapping-generator": "./lib/cli.js" }, - "author": "Wieland Schöbl ", + "author": "Thea Schöbl ", "scripts": { - "build": "npm run tslint && npm run compile", + "build": "npm run lint && npm run compile", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md && git commit -m 'docs: update changelog'", "check-configuration": "openstapps-configuration", "compile": "rimraf lib && tsc && prepend lib/cli.js '#!/usr/bin/env node\n'", @@ -20,7 +20,8 @@ "preversion": "npm run prepublishOnly", "push": "git push && git push origin \"v$npm_package_version\"", "test": "mocha --require ts-node/register test/*.spec.ts", - "tslint": "tslint -p tsconfig.json -c tslint.json 'src/**/*.ts'" + "lint": "eslint -c .eslintrc --ignore-path .eslintignore --ext .ts src/ test/", + "lint:fix": "eslint --fix -c .eslintrc --ignore-path .eslintignore --ext .ts src/ test/" }, "dependencies": { "@openstapps/logger": "1.1.1", @@ -33,6 +34,7 @@ }, "devDependencies": { "@testdeck/mocha": "0.3.3", + "@openstapps/eslint-config": "1.1.0", "@types/chai": "4.3.4", "@types/mocha": "9.1.1", "@types/node": "14.18.36", @@ -44,7 +46,13 @@ "prepend-file-cli": "1.0.6", "rimraf": "3.0.2", "ts-node": "10.9.1", - "tslint": "6.1.3", - "tslint-eslint-rules": "5.4.0" + "@typescript-eslint/eslint-plugin": "5.40.0", + "@typescript-eslint/parser": "5.40.0", + "eslint": "8.25.0", + "eslint-config-prettier": "8.5.0", + "eslint-plugin-jsdoc": "39.3.6", + "eslint-plugin-prettier": "4.2.1", + "eslint-plugin-unicorn": "44.0.2", + "prettier": "2.7.1" } } diff --git a/src/cli.ts b/src/cli.ts index cf9926d3..8f8a08d2 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,3 +1,4 @@ +/* eslint-disable unicorn/no-null */ /* * Copyright (C) 2018-2021 StApps * This program is free software: you can redistribute it and/or modify it @@ -16,7 +17,7 @@ import {Logger} from '@openstapps/logger'; import {Command} from 'commander'; import {readFileSync, writeFileSync} from 'fs'; import got from 'got'; -import {resolve} from 'path'; +import path from 'path'; import {exit} from 'process'; import {generateTemplate} from './mapping'; import {getProjectReflection} from './project-reflection'; @@ -33,11 +34,8 @@ process.on('unhandledRejection', async (reason: unknown) => { const commander = new Command('openstapps-core-tools'); -commander - .version(JSON.parse( - readFileSync(resolve(__dirname, '..', 'package.json')) - .toString(), - ).version); +// eslint-disable-next-line unicorn/prefer-module +commander.version(JSON.parse(readFileSync(path.resolve(__dirname, '..', 'package.json')).toString()).version); commander .command('mapping ') @@ -45,9 +43,9 @@ commander .option('-i, --ignoredTags ', 'Ignored Tags (comma-separated)') .option('-a, --aggPath ', 'Aggregations Path') .option('-e, --errorPath ', 'Error Path') - .action(async (relativeSrcPath, options) => { + .action(async (relativeSourcePath, options) => { // get absolute paths - const srcPath = resolve(relativeSrcPath); + const sourcePath = path.resolve(relativeSourcePath); let ignoredTagsList: string[] = []; if (typeof options.ignoredTags === 'string') { @@ -55,10 +53,10 @@ commander } // get project reflection - const projectReflection = getProjectReflection(srcPath); + const projectReflection = getProjectReflection(sourcePath); const result = generateTemplate(projectReflection, ignoredTagsList, true); - if (result.errors.length !== 0) { + if (result.errors.length > 0) { await Logger.error('Mapping generated with errors!'); } else { Logger.ok('Mapping generated without errors!'); @@ -66,22 +64,22 @@ commander // write documentation to file if (typeof options.aggPath !== 'undefined') { - const aggPath = resolve(options.aggPath); + const aggPath = path.resolve(options.aggPath); // tslint:disable-next-line:no-magic-numbers writeFileSync(aggPath, JSON.stringify(result.aggregations, null, 2)); Logger.ok(`Elasticsearch aggregations written to ${aggPath}.`); } if (typeof options.mappingPath !== 'undefined') { - const mappingPath = resolve(options.mappingPath); + const mappingPath = path.resolve(options.mappingPath); // tslint:disable-next-line:no-magic-numbers writeFileSync(mappingPath, JSON.stringify(result.mappings, null, 2)); Logger.ok(`Elasticsearch mappings written to ${mappingPath}.`); } if (typeof options.errorPath !== 'undefined') { - const errPath = resolve(options.errorPath); + const errorPath = path.resolve(options.errorPath); // tslint:disable-next-line:no-magic-numbers - writeFileSync(errPath, JSON.stringify(result.errors, null, 2)); - Logger.ok(`Mapping errors written to ${errPath}.`); + writeFileSync(errorPath, JSON.stringify(result.errors, null, 2)); + Logger.ok(`Mapping errors written to ${errorPath}.`); } else if (result.errors.length > 0) { for (const error of result.errors) { await Logger.error(error); @@ -93,12 +91,13 @@ commander commander .command('put-es-templates [ignoredTags]') - .action(async (relativeSrcPath, esAddress) => { + .action(async (relativeSourcePath, esAddress) => { // get absolute paths - const srcPath = resolve(relativeSrcPath); + const sourcePath = path.resolve(relativeSourcePath); // get project reflection - const templates = require(srcPath) as ElasticsearchTemplateCollection; + // eslint-disable-next-line @typescript-eslint/no-var-requires,unicorn/prefer-module + const templates = require(sourcePath) as ElasticsearchTemplateCollection; for (const template in templates) { if (!templates.hasOwnProperty(template)) { @@ -111,7 +110,9 @@ commander const HTTP_STATUS_OK = 200; if (response.statusCode !== HTTP_STATUS_OK) { - await Logger.error(`Template for "${template}" failed in Elasticsearch:\n${JSON.stringify(response.body)}`); + await Logger.error( + `Template for "${template}" failed in Elasticsearch:\n${JSON.stringify(response.body)}`, + ); exit(-1); } } diff --git a/src/config/fieldmap.ts b/src/config/fieldmap.ts index d38990c4..bfd35599 100644 --- a/src/config/fieldmap.ts +++ b/src/config/fieldmap.ts @@ -15,16 +15,18 @@ import {ElasticsearchFieldmap, ElasticsearchFilterableMap} from '../types/mapping'; import {ElasticsearchDataType} from './typemap'; -export enum analyzers { - ducet_sort = 'ducet_sort', - search_german = 'search_german', -} +const ducetSort = { + type: 'icu_collation_keyword', + language: 'de', + country: 'DE', + variant: '@collation=phonebook', +}; export const fieldmap: ElasticsearchFieldmap = { aggregatable: { default: { raw: { - ignore_above: 10000, + ignore_above: 10_000, type: ElasticsearchDataType.keyword, }, }, @@ -32,18 +34,10 @@ export const fieldmap: ElasticsearchFieldmap = { }, sortable: { default: { - sort: { - analyzer: analyzers.ducet_sort, - fielddata: true, - type: ElasticsearchDataType.text, - }, + sort: ducetSort, }, ducet: { - sort: { - analyzer: analyzers.ducet_sort, - fielddata: true, - type: ElasticsearchDataType.text, - }, + sort: ducetSort, }, ignore: ['price'], }, diff --git a/src/config/premap.ts b/src/config/premap.ts index d12c4000..33c34439 100644 --- a/src/config/premap.ts +++ b/src/config/premap.ts @@ -16,7 +16,7 @@ import {ElasticsearchPremap} from '../types/mapping'; import {ElasticsearchDataType} from './typemap'; export const premaps: ElasticsearchPremap = { - CoordinateReferenceSystem: { + 'CoordinateReferenceSystem': { dynamic: true, properties: { type: { @@ -24,12 +24,10 @@ export const premaps: ElasticsearchPremap = { }, }, }, - LineString: { - precision: '1m', - tree: 'quadtree', + 'LineString': { type: ElasticsearchDataType.geo_shape, }, - Point: { + 'Point': { properties: { type: { type: ElasticsearchDataType.keyword, @@ -40,12 +38,10 @@ export const premaps: ElasticsearchPremap = { }, dynamic: 'strict', }, - Polygon: { - precision: '1m', - tree: 'quadtree', + 'Polygon': { type: ElasticsearchDataType.geo_shape, }, - SCISO8601DateRange: { + 'SCISO8601DateRange': { type: ElasticsearchDataType.date_range, }, 'jsonpatch.OpPatch': { diff --git a/src/config/settings.ts b/src/config/settings.ts index 75eb9c92..51c09590 100644 --- a/src/config/settings.ts +++ b/src/config/settings.ts @@ -15,51 +15,8 @@ import {ElasticsearchSettings} from '../types/mapping'; export const settings: ElasticsearchSettings = { - analysis: { - analyzer: { - ducet_sort: { - filter: [ - 'german_phonebook', - ], - tokenizer: 'keyword', - type: 'custom', - }, - search_german: { - filter: [ - 'lowercase', - 'german_stop', - 'german_stemmer', - ], - tokenizer: 'stapps_ngram', - type: 'custom', - }, - }, - filter: { - german_phonebook: { - country: 'DE', - language: 'de', - type: 'icu_collation', - variant: '@collation=phonebook', - }, - german_stemmer: { - language: 'german', - type: 'stemmer', - }, - german_stop: { - stopwords: '_german_', - type: 'stop', - }, - }, - tokenizer: { - stapps_ngram: { - max_gram: 7, - min_gram: 4, - type: 'ngram', - }, - }, - }, - 'mapping.total_fields.limit': 10000, - max_result_window: 30000, - number_of_replicas: 0, - number_of_shards: 1, + 'mapping.total_fields.limit': 10_000, + 'max_result_window': 30_000, + 'number_of_replicas': 0, + 'number_of_shards': 1, }; diff --git a/src/config/typemap.ts b/src/config/typemap.ts index 2815131f..8616b0b7 100644 --- a/src/config/typemap.ts +++ b/src/config/typemap.ts @@ -70,9 +70,9 @@ export const typemap: ElasticsearchTypemap = { /** * If the string is a tag type */ -export function isTagType(str: string): boolean { +export function isTagType(string_: string): boolean { for (const key in typemap) { - if (typemap.hasOwnProperty(key) && typeof typemap[key][str] !== 'undefined') { + if (typemap.hasOwnProperty(key) && typeof typemap[key][string_] !== 'undefined') { return true; } } diff --git a/src/mapping.ts b/src/mapping.ts index f157b262..4ceab3ba 100644 --- a/src/mapping.ts +++ b/src/mapping.ts @@ -38,7 +38,8 @@ import { ElasticsearchObject, ElasticsearchTemplateCollection, ElasticsearchType, - ElasticsearchValue, MappingGenTemplate, + ElasticsearchValue, + MappingGenTemplate, } from './types/mapping'; let dynamicTemplates: ElasticsearchDynamicTemplate[] = []; @@ -56,7 +57,7 @@ const inheritTagsName = 'inherittags'; const maxErrorObjectChars = 1000; let ignoredTagsList = ['indexable', 'validatable', inheritTagsName]; -let inheritTagsMap: { [path: string]: CommentTag[]; } = {}; +let inheritTagsMap: {[path: string]: CommentTag[]} = {}; /** * Gets all interfaces that have an @indexable tag @@ -64,7 +65,6 @@ let inheritTagsMap: { [path: string]: CommentTag[]; } = {}; * @param projectReflection the project reflection from which to extract the indexable interfaces */ export function getAllIndexableInterfaces(projectReflection: ProjectReflection): DeclarationReflection[] { - let indexableInterfaces: DeclarationReflection[] = []; if (!Array.isArray(projectReflection.children) || projectReflection.children.length === 0) { @@ -72,14 +72,14 @@ export function getAllIndexableInterfaces(projectReflection: ProjectReflection): } // push all declaration reflections into one array - projectReflection.children.forEach((declarationReflection) => { + for (const declarationReflection of projectReflection.children) { if (Array.isArray(declarationReflection.children)) { - indexableInterfaces = indexableInterfaces.concat(declarationReflection.children); + indexableInterfaces = [...indexableInterfaces, ...declarationReflection.children]; } - }); + } // filter all declaration reflections with an @indexable tag - indexableInterfaces = indexableInterfaces.filter((declarationReflection) => { + indexableInterfaces = indexableInterfaces.filter(declarationReflection => { if ( typeof declarationReflection.comment === 'undefined' || typeof declarationReflection.comment.tags === 'undefined' @@ -87,9 +87,11 @@ export function getAllIndexableInterfaces(projectReflection: ProjectReflection): return false; } - return typeof declarationReflection.comment.tags.find((commentTag) => { - return commentTag.tagName === indexableTag; - }) !== 'undefined'; + return ( + typeof declarationReflection.comment.tags.find(commentTag => { + return commentTag.tagName === indexableTag; + }) !== 'undefined' + ); }); return indexableInterfaces; @@ -104,8 +106,17 @@ export function getAllIndexableInterfaces(projectReflection: ProjectReflection): * @param object the object or name * @param message the error message */ -function composeErrorMessage(path: string, topTypeName: string, typeName: string, object: string, message: string) { - const error = `At "${topTypeName}::${path.substr(0, path.length - 1)}" for ${typeName} "${trimString(object, maxErrorObjectChars)}": ${message}`; +function composeErrorMessage( + path: string, + topTypeName: string, + typeName: string, + object: string, + message: string, +) { + const error = `At "${topTypeName}::${path.slice( + 0, + Math.max(0, path.length - 1), + )}" for ${typeName} "${trimString(object, maxErrorObjectChars)}": ${message}`; errors.push(error); if (showErrors) { // tslint:disable-next-line:no-floating-promises @@ -120,9 +131,7 @@ function composeErrorMessage(path: string, topTypeName: string, typeName: string * @param maxLength the maximum allowed length before it is clamped */ function trimString(value: string, maxLength: number): string { - return value.length > maxLength ? - `${value.substring(0, maxLength)}...` : - value; + return value.length > maxLength ? `${value.slice(0, Math.max(0, maxLength))}...` : value; } /** @@ -137,18 +146,24 @@ function trimString(value: string, maxLength: number): string { * @param path the current path to the object we are in * @param tags any tags attached to the type */ -function getReflectionGeneric(type: ReferenceType, - out: Map, - topTypeName: string, - path: string, - tags: CommentTag[]): Map { - if (typeof type.typeArguments !== 'undefined' - && type.reflection instanceof DeclarationReflection - && typeof type.reflection.typeParameters !== 'undefined') { +function getReflectionGeneric( + type: ReferenceType, + out: Map, + topTypeName: string, + path: string, + tags: CommentTag[], +): Map { + if ( + typeof type.typeArguments !== 'undefined' && + type.reflection instanceof DeclarationReflection && + typeof type.reflection.typeParameters !== 'undefined' + ) { for (let i = 0; i < type.reflection.typeParameters.length; i++) { if (i < type.typeArguments.length) { - out - .set(type.reflection.typeParameters[i].name, handleType(type.typeArguments[i], out, topTypeName, path, tags)); + out.set( + type.reflection.typeParameters[i].name, + handleType(type.typeArguments[i], out, topTypeName, path, tags), + ); } else { // this can happen due to a bug in TypeDoc https://github.com/TypeStrong/typedoc/issues/1061 // we have no way to know the type here, so we have to use this. @@ -157,8 +172,10 @@ function getReflectionGeneric(type: ReferenceType, properties: {}, }); - Logger.warn(`Type "${type.name}": Defaults of generics (Foo) currently don't work due to a bug` + - ` in TypeDoc. It has been replaced by a dynamic type.`); + Logger.warn( + `Type "${type.name}": Defaults of generics (Foo) currently don't work due to a bug` + + ` in TypeDoc. It has been replaced by a dynamic type.`, + ); } } } @@ -177,15 +194,21 @@ function getReflectionGeneric(type: ReferenceType, * @param topTypeName the name of the SCThingType * @param tags any tags attached to the type */ -function handleExternalType(ref: ReferenceType, generics: Map, - path: string, topTypeName: string, tags: CommentTag[]): ElasticsearchValue { +function handleExternalType( + ref: ReferenceType, + generics: Map, + path: string, + topTypeName: string, + tags: CommentTag[], +): ElasticsearchValue { for (const premap of Object.keys(premaps)) { if (premap === ref.name) { return readFieldTags(premaps[premap], path, topTypeName, tags); } } - if (ref.name === 'Array') { // basically an external type, but Array is quite common, especially with generics + if (ref.name === 'Array') { + // basically an external type, but Array is quite common, especially with generics if (typeof ref.typeArguments === 'undefined' || typeof ref.typeArguments[0] === 'undefined') { composeErrorMessage(path, topTypeName, 'Array with generics', 'array', 'Failed to parse'); @@ -194,12 +217,19 @@ function handleExternalType(ref: ReferenceType, generics: Map, - path: string, - topTypeName: string, - inheritedTags?: CommentTag[]): - ElasticsearchValue { +function handleDeclarationReflection( + decl: DeclarationReflection, + generics: Map, + path: string, + topTypeName: string, + inheritedTags?: CommentTag[], +): ElasticsearchValue { // check if we have an object referencing a generic - if (generics.has(decl.name)) { // if the object name is the same as the generic name - return readFieldTags(generics.get(decl.name) as ElasticsearchObject | ElasticsearchType, path, topTypeName, - decl.comment?.tags ?? []); + if (generics.has(decl.name)) { + // if the object name is the same as the generic name + return readFieldTags( + generics.get(decl.name) as ElasticsearchObject | ElasticsearchType, + path, + topTypeName, + decl.comment?.tags ?? [], + ); // use the value defined by the generic - } // start the actual handling process @@ -251,7 +286,9 @@ function handleDeclarationReflection(decl: DeclarationReflection, template[decl.name] = { mapping: handleType( decl.indexSignature.type, - new Map(generics), path, topTypeName, + new Map(generics), + path, + topTypeName, getCommentTags(decl.indexSignature, path, topTypeName), ), match: '*', @@ -270,21 +307,31 @@ function handleDeclarationReflection(decl: DeclarationReflection, if (typeof decl.children !== 'undefined' && decl.children.length > 0) { for (const child of decl.children) { empty = false; - out.properties[child.name] = - handleDeclarationReflection(child, new Map(generics), `${path}${child.name}.`, topTypeName); + out.properties[child.name] = handleDeclarationReflection( + child, + new Map(generics), + `${path}${child.name}.`, + topTypeName, + ); } - } else if (decl.type instanceof Type) { // if the object is a type, so we are dealing with a PROPERTY + } else if (decl.type instanceof Type) { + // if the object is a type, so we are dealing with a PROPERTY // get inherited tags - const tags = (inheritedTags ?? []).length > 0 - ? (typeof inheritedTags!.find(it => isTagType(it.tagName)) !== 'undefined' - ? inheritedTags! - : [...inheritedTags ?? [], ...getCommentTags(decl, path, topTypeName)]) - : getCommentTags(decl, path, topTypeName); + const tags = + (inheritedTags ?? []).length > 0 + ? typeof inheritedTags!.find(it => isTagType(it.tagName)) !== 'undefined' + ? inheritedTags! + : [...(inheritedTags ?? []), ...getCommentTags(decl, path, topTypeName)] + : getCommentTags(decl, path, topTypeName); return handleType(decl.type, new Map(generics), path, topTypeName, tags); } else if (decl.kindString === 'Enumeration member') { - return readTypeTags(typeof decl.defaultValue, path, topTypeName, - getCommentTags(decl, path, topTypeName, inheritedTags)); + return readTypeTags( + typeof decl.defaultValue, + path, + topTypeName, + getCommentTags(decl, path, topTypeName, inheritedTags), + ); } if (empty) { @@ -315,19 +362,33 @@ function getCommentTags( return []; } - let out: CommentTag[] = decl.comment instanceof Comment ? - typeof decl.comment.tags !== 'undefined' ? decl.comment.tags : inheritedTags : inheritedTags; - if (decl.overwrites instanceof ReferenceType && decl.overwrites.reflection instanceof DeclarationReflection) { + let out: CommentTag[] = + decl.comment instanceof Comment + ? typeof decl.comment.tags !== 'undefined' + ? decl.comment.tags + : inheritedTags + : inheritedTags; + if ( + decl.overwrites instanceof ReferenceType && + decl.overwrites.reflection instanceof DeclarationReflection + ) { out = arrayPriorityJoin( - getCommentTags(decl.overwrites.reflection, path, topTypeName, inheritedTags, decl.id), out); + getCommentTags(decl.overwrites.reflection, path, topTypeName, inheritedTags, decl.id), + out, + ); } - if (decl.inheritedFrom instanceof ReferenceType && decl.inheritedFrom.reflection instanceof DeclarationReflection) { + if ( + decl.inheritedFrom instanceof ReferenceType && + decl.inheritedFrom.reflection instanceof DeclarationReflection + ) { out = arrayPriorityJoin( - getCommentTags(decl.inheritedFrom.reflection, path, topTypeName, inheritedTags, decl.id), out); + getCommentTags(decl.inheritedFrom.reflection, path, topTypeName, inheritedTags, decl.id), + out, + ); } saveCommentTags(out, path, topTypeName); - const inheritTag = out.find(((value) => value.tagName === inheritTagsName)); + const inheritTag = out.find(value => value.tagName === inheritTagsName); if (typeof inheritTag !== 'undefined') { out = arrayPriorityJoin(out, retrieveCommentTags(inheritTag.text.trim(), path, topTypeName)); } @@ -343,8 +404,9 @@ function getCommentTags( * @param topTypeName the name of the SCThingType */ function saveCommentTags(tags: CommentTag[], path: string, topTypeName: string) { - inheritTagsMap[`${topTypeName}::${path.substr(0, path.length - 1)}`] = - tags.filter(((value) => value.tagName !== 'see' && value.tagName !== inheritTagsName)); + inheritTagsMap[`${topTypeName}::${path.slice(0, Math.max(0, path.length - 1))}`] = tags.filter( + value => value.tagName !== 'see' && value.tagName !== inheritTagsName, + ); } /** @@ -373,14 +435,14 @@ function retrieveCommentTags(path: string, currentPath: string, topTypeName: str function arrayPriorityJoin(originals: CommentTag[], overrider: CommentTag[]): CommentTag[] { const out: CommentTag[] = overrider; - originals.forEach((original) => { - const result = overrider.find((element) => original.tagName === element.tagName); + for (const original of originals) { + const result = overrider.find(element => original.tagName === element.tagName); // no support for multiple tags with the same name if (!(result instanceof CommentTag)) { out.push(original); } - }); + } return out; } @@ -397,11 +459,13 @@ function arrayPriorityJoin(originals: CommentTag[], overrider: CommentTag[]): Co * @param topTypeName the name of the SCThingType * @param tags any tags attached to the type */ -function handleUnionType(type: UnionType, - generics: Map, - path: string, - topTypeName: string, - tags: CommentTag[]): ElasticsearchValue { +function handleUnionType( + type: UnionType, + generics: Map, + path: string, + topTypeName: string, + tags: CommentTag[], +): ElasticsearchValue { const list: ElasticsearchValue[] = []; for (const subType of type.types) { @@ -421,8 +485,13 @@ function handleUnionType(type: UnionType, return out; } - composeErrorMessage(path, topTypeName, 'Union Type', stringify(list), - 'Empty union type. This is likely not a user error.'); + composeErrorMessage( + path, + topTypeName, + 'Union Type', + stringify(list), + 'Empty union type. This is likely not a user error.', + ); return {type: ElasticsearchDataType.parse_error}; } @@ -436,37 +505,50 @@ function handleUnionType(type: UnionType, * @param topTypeName the name of the SCThingType * @param tags any tags attached to the type */ -function handleType(type: Type, generics: Map, path: string, topTypeName: string, - tags: CommentTag[]): - ElasticsearchValue { +function handleType( + type: Type, + generics: Map, + path: string, + topTypeName: string, + tags: CommentTag[], +): ElasticsearchValue { // logger.log((type as any).name); - if (type instanceof ArrayType) { // array is irrelevant in Elasticsearch, so just go with the element type + if (type instanceof ArrayType) { + // array is irrelevant in Elasticsearch, so just go with the element type const esType = handleType(type.elementType, new Map(generics), path, topTypeName, tags); // also merge tags of the array to the element type // filter out the type tags lazily, this can lead to double messages for "Not implemented tag" let newTags = tags; if ('type' in esType) { - newTags = tags.filter((tag) => { + newTags = tags.filter(tag => { return !(tag.tagName === esType.type); }); } return readFieldTags(esType, path, topTypeName, newTags); } - if (type.type === 'stringLiteral') { // a string literal, usually for type + if (type.type === 'stringLiteral') { + // a string literal, usually for type return readTypeTags(type.type, path, topTypeName, tags); } - if (type instanceof IntrinsicType) { // the absolute default type, like strings + if (type instanceof IntrinsicType) { + // the absolute default type, like strings return readTypeTags(type.name, path, topTypeName, tags); } - if (type instanceof UnionType) { // the union type... + if (type instanceof UnionType) { + // the union type... return handleUnionType(type, new Map(generics), path, topTypeName, tags); } if (type instanceof ReferenceType) { if (typeof premaps[type.name] === 'undefined' && typeof type.reflection !== 'undefined') { // there is really no way to make this typesafe, every element in DeclarationReflection is optional. - return handleDeclarationReflection(type.reflection as DeclarationReflection, - getReflectionGeneric(type, new Map(generics), path, topTypeName, tags), path, topTypeName, tags); + return handleDeclarationReflection( + type.reflection as DeclarationReflection, + getReflectionGeneric(type, new Map(generics), path, topTypeName, tags), + path, + topTypeName, + tags, + ); } return handleExternalType(type, new Map(generics), path, topTypeName, tags); @@ -479,11 +561,14 @@ function handleType(type: Type, generics: Map, path: composeErrorMessage(path, topTypeName, 'Generic', type.name, 'Missing reflection, please report!'); return {type: ElasticsearchDataType.parse_error}; - } if (type instanceof ReflectionType) { - return readFieldTags(handleDeclarationReflection(type.declaration, new Map(generics), path, topTypeName), - path, topTypeName, tags); + return readFieldTags( + handleDeclarationReflection(type.declaration, new Map(generics), path, topTypeName), + path, + topTypeName, + tags, + ); } composeErrorMessage(path, topTypeName, 'type', stringify(type), 'Not implemented type'); @@ -502,43 +587,42 @@ function addAggregatable(path: string, topTypeName: string, global: boolean) { // push type.path and remove the '.' at the end of the path if (global) { - const prop = path.slice(0, -1) - .split('.') - .pop() as string; // cannot be undefined + const property_ = path.slice(0, -1).split('.').pop() as string; // cannot be undefined - return (aggregations['@all'] as ESNestedAggregation).aggs[prop.split('.') - .pop() as string] = { + return ((aggregations['@all'] as ESNestedAggregation).aggs[property_.split('.').pop() as string] = { terms: { - field: `${prop}.raw`, + field: `${property_}.raw`, size: 1000, }, - }; + }); } const property = path.slice(0, -1); - return (aggregations[topTypeName] as ESNestedAggregation).aggs[property] = { + return ((aggregations[topTypeName] as ESNestedAggregation).aggs[property] = { terms: { field: `${property}.raw`, size: 1000, }, - }; + }); } /** * Reads all tags related to Elasticsearch fields from the fieldMap * - * @param prev the previous ElasticsearchValue, for example and object + * @param previous the previous ElasticsearchValue, for example and object * @param path the current path to the object we are in * @param topTypeName the name of the SCThingType * @param tags tags attached to the value * @param dataType the ElasticsearchDataType, for checking if a tag is a type tag */ -function readFieldTags(prev: ElasticsearchValue, - path: string, - topTypeName: string, - tags: CommentTag[], - dataType?: string): ElasticsearchValue { +function readFieldTags( + previous: ElasticsearchValue, + path: string, + topTypeName: string, + tags: CommentTag[], + dataType?: string, +): ElasticsearchValue { for (const tag of tags) { if (tag.tagName === aggregatableTag) { addAggregatable(path, topTypeName, tag.text.trim() === aggregatableTagParameterGlobal); @@ -546,31 +630,43 @@ function readFieldTags(prev: ElasticsearchValue, if (!ignoredTagsList.includes(tag.tagName)) { if (typeof fieldmap[tag.tagName] !== 'undefined') { - if (typeof prev.fields === 'undefined') { + if (typeof previous.fields === 'undefined') { // create in case it doesn't exist - prev.fields = {}; + previous.fields = {}; } if (tag.text.trim() === '') { // merge fields - prev.fields = {...prev.fields, ...fieldmap[tag.tagName].default}; + previous.fields = {...previous.fields, ...fieldmap[tag.tagName].default}; } else if (typeof fieldmap[tag.tagName][tag.text.trim()] !== 'undefined') { // merge fields - prev.fields = {...prev.fields, ...fieldmap[tag.tagName][tag.text.trim()]}; + previous.fields = {...previous.fields, ...fieldmap[tag.tagName][tag.text.trim()]}; } else if (!fieldmap[tag.tagName].ignore.includes(tag.text.trim())) { // when there is an unidentified tag - composeErrorMessage(path, topTypeName, 'tag', tag.tagName, `Not implemented tag param "${tag.text.trim()}"`); + composeErrorMessage( + path, + topTypeName, + 'tag', + tag.tagName, + `Not implemented tag param "${tag.text.trim()}"`, + ); } } else if (tag.tagName === filterableTagName) { - if (typeof prev.fields === 'undefined') { - prev.fields = {}; + if (typeof previous.fields === 'undefined') { + previous.fields = {}; } - if ('type' in prev) { - const type = filterableMap[prev.type]; + if ('type' in previous) { + const type = filterableMap[previous.type]; if (typeof type !== 'undefined') { // merge fields - prev.fields = {...prev.fields, ...{raw: {type: type}}}; + previous.fields = {...previous.fields, raw: {type: type}}; } else { - composeErrorMessage(path, topTypeName, 'tag', tag.tagName, `Not implemented for ${prev.type}`); + composeErrorMessage( + path, + topTypeName, + 'tag', + tag.tagName, + `Not implemented for ${previous.type}`, + ); } } else { composeErrorMessage(path, topTypeName, 'tag', tag.tagName, 'Not applicable for object types'); @@ -581,7 +677,7 @@ function readFieldTags(prev: ElasticsearchValue, } } - return prev; + return previous; } /** @@ -592,16 +688,30 @@ function readFieldTags(prev: ElasticsearchValue, * @param topTypeName the name of the SCThingType * @param tags tags attached to the value */ -function readTypeTags(type: string, path: string, topTypeName: string, tags: CommentTag[]): ElasticsearchValue { +function readTypeTags( + type: string, + path: string, + topTypeName: string, + tags: CommentTag[], +): ElasticsearchValue { let out: ElasticsearchValue = {type: ElasticsearchDataType.parse_error}; - if (typeof typemap[type] !== 'undefined') { // first look if the value has a definition in the typemap + if (typeof typemap[type] !== 'undefined') { + // first look if the value has a definition in the typemap for (let i = tags.length - 1; i >= 0; i--) { - if (!ignoredTagsList.includes(tags[i].tagName) && typeof typemap[type][tags[i].tagName] !== 'undefined') { + if ( + !ignoredTagsList.includes(tags[i].tagName) && + typeof typemap[type][tags[i].tagName] !== 'undefined' + ) { // if we have a tag that indicates a type if (out.type !== ElasticsearchDataType.parse_error) { - composeErrorMessage(path, topTypeName, 'type', type, - `Type conflict; "${typemap[type][tags[i].tagName]}" would override "${out.type}"`); + composeErrorMessage( + path, + topTypeName, + 'type', + type, + `Type conflict; "${typemap[type][tags[i].tagName]}" would override "${out.type}"`, + ); out.type = ElasticsearchDataType.type_conflict; continue; } @@ -617,7 +727,8 @@ function readTypeTags(type: string, path: string, topTypeName: string, tags: Com return out; } - if (dynamicTypes.includes(type)) { // Elasticsearch dynamic type TODO: doesn't work for direct types + if (dynamicTypes.includes(type)) { + // Elasticsearch dynamic type TODO: doesn't work for direct types return { dynamic: true, properties: {}, @@ -666,15 +777,18 @@ function reset(resetInheritTags = true) { * @param showErrorOutput whether to print all errors in the command line or not * @param interfaceFilter only parse specific interfaces, this is for testing purposes */ -export function generateTemplate(projectReflection: ProjectReflection, - ignoredTags: string[], - showErrorOutput = true, - interfaceFilter: string[] = []): MappingGenTemplate { +export function generateTemplate( + projectReflection: ProjectReflection, + ignoredTags: string[], + showErrorOutput = true, + interfaceFilter: string[] = [], +): MappingGenTemplate { reset(); showErrors = showErrorOutput; ignoredTagsList = ['indexable', 'validatable', inheritTagsName]; + // eslint-disable-next-line prefer-spread ignoredTagsList.push.apply(ignoredTagsList, ignoredTags); const indexableInterfaces = getAllIndexableInterfaces(projectReflection); @@ -687,37 +801,42 @@ export function generateTemplate(projectReflection: ProjectReflection, throw new Error('Interface needs at least some properties to be indexable'); } - const typeObject = _interface.children.find((declarationReflection) => { + const typeObject = _interface.children.find(declarationReflection => { return declarationReflection.name === 'type'; }); if (typeof typeObject === 'undefined' || typeof typeObject.type === 'undefined') { - throw new Error('Interface needs a type to be indexable'); + throw new TypeError('Interface needs a type to be indexable'); } let typeName = 'INVALID_TYPE'; if (typeObject.type instanceof ReferenceType) { - if (typeObject.type.reflection instanceof DeclarationReflection - && typeof typeObject.type.reflection.defaultValue === 'string') { - typeName = typeObject.type.reflection.defaultValue.replace('"', '') - .replace('"', ''); + if ( + typeObject.type.reflection instanceof DeclarationReflection && + typeof typeObject.type.reflection.defaultValue === 'string' + ) { + typeName = typeObject.type.reflection.defaultValue.replace('"', '').replace('"', ''); } else { // tslint:disable-next-line:no-floating-promises - void Logger.error('Your input files seem to be incorrect, or there is a major bug in the mapping generator.'); + void Logger.error( + 'Your input files seem to be incorrect, or there is a major bug in the mapping generator.', + ); } } else if (typeObject.type instanceof StringLiteralType) { Logger.warn(`The interface ${_interface.name} uses a string literal as type, please use SCThingType.`); typeName = typeObject.type.value; } else { // tslint:disable-next-line:no-floating-promises - void Logger.error(`The interface ${_interface.name} is required to use an SCThingType as a type, please do so.`); + void Logger.error( + `The interface ${_interface.name} is required to use an SCThingType as a type, please do so.`, + ); } // init aggregation schema for type aggregations[typeName] = { aggs: {}, filter: { - type: { - value: typeName, + term: { + type: typeName, }, }, }; @@ -732,45 +851,48 @@ export function generateTemplate(projectReflection: ProjectReflection, throw new Error('Interface needs at least some properties to be indexable'); } - const typeObject = _interface.children.find((declarationReflection) => { + const typeObject = _interface.children.find(declarationReflection => { return declarationReflection.name === 'type'; }); if (typeof typeObject === 'undefined' || typeof typeObject.type === 'undefined') { - throw new Error('Interface needs a type to be indexable'); + throw new TypeError('Interface needs a type to be indexable'); } let typeName = 'INVALID_TYPE'; if (typeObject.type instanceof ReferenceType) { - if (typeObject.type.reflection instanceof DeclarationReflection - && typeof typeObject.type.reflection.defaultValue === 'string') { - typeName = typeObject.type.reflection.defaultValue.replace('"', '') - .replace('"', ''); + if ( + typeObject.type.reflection instanceof DeclarationReflection && + typeof typeObject.type.reflection.defaultValue === 'string' + ) { + typeName = typeObject.type.reflection.defaultValue.replace('"', '').replace('"', ''); } else { // tslint:disable-next-line:no-floating-promises - void Logger.error('Your input files seem to be incorrect, or there is a major bug in the mapping generator.'); + void Logger.error( + 'Your input files seem to be incorrect, or there is a major bug in the mapping generator.', + ); } } else if (typeObject.type instanceof StringLiteralType) { Logger.warn(`The interface ${_interface.name} uses a string literal as type, please use SCThingType.`); typeName = typeObject.type.value; } else { // tslint:disable-next-line:no-floating-promises - void Logger.error(`The interface ${_interface.name} is required to use an SCThingType as a type, please do so.`); + void Logger.error( + `The interface ${_interface.name} is required to use an SCThingType as a type, please do so.`, + ); } // filter out - if (interfaceFilter.length !== 0) { - if (typeof interfaceFilter.find((it) => it === typeName) === 'undefined') { - continue; - } + if (interfaceFilter.length > 0 && typeof interfaceFilter.find(it => it === typeName) === 'undefined') { + continue; } // init aggregation schema for type aggregations[typeName] = { aggs: {}, filter: { - type: { - value: typeName, + term: { + type: typeName, }, }, }; @@ -782,26 +904,21 @@ export function generateTemplate(projectReflection: ProjectReflection, const templateName = `template_${typeNameWithoutSpaces}`; out[templateName] = { - mappings: { - [typeName]: handleDeclarationReflection(_interface, new Map(), '', typeName) as ElasticsearchObject, - }, + mappings: handleDeclarationReflection(_interface, new Map(), '', typeName) as ElasticsearchObject, settings: settings, - template: `stapps_${typeNameWithoutSpaces}*`, - } - ; - out[templateName].mappings[typeName].properties.creation_date = { + index_patterns: [`stapps_${typeNameWithoutSpaces}*`], + }; + out[templateName].mappings.properties.creation_date = { type: ElasticsearchDataType.date, }; - out[templateName].mappings[typeName].dynamic_templates = dynamicTemplates; + out[templateName].mappings.dynamic_templates = dynamicTemplates; // Set some properties - out[templateName].mappings[typeName]._source = { - excludes: [ - 'creation_date', - ], + out[templateName].mappings._source = { + excludes: ['creation_date'], }; - out[templateName].mappings[typeName].date_detection = false; + out[templateName].mappings.date_detection = false; dynamicTemplates = []; diff --git a/src/project-reflection.ts b/src/project-reflection.ts index 8b8c39d3..be8a713b 100644 --- a/src/project-reflection.ts +++ b/src/project-reflection.ts @@ -15,20 +15,20 @@ import {Logger} from '@openstapps/logger'; import {existsSync, PathLike} from 'fs'; import {platform} from 'os'; -import {join, sep} from 'path'; +import path from 'path'; import {Application, ProjectReflection} from 'typedoc'; import {ModuleKind, ScriptTarget} from 'typescript'; /** * Get a project reflection from a path * - * @param srcPath Path to get reflection from + * @param sourcePath Path to get reflection from * @param excludeExternals Exclude external dependencies */ -export function getProjectReflection(srcPath: PathLike, excludeExternals = true): ProjectReflection { - Logger.info(`Generating project reflection for ${srcPath.toString()}.`); +export function getProjectReflection(sourcePath: PathLike, excludeExternals = true): ProjectReflection { + Logger.info(`Generating project reflection for ${sourcePath.toString()}.`); - const tsconfigPath = getTsconfigPath(srcPath.toString()); + const tsconfigPath = getTsconfigPath(sourcePath.toString()); // initialize new Typedoc application const app = new Application(); @@ -39,12 +39,12 @@ export function getProjectReflection(srcPath: PathLike, excludeExternals = true) includeDeclarations: true, module: ModuleKind.CommonJS, target: ScriptTarget.Latest, - tsconfig: join(tsconfigPath, 'tsconfig.json'), + tsconfig: path.join(tsconfigPath, 'tsconfig.json'), }); - let inputFilePath = srcPath; + let inputFilePath = sourcePath; if (inputFilePath === tsconfigPath) { - inputFilePath = join(tsconfigPath, 'src'); + inputFilePath = path.join(tsconfigPath, 'src'); } // get input files @@ -54,7 +54,7 @@ export function getProjectReflection(srcPath: PathLike, excludeExternals = true) const result = app.convert(inputFiles); if (typeof result === 'undefined') { - throw new Error('Project reflection could not be generated.'); + throw new TypeError('Project reflection could not be generated.'); } return result; @@ -69,12 +69,10 @@ export function getTsconfigPath(startPath: string): string { let tsconfigPath = startPath; // see https://stackoverflow.com/questions/9652043/identifying-the-file-system-root-with-node-js - const root = (platform() === 'win32') ? process - .cwd() - .split(sep)[0] : '/'; + const root = platform() === 'win32' ? process.cwd().split(path.sep)[0] : '/'; // repeat until a tsconfig.json is found - while (!existsSync(join(tsconfigPath, 'tsconfig.json'))) { + while (!existsSync(path.join(tsconfigPath, 'tsconfig.json'))) { if (tsconfigPath === root) { throw new Error( `Reached file system root ${root} while searching for 'tsconfig.json' in ${startPath}!`, @@ -82,9 +80,9 @@ export function getTsconfigPath(startPath: string): string { } // pop last directory - const tsconfigPathParts = tsconfigPath.split(sep); + const tsconfigPathParts = tsconfigPath.split(path.sep); tsconfigPathParts.pop(); - tsconfigPath = tsconfigPathParts.join(sep); + tsconfigPath = tsconfigPathParts.join(path.sep); } Logger.info(`Using 'tsconfig.json' from ${tsconfigPath}.`); diff --git a/src/types/aggregation.d.ts b/src/types/aggregation.d.ts index e315e9ff..7972008a 100644 --- a/src/types/aggregation.d.ts +++ b/src/types/aggregation.d.ts @@ -15,6 +15,7 @@ /** * An elasticsearch bucket aggregation + * * @see https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-aggregations-bucket.html */ export interface AggregationSchema { @@ -48,11 +49,11 @@ export interface ESAggTypeFilter { /** * The type of the object to find */ - type: { + term: { /** * The name of the type */ - value: string; + type: string; }; } @@ -63,7 +64,7 @@ export interface ESAggMatchAllFilter { /** * Filter that matches everything */ - match_all: {}; + match_all: object; } /** diff --git a/src/types/mapping.d.ts b/src/types/mapping.d.ts index a7e17fb3..13b630cd 100644 --- a/src/types/mapping.d.ts +++ b/src/types/mapping.d.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ /* * Copyright (C) 2019-2021 StApps * This program is free software: you can redistribute it and/or modify it @@ -219,7 +220,6 @@ export interface ElasticsearchGeoShape { * https://www.elastic.co/guide/en/elasticsearch/reference/5.6/object.html */ export interface ElasticsearchObject { - /** * Only for the top type */ @@ -227,9 +227,7 @@ export interface ElasticsearchObject { /** * Fields that should be excluded in the _source field */ - excludes: [ - 'creation_date' - ]; + excludes: ['creation_date']; }; /** @@ -291,22 +289,20 @@ export interface ElasticsearchTemplateCollection { * This is what you pass to Elasticsearch */ export interface ElasticsearchTemplate { + /** + * The name of the template, for referencing in Elasticsearch + */ + index_patterns: [string]; + /** * This is a pre-defined structure you should use for your mapping */ - mappings: { - [typeName: string]: ElasticsearchObject; - }; + mappings: ElasticsearchObject; /** * The settings for Elasticsearch */ settings: ElasticsearchSettings; - - /** - * The name of the template, for referencing in Elasticsearch - */ - template: string; } /** @@ -323,7 +319,7 @@ export interface ElasticsearchSettings { * * https://www.elastic.co/guide/en/elasticsearch/reference/5.6/analysis-analyzers.html */ - analysis: { + analysis?: { [name: string]: any; }; } diff --git a/test/aggregations.spec.ts b/test/aggregations.spec.ts index 16e6e206..8e3fbd89 100644 --- a/test/aggregations.spec.ts +++ b/test/aggregations.spec.ts @@ -1,3 +1,4 @@ +/* eslint-disable unicorn/consistent-function-scoping */ /* * Copyright (C) 2020 StApps * This program is free software: you can redistribute it and/or modify it @@ -15,8 +16,8 @@ import {Logger} from '@openstapps/logger'; import {readdirSync, statSync} from 'fs'; import path from 'path'; -import {MapAggTest} from './mapping-model/MapAggTest'; -import {MapAggTestOptions} from './mapping-model/MapAggTestOptions'; +import {MapAggTest} from './mapping-model/map-agg-test'; +import {MapAggTestOptions} from './mapping-model/map-agg-test-options'; describe('ES Aggregation Gen', async () => { const magAppInstance = new MapAggTest('aggregations'); @@ -29,14 +30,20 @@ describe('ES Aggregation Gen', async () => { const directory = statSync(fullPath); return directory.isDirectory() - ? ([] as string[]).concat(...readdirSync(fullPath).map(fragment => - expandPathToFilesSync(path.resolve(sourcePath, fragment), accept), - )) + ? // eslint-disable-next-line unicorn/prefer-spread + ([] as string[]).concat( + ...readdirSync(fullPath).map(fragment => + expandPathToFilesSync(path.resolve(sourcePath, fragment), accept), + ), + ) : [fullPath].filter(accept); } - for (const file of expandPathToFilesSync('./test/mapping-model/aggregations/', file => file.endsWith('agg-test.ts'))) { + for (const file of expandPathToFilesSync('./test/mapping-model/aggregations/', file => + file.endsWith('agg-test.ts'), + )) { try { + // eslint-disable-next-line unicorn/no-await-expression-member const test = (await import(file))['testConfig'] as MapAggTestOptions; it(test.testName, function () { @@ -47,4 +54,6 @@ describe('ES Aggregation Gen', async () => { process.exit(1); } } -}).timeout(20_000).slow(10_000); +}) + .timeout(20_000) + .slow(10_000); diff --git a/test/mapping-model/aggregations/src/agg-array.agg-test.ts b/test/mapping-model/aggregations/src/agg-array.agg-test.ts index 23536429..4d77cf70 100644 --- a/test/mapping-model/aggregations/src/agg-array.agg-test.ts +++ b/test/mapping-model/aggregations/src/agg-array.agg-test.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; /** * @indexable diff --git a/test/mapping-model/aggregations/src/agg-global-nested.agg-test.ts b/test/mapping-model/aggregations/src/agg-global-nested.agg-test.ts index e3eee5e2..94d3d2f8 100644 --- a/test/mapping-model/aggregations/src/agg-global-nested.agg-test.ts +++ b/test/mapping-model/aggregations/src/agg-global-nested.agg-test.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; /** * @indexable diff --git a/test/mapping-model/aggregations/src/agg-global.agg-test.ts b/test/mapping-model/aggregations/src/agg-global.agg-test.ts index eab4931c..8ec9a2af 100644 --- a/test/mapping-model/aggregations/src/agg-global.agg-test.ts +++ b/test/mapping-model/aggregations/src/agg-global.agg-test.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; /** * @indexable diff --git a/test/mapping-model/aggregations/src/agg-inherited-global.agg-test.ts b/test/mapping-model/aggregations/src/agg-inherited-global.agg-test.ts index 382edc21..e17048d2 100644 --- a/test/mapping-model/aggregations/src/agg-inherited-global.agg-test.ts +++ b/test/mapping-model/aggregations/src/agg-inherited-global.agg-test.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; /** * @indexable @@ -23,7 +23,6 @@ export interface AggInheritedGlobal extends Foo { type: ThingType.AggInheritedGlobal; } - interface Foo { /** * @aggregatable global diff --git a/test/mapping-model/aggregations/src/agg-inherited-overwritten.agg-test.ts b/test/mapping-model/aggregations/src/agg-inherited-overwritten.agg-test.ts index bd33453e..cf2d8a67 100644 --- a/test/mapping-model/aggregations/src/agg-inherited-overwritten.agg-test.ts +++ b/test/mapping-model/aggregations/src/agg-inherited-overwritten.agg-test.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; /** * @indexable @@ -28,7 +28,6 @@ export interface AggInherited extends Foo { type: ThingType.AggInheritedOverwritten; } - interface Foo { /** * @aggregatable diff --git a/test/mapping-model/aggregations/src/agg-inherited.agg-test.ts b/test/mapping-model/aggregations/src/agg-inherited.agg-test.ts index d4ac43cd..057f2c86 100644 --- a/test/mapping-model/aggregations/src/agg-inherited.agg-test.ts +++ b/test/mapping-model/aggregations/src/agg-inherited.agg-test.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; /** * @indexable @@ -23,7 +23,6 @@ export interface AggInherited extends Foo { type: ThingType.AggInherited; } - interface Foo { /** * @aggregatable diff --git a/test/mapping-model/aggregations/src/agg-nested.agg-test.ts b/test/mapping-model/aggregations/src/agg-nested.agg-test.ts index 8b693490..d4d72199 100644 --- a/test/mapping-model/aggregations/src/agg-nested.agg-test.ts +++ b/test/mapping-model/aggregations/src/agg-nested.agg-test.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; /** * @indexable diff --git a/test/mapping-model/MapAggTestOptions.ts b/test/mapping-model/map-agg-test-options.ts similarity index 99% rename from test/mapping-model/MapAggTestOptions.ts rename to test/mapping-model/map-agg-test-options.ts index d1699927..67664b4a 100644 --- a/test/mapping-model/MapAggTestOptions.ts +++ b/test/mapping-model/map-agg-test-options.ts @@ -21,7 +21,7 @@ export interface MapAggTestOptions { agg?: { fields?: string[]; globals?: string[]; - } + }; map?: MinimalMappingDescription; err?: string[]; ignoredTags?: string[]; diff --git a/test/mapping-model/MapAggTest.ts b/test/mapping-model/map-agg-test.ts similarity index 75% rename from test/mapping-model/MapAggTest.ts rename to test/mapping-model/map-agg-test.ts index 0b402dc1..d68a6bd6 100644 --- a/test/mapping-model/MapAggTest.ts +++ b/test/mapping-model/map-agg-test.ts @@ -14,21 +14,23 @@ */ import {ElasticsearchDataType} from '../../src/config/typemap'; import {generateTemplate} from '../../src/mapping'; -import {resolve} from "path"; -import {expect} from "chai"; +import path from 'path'; +import {expect} from 'chai'; import {ProjectReflection} from 'typedoc'; import {getProjectReflection} from '../../src/project-reflection'; import {AggregationSchema, ESNestedAggregation} from '../../src/types/aggregation'; import {ElasticsearchTemplateCollection} from '../../src/types/mapping'; -import {MapAggTestOptions, MinimalMappingDescription} from './MapAggTestOptions'; +import {MapAggTestOptions, MinimalMappingDescription} from './map-agg-test-options'; import {settings} from '../../src/config/settings'; export class MapAggTest { mapping_model_path!: string; + reflection!: ProjectReflection; - constructor(dir: string) { - this.mapping_model_path = resolve(__dirname, dir); + constructor(directory: string) { + // eslint-disable-next-line unicorn/prefer-module + this.mapping_model_path = path.resolve(__dirname, directory); this.reflection = getProjectReflection(this.mapping_model_path); } @@ -37,14 +39,18 @@ export class MapAggTest { if (typeof options.err !== 'undefined') { for (const error of template.errors) { - expect(options.err).to.include(error, "Unexpected Error!") + expect(options.err).to.include(error, 'Unexpected Error!'); } } else { expect(template.errors).to.be.deep.equal([], 'Unexpected Error!'); } if (typeof options.agg !== 'undefined') { - const expectedAggSchema = MapAggTest.buildAggregation(options.name, options.agg.fields, options.agg.globals) + const expectedAggSchema = MapAggTest.buildAggregation( + options.name, + options.agg.fields, + options.agg.globals, + ); expect(template.aggregations).to.be.deep.equal(expectedAggSchema, 'Aggregation schema not equal!'); } @@ -59,8 +65,8 @@ export class MapAggTest { '@all': { aggs: {}, filter: { - match_all: {} - } + match_all: {}, + }, }, }; @@ -69,8 +75,8 @@ export class MapAggTest { terms: { field: `${global}.raw`, size: 1000, - } - } + }, + }; } if (typeof fields === 'undefined' || fields.length === 0) { @@ -80,19 +86,19 @@ export class MapAggTest { out[name] = { aggs: {}, filter: { - type: { - value: name, - } - } - } + term: { + type: name, + }, + }, + }; for (const field of fields) { (out[name]! as ESNestedAggregation).aggs[field] = { terms: { field: `${field}.raw`, size: 1000, - } - } + }, + }; } return out; @@ -107,28 +113,30 @@ export class MapAggTest { const out: ElasticsearchTemplateCollection = {}; const templateName = `template_${typeNameWithoutSpaces}`; out[templateName] = { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore empty object mappings: {}, settings: settings, - template: `stapps_${typeNameWithoutSpaces}*`, - } + index_patterns: [`stapps_${typeNameWithoutSpaces}*`], + }; const maps = map.maps ?? {}; maps.type = { - type: ElasticsearchDataType.text - } + type: ElasticsearchDataType.text, + }; maps.creation_date = { - type: ElasticsearchDataType.date - } - out[templateName].mappings[name] = { + type: ElasticsearchDataType.date, + }; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore can be used to index + out[templateName].mappings = { _source: { - excludes: [ - 'creation_date' - ] + excludes: ['creation_date'], }, date_detection: false, dynamic: 'strict', properties: maps, dynamic_templates: map.dynamicTemplates ?? [], - } + }; return out; } diff --git a/test/mapping-model/mappings/src/any-unknown.mapping-test.ts b/test/mapping-model/mappings/src/any-unknown.mapping-test.ts index a4b5059b..79c42930 100644 --- a/test/mapping-model/mappings/src/any-unknown.mapping-test.ts +++ b/test/mapping-model/mappings/src/any-unknown.mapping-test.ts @@ -14,17 +14,18 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; /** * @indexable */ export interface AnyUnknown { + // eslint-disable-next-line @typescript-eslint/no-explicit-any foo: any; bar: unknown; - type: ThingType.AnyUnknown + type: ThingType.AnyUnknown; } export const testConfig: MapAggTestOptions = { @@ -34,12 +35,12 @@ export const testConfig: MapAggTestOptions = { maps: { foo: { dynamic: true, - properties: {} + properties: {}, }, bar: { dynamic: true, - properties: {} - } - } - } + properties: {}, + }, + }, + }, }; diff --git a/test/mapping-model/mappings/src/date.mapping-test.ts b/test/mapping-model/mappings/src/date.mapping-test.ts index f1fb2f8f..1239e6be 100644 --- a/test/mapping-model/mappings/src/date.mapping-test.ts +++ b/test/mapping-model/mappings/src/date.mapping-test.ts @@ -14,13 +14,13 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ElasticsearchDataType} from '../../../../src/config/typemap'; /** * @date */ -export type SCISO8601Date = string +export type SCISO8601Date = string; /** * @indexable @@ -33,7 +33,7 @@ export interface DateAndRange { dateAlias: SCISO8601Date; - type: ThingType.Date + type: ThingType.Date; } export const testConfig: MapAggTestOptions = { @@ -47,6 +47,6 @@ export const testConfig: MapAggTestOptions = { dateAlias: { type: ElasticsearchDataType.date, }, - } - } + }, + }, }; diff --git a/test/mapping-model/mappings/src/default-generics.mapping-test.ts b/test/mapping-model/mappings/src/default-generics.mapping-test.ts index 1f6e1b2c..4f488d35 100644 --- a/test/mapping-model/mappings/src/default-generics.mapping-test.ts +++ b/test/mapping-model/mappings/src/default-generics.mapping-test.ts @@ -15,7 +15,7 @@ import {ElasticsearchDataType} from '../../../../src/config/typemap'; import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; /** * @indexable @@ -39,13 +39,11 @@ export const testConfig: MapAggTestOptions = { dynamic: 'strict', properties: { bar: { - type: ElasticsearchDataType.parse_error - } - } - } - } + type: ElasticsearchDataType.parse_error, + }, + }, + }, + }, }, - err: [ - `At "${ThingType.DefaultGeneric}::foo.bar" for Generic "T": Missing reflection, please report!` - ] + err: [`At "${ThingType.DefaultGeneric}::foo.bar" for Generic "T": Missing reflection, please report!`], }; diff --git a/test/mapping-model/mappings/src/double-type-conflict.mapping-test.ts b/test/mapping-model/mappings/src/double-type-conflict.mapping-test.ts index 1414c488..b527815e 100644 --- a/test/mapping-model/mappings/src/double-type-conflict.mapping-test.ts +++ b/test/mapping-model/mappings/src/double-type-conflict.mapping-test.ts @@ -15,7 +15,7 @@ import {ElasticsearchDataType} from '../../../../src/config/typemap'; import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; /** * @indexable @@ -42,15 +42,15 @@ export const testConfig: MapAggTestOptions = { map: { maps: { stringDoubleTypeConflict: { - type: ElasticsearchDataType.type_conflict + type: ElasticsearchDataType.type_conflict, }, numberDoubleTypeConflict: { - type: ElasticsearchDataType.type_conflict - } - } + type: ElasticsearchDataType.type_conflict, + }, + }, }, err: [ `At "${ThingType.DoubleTypeConflict}::stringDoubleTypeConflict" for type "string": Type conflict; "keyword" would override "text"`, - `At "${ThingType.DoubleTypeConflict}::numberDoubleTypeConflict" for type "number": Type conflict; "integer" would override "float"` - ] + `At "${ThingType.DoubleTypeConflict}::numberDoubleTypeConflict" for type "number": Type conflict; "integer" would override "float"`, + ], }; diff --git a/test/mapping-model/mappings/src/enum.mapping-test.ts b/test/mapping-model/mappings/src/enum.mapping-test.ts index 2617780a..5a728e0f 100644 --- a/test/mapping-model/mappings/src/enum.mapping-test.ts +++ b/test/mapping-model/mappings/src/enum.mapping-test.ts @@ -14,16 +14,16 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ElasticsearchDataType} from '../../../../src/config/typemap'; /** * @indexable */ export interface Enum { - foo: Bar, + foo: Bar; - bar: Baz, + bar: Baz; type: ThingType.Enum; } @@ -36,6 +36,7 @@ enum Bar { enum Baz { d = 'd', + // eslint-disable-next-line unicorn/prevent-abbreviations e = 'e', f = 'f', } @@ -48,11 +49,11 @@ export const testConfig: MapAggTestOptions = { map: { maps: { foo: { - type: ElasticsearchDataType.text + type: ElasticsearchDataType.text, }, bar: { - type: ElasticsearchDataType.text - } - } - } + type: ElasticsearchDataType.text, + }, + }, + }, }; diff --git a/test/mapping-model/mappings/src/filterable-tag.mapping-test.ts b/test/mapping-model/mappings/src/filterable-tag.mapping-test.ts index 86f9b792..305cf5b0 100644 --- a/test/mapping-model/mappings/src/filterable-tag.mapping-test.ts +++ b/test/mapping-model/mappings/src/filterable-tag.mapping-test.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ElasticsearchDataType} from '../../../../src/config/typemap'; export type FilterableEnumType = 'a' | 'b' | 'c'; @@ -38,14 +38,14 @@ export interface FilterableTag { /** * @filterable */ - baz: 'some literal' + baz: 'some literal'; /** * @filterable */ - buz: FilterableEnumType + buz: FilterableEnumType; - type: ThingType.FilterableTag + type: ThingType.FilterableTag; } export const testConfig: MapAggTestOptions = { @@ -57,34 +57,34 @@ export const testConfig: MapAggTestOptions = { type: ElasticsearchDataType.text, fields: { raw: { - type: ElasticsearchDataType.keyword - } - } + type: ElasticsearchDataType.keyword, + }, + }, }, bar: { type: ElasticsearchDataType.keyword, fields: { raw: { - type: ElasticsearchDataType.keyword - } - } + type: ElasticsearchDataType.keyword, + }, + }, }, baz: { type: ElasticsearchDataType.keyword, fields: { raw: { - type: ElasticsearchDataType.keyword - } - } + type: ElasticsearchDataType.keyword, + }, + }, }, buz: { type: ElasticsearchDataType.keyword, fields: { raw: { - type: ElasticsearchDataType.keyword - } - } - } - } - } + type: ElasticsearchDataType.keyword, + }, + }, + }, + }, + }, }; diff --git a/test/mapping-model/mappings/src/generics.mapping-test.ts b/test/mapping-model/mappings/src/generics.mapping-test.ts index bba84d4f..105619f5 100644 --- a/test/mapping-model/mappings/src/generics.mapping-test.ts +++ b/test/mapping-model/mappings/src/generics.mapping-test.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ElasticsearchDataType} from '../../../../src/config/typemap'; /** @@ -22,7 +22,7 @@ import {ElasticsearchDataType} from '../../../../src/config/typemap'; */ export interface Generics { foo: InterfaceWithDefaultGeneric; - baz: InterfaceWithStringGeneric + baz: InterfaceWithStringGeneric; type: ThingType.Generics; } @@ -44,18 +44,18 @@ export const testConfig: MapAggTestOptions = { dynamic: 'strict', properties: { bar: { - type: ElasticsearchDataType.integer - } - } + type: ElasticsearchDataType.integer, + }, + }, }, baz: { dynamic: 'strict', properties: { bar: { - type: ElasticsearchDataType.text - } - } - } - } - } + type: ElasticsearchDataType.text, + }, + }, + }, + }, + }, }; diff --git a/test/mapping-model/mappings/src/impossible-union.mapping-test.ts b/test/mapping-model/mappings/src/impossible-union.mapping-test.ts index d143c966..7010436c 100644 --- a/test/mapping-model/mappings/src/impossible-union.mapping-test.ts +++ b/test/mapping-model/mappings/src/impossible-union.mapping-test.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ElasticsearchDataType} from '../../../../src/config/typemap'; /** @@ -23,7 +23,7 @@ import {ElasticsearchDataType} from '../../../../src/config/typemap'; export interface ImpossibleUnion { foo: 'a' | 1 | boolean; - type: ThingType.ImpossibleUnion + type: ThingType.ImpossibleUnion; } export const testConfig: MapAggTestOptions = { @@ -32,11 +32,11 @@ export const testConfig: MapAggTestOptions = { map: { maps: { foo: { - type: ElasticsearchDataType.boolean - } - } + type: ElasticsearchDataType.boolean, + }, + }, }, err: [ - `At "${ThingType.ImpossibleUnion}::foo" for type "[{"type":"1","name":"2"},"unknown","1"]": Not implemented type` - ] + `At "${ThingType.ImpossibleUnion}::foo" for type "[{"type":"1","name":"2"},"unknown","1"]": Not implemented type`, + ], }; diff --git a/test/mapping-model/mappings/src/incompatible-type.mapping-test.ts b/test/mapping-model/mappings/src/incompatible-type.mapping-test.ts index b0b26108..689de8ea 100644 --- a/test/mapping-model/mappings/src/incompatible-type.mapping-test.ts +++ b/test/mapping-model/mappings/src/incompatible-type.mapping-test.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ElasticsearchDataType} from '../../../../src/config/typemap'; /** @@ -41,7 +41,6 @@ export interface DoubleTypeConflict { */ floatString: string; - type: ThingType.IncompatibleType; } @@ -51,23 +50,23 @@ export const testConfig: MapAggTestOptions = { map: { maps: { keywordNumber: { - type: ElasticsearchDataType.integer + type: ElasticsearchDataType.integer, }, textNumber: { - type: ElasticsearchDataType.integer + type: ElasticsearchDataType.integer, }, integerString: { - type: ElasticsearchDataType.text + type: ElasticsearchDataType.text, }, floatString: { - type: ElasticsearchDataType.text - } - } + type: ElasticsearchDataType.text, + }, + }, }, err: [ `At "${ThingType.IncompatibleType}::keywordNumber" for tag "keyword": Not implemented tag`, `At "${ThingType.IncompatibleType}::textNumber" for tag "text": Not implemented tag`, `At "${ThingType.IncompatibleType}::floatString" for tag "float": Not implemented tag`, `At "${ThingType.IncompatibleType}::integerString" for tag "integer": Not implemented tag`, - ] + ], }; diff --git a/test/mapping-model/mappings/src/index-signature.mapping-test.ts b/test/mapping-model/mappings/src/index-signature.mapping-test.ts index 882c3966..d15a4d28 100644 --- a/test/mapping-model/mappings/src/index-signature.mapping-test.ts +++ b/test/mapping-model/mappings/src/index-signature.mapping-test.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ElasticsearchDataType} from '../../../../src/config/typemap'; /** @@ -25,8 +25,8 @@ export interface IndexSignature { [key: string]: { bar: number; baz: string; - } - } + }; + }; type: ThingType.IndexSignature; } @@ -38,8 +38,8 @@ export const testConfig: MapAggTestOptions = { maps: { foo: { dynamic: true, - properties: {} - } + properties: {}, + }, }, dynamicTemplates: [ { @@ -48,18 +48,18 @@ export const testConfig: MapAggTestOptions = { dynamic: 'strict', properties: { bar: { - type: ElasticsearchDataType.integer + type: ElasticsearchDataType.integer, }, baz: { - type: ElasticsearchDataType.text - } - } + type: ElasticsearchDataType.text, + }, + }, }, match: '*', match_mapping_type: '*', - path_match: 'foo.*' - } - } - ] - } + path_match: 'foo.*', + }, + }, + ], + }, }; diff --git a/test/mapping-model/mappings/src/inferred-type-filterable.mapping-test.ts b/test/mapping-model/mappings/src/inferred-type-filterable.mapping-test.ts index bd91b4ee..66fd9680 100644 --- a/test/mapping-model/mappings/src/inferred-type-filterable.mapping-test.ts +++ b/test/mapping-model/mappings/src/inferred-type-filterable.mapping-test.ts @@ -14,7 +14,7 @@ */ import {ElasticsearchDataType} from '../../../../src/config/typemap'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ThingType} from './types'; /** @@ -36,7 +36,7 @@ export interface InferredTypeFilterable { */ bar: SCISO8601Date; - type: ThingType.InferredTypeFilterable + type: ThingType.InferredTypeFilterable; } export const testConfig: MapAggTestOptions = { @@ -49,12 +49,12 @@ export const testConfig: MapAggTestOptions = { fields: { raw: { type: ElasticsearchDataType.keyword, - } - } + }, + }, }, bar: { type: ElasticsearchDataType.date, - } - } - } + }, + }, + }, }; diff --git a/test/mapping-model/mappings/src/inherit-tags.mapping-test.ts b/test/mapping-model/mappings/src/inherit-tags.mapping-test.ts index 22e3b545..8a63f4d8 100644 --- a/test/mapping-model/mappings/src/inherit-tags.mapping-test.ts +++ b/test/mapping-model/mappings/src/inherit-tags.mapping-test.ts @@ -14,7 +14,7 @@ */ import {ElasticsearchDataType} from '../../../../src/config/typemap'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ThingType} from './types'; /** @@ -24,14 +24,14 @@ export interface InheritTags { /** * @inheritTags inherit tags::bar.baz */ - foo: number, + foo: number; bar: { /** * @float */ - baz: number - } + baz: number; + }; type: ThingType.InheritTags; } @@ -42,16 +42,16 @@ export const testConfig: MapAggTestOptions = { map: { maps: { foo: { - type: ElasticsearchDataType.float + type: ElasticsearchDataType.float, }, bar: { dynamic: 'strict', properties: { baz: { - type: ElasticsearchDataType.float - } - } + type: ElasticsearchDataType.float, + }, + }, }, - } - } + }, + }, }; diff --git a/test/mapping-model/mappings/src/inherited-property.mapping-test.ts b/test/mapping-model/mappings/src/inherited-property.mapping-test.ts index 8453d2b3..b2c070f0 100644 --- a/test/mapping-model/mappings/src/inherited-property.mapping-test.ts +++ b/test/mapping-model/mappings/src/inherited-property.mapping-test.ts @@ -14,14 +14,14 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ElasticsearchDataType} from '../../../../src/config/typemap'; /** * @indexable */ -export interface InheritedProperty extends Bar{ - foo: number, +export interface InheritedProperty extends Bar { + foo: number; type: ThingType.InheritedProperty; } @@ -44,14 +44,14 @@ export const testConfig: MapAggTestOptions = { map: { maps: { foo: { - type: ElasticsearchDataType.integer + type: ElasticsearchDataType.integer, }, bar: { - type: ElasticsearchDataType.keyword + type: ElasticsearchDataType.keyword, }, baz: { - type: ElasticsearchDataType.float - } - } - } + type: ElasticsearchDataType.float, + }, + }, + }, }; diff --git a/test/mapping-model/mappings/src/invalid-tag.mapping-test.ts b/test/mapping-model/mappings/src/invalid-tag.mapping-test.ts index eafa7d27..7fb34b7e 100644 --- a/test/mapping-model/mappings/src/invalid-tag.mapping-test.ts +++ b/test/mapping-model/mappings/src/invalid-tag.mapping-test.ts @@ -1,3 +1,4 @@ +/* eslint-disable jsdoc/check-tag-names */ /* * Copyright (C) 2020 StApps * This program is free software: you can redistribute it and/or modify it @@ -14,7 +15,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ElasticsearchDataType} from '../../../../src/config/typemap'; /** @@ -35,11 +36,9 @@ export const testConfig: MapAggTestOptions = { map: { maps: { foo: { - type: ElasticsearchDataType.text - } - } + type: ElasticsearchDataType.text, + }, + }, }, - err: [ - `At "${ThingType.InvalidTag}::foo" for tag "aninvalidtag": Not implemented tag` - ] + err: [`At "${ThingType.InvalidTag}::foo" for tag "aninvalidtag": Not implemented tag`], }; diff --git a/test/mapping-model/mappings/src/map-explicit-types.mapping-test.ts b/test/mapping-model/mappings/src/map-explicit-types.mapping-test.ts index 3e2241bc..b1b2a65e 100644 --- a/test/mapping-model/mappings/src/map-explicit-types.mapping-test.ts +++ b/test/mapping-model/mappings/src/map-explicit-types.mapping-test.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ElasticsearchDataType} from '../../../../src/config/typemap'; /** @@ -44,12 +44,12 @@ export interface MapExplicitTypes { /** * @date */ - esEpochMsDate: number + esEpochMsDate: number; /** * @date */ - esStringDate: string + esStringDate: string; type: ThingType.MapExplicitTypes; } @@ -60,23 +60,23 @@ export const testConfig: MapAggTestOptions = { map: { maps: { esInteger: { - type: ElasticsearchDataType.integer + type: ElasticsearchDataType.integer, }, esFloat: { - type: ElasticsearchDataType.float + type: ElasticsearchDataType.float, }, esKeyword: { - type: ElasticsearchDataType.keyword + type: ElasticsearchDataType.keyword, }, esText: { - type: ElasticsearchDataType.text + type: ElasticsearchDataType.text, }, esEpochMsDate: { - type: ElasticsearchDataType.date + type: ElasticsearchDataType.date, }, esStringDate: { - type: ElasticsearchDataType.date + type: ElasticsearchDataType.date, }, - } - } + }, + }, }; diff --git a/test/mapping-model/mappings/src/missing-premap.mapping-test.ts b/test/mapping-model/mappings/src/missing-premap.mapping-test.ts index ba23aa94..98d6f6ba 100644 --- a/test/mapping-model/mappings/src/missing-premap.mapping-test.ts +++ b/test/mapping-model/mappings/src/missing-premap.mapping-test.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ElasticsearchDataType} from '../../../../src/config/typemap'; /** @@ -35,11 +35,9 @@ export const testConfig: MapAggTestOptions = { map: { maps: { foo: { - type: ElasticsearchDataType.missing_premap - } - } + type: ElasticsearchDataType.missing_premap, + }, + }, }, - err: [ - `At "${ThingType.MissingPremap}::foo" for external type "HTMLAllCollection": Missing pre-map` - ] + err: [`At "${ThingType.MissingPremap}::foo" for external type "HTMLAllCollection": Missing pre-map`], }; diff --git a/test/mapping-model/mappings/src/nested.mapping-test.ts b/test/mapping-model/mappings/src/nested.mapping-test.ts index 6d6d1033..c61e2a28 100644 --- a/test/mapping-model/mappings/src/nested.mapping-test.ts +++ b/test/mapping-model/mappings/src/nested.mapping-test.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ElasticsearchDataType} from '../../../../src/config/typemap'; /** @@ -29,10 +29,10 @@ export interface Nested { * @keyword */ depth3_2: string; - } + }; depth2_2: boolean; - } - } + }; + }; type: ThingType.Nested; } @@ -52,20 +52,20 @@ export const testConfig: MapAggTestOptions = { dynamic: 'strict', properties: { depth3_1: { - type: ElasticsearchDataType.integer + type: ElasticsearchDataType.integer, }, depth3_2: { - type: ElasticsearchDataType.keyword - } - } + type: ElasticsearchDataType.keyword, + }, + }, }, depth2_2: { - type: ElasticsearchDataType.boolean - } - } - } - } - } - } - } + type: ElasticsearchDataType.boolean, + }, + }, + }, + }, + }, + }, + }, }; diff --git a/test/mapping-model/mappings/src/object-union.mapping-test.ts b/test/mapping-model/mappings/src/object-union.mapping-test.ts index 17f15997..3de9f881 100644 --- a/test/mapping-model/mappings/src/object-union.mapping-test.ts +++ b/test/mapping-model/mappings/src/object-union.mapping-test.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ElasticsearchDataType} from '../../../../src/config/typemap'; /** @@ -23,7 +23,7 @@ import {ElasticsearchDataType} from '../../../../src/config/typemap'; export interface ObjectUnion { foo: Boo | Buu; - type: ThingType.ObjectUnion + type: ThingType.ObjectUnion; } // we can't name them Bar or Baz, look here for more info: @@ -49,16 +49,16 @@ export const testConfig: MapAggTestOptions = { dynamic: 'strict', properties: { a: { - type: ElasticsearchDataType.boolean + type: ElasticsearchDataType.boolean, }, b: { - type: ElasticsearchDataType.integer + type: ElasticsearchDataType.integer, }, intersection: { - type: ElasticsearchDataType.text - } - } - } - } - } + type: ElasticsearchDataType.text, + }, + }, + }, + }, + }, }; diff --git a/test/mapping-model/mappings/src/paired-tags.mapping-test.ts b/test/mapping-model/mappings/src/paired-tags.mapping-test.ts index bdd7c169..1cb22ad0 100644 --- a/test/mapping-model/mappings/src/paired-tags.mapping-test.ts +++ b/test/mapping-model/mappings/src/paired-tags.mapping-test.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ElasticsearchDataType} from '../../../../src/config/typemap'; /** @@ -46,23 +46,24 @@ export const testConfig: MapAggTestOptions = { type: ElasticsearchDataType.keyword, fields: { raw: { - type: ElasticsearchDataType.keyword - } - } + type: ElasticsearchDataType.keyword, + }, + }, }, bar: { type: ElasticsearchDataType.text, fields: { raw: { - type: ElasticsearchDataType.keyword + type: ElasticsearchDataType.keyword, }, sort: { - analyzer: 'ducet_sort', - fielddata: true, - type: ElasticsearchDataType.text - } - } - } - } - } + country: 'DE', + language: 'de', + type: 'icu_collation_keyword', + variant: '@collation=phonebook', + }, + }, + }, + }, + }, }; diff --git a/test/mapping-model/mappings/src/sensible-defaults.mapping-test.ts b/test/mapping-model/mappings/src/sensible-defaults.mapping-test.ts index 4d4da243..1dfd4f38 100644 --- a/test/mapping-model/mappings/src/sensible-defaults.mapping-test.ts +++ b/test/mapping-model/mappings/src/sensible-defaults.mapping-test.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ElasticsearchDataType} from '../../../../src/config/typemap'; /** @@ -37,23 +37,23 @@ export const testConfig: MapAggTestOptions = { map: { maps: { numberDefault: { - type: ElasticsearchDataType.integer + type: ElasticsearchDataType.integer, }, stringDefault: { - type: ElasticsearchDataType.text + type: ElasticsearchDataType.text, }, booleanDefault: { - type: ElasticsearchDataType.boolean + type: ElasticsearchDataType.boolean, }, stringLiteralDefault: { - type: ElasticsearchDataType.keyword + type: ElasticsearchDataType.keyword, }, booleanTrueLiteralDefault: { - type: ElasticsearchDataType.boolean + type: ElasticsearchDataType.boolean, }, booleanFalseLiteralDefault: { - type: ElasticsearchDataType.boolean - } - } - } + type: ElasticsearchDataType.boolean, + }, + }, + }, }; diff --git a/test/mapping-model/mappings/src/sortable-tag.mapping-test.ts b/test/mapping-model/mappings/src/sortable-tag.mapping-test.ts index ca261727..83f0a18c 100644 --- a/test/mapping-model/mappings/src/sortable-tag.mapping-test.ts +++ b/test/mapping-model/mappings/src/sortable-tag.mapping-test.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ElasticsearchDataType} from '../../../../src/config/typemap'; /** @@ -36,7 +36,7 @@ export interface SortableTag { */ baz: number; - type: ThingType.SortableTag + type: ThingType.SortableTag; } export const testConfig: MapAggTestOptions = { @@ -48,32 +48,35 @@ export const testConfig: MapAggTestOptions = { type: ElasticsearchDataType.text, fields: { sort: { - analyzer: 'ducet_sort', - fielddata: true, - type: 'text' - } - } + country: 'DE', + language: 'de', + type: 'icu_collation_keyword', + variant: '@collation=phonebook', + }, + }, }, bar: { type: ElasticsearchDataType.text, fields: { sort: { - analyzer: 'ducet_sort', - fielddata: true, - type: 'text' - } - } + country: 'DE', + language: 'de', + type: 'icu_collation_keyword', + variant: '@collation=phonebook', + }, + }, }, baz: { type: ElasticsearchDataType.integer, fields: { sort: { - analyzer: 'ducet_sort', - fielddata: true, - type: 'text' - } - } - } - } - } + country: 'DE', + language: 'de', + type: 'icu_collation_keyword', + variant: '@collation=phonebook', + }, + }, + }, + }, + }, }; diff --git a/test/mapping-model/mappings/src/tags-ignore-case.mapping-test.ts b/test/mapping-model/mappings/src/tags-ignore-case.mapping-test.ts index cdf8bb42..a62d9ce9 100644 --- a/test/mapping-model/mappings/src/tags-ignore-case.mapping-test.ts +++ b/test/mapping-model/mappings/src/tags-ignore-case.mapping-test.ts @@ -13,7 +13,7 @@ * this program. If not, see . */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ElasticsearchDataType} from '../../../../src/config/typemap'; /** @@ -23,19 +23,19 @@ export interface TagsIgnoreCase { /** * @inheritTags inherit tags::bar.baz */ - camelCase: number, + camelCase: number; /** - * @inherittags inherit tags::bar.baz + * @inheritTags inherit tags::bar.baz */ - lowerCase: number, + lowerCase: number; bar: { /** * @float */ - baz: number - } + baz: number; + }; type: ThingType.TagsIgnoreCase; } @@ -46,19 +46,19 @@ export const testConfig: MapAggTestOptions = { map: { maps: { camelCase: { - type: ElasticsearchDataType.float + type: ElasticsearchDataType.float, }, lowerCase: { - type: ElasticsearchDataType.float + type: ElasticsearchDataType.float, }, bar: { dynamic: 'strict', properties: { baz: { - type: ElasticsearchDataType.float - } - } + type: ElasticsearchDataType.float, + }, + }, }, - } - } + }, + }, }; diff --git a/test/mapping-model/mappings/src/type-alias.mapping-test.ts b/test/mapping-model/mappings/src/type-alias.mapping-test.ts index fef4e47c..0fd1b734 100644 --- a/test/mapping-model/mappings/src/type-alias.mapping-test.ts +++ b/test/mapping-model/mappings/src/type-alias.mapping-test.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ElasticsearchDataType} from '../../../../src/config/typemap'; /** @@ -24,17 +24,17 @@ export interface TypeAlias { /** * */ - textProperty: ATextAlias, + textProperty: ATextAlias; /** * */ - keywordProperty: AKeywordAlias, + keywordProperty: AKeywordAlias; /** * @keyword */ - overriddenTextAsKeyword: ATextAlias + overriddenTextAsKeyword: ATextAlias; type: ThingType.TypeAlias; } @@ -63,6 +63,6 @@ export const testConfig: MapAggTestOptions = { overriddenTextAsKeyword: { type: ElasticsearchDataType.keyword, }, - } - } + }, + }, }; diff --git a/test/mapping-model/mappings/src/type-overrides.mapping-test.ts b/test/mapping-model/mappings/src/type-overrides.mapping-test.ts index 95695685..2f8c7b8c 100644 --- a/test/mapping-model/mappings/src/type-overrides.mapping-test.ts +++ b/test/mapping-model/mappings/src/type-overrides.mapping-test.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ElasticsearchDataType} from '../../../../src/config/typemap'; export interface SCISO8601DateRange { @@ -27,7 +27,7 @@ export interface SCISO8601DateRange { export interface TypeOverrides { foo: SCISO8601DateRange; - type: ThingType.TypeOverrides + type: ThingType.TypeOverrides; } export const testConfig: MapAggTestOptions = { @@ -38,6 +38,6 @@ export const testConfig: MapAggTestOptions = { foo: { type: ElasticsearchDataType.date_range, }, - } - } + }, + }, }; diff --git a/test/mapping-model/mappings/src/type-query.mapping-test.disabled.ts b/test/mapping-model/mappings/src/type-query.mapping-test.disabled.ts index 4485eead..0e359500 100644 --- a/test/mapping-model/mappings/src/type-query.mapping-test.disabled.ts +++ b/test/mapping-model/mappings/src/type-query.mapping-test.disabled.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ElasticsearchDataType} from '../../../../src/config/typemap'; /** @@ -29,7 +29,7 @@ export interface TypeQuery { enum Bar { 'a', 'b', - 'c' + 'c', } // https://gitlab.com/openstapps/core-tools/-/issues/47 @@ -39,8 +39,8 @@ export const testConfig: MapAggTestOptions = { map: { maps: { foo: { - type: ElasticsearchDataType.text - } - } - } + type: ElasticsearchDataType.text, + }, + }, + }, }; diff --git a/test/mapping-model/mappings/src/type-wrapper-inheritance.mapping-test.disabled.ts b/test/mapping-model/mappings/src/type-wrapper-inheritance.mapping-test.disabled.ts index e7990746..bb295370 100644 --- a/test/mapping-model/mappings/src/type-wrapper-inheritance.mapping-test.disabled.ts +++ b/test/mapping-model/mappings/src/type-wrapper-inheritance.mapping-test.disabled.ts @@ -14,7 +14,7 @@ */ import {ThingType} from './types'; -import {MapAggTestOptions} from '../../MapAggTestOptions'; +import {MapAggTestOptions} from '../../map-agg-test-options'; import {ElasticsearchDataType} from '../../../../src/config/typemap'; /** @@ -36,7 +36,7 @@ export interface TypeWrapperInheritance { */ stringLiteralWrapper: StringLiteralWrapper; - type: ThingType.TypeWrapperInheritance + type: ThingType.TypeWrapperInheritance; } type NumberWrapper = number; @@ -53,16 +53,16 @@ export const testConfig: MapAggTestOptions = { dynamic: 'strict', properties: { numberWrapper: { - type: ElasticsearchDataType.float + type: ElasticsearchDataType.float, }, stringWrapper: { - type: ElasticsearchDataType.keyword + type: ElasticsearchDataType.keyword, }, stringLiteralWrapper: { - type: ElasticsearchDataType.text - } - } - } - } - } + type: ElasticsearchDataType.text, + }, + }, + }, + }, + }, }; diff --git a/test/mapping.spec.ts b/test/mapping.spec.ts index e04e3519..76da44d4 100644 --- a/test/mapping.spec.ts +++ b/test/mapping.spec.ts @@ -15,8 +15,8 @@ import {Logger} from '@openstapps/logger'; import {readdirSync, statSync} from 'fs'; import path from 'path'; -import {MapAggTest} from './mapping-model/MapAggTest'; -import {MapAggTestOptions} from './mapping-model/MapAggTestOptions'; +import {MapAggTest} from './mapping-model/map-agg-test'; +import {MapAggTestOptions} from './mapping-model/map-agg-test-options'; describe('ES Mapping Gen', async () => { const magAppInstance = new MapAggTest('mappings'); @@ -24,27 +24,36 @@ describe('ES Mapping Gen', async () => { /** * Expand a path to a list of all files deeply contained in it */ + // eslint-disable-next-line unicorn/consistent-function-scoping function expandPathToFilesSync(sourcePath: string, accept: (fileName: string) => boolean): string[] { const fullPath = path.resolve(sourcePath); const directory = statSync(fullPath); return directory.isDirectory() - ? ([] as string[]).concat(...readdirSync(fullPath).map(fragment => - expandPathToFilesSync(path.resolve(sourcePath, fragment), accept), - )) + ? // eslint-disable-next-line unicorn/prefer-spread + ([] as string[]).concat( + ...readdirSync(fullPath).map(fragment => + expandPathToFilesSync(path.resolve(sourcePath, fragment), accept), + ), + ) : [fullPath].filter(accept); } - for (const file of expandPathToFilesSync('./test/mapping-model/mappings/', file => file.endsWith('mapping-test.ts'))) { + for (const file of expandPathToFilesSync('./test/mapping-model/mappings/', file => + file.endsWith('mapping-test.ts'), + )) { try { + // eslint-disable-next-line unicorn/no-await-expression-member const test = (await import(file))['testConfig'] as MapAggTestOptions; it(test.testName, function () { - magAppInstance.testInterfaceAgainstPath(test) - }) + magAppInstance.testInterfaceAgainstPath(test); + }); } catch (error) { await Logger.error('UNHANDLED REJECTION', error.stack); process.exit(1); } } -}).timeout(20_000).slow(10_000); +}) + .timeout(20_000) + .slow(10_000); diff --git a/tslint.json b/tslint.json deleted file mode 100644 index 3b13d8c1..00000000 --- a/tslint.json +++ /dev/null @@ -1,143 +0,0 @@ -{ - "defaultSeverity": "error", - "extends": [ - "tslint:recommended", - "tslint-eslint-rules" - ], - "rules": { - "array-type": [ - true, - "array-simple" - ], - "arrow-return-shorthand": true, - "await-promise": true, - "ban-comma-operator": true, - "ban-ts-ignore": true, - "completed-docs": true, - "curly": true, - "encoding": true, - "file-header": true, - "file-name-casing": [ - true, - "kebab-case" - ], - "forin": true, - "indent": [ - true, - "spaces", - 2 - ], - "interface-name": [ - true, - "never-prefix" - ], - "linebreak-style": [ - true, - "LF" - ], - "max-classes-per-file": false, - "member-access": false, - "member-ordering": [ - true, - { - "alphabetize": true, - "order": [ - "private-static-field", - "protected-static-field", - "public-static-field", - "private-instance-field", - "protected-instance-field", - "public-instance-field", - "private-static-method", - "protected-static-method", - "public-static-method", - "constructor", - "private-instance-method", - "protected-instance-method", - "public-instance-method" - ] - } - ], - "newline-before-return": true, - "newline-per-chained-call": true, - "no-angle-bracket-type-assertion": true, - "no-any": true, - "no-boolean-literal-compare": true, - "no-conditional-assignment": true, - "no-construct": true, - "no-default-export": true, - "no-default-import": true, - "no-duplicate-super": true, - "no-floating-promises": true, - "no-implicit-dependencies": true, - "no-inferrable-types": true, - "no-magic-numbers": true, - "no-parameter-reassignment": true, - "no-redundant-jsdoc": true, - "no-reference": true, - "no-return-await": true, - "no-shadowed-variable": true, - "no-sparse-arrays": true, - "no-string-throw": true, - "no-trailing-whitespace": [ - true, - "ignore-comments", - "ignore-jsdoc" - ], - "object-curly-spacing": [ - true, - "never" - ], - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-variable-per-declaration": true, - "ordered-imports": [ - true, - { - "import-sources-order": "case-insensitive", - "named-imports-order": "case-insensitive" - } - ], - "prefer-const": true, - "prefer-for-of": true, - "prefer-function-over-method": true, - "prefer-object-spread": true, - "prefer-readonly": true, - "prefer-template": true, - "promise-function-async": true, - "quotemark": [ - true, - "single", - "avoid-escape" - ], - "semicolon": true, - "static-this": true, - "strict-boolean-expressions": true, - "trailing-comma": [ - true, - { - "multiline": "always", - "singleline": "never" - } - ], - "type-literal-delimiter": [ - true, - { - "singleLine": "always" - } - ], - "unnecessary-bind": true, - "unnecessary-else": true, - "variable-name": [ - true, - "ban-keywords", - "check-format", - "allow-leading-underscore" - ] - }, - "linterOptions": { - "exclude": [ - "../../../test/**" - ] - } -}