@tricoteuses/senat 3.1.22 → 3.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/LICENSE.md +32 -32
  2. package/README.md +326 -326
  3. package/lib/src/index.d.ts +1 -0
  4. package/lib/src/other_types/collaborateurs.d.ts +5 -0
  5. package/lib/src/parsers/collaborateurs.d.ts +44 -0
  6. package/lib/src/parsers/collaborateurs.js +157 -0
  7. package/lib/src/rich_types/sens.d.ts +5 -0
  8. package/lib/src/scripts/data-download.js +1 -0
  9. package/lib/src/scripts/retrieve_collaborateurs.js +166 -0
  10. package/lib/src/scripts/retrieve_cr_seance.js +34 -25
  11. package/lib/src/scripts/retrieve_videos.js +13 -8
  12. package/lib/src/scripts/shared/incremental_import_sql.js +866 -859
  13. package/lib/src/scripts/shared/schema_version.js +84 -84
  14. package/lib/src/scripts/shared/staging_metadata_sql.js +214 -214
  15. package/lib/src/scripts/validate_prefixed_tables.js +12 -12
  16. package/lib/src/server/ameli.js +14 -13
  17. package/lib/src/server/conversion_textes.js +106 -106
  18. package/lib/src/server/debats.js +10 -10
  19. package/lib/src/server/documents.js +22 -22
  20. package/lib/src/server/dosleg.js +33 -33
  21. package/lib/src/server/questions.js +10 -10
  22. package/lib/src/server/scrutins.js +3 -3
  23. package/lib/src/server/sens.js +19 -19
  24. package/lib/src/utils/reunion_odj_building.js +0 -4
  25. package/lib/src/videos/match.js +7 -5
  26. package/lib/src/videos/pipeline.js +26 -19
  27. package/lib/tests/collaborateurs.test.js +115 -0
  28. package/lib/tests/incrementalImportSql.test.js +4 -1
  29. package/package.json +121 -119
  30. package/lib/add-js-extensions-v2.js +0 -23
  31. package/lib/add-js-extensions.js +0 -17
  32. package/lib/aggregates.d.ts +0 -52
  33. package/lib/aggregates.js +0 -930
  34. package/lib/aggregates.mjs +0 -713
  35. package/lib/aggregates.ts +0 -833
  36. package/lib/config.d.ts +0 -10
  37. package/lib/config.js +0 -16
  38. package/lib/config.mjs +0 -16
  39. package/lib/config.ts +0 -26
  40. package/lib/databases.d.ts +0 -2
  41. package/lib/databases.js +0 -26
  42. package/lib/databases.mjs +0 -57
  43. package/lib/databases.ts +0 -71
  44. package/lib/datasets.d.ts +0 -34
  45. package/lib/datasets.js +0 -233
  46. package/lib/datasets.mjs +0 -78
  47. package/lib/datasets.ts +0 -118
  48. package/lib/fields.d.ts +0 -10
  49. package/lib/fields.js +0 -68
  50. package/lib/fields.mjs +0 -22
  51. package/lib/fields.ts +0 -29
  52. package/lib/git.d.ts +0 -26
  53. package/lib/git.js +0 -167
  54. package/lib/index.d.ts +0 -13
  55. package/lib/index.js +0 -1
  56. package/lib/index.mjs +0 -7
  57. package/lib/index.ts +0 -64
  58. package/lib/inserters.d.ts +0 -98
  59. package/lib/inserters.js +0 -500
  60. package/lib/inserters.mjs +0 -360
  61. package/lib/inserters.ts +0 -521
  62. package/lib/legislatures.json +0 -38
  63. package/lib/loaders.d.ts +0 -58
  64. package/lib/loaders.js +0 -286
  65. package/lib/loaders.mjs +0 -158
  66. package/lib/loaders.ts +0 -271
  67. package/lib/model/agenda.d.ts +0 -6
  68. package/lib/model/agenda.js +0 -148
  69. package/lib/model/ameli.d.ts +0 -51
  70. package/lib/model/ameli.js +0 -149
  71. package/lib/model/ameli.mjs +0 -84
  72. package/lib/model/ameli.ts +0 -100
  73. package/lib/model/commission.d.ts +0 -18
  74. package/lib/model/commission.js +0 -269
  75. package/lib/model/debats.d.ts +0 -67
  76. package/lib/model/debats.js +0 -95
  77. package/lib/model/debats.mjs +0 -43
  78. package/lib/model/debats.ts +0 -68
  79. package/lib/model/documents.d.ts +0 -12
  80. package/lib/model/documents.js +0 -151
  81. package/lib/model/dosleg.d.ts +0 -7
  82. package/lib/model/dosleg.js +0 -326
  83. package/lib/model/dosleg.mjs +0 -196
  84. package/lib/model/dosleg.ts +0 -240
  85. package/lib/model/index.d.ts +0 -7
  86. package/lib/model/index.js +0 -7
  87. package/lib/model/index.mjs +0 -5
  88. package/lib/model/index.ts +0 -15
  89. package/lib/model/questions.d.ts +0 -45
  90. package/lib/model/questions.js +0 -89
  91. package/lib/model/questions.mjs +0 -71
  92. package/lib/model/questions.ts +0 -93
  93. package/lib/model/scrutins.d.ts +0 -13
  94. package/lib/model/scrutins.js +0 -114
  95. package/lib/model/seance.d.ts +0 -3
  96. package/lib/model/seance.js +0 -267
  97. package/lib/model/sens.d.ts +0 -146
  98. package/lib/model/sens.js +0 -454
  99. package/lib/model/sens.mjs +0 -415
  100. package/lib/model/sens.ts +0 -516
  101. package/lib/model/texte.d.ts +0 -7
  102. package/lib/model/texte.js +0 -256
  103. package/lib/model/texte.mjs +0 -208
  104. package/lib/model/texte.ts +0 -229
  105. package/lib/model/util.d.ts +0 -9
  106. package/lib/model/util.js +0 -38
  107. package/lib/model/util.mjs +0 -19
  108. package/lib/model/util.ts +0 -32
  109. package/lib/parsers/texte.d.ts +0 -7
  110. package/lib/parsers/texte.js +0 -228
  111. package/lib/raw_types/ameli.d.ts +0 -914
  112. package/lib/raw_types/ameli.js +0 -5
  113. package/lib/raw_types/ameli.mjs +0 -163
  114. package/lib/raw_types/debats.d.ts +0 -207
  115. package/lib/raw_types/debats.js +0 -5
  116. package/lib/raw_types/debats.mjs +0 -58
  117. package/lib/raw_types/dosleg.d.ts +0 -1619
  118. package/lib/raw_types/dosleg.js +0 -5
  119. package/lib/raw_types/dosleg.mjs +0 -438
  120. package/lib/raw_types/questions.d.ts +0 -419
  121. package/lib/raw_types/questions.js +0 -5
  122. package/lib/raw_types/questions.mjs +0 -11
  123. package/lib/raw_types/senat.d.ts +0 -11368
  124. package/lib/raw_types/senat.js +0 -5
  125. package/lib/raw_types/sens.d.ts +0 -8248
  126. package/lib/raw_types/sens.js +0 -5
  127. package/lib/raw_types/sens.mjs +0 -508
  128. package/lib/raw_types_kysely/ameli.d.ts +0 -915
  129. package/lib/raw_types_kysely/ameli.js +0 -7
  130. package/lib/raw_types_kysely/ameli.mjs +0 -5
  131. package/lib/raw_types_kysely/ameli.ts +0 -951
  132. package/lib/raw_types_kysely/debats.d.ts +0 -207
  133. package/lib/raw_types_kysely/debats.js +0 -7
  134. package/lib/raw_types_kysely/debats.mjs +0 -5
  135. package/lib/raw_types_kysely/debats.ts +0 -222
  136. package/lib/raw_types_kysely/dosleg.d.ts +0 -3532
  137. package/lib/raw_types_kysely/dosleg.js +0 -7
  138. package/lib/raw_types_kysely/dosleg.mjs +0 -5
  139. package/lib/raw_types_kysely/dosleg.ts +0 -3621
  140. package/lib/raw_types_kysely/questions.d.ts +0 -414
  141. package/lib/raw_types_kysely/questions.js +0 -7
  142. package/lib/raw_types_kysely/questions.mjs +0 -5
  143. package/lib/raw_types_kysely/questions.ts +0 -426
  144. package/lib/raw_types_kysely/sens.d.ts +0 -4394
  145. package/lib/raw_types_kysely/sens.js +0 -7
  146. package/lib/raw_types_kysely/sens.mjs +0 -5
  147. package/lib/raw_types_kysely/sens.ts +0 -4499
  148. package/lib/raw_types_schemats/ameli.d.ts +0 -539
  149. package/lib/raw_types_schemats/ameli.js +0 -2
  150. package/lib/raw_types_schemats/ameli.mjs +0 -2
  151. package/lib/raw_types_schemats/ameli.ts +0 -601
  152. package/lib/raw_types_schemats/debats.d.ts +0 -127
  153. package/lib/raw_types_schemats/debats.js +0 -2
  154. package/lib/raw_types_schemats/debats.mjs +0 -2
  155. package/lib/raw_types_schemats/debats.ts +0 -145
  156. package/lib/raw_types_schemats/dosleg.d.ts +0 -977
  157. package/lib/raw_types_schemats/dosleg.js +0 -2
  158. package/lib/raw_types_schemats/dosleg.mjs +0 -2
  159. package/lib/raw_types_schemats/dosleg.ts +0 -2193
  160. package/lib/raw_types_schemats/questions.d.ts +0 -235
  161. package/lib/raw_types_schemats/questions.js +0 -2
  162. package/lib/raw_types_schemats/questions.mjs +0 -2
  163. package/lib/raw_types_schemats/questions.ts +0 -249
  164. package/lib/raw_types_schemats/sens.d.ts +0 -6915
  165. package/lib/raw_types_schemats/sens.js +0 -2
  166. package/lib/raw_types_schemats/sens.mjs +0 -2
  167. package/lib/raw_types_schemats/sens.ts +0 -2907
  168. package/lib/scripts/convert_data.js +0 -354
  169. package/lib/scripts/convert_data.mjs +0 -181
  170. package/lib/scripts/convert_data.ts +0 -243
  171. package/lib/scripts/data-download.d.ts +0 -1
  172. package/lib/scripts/data-download.js +0 -12
  173. package/lib/scripts/datautil.d.ts +0 -8
  174. package/lib/scripts/datautil.js +0 -34
  175. package/lib/scripts/datautil.mjs +0 -16
  176. package/lib/scripts/datautil.ts +0 -19
  177. package/lib/scripts/images/transparent_150x192.jpg +0 -0
  178. package/lib/scripts/images/transparent_155x225.jpg +0 -0
  179. package/lib/scripts/parse_textes.d.ts +0 -1
  180. package/lib/scripts/parse_textes.js +0 -44
  181. package/lib/scripts/parse_textes.mjs +0 -46
  182. package/lib/scripts/parse_textes.ts +0 -65
  183. package/lib/scripts/retrieve_agenda.d.ts +0 -1
  184. package/lib/scripts/retrieve_agenda.js +0 -132
  185. package/lib/scripts/retrieve_cr_commission.d.ts +0 -1
  186. package/lib/scripts/retrieve_cr_commission.js +0 -364
  187. package/lib/scripts/retrieve_cr_seance.d.ts +0 -6
  188. package/lib/scripts/retrieve_cr_seance.js +0 -347
  189. package/lib/scripts/retrieve_documents.d.ts +0 -3
  190. package/lib/scripts/retrieve_documents.js +0 -219
  191. package/lib/scripts/retrieve_documents.mjs +0 -249
  192. package/lib/scripts/retrieve_documents.ts +0 -298
  193. package/lib/scripts/retrieve_open_data.d.ts +0 -1
  194. package/lib/scripts/retrieve_open_data.js +0 -315
  195. package/lib/scripts/retrieve_open_data.mjs +0 -217
  196. package/lib/scripts/retrieve_open_data.ts +0 -268
  197. package/lib/scripts/retrieve_senateurs_photos.d.ts +0 -1
  198. package/lib/scripts/retrieve_senateurs_photos.js +0 -147
  199. package/lib/scripts/retrieve_senateurs_photos.mjs +0 -147
  200. package/lib/scripts/retrieve_senateurs_photos.ts +0 -177
  201. package/lib/scripts/retrieve_videos.d.ts +0 -1
  202. package/lib/scripts/retrieve_videos.js +0 -461
  203. package/lib/scripts/shared/cli_helpers.d.ts +0 -95
  204. package/lib/scripts/shared/cli_helpers.js +0 -91
  205. package/lib/scripts/shared/cli_helpers.ts +0 -36
  206. package/lib/scripts/shared/util.d.ts +0 -4
  207. package/lib/scripts/shared/util.js +0 -35
  208. package/lib/scripts/shared/util.ts +0 -33
  209. package/lib/scripts/test_iter_load.d.ts +0 -1
  210. package/lib/scripts/test_iter_load.js +0 -12
  211. package/lib/src/ameli.d.ts +0 -66
  212. package/lib/src/ameli.js +0 -1
  213. package/lib/src/config.d.ts +0 -43
  214. package/lib/src/config.js +0 -37
  215. package/lib/src/conversion_textes.d.ts +0 -11
  216. package/lib/src/conversion_textes.js +0 -320
  217. package/lib/src/databases.d.ts +0 -3
  218. package/lib/src/databases.js +0 -26
  219. package/lib/src/databases_postgres.d.ts +0 -4
  220. package/lib/src/databases_postgres.js +0 -23
  221. package/lib/src/datasets.d.ts +0 -38
  222. package/lib/src/datasets.js +0 -247
  223. package/lib/src/db_types/ameli.d.ts +0 -1762
  224. package/lib/src/db_types/ameli.js +0 -1074
  225. package/lib/src/db_types/debats.d.ts +0 -380
  226. package/lib/src/db_types/debats.js +0 -266
  227. package/lib/src/db_types/dosleg.d.ts +0 -2954
  228. package/lib/src/db_types/dosleg.js +0 -2005
  229. package/lib/src/db_types/questions.d.ts +0 -699
  230. package/lib/src/db_types/questions.js +0 -493
  231. package/lib/src/db_types/sens.d.ts +0 -7843
  232. package/lib/src/db_types/sens.js +0 -4691
  233. package/lib/src/debats.d.ts +0 -38
  234. package/lib/src/debats.js +0 -1
  235. package/lib/src/dosleg.d.ts +0 -142
  236. package/lib/src/dosleg.js +0 -193
  237. package/lib/src/git.d.ts +0 -27
  238. package/lib/src/git.js +0 -251
  239. package/lib/src/loaders.d.ts +0 -52
  240. package/lib/src/loaders.js +0 -260
  241. package/lib/src/model/agenda.d.ts +0 -6
  242. package/lib/src/model/agenda.js +0 -148
  243. package/lib/src/model/ameli.d.ts +0 -67
  244. package/lib/src/model/ameli.js +0 -150
  245. package/lib/src/model/ameli_postgres.d.ts +0 -67
  246. package/lib/src/model/ameli_postgres.js +0 -150
  247. package/lib/src/model/commission.d.ts +0 -19
  248. package/lib/src/model/commission.js +0 -269
  249. package/lib/src/model/debats.d.ts +0 -39
  250. package/lib/src/model/debats.js +0 -112
  251. package/lib/src/model/documents.d.ts +0 -32
  252. package/lib/src/model/documents.js +0 -182
  253. package/lib/src/model/dosleg.d.ts +0 -144
  254. package/lib/src/model/dosleg.js +0 -468
  255. package/lib/src/model/index.d.ts +0 -7
  256. package/lib/src/model/index.js +0 -7
  257. package/lib/src/model/questions.d.ts +0 -54
  258. package/lib/src/model/questions.js +0 -91
  259. package/lib/src/model/scrutins.d.ts +0 -48
  260. package/lib/src/model/scrutins.js +0 -121
  261. package/lib/src/model/seance.d.ts +0 -3
  262. package/lib/src/model/seance.js +0 -267
  263. package/lib/src/model/sens.d.ts +0 -112
  264. package/lib/src/model/sens.js +0 -385
  265. package/lib/src/model/util.d.ts +0 -1
  266. package/lib/src/model/util.js +0 -15
  267. package/lib/src/other_types/questions.d.ts +0 -2
  268. package/lib/src/other_types/questions.js +0 -1
  269. package/lib/src/questions.d.ts +0 -53
  270. package/lib/src/questions.js +0 -1
  271. package/lib/src/raw_types/ameli.d.ts +0 -1762
  272. package/lib/src/raw_types/ameli.js +0 -1074
  273. package/lib/src/raw_types/debats.d.ts +0 -380
  274. package/lib/src/raw_types/debats.js +0 -266
  275. package/lib/src/raw_types/dosleg.d.ts +0 -2954
  276. package/lib/src/raw_types/dosleg.js +0 -2005
  277. package/lib/src/raw_types/questions.d.ts +0 -699
  278. package/lib/src/raw_types/questions.js +0 -493
  279. package/lib/src/raw_types/senat.d.ts +0 -11372
  280. package/lib/src/raw_types/senat.js +0 -5
  281. package/lib/src/raw_types/sens.d.ts +0 -7843
  282. package/lib/src/raw_types/sens.js +0 -4691
  283. package/lib/src/raw_types_schemats/ameli.d.ts +0 -541
  284. package/lib/src/raw_types_schemats/ameli.js +0 -2
  285. package/lib/src/raw_types_schemats/debats.d.ts +0 -127
  286. package/lib/src/raw_types_schemats/debats.js +0 -2
  287. package/lib/src/raw_types_schemats/dosleg.d.ts +0 -977
  288. package/lib/src/raw_types_schemats/dosleg.js +0 -2
  289. package/lib/src/raw_types_schemats/questions.d.ts +0 -237
  290. package/lib/src/raw_types_schemats/questions.js +0 -2
  291. package/lib/src/raw_types_schemats/sens.d.ts +0 -2709
  292. package/lib/src/raw_types_schemats/sens.js +0 -2
  293. package/lib/src/rich_types/agenda.d.ts +0 -45
  294. package/lib/src/rich_types/agenda.js +0 -1
  295. package/lib/src/rich_types/compte_rendu.d.ts +0 -83
  296. package/lib/src/rich_types/compte_rendu.js +0 -1
  297. package/lib/src/rich_types/sessions.d.ts +0 -6
  298. package/lib/src/rich_types/sessions.js +0 -19
  299. package/lib/src/rich_types/texte.d.ts +0 -72
  300. package/lib/src/rich_types/texte.js +0 -15
  301. package/lib/src/scripts/test_iter_load.d.ts +0 -1
  302. package/lib/src/scripts/test_iter_load.js +0 -12
  303. package/lib/src/sens.d.ts +0 -104
  304. package/lib/src/sens.js +0 -1
  305. package/lib/src/types/agenda.d.ts +0 -45
  306. package/lib/src/types/agenda.js +0 -1
  307. package/lib/src/types/ameli.d.ts +0 -1762
  308. package/lib/src/types/ameli.js +0 -1074
  309. package/lib/src/types/compte_rendu.d.ts +0 -83
  310. package/lib/src/types/compte_rendu.js +0 -1
  311. package/lib/src/types/debats.d.ts +0 -380
  312. package/lib/src/types/debats.js +0 -266
  313. package/lib/src/types/dosleg.d.ts +0 -2954
  314. package/lib/src/types/dosleg.js +0 -2005
  315. package/lib/src/types/questions.d.ts +0 -699
  316. package/lib/src/types/questions.js +0 -493
  317. package/lib/src/types/sens.d.ts +0 -7843
  318. package/lib/src/types/sens.js +0 -4691
  319. package/lib/src/types/sessions.d.ts +0 -6
  320. package/lib/src/types/sessions.js +0 -19
  321. package/lib/src/types/texte.d.ts +0 -72
  322. package/lib/src/types/texte.js +0 -15
  323. package/lib/src/validators/config.d.ts +0 -9
  324. package/lib/src/validators/config.js +0 -10
  325. package/lib/strings.d.ts +0 -1
  326. package/lib/strings.js +0 -18
  327. package/lib/strings.mjs +0 -18
  328. package/lib/strings.ts +0 -26
  329. package/lib/tsconfig.tsbuildinfo +0 -1
  330. package/lib/types/agenda.d.ts +0 -44
  331. package/lib/types/agenda.js +0 -1
  332. package/lib/types/ameli.d.ts +0 -5
  333. package/lib/types/ameli.js +0 -1
  334. package/lib/types/ameli.mjs +0 -13
  335. package/lib/types/ameli.ts +0 -21
  336. package/lib/types/compte_rendu.d.ts +0 -83
  337. package/lib/types/compte_rendu.js +0 -1
  338. package/lib/types/debats.d.ts +0 -2
  339. package/lib/types/debats.js +0 -1
  340. package/lib/types/debats.mjs +0 -2
  341. package/lib/types/debats.ts +0 -6
  342. package/lib/types/dosleg.d.ts +0 -70
  343. package/lib/types/dosleg.js +0 -1
  344. package/lib/types/dosleg.mjs +0 -151
  345. package/lib/types/dosleg.ts +0 -284
  346. package/lib/types/questions.d.ts +0 -2
  347. package/lib/types/questions.js +0 -1
  348. package/lib/types/questions.mjs +0 -1
  349. package/lib/types/questions.ts +0 -3
  350. package/lib/types/sens.d.ts +0 -10
  351. package/lib/types/sens.js +0 -1
  352. package/lib/types/sens.mjs +0 -1
  353. package/lib/types/sens.ts +0 -12
  354. package/lib/types/sessions.d.ts +0 -5
  355. package/lib/types/sessions.js +0 -84
  356. package/lib/types/sessions.mjs +0 -43
  357. package/lib/types/sessions.ts +0 -42
  358. package/lib/types/texte.d.ts +0 -74
  359. package/lib/types/texte.js +0 -16
  360. package/lib/types/texte.mjs +0 -16
  361. package/lib/types/texte.ts +0 -76
  362. package/lib/typings/windows-1252.d.js +0 -2
  363. package/lib/typings/windows-1252.d.mjs +0 -2
  364. package/lib/typings/windows-1252.d.ts +0 -11
  365. package/lib/utils/cr_spliting.d.ts +0 -28
  366. package/lib/utils/cr_spliting.js +0 -265
  367. package/lib/utils/date.d.ts +0 -10
  368. package/lib/utils/date.js +0 -100
  369. package/lib/utils/nvs-timecode.d.ts +0 -7
  370. package/lib/utils/nvs-timecode.js +0 -79
  371. package/lib/utils/reunion_grouping.d.ts +0 -9
  372. package/lib/utils/reunion_grouping.js +0 -361
  373. package/lib/utils/reunion_odj_building.d.ts +0 -5
  374. package/lib/utils/reunion_odj_building.js +0 -154
  375. package/lib/utils/reunion_parsing.d.ts +0 -23
  376. package/lib/utils/reunion_parsing.js +0 -209
  377. package/lib/utils/scoring.d.ts +0 -14
  378. package/lib/utils/scoring.js +0 -147
  379. package/lib/utils/string_cleaning.d.ts +0 -7
  380. package/lib/utils/string_cleaning.js +0 -57
  381. package/lib/validators/config.d.ts +0 -9
  382. package/lib/validators/config.js +0 -10
  383. package/lib/validators/config.mjs +0 -54
  384. package/lib/validators/config.ts +0 -79
  385. package/lib/validators/senat.d.ts +0 -0
  386. package/lib/validators/senat.js +0 -28
  387. package/lib/validators/senat.mjs +0 -24
  388. package/lib/validators/senat.ts +0 -26
  389. /package/lib/{add-js-extensions-v2.d.ts → src/other_types/collaborateurs.js} +0 -0
  390. /package/lib/{add-js-extensions.d.ts → src/scripts/retrieve_collaborateurs.d.ts} +0 -0
  391. /package/lib/{scripts/convert_data.d.ts → tests/collaborateurs.test.d.ts} +0 -0
