feat: implement pg-ff-client for direct SQL bulk data retrieval and add .claude permission settings

This commit is contained in:
Michael committed 2026-04-24 11:57:26 +02:00
1 parent a1579de6d7
commit 0ad403651d
2 files changed
+8 -4

No files matched your search

+4 -1
View File
@@ -15,7 +15,10 @@
"Bash(node -e \"let d=''; process.stdin.on\\('data',c=>d+=c\\); process.stdin.on\\('end',\\(\\)=>{ const j=JSON.parse\\(d\\); const items=j.top10_ca||[]; if\\(items.length\\) { console.log\\('KEYS:', Object.keys\\(items[0]\\).join\\(', '\\)\\); console.log\\('FIRST:', JSON.stringify\\(items[0], null, 2\\)\\); } else console.log\\('EMPTY'\\); }\\)\")",
"Bash(node -e \"let d=''; process.stdin.on\\('data',c=>d+=c\\); process.stdin.on\\('end',\\(\\)=>{ const j=JSON.parse\\(d\\); const items=Array.isArray\\(j\\)?j:\\(j.data||j.items||j.mouvements||j.list||[]\\); if\\(items.length\\) { console.log\\('KEYS:', Object.keys\\(items[0]\\).join\\(', '\\)\\); console.log\\('FIRST:', JSON.stringify\\(items[0], null, 2\\)\\); } else { console.log\\('STRUCTURE:', Object.keys\\(j\\)\\); console.log\\('RAW:', JSON.stringify\\(j\\).slice\\(0,500\\)\\); } }\\)\")",
"Bash(node -e \"let d=''; process.stdin.on\\('data',c=>d+=c\\); process.stdin.on\\('end',\\(\\)=>{ const j=JSON.parse\\(d\\); const a=\\(j.articles||j\\)[0]; console.log\\('KEYS:', Object.keys\\(a\\).join\\(', '\\)\\); console.log\\('nom_fou_principal:', a.nom_fou_principal\\); console.log\\('codefou_principal:', a.codefou_principal\\); console.log\\('no_id:', a.no_id\\); }\\)\")",
"Bash(node -e \"let d=''; process.stdin.on\\('data',c=>d+=c\\); process.stdin.on\\('end',\\(\\)=>{ console.log\\(JSON.stringify\\(JSON.parse\\(d\\), null, 2\\)\\); }\\)\")"
"Bash(node -e \"let d=''; process.stdin.on\\('data',c=>d+=c\\); process.stdin.on\\('end',\\(\\)=>{ console.log\\(JSON.stringify\\(JSON.parse\\(d\\), null, 2\\)\\); }\\)\")",
"Bash(node -e \"let d=''; process.stdin.on\\('data',c=>d+=c\\); process.stdin.on\\('end',\\(\\)=>{ const j=JSON.parse\\(d\\); const rows=Array.isArray\\(j\\)?j:\\(j.propositions??j.data??j.items??[]\\); console.log\\('top-level keys:', Object.keys\\(j\\)\\); if\\(rows.length\\){ const s=rows[0]; console.log\\('row keys:', Object.keys\\(s\\).join\\(', '\\)\\); console.log\\('franco_ht:', s.franco_ht, '| franco:', s.franco, '| franco_atteint:', s.franco_atteint\\); } else console.log\\('empty'\\); }\\)\")",
"Bash(node -e \"let d=''; process.stdin.on\\('data',c=>d+=c\\); process.stdin.on\\('end',\\(\\)=>{ const j=JSON.parse\\(d\\); console.log\\('top-level keys:', Object.keys\\(j\\)\\); const resume=j.resume; console.log\\('resume type:', Array.isArray\\(resume\\)?'array':'object'\\); if\\(Array.isArray\\(resume\\)&&resume.length\\){ console.log\\('resume[0]:', JSON.stringify\\(resume[0],null,2\\)\\); } else { console.log\\('resume:', JSON.stringify\\(resume,null,2\\)\\); } }\\)\")",
"Bash(node -e \"let d=''; process.stdin.on\\('data',c=>d+=c\\); process.stdin.on\\('end',\\(\\)=>{ const j=JSON.parse\\(d\\); console.log\\('top-level keys:', Object.keys\\(j\\)\\); const resume=j.resume; console.log\\('resume type:', Array.isArray\\(resume\\)?'array':'object'\\); if\\(Array.isArray\\(resume\\)&&resume.length\\){ console.log\\('resume[0]:', JSON.stringify\\(resume[0]\\)\\); } else { console.log\\('resume:', JSON.stringify\\(resume\\)\\); } }\\)\")"
]
}
}
+4 -3
View File
@@ -1157,11 +1157,12 @@ export async function pgGetCommandesAuto(): Promise<PgCommandeAutoRow[]> {
.then(res2 => res2.ok ? res2.json() : null)
.then(detail => {
if (!detail) return null;
// Le detail endpoint retourne { resume: { franco_ht, ... }, articles: [...] }
// Le detail endpoint retourne { resume: [...] } (tableau) ou { resume: {} }
// ou directement les champs du résumé
const resume = detail?.resume ?? detail?.summary ?? detail;
const resumeRaw = detail?.resume ?? detail?.summary ?? detail;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const francoVal = Number((resume as any)?.franco_ht ?? (resume as any)?.franco ?? 0);
const resumeItem: any = Array.isArray(resumeRaw) ? resumeRaw[0] : resumeRaw;
const francoVal = Number(resumeItem?.franco_ht ?? resumeItem?.franco ?? 0);
return { codefou: r.codefou, site: r.site, franco: francoVal };
})
.catch(() => null)