@tricoteuses/senat 2.22.16 → 3.0.0

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 (345) hide show
  1. package/README.md +168 -0
  2. package/lib/aggregates.d.ts +52 -0
  3. package/lib/aggregates.js +930 -0
  4. package/lib/aggregates.mjs +713 -0
  5. package/lib/aggregates.ts +833 -0
  6. package/lib/config.d.ts +10 -0
  7. package/lib/config.js +16 -0
  8. package/lib/config.mjs +16 -0
  9. package/lib/config.ts +26 -0
  10. package/lib/databases.d.ts +2 -0
  11. package/lib/databases.js +26 -0
  12. package/lib/databases.mjs +57 -0
  13. package/lib/databases.ts +71 -0
  14. package/lib/datasets.d.ts +34 -0
  15. package/lib/datasets.js +233 -0
  16. package/lib/datasets.mjs +78 -0
  17. package/lib/datasets.ts +118 -0
  18. package/lib/fields.d.ts +10 -0
  19. package/lib/fields.js +68 -0
  20. package/lib/fields.mjs +22 -0
  21. package/lib/fields.ts +29 -0
  22. package/lib/git.d.ts +26 -0
  23. package/lib/git.js +167 -0
  24. package/lib/index.d.ts +13 -0
  25. package/lib/index.js +1 -0
  26. package/lib/index.mjs +7 -0
  27. package/lib/index.ts +64 -0
  28. package/lib/inserters.d.ts +98 -0
  29. package/lib/inserters.js +500 -0
  30. package/lib/inserters.mjs +360 -0
  31. package/lib/inserters.ts +521 -0
  32. package/lib/legislatures.json +38 -0
  33. package/lib/loaders.d.ts +58 -0
  34. package/lib/loaders.js +286 -0
  35. package/lib/loaders.mjs +158 -0
  36. package/lib/loaders.ts +271 -0
  37. package/lib/model/agenda.d.ts +6 -0
  38. package/lib/model/agenda.js +148 -0
  39. package/lib/model/ameli.d.ts +51 -0
  40. package/lib/model/ameli.js +149 -0
  41. package/lib/model/ameli.mjs +84 -0
  42. package/lib/model/ameli.ts +100 -0
  43. package/lib/model/commission.d.ts +18 -0
  44. package/lib/model/commission.js +269 -0
  45. package/lib/model/debats.d.ts +67 -0
  46. package/lib/model/debats.js +95 -0
  47. package/lib/model/debats.mjs +43 -0
  48. package/lib/model/debats.ts +68 -0
  49. package/lib/model/documents.d.ts +12 -0
  50. package/lib/model/documents.js +151 -0
  51. package/lib/model/dosleg.d.ts +7 -0
  52. package/lib/model/dosleg.js +326 -0
  53. package/lib/model/dosleg.mjs +196 -0
  54. package/lib/model/dosleg.ts +240 -0
  55. package/lib/model/index.d.ts +7 -0
  56. package/lib/model/index.js +7 -0
  57. package/lib/model/index.mjs +5 -0
  58. package/lib/model/index.ts +15 -0
  59. package/lib/model/questions.d.ts +45 -0
  60. package/lib/model/questions.js +89 -0
  61. package/lib/model/questions.mjs +71 -0
  62. package/lib/model/questions.ts +93 -0
  63. package/lib/model/scrutins.d.ts +13 -0
  64. package/lib/model/scrutins.js +114 -0
  65. package/lib/model/seance.d.ts +3 -0
  66. package/lib/model/seance.js +267 -0
  67. package/lib/model/sens.d.ts +146 -0
  68. package/lib/model/sens.js +454 -0
  69. package/lib/model/sens.mjs +415 -0
  70. package/lib/model/sens.ts +516 -0
  71. package/lib/model/texte.d.ts +7 -0
  72. package/lib/model/texte.js +256 -0
  73. package/lib/model/texte.mjs +208 -0
  74. package/lib/model/texte.ts +229 -0
  75. package/lib/model/util.d.ts +9 -0
  76. package/lib/model/util.js +38 -0
  77. package/lib/model/util.mjs +19 -0
  78. package/lib/model/util.ts +32 -0
  79. package/lib/parsers/texte.d.ts +7 -0
  80. package/lib/parsers/texte.js +228 -0
  81. package/lib/raw_types/ameli.d.ts +914 -0
  82. package/lib/raw_types/ameli.js +5 -0
  83. package/lib/raw_types/ameli.mjs +163 -0
  84. package/lib/raw_types/debats.d.ts +207 -0
  85. package/lib/raw_types/debats.js +5 -0
  86. package/lib/raw_types/debats.mjs +58 -0
  87. package/lib/raw_types/dosleg.d.ts +1619 -0
  88. package/lib/raw_types/dosleg.js +5 -0
  89. package/lib/raw_types/dosleg.mjs +438 -0
  90. package/lib/raw_types/questions.d.ts +419 -0
  91. package/lib/raw_types/questions.js +5 -0
  92. package/lib/raw_types/questions.mjs +11 -0
  93. package/lib/raw_types/senat.d.ts +11368 -0
  94. package/lib/raw_types/senat.js +5 -0
  95. package/lib/raw_types/sens.d.ts +8248 -0
  96. package/lib/raw_types/sens.js +5 -0
  97. package/lib/raw_types/sens.mjs +508 -0
  98. package/lib/raw_types_kysely/ameli.d.ts +915 -0
  99. package/lib/raw_types_kysely/ameli.js +7 -0
  100. package/lib/raw_types_kysely/ameli.mjs +5 -0
  101. package/lib/raw_types_kysely/ameli.ts +951 -0
  102. package/lib/raw_types_kysely/debats.d.ts +207 -0
  103. package/lib/raw_types_kysely/debats.js +7 -0
  104. package/lib/raw_types_kysely/debats.mjs +5 -0
  105. package/lib/raw_types_kysely/debats.ts +222 -0
  106. package/lib/raw_types_kysely/dosleg.d.ts +3532 -0
  107. package/lib/raw_types_kysely/dosleg.js +7 -0
  108. package/lib/raw_types_kysely/dosleg.mjs +5 -0
  109. package/lib/raw_types_kysely/dosleg.ts +3621 -0
  110. package/lib/raw_types_kysely/questions.d.ts +414 -0
  111. package/lib/raw_types_kysely/questions.js +7 -0
  112. package/lib/raw_types_kysely/questions.mjs +5 -0
  113. package/lib/raw_types_kysely/questions.ts +426 -0
  114. package/lib/raw_types_kysely/sens.d.ts +4394 -0
  115. package/lib/raw_types_kysely/sens.js +7 -0
  116. package/lib/raw_types_kysely/sens.mjs +5 -0
  117. package/lib/raw_types_kysely/sens.ts +4499 -0
  118. package/lib/raw_types_schemats/ameli.d.ts +539 -0
  119. package/lib/raw_types_schemats/ameli.js +2 -0
  120. package/lib/raw_types_schemats/ameli.mjs +2 -0
  121. package/lib/raw_types_schemats/ameli.ts +601 -0
  122. package/lib/raw_types_schemats/debats.d.ts +127 -0
  123. package/lib/raw_types_schemats/debats.js +2 -0
  124. package/lib/raw_types_schemats/debats.mjs +2 -0
  125. package/lib/raw_types_schemats/debats.ts +145 -0
  126. package/lib/raw_types_schemats/dosleg.d.ts +977 -0
  127. package/lib/raw_types_schemats/dosleg.js +2 -0
  128. package/lib/raw_types_schemats/dosleg.mjs +2 -0
  129. package/lib/raw_types_schemats/dosleg.ts +2193 -0
  130. package/lib/raw_types_schemats/questions.d.ts +235 -0
  131. package/lib/raw_types_schemats/questions.js +2 -0
  132. package/lib/raw_types_schemats/questions.mjs +2 -0
  133. package/lib/raw_types_schemats/questions.ts +249 -0
  134. package/lib/raw_types_schemats/sens.d.ts +6915 -0
  135. package/lib/raw_types_schemats/sens.js +2 -0
  136. package/lib/raw_types_schemats/sens.mjs +2 -0
  137. package/lib/raw_types_schemats/sens.ts +2907 -0
  138. package/lib/scripts/convert_data.d.ts +1 -0
  139. package/lib/scripts/convert_data.js +354 -0
  140. package/lib/scripts/convert_data.mjs +181 -0
  141. package/lib/scripts/convert_data.ts +243 -0
  142. package/lib/scripts/data-download.d.ts +1 -0
  143. package/lib/scripts/data-download.js +12 -0
  144. package/lib/scripts/datautil.d.ts +8 -0
  145. package/lib/scripts/datautil.js +34 -0
  146. package/lib/scripts/datautil.mjs +16 -0
  147. package/lib/scripts/datautil.ts +19 -0
  148. package/lib/scripts/images/transparent_150x192.jpg +0 -0
  149. package/lib/scripts/images/transparent_155x225.jpg +0 -0
  150. package/lib/scripts/parse_textes.d.ts +1 -0
  151. package/lib/scripts/parse_textes.js +44 -0
  152. package/lib/scripts/parse_textes.mjs +46 -0
  153. package/lib/scripts/parse_textes.ts +65 -0
  154. package/lib/scripts/retrieve_agenda.d.ts +1 -0
  155. package/lib/scripts/retrieve_agenda.js +132 -0
  156. package/lib/scripts/retrieve_cr_commission.d.ts +1 -0
  157. package/lib/scripts/retrieve_cr_commission.js +364 -0
  158. package/lib/scripts/retrieve_cr_seance.d.ts +6 -0
  159. package/lib/scripts/retrieve_cr_seance.js +347 -0
  160. package/lib/scripts/retrieve_documents.d.ts +3 -0
  161. package/lib/scripts/retrieve_documents.js +219 -0
  162. package/lib/scripts/retrieve_documents.mjs +249 -0
  163. package/lib/scripts/retrieve_documents.ts +298 -0
  164. package/lib/scripts/retrieve_open_data.d.ts +1 -0
  165. package/lib/scripts/retrieve_open_data.js +315 -0
  166. package/lib/scripts/retrieve_open_data.mjs +217 -0
  167. package/lib/scripts/retrieve_open_data.ts +268 -0
  168. package/lib/scripts/retrieve_senateurs_photos.d.ts +1 -0
  169. package/lib/scripts/retrieve_senateurs_photos.js +147 -0
  170. package/lib/scripts/retrieve_senateurs_photos.mjs +147 -0
  171. package/lib/scripts/retrieve_senateurs_photos.ts +177 -0
  172. package/lib/scripts/retrieve_videos.d.ts +1 -0
  173. package/lib/scripts/retrieve_videos.js +461 -0
  174. package/lib/scripts/shared/cli_helpers.d.ts +95 -0
  175. package/lib/scripts/shared/cli_helpers.js +91 -0
  176. package/lib/scripts/shared/cli_helpers.ts +36 -0
  177. package/lib/scripts/shared/util.d.ts +4 -0
  178. package/lib/scripts/shared/util.js +35 -0
  179. package/lib/scripts/shared/util.ts +33 -0
  180. package/lib/scripts/test_iter_load.d.ts +1 -0
  181. package/lib/scripts/test_iter_load.js +12 -0
  182. package/lib/src/config.d.ts +22 -0
  183. package/lib/src/config.js +17 -7
  184. package/lib/src/conversion_textes.js +5 -1
  185. package/lib/src/databases.d.ts +2 -1
  186. package/lib/src/databases_postgres.d.ts +4 -0
  187. package/lib/src/databases_postgres.js +23 -0
  188. package/lib/src/datasets.d.ts +4 -0
  189. package/lib/src/datasets.js +16 -2
  190. package/lib/src/git.d.ts +1 -0
  191. package/lib/src/git.js +45 -11
  192. package/lib/src/index.d.ts +19 -8
  193. package/lib/src/index.js +6 -1
  194. package/lib/src/loaders.js +10 -4
  195. package/lib/src/model/agenda.js +2 -2
  196. package/lib/src/model/ameli.d.ts +64 -52
  197. package/lib/src/model/ameli.js +147 -145
  198. package/lib/src/model/ameli_postgres.d.ts +67 -0
  199. package/lib/src/model/ameli_postgres.js +150 -0
  200. package/lib/src/model/commission.d.ts +3 -2
  201. package/lib/src/model/commission.js +2 -2
  202. package/lib/src/model/debats.d.ts +38 -66
  203. package/lib/src/model/debats.js +110 -93
  204. package/lib/src/model/documents.d.ts +32 -12
  205. package/lib/src/model/documents.js +171 -130
  206. package/lib/src/model/dosleg.d.ts +142 -5
  207. package/lib/src/model/dosleg.js +298 -156
  208. package/lib/src/model/questions.d.ts +54 -45
  209. package/lib/src/model/questions.js +89 -87
  210. package/lib/src/model/scrutins.d.ts +48 -13
  211. package/lib/src/model/scrutins.js +118 -111
  212. package/lib/src/model/seance.js +3 -3
  213. package/lib/src/model/sens.d.ts +109 -179
  214. package/lib/src/model/sens.js +384 -484
  215. package/lib/src/model/util.d.ts +0 -8
  216. package/lib/src/model/util.js +0 -23
  217. package/lib/src/parsers/texte.js +7 -7
  218. package/lib/src/raw_types/ameli.d.ts +1651 -803
  219. package/lib/src/raw_types/ameli.js +1816 -5
  220. package/lib/src/raw_types/debats.d.ts +353 -180
  221. package/lib/src/raw_types/debats.js +517 -5
  222. package/lib/src/raw_types/dosleg.d.ts +2862 -1527
  223. package/lib/src/raw_types/dosleg.js +4354 -5
  224. package/lib/src/raw_types/questions.d.ts +671 -395
  225. package/lib/src/raw_types/questions.js +1303 -5
  226. package/lib/src/raw_types/sens.d.ts +7743 -8148
  227. package/lib/src/raw_types/sens.js +10429 -5
  228. package/lib/src/raw_types_schemats/ameli.d.ts +4 -2
  229. package/lib/src/raw_types_schemats/debats.d.ts +2 -2
  230. package/lib/src/raw_types_schemats/dosleg.d.ts +2 -2
  231. package/lib/src/raw_types_schemats/questions.d.ts +2 -2
  232. package/lib/src/raw_types_schemats/sens.d.ts +10 -4216
  233. package/lib/src/scripts/convert_data.js +7 -6
  234. package/lib/src/scripts/convert_xml_to_html.js +2 -2
  235. package/lib/src/scripts/data-download.js +3 -2
  236. package/lib/src/scripts/retrieve_agenda.js +21 -9
  237. package/lib/src/scripts/retrieve_cr_commission.js +17 -17
  238. package/lib/src/scripts/retrieve_cr_seance.d.ts +14 -1
  239. package/lib/src/scripts/retrieve_cr_seance.js +10 -11
  240. package/lib/src/scripts/retrieve_documents.d.ts +11 -2
  241. package/lib/src/scripts/retrieve_documents.js +25 -14
  242. package/lib/src/scripts/retrieve_open_data.js +514 -153
  243. package/lib/src/scripts/retrieve_senateurs_photos.js +25 -11
  244. package/lib/src/scripts/retrieve_videos.js +12 -11
  245. package/lib/src/scripts/shared/cli_helpers.d.ts +1 -6
  246. package/lib/src/scripts/shared/cli_helpers.js +9 -8
  247. package/lib/src/scripts/shared/incremental_import_sql.d.ts +2 -0
  248. package/lib/src/scripts/shared/incremental_import_sql.js +894 -0
  249. package/lib/src/scripts/shared/prefixed_tables.d.ts +10 -0
  250. package/lib/src/scripts/shared/prefixed_tables.js +36 -0
  251. package/lib/src/scripts/shared/schema_version.d.ts +3 -0
  252. package/lib/src/scripts/shared/schema_version.js +97 -0
  253. package/lib/src/scripts/shared/staging_import.d.ts +3 -0
  254. package/lib/src/scripts/shared/staging_import.js +80 -0
  255. package/lib/src/scripts/shared/staging_metadata_sql.d.ts +1 -0
  256. package/lib/src/scripts/shared/staging_metadata_sql.js +221 -0
  257. package/lib/src/scripts/validate_prefixed_tables.d.ts +1 -0
  258. package/lib/src/scripts/validate_prefixed_tables.js +101 -0
  259. package/lib/src/types/ameli.d.ts +4 -4
  260. package/lib/src/types/debats.d.ts +2 -2
  261. package/lib/src/types/dosleg.d.ts +39 -39
  262. package/lib/src/types/questions.d.ts +2 -2
  263. package/lib/src/types/sens.d.ts +0 -2
  264. package/lib/src/types/texte.d.ts +1 -1
  265. package/lib/src/utils/cr_spliting.d.ts +9 -6
  266. package/lib/src/utils/cr_spliting.js +6 -101
  267. package/lib/src/utils/reunion_odj_building.d.ts +7 -3
  268. package/lib/src/utils/reunion_parsing.d.ts +2 -1
  269. package/lib/src/utils/reunion_parsing.js +2 -2
  270. package/lib/src/videos/match.js +8 -5
  271. package/lib/src/videos/pipeline.d.ts +6 -2
  272. package/lib/src/videos/pipeline.js +21 -8
  273. package/lib/src/videos/search.js +6 -2
  274. package/lib/strings.d.ts +1 -0
  275. package/lib/strings.js +18 -0
  276. package/lib/strings.mjs +18 -0
  277. package/lib/strings.ts +26 -0
  278. package/lib/tests/incrementalImportSql.test.d.ts +1 -0
  279. package/lib/tests/incrementalImportSql.test.js +155 -0
  280. package/lib/tests/prefixedTables.test.d.ts +1 -0
  281. package/lib/tests/prefixedTables.test.js +22 -0
  282. package/lib/tests/schemaVersion.test.d.ts +1 -0
  283. package/lib/tests/schemaVersion.test.js +23 -0
  284. package/lib/tests/validatePrefixedTables.test.d.ts +1 -0
  285. package/lib/tests/validatePrefixedTables.test.js +14 -0
  286. package/lib/types/agenda.d.ts +44 -0
  287. package/lib/types/agenda.js +1 -0
  288. package/lib/types/ameli.d.ts +5 -0
  289. package/lib/types/ameli.js +1 -0
  290. package/lib/types/ameli.mjs +13 -0
  291. package/lib/types/ameli.ts +21 -0
  292. package/lib/types/compte_rendu.d.ts +83 -0
  293. package/lib/types/compte_rendu.js +1 -0
  294. package/lib/types/debats.d.ts +2 -0
  295. package/lib/types/debats.js +1 -0
  296. package/lib/types/debats.mjs +2 -0
  297. package/lib/types/debats.ts +6 -0
  298. package/lib/types/dosleg.d.ts +70 -0
  299. package/lib/types/dosleg.js +1 -0
  300. package/lib/types/dosleg.mjs +151 -0
  301. package/lib/types/dosleg.ts +284 -0
  302. package/lib/types/questions.d.ts +2 -0
  303. package/lib/types/questions.js +1 -0
  304. package/lib/types/questions.mjs +1 -0
  305. package/lib/types/questions.ts +3 -0
  306. package/lib/types/sens.d.ts +10 -0
  307. package/lib/types/sens.js +1 -0
  308. package/lib/types/sens.mjs +1 -0
  309. package/lib/types/sens.ts +12 -0
  310. package/lib/types/sessions.d.ts +5 -0
  311. package/lib/types/sessions.js +84 -0
  312. package/lib/types/sessions.mjs +43 -0
  313. package/lib/types/sessions.ts +42 -0
  314. package/lib/types/texte.d.ts +74 -0
  315. package/lib/types/texte.js +16 -0
  316. package/lib/types/texte.mjs +16 -0
  317. package/lib/types/texte.ts +76 -0
  318. package/lib/typings/windows-1252.d.js +2 -0
  319. package/lib/typings/windows-1252.d.mjs +2 -0
  320. package/lib/typings/windows-1252.d.ts +11 -0
  321. package/lib/utils/cr_spliting.d.ts +28 -0
  322. package/lib/utils/cr_spliting.js +265 -0
  323. package/lib/utils/date.d.ts +10 -0
  324. package/lib/utils/date.js +100 -0
  325. package/lib/utils/nvs-timecode.d.ts +7 -0
  326. package/lib/utils/nvs-timecode.js +79 -0
  327. package/lib/utils/reunion_grouping.d.ts +9 -0
  328. package/lib/utils/reunion_grouping.js +361 -0
  329. package/lib/utils/reunion_odj_building.d.ts +5 -0
  330. package/lib/utils/reunion_odj_building.js +154 -0
  331. package/lib/utils/reunion_parsing.d.ts +23 -0
  332. package/lib/utils/reunion_parsing.js +209 -0
  333. package/lib/utils/scoring.d.ts +14 -0
  334. package/lib/utils/scoring.js +147 -0
  335. package/lib/utils/string_cleaning.d.ts +7 -0
  336. package/lib/utils/string_cleaning.js +57 -0
  337. package/lib/validators/config.d.ts +9 -0
  338. package/lib/validators/config.js +10 -0
  339. package/lib/validators/config.mjs +54 -0
  340. package/lib/validators/config.ts +79 -0
  341. package/lib/validators/senat.d.ts +0 -0
  342. package/lib/validators/senat.js +28 -0
  343. package/lib/validators/senat.mjs +24 -0
  344. package/lib/validators/senat.ts +26 -0
  345. package/package.json +11 -11
