From 6786c8f321b9361bf8349ee9797a730a5247891f Mon Sep 17 00:00:00 2001 From: Robin van der Linde Date: Thu, 25 Apr 2024 00:56:36 +0200 Subject: [PATCH] Test with name suggestion index --- assets/layers/atm/atm.json | 4 +- package-lock.json | 223 +++++++++++++++++- package.json | 3 +- .../Helpers/NameSuggestionIndexInput.svelte | 103 ++++++++ src/UI/InputElement/InputHelper.svelte | 3 + src/UI/InputElement/Validators.ts | 3 + .../NameSuggestionIndexValidator.ts | 37 +++ 7 files changed, 371 insertions(+), 5 deletions(-) create mode 100644 src/UI/InputElement/Helpers/NameSuggestionIndexInput.svelte create mode 100644 src/UI/InputElement/Validators/NameSuggestionIndexValidator.ts diff --git a/assets/layers/atm/atm.json b/assets/layers/atm/atm.json index 9d40a592f..9c36ede46 100644 --- a/assets/layers/atm/atm.json +++ b/assets/layers/atm/atm.json @@ -150,7 +150,7 @@ }, "freeform": { "key": "brand", - "type": "string", + "type": "nsi", "placeholder": { "en": "Brand name", "de": "Markenname", @@ -641,4 +641,4 @@ "enableImproveAccuracy": true, "enableRelocation": false } -} +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index d06b642ff..728b25801 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,18 @@ { "name": "mapcomplete", - "version": "0.42.0", + "version": "0.42.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "mapcomplete", - "version": "0.42.0", + "version": "0.42.3", "license": "GPL-3.0-or-later", "dependencies": { "@comunica/core": "^3.0.1", "@comunica/query-sparql": "^3.0.1", "@comunica/query-sparql-link-traversal": "^0.3.0", + "@rapideditor/location-conflation": "^1.3.0", "@rgossiaux/svelte-headlessui": "^1.0.2", "@rgossiaux/svelte-heroicons": "^0.1.2", "@rollup/plugin-typescript": "^11.0.0", @@ -53,6 +54,7 @@ "mangrove-reviews-typescript": "^1.1.0", "maplibre-gl": "^4.1.1", "monaco-editor": "^0.46.0", + "name-suggestion-index": "^6.0.20240422", "nano-markdown": "^1.2.2", "opening_hours": "^3.6.0", "osm-auth": "^2.2.0", @@ -129,6 +131,11 @@ "node": ">=0.10.0" } }, + "node_modules/@aitodotai/json-stringify-pretty-compact": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@aitodotai/json-stringify-pretty-compact/-/json-stringify-pretty-compact-1.3.0.tgz", + "integrity": "sha512-K+whdCBlVjzx8zCK2ZUohGJb5bUOxRpiEAfD1NCUgH0mApdDZD9c7VHXJVzWlt3wfV1X4OFyCRmTqbPd6U87lQ==" + }, "node_modules/@ampproject/remapping": { "version": "2.2.0", "dev": true, @@ -4743,6 +4750,14 @@ "@jridgewell/sourcemap-codec": "1.4.14" } }, + "node_modules/@mapbox/geojson-area": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@mapbox/geojson-area/-/geojson-area-0.2.2.tgz", + "integrity": "sha512-bBqqFn1kIbLBfn7Yq1PzzwVkPYQr9lVUeT8Dhd0NL5n76PBuXzOcuLV7GOSbEB1ia8qWxH4COCvFpziEu/yReA==", + "dependencies": { + "wgs84": "0.0.0" + } + }, "node_modules/@mapbox/geojson-rewind": { "version": "0.5.2", "license": "ISC", @@ -4865,6 +4880,33 @@ "url": "https://opencollective.com/parcel" } }, + "node_modules/@rapideditor/country-coder": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/@rapideditor/country-coder/-/country-coder-5.2.2.tgz", + "integrity": "sha512-xGkI+wHX694sFcKKVdy20/uNeHuIiJACnke2vp7LzX22PRPJJv+pcn1OU5nb1urnad275EMfJQR33ayi2hWZOQ==", + "dependencies": { + "which-polygon": "^2.2.1" + }, + "engines": { + "node": ">=16.14.0" + } + }, + "node_modules/@rapideditor/location-conflation": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@rapideditor/location-conflation/-/location-conflation-1.3.0.tgz", + "integrity": "sha512-h4FAeKNxuqmO7OGTkXN5CS8gbP+/sCyrQdgSMhtjGYwnGaNQoEIypQNRYAqQJxJjgNISvVvunRTvSOOJfSWxSw==", + "dependencies": { + "@aitodotai/json-stringify-pretty-compact": "^1.3.0", + "@mapbox/geojson-area": "^0.2.2", + "@rapideditor/country-coder": "^5.2.1", + "circle-to-polygon": "^2.2.0", + "geojson-precision": "^1.0.0", + "polyclip-ts": "~0.16.3" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@rdfjs/types": { "version": "1.1.0", "license": "MIT", @@ -7921,6 +7963,11 @@ "node": ">=8" } }, + "node_modules/circle-to-polygon": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/circle-to-polygon/-/circle-to-polygon-2.2.0.tgz", + "integrity": "sha512-yC9/bw6P0YmV2/oxm4DLrSgrzHhbz9H+vgUScmSFN5KilR/KFGVRbUi9a0mIYPsXK44HvnysVVi/iIysRJVvNw==" + }, "node_modules/cli-truncate": { "version": "3.1.0", "license": "MIT", @@ -8708,6 +8755,11 @@ "node": ">=0.8.0" } }, + "node_modules/diacritics": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/diacritics/-/diacritics-1.3.0.tgz", + "integrity": "sha512-wlwEkqcsaxvPJML+rDh/2iS824jbREk6DUMUKkEaSlxdYHeS43cClJtsWglvw2RfeXGm6ohKDqsXteJ5sP5enA==" + }, "node_modules/didyoumean": { "version": "1.2.2", "license": "Apache-2.0" @@ -9884,6 +9936,25 @@ "geojson-numeric": "geojson-numeric" } }, + "node_modules/geojson-precision": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/geojson-precision/-/geojson-precision-1.0.0.tgz", + "integrity": "sha512-lXK9eCxhZQnZSMtz+xcy16H6In9oGbtYg0A92elUX13QtdrIsngrU2w9ZjkKB2GY1TDIJJ22elzcgRAEmyFoXQ==", + "dependencies": { + "commander": "2.19.0" + }, + "bin": { + "geojson-precision": "bin/geojson-precision" + }, + "engines": { + "node": ">=6.4.0" + } + }, + "node_modules/geojson-precision/node_modules/commander": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", + "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==" + }, "node_modules/geojson-random": { "version": "0.2.2", "license": "ISC", @@ -11319,6 +11390,11 @@ "node": ">=10" } }, + "node_modules/lineclip": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/lineclip/-/lineclip-1.1.5.tgz", + "integrity": "sha512-KlA/wRSjpKl7tS9iRUdlG72oQ7qZ1IlVbVgHwoO10TBR/4gQ86uhKow6nlzMAJJhjCWKto8OeoAzzIzKSmN25A==" + }, "node_modules/local-pkg": { "version": "0.4.3", "license": "MIT", @@ -11915,6 +11991,19 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/name-suggestion-index": { + "version": "6.0.20240422", + "resolved": "https://registry.npmjs.org/name-suggestion-index/-/name-suggestion-index-6.0.20240422.tgz", + "integrity": "sha512-NP0QJfCGKkpduNruS6dM8U7uA//EjyH4Kw+lavUWuQxOl0QxhFVF9caMh3UPvDZgqdMOMpyi/z195rjieAAPyQ==", + "dependencies": { + "diacritics": "^1.3.0", + "run-s": "^0.0.0", + "which-polygon": "^2.2.1" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/nano-markdown": { "version": "1.2.2", "license": "MIT" @@ -12503,6 +12592,15 @@ "version": "1.1.0", "license": "MIT" }, + "node_modules/polyclip-ts": { + "version": "0.16.5", + "resolved": "https://registry.npmjs.org/polyclip-ts/-/polyclip-ts-0.16.5.tgz", + "integrity": "sha512-ZchnG0zGZReHgEo3EYzEUi6UmfQFFzNnj6AFU+gBm+IJJ4qG9gL4CwjtCV6oi/PittUPpJLiLJxcn/AgrCBO+g==", + "dependencies": { + "bignumber.js": "^9.1.0", + "splaytree-ts": "^1.0.1" + } + }, "node_modules/polygon-clipping": { "version": "0.15.3", "license": "MIT", @@ -13941,6 +14039,11 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/run-s": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/run-s/-/run-s-0.0.0.tgz", + "integrity": "sha512-KPDNauF2Tpnm3nG0+0LJuJxwBFrhAdthpM8bVdDvjWQA7pWP7QoNwEl1+dJ7WVJj81AQP/i6kl6JUmAk7tg3Og==" + }, "node_modules/rw": { "version": "1.3.3", "license": "BSD-3-Clause" @@ -14560,6 +14663,11 @@ "version": "3.1.1", "license": "MIT" }, + "node_modules/splaytree-ts": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/splaytree-ts/-/splaytree-ts-1.0.1.tgz", + "integrity": "sha512-B+VzCm33/KEchi/fzT6/3NRHm8k5+Kf37SBQO3meHHS/tK2xBnIm4ZvusQ1wUpHgKMCCqEWgXnwFXAa1nD289g==" + }, "node_modules/split-string": { "version": "3.1.0", "license": "MIT", @@ -16502,6 +16610,15 @@ "node": ">= 8" } }, + "node_modules/which-polygon": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/which-polygon/-/which-polygon-2.2.1.tgz", + "integrity": "sha512-RlpWbqz12OMT0r2lEHk7IUPXz0hb1L/ZZsGushB2P2qxuBu1aq1+bcTfsLtfoRBYHsED6ruBMiwFaidvXZfQVw==", + "dependencies": { + "lineclip": "^1.1.5", + "rbush": "^2.0.1" + } + }, "node_modules/which-typed-array": { "version": "1.1.9", "dev": true, @@ -16779,6 +16896,11 @@ "version": "1.2.6", "dev": true }, + "@aitodotai/json-stringify-pretty-compact": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@aitodotai/json-stringify-pretty-compact/-/json-stringify-pretty-compact-1.3.0.tgz", + "integrity": "sha512-K+whdCBlVjzx8zCK2ZUohGJb5bUOxRpiEAfD1NCUgH0mApdDZD9c7VHXJVzWlt3wfV1X4OFyCRmTqbPd6U87lQ==" + }, "@ampproject/remapping": { "version": "2.2.0", "dev": true, @@ -20392,6 +20514,14 @@ "@jridgewell/sourcemap-codec": "1.4.14" } }, + "@mapbox/geojson-area": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@mapbox/geojson-area/-/geojson-area-0.2.2.tgz", + "integrity": "sha512-bBqqFn1kIbLBfn7Yq1PzzwVkPYQr9lVUeT8Dhd0NL5n76PBuXzOcuLV7GOSbEB1ia8qWxH4COCvFpziEu/yReA==", + "requires": { + "wgs84": "0.0.0" + } + }, "@mapbox/geojson-rewind": { "version": "0.5.2", "requires": { @@ -20462,6 +20592,27 @@ "version": "2.8.2", "dev": true }, + "@rapideditor/country-coder": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/@rapideditor/country-coder/-/country-coder-5.2.2.tgz", + "integrity": "sha512-xGkI+wHX694sFcKKVdy20/uNeHuIiJACnke2vp7LzX22PRPJJv+pcn1OU5nb1urnad275EMfJQR33ayi2hWZOQ==", + "requires": { + "which-polygon": "^2.2.1" + } + }, + "@rapideditor/location-conflation": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@rapideditor/location-conflation/-/location-conflation-1.3.0.tgz", + "integrity": "sha512-h4FAeKNxuqmO7OGTkXN5CS8gbP+/sCyrQdgSMhtjGYwnGaNQoEIypQNRYAqQJxJjgNISvVvunRTvSOOJfSWxSw==", + "requires": { + "@aitodotai/json-stringify-pretty-compact": "^1.3.0", + "@mapbox/geojson-area": "^0.2.2", + "@rapideditor/country-coder": "^5.2.1", + "circle-to-polygon": "^2.2.0", + "geojson-precision": "^1.0.0", + "polyclip-ts": "~0.16.3" + } + }, "@rdfjs/types": { "version": "1.1.0", "requires": { @@ -22482,6 +22633,11 @@ "ci-info": { "version": "3.7.1" }, + "circle-to-polygon": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/circle-to-polygon/-/circle-to-polygon-2.2.0.tgz", + "integrity": "sha512-yC9/bw6P0YmV2/oxm4DLrSgrzHhbz9H+vgUScmSFN5KilR/KFGVRbUi9a0mIYPsXK44HvnysVVi/iIysRJVvNw==" + }, "cli-truncate": { "version": "3.1.0", "requires": { @@ -22992,6 +23148,11 @@ "minimist": "^1.2.6" } }, + "diacritics": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/diacritics/-/diacritics-1.3.0.tgz", + "integrity": "sha512-wlwEkqcsaxvPJML+rDh/2iS824jbREk6DUMUKkEaSlxdYHeS43cClJtsWglvw2RfeXGm6ohKDqsXteJ5sP5enA==" + }, "didyoumean": { "version": "1.2.2" }, @@ -23745,6 +23906,21 @@ "optimist": "~0.3.5" } }, + "geojson-precision": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/geojson-precision/-/geojson-precision-1.0.0.tgz", + "integrity": "sha512-lXK9eCxhZQnZSMtz+xcy16H6In9oGbtYg0A92elUX13QtdrIsngrU2w9ZjkKB2GY1TDIJJ22elzcgRAEmyFoXQ==", + "requires": { + "commander": "2.19.0" + }, + "dependencies": { + "commander": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", + "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==" + } + } + }, "geojson-random": { "version": "0.2.2" }, @@ -24645,6 +24821,11 @@ "lilconfig": { "version": "2.0.6" }, + "lineclip": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/lineclip/-/lineclip-1.1.5.tgz", + "integrity": "sha512-KlA/wRSjpKl7tS9iRUdlG72oQ7qZ1IlVbVgHwoO10TBR/4gQ86uhKow6nlzMAJJhjCWKto8OeoAzzIzKSmN25A==" + }, "local-pkg": { "version": "0.4.3" }, @@ -25029,6 +25210,16 @@ } } }, + "name-suggestion-index": { + "version": "6.0.20240422", + "resolved": "https://registry.npmjs.org/name-suggestion-index/-/name-suggestion-index-6.0.20240422.tgz", + "integrity": "sha512-NP0QJfCGKkpduNruS6dM8U7uA//EjyH4Kw+lavUWuQxOl0QxhFVF9caMh3UPvDZgqdMOMpyi/z195rjieAAPyQ==", + "requires": { + "diacritics": "^1.3.0", + "run-s": "^0.0.0", + "which-polygon": "^2.2.1" + } + }, "nano-markdown": { "version": "1.2.2" }, @@ -25397,6 +25588,15 @@ "point-in-polygon": { "version": "1.1.0" }, + "polyclip-ts": { + "version": "0.16.5", + "resolved": "https://registry.npmjs.org/polyclip-ts/-/polyclip-ts-0.16.5.tgz", + "integrity": "sha512-ZchnG0zGZReHgEo3EYzEUi6UmfQFFzNnj6AFU+gBm+IJJ4qG9gL4CwjtCV6oi/PittUPpJLiLJxcn/AgrCBO+g==", + "requires": { + "bignumber.js": "^9.1.0", + "splaytree-ts": "^1.0.1" + } + }, "polygon-clipping": { "version": "0.15.3", "requires": { @@ -26344,6 +26544,11 @@ "queue-microtask": "^1.2.2" } }, + "run-s": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/run-s/-/run-s-0.0.0.tgz", + "integrity": "sha512-KPDNauF2Tpnm3nG0+0LJuJxwBFrhAdthpM8bVdDvjWQA7pWP7QoNwEl1+dJ7WVJj81AQP/i6kl6JUmAk7tg3Og==" + }, "rw": { "version": "1.3.3" }, @@ -26752,6 +26957,11 @@ "splaytree": { "version": "3.1.1" }, + "splaytree-ts": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/splaytree-ts/-/splaytree-ts-1.0.1.tgz", + "integrity": "sha512-B+VzCm33/KEchi/fzT6/3NRHm8k5+Kf37SBQO3meHHS/tK2xBnIm4ZvusQ1wUpHgKMCCqEWgXnwFXAa1nD289g==" + }, "split-string": { "version": "3.1.0", "requires": { @@ -28027,6 +28237,15 @@ "isexe": "^2.0.0" } }, + "which-polygon": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/which-polygon/-/which-polygon-2.2.1.tgz", + "integrity": "sha512-RlpWbqz12OMT0r2lEHk7IUPXz0hb1L/ZZsGushB2P2qxuBu1aq1+bcTfsLtfoRBYHsED6ruBMiwFaidvXZfQVw==", + "requires": { + "lineclip": "^1.1.5", + "rbush": "^2.0.1" + } + }, "which-typed-array": { "version": "1.1.9", "dev": true, diff --git a/package.json b/package.json index db471b508..f60f616b2 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,6 @@ "optimize-images-png": "cd assets/generated/ && find -name '*.png' -exec optipng '{}' \\; && echo 'PNGs are optimized'", "optimize-images-jpg": "cd assets/ && find . -regextype sed -regex \".*/.*.\\(jpg\\|JPG\\|JPEG\\|jpeg\\)\" -exec jpegoptim '{}' \\; && echo 'JPGs are optimized'", "optimize-images-scaledown-jpg": "cd assets/ && find . -regextype sed -regex \".*/.*.\\(jpg\\|JPG\\|JPEG\\|jpeg\\)\" -exec mogrify -resize 640x640\\> '{}' \\; && echo 'JPGs are optimized'", - "generate:stats": "vite-node scripts/GenerateSeries.ts", "reset:layeroverview": "npm run prep:layeroverview && npm run generate:layeroverview && npm run refresh:layeroverview", "prep:layeroverview": "mkdir -p ./src/assets/generated/layers; echo {\\\"themes\\\":[]} > ./src/assets/generated/known_themes.json && echo {\\\"layers\\\": []} > ./src/assets/generated/known_layers.json && rm -f ./src/assets/generated/layers/*.json && rm -f ./src/assets/generated/themes/*.json && cp ./assets/layers/usersettings/usersettings.json ./src/assets/generated/layers/usersettings.json && echo '{}' > ./src/assets/generated/layers/favourite.json && echo '{}' > ./src/assets/generated/layers/summary.json", @@ -131,6 +130,7 @@ "@comunica/core": "^3.0.1", "@comunica/query-sparql": "^3.0.1", "@comunica/query-sparql-link-traversal": "^0.3.0", + "@rapideditor/location-conflation": "^1.3.0", "@rgossiaux/svelte-headlessui": "^1.0.2", "@rgossiaux/svelte-heroicons": "^0.1.2", "@rollup/plugin-typescript": "^11.0.0", @@ -172,6 +172,7 @@ "mangrove-reviews-typescript": "^1.1.0", "maplibre-gl": "^4.1.1", "monaco-editor": "^0.46.0", + "name-suggestion-index": "^6.0.20240422", "nano-markdown": "^1.2.2", "opening_hours": "^3.6.0", "osm-auth": "^2.2.0", diff --git a/src/UI/InputElement/Helpers/NameSuggestionIndexInput.svelte b/src/UI/InputElement/Helpers/NameSuggestionIndexInput.svelte new file mode 100644 index 000000000..d05b352f7 --- /dev/null +++ b/src/UI/InputElement/Helpers/NameSuggestionIndexInput.svelte @@ -0,0 +1,103 @@ + + +
+ +
+ {#each filteredItems as item} +
{ + value.setData(item.tags[tag]) + }} + > + {item.displayName} +
+ {/each} +
+
diff --git a/src/UI/InputElement/InputHelper.svelte b/src/UI/InputElement/InputHelper.svelte index 78cd48350..e7676dde8 100644 --- a/src/UI/InputElement/InputHelper.svelte +++ b/src/UI/InputElement/InputHelper.svelte @@ -19,6 +19,7 @@ import OpeningHoursInput from "./Helpers/OpeningHoursInput.svelte" import SlopeInput from "./Helpers/SlopeInput.svelte" import type { SpecialVisualizationState } from "../SpecialVisualization" + import NameSuggestionIndexInput from "./Helpers/NameSuggestionIndexInput.svelte" export let type: ValidatorType export let value: UIEventSource @@ -50,4 +51,6 @@ {:else if type === "wikidata"} InputHelpers.constructWikidataHelper(value, properties)} /> +{:else if type === "nsi"} + {/if} diff --git a/src/UI/InputElement/Validators.ts b/src/UI/InputElement/Validators.ts index 555443b05..d2b674a98 100644 --- a/src/UI/InputElement/Validators.ts +++ b/src/UI/InputElement/Validators.ts @@ -28,6 +28,7 @@ import TagValidator from "./Validators/TagValidator" import IdValidator from "./Validators/IdValidator" import SlopeValidator from "./Validators/SlopeValidator" import VeloparkValidator from "./Validators/VeloparkValidator" +import NameSuggestionIndexValidator from "./Validators/NameSuggestionIndexValidator" export type ValidatorType = (typeof Validators.availableTypes)[number] @@ -60,6 +61,7 @@ export default class Validators { "id", "slope", "velopark", + "nsi", ] as const public static readonly AllValidators: ReadonlyArray = [ @@ -89,6 +91,7 @@ export default class Validators { new IdValidator(), new SlopeValidator(), new VeloparkValidator(), + new NameSuggestionIndexValidator(), ] private static _byType = Validators._byTypeConstructor() diff --git a/src/UI/InputElement/Validators/NameSuggestionIndexValidator.ts b/src/UI/InputElement/Validators/NameSuggestionIndexValidator.ts new file mode 100644 index 000000000..2cfebde86 --- /dev/null +++ b/src/UI/InputElement/Validators/NameSuggestionIndexValidator.ts @@ -0,0 +1,37 @@ +import Title from "../../Base/Title" +import Combine from "../../Base/Combine" +import { Validator } from "../Validator" +import Table from "../../Base/Table" + +export default class NameSuggestionIndexValidator extends Validator { + constructor() { + super( + "nsi", + new Combine([ + "Gives a list of possible suggestions for a brand or operator tag.", + new Title("Helper arguments"), + new Table( + ["name", "doc"], + [ + [ + "options", + new Combine([ + "A JSON-object of type `{ main: string, key: string }`. ", + new Table( + ["subarg", "doc"], + [ + [ + "main", + "The main tag to give suggestions for, e.g. `amenity=restaurant`.", + ], + ["key", "The key to give suggestions for, e.g. `brand`."], + ] + ), + ]), + ], + ] + ), + ]) + ) + } +}