Robert Schäfer 3c1c2d4dcb refactor(backend): put config into context
This is a side quest of #8558. The motivation is to be able to do dependency injection in the tests without overwriting global data. I saw the first merge conflict from #8551 and voila: It seems @Mogge could have used this already.

refactor: follow @Mogge's review

See: https://github.com/Ocelot-Social-Community/Ocelot-Social/pull/8603#pullrequestreview-2880714796

refactor: better test helper methods

wip: continue refactoring

wip: continue posts

continue

wip: continue groups

continue registration

registration

continue messages

continue observeposts

continue categories

continue posts in groups

continue invite codes

refactor: continue notificationsMiddleware

continue statistics spec

followed-users

online-status

mentions-in-groups

posts-in-groups

email spec

finish all tests

improve typescript

missed one test

remove one more reference of CONFIG

eliminate one more global import of CONFIG

fix language spec test

fix two more test suites

refactor: completely mock out 3rd part API request

refactor test

fixed user_management spec

fixed more locatoin specs

install types for jsonwebtoken

one more fetchmock

fixed one more suite

fix one more spec

yet another spec

fix spec

delete whitespaces

remove beforeAll that the same as the default

fix merge conflict

fix e2e test

refactor: use single callback function for `context` setup

refactor: display logs from backend during CI

Because why not?

fix seeds

fix login

refactor: one unnecessary naming

refactor: better editor support

refactor: fail early

Interestingly, I've had to destructure `context.user` in order to make
typescript happy. Weird.

refactor: undo changes to workflows - no effect

We're running in `--detached` mode on CI, so I guess we won't be able to
see the logs anyways.
2025-06-11 21:10:35 +08:00

662 lines
21 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

