Files
veille-ia-gen/nodered-flows/license-watch.json
T
cyber-mawonaj 6978fbb5b8 feat(app) : phase 2 — endpoint /api/alerts, inbox, flows Node-RED
- POST /api/alerts : token Bearer (comparaison temps constant, 503 si non
  configuré), schéma d'alerte PRD §4.4 validé Zod, exempté du SSO dans les hooks
- Persistance alertes.yaml + commits git (réception, « traité »)
- Inbox /alertes : filtres par profil impacté et statut, actions « Marquer
  traité » et « Créer/MAJ fiche » avec pré-remplissage du formulaire registre
  depuis l'alerte (aucun champ licence/capacité inventé)
- nodered-flows/ : 4 flows importables (rss-ingest, license-watch, classifier
  avec le prompt figé du PRD §6 embarqué tel quel, notify) — nœuds core
  uniquement, configuration par variables d'env, README de câblage
- Vérifié : check/lint/test (27) /build verts, autofixer propre, JSON des flows
  et fonctions embarquées validés, test fumée HTTP (201/400/401 sur l'endpoint,
  inbox, traité + commit, pré-remplissage MAJ fiche)
2026-08-01 10:40:18 -04:00

70 lines
2.4 KiB
JSON

[
{
"id": "tab_license_watch",
"type": "tab",
"label": "veille-ia : license-watch",
"disabled": false,
"info": "PRD §5.2 — Réception des webhooks changedetection_ynh (URLs ToS/licences : BFL, MiniMax Community License, cards HF, Midjourney, Runway, Suno, Steam/itch.io policies) → POST classifier avec type changement_licence et urgence haute.\n\nDans changedetection : Notification URL = post://127.0.0.1:1880/veille-ia/license-watch (adapter si Node-RED sur un autre hôte).\n\nVariables d'environnement :\n- CLASSIFIER_URL (défaut http://127.0.0.1:1880/veille-ia/classifier)"
},
{
"id": "lw_http_in",
"type": "http in",
"z": "tab_license_watch",
"name": "webhook changedetection",
"url": "/veille-ia/license-watch",
"method": "post",
"upload": false,
"swaggerDoc": "",
"x": 170,
"y": 100,
"wires": [["lw_preparer"]]
},
{
"id": "lw_preparer",
"type": "function",
"z": "tab_license_watch",
"name": "Préparer (type licence, urgence haute)",
"func": "// changedetection.io envoie selon sa configuration :\n// title, watch_url, diff_url, body/diff…\nconst p = msg.payload || {};\nmsg.titreOriginal = `Changement détecté : ${p.title || p.watch_url || 'page surveillée'}`;\nmsg.texte = [\n `Page surveillée : ${p.watch_url || '(inconnue)'}`,\n p.diff_url ? `Diff : ${p.diff_url}` : '',\n '',\n p.body || p.diff || JSON.stringify(p)\n].join('\\n');\nmsg.lien = p.watch_url || null;\nmsg.typeSuggere = 'changement_licence';\nmsg.urgenceSuggeree = 'haute';\nmsg.method = 'POST';\nmsg.url = env.get('CLASSIFIER_URL') || 'http://127.0.0.1:1880/veille-ia/classifier';\nmsg.headers = { 'content-type': 'application/json' };\nmsg.payload = msg.texte;\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 460,
"y": 100,
"wires": [["lw_vers_classifier"]]
},
{
"id": "lw_vers_classifier",
"type": "http request",
"z": "tab_license_watch",
"name": "POST classifier",
"method": "use",
"ret": "txt",
"paytoqs": "ignore",
"url": "",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [],
"x": 730,
"y": 100,
"wires": [["lw_response"]]
},
{
"id": "lw_response",
"type": "http response",
"z": "tab_license_watch",
"name": "202",
"statusCode": "202",
"headers": {},
"x": 890,
"y": 100,
"wires": []
}
]