From 2d718889280dfc8ca362313332c900ffe5b64d1d Mon Sep 17 00:00:00 2001 From: Daniele Guido Date: Fri, 9 Aug 2024 15:31:18 +0200 Subject: [PATCH] add scripts and new endpoints --- docs/urls.json | 60 ++- ...c9594a5b0b58c234e86a28eb9570e75a60de4.json | 4 +- ...82155b08e094217d0b4c288ceafc9335024bd.json | 54 ++- ...06eb397d542efaa28a7f89ceb914fb95c051b.json | 2 +- ...5675887579d25731a46106ba204937e2d9ef1.json | 176 +++++++- public/api/story/level-01-journeys/index.json | 4 +- .../story/note-01-entering-the-war/index.json | 6 +- ...2682a85e719c6b10cdd245a816038d72640d7.json | 82 ++++ public/api/story/st-joseph-clinic/index.json | 92 ++++- .../theme-01-vivre-sous-lannexion/index.json | 65 ++- .../theme-02-reagir-a-lannexion/index.json | 37 +- ...72afa922e6244062764c3390dd49ff8af6ae5.json | 67 +++ scripts/package-lock.json | 386 ++++++++++++++++++ scripts/package.json | 11 + scripts/prefetch.js | 149 +++++++ scripts/urls.json | 80 ++++ 16 files changed, 1233 insertions(+), 42 deletions(-) create mode 100644 public/api/story/note-05-theme-02/2f176b99c2924fc4acac5f511532682a85e719c6b10cdd245a816038d72640d7.json create mode 100644 public/api/tag/c0c2b8699dc9634674990556fc872afa922e6244062764c3390dd49ff8af6ae5.json create mode 100644 scripts/package-lock.json create mode 100644 scripts/package.json create mode 100644 scripts/prefetch.js create mode 100644 scripts/urls.json diff --git a/docs/urls.json b/docs/urls.json index 9888133..06a53a6 100644 --- a/docs/urls.json +++ b/docs/urls.json @@ -1,58 +1,82 @@ [ { "description": "[Homepage] get the contents (title and abstract) for the Home page", - "url": "/api/story/home" + "url": "/api/story/home", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }, { "description": "[Menu] get the list of stories that composes the Menu, basically all stories tagged with `menu` tag. The `slug` property of each story is prefixed with `level-` followed by a number, this way the list is easily ordered. Every story has a `slug` property that is used as identifier", - "url": "/api/story/?filters={%22tags__slug%22:%22menu%22}&order_by=slug&limit=10" + "url": "/api/story/?filters={\"tags__slug\":\"menu\"}&order_by=slug&limit=10", + "hash": "d159095c9a67b4a002ed8a5c522df27440e74f0f58af01bd93b7d38de7ad7bfa" }, { "description": "[level 1] Content of the object of type Story", - "url": "/api/story/level-01-journeys" + "url": "/api/story/level-01-journeys", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }, { "description": "[level 1] get all 'capsules' linked to the story with slug `level-01-journeys` that contains a geographic location", - "url": "/api/story/?filters={%22mentioned_to__slug%22%3A%22level-01-journeys%22,%22covers__data__type%22:%22place%22}&limit=100" + "url": "/api/story/?filters={\"mentioned_to__slug\"%3A\"level-01-journeys\",\"covers__data__type\":\"place\"}&limit=100", + "hash": "4a75fb8cbf80d23b000166e1dbc06eb397d542efaa28a7f89ceb914fb95c051b" }, { "description": "[Level 1] get all location linked to the video capsule stories mentioned to the story with slug `level-01-journeys`; return the list unsorted", - "url": "/api/document/?filters={%22data__type%22:%22place%22,%22stories__mentioned_to__slug%22:%22level-01-journeys%22}&limit=100" + "url": "/api/document/?filters={\"data__type\":\"place\",\"stories__mentioned_to__slug\":\"level-01-journeys\"}&limit=100", + "hash": "e8f4db59f555a97d2af57daca0bd44b112dec05309cee0474f00eff1e963d031" }, { "description": "[Level 1] get all stories mentioned to `level-01-journeys` (st Joseph Clinic with video cover is one of them)", - "url": "/api/story/?filters={%22mentioned_to__slug%22:%22level-01-journeys%22}&limit=100" + "url": "/api/story/?filters={\"mentioned_to__slug\":\"level-01-journeys\"}&limit=100", + "hash": "95b555c4c61747123a8af05153c5675887579d25731a46106ba204937e2d9ef1" }, { "description": "[Level 1] get all properties and all related documents and related stories to `st-joseph-clinic`", - "url": "/api/story/st-joseph-clinic" + "url": "/api/story/st-joseph-clinic", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }, { - "url": "/api/story?filters={%22tags__slug%22:%22theme%22}", - "description": "Get all stories with the tag 'theme'" + "url": "/api/story?filters={\"tags__slug\":\"theme\"}", + "description": "Get all stories with the tag 'theme'", + "hash": "2c6ef15591a4dd4b95133af345082155b08e094217d0b4c288ceafc9335024bd" }, { - "url": "/api/story?filters={%22mentioned_to__slug%22:%22theme-02-reagir-a-lannexion%22}", - "description": "Get all stories that mention the story with the slug 'theme-02-reagir-a-lannexion'" + "url": "/api/story?filters={\"mentioned_to__slug\":\"theme-02-reagir-a-lannexion\"}", + "description": "Get all stories that mention the story with the slug 'theme-02-reagir-a-lannexion'", + "hash": "064252d4ab3f236e431ebc478d2c9594a5b0b58c234e86a28eb9570e75a60de4" }, { "url": "/api/story/theme-01-vivre-sous-lannexion", - "description": "Get the story with the slug 'theme-01-vivre-sous-lannexion'" + "description": "Get the story with the slug 'theme-01-vivre-sous-lannexion'", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }, { "url": "/api/story/theme-02-reagir-a-lannexion", - "description": "Get the story with the slug 'theme-02-reagir-a-lannexion'" + "description": "Get the story with the slug 'theme-02-reagir-a-lannexion'", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }, { "url": "/api/story/note-01-entering-the-war", - "description": "Get the story with the slug 'note-01-entering-the-war'" + "description": "Get the story with the slug 'note-01-entering-the-war'", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }, { "url": "/api/story/note-02-la-formation-dun-consensus-memoriel", - "description": "Get the story with the slug 'note-02-la-formation-dun-consensus-memoriel'" + "description": "Get the story with the slug 'note-02-la-formation-dun-consensus-memoriel'", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }, { - "url": "/api/document/?q=castle&filters={%22data__type%22:%22place%22}", - "description": "Get all documents/places that contain the word 'castle'" + "url": "/api/document/?q=castle&filters={\"data__type\":\"place\"}", + "description": "Get all documents/places that contain the word 'castle'", + "hash": "b08398cbb947ab8b912734b08249eb8291d56e23b0e82fc91f839b74be6b10f2" + }, + { + "url": "/api/tag/?filters={\"category\":\"keyword\"}", + "description": "Get all available tags", + "hash": "c0c2b8699dc9634674990556fc872afa922e6244062764c3390dd49ff8af6ae5" + }, + { + "url": "/api/story/note-05-theme-02/?parser=yaml", + "description": "get the note content with a reference section", + "hash": "2f176b99c2924fc4acac5f511532682a85e719c6b10cdd245a816038d72640d7" } -] +] \ No newline at end of file diff --git a/public/api/story/064252d4ab3f236e431ebc478d2c9594a5b0b58c234e86a28eb9570e75a60de4.json b/public/api/story/064252d4ab3f236e431ebc478d2c9594a5b0b58c234e86a28eb9570e75a60de4.json index 4b687c2..cdaaceb 100644 --- a/public/api/story/064252d4ab3f236e431ebc478d2c9594a5b0b58c234e86a28eb9570e75a60de4.json +++ b/public/api/story/064252d4ab3f236e431ebc478d2c9594a5b0b58c234e86a28eb9570e75a60de4.json @@ -9,7 +9,7 @@ "short_url": "dGBHZ5G", "date": null, "date_created": "2024-05-17T08:51:14.285141Z", - "date_last_modified": "2024-05-17T14:36:57.250324Z", + "date_last_modified": "2024-08-09T09:07:31.828242Z", "status": "public", "covers": [], "authors": [], @@ -42,7 +42,7 @@ "overlay": "", "backgroundColor": "#ddd" }, - "count_modules": 3 + "count_modules": 4 } }, { diff --git a/public/api/story/2c6ef15591a4dd4b95133af345082155b08e094217d0b4c288ceafc9335024bd.json b/public/api/story/2c6ef15591a4dd4b95133af345082155b08e094217d0b4c288ceafc9335024bd.json index 855e5ed..d6ea8d7 100644 --- a/public/api/story/2c6ef15591a4dd4b95133af345082155b08e094217d0b4c288ceafc9335024bd.json +++ b/public/api/story/2c6ef15591a4dd4b95133af345082155b08e094217d0b4c288ceafc9335024bd.json @@ -1,5 +1,5 @@ { - "count": 3, + "count": 4, "next": null, "previous": null, "results": [ @@ -9,7 +9,7 @@ "short_url": "P3ru6Qp", "date": null, "date_created": "2024-05-17T08:44:34.373782Z", - "date_last_modified": "2024-05-17T14:33:34.431054Z", + "date_last_modified": "2024-08-09T12:39:22.547226Z", "status": "public", "covers": [], "authors": [], @@ -33,6 +33,10 @@ "abstract": { "fr_FR": "" }, + "chapters": [ + 14, + 15 + ], "background": { "bbox": [], "overlay": "", @@ -46,7 +50,7 @@ "short_url": "7XziHSn", "date": null, "date_created": "2024-05-17T08:45:18.263716Z", - "date_last_modified": "2024-05-17T14:33:21.192580Z", + "date_last_modified": "2024-08-09T10:39:16.355032Z", "status": "public", "covers": [], "authors": [], @@ -76,7 +80,8 @@ }, "chapters": [ 4, - 6 + 6, + 13 ], "background": { "bbox": [], @@ -137,6 +142,47 @@ "backgroundColor": "#ddd" } } + }, + { + "id": 16, + "slug": "theme-03-battles-fr", + "short_url": "D2MRxoo", + "date": null, + "date_created": "2024-08-09T12:51:32.152178Z", + "date_last_modified": "2024-08-09T12:51:40.078185Z", + "status": "public", + "covers": [], + "authors": [], + "tags": [ + { + "id": 1, + "category": "publishing", + "slug": "theme", + "name": "theme", + "status": "public", + "data": { + "name": "theme" + } + } + ], + "data": { + "color": "", + "title": { + "de_DE": "Theme 03 - Battles DE", + "en_GB": "Theme 03 - Battles EN", + "fr_FR": "Theme 03 - Battles FR" + }, + "abstract": { + "de_DE": "The Battle of the Bulge: December 1944 DE", + "en_GB": "The Battle of the Bulge: December 1944 EN", + "fr_FR": "The Battle of the Bulge: December 1944 FR" + }, + "background": { + "bbox": [], + "overlay": "", + "backgroundColor": "#ddd" + } + } } ] } \ No newline at end of file diff --git a/public/api/story/4a75fb8cbf80d23b000166e1dbc06eb397d542efaa28a7f89ceb914fb95c051b.json b/public/api/story/4a75fb8cbf80d23b000166e1dbc06eb397d542efaa28a7f89ceb914fb95c051b.json index 4b4fe6c..69bca83 100644 --- a/public/api/story/4a75fb8cbf80d23b000166e1dbc06eb397d542efaa28a7f89ceb914fb95c051b.json +++ b/public/api/story/4a75fb8cbf80d23b000166e1dbc06eb397d542efaa28a7f89ceb914fb95c051b.json @@ -381,4 +381,4 @@ "data": {} } ] -} +} \ No newline at end of file diff --git a/public/api/story/95b555c4c61747123a8af05153c5675887579d25731a46106ba204937e2d9ef1.json b/public/api/story/95b555c4c61747123a8af05153c5675887579d25731a46106ba204937e2d9ef1.json index 6edb676..15c8c01 100644 --- a/public/api/story/95b555c4c61747123a8af05153c5675887579d25731a46106ba204937e2d9ef1.json +++ b/public/api/story/95b555c4c61747123a8af05153c5675887579d25731a46106ba204937e2d9ef1.json @@ -194,9 +194,179 @@ "short_url": "FUwmsEN", "date": null, "date_created": "2024-05-23T11:57:34.569888Z", - "date_last_modified": "2024-05-23T11:57:34.569898Z", + "date_last_modified": "2024-08-07T07:48:36.304219Z", "status": "public", - "covers": [], + "covers": [ + { + "id": 20, + "title": "klinik st Joseph, 1943 (CNA)", + "slug": "klinik-st-joseph-1943-cna", + "mimetype": "", + "type": "video", + "data": { + "type": "media", + "title": { + "de_DE": "CNA: IA000453.mp4\" (klinik st Joseph de 1 minute 00 à 1 minute 3) film datant de 1943 ", + "en_GB": "CNA: IA000453.mp4\" (klinik st Joseph de 1 minute 00 à 1 minute 3) film datant de 1943 ", + "fr_FR": "CNA: IA000453.mp4\" (klinik st Joseph de 1 minute 00 à 1 minute 3) film datant de 1943 " + }, + "geojson": { + "crs": { + "type": "name", + "properties": { + "name": "EPSG:2169" + } + }, + "geometry": { + "properties": { + "city": { + "de_DE": "", + "en_GB": "", + "fr_FR": "" + }, + "name": { + "de_DE": "", + "en_GB": "", + "fr_FR": "" + }, + "address": { + "de_DE": "", + "en_GB": "", + "fr_FR": "" + } + } + } + }, + "identifier": "", + "provenance": "", + "description": { + "de_DE": "CNA: IA000453.mp4\" (klinik st Joseph de 1 minute 00 à 1 minute 3) film datant de 1943 ", + "en_GB": "CNA: IA000453.mp4\" (klinik st Joseph de 1 minute 00 à 1 minute 3) film datant de 1943 ", + "fr_FR": "CNA: IA000453.mp4\" (klinik st Joseph de 1 minute 00 à 1 minute 3) film datant de 1943 " + }, + "resolutions": { + "medium": { + "url": "https://placehold.co/768x430/black/white?text=klinik-st-joseph-1943-cna", + "width": 768, + "height": 430 + }, + "preview": { + "url": "https://placehold.co/1371x768/black/white?text=klinik-st-joseph-1943-cna", + "width": 1371, + "height": 768 + }, + "thumbnail": { + "url": "https://placehold.co/260x146/black/white?text=klinik-st-joseph-1943-cna", + "width": 260, + "height": 146 + } + }, + "videoResolutions": { + "hsl": { + "url": "https://player.vimeo.com/external/528298336.m3u8?s=48042a6eddb4ebc97b6ede8f92c4a39139ddb2a6&logging=false" + }, + "dash": { + "url": "https://player.vimeo.com/external/528298336.mpd?s=26992b78d2bd96e58a2a21d4c224af21355e73fd&logging=false" + }, + "sd360p": { + "url": "https://player.vimeo.com/progressive_redirect/playback/528298336/rendition/360p/file.mp4?loc=external&signature=094baf3a199f1c4e36356a4dfd3474a53abb1e0adf8a0052d330962fec4ce038" + } + } + }, + "url": "https://vimeo.com/528298336/8b9085c3b6?share=copy", + "attachment": null, + "snapshot": "/media/video/snapshots/Screenshot_2024-05-24_at_09.17.10.png", + "short_url": "b9EcuWk" + }, + { + "id": 21, + "title": "Metz, Cathedral", + "slug": "metz-cathedral", + "mimetype": "", + "type": "entity", + "data": { + "type": "place", + "title": { + "de_DE": "Cathédrale Saint-Étienne de Metz", + "en_GB": "Metz Cathedral", + "fr_FR": "Cathédrale Saint-Étienne de Metz" + }, + "geojson": { + "crs": { + "type": "name", + "properties": { + "name": "EPSG:2169" + } + }, + "type": "Feature", + "geometry": { + "type": "Point", + "properties": { + "city": { + "de_DE": "Metz", + "en_GB": "Metz", + "fr_FR": "Metz" + }, + "name": { + "de_DE": "Cathédrale Saint-Étienne de Metz", + "en_GB": "Cathédrale Saint-Étienne de Metz", + "fr_FR": "Cathédrale Saint-Étienne de Metz" + }, + "address": { + "de_DE": "", + "en_GB": "", + "fr_FR": "" + }, + "country": "France" + }, + "coordinates": [ + "49.1210453", + "6.1762313" + ] + } + }, + "identifier": "", + "provenance": "", + "description": { + "de_DE": "49.1210453,6.1762313,16.57z", + "en_GB": "49.1210453,6.1762313,16.57z", + "fr_FR": "49.1210453,6.1762313,16.57z" + }, + "resolutions": { + "medium": { + "url": "", + "width": 0, + "height": 0 + }, + "preview": { + "url": "", + "width": 0, + "height": 0 + }, + "thumbnail": { + "url": "", + "width": 0, + "height": 0 + } + }, + "videoResolutions": { + "hsl": { + "url": "" + }, + "dash": { + "url": "" + }, + "sd360p": { + "url": "" + } + } + }, + "url": null, + "attachment": null, + "snapshot": null, + "short_url": "4C9SxLi" + } + ], "authors": [], "tags": [ { @@ -261,4 +431,4 @@ } } ] -} +} \ No newline at end of file diff --git a/public/api/story/level-01-journeys/index.json b/public/api/story/level-01-journeys/index.json index e381652..703d3ec 100644 --- a/public/api/story/level-01-journeys/index.json +++ b/public/api/story/level-01-journeys/index.json @@ -76,7 +76,7 @@ "count_modules": 0 }, "date_created": "2024-05-17T14:27:24.975607Z", - "date_last_modified": "2024-05-24T09:15:13.110225Z" + "date_last_modified": "2024-08-07T07:29:43.914171Z" }, { "id": 9, @@ -86,7 +86,7 @@ "date": null, "data": {}, "date_created": "2024-05-23T11:57:34.569888Z", - "date_last_modified": "2024-05-23T11:57:34.569898Z" + "date_last_modified": "2024-08-07T07:48:36.304219Z" } ], "data": { diff --git a/public/api/story/note-01-entering-the-war/index.json b/public/api/story/note-01-entering-the-war/index.json index 16ab4ed..59a51da 100644 --- a/public/api/story/note-01-entering-the-war/index.json +++ b/public/api/story/note-01-entering-the-war/index.json @@ -36,12 +36,12 @@ "overlay": "", "backgroundColor": "#ddd" }, - "count_modules": 3 + "count_modules": 4 }, - "contents": "{\r\n \"modules\": [\r\n {\r\n \"module\": \"text\",\r\n \"background\": {\r\n \"color\": \"#ddd\"\r\n },\r\n \"text\": {\r\n \"color\": \"#000\",\r\n \"position\": \"center\",\r\n \"content\": {\r\n \"en_GB\": \"With the outbreak of the Second World War, Luxembourg found itself in a precarious political position. Although the Grand Duchy’s Government was quick to reiterate its traditional policy of strict “disarmed neutrality”, it harboured no illusions about the latter’s viability. Diplomatically isolated and landlocked between Nazi Germany and France, the country risked being overrun by the war-waging powers in the first hours of the conflict – just like in 1914\\\\.\",\r\n \"fr_FR\": \"Avec le déclenchement de la Seconde Guerre mondiale, le Luxembourg se trouva dans une position politique précaire. Bien que le gouvernement du Grand-Duché ait rapidement réitéré sa politique traditionnelle de stricte « neutralité désarmée », il ne se faisait aucune illusion quant à la viabilité de celle-ci. Diplomatiquement isolé et enclavé entre l'Allemagne nazie et la France, le pays risquait d'être envahi par les puissances belligérantes dès les premières heures du conflit – tout comme en 1914\\\\.\",\r\n \"de_DE\": \"Mit dem Ausbruch des Zweiten Weltkriegs befand sich Luxemburg in einer prekären politischen Lage. Obwohl die Regierung des Großherzogtums schnell ihre traditionelle Politik der strikten „entwaffneten Neutralität“ bekräftigte, machte sie sich keine Illusionen über deren Machbarkeit. Diplomatisch isoliert und eingezwängt zwischen dem nationalsozialistischen Deutschland und Frankreich, riskierte das Land, in den ersten Stunden des Konflikts von den kriegsführenden Mächten überrannt zu werden – genau wie 1914\\\\.\"\r\n }\r\n }\r\n },\r\n {\r\n \"module\": \"text\",\r\n \"background\": {\r\n \"color\": \"#ddd\"\r\n },\r\n \"text\": {\r\n \"color\": \"#000\",\r\n \"position\": \"center\",\r\n \"content\": {\r\n \"en_GB\": \"This time, however, the Government was poised to act within the narrow frames of neutrality. On 25 August 1939, Luxembourg’s volunteer army of 700 men was deployed to the borders to guard the newly built defensive “Schuster Line” consisting of 62 road barriers. Meanwhile, in January 1940, the Government and grand ducal family secretly decided to leave the country in the event of an invasion.\",\r\n \"fr_FR\": \"Cette fois-ci, cependant, le gouvernement était prêt à agir dans les limites étroites de la neutralité. Le 25 août 1939, l'armée volontaire luxembourgeoise de 700 hommes fut déployée aux frontières pour garder la nouvelle ligne défensive « Ligne Schuster » composée de 62 barrières routières. Entre-temps, en janvier 1940, le gouvernement et la famille grand-ducale décidèrent secrètement de quitter le pays en cas d'invasion.\",\r\n \"de_DE\": \"Diesmal jedoch war die Regierung bereit, im engen Rahmen der Neutralität zu handeln. Am 25. August 1939 wurde die Freiwilligenarmee Luxemburgs von 700 Mann an die Grenzen entsandt, um die neu errichtete Verteidigungslinie „Schuster-Linie“ zu bewachen, die aus 62 Straßensperren bestand. Unterdessen beschloss die Regierung im Januar 1940 zusammen mit der großherzoglichen Familie, das Land im Falle einer Invasion heimlich zu verlassen.\"\r\n }\r\n }\r\n },\r\n {\r\n \"module\": \"text\",\r\n \"background\": {\r\n \"color\": \"#ddd\"\r\n },\r\n \"text\": {\r\n \"color\": \"#000\",\r\n \"position\": \"center\",\r\n \"content\": {\r\n \"en_GB\": \"These precautionary measures apart, civilian society was not directly affected by the conflict until May 1940\\\\. Yet the threat of war remained a daily presence: air raid shelters were opened, the border populations near Schengen were evacuated, and the canons of the Franco-German frontlines could be heard as far as Luxembourg City. On 10 May 1940, Nazi Germany violated Luxembourg’s neutrality and invaded the country in its “Blitzkrieg” against France. As the Luxembourg Army surrendered right away, the German invaders rapidly bypassed the “Schuster Line” and overran the country within a few hours.\",\r\n \"fr_FR\": \"Ces mesures de précaution mises à part, la société civile ne fut pas directement affectée par le conflit avant mai 1940\\\\. Pourtant, la menace de guerre restait une présence quotidienne : des abris anti-aériens furent ouverts, les populations frontalières près de Schengen furent évacuées et les canons des lignes de front franco-allemandes pouvaient être entendus jusqu'à Luxembourg-Ville. Le 10 mai 1940, l'Allemagne nazie viola la neutralité du Luxembourg et envahit le pays dans son « Blitzkrieg » contre la France. Comme l'armée luxembourgeoise se rendit immédiatement, les envahisseurs allemands contournèrent rapidement la « Ligne Schuster » et envahirent le pays en quelques heures.\",\r\n \"de_DE\": \"Abgesehen von diesen Vorsichtsmaßnahmen war die Zivilgesellschaft bis Mai 1940 nicht direkt von dem Konflikt betroffen\\\\. Doch die Kriegsgefahr war täglich präsent: Luftschutzbunker wurden geöffnet, die Grenzbevölkerung in der Nähe von Schengen wurde evakuiert, und die Kanonen der deutsch-französischen Frontlinien waren bis nach Luxemburg-Stadt zu hören. Am 10. Mai 1940 verletzte Nazi-Deutschland die Neutralität Luxemburgs und überfiel das Land im Rahmen seines „Blitzkriegs“ gegen Frankreich. Da sich die luxemburgische Armee sofort ergab, umgingen die deutschen Invasoren schnell die „Schuster-Linie“ und überrannten das Land innerhalb weniger Stunden.\"\r\n }\r\n }\r\n }\r\n ]\r\n}", + "contents": "{\"modules\":[{\"module\":\"text\",\"background\":{\"color\":\"#ddd\"},\"text\":{\"color\":\"#000\",\"position\":\"center\",\"content\":{\"en_GB\":\"With the outbreak of the Second World War, Luxembourg found itself in a precarious political position. Although the Grand Duchy’s Government was quick to reiterate its traditional policy of strict “disarmed neutrality”, it harboured no illusions about the latter’s viability. Diplomatically isolated and landlocked between Nazi Germany and France, the country risked being overrun by the war-waging powers in the first hours of the conflict – just like in 1914\\\\.\",\"fr_FR\":\"Avec le déclenchement de la Seconde Guerre mondiale, le Luxembourg se trouva dans une position politique précaire. Bien que le gouvernement du Grand-Duché ait rapidement réitéré sa politique traditionnelle de stricte « neutralité désarmée », il ne se faisait aucune illusion quant à la viabilité de celle-ci. Diplomatiquement isolé et enclavé entre l'Allemagne nazie et la France, le pays risquait d'être envahi par les puissances belligérantes dès les premières heures du conflit – tout comme en 1914\\\\.\",\"de_DE\":\"Mit dem Ausbruch des Zweiten Weltkriegs befand sich Luxemburg in einer prekären politischen Lage. Obwohl die Regierung des Großherzogtums schnell ihre traditionelle Politik der strikten „entwaffneten Neutralität“ bekräftigte, machte sie sich keine Illusionen über deren Machbarkeit. Diplomatisch isoliert und eingezwängt zwischen dem nationalsozialistischen Deutschland und Frankreich, riskierte das Land, in den ersten Stunden des Konflikts von den kriegsführenden Mächten überrannt zu werden – genau wie 1914\\\\.\"}}},{\"module\":\"text\",\"background\":{\"color\":\"#ddd\"},\"text\":{\"color\":\"#000\",\"position\":\"center\",\"content\":{\"en_GB\":\"This time, however, the Government was poised to act within the narrow frames of neutrality. On 25 August 1939, Luxembourg’s volunteer army of 700 men was deployed to the borders to guard the newly built defensive “Schuster Line” consisting of 62 road barriers. Meanwhile, in January 1940, the Government and grand ducal family secretly decided to leave the country in the event of an invasion.\",\"fr_FR\":\"Cette fois-ci, cependant, le gouvernement était prêt à agir dans les limites étroites de la neutralité. Le 25 août 1939, l'armée volontaire luxembourgeoise de 700 hommes fut déployée aux frontières pour garder la nouvelle ligne défensive « Ligne Schuster » composée de 62 barrières routières. Entre-temps, en janvier 1940, le gouvernement et la famille grand-ducale décidèrent secrètement de quitter le pays en cas d'invasion.\",\"de_DE\":\"Diesmal jedoch war die Regierung bereit, im engen Rahmen der Neutralität zu handeln. Am 25. August 1939 wurde die Freiwilligenarmee Luxemburgs von 700 Mann an die Grenzen entsandt, um die neu errichtete Verteidigungslinie „Schuster-Linie“ zu bewachen, die aus 62 Straßensperren bestand. Unterdessen beschloss die Regierung im Januar 1940 zusammen mit der großherzoglichen Familie, das Land im Falle einer Invasion heimlich zu verlassen.\"}}},{\"module\":\"text\",\"background\":{\"color\":\"#ddd\"},\"text\":{\"color\":\"#000\",\"position\":\"center\",\"content\":{\"en_GB\":\"These precautionary measures apart, civilian society was not directly affected by the conflict until May 1940\\\\. Yet the threat of war remained a daily presence: air raid shelters were opened, the border populations near Schengen were evacuated, and the canons of the Franco-German frontlines could be heard as far as Luxembourg City. On 10 May 1940, Nazi Germany violated Luxembourg’s neutrality and invaded the country in its “Blitzkrieg” against France. As the Luxembourg Army surrendered right away, the German invaders rapidly bypassed the “Schuster Line” and overran the country within a few hours.\",\"fr_FR\":\"Ces mesures de précaution mises à part, la société civile ne fut pas directement affectée par le conflit avant mai 1940\\\\. Pourtant, la menace de guerre restait une présence quotidienne : des abris anti-aériens furent ouverts, les populations frontalières près de Schengen furent évacuées et les canons des lignes de front franco-allemandes pouvaient être entendus jusqu'à Luxembourg-Ville. Le 10 mai 1940, l'Allemagne nazie viola la neutralité du Luxembourg et envahit le pays dans son « Blitzkrieg » contre la France. Comme l'armée luxembourgeoise se rendit immédiatement, les envahisseurs allemands contournèrent rapidement la « Ligne Schuster » et envahirent le pays en quelques heures.\",\"de_DE\":\"Abgesehen von diesen Vorsichtsmaßnahmen war die Zivilgesellschaft bis Mai 1940 nicht direkt von dem Konflikt betroffen\\\\. Doch die Kriegsgefahr war täglich präsent: Luftschutzbunker wurden geöffnet, die Grenzbevölkerung in der Nähe von Schengen wurde evakuiert, und die Kanonen der deutsch-französischen Frontlinien waren bis nach Luxemburg-Stadt zu hören. Am 10. Mai 1940 verletzte Nazi-Deutschland die Neutralität Luxemburgs und überfiel das Land im Rahmen seines „Blitzkriegs“ gegen Frankreich. Da sich die luxemburgische Armee sofort ergab, umgingen die deutschen Invasoren schnell die „Schuster-Linie“ und überrannten das Land innerhalb weniger Stunden.\"}}},{\"module\":\"text\",\"background\":{\"color\":\"#ddd\"},\"text\":{\"color\":\"#000\",\"position\":\"center\",\"content\":{\"fr_FR\":\"## References\\n\\n‘ANLux, PdE-324885, Rapport Du Brigadier de La Sûreté, Nicolas Huberty Du 14 Août 1939.’, 14 August 1939\\\\. PdE-324885.\\n\\nLa Tribune juive : organe indépendant du judaïsme de l’Est de la France. ‘Mondorf-Les-Bains, Echo de Pâque’. 17 May 1935\\\\. gallica.bnf.fr.\"}}}]}", "date": null, "date_created": "2024-05-17T08:51:14.285141Z", - "date_last_modified": "2024-05-17T14:36:57.250324Z", + "date_last_modified": "2024-08-09T09:07:31.828242Z", "status": "public", "source": null, "authors": [], diff --git a/public/api/story/note-05-theme-02/2f176b99c2924fc4acac5f511532682a85e719c6b10cdd245a816038d72640d7.json b/public/api/story/note-05-theme-02/2f176b99c2924fc4acac5f511532682a85e719c6b10cdd245a816038d72640d7.json new file mode 100644 index 0000000..60b0ef9 --- /dev/null +++ b/public/api/story/note-05-theme-02/2f176b99c2924fc4acac5f511532682a85e719c6b10cdd245a816038d72640d7.json @@ -0,0 +1,82 @@ +{ + "id": 15, + "slug": "note-05-theme-02", + "short_url": "MeXYJFK", + "title": "Note 05 theme 02", + "abstract": null, + "documents": [], + "tags": [ + { + "id": 2, + "category": "publishing", + "slug": "chapter", + "name": "chapter", + "status": "public", + "data": { + "name": "chapter" + } + } + ], + "covers": [], + "stories": [], + "data": { + "color": "", + "title": { + "de_DE": "", + "en_GB": "", + "fr_FR": "Note 05 - The German Invasion: May 10, 1940" + }, + "abstract": { + "de_DE": "Mainly for theme 02", + "en_GB": "Mainly for theme 02", + "fr_FR": "Mainly for theme 02" + }, + "background": { + "bbox": [], + "overlay": "", + "backgroundColor": "#ddd" + }, + "count_modules": 2 + }, + "contents": { + "modules": [ + { + "module": "text", + "background": { + "color": "#ddd" + }, + "text": { + "color": "#000", + "position": "center", + "content": { + "fr_FR": "On May 10, 1940, Luxembourg's neutrality was brutally violated as Nazi Germany launched its invasion of the country. The small, defenseless Grand Duchy was quickly overrun by German forces, marking the beginning of a dark period of occupation. Despite Luxembourg’s efforts to remain neutral, the invasion was part of Hitler's broader plan to outflank the French Maginot Line and swiftly conquer Western Europe.", + "en_GB": "", + "de_DE": "" + } + } + }, + { + "module": "text", + "background": { + "color": "#ddd" + }, + "text": { + "color": "#000", + "position": "center", + "content": { + "fr_FR": "## References\n\n“Zeitungen: Tages- Und Wochenzeitungen, Gelehrten-Journale.” Accessed September 21, 2017\\. https://www.digitale-sammlungen.de/index.html?c=sammlungen&kategorie_sammlung=3&l=de.\n\n“La Gazette du Grand-Duché de Luxembourg.” Schamburger, 1878.", + "en_GB": "References\n\n\n“Zeitungen: Tages- Und Wochenzeitungen, Gelehrten-Journale.” Accessed September 21, 2017. https://www.digitale-sammlungen.de/index.html?c=sammlungen&kategorie_sammlung=3&l=de.\n\n\n“La Gazette du Grand-Duché de Luxembourg.” Schamburger, 1878.\n\n", + "de_DE": "References\n\n\n“Zeitungen: Tages- Und Wochenzeitungen, Gelehrten-Journale.” Accessed September 21, 2017. https://www.digitale-sammlungen.de/index.html?c=sammlungen&kategorie_sammlung=3&l=de.\n\n\n“La Gazette du Grand-Duché de Luxembourg.” Schamburger, 1878.\n\n" + } + } + } + ] + }, + "date": null, + "date_created": "2024-08-09T12:39:22.461519Z", + "date_last_modified": "2024-08-09T13:29:00.625215Z", + "status": "public", + "source": null, + "authors": [], + "version": "" +} \ No newline at end of file diff --git a/public/api/story/st-joseph-clinic/index.json b/public/api/story/st-joseph-clinic/index.json index a7955fc..1e94b8d 100644 --- a/public/api/story/st-joseph-clinic/index.json +++ b/public/api/story/st-joseph-clinic/index.json @@ -166,6 +166,64 @@ "attachment": null, "snapshot": "/media/video/snapshots/Screenshot_2024-05-24_at_09.17.10.png", "short_url": "b9EcuWk" + }, + { + "id": 18, + "title": "Clinique Saint-Joseph", + "slug": "clinique-saint-joseph", + "mimetype": "", + "type": "entity", + "data": { + "type": "place", + "title": { + "de_DE": "Saint-Joseph-Klinik", + "en_GB": "Saint-Joseph Clinic", + "fr_FR": "Clinique Saint-Joseph" + }, + "geojson": { + "crs": { + "type": "name", + "properties": { + "name": "EPSG:2169" + } + }, + "type": "Feature", + "geometry": { + "type": "Point", + "properties": { + "city": { + "de_DE": "Wiltz", + "en_GB": "Wiltz", + "fr_FR": "Wiltz" + }, + "name": { + "de_DE": "", + "en_GB": "", + "fr_FR": "" + }, + "address": { + "de_DE": "", + "en_GB": "", + "fr_FR": "" + }, + "country": "Luxembourg" + }, + "coordinates": [ + "63197.490072547036", + "114580.1060949051" + ] + } + }, + "description": { + "de_DE": "Versorgungsort für Flüchtlinge aus Differdange", + "en_GB": "Place of supply for refugees from Differdange", + "fr_FR": "Lieu de ravitaillement des réfugiés de Differdange" + } + }, + "url": null, + "attachment": null, + "snapshot": null, + "short_url": "iR8gFGE" } ], "stories": [ @@ -192,10 +250,38 @@ "overlay": "", "backgroundColor": "#ddd" }, - "count_modules": 3 + "count_modules": 4 }, "date_created": "2024-05-17T08:51:14.285141Z", - "date_last_modified": "2024-05-17T14:36:57.250324Z" + "date_last_modified": "2024-08-09T09:07:31.828242Z" + }, + { + "id": 15, + "slug": "note-05-theme-02", + "title": "Note 05 theme 02", + "short_url": "MeXYJFK", + "date": null, + "data": { + "color": "", + "title": { + "de_DE": "", + "en_GB": "", + "fr_FR": "Note 05 - The German Invasion: May 10, 1940" + }, + "abstract": { + "de_DE": "Mainly for theme 02", + "en_GB": "Mainly for theme 02", + "fr_FR": "Mainly for theme 02" + }, + "background": { + "bbox": [], + "overlay": "", + "backgroundColor": "#ddd" + }, + "count_modules": 2 + }, + "date_created": "2024-08-09T12:39:22.461519Z", + "date_last_modified": "2024-08-09T13:29:00.625215Z" } ], "data": { @@ -215,7 +301,7 @@ "contents": "", "date": null, "date_created": "2024-05-17T14:27:24.975607Z", - "date_last_modified": "2024-05-24T09:15:13.110225Z", + "date_last_modified": "2024-08-07T07:29:43.914171Z", "status": "public", "source": null, "authors": [], diff --git a/public/api/story/theme-01-vivre-sous-lannexion/index.json b/public/api/story/theme-01-vivre-sous-lannexion/index.json index 8b65da9..dc8d83e 100644 --- a/public/api/story/theme-01-vivre-sous-lannexion/index.json +++ b/public/api/story/theme-01-vivre-sous-lannexion/index.json @@ -18,7 +18,64 @@ } ], "covers": [], - "stories": [], + "stories": [ + { + "id": 14, + "slug": "note-04-theme-02", + "title": "Note 04 - Theme 02", + "short_url": "W5QQg9g", + "date": null, + "data": { + "color": "", + "title": { + "de_DE": "", + "en_GB": "", + "fr_FR": "Note 04 - Theme 02" + }, + "abstract": { + "de_DE": "Note 04 (DE)", + "en_GB": "Note 04 (EN)", + "fr_FR": "Note 04 (FR)" + }, + "background": { + "bbox": [], + "overlay": "", + "backgroundColor": "#ddd" + }, + "count_modules": 1 + }, + "date_created": "2024-08-09T12:36:49.453860Z", + "date_last_modified": "2024-08-09T12:38:28.734165Z" + }, + { + "id": 15, + "slug": "note-05-theme-02", + "title": "Note 05 theme 02", + "short_url": "MeXYJFK", + "date": null, + "data": { + "color": "", + "title": { + "de_DE": "", + "en_GB": "", + "fr_FR": "Note 05 - The German Invasion: May 10, 1940" + }, + "abstract": { + "de_DE": "Mainly for theme 02", + "en_GB": "Mainly for theme 02", + "fr_FR": "Mainly for theme 02" + }, + "background": { + "bbox": [], + "overlay": "", + "backgroundColor": "#ddd" + }, + "count_modules": 2 + }, + "date_created": "2024-08-09T12:39:22.461519Z", + "date_last_modified": "2024-08-09T13:29:00.625215Z" + } + ], "data": { "color": "", "title": { @@ -27,6 +84,10 @@ "abstract": { "fr_FR": "" }, + "chapters": [ + 14, + 15 + ], "background": { "bbox": [], "overlay": "", @@ -36,7 +97,7 @@ "contents": "", "date": null, "date_created": "2024-05-17T08:44:34.373782Z", - "date_last_modified": "2024-05-17T14:33:34.431054Z", + "date_last_modified": "2024-08-09T12:39:22.547226Z", "status": "public", "source": null, "authors": [], diff --git a/public/api/story/theme-02-reagir-a-lannexion/index.json b/public/api/story/theme-02-reagir-a-lannexion/index.json index 52565cb..f85e5a4 100644 --- a/public/api/story/theme-02-reagir-a-lannexion/index.json +++ b/public/api/story/theme-02-reagir-a-lannexion/index.json @@ -42,10 +42,10 @@ "overlay": "", "backgroundColor": "#ddd" }, - "count_modules": 3 + "count_modules": 4 }, "date_created": "2024-05-17T08:51:14.285141Z", - "date_last_modified": "2024-05-17T14:36:57.250324Z" + "date_last_modified": "2024-08-09T09:07:31.828242Z" }, { "id": 6, @@ -74,6 +74,34 @@ }, "date_created": "2024-05-17T14:32:10.732213Z", "date_last_modified": "2024-05-17T14:45:14.560905Z" + }, + { + "id": 13, + "slug": "note-03-example", + "title": "Note 03 - Example", + "short_url": "iHGc7ya", + "date": null, + "data": { + "color": "", + "title": { + "de_DE": "", + "en_GB": "", + "fr_FR": "note-03-Example" + }, + "abstract": { + "de_DE": "Note 03 Example (DE)", + "en_GB": "Note 03 Example (EN)", + "fr_FR": "Note 03 Example (FR)" + }, + "background": { + "bbox": [], + "overlay": "", + "backgroundColor": "#ddd" + }, + "count_modules": 0 + }, + "date_created": "2024-08-09T10:39:16.275222Z", + "date_last_modified": "2024-08-09T12:28:47.844715Z" } ], "data": { @@ -90,7 +118,8 @@ }, "chapters": [ 4, - 6 + 6, + 13 ], "background": { "bbox": [], @@ -101,7 +130,7 @@ "contents": "", "date": null, "date_created": "2024-05-17T08:45:18.263716Z", - "date_last_modified": "2024-05-17T14:33:21.192580Z", + "date_last_modified": "2024-08-09T10:39:16.355032Z", "status": "public", "source": null, "authors": [], diff --git a/public/api/tag/c0c2b8699dc9634674990556fc872afa922e6244062764c3390dd49ff8af6ae5.json b/public/api/tag/c0c2b8699dc9634674990556fc872afa922e6244062764c3390dd49ff8af6ae5.json new file mode 100644 index 0000000..de47e38 --- /dev/null +++ b/public/api/tag/c0c2b8699dc9634674990556fc872afa922e6244062764c3390dd49ff8af6ae5.json @@ -0,0 +1,67 @@ +{ + "count": 5, + "next": null, + "previous": null, + "results": [ + { + "id": 8, + "category": "keyword", + "slug": "saint-joseph-clinic", + "name": "St Joseph Clinic", + "status": "public", + "data": { + "de_DE": "Klinik St Joseph", + "en_GB": "St Joseph Clinic", + "fr_FR": "Clinique St Joseph" + } + }, + { + "id": 11, + "category": "keyword", + "slug": "10-may-1940-test", + "name": "The German Invasion: May 10, 1940", + "status": "public", + "data": { + "de_DE": "The German Invasion: May 10, 1940 DE", + "en_GB": "The German Invasion: May 10, 1940 EN", + "fr_FR": "The German Invasion: May 10, 1940 FR" + } + }, + { + "id": 13, + "category": "keyword", + "slug": "under-nazi-occupation", + "name": "Luxembourg Under Nazi Occupation", + "status": "public", + "data": { + "de_DE": "Luxembourg Under Nazi Occupation DE", + "en_GB": "Luxembourg Under Nazi Occupation EN", + "fr_FR": "Luxembourg Under Nazi Occupation FR" + } + }, + { + "id": 14, + "category": "keyword", + "slug": "resistance-movement", + "name": "The Resistance Movement", + "status": "public", + "data": { + "de_DE": "The Resistance Movement DE", + "en_GB": "The Resistance Movement EN", + "fr_FR": "The Resistance Movement FR" + } + }, + { + "id": 15, + "category": "keyword", + "slug": "battle-bulge-dec-1944", + "name": "The Battle of the Bulge: December 1944", + "status": "public", + "data": { + "de_DE": "The Battle of the Bulge: December 1944 DE", + "en_GB": "The Battle of the Bulge: December 1944 EN", + "fr_FR": "The Battle of the Bulge: December 1944 FR" + } + } + ] +} \ No newline at end of file diff --git a/scripts/package-lock.json b/scripts/package-lock.json new file mode 100644 index 0000000..e1e3bb4 --- /dev/null +++ b/scripts/package-lock.json @@ -0,0 +1,386 @@ +{ + "name": "scripts", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "scripts", + "dependencies": { + "axios": "^1.6.8", + "debug": "^4.3.4", + "nodemon": "^3.1.0" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "license": "MIT" + }, + "node_modules/axios": { + "version": "1.6.8", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "license": "MIT" + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.6", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "license": "ISC" + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/nodemon": { + "version": "3.1.0", + "license": "MIT", + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^4", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "license": "MIT" + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "license": "MIT" + }, + "node_modules/readdirp": { + "version": "3.6.0", + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/semver": { + "version": "7.6.2", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/simple-update-notifier": { + "version": "2.0.0", + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/touch": { + "version": "3.1.1", + "license": "ISC", + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "license": "MIT" + } + } +} diff --git a/scripts/package.json b/scripts/package.json new file mode 100644 index 0000000..cebd87b --- /dev/null +++ b/scripts/package.json @@ -0,0 +1,11 @@ +{ + "dependencies": { + "axios": "^1.6.8", + "debug": "^4.3.4", + "nodemon": "^3.1.0" + }, + "scripts": { + "start": "node prefecth.js", + "prefetch": "DEBUG=www2 nodemon prefetch.js" + } +} diff --git a/scripts/prefetch.js b/scripts/prefetch.js new file mode 100644 index 0000000..6829684 --- /dev/null +++ b/scripts/prefetch.js @@ -0,0 +1,149 @@ +const path = require('path') +const crypto = require('crypto') +const debug = require('debug')('ww2') +const { mkdir, writeFile, readFile } = require('fs').promises +const axios = require('axios') +console.log('hello ❤️') + +console.log('Use `npm run dev` to see debug output') +console.log('ENV variables prefixed by WW2_:') +Object.entries(process.env) + .filter((d) => d[0].indexOf('WW2_', 0) === 0) + .forEach(([key, value]) => console.log(`- ${key}=${value}`)) +console.log() +debug('hello from the debugger ❤️') + +async function generateApiStaticFile(url, config) { + const absoluteUrl = `${config.host}${url}` + debug('\ngenerateApiStaticFile url:', absoluteUrl) + // get hash of the ? part of the url + // e.g. /story/?filters={"tags__slug":"theme"} -> hash of `filters={"tags__slug":"theme"}` + const urlObject = new URL(absoluteUrl) + const urlPath = urlObject.pathname + debug('url path:', urlPath) + const queryString = urlObject.searchParams.toString() + debug('queryString:', queryString.length) + const hash = crypto.createHash('sha256').update(queryString).digest('hex') + debug('hash:', hash) + let filepath = + queryString.length > 1 + ? `${config.dist}/${urlPath}/${hash}.json` + : `${config.dist}/${urlPath}/index.json` + filepath = filepath.replace(/\/+/g, '/') + debug('filepath:', filepath) + // remove ownership + const contents = await axios + .get(absoluteUrl) + .then((res) => res.data) + .then((data) => { + if (data.results && Array.isArray(data.results)) { + return { + ...data, + results: data.results.map((d) => { + delete d.owner + return d + }), + } + } else if (data.owner) { + delete data.owner + delete data.url + } + return data + }) + // print contents in corresponding filepath + debug('writeFile...') + // create missing directory recurively + const dir = path.dirname(filepath) + try { + await mkdir(dir) + debug('mkdir', dir) + } catch (e) { + if (e.code !== 'EEXIST') { + throw e + } + } + await writeFile(filepath, JSON.stringify(contents, null, 2)) + debug('writeFile done') + return { + hash, + filepath: filepath.replace(config.dist, ''), + } +} + +async function buildApiFolders(config) { + try { + debug('buildApiFolders: mkdir', `${config.dist}/api`) + await mkdir(`${config.dist}/api`) + + console.log('✔️ Successfully created api folder') + } catch (e) { + if (e.code !== 'EEXIST') { + throw e + } + debug('buildApiFolders: api folder already exists') + } + + try { + debug('buildApiFolders: mkdir', `${config.dist}/api/story`) + await mkdir(`${config.dist}/api/story`) + + console.log('✔️ Successfully created api/story folder') + } catch (e) { + if (e.code !== 'EEXIST') { + throw e + } + debug('buildApiFolders: api/story folder already exists') + } + try { + debug('buildApiFolders: mkdir', `${config.dist}/api/document`) + await mkdir(`${config.dist}/api/document`) + + console.log('✔️ Successfully created api/document folder') + } catch (e) { + if (e.code !== 'EEXIST') { + throw e + } + debug('buildApiFolders: api/document folder already exists') + } +} + +async function apiOutputsAsStaticFiles() { + debug('apiOutputsAsStaticFiles') + const urlItems = await readFile( + path.join(__dirname, './urls.json'), + 'utf8' + ).then(JSON.parse) + + const config = { + dirname: __dirname, + dist: + process.env.WW2_API_STATIC_OUTPUT_PATH ?? + path.join(__dirname, '../public'), + host: process.env.WW2_API_HOST ?? 'http://localhost/api', + urls: urlItems.map((d) => d.url), + } + debug(config) + await buildApiFolders(config) + const results = [] + + for (const urlItem of urlItems) { + console.log('url:', urlItem.url) + const result = await generateApiStaticFile(urlItem.url, config) + results.push({ + ...urlItem, + hash: result.hash, + url: urlItem.url.replace(/\%22/g, '"'), + }) + } + + // save as json + await writeFile( + path.join(__dirname, '../docs/urls.json'), + JSON.stringify(results, null, 2) + ) + console.log('✔️ Successfully saved urls.json') +} + +if (require.main === module) { + apiOutputsAsStaticFiles() +} diff --git a/scripts/urls.json b/scripts/urls.json new file mode 100644 index 0000000..4296e27 --- /dev/null +++ b/scripts/urls.json @@ -0,0 +1,80 @@ +[ + { + "description": "[Homepage] get the contents (title and abstract) for the Home page", + "url": "/api/story/home", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "description": "[Menu] get the list of stories that composes the Menu, basically all stories tagged with `menu` tag. The `slug` property of each story is prefixed with `level-` followed by a number, this way the list is easily ordered. Every story has a `slug` property that is used as identifier", + "url": "/api/story/?filters={\"tags__slug%22:%22menu%22}&order_by=slug&limit=10", + "hash": "d159095c9a67b4a002ed8a5c522df27440e74f0f58af01bd93b7d38de7ad7bfa" + }, + { + "description": "[level 1] Content of the object of type Story", + "url": "/api/story/level-01-journeys", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "description": "[level 1] get all 'capsules' linked to the story with slug `level-01-journeys` that contains a geographic location", + "url": "/api/story/?filters={\"mentioned_to__slug%22%3A%22level-01-journeys%22,%22covers__data__type%22:%22place%22}&limit=100", + "hash": "4a75fb8cbf80d23b000166e1dbc06eb397d542efaa28a7f89ceb914fb95c051b" + }, + { + "description": "[Level 1] get all location linked to the video capsule stories mentioned to the story with slug `level-01-journeys`; return the list unsorted", + "url": "/api/document/?filters={\"data__type%22:%22place%22,%22stories__mentioned_to__slug%22:%22level-01-journeys%22}&limit=100", + "hash": "e8f4db59f555a97d2af57daca0bd44b112dec05309cee0474f00eff1e963d031" + }, + { + "description": "[Level 1] get all stories mentioned to `level-01-journeys` (st Joseph Clinic with video cover is one of them)", + "url": "/api/story/?filters={\"mentioned_to__slug%22:%22level-01-journeys%22}&limit=100", + "hash": "95b555c4c61747123a8af05153c5675887579d25731a46106ba204937e2d9ef1" + }, + { + "description": "[Level 1] get all properties and all related documents and related stories to `st-joseph-clinic`", + "url": "/api/story/st-joseph-clinic", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "url": "/api/story?filters={\"tags__slug%22:%22theme%22}", + "description": "Get all stories with the tag 'theme'", + "hash": "2c6ef15591a4dd4b95133af345082155b08e094217d0b4c288ceafc9335024bd" + }, + { + "url": "/api/story?filters={\"mentioned_to__slug%22:%22theme-02-reagir-a-lannexion%22}", + "description": "Get all stories that mention the story with the slug 'theme-02-reagir-a-lannexion'", + "hash": "064252d4ab3f236e431ebc478d2c9594a5b0b58c234e86a28eb9570e75a60de4" + }, + { + "url": "/api/story/theme-01-vivre-sous-lannexion", + "description": "Get the story with the slug 'theme-01-vivre-sous-lannexion'", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "url": "/api/story/theme-02-reagir-a-lannexion", + "description": "Get the story with the slug 'theme-02-reagir-a-lannexion'", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "url": "/api/story/note-01-entering-the-war", + "description": "Get the story with the slug 'note-01-entering-the-war'", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "url": "/api/story/note-02-la-formation-dun-consensus-memoriel", + "description": "Get the story with the slug 'note-02-la-formation-dun-consensus-memoriel'", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "url": "/api/document/?q=castle&filters={\"data__type%22:%22place%22}", + "description": "Get all documents/places that contain the word 'castle'", + "hash": "b08398cbb947ab8b912734b08249eb8291d56e23b0e82fc91f839b74be6b10f2" + }, + { + "url": "/api/tag/?filters={%22category%22:%22keyword%22}", + "description": "Get all available tags" + }, + { + "url": "/api/story/note-05-theme-02/?parser=yaml", + "description": "get the note content with a reference section" + } +]