From 16fbed5083f896d44e189bdece8423608cf85749 Mon Sep 17 00:00:00 2001 From: Marc Gavanier Date: Thu, 16 Jan 2025 11:46:23 +0100 Subject: [PATCH] feat: remove static sources --- .github/workflows/nightly-publish.yml | 19 ++----- .github/workflows/release.yml | 19 ++----- .github/workflows/validate.yml | 19 ++----- package.json | 50 ++----------------- .../fiche-acces-libre.field.spec.ts | 24 +++++++++ .../fiche-acces-libre.field.ts | 12 +++-- 6 files changed, 46 insertions(+), 97 deletions(-) diff --git a/.github/workflows/nightly-publish.yml b/.github/workflows/nightly-publish.yml index 57c8b7bf..d07c6f0e 100644 --- a/.github/workflows/nightly-publish.yml +++ b/.github/workflows/nightly-publish.yml @@ -11,36 +11,23 @@ jobs: uses: ./.github/workflows/process-data.reusable.yml with: sources: '[ - "aidants-connect", - "aix-en-provence", - "angers", - "bus-france-services-charente", "charente-maritime", "conseiller-numerique", "coop-numerique", - "corse", "dora", - "epernay", - "etapes-numerique", - "fibre-64", "france-services", "francil-in", - "gironde", "grand-paris-sud", "haute-vienne", "hinaura", "hub-bretagne", - "hub-lo", - "la-creuse", - "le-havre", - "les-landes", - "loire-atlantique", - "maine-et-loire", "mednum-bfc", "mulhouse", - "nouvelle-caledonie", "vendee", + "le-havre", + "les-landes", "paca", + "loire-atlantique", "rhin-occ", "siilab" ]' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4d35be76..e2c64e2e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -80,36 +80,23 @@ jobs: uses: ./.github/workflows/process-data.reusable.yml with: sources: '[ - "aidants-connect", - "aix-en-provence", - "angers", - "bus-france-services-charente", "charente-maritime", "conseiller-numerique", "coop-numerique", - "corse", "dora", - "epernay", - "etapes-numerique", - "fibre-64", "france-services", "francil-in", - "gironde", "grand-paris-sud", "haute-vienne", "hinaura", "hub-bretagne", - "hub-lo", - "la-creuse", - "le-havre", - "les-landes", - "loire-atlantique", - "maine-et-loire", "mednum-bfc", "mulhouse", - "nouvelle-caledonie", "vendee", + "le-havre", + "les-landes", "paca", + "loire-atlantique", "rhin-occ", "siilab" ]' diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 4498417d..ee0fd588 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -134,36 +134,23 @@ jobs: uses: ./.github/workflows/process-data.reusable.yml with: sources: '[ - "aidants-connect", - "aix-en-provence", - "angers", - "bus-france-services-charente", "charente-maritime", "conseiller-numerique", "coop-numerique", - "corse", "dora", - "epernay", - "etapes-numerique", - "fibre-64", "france-services", "francil-in", - "gironde", "grand-paris-sud", "haute-vienne", "hinaura", "hub-bretagne", - "hub-lo", - "la-creuse", - "le-havre", - "les-landes", - "loire-atlantique", - "maine-et-loire", "mednum-bfc", "mulhouse", - "nouvelle-caledonie", "vendee", + "le-havre", + "les-landes", "paca", + "loire-atlantique", "rhin-occ", "siilab" ]' diff --git a/package.json b/package.json index fd0d5241..8f7b54ff 100644 --- a/package.json +++ b/package.json @@ -45,32 +45,19 @@ "build": "tsc --project .tsconfig/tsconfig.json && cp -r ./src/data ./dist/", "start.data-inclusion": "tsx src/index.ts data-inclusion", "mednum": "tsx src/index.ts", - "transformer.aidants-connect": "tsx src/index.ts transformer -n \"Aidants Connect\" -t \"National\" -s \"https://aidantsconnect.beta.gouv.fr/api/organisations/?format=json@results\" -c \"./assets/input/aidants-connect/aidants-connect.config.json\" -o \"./assets/output/aidants-connect\"", - "transformer.aix-en-provence": "tsx src/index.ts transformer -n \"Mairie Aix en Provence\" -t \"Bouches-du-Rhône\" -s \"./assets/input/aix-en-provence/aix-en-provence.json\" -c \"./assets/input/aix-en-provence/aix-en-provence.config.json\" -o \"./assets/output/aix-en-provence\"", - "transformer.angers": "tsx src/index.ts transformer -n \"Angers\" -t \"Maine-et-Loire\" -s \"./assets/input/angers/angers.json\" -c \"./assets/input/angers/angers.config.json\" -o \"./assets/output/angers\"", - "transformer.bus-france-services-charente": "tsx src/index.ts transformer -n \"Bus France Services en Charente\" -t \"Nouvelle-Aquitaine\" -s \"./assets/input/bus-france-services-charente/bus-france-services-charente.json\" -c \"./assets/input/bus-france-services-charente/bus-france-services-charente.config.json\" -o \"./assets/output/bus-france-services-charente\"", "transformer.charente-maritime": "tsx src/index.ts transformer -n \"Département de la Charente-Maritime\" -t \"Nouvelle-Aquitaine\" -s \"https://www.data.gouv.fr/fr/datasets/r/a409cbb5-cc2e-4f63-bed4-27fcc1777379@features\" -c \"./assets/input/charente-maritime/charente-maritime.config.json\" -o \"./assets/output/charente-maritime\"", "transformer.conseiller-numerique": "tsx src/index.ts transformer -n \"Conseiller Numerique\" -t \"National\" -s \"https://api.conseiller-numerique.gouv.fr/permanences\" -c \"./assets/input/conseiller-numerique/conseiller-numerique.config.json\" -o \"./assets/output/conseiller-numerique\"", "transformer.coop-numerique": "tsx src/index.ts transformer -n \"Coop numérique\" -t \"National\" -s \"https://coop-numerique.anct.gouv.fr/api/lieux-mediation-numerique\" -c \"./assets/input/coop-numerique/coop-numerique.config.json\" -o \"./assets/output/coop-numerique\"", - "transformer.corse": "tsx src/index.ts transformer -n \"Corse\" -t \"Corse\" -s \"./assets/input/corse/corse.json\" -c \"./assets/input/corse/corse.config.json\" -o \"./assets/output/corse\"", "transformer.dora": "yarn start.data-inclusion -o \"./assets/input/dora/dora.json\" -f \"dora\" && tsx src/index.ts transformer -n \"dora\" -t \"National\" -s \"./assets/input/dora/dora.json\" -c \"./assets/input/dora/dora.config.json\" -o \"./assets/output/dora\"", - "transformer.epernay": "tsx src/index.ts transformer -n \"Epernay\" -t \"Marne\" -s \"./assets/input/epernay/epernay.json\" -c \"./assets/input/epernay/epernay.config.json\" -o \"./assets/output/epernay\"", - "transformer.etapes-numerique": "tsx src/index.ts transformer -n \"Etapes Numerique\" -t \"National\" -s \"./assets/input/etapes-numerique/etapes-numerique.json\" -c \"./assets/input/etapes-numerique/etapes-numerique.config.json\" -o \"./assets/output/etapes-numerique\"", - "transformer.fibre-64": "tsx src/index.ts transformer -n \"Fibre 64\" -t \"Pyrenees-Atlantique\" -s \"./assets/input/fibre-64/fibre-64.json\" -c \"./assets/input/fibre-64/fibre-64.config.json\" -o \"./assets/output/fibre-64\"", "transformer.france-services": "tsx src/index.ts transformer -n \"France Services\" -t \"National\" -s \"https://www.data.gouv.fr/fr/datasets/r/afc3f97f-0ef5-429b-bf16-7b7876d27cd4\" -c \"./assets/input/france-services/france-services.config.json\" -o \"./assets/output/france-services\"", "transformer.francil-in": "tsx src/index.ts transformer -n \"Francil-in\" -t \"Île-de-France\" -s \"https://data-francilin.netlify.app/structures.geojson@features\" -c \"./assets/input/francil-in/francil-in.config.json\" -o \"./assets/output/francil-in\"", - "transformer.gironde": "tsx src/index.ts transformer -n \"Gironde\" -t\"Nouvelle-Aquitaine\" -s \"./assets/input/gironde/gironde.json\" -c \"./assets/input/gironde/gironde.config.json\" -o \"./assets/output/gironde\"", "transformer.grand-paris-sud": "tsx src/index.ts transformer -n \"Grand Paris Sud\" -t\"Île-de-France\" -s \"https://data.grandparissud.fr/api/explore/v2.1/catalog/datasets/datainclusion-description-des-structures-gps/records?limit=100@results\" -c \"./assets/input/grand-paris-sud/grand-paris-sud.config.json\" -o \"./assets/output/grand-paris-sud\"", "transformer.haute-vienne": "tsx src/index.ts transformer -n \"Haute-Vienne\" -t \"Nouvelle-Aquitaine\" -s \"https://sig.limoges-metropole.fr/servernf1/rest/services/_SOCIAL/actnum_consult/FeatureServer/0/query?f=geojson&where=(service%20IS%20NOT%20NULL)&outFields=*&@features\" -c \"./assets/input/haute-vienne/haute-vienne.config.json\" -o \"./assets/output/haute-vienne\"", "transformer.hinaura": "tsx src/index.ts transformer -n \"Hinaura\" -t \"Auvergne-Rhône-Alpes\" -s \"https://carto.hinaura.fr/?api/forms/8/entries\" -c \"./assets/input/hinaura/hinaura.config.json\" -o \"./assets/output/hinaura\"", "transformer.hub-bretagne": "tsx src/index.ts transformer -n \"Hub Bretagne\" -t \"Bretagne\" -s \"https://api.portrea.fr/api/v1/territoire/france/ressources\" -c \"./assets/input/hub-bretagne/hub-bretagne.config.json\" -o \"./assets/output/hub-bretagne\"", - "transformer.hub-lo": "tsx src/index.ts transformer -n \"Hub-lo\" -t \"Centre-Val-de-Loire\" -s \"./assets/input/hub-lo/hub-lo.json\" -c \"./assets/input/hub-lo/hub-lo.config.json\" -o \"./assets/output/hub-lo\"", - "transformer.maine-et-loire": "tsx src/index.ts transformer -n \"Département du Maine-et-Loire\" -t \"Maine-et-Loire\" -s \"./assets/input/maine-et-loire/maine-et-loire.json\" -c \"./assets/input/maine-et-loire/maine-et-loire.config.json\" -o \"./assets/output/maine-et-loire\"", "transformer.mednum-bfc": "tsx src/index.ts transformer -n \"Mednum BFC\" -t \"Bourgogne-Franche-Comté\" -s \"https://raw.githubusercontent.com/multi-coop/data-bfc-ternum/main/csv/bfc-ternum-dataset.csv\" -c \"./assets/input/mednum-bfc/mednum-bfc.config.json\" -o \"./assets/output/mednum-bfc\"", "transformer.mulhouse": "tsx src/index.ts transformer -n \"Mulhouse\" -t \"Haut-Rhin\" -s \"https://data.mulhouse-alsace.fr/api/records/1.0/search/?dataset=68224_acteurs-de-la-mediation-numerique-a-mulhouse&q=&facet=type_de_structure&facet=type_public&facet=acces_equipement_numerique_et_internet&facet=type_equipement&facet=tarif_acces_equipement&facet=accompagnement_pour_des_demarches_en_ligne&facet=tarif_accompagnement_pour_des_demarches_en_ligne&facet=modalites_d_acces_accompagnement_pour_des_demarches_en_ligne&facet=formations_ateliers&facet=tarif_formations_ateliers&facet=modalites_d_acces_formations_ateliers@records\" -c \"./assets/input/mulhouse/mulhouse.config.json\" -o \"./assets/output/mulhouse\"", - "transformer.nouvelle-caledonie": "tsx src/index.ts transformer -n \"Nouvelle-Calédonie\" -t \"Nouvelle-Calédonie\" -s \"./assets/input/nouvelle-caledonie/nouvelle-caledonie.json\" -c \"./assets/input/nouvelle-caledonie/nouvelle-caledonie.config.json\" -o \"./assets/output/nouvelle-caledonie\"", "transformer.vendee": "tsx src/index.ts transformer -n \"Vendée\" -t \"Vendée\" -s \"https://www.data.gouv.fr/fr/datasets/r/d2877549-0ac9-4c1d-96bf-ede948e980fb\" -c \"./assets/input/vendee/vendee.config.json\" -o \"./assets/output/vendee\" -d \"\t\"", - "transformer.la-creuse": "tsx src/index.ts transformer -n \"La Creuse\" -t \"Nouvelle-Aquitaine\" -s \"./assets/input/la-creuse/la-creuse.json\" -c \"./assets/input/la-creuse/la-creuse.config.json\" -o \"./assets/output/la-creuse\"", "transformer.le-havre": "tsx src/index.ts transformer -n \"Le Havre\" -t \"Le Havre\" -s \"https://www.data.gouv.fr/fr/datasets/r/ca69354c-f4f0-48f4-864e-d5a1c7e835ad\" -c \"./assets/input/le-havre/le-havre.config.json\" -o \"./assets/output/le-havre\" -d \";\"", "transformer.les-landes": "tsx src/index.ts transformer -n \"Les Landes\" -t \"Nouvelle-Aquitaine\" -s \"https://www.pigma.org/fr/datapusher/ws/default/usergroup6.a9d11fa0-12e5-4161-9a0d-3a1c21da3bf0/all.json@values\" -c \"./assets/input/les-landes/les-landes.config.json\" -o \"./assets/output/les-landes\"", "transformer.paca": "tsx src/index.ts transformer -n \"Paca\" -t \"Provence-Alpes-Côte d'Azur\" -s \"https://www.data.gouv.fr/fr/datasets/r/5250e9c9-8abe-4a4e-8ebc-cb4e8fe72b71\" -c \"./assets/input/paca/paca.config.json\" -o \"./assets/output/paca\" -d \";\"", @@ -78,35 +65,21 @@ "transformer.rhin-occ": "tsx src/index.ts transformer -n \"RhinOcc\" -t \"Occitanie\" -s \"https://rhinoccc.gogocarto.fr/api/elements.json?categories=&excludeExternal=true?@data\" -c \"./assets/input/rhin-occ/rhin-occ.config.json\" -o \"./assets/output/rhin-occ\"", "transformer.res-in": "tsx src/index.ts transformer -n \"Res-in\" -t \"Lyon\" -s \"https://resin.grandlyon.com/api/structures\" -c \"./assets/input/res-in/res-in.config.json\" -o \"./assets/output/res-in\"", "transformer.siilab": "tsx src/index.ts transformer -n \"Siilab\" -t \"Hauts-de-France\" -s \"https://cdonline.articque.com/download/434922/SIILAB_HDF_standard_med_num.csv\" -c \"./assets/input/siilab/siilab.config.json\" -o \"./assets/output/siilab\" -d \";\"", - "transformer.ultra-num": "tsx src/index.ts transformer -n \"Ultra-numerique\" -t \"La Reunion\" -s \"./assets/input/ultra-num/ultra-num.json\" -c \"./assets/input/ultra-num/ultra-num.config.json\" -o \"./assets/output/ultra-num\"", "extract.all": "tsx src/index.ts extract -n \"Data Inclusion\" -o ./assets/output-extraction/data-inclusion -t National -c false", "publier.all": "tsx src/index.ts publier -z country:fr -m ./assets/output-extraction/data-inclusion/publier.json", - "publier.aidants-connect": "tsx src/index.ts publier -z \"country:fr\" -m \"./assets/output/aidants-connect/publier.json\"", - "publier.aix-en-provence": "tsx src/index.ts publier -z \"fr:commune:13001\" -m \"./assets/output/aix-en-provence/publier.json\"", - "publier.angers": "tsx src/index.ts publier -z \"fr:commune:49007\" -m \"./assets/output/angers/publier.json\"", - "publier.bus-france-services-charente": "tsx src/index.ts publier -z \"fr:departement:16\" -m \"./assets/output/bus-france-services-charente/publier.json\"", "publier.charente-maritime": "tsx src/index.ts publier -z \"fr:departement:17\" -m \"./assets/output/charente-maritime/publier.json\"", "publier.conseiller-numerique": "tsx src/index.ts publier -z \"country:fr\" -m \"./assets/output/conseiller-numerique/publier.json\"", "publier.coop-numerique": "tsx src/index.ts publier -z \"country:fr\" -m \"./assets/output/coop-numerique/publier.json\"", - "publier.corse": "tsx src/index.ts publier -z \"fr:region:94\" -m \"./assets/output/corse/publier.json\"", "publier.dora": "tsx src/index.ts publier -z \"country:fr\" -m \"./assets/output/dora/publier.json\"", - "publier.epernay": "tsx src/index.ts publier -z \"fr:departement:51\" -m \"./assets/output/epernay/publier.json\"", - "publier.etapes-numerique": "tsx src/index.ts publier -z \"country:fr\" -m \"./assets/output/etapes-numerique/publier.json\"", - "publier.fibre-64": "tsx src/index.ts publier -z \"fr:departement:64\" -m \"./assets/output/fibre-64/publier.json\"", "publier.france-services": "tsx src/index.ts publier -z \"country:fr\" -m \"./assets/output/france-services/publier.json\"", "publier.francil-in": "tsx src/index.ts publier -z \"fr:region:11\" -m \"./assets/output/francil-in/publier.json\"", - "publier.gironde": "tsx src/index.ts publier -z \"fr:departement:33\" -m \"./assets/output/gironde/publier.json\"", "publier.grand-paris-sud": "tsx src/index.ts publier -z \"fr:region:11\" -m \"./assets/output/grand-paris-sud/publier.json\"", "publier.haute-vienne": "tsx src/index.ts publier -z \"fr:departement:87\" -m \"./assets/output/haute-vienne/publier.json\"", "publier.hinaura": "tsx src/index.ts publier -z \"fr:region:84\" -m \"./assets/output/hinaura/publier.json\"", "publier.hub-bretagne": "tsx src/index.ts publier -z \"fr:region:24\" -m \"./assets/output/hub-lo/publier.json\"", - "publier.hub-lo": "tsx src/index.ts publier -z \"fr:region:53\" -m \"./assets/output/hub-bretagne/publier.json\"", - "publier.maine-et-loire": "tsx src/index.ts publier -z \"fr:departement:49\" -m \"./assets/output/maine-et-loire/publier.json\"", "publier.mednum-bfc": "tsx src/index.ts publier -z \"fr:region:27\" -m \"./assets/output/mednum-bfc/publier.json\"", "publier.mulhouse": "tsx src/index.ts publier -z \"fr:commune:68224\" -m \"./assets/output/mulhouse/publier.json\"", - "publier.nouvelle-caledonie": "tsx src/index.ts publier -z \"fr:departement:988\" -m \"./assets/output/nouvelle-caledonie/publier.json\"", "publier.vendee": "tsx src/index.ts publier -z \"fr:departement:85\" -m \"./assets/output/vendee/publier.json\"", - "publier.la-creuse": "tsx src/index.ts publier -z \"fr:departement:23\" -m \"./assets/output/la-creuse/publier.json\"", "publier.le-havre": "tsx src/index.ts publier -z \"fr:commune:76351\" -m \"./assets/output/le-havre/publier.json\"", "publier.les-landes": "tsx src/index.ts publier -z \"fr:departement:40\" -m \"./assets/output/les-landes/publier.json\"", "publier.paca": "tsx src/index.ts publier -z \"fr:region:93\" -m \"./assets/output/paca/publier.json\"", @@ -114,41 +87,26 @@ "publier.rhin-occ": "tsx src/index.ts publier -z \"fr:region:76\" -m \"./assets/output/rhin-occ/publier.json\"", "publier.res-in": "tsx src/index.ts publier -z \"fr:commune:69123\" -m \"./assets/output/res-in/publier.json\"", "publier.siilab": "tsx src/index.ts publier -z \"fr:region:32\" -m \"./assets/output/siilab/publier.json\"", - "publier.ultra-num": "tsx src/index.ts publier -z \"fr:region:04\" -m \"./assets/output/ultra-num/publier.json\"", - "dedupliquer.aidants-connect": "tsx src/index.ts dedupliquer -s \"./assets/output/aidants-connect/*-aidants-connect-lieux-de-mediation-numeriques-national.json\" -b \"./assets/output/aidants-connect/*-aidants-connect-lieux-de-mediation-numeriques-national.json\" -n \"Aidants Connect\" -t \"National\" -o \"./assets/output/aidants-connect\" -i true", - "dedupliquer.aix-en-provence": "tsx src/index.ts dedupliquer -s \"./assets/output/aix-en-provence/*-mairie-aix-en-provence-lieux-de-mediation-numeriques-bouches-du-rhone.json\" -b \"./assets/output/aix-en-provence/*-mairie-aix-en-provence-lieux-de-mediation-numeriques-bouches-du-rhone.json\" -n \"Mairie Aix en Provence\" -t \"Bouches-du-Rhône\" -o \"./assets/output/aix-en-provence\" -i true", - "dedupliquer.angers": "tsx src/index.ts dedupliquer -s \"./assets/output/angers/*-angers-lieux-de-mediation-numeriques-maine-et-loire.csv\" -b \"./assets/output/angers/*-angers-lieux-de-mediation-numeriques-maine-et-loire.csv\" -n \"Angers\" -t \"Maine-et-Loire\" -o \"./assets/output/angers\" -i true", - "dedupliquer.bus-france-services-charente": "tsx src/index.ts dedupliquer -s \"./assets/output/bus-france-services-charente/*-bus-france-services-en-charente-lieux-de-mediation-numeriques-nouvelle-aquitaine.json\" -b \"./assets/output/bus-france-services-charente/*-bus-france-services-en-charente-lieux-de-mediation-numeriques-nouvelle-aquitaine.json\" -n \"Bus France Services en Charente\" -t \"Nouvelle-Aquitaine\" -o \"./assets/output/bus-france-services-charente\" -i true", "dedupliquer.charente-maritime": "tsx src/index.ts dedupliquer -s \"./assets/output/charente-maritime/*-departement-de-la-charente-maritime-lieux-de-mediation-numeriques-nouvelle-aquitaine.json\" -b \"./assets/output/charente-maritime/*-departement-de-la-charente-maritime-lieux-de-mediation-numeriques-nouvelle-aquitaine.json\" -n \"Département de la Charente-Maritime\" -t \"Nouvelle-Aquitaine\" -o \"./assets/output/charente-maritime\" -i true", "dedupliquer.conseiller-numerique": "tsx src/index.ts dedupliquer -s \"./assets/output/conseiller-numerique/*-conseiller-numerique-lieux-de-mediation-numeriques-national.json\" -b \"./assets/output/conseiller-numerique/*-conseiller-numerique-lieux-de-mediation-numeriques-national.json\" -n \"Conseiller Numerique\" -t \"National\" -o \"./assets/output/conseiller-numerique\" -i true", "dedupliquer.coop-numerique": "tsx src/index.ts dedupliquer -s \"./assets/output/coop-numerique/*-coop-numerique-lieux-de-mediation-numeriques-national.json\" -b \"./assets/output/coop-numerique/*-coop-numerique-lieux-de-mediation-numeriques-national.json\" -n \"Coop numérique\" -t \"National\" -o \"./assets/output/coop-numerique\" -i true", - "dedupliquer.corse": "tsx src/index.ts dedupliquer -s \"./assets/output/corse/*-corse-lieux-de-mediation-numeriques-corse.json\" -b \"./assets/output/corse/*-corse-lieux-de-mediation-numeriques-corse.json\" -n \"Corse\" -t \"Corse\" -o \"./assets/output/corse\" -i true", "dedupliquer.dora": "tsx src/index.ts dedupliquer -s \"./assets/output/dora/*-dora-lieux-de-mediation-numeriques-national.json\" -b \"./assets/output/dora/*-dora-lieux-de-mediation-numeriques-national.json\" -n \"dora\" -t \"National\" -o \"./assets/output/dora\" -i true", - "dedupliquer.epernay": "tsx src/index.ts dedupliquer -s \"./assets/output/epernay/*-epernay-lieux-de-mediation-numeriques-marne.json\" -b \"./assets/output/epernay/*-epernay-lieux-de-mediation-numeriques-marne.json\" -n \"Epernay\" -t \"Marne\" -o \"./assets/output/epernay\" -i true", - "dedupliquer.etapes-numerique": "tsx src/index.ts dedupliquer -s \"./assets/output/etapes-numerique/*-etapes-numerique-lieux-de-mediation-numeriques-national.json\" -b \"./assets/output/etapes-numerique/*-etapes-numerique-lieux-de-mediation-numeriques-national.json\" -n \"Etapes Numerique\" -t \"National\" -o \"./assets/output/etapes-numerique\" -i true", - "dedupliquer.fibre-64": "tsx src/index.ts dedupliquer -s \"./assets/output/fibre-64/*-fibre-64-lieux-de-mediation-numeriques-pyrenees-atlantique.json\" -b \"./assets/output/fibre-64/*-fibre-64-lieux-de-mediation-numeriques-pyrenees-atlantique.json\" -n \"Fibre 64\" -t \"Pyrenees-Atlantique\" -o \"./assets/output/fibre-64\" -i true", "dedupliquer.france-services": "tsx src/index.ts dedupliquer -s \"./assets/output/france-services/*-france-services-lieux-de-mediation-numeriques-national.json\" -b \"./assets/output/france-services/*-france-services-lieux-de-mediation-numeriques-national.json\" -n \"France Services\" -t \"National\" -o \"./assets/output/france-services\" -i true", "dedupliquer.francil-in": "tsx src/index.ts dedupliquer -s \"./assets/output/francil-in/*-francil-in-lieux-de-mediation-numeriques-ile-de-france.json\" -b \"./assets/output/francil-in/*-francil-in-lieux-de-mediation-numeriques-ile-de-france.json\" -n \"Francil-in\" -t \"Île-de-France\" -o \"./assets/output/francil-in\" -i true", - "dedupliquer.gironde": "tsx src/index.ts dedupliquer -s \"./assets/output/gironde/*-gironde-lieux-de-mediation-numeriques-nouvelle-aquitaine.json\" -b \"./assets/output/gironde/*-gironde-lieux-de-mediation-numeriques-nouvelle-aquitaine.json\" -n \"Gironde\" -t\"Nouvelle-Aquitaine\" -o \"./assets/output/gironde\" -i true", "dedupliquer.grand-paris-sud": "tsx src/index.ts dedupliquer -s \"./assets/output/grand-paris-sud/*-grand-paris-sud-lieux-de-mediation-numeriques-ile-de-france.json\" -b \"./assets/output/grand-paris-sud/*-grand-paris-sud-lieux-de-mediation-numeriques-ile-de-france.json\" -n \"Grand Paris Sud\" -t\"Île-de-France\" -o \"./assets/output/grand-paris-sud\" -i true", "dedupliquer.haute-vienne": "tsx src/index.ts dedupliquer -s \"./assets/output/haute-vienne/*-haute-vienne-lieux-de-mediation-numeriques-nouvelle-aquitaine.json\" -b \"./assets/output/haute-vienne/*-haute-vienne-lieux-de-mediation-numeriques-nouvelle-aquitaine.json\" -n \"Haute-Vienne\" -t \"Nouvelle-Aquitaine\" -o \"./assets/output/haute-vienne\" -i true", "dedupliquer.hinaura": "tsx src/index.ts dedupliquer -s \"./assets/output/hinaura/*-hinaura-lieux-de-mediation-numeriques-auvergne-rhone-alpes.json\" -b \"./assets/output/hinaura/*-hinaura-lieux-de-mediation-numeriques-auvergne-rhone-alpes.json\" -n \"Hinaura\" -t \"Auvergne-Rhône-Alpes\" -o \"./assets/output/hinaura\" -i true", "dedupliquer.hub-bretagne": "tsx src/index.ts dedupliquer -s \"./assets/output/hub-bretagne/*-hub-bretagne-lieux-de-mediation-numeriques-bretagne.json\" -b \"./assets/output/hub-bretagne/*-hub-bretagne-lieux-de-mediation-numeriques-bretagne.json\" -n \"Hub Bretagne\" -t \"Bretagne\" -o \"./assets/output/hub-bretagne\" -i true", - "dedupliquer.hub-lo": "tsx src/index.ts dedupliquer -s \"./assets/output/hub-lo/*-hub-lo-lieux-de-mediation-numeriques-centre-val-de-loire.json\" -b \"./assets/output/hub-lo/*-hub-lo-lieux-de-mediation-numeriques-centre-val-de-loire.json\" -n \"Hub-lo\" -t \"Centre-Val-de-Loire\" -o \"./assets/output/hub-lo\" -i true", - "dedupliquer.la-creuse": "tsx src/index.ts dedupliquer -s \"./assets/output/la-creuse/*-la-creuse-lieux-de-mediation-numeriques-nouvelle-aquitaine.json\" -b \"./assets/output/la-creuse/*-la-creuse-lieux-de-mediation-numeriques-nouvelle-aquitaine.json\" -n \"La Creuse\" -t \"Nouvelle-Aquitaine\" -o \"./assets/output/la-creuse\" -i true", - "dedupliquer.le-havre": "tsx src/index.ts dedupliquer -s \"./assets/output/le-havre/*-le-havre-lieux-de-mediation-numeriques-le-havre.json\" -b \"./assets/output/le-havre/*-le-havre-lieux-de-mediation-numeriques-le-havre.json\" -n \"Le Havre\" -t \"Le Havre\" -o \"./assets/output/le-havre\" -i true", - "dedupliquer.les-landes": "tsx src/index.ts dedupliquer -s \"./assets/output/les-landes/*-les-landes-lieux-de-mediation-numeriques-nouvelle-aquitaine.json\" -b \"./assets/output/les-landes/*-les-landes-lieux-de-mediation-numeriques-nouvelle-aquitaine.json\" -n \"Les Landes\" -t \"Nouvelle-Aquitaine\" -o \"./assets/output/les-landes\" -i true", - "dedupliquer.loire-atlantique": "tsx src/index.ts dedupliquer -s \"./assets/output/loire-atlantique/*-loire-atlantique-lieux-de-mediation-numeriques-loire-atlantique.json\" -b \"./assets/output/loire-atlantique/*-loire-atlantique-lieux-de-mediation-numeriques-loire-atlantique.json\" -n \"Loire Atlantique\" -t \"Loire-Atlantique\" -o \"./assets/output/loire-atlantique\" -i true", - "dedupliquer.maine-et-loire": "tsx src/index.ts dedupliquer -s \"./assets/output/maine-et-loire/*-departement-du-maine-et-loire-lieux-de-mediation-numeriques-maine-et-loire.json\" -b \"./assets/output/maine-et-loire/*-departement-du-maine-et-loire-lieux-de-mediation-numeriques-maine-et-loire.json\" -n \"Département du Maine-et-Loire\" -t \"Maine-et-Loire\" -o \"./assets/output/maine-et-loire\" -i true", "dedupliquer.mednum-bfc": "tsx src/index.ts dedupliquer -s \"./assets/output/mednum-bfc/*-mednum-bfc-lieux-de-mediation-numeriques-bourgogne-franche-comte.json\" -b \"./assets/output/mednum-bfc/*-mednum-bfc-lieux-de-mediation-numeriques-bourgogne-franche-comte.json\" -n \"Mednum BFC\" -t \"Bourgogne-Franche-Comté\" -o \"./assets/output/mednum-bfc\" -i true", "dedupliquer.mulhouse": "tsx src/index.ts dedupliquer -s \"./assets/output/mulhouse/*-mulhouse-lieux-de-mediation-numeriques-haut-rhin.json\" -b \"./assets/output/mulhouse/*-mulhouse-lieux-de-mediation-numeriques-haut-rhin.json\" -n \"Mulhouse\" -t \"Haut-Rhin\" -o \"./assets/output/mulhouse\" -i true", - "dedupliquer.nouvelle-caledonie": "tsx src/index.ts dedupliquer -s \"./assets/output/nouvelle-caledonie/*-nouvelle-caledonie-lieux-de-mediation-numeriques-nouvelle-caledonie.json\" -b \"./assets/output/nouvelle-caledonie/*-nouvelle-caledonie-lieux-de-mediation-numeriques-nouvelle-caledonie.json\" -n \"Nouvelle-Calédonie\" -t \"Nouvelle-Calédonie\" -o \"./assets/output/nouvelle-caledonie\" -i true", + "dedupliquer.vendee": "tsx src/index.ts dedupliquer -s \"./assets/output/vendee/*-vendee-lieux-de-mediation-numeriques-vendee.json\" -b \"./assets/output/vendee/*-vendee-lieux-de-mediation-numeriques-vendee.json\" -n \"Vendée\" -t \"Vendée\" -o \"./assets/output/vendee\" -i true", + "dedupliquer.le-havre": "tsx src/index.ts dedupliquer -s \"./assets/output/le-havre/*-le-havre-lieux-de-mediation-numeriques-le-havre.json\" -b \"./assets/output/le-havre/*-le-havre-lieux-de-mediation-numeriques-le-havre.json\" -n \"Le Havre\" -t \"Le Havre\" -o \"./assets/output/le-havre\" -i true", + "dedupliquer.les-landes": "tsx src/index.ts dedupliquer -s \"./assets/output/les-landes/*-les-landes-lieux-de-mediation-numeriques-nouvelle-aquitaine.json\" -b \"./assets/output/les-landes/*-les-landes-lieux-de-mediation-numeriques-nouvelle-aquitaine.json\" -n \"Les Landes\" -t \"Nouvelle-Aquitaine\" -o \"./assets/output/les-landes\" -i true", "dedupliquer.paca": "tsx src/index.ts dedupliquer -s \"./assets/output/paca/*-paca-lieux-de-mediation-numeriques-provence-alpes-cote-d-azur.json\" -b \"./assets/output/paca/*-paca-lieux-de-mediation-numeriques-provence-alpes-cote-d-azur.json\" -n \"Paca\" -t \"Provence-Alpes-Côte d'Azur\" -o \"./assets/output/paca\" -i true", + "dedupliquer.loire-atlantique": "tsx src/index.ts dedupliquer -s \"./assets/output/loire-atlantique/*-loire-atlantique-lieux-de-mediation-numeriques-loire-atlantique.json\" -b \"./assets/output/loire-atlantique/*-loire-atlantique-lieux-de-mediation-numeriques-loire-atlantique.json\" -n \"Loire Atlantique\" -t \"Loire-Atlantique\" -o \"./assets/output/loire-atlantique\" -i true", "dedupliquer.rhin-occ": "tsx src/index.ts dedupliquer -s \"./assets/output/rhin-occ/*-rhinocc-lieux-de-mediation-numeriques-occitanie.json\" -b \"./assets/output/rhin-occ/*-rhinocc-lieux-de-mediation-numeriques-occitanie.json\" -n \"RhinOcc\" -t \"Occitanie\" -o \"./assets/output/rhin-occ\" -i true", "dedupliquer.res-in": "tsx src/index.ts dedupliquer -s \"./assets/output/____/*-____.json\" -b \"./assets/output/____/*-____.json\" -n \"Res-in\" -t \"Lyon\" -o \"./assets/output/res-in\" -i true", "dedupliquer.siilab": "tsx src/index.ts dedupliquer -s \"./assets/output/siilab/*-siilab-lieux-de-mediation-numeriques-hauts-de-france.json\" -b \"./assets/output/siilab/*-siilab-lieux-de-mediation-numeriques-hauts-de-france.json\" -n \"Siilab\" -t \"Hauts-de-France\" -o \"./assets/output/siilab\" -i true", - "dedupliquer.ultra-num": "tsx src/index.ts dedupliquer -s \"./assets/output/____/*-____.json\" -b \"./assets/output/____/*-____.json\" -n \"Ultra-numerique\" -t \"La Reunion\" -o \"./assets/output/ultra-num\" -i true", - "dedupliquer.vendee": "tsx src/index.ts dedupliquer -s \"./assets/output/vendee/*-vendee-lieux-de-mediation-numeriques-vendee.json\" -b \"./assets/output/vendee/*-vendee-lieux-de-mediation-numeriques-vendee.json\" -n \"Vendée\" -t \"Vendée\" -o \"./assets/output/vendee\" -i true", "dedupliquer.merged-json": "tsx src/index.ts dedupliquer -s ./assets/to-deduplicate/merged_output.json -b ./assets/to-deduplicate/merged_output.json -n \"Données dédupliquées\" -t National -o ./assets/deduplicated", "dedupliquer.merged-csv": "tsx src/index.ts dedupliquer -s ./merged_output.csv -b ./merged_output.csv -n \"Données dédupliquées\" -t National -o ./assets/deduplicated", "fusionner": "tsx src/index.ts fusionner -i \"./to-merge/*-sans-doublons.json\" -o \"./merged\"", diff --git a/src/transformer/fields/fiche-acces-libre/fiche-acces-libre.field.spec.ts b/src/transformer/fields/fiche-acces-libre/fiche-acces-libre.field.spec.ts index 2c0f6865..82c36dff 100644 --- a/src/transformer/fields/fiche-acces-libre/fiche-acces-libre.field.spec.ts +++ b/src/transformer/fields/fiche-acces-libre/fiche-acces-libre.field.spec.ts @@ -52,6 +52,30 @@ describe('accessibilite field', (): void => { expect(accessibilite).toBeUndefined(); }); + it('should not get accessibilite url from data source if not valid', (): void => { + const matching: LieuxMediationNumeriqueMatching = { + fiche_acces_libre: { + colonne: 'bf_accessibilit_' + } + } as LieuxMediationNumeriqueMatching; + + const adresseProcessed: Adresse = { + voie: '', + code_postal: '', + commune: '' + } as Adresse; + + const source: DataSource = { + bf_accessibilit_: 'https://acceslibre.beta.gouv.fr/static/js/widget.js' + }; + + const accesLibreData: Erp[] = []; + + const accessibilite: string | undefined = processFicheAccesLibre(source, matching, accesLibreData, adresseProcessed); + + expect(accessibilite).toBeUndefined(); + }); + it('should not get accessibilite url from data source if not valid', (): void => { const matching: LieuxMediationNumeriqueMatching = { fiche_acces_libre: { diff --git a/src/transformer/fields/fiche-acces-libre/fiche-acces-libre.field.ts b/src/transformer/fields/fiche-acces-libre/fiche-acces-libre.field.ts index 558f6f8b..23b5815c 100644 --- a/src/transformer/fields/fiche-acces-libre/fiche-acces-libre.field.ts +++ b/src/transformer/fields/fiche-acces-libre/fiche-acces-libre.field.ts @@ -1,6 +1,6 @@ import { Adresse, Url } from '@gouvfr-anct/lieux-de-mediation-numerique'; -import { LieuxMediationNumeriqueMatching, DataSource, Colonne } from '../../input'; import { ratio } from 'fuzzball'; +import { LieuxMediationNumeriqueMatching, DataSource, Colonne } from '../../input'; export type Erp = { name: string; @@ -41,8 +41,14 @@ const getAccessibiliteFromAccesLibre = ( return accesLibreUrl == null ? undefined : Url(accesLibreUrl); }; -const canProcessAccessibilite = (source: DataSource, accessibilite?: Colonne): accessibilite is Colonne => - accessibilite?.colonne != null && source[accessibilite.colonne] != null && source[accessibilite.colonne] !== ''; +const canProcessAccessibilite = (source: DataSource, accessibilite?: Colonne): accessibilite is Colonne => { + return ( + accessibilite?.colonne != null && + source[accessibilite.colonne] != null && + source[accessibilite.colonne] !== '' && + !(source[accessibilite.colonne] as string).startsWith('https://acceslibre.beta.gouv.fr/static/js/widget.js') + ); +}; const fixUrl = (url: string): string => url.replace(/\(/g, '%28').replace(/\)/g, '%29');