export const hamburg = {
type: 'FeatureCollection',
query: ['hamburg', 'germany'],
features: [
{
id: 'place.9274',
type: 'Feature',
place_type: ['region', 'place'],
relevance: 1,
properties: {
mapbox_id: 'dXJuOm1ieHBsYzpKRG8',
wikidata: 'Q1055',
short_code: 'DE-HH',
},
text_en: 'Hamburg',
language_en: 'en',
place_name_en: 'Hamburg, Germany',
text: 'Hamburg',
language: 'en',
place_name: 'Hamburg, Germany',
text_de: 'Hamburg',
language_de: 'de',
place_name_de: 'Hamburg, Deutschland',
text_fr: 'Hambourg',
language_fr: 'fr',
place_name_fr: 'Hambourg, Allemagne',
text_nl: 'Hamburg',
language_nl: 'nl',
place_name_nl: 'Hamburg, Duitsland',
text_it: 'Amburgo',
language_it: 'it',
place_name_it: 'Amburgo, Germania',
text_es: 'Hamburgo',
language_es: 'es',
place_name_es: 'Hamburgo, Alemania',
text_pt: 'Hamburgo',
language_pt: 'pt',
place_name_pt: 'Hamburgo, Alemanha',
text_pl: 'Hamburg',
language_pl: 'pl',
place_name_pl: 'Hamburg, Niemcy',
text_ru: 'Гамбург',
language_ru: 'ru',
place_name_ru: 'Гамбург, Германия',
bbox: [8.345049, 53.395085, 10.325247, 54.010088],
center: [10.000654, 53.550341],
geometry: {
type: 'Point',
coordinates: [10.000654, 53.550341],
},
context: [
{
id: 'country.8762',
mapbox_id: 'dXJuOm1ieHBsYzpJam8',
wikidata: 'Q183',
short_code: 'de',
text_en: 'Germany',
language_en: 'en',
text: 'Germany',
language: 'en',
text_de: 'Deutschland',
language_de: 'de',
text_fr: 'Allemagne',
language_fr: 'fr',
text_nl: 'Duitsland',
language_nl: 'nl',
text_it: 'Germania',
language_it: 'it',
text_es: 'Alemania',
language_es: 'es',
text_pt: 'Alemanha',
language_pt: 'pt',
text_pl: 'Niemcy',
language_pl: 'pl',
text_ru: 'Германия',
language_ru: 'ru',
},
],
},
{
id: 'address.2262168808051568',
type: 'Feature',
place_type: ['address'],
relevance: 1,
properties: {
accuracy: 'street',
mapbox_id: 'dXJuOm1ieGFkci1zdHI6MGM5NzRmMmYtNTA0Yi00MDk1LWJjNGItNTA3NmRhY2Y4YzQ5',
},
text_en: 'Hamburg',
place_name_en: 'Hamburg, 38889 Oberharz am Brocken, Germany',
text: 'Hamburg',
place_name: 'Hamburg, 38889 Oberharz am Brocken, Germany',
text_de: 'Hamburg',
place_name_de: 'Hamburg, 38889 Oberharz am Brocken, Deutschland',
text_fr: 'Hamburg',
place_name_fr: 'Hamburg, 38889 Oberharz am Brocken, Allemagne',
text_nl: 'Hamburg',
place_name_nl: 'Hamburg, 38889 Oberharz am Brocken, Duitsland',
text_it: 'Hamburg',
place_name_it: 'Hamburg, 38889 Oberharz am Brocken, Germania',
text_es: 'Hamburg',
place_name_es: 'Hamburg, 38889 Oberharz am Brocken, Alemania',
text_pt: 'Hamburg',
place_name_pt: 'Hamburg, 38889 Oberharz am Brocken, Alemanha',
text_pl: 'Hamburg',
place_name_pl: 'Hamburg, 38889 Oberharz am Brocken, Niemcy',
text_ru: 'Hamburg',
place_name_ru: 'Hamburg, 38889 Оберхарц-ам-Броккен, Германия',
center: [10.872935, 51.752737],
geometry: {
type: 'Point',
coordinates: [10.872935, 51.752737],
},
context: [
{
id: 'postcode.23424570',
mapbox_id: 'dXJuOm1ieHBsYzpBV1Z1T2c',
text_en: '38889',
text: '38889',
text_de: '38889',
text_fr: '38889',
text_nl: '38889',
text_it: '38889',
text_es: '38889',
text_pt: '38889',
text_pl: '38889',
text_ru: '38889',
},
{
id: 'locality.232909370',
mapbox_id: 'dXJuOm1ieHBsYzpEZUhxT2c',
wikidata: 'Q1982027',
text_en: 'Neuwerk',
language_en: 'en',
text: 'Neuwerk',
language: 'en',
text_de: 'Neuwerk',
language_de: 'de',
text_fr: 'Neuwerk',
language_fr: 'fr',
text_nl: 'Neuwerk',
language_nl: 'nl',
text_it: 'Neuwerk',
language_it: 'it',
text_es: 'Neuwerk',
language_es: 'es',
text_pt: 'Neuwerk',
language_pt: 'pt',
text_pl: 'Neuwerk',
language_pl: 'pl',
text_ru: 'Neuwerk',
},
{
id: 'place.57780282',
mapbox_id: 'dXJuOm1ieHBsYzpBM0dvT2c',
wikidata: 'Q703001',
text_en: 'Oberharz am Brocken',
language_en: 'en',
text: 'Oberharz am Brocken',
language: 'en',
text_de: 'Oberharz am Brocken',
language_de: 'de',
text_fr: 'Oberharz am Brocken',
language_fr: 'fr',
text_nl: 'Oberharz am Brocken',
language_nl: 'nl',
text_it: 'Oberharz am Brocken',
language_it: 'it',
text_es: 'Oberharz am Brocken',
language_es: 'es',
text_pt: 'Oberharz am Brocken',
language_pt: 'pt',
text_pl: 'Oberharz am Brocken',
language_pl: 'pl',
text_ru: 'Оберхарц-ам-Броккен',
language_ru: 'ru',
},
{
id: 'district.755258',
mapbox_id: 'dXJuOm1ieHBsYzpDNFk2',
wikidata: 'Q6087',
text_en: 'Harz District',
language_en: 'en',
text: 'Harz District',
language: 'en',
text_de: 'Kreis Harz',
language_de: 'de',
text_fr: 'Arrondissement de Harz',
language_fr: 'fr',
text_nl: 'Landkreis Harz',
language_nl: 'nl',
text_it: 'circondario dello Harz',
language_it: 'it',
text_es: 'Distrito de Harz',
language_es: 'es',
text_pt: 'Distrito de Harz',
language_pt: 'es',
text_pl: 'Landkreis Harz',
language_pl: 'pl',
text_ru: 'Гарц',
language_ru: 'ru',
},
{
id: 'region.91194',
mapbox_id: 'dXJuOm1ieHBsYzpBV1E2',
wikidata: 'Q1206',
short_code: 'DE-ST',
text_en: 'Saxony-Anhalt',
language_en: 'en',
text: 'Saxony-Anhalt',
language: 'en',
text_de: 'Sachsen-Anhalt',
language_de: 'de',
text_fr: 'Saxe-Anhalt',
language_fr: 'fr',
text_nl: 'Saksen-Anhalt',
language_nl: 'nl',
text_it: 'Sassonia-Anhalt',
language_it: 'it',
text_es: 'Sajonia-Anhalt',
language_es: 'es',
text_pt: 'Saxónia-Anhalt',
language_pt: 'pt',
text_pl: 'Saksonia-Anhalt',
language_pl: 'pl',
text_ru: 'Саксония-Анхальт',
language_ru: 'ru',
},
{
id: 'country.8762',
mapbox_id: 'dXJuOm1ieHBsYzpJam8',
wikidata: 'Q183',
short_code: 'de',
text_en: 'Germany',
language_en: 'en',
text: 'Germany',
language: 'en',
text_de: 'Deutschland',
language_de: 'de',
text_fr: 'Allemagne',
language_fr: 'fr',
text_nl: 'Duitsland',
language_nl: 'nl',
text_it: 'Germania',
language_it: 'it',
text_es: 'Alemania',
language_es: 'es',
text_pt: 'Alemanha',
language_pt: 'pt',
text_pl: 'Niemcy',
language_pl: 'pl',
text_ru: 'Германия',
language_ru: 'ru',
},
],
},
{
id: 'address.8952604554248206',
type: 'Feature',
place_type: ['address'],
relevance: 1,
properties: {
accuracy: 'street',
mapbox_id: 'dXJuOm1ieGFkci1zdHI6NGNmMGExNGUtMjExMy00Yzk1LTllYjQtYTllOTRmNDIxZmEz',
},
text_en: 'Hamburg',
place_name_en: 'Hamburg, 54608 Bleialf, Germany',
text: 'Hamburg',
place_name: 'Hamburg, 54608 Bleialf, Germany',
text_de: 'Hamburg',
place_name_de: 'Hamburg, 54608 Bleialf, Deutschland',
text_fr: 'Hamburg',
place_name_fr: 'Hamburg, 54608 Bleialf, Allemagne',
text_nl: 'Hamburg',
place_name_nl: 'Hamburg, 54608 Bleialf, Duitsland',
text_it: 'Hamburg',
place_name_it: 'Hamburg, 54608 Bleialf, Germania',
text_es: 'Hamburg',
place_name_es: 'Hamburg, 54608 Bleialf, Alemania',
text_pt: 'Hamburg',
place_name_pt: 'Hamburg, 54608 Bleialf, Alemanha',
text_pl: 'Hamburg',
place_name_pl: 'Hamburg, 54608 Bleialf, Niemcy',
text_ru: 'Hamburg',
place_name_ru: 'Hamburg, 54608 Блайальф, Германия',
center: [6.286919, 50.231471],
geometry: {
type: 'Point',
coordinates: [6.286919, 50.231471],
},
context: [
{
id: 'postcode.30887482',
mapbox_id: 'dXJuOm1ieHBsYzpBZGRPT2c',
text_en: '54608',
text: '54608',
text_de: '54608',
text_fr: '54608',
text_nl: '54608',
text_it: '54608',
text_es: '54608',
text_pt: '54608',
text_pl: '54608',
text_ru: '54608',
},
{
id: 'place.8742970',
mapbox_id: 'dXJuOm1ieHBsYzpoV2c2',
wikidata: 'Q553361',
text_en: 'Bleialf',
language_en: 'en',
text: 'Bleialf',
language: 'en',
text_de: 'Bleialf',
language_de: 'de',
text_fr: 'Bleialf',
language_fr: 'fr',
text_nl: 'Bleialf',
language_nl: 'nl',
text_it: 'Bleialf',
language_it: 'it',
text_es: 'Bleialf',
language_es: 'es',
text_pt: 'Bleialf',
language_pt: 'pt',
text_pl: 'Bleialf',
language_pl: 'pl',
text_ru: 'Блайальф',
language_ru: 'ru',
},
{
id: 'district.2434618',
mapbox_id: 'dXJuOm1ieHBsYzpKU1k2',
wikidata: 'Q8580',
text_en: 'Eifelkreis Bitburg-Prüm',
language_en: 'en',
text: 'Eifelkreis Bitburg-Prüm',
language: 'en',
text_de: 'Eifelkreis Bitburg-Prüm',
language_de: 'de',
text_fr: 'Eifel-Bitburg-Prüm',
language_fr: 'fr',
text_nl: 'Eifelkreis Bitburg-Prüm',
language_nl: 'nl',
text_it: 'Eifelkreis Bitburg-Prüm',
language_it: 'it',
text_es: 'Eifel-Bitburg-Prüm',
language_es: 'es',
text_pt: 'Bitburg-Prüm',
language_pt: 'pt',
text_pl: 'Eifelkreis Bitburg-Prüm',
language_pl: 'pl',
text_ru: 'Айфель-Битбург-Прюм',
language_ru: 'ru',
},
{
id: 'region.58426',
mapbox_id: 'dXJuOm1ieHBsYzo1RG8',
wikidata: 'Q1200',
short_code: 'DE-RP',
text_en: 'Rhineland-Palatinate',
language_en: 'en',
text: 'Rhineland-Palatinate',
language: 'en',
text_de: 'Rheinland-Pfalz',
language_de: 'de',
text_fr: 'Rhénanie-Palatinat',
language_fr: 'fr',
text_nl: 'Rijnland-Palts',
language_nl: 'nl',
text_it: 'Renania-Palatinato',
language_it: 'it',
text_es: 'Renania-Palatinado',
language_es: 'es',
text_pt: 'Renânia-Palatinado',
language_pt: 'pt',
text_pl: 'Nadrenia-Palatynat',
language_pl: 'pl',
text_ru: 'Рейнланд-Пфальц',
language_ru: 'ru',
},
{
id: 'country.8762',
mapbox_id: 'dXJuOm1ieHBsYzpJam8',
wikidata: 'Q183',
short_code: 'de',
text_en: 'Germany',
language_en: 'en',
text: 'Germany',
language: 'en',
text_de: 'Deutschland',
language_de: 'de',
text_fr: 'Allemagne',
language_fr: 'fr',
text_nl: 'Duitsland',
language_nl: 'nl',
text_it: 'Germania',
language_it: 'it',
text_es: 'Alemania',
language_es: 'es',
text_pt: 'Alemanha',
language_pt: 'pt',
text_pl: 'Niemcy',
language_pl: 'pl',
text_ru: 'Германия',
language_ru: 'ru',
},
],
},
{
id: 'place.35727418',
type: 'Feature',
place_type: ['place'],
relevance: 0.964286,
properties: {
mapbox_id: 'dXJuOm1ieHBsYzpBaUVvT2c',
wikidata: 'Q7040',
},
text_en: 'Homburg',
language_en: 'en',
place_name_en: 'Homburg, Saarpfalz-Kreis, Saarland, Germany',
text: 'Homburg',
language: 'en',
place_name: 'Homburg, Saarpfalz-Kreis, Saarland, Germany',
text_de: 'Homburg',
language_de: 'de',
place_name_de: 'Homburg, Saarpfalz-Kreis, Saarland, Deutschland',
text_fr: 'Hombourg',
language_fr: 'fr',
place_name_fr: 'Hombourg, circondario del Saarpfalz, Sarre, Allemagne',
text_nl: 'Homburg',
language_nl: 'nl',
place_name_nl: 'Homburg, Saarpfalz-Kreis, Saarland, Duitsland',
text_it: 'Homburg',
language_it: 'it',
place_name_it: 'Homburg, circondario del Saarpfalz, Saarland, Germania',
text_es: 'Homburg',
language_es: 'es',
place_name_es: 'Homburg, Saarpfalz-Kreis, Sarre, Alemania',
text_pt: 'Homburg',
language_pt: 'pt',
place_name_pt: 'Homburg, circondario del Saarpfalz, Sarre, Alemanha',
text_pl: 'Homburg',
language_pl: 'pl',
place_name_pl: 'Homburg, Powiat Saarpfalz, Saara, Niemcy',
text_ru: 'Хомбург',
language_ru: 'ru',
place_name_ru: 'Хомбург, Саарпфальц, Саар, Германия',
bbox: [7.274109, 49.247602, 7.404584, 49.386381],
center: [7.340504, 49.321426],
geometry: {
type: 'Point',
coordinates: [7.340504, 49.321426],
},
context: [
{
id: 'district.2704954',
mapbox_id: 'dXJuOm1ieHBsYzpLVVk2',
wikidata: 'Q6793',
text_en: 'Saarpfalz-Kreis',
language_en: 'de',
text: 'Saarpfalz-Kreis',
language: 'de',
text_de: 'Saarpfalz-Kreis',
language_de: 'de',
text_fr: 'circondario del Saarpfalz',
language_fr: 'it',
text_nl: 'Saarpfalz-Kreis',
text_it: 'circondario del Saarpfalz',
language_it: 'it',
text_es: 'Saarpfalz-Kreis',
text_pt: 'circondario del Saarpfalz',
language_pt: 'it',
text_pl: 'Powiat Saarpfalz',
language_pl: 'pl',
text_ru: 'Саарпфальц',
language_ru: 'ru',
},
{
id: 'region.66618',
mapbox_id: 'dXJuOm1ieHBsYzpBUVE2',
wikidata: 'Q1201',
short_code: 'DE-SL',
text_en: 'Saarland',
language_en: 'en',
text: 'Saarland',
language: 'en',
text_de: 'Saarland',
language_de: 'de',
text_fr: 'Sarre',
language_fr: 'fr',
text_nl: 'Saarland',
language_nl: 'nl',
text_it: 'Saarland',
language_it: 'it',
text_es: 'Sarre',
language_es: 'es',
text_pt: 'Sarre',
language_pt: 'pt',
text_pl: 'Saara',
language_pl: 'pl',
text_ru: 'Саар',
language_ru: 'ru',
},
{
id: 'country.8762',
mapbox_id: 'dXJuOm1ieHBsYzpJam8',
wikidata: 'Q183',
short_code: 'de',
text_en: 'Germany',
language_en: 'en',
text: 'Germany',
language: 'en',
text_de: 'Deutschland',
language_de: 'de',
text_fr: 'Allemagne',
language_fr: 'fr',
text_nl: 'Duitsland',
language_nl: 'nl',
text_it: 'Germania',
language_it: 'it',
text_es: 'Alemania',
language_es: 'es',
text_pt: 'Alemanha',
language_pt: 'pt',
text_pl: 'Niemcy',
language_pl: 'pl',
text_ru: 'Германия',
language_ru: 'ru',
},
],
},
{
id: 'place.30623802',
type: 'Feature',
place_type: ['place'],
relevance: 0.964286,
properties: {
mapbox_id: 'dXJuOm1ieHBsYzpBZE5JT2c',
wikidata: 'Q503226',
},
text_en: 'Harburg',
language_en: 'en',
place_name_en: 'Harburg, arrondissement de Danube-Ries, Bavaria, Germany',
text: 'Harburg',
language: 'en',
place_name: 'Harburg, arrondissement de Danube-Ries, Bavaria, Germany',
text_de: 'Harburg',
language_de: 'de',
place_name_de: 'Harburg, Kreis Donau-Ries, Bayern, Deutschland',
text_fr: 'Harbourg',
language_fr: 'fr',
place_name_fr: 'Harbourg, arrondissement de Danube-Ries, Bavière, Allemagne',
text_nl: 'Harburg',
language_nl: 'nl',
place_name_nl: 'Harburg, arrondissement de Danube-Ries, Beieren, Duitsland',
text_it: 'Harburg',
language_it: 'it',
place_name_it: 'Harburg, Circondario del Danubio-Ries, Baviera, Germania',
text_es: 'Harburg',
language_es: 'es',
place_name_es: 'Harburg, arrondissement de Danube-Ries, Baviera, Alemania',
text_pt: 'Harburg',
language_pt: 'pt',
place_name_pt: 'Harburg, Circondario del Danubio-Ries, Baviera, Alemanha',
text_pl: 'Harburg',
language_pl: 'pl',
place_name_pl: 'Harburg, Landkreis Donau-Ries, Bawaria, Niemcy',
text_ru: 'Харбург',
language_ru: 'ru',
place_name_ru: 'Харбург, Донау-Рис, Бавария, Германия',
bbox: [10.617754, 48.726549, 10.770464, 48.83036],
center: [10.688789, 48.787212],
geometry: {
type: 'Point',
coordinates: [10.688789, 48.787212],
},
context: [
{
id: 'district.419386',
mapbox_id: 'dXJuOm1ieHBsYzpCbVk2',
wikidata: 'Q10418',
text_en: 'arrondissement de Danube-Ries',
language_en: 'fr',
text: 'arrondissement de Danube-Ries',
language: 'fr',
text_de: 'Kreis Donau-Ries',
language_de: 'de',
text_fr: 'arrondissement de Danube-Ries',
language_fr: 'fr',
text_nl: 'arrondissement de Danube-Ries',
language_nl: 'fr',
text_it: 'Circondario del Danubio-Ries',
language_it: 'it',
text_es: 'arrondissement de Danube-Ries',
language_es: 'fr',
text_pt: 'Circondario del Danubio-Ries',
language_pt: 'it',
text_pl: 'Landkreis Donau-Ries',
language_pl: 'pl',
text_ru: 'Донау-Рис',
language_ru: 'ru',
},
{
id: 'region.123962',
mapbox_id: 'dXJuOm1ieHBsYzpBZVE2',
wikidata: 'Q980',
short_code: 'DE-BY',
text_en: 'Bavaria',
language_en: 'en',
text: 'Bavaria',
language: 'en',
text_de: 'Bayern',
language_de: 'de',
text_fr: 'Bavière',
language_fr: 'fr',
text_nl: 'Beieren',
language_nl: 'nl',
text_it: 'Baviera',
language_it: 'it',
text_es: 'Baviera',
language_es: 'es',
text_pt: 'Baviera',
language_pt: 'pt',
text_pl: 'Bawaria',
language_pl: 'pl',
text_ru: 'Бавария',
language_ru: 'ru',
},
{
id: 'country.8762',
mapbox_id: 'dXJuOm1ieHBsYzpJam8',
wikidata: 'Q183',
short_code: 'de',
text_en: 'Germany',
language_en: 'en',
text: 'Germany',
language: 'en',
text_de: 'Deutschland',
language_de: 'de',
text_fr: 'Allemagne',
language_fr: 'fr',
text_nl: 'Duitsland',
language_nl: 'nl',
text_it: 'Germania',
language_it: 'it',
text_es: 'Alemania',
language_es: 'es',
text_pt: 'Alemanha',
language_pt: 'pt',
text_pl: 'Niemcy',
language_pl: 'pl',
text_ru: 'Германия',
language_ru: 'ru',
},
],
},
],
attribution:
'NOTICE: © 2025 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service (https://www.mapbox.com/about/maps/). This response and the information it contains may not be retained.',
}