@@ -0,0 +1,155 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { buildIncrementalDatasetImportSql, buildNormalizeStagingSchemaSql, } from "../src/scripts/shared/incremental_import_sql";
3
+ import { stagingSchemaName } from "../src/scripts/shared/prefixed_tables";
4
+ import { buildExportStagingMetadataStatementsQuery } from "../src/scripts/shared/staging_metadata_sql";
5
+ import { isCopyFromStdinLine, rewriteLineForStagingImport } from "../src/scripts/shared/staging_import";
6
+ describe("incremental import SQL", () => {
7
+ it("normalizes staging object names before merge", () => {
8
+ const sql = buildNormalizeStagingSchemaSql("dosleg");
9
+ expect(sql).toContain("WHERE n.nspname = 'dosleg_staging'");
10
+ expect(sql).toContain("AND c.relname NOT LIKE 'dosleg_' || '%'");
11
+ expect(sql).toContain("ALTER INDEX %I.%I RENAME TO %I");
12
+ expect(sql).toContain("ALTER SEQUENCE %I.%I RENAME TO %I");
13
+ expect(sql).toContain("ALTER TABLE %I.%I RENAME TO %I");
14
+ });
15
+ it("builds merge SQL for incremental synchronization into senat", () => {
16
+ const sql = buildIncrementalDatasetImportSql("dosleg", "opendata", {
17
+ corscr: ["sesann", "scrnum", "corscrord"],
18
+ docsea: ["evtseacle", "docseaord"],
19
+ }, ["amescr"]);
20
+ expect(sql).toContain("WHERE n.nspname = 'dosleg_staging'");
21
+ expect(sql).toContain("AND c.relkind IN ('r', 'p', 'f')");
22
+ expect(sql).toContain("CREATE TABLE senat.%I (LIKE %I.%I INCLUDING IDENTITY INCLUDING GENERATED INCLUDING DEFAULTS)");
23
+ expect(sql).toContain("ALTER TABLE senat.%I DROP COLUMN IF EXISTS %I CASCADE");
24
+ expect(sql).toContain("ALTER TABLE senat.%I ADD COLUMN %I %s");
25
+ expect(sql).toContain("ALTER TABLE senat.%I ALTER COLUMN %I TYPE %s%s USING %I::%s");
26
+ expect(sql).toContain("SELECT obj_description(c.oid, 'pg_class')");
27
+ expect(sql).toContain("COMMENT ON TABLE senat.%I IS %L");
28
+ expect(sql).toContain("col_description(staging_class.oid, staging_attribute.attnum) AS staging_comment");
29
+ expect(sql).toContain("COMMENT ON COLUMN senat.%I.%I IS %L");
30
+ expect(sql).toContain("SELECT 'dosleg_corscr' AS tablename, ARRAY['sesann', 'scrnum', 'corscrord']::text[] AS key_columns");
31
+ expect(sql).toContain("SELECT 'dosleg_docsea' AS tablename, ARRAY['evtseacle', 'docseaord']::text[] AS key_columns");
32
+ expect(sql).toContain("SELECT 'dosleg_amescr' AS tablename");
33
+ expect(sql).toContain("t.%1$I IS NOT DISTINCT FROM s.%1$I");
34
+ expect(sql).toContain("jsonb_build_array(");
35
+ expect(sql).toContain("Sync strategy for %.%: %");
36
+ expect(sql).toContain("Rejected sync key for %.% from % because only %/% columns are present in both staging and target: %");
37
+ expect(sql).toContain("WHERE table_namespace.nspname IN ('dosleg_staging', 'senat')");
38
+ expect(sql).toContain("CASE WHEN table_namespace.nspname = 'dosleg_staging' THEN 0 ELSE 1 END AS schema_priority");
39
+ expect(sql).toContain("No primary key or all-NOT-NULL unique key found for %.%; falling back to full refresh");
40
+ expect(sql).toContain("incremental_row_multiset");
41
+ expect(sql).toContain("LEFT JOIN staging_counts reference_row USING (row_signature)");
42
+ expect(sql).toContain("LEFT JOIN target_counts reference_row USING (row_signature)");
43
+ expect(sql).toContain("DELETE FROM senat.%1$I t WHERE NOT EXISTS (SELECT 1 FROM %2$I.%1$I s WHERE %3$s)");
44
+ expect(sql).toContain("UPDATE senat.%1$I t SET %2$s FROM %3$I.%1$I s WHERE %4$s AND (%5$s)");
45
+ expect(sql).toContain("INSERT INTO senat.%1$I (%2$s) SELECT %3$s FROM %4$I.%1$I s WHERE NOT EXISTS (SELECT 1 FROM senat.%1$I t WHERE %5$s)");
46
+ expect(sql).toContain("ALTER TABLE senat.%I ADD CONSTRAINT %I %s");
47
+ expect(sql).toContain("DROP SEQUENCE IF EXISTS senat.%I CASCADE");
48
+ expect(sql).not.toContain("DROP SCHEMA IF EXISTS dosleg_staging CASCADE;");
49
+ });
50
+ it("prefers row multiset strategy over configured keys when both are provided", () => {
51
+ const sql = buildIncrementalDatasetImportSql("questions", "opendata", {
52
+ tam_reponses: ["idque"],
53
+ }, ["tam_reponses"]);
54
+ expect(sql).toContain("IF use_row_multiset_merge THEN");
55
+ expect(sql).toContain("ELSIF key_columns IS NULL THEN");
56
+ expect(sql).toContain("SELECT 'questions_tam_reponses' AS tablename");
57
+ expect(sql).toContain("incremental_row_multiset");
58
+ });
59
+ it("escapes single quotes in SQL literals produced for staging names", () => {
60
+ const normalizeSql = buildNormalizeStagingSchemaSql("quo'te");
61
+ const incrementalSql = buildIncrementalDatasetImportSql("quo'te", "opendata", {
62
+ table: ["col'umn"],
63
+ }, ["ta'ble"]);
64
+ expect(normalizeSql).toContain("WHERE n.nspname = 'quo''te_staging'");
65
+ expect(normalizeSql).toContain("AND c.relname NOT LIKE 'quo''te_' || '%'");
66
+ expect(incrementalSql).toContain("WHERE n.nspname = 'quo''te_staging'");
67
+ expect(incrementalSql).toContain("tablename LIKE 'quo''te_' || '%'");
68
+ expect(incrementalSql).toContain("SELECT 'quo''te_table' AS tablename, ARRAY['col''umn']::text[] AS key_columns");
69
+ expect(incrementalSql).toContain("SELECT 'quo''te_ta''ble' AS tablename");
70
+ });
71
+ it("builds an unlogged staging schema name usable by import rewriting", () => {
72
+ expect(stagingSchemaName("sens")).toBe("sens_staging");
73
+ });
74
+ it("exports metadata synchronization statements from the real staging database", () => {
75
+ const sql = buildExportStagingMetadataStatementsQuery("sens_staging", "senat");
76
+ expect(sql).toContain("CREATE SEQUENCE IF NOT EXISTS %I.%I");
77
+ expect(sql).toContain("ALTER TABLE %I.%I ALTER COLUMN %I SET DEFAULT %s");
78
+ expect(sql).toContain("COMMENT ON TABLE %I.%I IS %L");
79
+ expect(sql).toContain("COMMENT ON COLUMN %I.%I.%I IS %L");
80
+ expect(sql).toContain("ALTER TABLE %I.%I ADD CONSTRAINT %I %s");
81
+ expect(sql).toContain("WHEN 'p' THEN 1");
82
+ expect(sql).toContain("WHEN 'f' THEN 4");
83
+ expect(sql).toContain("pg_get_indexdef(index_data.indexrelid)");
84
+ expect(sql).toContain("SELECT setval(%L, %s, %s)");
85
+ expect(sql).toContain("encode(convert_to(statement, 'UTF8'), 'hex')");
86
+ expect(sql).toContain("ORDER BY group_no, order_no, object_name");
87
+ });
88
+ it("rewrites staging DDL toward the staging schema and unlogged objects", () => {
89
+ const dataset = {
90
+ database: "dosleg",
91
+ repairEncoding: false,
92
+ title: "demo",
93
+ url: "https://example.test/demo.zip",
94
+ };
95
+ expect(rewriteLineForStagingImport("SET search_path = dosleg, pg_catalog;", dataset, "dosleg_staging")).toBe("SET search_path = dosleg_staging, pg_catalog;");
96
+ expect(rewriteLineForStagingImport("CREATE TABLE texte (id integer);", dataset, "dosleg_staging")).toBe("CREATE UNLOGGED TABLE texte (id integer);");
97
+ expect(rewriteLineForStagingImport("CREATE SEQUENCE texte_id_seq;", dataset, "dosleg_staging")).toBe("CREATE UNLOGGED SEQUENCE texte_id_seq;");
98
+ expect(rewriteLineForStagingImport("SELECT * FROM dosleg.texte;", dataset, "dosleg_staging")).toBe("SELECT * FROM dosleg_staging.texte;");
99
+ expect(rewriteLineForStagingImport("SELECT 'dosleg.texte'::text;", dataset, "dosleg_staging")).toBe("SELECT 'dosleg.texte'::text;");
100
+ });
101
+ it("keeps two-part COMMENT ON COLUMN statements when the table name matches the dataset name", () => {
102
+ const dataset = {
103
+ database: "debats",
104
+ repairEncoding: false,
105
+ title: "demo",
106
+ url: "https://example.test/demo.zip",
107
+ };
108
+ expect(rewriteLineForStagingImport("COMMENT ON COLUMN debats.datsea IS 'Date de la séance (clé)';", dataset, "debats_staging")).toBe("COMMENT ON COLUMN debats.datsea IS 'Date de la séance (clé)';");
109
+ });
110
+ it("rewrites sens dump references that still use the senat schema", () => {
111
+ const dataset = {
112
+ database: "sens",
113
+ repairEncoding: false,
114
+ title: "demo",
115
+ url: "https://example.test/demo.zip",
116
+ };
117
+ expect(rewriteLineForStagingImport("SET search_path = senat, pg_catalog;", dataset, "sens_staging")).toBe("SET search_path = sens_staging, pg_catalog;");
118
+ expect(rewriteLineForStagingImport("CREATE SCHEMA senat;", dataset, "sens_staging")).toBe("CREATE SCHEMA IF NOT EXISTS sens_staging;");
119
+ expect(rewriteLineForStagingImport("ALTER TABLE senat.senateur ADD COLUMN test integer;", dataset, "sens_staging")).toBe("ALTER TABLE sens_staging.senateur ADD COLUMN test integer;");
120
+ });
121
+ it("skips privilege statements during staging import", () => {
122
+ const dataset = {
123
+ database: "ameli",
124
+ repairEncoding: false,
125
+ title: "demo",
126
+ url: "https://example.test/demo.zip",
127
+ };
128
+ expect(rewriteLineForStagingImport("GRANT ALL ON TABLE amd TO opendata;", dataset, "ameli_staging")).toBe("-- skipped GRANT/REVOKE during staging import");
129
+ expect(rewriteLineForStagingImport("REVOKE ALL ON TABLE amd FROM opendata;", dataset, "ameli_staging")).toBe("-- skipped GRANT/REVOKE during staging import");
130
+ });
131
+ it("skips redundant dump cleanup statements during staging import", () => {
132
+ const dataset = {
133
+ database: "ameli",
134
+ repairEncoding: false,
135
+ title: "demo",
136
+ url: "https://example.test/demo.zip",
137
+ };
138
+ expect(rewriteLineForStagingImport("ALTER TABLE ONLY ameli_staging.txt_ameli DROP CONSTRAINT IF EXISTS txt_ameli_pkey;", dataset, "ameli_staging")).toBe("-- skipped redundant DROP CONSTRAINT during staging import");
139
+ expect(rewriteLineForStagingImport("DROP INDEX IF EXISTS ameli_staging.pk_txt;", dataset, "ameli_staging")).toBe("-- skipped redundant DROP INDEX during staging import");
140
+ expect(rewriteLineForStagingImport("DROP TABLE IF EXISTS ameli_staging.txt_ameli;", dataset, "ameli_staging")).toBe("-- skipped redundant DROP TABLE during staging import");
141
+ expect(rewriteLineForStagingImport("DROP SCHEMA public;", dataset, "ameli_staging")).toBe("-- skipped redundant DROP SCHEMA public during staging import");
142
+ expect(rewriteLineForStagingImport("CREATE SCHEMA public;", dataset, "ameli_staging")).toBe("-- skipped redundant CREATE SCHEMA public during staging import");
143
+ expect(rewriteLineForStagingImport("COMMENT ON SCHEMA public IS 'standard public schema';", dataset, "ameli_staging")).toBe("-- skipped redundant COMMENT ON SCHEMA public during staging import");
144
+ });
145
+ it("does not rewrite COPY payload lines", () => {
146
+ const dataset = {
147
+ database: "ameli",
148
+ repairEncoding: false,
149
+ title: "demo",
150
+ url: "https://example.test/demo.zip",
151
+ };
152
+ expect(isCopyFromStdinLine("COPY amd (id, obj) FROM stdin;")).toBe(true);
153
+ expect(rewriteLineForStagingImport("1\t<body><p>consultation du public.</p></body>\t<body><p>Mayotte public.</p></body>", dataset, "ameli_staging", true)).toBe("1\t<body><p>consultation du public.</p></body>\t<body><p>Mayotte public.</p></body>");
154
+ });
155
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { buildGeneratedTableManifest, extractPrefixedTableNamesFromGeneratedManifest, prefixedName, senatSchemaName, stagingSchemaName, stripDatasetPrefix, } from "../src/scripts/shared/prefixed_tables";
3
+ describe("prefixed table helpers", () => {
4
+ it("builds prefixed table and staging schema names", () => {
5
+ expect(prefixedName("dosleg", "texte")).toBe("dosleg_texte");
6
+ expect(stagingSchemaName("questions")).toBe("questions_staging");
7
+ expect(senatSchemaName).toBe("senat");
8
+ });
9
+ it("strips the dataset prefix from generated type names", () => {
10
+ expect(stripDatasetPrefix("ameli_amd", "ameli")).toBe("amd");
11
+ expect(stripDatasetPrefix("ameli_txt_ameli", "ameli")).toBe("txt_ameli");
12
+ expect(stripDatasetPrefix("amd", "ameli")).toBe("amd");
13
+ });
14
+ it("extracts expected prefixed public tables from generated manifests", () => {
15
+ const manifest = buildGeneratedTableManifest("ameli", ["ameli_amd", "ameli_ses", "ameli_txt_ameli"]);
16
+ expect(extractPrefixedTableNamesFromGeneratedManifest(manifest, "ameli")).toEqual([
17
+ "ameli_amd",
18
+ "ameli_ses",
19
+ "ameli_txt_ameli",
20
+ ]);
21
+ });
22
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { buildEnsureSchemaVersionTableSql, buildIncrementSchemaVersionSql, buildSchemaStructureFingerprintQuery, } from "../src/scripts/shared/schema_version";
3
+ describe("schema version SQL", () => {
4
+ it("creates the senat.version table and seeds version zero", () => {
5
+ const sql = buildEnsureSchemaVersionTableSql("senat");
6
+ expect(sql).toContain("CREATE TABLE IF NOT EXISTS senat.version(");
7
+ expect(sql).toContain("number integer PRIMARY KEY");
8
+ expect(sql).toContain("COMMENT ON TABLE senat.version IS 'version of database'");
9
+ expect(sql).toContain("INSERT INTO senat.version(number)");
10
+ expect(sql).toContain("SELECT 0");
11
+ });
12
+ it("builds a fingerprint query that ignores the version table itself", () => {
13
+ const sql = buildSchemaStructureFingerprintQuery("senat");
14
+ expect(sql).toContain("table_class.relname <> 'version'");
15
+ expect(sql).toContain("columns.table_name <> 'version'");
16
+ expect(sql).toContain("constraint_data.contype <> 'n'");
17
+ expect(sql).toContain("pg_get_indexdef(idx.indexrelid)");
18
+ expect(sql).toContain("SELECT coalesce(md5(string_agg(entry, E'\\n' ORDER BY entry)), '')");
19
+ });
20
+ it("increments the schema version with a simple update", () => {
21
+ expect(buildIncrementSchemaVersionSql("senat")).toBe("UPDATE senat.version SET number = number + 1");
22
+ });
23
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ import { readFileSync } from "fs";
2
+ import { describe, expect, it } from "vitest";
3
+ import { datasets } from "../src/datasets";
4
+ import { extractPrefixedTableNamesFromGeneratedManifest, getGeneratedTableManifestPath, } from "../src/scripts/shared/prefixed_tables";
5
+ describe("generated raw types coverage", () => {
6
+ it("maps each generated dataset definition to prefixed senat tables", () => {
7
+ for (const dataset of Object.values(datasets)) {
8
+ const manifest = readFileSync(getGeneratedTableManifestPath(dataset.database), { encoding: "utf8" });
9
+ const tableNames = extractPrefixedTableNamesFromGeneratedManifest(manifest, dataset.database);
10
+ expect(tableNames.length).toBeGreaterThan(0);
11
+ expect(tableNames.every((tableName) => tableName.startsWith(`${dataset.database}_`))).toBe(true);
12
+ }
13
+ });
14
+ });
@@ -0,0 +1,44 @@
1
+ export interface AgendaEvent {
2
+ id: string;
3
+ type: string | null;
4
+ date: string;
5
+ startTime: string | null;
6
+ endTime: string | null;
7
+ timeOriginal: string | null;
8
+ titre: string;
9
+ organe: string | null;
10
+ objet: string | null;
11
+ lieu: string | null;
12
+ captationVideo: boolean;
13
+ urlDossierSenat: string | null;
14
+ quantieme: string | null;
15
+ }
16
+ export type TimeSlot = "MATIN" | "APRES-MIDI" | "SOIR" | "UNKNOWN";
17
+ export interface Reunion {
18
+ uid: string;
19
+ chambre: "SN";
20
+ date: string;
21
+ startTime: string | null;
22
+ endTime: string | null;
23
+ captationVideo: boolean;
24
+ titre: string;
25
+ type: string;
26
+ organe?: string;
27
+ objet?: string;
28
+ lieu?: string;
29
+ events: AgendaEvent[];
30
+ compteRenduRefUid?: string;
31
+ transcriptionRef?: string;
32
+ urlVideo?: string;
33
+ timecodeDebutVideo?: number;
34
+ timecodeFinVideo?: number;
35
+ odj?: ReunionOdj;
36
+ }
37
+ export interface ReunionOdjPoint {
38
+ objet: string | null;
39
+ dossierLegislatifRef: string | null;
40
+ codeEtape: string | null;
41
+ }
42
+ export interface ReunionOdj {
43
+ pointsOdj: ReunionOdjPoint[];
44
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import { ses as Ses, sub as Sub, subFields, txt_ameli } from "../raw_types_schemats/ameli";
2
+ export type { Ses, Sub };
3
+ export interface TxtAmeli extends txt_ameli {
4
+ subids?: subFields.id[];
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ export const sesFieldsToParseInt = ["ann"];
2
+ export const sesFieldsToTrim = ["lil"];
3
+ export const subFieldsToParseInt = ["pos", "posder", "prires"];
4
+ export const subFieldsToTrim = ["lic", "lib", "sig", "style"];
5
+ export const txtAmeliFieldsToTrim = [
6
+ "num",
7
+ "int",
8
+ "inl",
9
+ "libdelim",
10
+ "libcplnat",
11
+ "doslegsignet",
12
+ "ordsnddelib",
13
+ ];
@@ -0,0 +1,21 @@
1
+ import { ses as Ses, sub as Sub, subFields, txt_ameli } from "../raw_types_schemats/ameli"
2
+
3
+ export { Ses, Sub }
4
+
5
+ export interface TxtAmeli extends txt_ameli {
6
+ subids?: subFields.id[]
7
+ }
8
+
9
+ export const sesFieldsToParseInt = ["ann"]
10
+ export const sesFieldsToTrim = ["lil"]
11
+ export const subFieldsToParseInt = ["pos", "posder", "prires"]
12
+ export const subFieldsToTrim = ["lic", "lib", "sig", "style"]
13
+ export const txtAmeliFieldsToTrim = [
14
+ "num",
15
+ "int",
16
+ "inl",
17
+ "libdelim",
18
+ "libcplnat",
19
+ "doslegsignet",
20
+ "ordsnddelib",
21
+ ]
@@ -0,0 +1,83 @@
1
+ export interface CompteRendu {
2
+ uid: string;
3
+ seanceRef: string;
4
+ sessionRef: string;
5
+ metadonnees: Metadonnees;
6
+ contenu: Contenu;
7
+ }
8
+ export interface Metadonnees {
9
+ dateSeance: string;
10
+ dateSeanceJour: string;
11
+ numSeanceJour: string;
12
+ numSeance: string;
13
+ typeAssemblee: "AN" | "SN";
14
+ legislature: string;
15
+ session: string;
16
+ nomFichierJo: string;
17
+ validite: string;
18
+ etat: string;
19
+ diffusion: string;
20
+ version: string;
21
+ environnement: string;
22
+ heureGeneration: Date;
23
+ sommaire?: Sommaire;
24
+ }
25
+ export interface Contenu {
26
+ quantiemes: Quantiemes;
27
+ ouvertureSeance?: Point[] | Point;
28
+ point: Point[] | Point;
29
+ finSeance?: FinSeance;
30
+ paragraphe?: Point[];
31
+ }
32
+ export interface FinSeance {
33
+ point: Point;
34
+ }
35
+ export interface Quantiemes {
36
+ journee: string;
37
+ session: string;
38
+ }
39
+ export interface Point {
40
+ ordre_absolu_seance: string;
41
+ code_grammaire: string;
42
+ roledebat?: string;
43
+ orateurs?: {
44
+ orateur: {
45
+ nom: string;
46
+ id: string;
47
+ qualite: string;
48
+ };
49
+ };
50
+ texte: {
51
+ _: string;
52
+ };
53
+ code_style?: string;
54
+ }
55
+ export interface Texte {
56
+ _?: string;
57
+ id_syceron?: string;
58
+ stime?: string;
59
+ sup?: string;
60
+ lienAdt?: Texte[] | Texte;
61
+ }
62
+ export interface Sommaire {
63
+ presidentSeance: Texte;
64
+ sommaire1: SommaireElement[] | SommaireElement;
65
+ sommaire3?: SommaireElement[] | SommaireElement;
66
+ sommaire2?: SommaireElement[] | SommaireElement;
67
+ para?: Texte[] | Texte;
68
+ }
69
+ export interface SommaireElement {
70
+ valeur_pts_odj: string | undefined;
71
+ titreStruct: TitreStruct;
72
+ para?: Array<Texte | string> | Texte;
73
+ sommaire2?: SommaireElement[] | SommaireElement;
74
+ sommaire3?: SommaireElement[] | SommaireElement;
75
+ presidentSeance?: Texte[] | Texte;
76
+ type_debat?: string;
77
+ }
78
+ export interface TitreStruct {
79
+ id_syceron: string;
80
+ intitule?: string;
81
+ sousIntitule?: string;
82
+ type_debat?: string;
83
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { debats as Debat, lecassdeb as LecAssDeb } from "../raw_types_schemats/debats";
2
+ export type { Debat, LecAssDeb };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export const debatsFieldsToTrim = ["deburl", "libspec"];
2
+ export const lecassdebFieldsToTrim = ["lecassidt"];
@@ -0,0 +1,6 @@
1
+ import { debats as Debat, lecassdeb as LecAssDeb } from "../raw_types_schemats/debats"
2
+
3
+ export { Debat, LecAssDeb }
4
+
5
+ export const debatsFieldsToTrim = ["deburl", "libspec"]
6
+ export const lecassdebFieldsToTrim = ["lecassidt"]
@@ -0,0 +1,70 @@
1
+ import { txt_ameliFields } from "../raw_types_schemats/ameli";
2
+ import { ass as Ass, aud, audFields, auteur, date_seance, date_seanceFields as dateSeanceFields, deccoc as DecCoc, denrap as DenRap, docatt, docattFields, ecr, ecrFields, etaloi as EtaLoi, lecass, lecassFields, lecassrap, lecture, lectureFields, loi, org as Org, oritxt as OriTxt, qua as Qua, rap, raporg as RapOrg, raporgFields, scr as Scr, texte, texteFields, typatt as TypAtt, typlec as TypLec, typloi as TypLoi, typtxt as TypTxt, typurl as TypUrl, typurlFields } from "../raw_types_schemats/dosleg";
3
+ import { Debat } from "./debats";
4
+ import { TxtAmeli } from "./ameli";
5
+ export type { Ass, DecCoc, DenRap, EtaLoi, Org, OriTxt, Qua, RapOrg, Scr, TypAtt, TypLec, TypLoi, TypTxt, TypUrl };
6
+ export interface Aud extends aud {
7
+ org?: Org;
8
+ }
9
+ export interface Auteur extends auteur {
10
+ qua?: Qua;
11
+ }
12
+ export interface DateSeance extends date_seance {
13
+ debat?: Debat;
14
+ scrids?: string[];
15
+ scrs?: Scr[];
16
+ }
17
+ export interface DocAtt extends docatt {
18
+ rap?: Rap;
19
+ typatt?: TypAtt;
20
+ }
21
+ export interface Ecr extends ecr {
22
+ aut?: Auteur;
23
+ }
24
+ export interface LecAss extends lecass {
25
+ ass?: Ass;
26
+ auds?: Aud[];
27
+ audcles?: audFields.audcle[];
28
+ datesSeances?: DateSeance[];
29
+ datesSeancesCodes?: dateSeanceFields.code[];
30
+ debatdatseas: Date[];
31
+ lecassraps?: LecAssRap[];
32
+ lecassrapids?: string[];
33
+ org?: Org;
34
+ texcods: texteFields.texcod[];
35
+ textes?: Texte[];
36
+ }
37
+ export interface LecAssRap extends lecassrap {
38
+ rap?: Rap;
39
+ }
40
+ export interface Lecture extends lecture {
41
+ typlec?: TypLec;
42
+ lecassidts?: lecassFields.lecassidt[];
43
+ lecasss?: LecAss[];
44
+ }
45
+ export interface Loi extends loi {
46
+ deccoc?: DecCoc;
47
+ etaloi?: EtaLoi;
48
+ lecidts?: lectureFields.lecidt[];
49
+ lectures?: Lecture[];
50
+ typloi?: TypLoi;
51
+ }
52
+ export interface Rap extends rap {
53
+ denrap?: DenRap;
54
+ docattcles?: docattFields.docattcle[];
55
+ docatts?: DocAtt[];
56
+ ecrnums?: ecrFields.ecrnum[];
57
+ ecrs?: Ecr[];
58
+ orgcods?: raporgFields.orgcod[];
59
+ orgs?: Org[];
60
+ }
61
+ export interface Texte extends texte {
62
+ ecrs?: Ecr[];
63
+ ecrnums?: ecrFields.ecrnum[];
64
+ libtypurl?: typurlFields.libtypurl;
65
+ org?: Org;
66
+ oritxt: OriTxt;
67
+ typtxt?: TypTxt;
68
+ txtAmeli?: TxtAmeli;
69
+ txtAmeliId: txt_ameliFields.id;
70
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,151 @@
1
+ export const assFieldsToTrim = ["libass"];
2
+ export const audFieldsToTrim = ["lecassidt", "audtit", "audurl", "orgcod"];
3
+ export const auteurFieldsToTrim = [
4
+ "autcod",
5
+ "quacod",
6
+ "typautcod",
7
+ "nomuse",
8
+ "prenom",
9
+ "nomtec",
10
+ "autmat",
11
+ "autfct",
12
+ ];
13
+ export const dateSeanceFieldsToTrim = ["lecidt", "statut"];
14
+ export const deccocFieldsToTrim = ["deccoccod", "deccoclib"];
15
+ export const denrapFieldsToTrim = [
16
+ "coddenrap",
17
+ "typraprap",
18
+ "libdenrap",
19
+ "denrapmin",
20
+ "denraptit",
21
+ "denrapstymin",
22
+ "solnatrapcod",
23
+ ];
24
+ export const docattFieldsToParseInt = ["docattcle", "rapcod"];
25
+ export const docattFieldsToTrim = ["docatturl"];
26
+ export const ecrFieldsToTrim = ["autcod", "ecrqua"];
27
+ export const etaloiFieldsToTrim = ["etaloilib"];
28
+ export const lecassFieldsToTrim = [
29
+ "lecassidt",
30
+ "lecidt",
31
+ "ptlurl",
32
+ "ptlnumcpl",
33
+ "ptlnot",
34
+ "ptlurl2",
35
+ "ptlnot2",
36
+ "ptlurl3",
37
+ "ptlnot3",
38
+ "ptlnumcpl2",
39
+ "ptlnumcpl3",
40
+ "lecassame",
41
+ "orgcod",
42
+ "loiintmod",
43
+ "reucom",
44
+ "debatsurl",
45
+ "libppr",
46
+ "ptlurlcom",
47
+ "aliasppr",
48
+ "lecassamecom",
49
+ ];
50
+ export const lecassrapFieldsToTrim = ["lecassidt"];
51
+ export const lectureFieldsToTrim = ["lecidt", "loicod", "typleccod", "leccom"];
52
+ export const loiFieldsToTrim = [
53
+ "loicod",
54
+ "typloicod",
55
+ "deccoccod",
56
+ "numero",
57
+ "loient",
58
+ "motclef",
59
+ "loitit",
60
+ "loiint",
61
+ "url_jo",
62
+ "loinumjo",
63
+ "loititjo",
64
+ "url_jo2",
65
+ "loinumjo2",
66
+ "deccocurl",
67
+ "num_decision",
68
+ "loicodmai",
69
+ "loinoudelibcod",
70
+ "motionloiorigcod",
71
+ "url_ordonnance",
72
+ "saisine_par",
73
+ "loinumjo3",
74
+ "url_jo3",
75
+ "url_an",
76
+ "url_presart",
77
+ "signetalt",
78
+ "orgcod",
79
+ "doscocurl",
80
+ "loiintori",
81
+ ];
82
+ export const orgFieldsToTrim = [
83
+ "orgcod",
84
+ "typorgcod",
85
+ "orgnom",
86
+ "orgliblon",
87
+ "orglibaff",
88
+ "orgurl",
89
+ "orglibcou",
90
+ "org_de",
91
+ "urltra",
92
+ "inttra",
93
+ "orgnomcouv",
94
+ "senorgcod",
95
+ "html_color",
96
+ ];
97
+ export const oritxtFieldsToTrim = ["oritxtcod", "oritxtlib", "oritxtlibfem"];
98
+ export const quaFieldsToTrim = ["quacod", "qualic", "quaabr", "quaabrplu"];
99
+ export const rapFieldsToParseInt = ["rapcod", "sesann", "rapnum", "rapnuman"];
100
+ export const rapFieldsToTrim = [
101
+ "coddenrap",
102
+ "blecod",
103
+ "raptitcou",
104
+ "raptil",
105
+ "rapurl",
106
+ "url2",
107
+ "url3",
108
+ "url4",
109
+ "url2txt",
110
+ "url3txt",
111
+ "url4txt",
112
+ "prix",
113
+ "numerobis",
114
+ "rapsoustit",
115
+ "rapres",
116
+ "forpubcod",
117
+ ];
118
+ export const raporgFieldsToTrim = ["orgcod"];
119
+ export const scrFieldsToTrim = ["scrint", "soslib"];
120
+ export const texteFieldsToParseInt = ["texcod", "sesann", "texnum"];
121
+ export const texteFieldsToTrim = [
122
+ "oritxtcod",
123
+ "typtxtcod",
124
+ "lecassidt",
125
+ "orgcod",
126
+ "texurl",
127
+ "url2",
128
+ "url3",
129
+ "url4",
130
+ "url2txt",
131
+ "url3txt",
132
+ "url4txt",
133
+ "prix",
134
+ "numerobis",
135
+ "reserve_comspe",
136
+ ];
137
+ export const typattFieldsToTrim = ["typattlib"];
138
+ export const typlecFieldsToTrim = ["typleccod", "typleclib"];
139
+ export const typloiFieldsToTrim = [
140
+ "typloicod",
141
+ "typloilib",
142
+ "groupe",
143
+ "typloiden",
144
+ "typloigen",
145
+ "typloitit",
146
+ "typloidenplu",
147
+ "typloide",
148
+ "typloiabr",
149
+ ];
150
+ export const typtxtFieldsToTrim = ["typtxtcod", "typtxtlib"];
151
+ export const typurlFieldsToTrim = ["libtypurl"];