@@ -1,209 +0,0 @@
1
- import { DateTime } from "luxon";
2
- import { buildOdj } from "./reunion_odj_building";
3
- import { norm } from "./string_cleaning";
4
- const PARIS = "Europe/Paris";
5
- const STOPWORDS = new Set([
6
- "de",
7
- "du",
8
- "des",
9
- "la",
10
- "le",
11
- "les",
12
- "l",
13
- "d",
14
- "et",
15
- "en",
16
- "au",
17
- "aux",
18
- "pour",
19
- "sur",
20
- "sous",
21
- "à",
22
- "a",
23
- "aux",
24
- ]);
25
- function toReunion(e, dossierBySenatUrl, uid) {
26
- const date = norm(e.date) ?? e.date;
27
- const { startISO, endISO } = deriveTimesForEvent(e);
28
- const startTime = startISO ?? e.startTime ?? null;
29
- const endTime = endISO ?? e.endTime ?? null;
30
- return {
31
- uid,
32
- chambre: "SN",
33
- date,
34
- type: e.type || "",
35
- organe: e.organe || undefined,
36
- startTime,
37
- endTime,
38
- captationVideo: e.captationVideo === true,
39
- titre: e.titre,
40
- objet: e.objet || "",
41
- events: [e], // TODO remove
42
- odj: buildOdj([e], dossierBySenatUrl),
43
- };
44
- }
45
- export function buildReunionsByBucket(events, dossierBySenatUrl) {
46
- const out = { IDS: [], IDC: [], IDM: [], IDO: [], IDI: [] };
47
- if (!events?.length)
48
- return out;
49
- for (const e of events) {
50
- const kind = classifyAgendaType(e?.type);
51
- if (!kind) {
52
- continue;
53
- console.warn("Can't determine type of reunion");
54
- }
55
- const bucket = typeToSuffixStrict(kind);
56
- const uid = makeReunionUid(e.date, kind, e.id, e.organe ?? null);
57
- out[bucket].push(toReunion(e, dossierBySenatUrl, uid));
58
- }
59
- // Tri stable par bucket (date + heure, inconnus à la fin)
60
- for (const k of Object.keys(out)) {
61
- out[k].sort((a, b) => {
62
- const da = DateTime.fromISO(`${a.date}T${a.startTime || "23:59:59.999+02:00"}`, { zone: PARIS }).toMillis();
63
- const db = DateTime.fromISO(`${b.date}T${b.startTime || "23:59:59.999+02:00"}`, { zone: PARIS }).toMillis();
64
- return da - db || (a.organe || "").localeCompare(b.organe || "") || (a.titre || "").localeCompare(b.titre || "");
65
- });
66
- }
67
- return out;
68
- }
69
- function normalizeNoAccents(s) {
70
- return (s || "")
71
- .trim()
72
- .normalize("NFKD")
73
- .replace(/[\u0300-\u036f]/g, "");
74
- }
75
- function classifyAgendaType(typeLabel) {
76
- const s = normalizeNoAccents(typeLabel || "").toLowerCase();
77
- if (/\bseance\b.*\bpublique\b/.test(s))
78
- return "SP";
79
- if (/\bcommissions\b/.test(s))
80
- return "COM";
81
- if (/\bmission\b.*\bcontrole\b/.test(s))
82
- return "MC";
83
- if (/\boffices\b|\bdelegations\b/.test(s))
84
- return "OD";
85
- if (/\instances\b|\decisionelles\b/.test(s))
86
- return "ID";
87
- return null;
88
- }
89
- function typeToSuffixStrict(kind) {
90
- switch (kind) {
91
- case "SP":
92
- return "IDS";
93
- case "COM":
94
- return "IDC";
95
- case "MC":
96
- return "IDM";
97
- case "OD":
98
- return "IDO";
99
- case "ID":
100
- return "IDI";
101
- }
102
- }
103
- function organeInitials(input, maxLen = 8) {
104
- if (!input)
105
- return "";
106
- const clean = normalizeNoAccents(input)
107
- .replace(/['’]/g, " ")
108
- .replace(/[^A-Za-z0-9\s]/g, " ")
109
- .replace(/\s+/g, " ")
110
- .trim();
111
- if (!clean)
112
- return "";
113
- const parts = clean.split(" ");
114
- const letters = [];
115
- for (const raw of parts) {
116
- const w = raw.toLowerCase();
117
- if (!w)
118
- continue;
119
- if (STOPWORDS.has(w))
120
- continue;
121
- // Take two first letter if alphanumeric
122
- const two = raw.slice(0, 2);
123
- if (/[A-Za-z0-9]/.test(two))
124
- letters.push(two.toUpperCase());
125
- }
126
- const out = letters.join("");
127
- return out.slice(0, maxLen);
128
- }
129
- export function makeReunionUid(dateISO, kind, agendaEventId, organe) {
130
- const ymd = dateISO ? formatYYYYMMDD(dateISO) : "00000000";
131
- const suffix = typeToSuffixStrict(kind);
132
- const org = organe && suffix !== "IDS" ? organeInitials(organe) : "";
133
- let base = `RUSN${ymd}${suffix}${org}${agendaEventId}`;
134
- return base;
135
- }
136
- export function formatYYYYMMDD(dateYYYYMMDD) {
137
- const [y, m, d] = dateYYYYMMDD.split("-");
138
- return `${y}${m}${d}`;
139
- }
140
- // Extract hours/minutes from French text like "à 10 h 30", "de 10 h à 12 h", etc.
141
- function parseTimeOriginalFR(timeOriginal) {
142
- if (!timeOriginal)
143
- return { start: null, end: null };
144
- const txt = (timeOriginal || "")
145
- .replace(/\u00A0/g, " ") // nbsp → space
146
- .replace(/\s+/g, " ") // espaces multiples
147
- .toLowerCase()
148
- .trim();
149
- // 1) "de 10 h 30 à 12 heures", "de 10h30 à 12h", "de 9 h à 11 h 15", etc.
150
- const reRange = /\bde\s+(\d{1,2})\s*(?:h|:)?\s*(\d{1,2})?\s*(?:heures?)?\s*à\s*(\d{1,2})\s*(?:h|:)?\s*(\d{1,2})?\s*(?:heures?)?/i;
151
- const mRange = txt.match(reRange);
152
- if (mRange) {
153
- const h1 = clampHour(+mRange[1]), m1 = clampMinute(mRange[2] ? +mRange[2] : 0);
154
- const h2 = clampHour(+mRange[3]), m2 = clampMinute(mRange[4] ? +mRange[4] : 0);
155
- return { start: toIsoTime(h1, m1), end: toIsoTime(h2, m2) };
156
- }
157
- // 2) "à 10 h 30", "à 10h", "A 10h30", "A 9 heures", etc.
158
- const reAt = /\b(?:a|à)\s*(\d{1,2})\s*(?:h|:)?\s*(\d{1,2})?\s*(?:heures?)?/i;
159
- const mAt = txt.match(reAt);
160
- if (mAt) {
161
- const h = clampHour(+mAt[1]), m = clampMinute(mAt[2] ? +mAt[2] : 0);
162
- return { start: toIsoTime(h, m), end: null };
163
- }
164
- // 3) "10 h 30", "15h", "9 heures" sans 'à' / 'de ... à ...'
165
- const reBare = /\b(\d{1,2})\s*(?:h|:)?\s*(\d{1,2})?\s*(?:heures?)?\b/;
166
- const mBare = txt.match(reBare);
167
- if (mBare) {
168
- const h = clampHour(+mBare[1]), m = clampMinute(mBare[2] ? +mBare[2] : 0);
169
- return { start: toIsoTime(h, m), end: null };
170
- }
171
- return { start: null, end: null };
172
- }
173
- function clampHour(h) {
174
- return Math.max(0, Math.min(23, h));
175
- }
176
- function clampMinute(m) {
177
- return Math.max(0, Math.min(59, m));
178
- }
179
- function toIsoTime(h, m) {
180
- return `${String(h).padStart(2, "0")}:${String(m).padStart(2, "0")}:00.000+02:00`;
181
- }
182
- export function deriveTimesForEvent(ev) {
183
- const directStart = ev.startTime ?? null;
184
- const directEnd = ev.endTime ?? null;
185
- const fromText = parseTimeOriginalFR(ev.timeOriginal);
186
- const startISO = directStart ?? fromText.start ?? null;
187
- const endISO = directEnd ?? fromText.end ?? null;
188
- return { startISO, endISO };
189
- }
190
- export function extractSommaireBlocks($, idx) {
191
- const blocks = [];
192
- // lignes du sommaire avec lien
193
- $("cri\\:tm5 a[href^='#'], cri\\:tm3 a[href^='#'], p.tm5 a[href^='#'], p.tm3 a[href^='#']").each((_, a) => {
194
- const href = $(a).attr("href") || "";
195
- const targetId = href.startsWith("#") ? href.slice(1) : null;
196
- const text = norm($(a).text() || "");
197
- const startIndex = idx.get(a) ?? idx.get($(a).closest("p")[0]) ?? null;
198
- if (!text || startIndex == null)
199
- return;
200
- blocks.push({ text, startIndex, targetId });
201
- });
202
- return blocks;
203
- }
204
- export function parseISO(iso) {
205
- if (!iso)
206
- return null;
207
- const dt = DateTime.fromISO(iso, { setZone: true, zone: PARIS });
208
- return dt.isValid ? dt : null;
209
- }
@@ -1,14 +0,0 @@
1
- import { AgendaEvent, Reunion } from "../types/agenda";
2
- export declare function jaccard(a: Set<string>, b: Set<string>): number;
3
- export declare function jaccardTokenSim(a: string, b: string): number;
4
- export declare function isNoiseBlock(text: string): boolean;
5
- /**
6
- * Score robuste pour "bloc court vs event long":
7
- * - coverageBloc = |A∩B| / |A| (critère principal)
8
- * - jaccard en secondaire (utile quand les 2 sont longs)
9
- * - bonus time optionnel (déjà chez toi)
10
- */
11
- export declare function scoreSommaireBlockForEvent(blockText: string, ev: AgendaEvent): number;
12
- export declare function scoreVideo(agenda: Reunion, agendaTs: number | null, sameOrg: boolean, videoTitle?: string, videoEpoch?: number, videoOrganes?: string[], timeAmbigious?: boolean): number;
13
- export declare function dice(a: string, b: string): number;
14
- export declare function normalize(s?: string | null): string;
@@ -1,147 +0,0 @@
1
- import { parseISO } from "./reunion_parsing";
2
- import { normalizeText } from "./string_cleaning";
3
- export function jaccard(a, b) {
4
- if (!a.size || !b.size)
5
- return 0;
6
- let inter = 0;
7
- for (const t of a)
8
- if (b.has(t))
9
- inter++;
10
- return inter / (a.size + b.size - inter);
11
- }
12
- export function jaccardTokenSim(a, b) {
13
- const A = new Set(normalizeText(a).split(" ").filter(Boolean));
14
- const B = new Set(normalizeText(b).split(" ").filter(Boolean));
15
- if (A.size === 0 || B.size === 0)
16
- return 0;
17
- let inter = 0;
18
- for (const x of A)
19
- if (B.has(x))
20
- inter++;
21
- return inter / (A.size + B.size - inter);
22
- }
23
- export function isNoiseBlock(text) {
24
- const t = normalizeText(text);
25
- // très génériques / institutionnels / bruit
26
- if (!t)
27
- return true;
28
- if (t.length < 6)
29
- return true;
30
- // Ex: "article 78", "ord re du jour", "organisation des travaux"
31
- if (/^article\s+\d+/.test(t))
32
- return true;
33
- if (/\b(organisation des travaux|ordre du jour|suspension|reprise de la seance)\b/.test(t))
34
- return true;
35
- if (/\b(vice presidente|president|secretaire|ministre|rapporteur)\b/.test(t))
36
- return true;
37
- return false;
38
- }
39
- /**
40
- * Score robuste pour "bloc court vs event long":
41
- * - coverageBloc = |A∩B| / |A| (critère principal)
42
- * - jaccard en secondaire (utile quand les 2 sont longs)
43
- * - bonus time optionnel (déjà chez toi)
44
- */
45
- export function scoreSommaireBlockForEvent(blockText, ev) {
46
- const evText = `${ev.titre ?? ""} ${ev.objet ?? ""}`;
47
- const A = tokens(blockText); // tokens du bloc
48
- const B = tokens(evText); // tokens de l'event
49
- if (A.size === 0 || B.size === 0)
50
- return 0;
51
- const inter = intersectionSize(A, B);
52
- const coverageBloc = inter / A.size; // 🔥 clé
53
- const jac = jaccard(A, B);
54
- // bonus inclusion brut (utile sur des expressions exactes)
55
- const bNorm = normalizeText(blockText);
56
- const eNorm = normalizeText(evText);
57
- const inclusion = bNorm.length >= 10 && eNorm.includes(bNorm) ? 0.12 : 0;
58
- // bonus heure (si tu l'as)
59
- const timeBonus = timeProximityBonus(ev.startTime ?? null, blockText);
60
- // combine: coverage domine
61
- const score = Math.max(coverageBloc, jac) * 0.85 + Math.min(1, jac) * 0.1 + inclusion + timeBonus;
62
- return Math.max(0, Math.min(1, score));
63
- }
64
- function intersectionSize(a, b) {
65
- let inter = 0;
66
- for (const x of a)
67
- if (b.has(x))
68
- inter++;
69
- return inter;
70
- }
71
- function tokens(s) {
72
- const stop = new Set(["de", "du", "des", "la", "le", "les", "et", "au", "aux", "sur", "en", "d", "l", "un", "une"]);
73
- return new Set(normalizeText(s)
74
- .split(" ")
75
- .filter((w) => w.length >= 3 && !stop.has(w)));
76
- }
77
- function timeProximityBonus(eventStartISO, blockText) {
78
- if (!eventStartISO)
79
- return 0;
80
- const dt = parseISO(eventStartISO);
81
- if (!dt)
82
- return 0;
83
- const eventMin = dt.hour * 60 + dt.minute;
84
- const hints = extractHourHints(blockText);
85
- if (!hints.length)
86
- return 0;
87
- let best = Infinity;
88
- for (const x of hints)
89
- best = Math.min(best, Math.abs(x.h * 60 + x.m - eventMin));
90
- if (best <= 30)
91
- return 0.1;
92
- if (best <= 60)
93
- return 0.06;
94
- if (best <= 120)
95
- return 0.03;
96
- return 0;
97
- }
98
- function extractHourHints(text) {
99
- const t = (text || "").toLowerCase();
100
- const out = [];
101
- const re = /\b(\d{1,2})\s*h\s*(\d{2})\b/g;
102
- let m;
103
- while ((m = re.exec(t)))
104
- out.push({ h: Number(m[1]), m: Number(m[2]) });
105
- return out;
106
- }
107
- export function scoreVideo(agenda, agendaTs, sameOrg, videoTitle, videoEpoch, videoOrganes, timeAmbigious = false) {
108
- const objetS = dice(agenda.objet || "", videoTitle || "");
109
- const titleS = dice(agenda.titre || "", videoTitle || "");
110
- const titleScore = Math.max(objetS, titleS);
111
- let timeScore = 0;
112
- if (agendaTs && videoEpoch) {
113
- const deltaMin = Math.abs(videoEpoch - agendaTs) / 60;
114
- timeScore = Math.exp(-deltaMin / 60);
115
- }
116
- let orgScore = 0;
117
- if (agenda.organe && videoOrganes && videoOrganes.length) {
118
- const agendaOrg = agenda.organe;
119
- orgScore = Math.max(...videoOrganes.map((v) => dice(agendaOrg, v)));
120
- }
121
- if (timeAmbigious) {
122
- return 0.6 * titleScore + (sameOrg ? 0.4 : orgScore * 0.4);
123
- }
124
- return 0.3 * titleScore + 0.3 * timeScore + (sameOrg ? 0.4 : orgScore * 0.4);
125
- }
126
- function tokensDice(s) {
127
- return normalize(s).split(" ").filter(Boolean);
128
- }
129
- export function dice(a, b) {
130
- const A = new Set(tokensDice(a)), B = new Set(tokensDice(b));
131
- if (!A.size || !B.size)
132
- return 0;
133
- let inter = 0;
134
- for (const t of A)
135
- if (B.has(t))
136
- inter++;
137
- return (2 * inter) / (A.size + B.size);
138
- }
139
- export function normalize(s) {
140
- return (s ?? "")
141
- .toLowerCase()
142
- .normalize("NFD")
143
- .replace(/[\u0300-\u036f]/g, "")
144
- .replace(/[^\p{L}\p{N}\s-]/gu, " ")
145
- .replace(/\s+/g, " ")
146
- .trim();
147
- }
@@ -1,7 +0,0 @@
1
- export declare function normalizeText(t: string): string;
2
- export declare function decodeHtmlEntities(s?: string | null): string;
3
- export declare function stripTrailingPunct(s: string): string;
4
- export declare function dedupeSpeaker(raw: string): string;
5
- export declare function fixApostrophes(s: string): string;
6
- export declare function norm(s?: string | null): string;
7
- export declare function normalizeSpaces(s: string): string;
@@ -1,57 +0,0 @@
1
- export function normalizeText(t) {
2
- return (t || "")
3
- .toLowerCase()
4
- .normalize("NFD")
5
- .replace(/\p{Diacritic}/gu, "")
6
- .replace(/[^a-z0-9\s]/g, " ")
7
- .replace(/\s+/g, " ")
8
- .trim();
9
- }
10
- export function decodeHtmlEntities(s) {
11
- if (!s)
12
- return "";
13
- return s
14
- .replace(/&#x([0-9a-fA-F]+);/g, (_, h) => String.fromCodePoint(parseInt(h, 16)))
15
- .replace(/&#(\d+);/g, (_, d) => String.fromCodePoint(parseInt(d, 10)))
16
- .replace(/&amp;/g, "&")
17
- .replace(/&lt;/g, "<")
18
- .replace(/&gt;/g, ">")
19
- .replace(/&quot;/g, '"')
20
- .replace(/&apos;/g, "'");
21
- }
22
- export function stripTrailingPunct(s) {
23
- return s.replace(/\s*([:,.;])\s*$/u, "").trim();
24
- }
25
- export function dedupeSpeaker(raw) {
26
- let s = norm(raw);
27
- s = stripTrailingPunct(s);
28
- const dupPatterns = [/^(.+?)\s*[.]\s*\1$/u, /^(.+?)\s*,\s*\1,?$/u, /^(.+?)\s+\1$/u];
29
- for (const re of dupPatterns) {
30
- const m = s.match(re);
31
- if (m) {
32
- s = m[1];
33
- break;
34
- }
35
- }
36
- return s.replace(/\.\s*$/, "");
37
- }
38
- export function fixApostrophes(s) {
39
- let out = s;
40
- out = out.replace(/\s*’\s*/g, "’");
41
- out = out.replace(/\b([dljctmsn])\s*’/gi, (_, m) => m + "’");
42
- out = out.replace(/’\s+([A-Za-zÀ-ÖØ-öø-ÿ])/g, "’$1");
43
- out = out.replace(/\s+([,;:.!?])/g, "$1");
44
- return out;
45
- }
46
- export function norm(s) {
47
- return (s || "")
48
- .replace(/\u00A0/g, " ")
49
- .replace(/\s+/g, " ")
50
- .trim();
51
- }
52
- export function normalizeSpaces(s) {
53
- return s
54
- .replace(/\u00A0/g, " ")
55
- .replace(/\s+/g, " ")
56
- .trim();
57
- }
@@ -1,9 +0,0 @@
1
- import { z } from "zod";
2
- export declare const configSchema: z.ZodObject<{
3
- db: z.ZodObject<{
4
- host: z.ZodString;
5
- password: z.ZodString;
6
- user: z.ZodString;
7
- port: z.ZodCoercedNumber<unknown>;
8
- }, z.core.$strip>;
9
- }, z.core.$strip>;
@@ -1,10 +0,0 @@
1
- import { z } from "zod";
2
- const dbSchema = z.object({
3
- host: z.string().trim().min(1, "Must not be empty"),
4
- password: z.string().trim().min(1, "Must not be empty"),
5
- user: z.string().trim().min(1, "Must not be empty"),
6
- port: z.coerce.number().int().min(0).max(65535),
7
- });
8
- export const configSchema = z.object({
9
- db: dbSchema,
10
- });
@@ -1,54 +0,0 @@
1
- import { validateChain, validateInteger, validateNonEmptyTrimmedString, validateNumber, validateOption, validateString, validateStringToNumber, validateTest, } from "@biryani/core";
2
- function validateDb(data) {
3
- if (data === null || data === undefined) {
4
- return [data, "Missing value"];
5
- }
6
- if (typeof data !== "object") {
7
- return [data, `Expected an object got "${typeof data}"`];
8
- }
9
- data = { ...data };
10
- const errors = {};
11
- const remainingKeys = new Set(Object.keys(data));
12
- for (const key of ["host", "password", "user"]) {
13
- remainingKeys.delete(key);
14
- const [value, error] = validateNonEmptyTrimmedString(data[key]);
15
- data[key] = value;
16
- if (error !== null) {
17
- errors[key] = error;
18
- }
19
- }
20
- {
21
- const key = "port";
22
- remainingKeys.delete(key);
23
- const [value, error] = validateChain(validateOption([validateString, validateStringToNumber], validateNumber), validateInteger, validateTest((value) => 0 <= value && value <= 65535, "Must be an integer between 0 and 65535"))(data[key]);
24
- data[key] = value;
25
- if (error !== null) {
26
- errors[key] = error;
27
- }
28
- }
29
- for (const key of remainingKeys) {
30
- errors[key] = "Unexpected item";
31
- }
32
- return [data, Object.keys(errors).length === 0 ? null : errors];
33
- }
34
- export function validateConfig(data) {
35
- if (data === null || data === undefined) {
36
- return [data, "Missing value"];
37
- }
38
- if (typeof data !== "object") {
39
- return [data, `Expected an object got "${typeof data}"`];
40
- }
41
- data = { ...data };
42
- const errors = {};
43
- const remainingKeys = new Set(Object.keys(data));
44
- {
45
- const key = "db";
46
- remainingKeys.delete(key);
47
- const [value, error] = validateDb(data[key]);
48
- data[key] = value;
49
- if (error !== null) {
50
- errors[key] = error;
51
- }
52
- }
53
- return [data, Object.keys(errors).length === 0 ? null : errors];
54
- }
@@ -1,79 +0,0 @@
1
- import {
2
- validateChain,
3
- validateInteger,
4
- validateNonEmptyTrimmedString,
5
- validateNumber,
6
- validateOption,
7
- validateString,
8
- validateStringToNumber,
9
- validateTest,
10
- } from "@biryani/core"
11
-
12
- function validateDb(data: any): [any, any] {
13
- if (data === null || data === undefined) {
14
- return [data, "Missing value"]
15
- }
16
- if (typeof data !== "object") {
17
- return [data, `Expected an object got "${typeof data}"`]
18
- }
19
-
20
- data = { ...data }
21
- const errors: { [key: string]: any } = {}
22
- const remainingKeys = new Set(Object.keys(data))
23
-
24
- for (const key of ["host", "password", "user"]) {
25
- remainingKeys.delete(key)
26
- const [value, error] = validateNonEmptyTrimmedString(data[key])
27
- data[key] = value
28
- if (error !== null) {
29
- errors[key] = error
30
- }
31
- }
32
-
33
- {
34
- const key = "port"
35
- remainingKeys.delete(key)
36
- const [value, error] = validateChain(
37
- validateOption([validateString, validateStringToNumber], validateNumber),
38
- validateInteger,
39
- validateTest(
40
- (value: any) => 0 <= value && value <= 65535,
41
- "Must be an integer between 0 and 65535",
42
- ),
43
- )(data[key])
44
- data[key] = value
45
- if (error !== null) {
46
- errors[key] = error
47
- }
48
- }
49
-
50
- for (const key of remainingKeys) {
51
- errors[key] = "Unexpected item"
52
- }
53
- return [data, Object.keys(errors).length === 0 ? null : errors]
54
- }
55
-
56
- export function validateConfig(data: any): [any, any] {
57
- if (data === null || data === undefined) {
58
- return [data, "Missing value"]
59
- }
60
- if (typeof data !== "object") {
61
- return [data, `Expected an object got "${typeof data}"`]
62
- }
63
-
64
- data = { ...data }
65
- const errors: { [key: string]: any } = {}
66
- const remainingKeys = new Set(Object.keys(data))
67
-
68
- {
69
- const key = "db"
70
- remainingKeys.delete(key)
71
- const [value, error] = validateDb(data[key])
72
- data[key] = value
73
- if (error !== null) {
74
- errors[key] = error
75
- }
76
- }
77
-
78
- return [data, Object.keys(errors).length === 0 ? null : errors]
79
- }
File without changes
@@ -1,28 +0,0 @@
1
- // import { validateNonEmptyTrimmedString } from "@biryani/core"
2
-
3
- // const acteurUidRegExp = /^PA\d+$/
4
- // const organeUidRegExp = /^PO\d+$/
5
-
6
- // export function validateSenateurUid(input: any): [any, any] {
7
- // const [value, error] = validateNonEmptyTrimmedString(input)
8
- // if (error !== null) {
9
- // return [value, error]
10
- // }
11
- // if (!acteurUidRegExp.test(value)) {
12
- // return [value, 'Invalid "acteur" unique ID']
13
- // }
14
- // return [value, null]
15
- // }
16
-
17
- // export function validateOrganeUid(input: any): [any, any] {
18
- // const [value, error] = validateNonEmptyTrimmedString(input)
19
- // if (error !== null) {
20
- // return [value, error]
21
- // }
22
- // if (!organeUidRegExp.test(value)) {
23
- // return [value, 'Invalid "organe" unique ID']
24
- // }
25
- // return [value, null]
26
- // }
27
- "use strict";
28
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiLi4vLi4vc3JjL3ZhbGlkYXRvcnMvc2VuYXQudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaW1wb3J0IHsgdmFsaWRhdGVOb25FbXB0eVRyaW1tZWRTdHJpbmcgfSBmcm9tIFwiQGJpcnlhbmkvY29yZVwiXG5cbi8vIGNvbnN0IGFjdGV1clVpZFJlZ0V4cCA9IC9eUEFcXGQrJC9cbi8vIGNvbnN0IG9yZ2FuZVVpZFJlZ0V4cCA9IC9eUE9cXGQrJC9cblxuLy8gZXhwb3J0IGZ1bmN0aW9uIHZhbGlkYXRlU2VuYXRldXJVaWQoaW5wdXQ6IGFueSk6IFthbnksIGFueV0ge1xuLy8gICBjb25zdCBbdmFsdWUsIGVycm9yXSA9IHZhbGlkYXRlTm9uRW1wdHlUcmltbWVkU3RyaW5nKGlucHV0KVxuLy8gICBpZiAoZXJyb3IgIT09IG51bGwpIHtcbi8vICAgICByZXR1cm4gW3ZhbHVlLCBlcnJvcl1cbi8vICAgfVxuLy8gICBpZiAoIWFjdGV1clVpZFJlZ0V4cC50ZXN0KHZhbHVlKSkge1xuLy8gICAgIHJldHVybiBbdmFsdWUsICdJbnZhbGlkIFwiYWN0ZXVyXCIgdW5pcXVlIElEJ11cbi8vICAgfVxuLy8gICByZXR1cm4gW3ZhbHVlLCBudWxsXVxuLy8gfVxuXG4vLyBleHBvcnQgZnVuY3Rpb24gdmFsaWRhdGVPcmdhbmVVaWQoaW5wdXQ6IGFueSk6IFthbnksIGFueV0ge1xuLy8gICBjb25zdCBbdmFsdWUsIGVycm9yXSA9IHZhbGlkYXRlTm9uRW1wdHlUcmltbWVkU3RyaW5nKGlucHV0KVxuLy8gICBpZiAoZXJyb3IgIT09IG51bGwpIHtcbi8vICAgICByZXR1cm4gW3ZhbHVlLCBlcnJvcl1cbi8vICAgfVxuLy8gICBpZiAoIW9yZ2FuZVVpZFJlZ0V4cC50ZXN0KHZhbHVlKSkge1xuLy8gICAgIHJldHVybiBbdmFsdWUsICdJbnZhbGlkIFwib3JnYW5lXCIgdW5pcXVlIElEJ11cbi8vICAgfVxuLy8gICByZXR1cm4gW3ZhbHVlLCBudWxsXVxuLy8gfVxuIl0sIm1hcHBpbmdzIjoiQUFBQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQUEiLCJpZ25vcmVMaXN0IjpbXX0=
@@ -1,24 +0,0 @@
1
- "use strict";
2
- // import { validateNonEmptyTrimmedString } from "@biryani/core"
3
- // const acteurUidRegExp = /^PA\d+$/
4
- // const organeUidRegExp = /^PO\d+$/
5
- // export function validateSenateurUid(input: any): [any, any] {
6
- // const [value, error] = validateNonEmptyTrimmedString(input)
7
- // if (error !== null) {
8
- // return [value, error]
9
- // }
10
- // if (!acteurUidRegExp.test(value)) {
11
- // return [value, 'Invalid "acteur" unique ID']
12
- // }
13
- // return [value, null]
14
- // }
15
- // export function validateOrganeUid(input: any): [any, any] {
16
- // const [value, error] = validateNonEmptyTrimmedString(input)
17
- // if (error !== null) {
18
- // return [value, error]
19
- // }
20
- // if (!organeUidRegExp.test(value)) {
21
- // return [value, 'Invalid "organe" unique ID']
22
- // }
23
- // return [value, null]
24
- // }
@@ -1,26 +0,0 @@
1
- // import { validateNonEmptyTrimmedString } from "@biryani/core"
2
-
3
- // const acteurUidRegExp = /^PA\d+$/
4
- // const organeUidRegExp = /^PO\d+$/
5
-
6
- // export function validateSenateurUid(input: any): [any, any] {
7
- // const [value, error] = validateNonEmptyTrimmedString(input)
8
- // if (error !== null) {
9
- // return [value, error]
10
- // }
11
- // if (!acteurUidRegExp.test(value)) {
12
- // return [value, 'Invalid "acteur" unique ID']
13
- // }
14
- // return [value, null]
15
- // }
16
-
17
- // export function validateOrganeUid(input: any): [any, any] {
18
- // const [value, error] = validateNonEmptyTrimmedString(input)
19
- // if (error !== null) {
20
- // return [value, error]
21
- // }
22
- // if (!organeUidRegExp.test(value)) {
23
- // return [value, 'Invalid "organe" unique ID']
24
- // }
25
- // return [value, null]
26
- // }