@tricoteuses/senat 3.1.18 → 3.1.19

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 (65) hide show
  1. package/lib/src/config.d.ts +0 -22
  2. package/lib/src/config.js +7 -17
  3. package/lib/src/conversion_textes.js +1 -5
  4. package/lib/src/databases.d.ts +2 -0
  5. package/lib/src/databases.js +26 -0
  6. package/lib/src/datasets.d.ts +0 -4
  7. package/lib/src/datasets.js +2 -16
  8. package/lib/src/git.d.ts +0 -1
  9. package/lib/src/git.js +11 -45
  10. package/lib/src/loaders.d.ts +12 -12
  11. package/lib/src/loaders.js +8 -14
  12. package/lib/src/model/agenda.d.ts +1 -1
  13. package/lib/src/model/agenda.js +3 -3
  14. package/lib/src/model/ameli.d.ts +52 -64
  15. package/lib/src/model/ameli.js +145 -147
  16. package/lib/src/model/commission.d.ts +4 -5
  17. package/lib/src/model/commission.js +6 -6
  18. package/lib/src/model/debats.d.ts +66 -38
  19. package/lib/src/model/debats.js +93 -110
  20. package/lib/src/model/documents.d.ts +12 -32
  21. package/lib/src/model/documents.js +130 -171
  22. package/lib/src/model/dosleg.d.ts +5 -142
  23. package/lib/src/model/dosleg.js +156 -298
  24. package/lib/src/model/index.d.ts +7 -7
  25. package/lib/src/model/index.js +7 -7
  26. package/lib/src/model/questions.d.ts +45 -54
  27. package/lib/src/model/questions.js +87 -89
  28. package/lib/src/model/scrutins.d.ts +13 -48
  29. package/lib/src/model/scrutins.js +111 -118
  30. package/lib/src/model/seance.d.ts +1 -1
  31. package/lib/src/model/seance.js +7 -7
  32. package/lib/src/model/sens.d.ts +179 -109
  33. package/lib/src/model/sens.js +484 -384
  34. package/lib/src/model/util.d.ts +8 -0
  35. package/lib/src/model/util.js +23 -0
  36. package/lib/src/raw_types/ameli.d.ts +800 -1648
  37. package/lib/src/raw_types/ameli.js +5 -1074
  38. package/lib/src/raw_types/debats.d.ts +180 -353
  39. package/lib/src/raw_types/debats.js +5 -266
  40. package/lib/src/raw_types/dosleg.d.ts +1523 -2858
  41. package/lib/src/raw_types/dosleg.js +5 -2005
  42. package/lib/src/raw_types/questions.d.ts +395 -671
  43. package/lib/src/raw_types/questions.js +5 -493
  44. package/lib/src/raw_types/senat.d.ts +11372 -0
  45. package/lib/src/raw_types/senat.js +5 -0
  46. package/lib/src/raw_types/sens.d.ts +8148 -7743
  47. package/lib/src/raw_types/sens.js +5 -4691
  48. package/lib/src/raw_types_schemats/ameli.d.ts +2 -4
  49. package/lib/src/raw_types_schemats/debats.d.ts +2 -2
  50. package/lib/src/raw_types_schemats/dosleg.d.ts +2 -2
  51. package/lib/src/raw_types_schemats/questions.d.ts +2 -2
  52. package/lib/src/raw_types_schemats/sens.d.ts +4235 -29
  53. package/lib/src/scripts/test_iter_load.d.ts +1 -0
  54. package/lib/src/scripts/test_iter_load.js +12 -0
  55. package/lib/src/types/ameli.d.ts +4 -4
  56. package/lib/src/types/dosleg.d.ts +39 -39
  57. package/lib/src/types/questions.d.ts +2 -2
  58. package/lib/src/types/sens.d.ts +2 -0
  59. package/lib/src/types/texte.d.ts +2 -2
  60. package/lib/src/utils/reunion_odj_building.js +27 -11
  61. package/package.json +1 -1
  62. package/lib/src/databases_postgres.d.ts +0 -4
  63. package/lib/src/databases_postgres.js +0 -23
  64. package/lib/src/scripts/debug_dosleg_query.d.ts +0 -6
  65. package/lib/src/scripts/debug_dosleg_query.js +0 -50
@@ -1 +1,9 @@
1
+ import { Expression } from "kysely";
2
+ export declare function concat(...exprs: Expression<number | string | null | undefined>[]): import("kysely").RawBuilder<string>;
3
+ export declare function expandToRows(expr: Expression<string | null | undefined>, regexp: Expression<string>): import("kysely").RawBuilder<unknown>;
4
+ export declare function nullIf(expr: Expression<number | string | null | undefined>): import("kysely").RawBuilder<unknown>;
5
+ export declare function removeSubstring(expr: Expression<string | null | undefined>, pattern: Expression<string>): import("kysely").RawBuilder<string>;
6
+ export declare function replace(expr: Expression<string | null | undefined>, pattern: Expression<string>, replacement: Expression<string>): import("kysely").RawBuilder<string>;
7
+ export declare function rtrim(expr: Expression<string | null | undefined>): import("kysely").RawBuilder<string>;
8
+ export declare function toDateString(expr: Expression<Date | null | undefined>, format?: Expression<string>): import("kysely").RawBuilder<string>;
1
9
  export declare function toCRDate(dateISO: string, startTime?: string | null): string;
@@ -1,3 +1,26 @@
1
+ import { sql } from "kysely";
2
+ import { STANDARD_DATE_FORMAT } from "../scripts/datautil";
3
+ export function concat(...exprs) {
4
+ return sql.join(exprs, sql `||`).$castTo();
5
+ }
6
+ export function expandToRows(expr, regexp) {
7
+ return sql `unnest(regexp_matches(${expr}, ${regexp}, 'g'))`;
8
+ }
9
+ export function nullIf(expr) {
10
+ return sql `nullif(trim(${expr}), '')`;
11
+ }
12
+ export function removeSubstring(expr, pattern) {
13
+ return replace(expr, pattern, sql.val(""));
14
+ }
15
+ export function replace(expr, pattern, replacement) {
16
+ return sql `replace(${expr}, ${pattern}, ${replacement})`;
17
+ }
18
+ export function rtrim(expr) {
19
+ return sql `rtrim(${expr})`;
20
+ }
21
+ export function toDateString(expr, format = sql.val(STANDARD_DATE_FORMAT)) {
22
+ return sql `to_char(${expr}, ${format})`;
23
+ }
1
24
  export function toCRDate(dateISO, startTime) {
2
25
  const yyyymmdd = dateISO.replace(/-/g, ""); // "20250716"
3
26
  let hh = "00", mm = "00", ss = "00", SSS = "000";