@tricoteuses/senat 2.22.5 → 2.22.7

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 (146) hide show
  1. package/lib/config.d.ts +12 -1
  2. package/lib/config.js +12 -1
  3. package/lib/loaders.js +1 -1
  4. package/lib/model/ameli.js +1 -3
  5. package/lib/model/documents.js +5 -18
  6. package/lib/model/dosleg.js +11 -11
  7. package/lib/model/texte.js +15 -43
  8. package/lib/raw_types/questions.d.ts +4 -0
  9. package/lib/raw_types/senat.d.ts +4 -0
  10. package/lib/raw_types_schemats/ameli.d.ts +1 -1
  11. package/lib/raw_types_schemats/debats.d.ts +1 -1
  12. package/lib/raw_types_schemats/dosleg.d.ts +1 -1
  13. package/lib/raw_types_schemats/questions.d.ts +3 -1
  14. package/lib/raw_types_schemats/sens.d.ts +1 -1
  15. package/lib/scripts/convert_data.js +3 -3
  16. package/lib/scripts/parse_textes.js +2 -2
  17. package/lib/scripts/retrieve_open_data.js +1 -0
  18. package/lib/scripts/test_iter_load.js +1 -1
  19. package/lib/src/model/ameli.d.ts +4 -0
  20. package/lib/src/model/ameli.js +3 -3
  21. package/lib/src/scripts/retrieve_videos.js +1 -0
  22. package/lib/src/types/agenda.d.ts +1 -0
  23. package/lib/src/utils/nvs-timecode.d.ts +17 -0
  24. package/lib/src/utils/nvs-timecode.js +79 -0
  25. package/lib/src/utils/weights_scoring_config.d.ts +2 -0
  26. package/lib/src/utils/weights_scoring_config.js +15 -0
  27. package/lib/src/videos/pipeline.d.ts +2 -0
  28. package/lib/src/videos/pipeline.js +3 -2
  29. package/lib/utils/reunion_grouping.d.ts +4 -2
  30. package/lib/utils/reunion_grouping.js +6 -30
  31. package/package.json +1 -1
  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.mjs +0 -16
  37. package/lib/config.ts +0 -26
  38. package/lib/databases.mjs +0 -57
  39. package/lib/databases.ts +0 -71
  40. package/lib/datasets.mjs +0 -78
  41. package/lib/datasets.ts +0 -118
  42. package/lib/fields.d.ts +0 -10
  43. package/lib/fields.js +0 -68
  44. package/lib/fields.mjs +0 -22
  45. package/lib/fields.ts +0 -29
  46. package/lib/index.mjs +0 -7
  47. package/lib/index.ts +0 -64
  48. package/lib/inserters.d.ts +0 -98
  49. package/lib/inserters.js +0 -500
  50. package/lib/inserters.mjs +0 -360
  51. package/lib/inserters.ts +0 -521
  52. package/lib/legislatures.json +0 -38
  53. package/lib/loaders.mjs +0 -158
  54. package/lib/loaders.ts +0 -271
  55. package/lib/model/ameli.mjs +0 -84
  56. package/lib/model/ameli.ts +0 -100
  57. package/lib/model/debats.mjs +0 -43
  58. package/lib/model/debats.ts +0 -68
  59. package/lib/model/dosleg.mjs +0 -196
  60. package/lib/model/dosleg.ts +0 -240
  61. package/lib/model/index.mjs +0 -5
  62. package/lib/model/index.ts +0 -15
  63. package/lib/model/questions.mjs +0 -71
  64. package/lib/model/questions.ts +0 -93
  65. package/lib/model/sens.mjs +0 -415
  66. package/lib/model/sens.ts +0 -516
  67. package/lib/model/texte.mjs +0 -208
  68. package/lib/model/texte.ts +0 -229
  69. package/lib/model/util.mjs +0 -19
  70. package/lib/model/util.ts +0 -32
  71. package/lib/raw_types/ameli.mjs +0 -163
  72. package/lib/raw_types/debats.mjs +0 -58
  73. package/lib/raw_types/dosleg.mjs +0 -438
  74. package/lib/raw_types/questions.mjs +0 -11
  75. package/lib/raw_types/sens.mjs +0 -508
  76. package/lib/raw_types_kysely/ameli.d.ts +0 -915
  77. package/lib/raw_types_kysely/ameli.js +0 -7
  78. package/lib/raw_types_kysely/ameli.mjs +0 -5
  79. package/lib/raw_types_kysely/ameli.ts +0 -951
  80. package/lib/raw_types_kysely/debats.d.ts +0 -207
  81. package/lib/raw_types_kysely/debats.js +0 -7
  82. package/lib/raw_types_kysely/debats.mjs +0 -5
  83. package/lib/raw_types_kysely/debats.ts +0 -222
  84. package/lib/raw_types_kysely/dosleg.d.ts +0 -3532
  85. package/lib/raw_types_kysely/dosleg.js +0 -7
  86. package/lib/raw_types_kysely/dosleg.mjs +0 -5
  87. package/lib/raw_types_kysely/dosleg.ts +0 -3621
  88. package/lib/raw_types_kysely/questions.d.ts +0 -414
  89. package/lib/raw_types_kysely/questions.js +0 -7
  90. package/lib/raw_types_kysely/questions.mjs +0 -5
  91. package/lib/raw_types_kysely/questions.ts +0 -426
  92. package/lib/raw_types_kysely/sens.d.ts +0 -4394
  93. package/lib/raw_types_kysely/sens.js +0 -7
  94. package/lib/raw_types_kysely/sens.mjs +0 -5
  95. package/lib/raw_types_kysely/sens.ts +0 -4499
  96. package/lib/raw_types_schemats/ameli.mjs +0 -2
  97. package/lib/raw_types_schemats/ameli.ts +0 -601
  98. package/lib/raw_types_schemats/debats.mjs +0 -2
  99. package/lib/raw_types_schemats/debats.ts +0 -145
  100. package/lib/raw_types_schemats/dosleg.mjs +0 -2
  101. package/lib/raw_types_schemats/dosleg.ts +0 -2193
  102. package/lib/raw_types_schemats/questions.mjs +0 -2
  103. package/lib/raw_types_schemats/questions.ts +0 -249
  104. package/lib/raw_types_schemats/sens.mjs +0 -2
  105. package/lib/raw_types_schemats/sens.ts +0 -2907
  106. package/lib/scripts/convert_data.mjs +0 -181
  107. package/lib/scripts/convert_data.ts +0 -243
  108. package/lib/scripts/datautil.mjs +0 -16
  109. package/lib/scripts/datautil.ts +0 -19
  110. package/lib/scripts/images/transparent_150x192.jpg +0 -0
  111. package/lib/scripts/images/transparent_155x225.jpg +0 -0
  112. package/lib/scripts/parse_textes.mjs +0 -46
  113. package/lib/scripts/parse_textes.ts +0 -65
  114. package/lib/scripts/retrieve_documents.mjs +0 -249
  115. package/lib/scripts/retrieve_documents.ts +0 -298
  116. package/lib/scripts/retrieve_open_data.mjs +0 -217
  117. package/lib/scripts/retrieve_open_data.ts +0 -268
  118. package/lib/scripts/retrieve_senateurs_photos.mjs +0 -147
  119. package/lib/scripts/retrieve_senateurs_photos.ts +0 -177
  120. package/lib/scripts/shared/cli_helpers.ts +0 -36
  121. package/lib/scripts/shared/util.ts +0 -33
  122. package/lib/strings.mjs +0 -18
  123. package/lib/strings.ts +0 -26
  124. package/lib/types/ameli.mjs +0 -13
  125. package/lib/types/ameli.ts +0 -21
  126. package/lib/types/debats.mjs +0 -2
  127. package/lib/types/debats.ts +0 -6
  128. package/lib/types/dosleg.mjs +0 -151
  129. package/lib/types/dosleg.ts +0 -284
  130. package/lib/types/questions.mjs +0 -1
  131. package/lib/types/questions.ts +0 -3
  132. package/lib/types/sens.mjs +0 -1
  133. package/lib/types/sens.ts +0 -12
  134. package/lib/types/sessions.mjs +0 -43
  135. package/lib/types/sessions.ts +0 -42
  136. package/lib/types/texte.mjs +0 -16
  137. package/lib/types/texte.ts +0 -76
  138. package/lib/typings/windows-1252.d.js +0 -2
  139. package/lib/typings/windows-1252.d.mjs +0 -2
  140. package/lib/typings/windows-1252.d.ts +0 -11
  141. package/lib/validators/config.mjs +0 -54
  142. package/lib/validators/config.ts +0 -79
  143. package/lib/validators/senat.d.ts +0 -0
  144. package/lib/validators/senat.js +0 -28
  145. package/lib/validators/senat.mjs +0 -24
  146. package/lib/validators/senat.ts +0 -26
@@ -1,713 +0,0 @@
1
- import { getDebats, getDebatsFromLecassidts, getLecAssDebsFromDatseas, } from "./model/debats";
2
- export const allFollows = [
3
- "aud.org",
4
- "auteur.qua",
5
- "dateSeance.debat",
6
- "dateSeance.scrs",
7
- "docatt.rec",
8
- "docatt.typatt",
9
- "ecr.aut",
10
- "lecass.ass",
11
- "lecass.auds",
12
- "lecass.datesSeances",
13
- "lecass.debats",
14
- "lecass.lecassraps",
15
- "lecass.org",
16
- "lecass.textes",
17
- "lecassrap.rap",
18
- "lecture.lecasss",
19
- "lecture.typlec",
20
- "loi.deccoc",
21
- "loi.etaloi",
22
- "loi.lectures",
23
- "loi.typloi",
24
- "rap.denrap",
25
- "rap.docatts",
26
- "rap.ecrs",
27
- "rap.orgs",
28
- "texte.ecrs",
29
- "texte.org",
30
- "texte.oritxt",
31
- "texte.txtAmeli",
32
- "texte.typtxt",
33
- "texte.typurl",
34
- "txtAmeli.subs",
35
- ];
36
- export class Aggregator {
37
- follow;
38
- objectByIdByTableName = {};
39
- requestedIdsByTableName = {};
40
- visitedIdsByTableName = {};
41
- constructor(follow) {
42
- this.follow = follow;
43
- }
44
- addAss(ass) {
45
- let objectById = this.objectByIdByTableName.ass;
46
- if (objectById === undefined) {
47
- objectById = this.objectByIdByTableName.ass = {};
48
- }
49
- objectById[ass.codass] = ass;
50
- }
51
- addAud(aud) {
52
- let objectById = this.objectByIdByTableName.aud;
53
- if (objectById === undefined) {
54
- objectById = this.objectByIdByTableName.aud = {};
55
- }
56
- objectById[aud.audcle] = aud;
57
- if (aud.orgcod !== null && this.follow.has("aud.org")) {
58
- this.request("org", aud.orgcod);
59
- }
60
- }
61
- addAuteur(auteur) {
62
- let objectById = this.objectByIdByTableName.auteur;
63
- if (objectById === undefined) {
64
- objectById = this.objectByIdByTableName.auteur = {};
65
- }
66
- objectById[auteur.autcod] = auteur;
67
- if (this.follow.has("auteur.qua")) {
68
- this.request("qua", auteur.quacod);
69
- }
70
- // TODO
71
- }
72
- addDateSeance(dateSeance) {
73
- let objectById = this.objectByIdByTableName.date_seance;
74
- if (objectById === undefined) {
75
- objectById = this.objectByIdByTableName.date_seance = {};
76
- }
77
- objectById[dateSeance.code] = dateSeance;
78
- if (dateSeance.date_s !== null && this.follow.has("dateSeance.debat")) {
79
- this.request("debats", dateSeance.date_s.toISOString());
80
- }
81
- if (this.follow.has("dateSeance.scrs")) {
82
- this.request("scr_by_code", dateSeance.code.toString());
83
- }
84
- }
85
- addDebat(debat) {
86
- let objectById = this.objectByIdByTableName.debats;
87
- if (objectById === undefined) {
88
- objectById = this.objectByIdByTableName.debats = {};
89
- }
90
- objectById[debat.datsea.toISOString()] = debat;
91
- }
92
- addDeccoc(deccoc) {
93
- let objectById = this.objectByIdByTableName.deccoc;
94
- if (objectById === undefined) {
95
- objectById = this.objectByIdByTableName.deccoc = {};
96
- }
97
- objectById[deccoc.deccoccod] = deccoc;
98
- }
99
- addDenrap(denrap) {
100
- let objectById = this.objectByIdByTableName.denrap;
101
- if (objectById === undefined) {
102
- objectById = this.objectByIdByTableName.denrap = {};
103
- }
104
- objectById[denrap.coddenrap] = denrap;
105
- }
106
- addDocatt(docatt) {
107
- let objectById = this.objectByIdByTableName.docatt;
108
- if (objectById === undefined) {
109
- objectById = this.objectByIdByTableName.docatt = {};
110
- }
111
- objectById[docatt.docattcle] = docatt;
112
- if (this.follow.has("docatt.rap")) {
113
- this.request("rap", docatt.rapcod.toString());
114
- }
115
- if (this.follow.has("docatt.typatt")) {
116
- this.request("typatt", docatt.rapcod.toString());
117
- }
118
- }
119
- addEcr(ecr) {
120
- let objectById = this.objectByIdByTableName.ecr;
121
- if (objectById === undefined) {
122
- objectById = this.objectByIdByTableName.ecr = {};
123
- }
124
- objectById[ecr.ecrnum] = ecr;
125
- if (ecr.autcod !== null && this.follow.has("ecr.aut")) {
126
- this.request("auteur", ecr.autcod);
127
- }
128
- }
129
- addEtaloi(etaloi) {
130
- let objectById = this.objectByIdByTableName.etaloi;
131
- if (objectById === undefined) {
132
- objectById = this.objectByIdByTableName.etaloi = {};
133
- }
134
- objectById[etaloi.etaloicod] = etaloi;
135
- }
136
- addLecass(lecass) {
137
- let objectById = this.objectByIdByTableName.lecass;
138
- if (objectById === undefined) {
139
- objectById = this.objectByIdByTableName.lecass = {};
140
- }
141
- objectById[lecass.lecassidt] = lecass;
142
- if (this.follow.has("lecass.ass")) {
143
- this.request("ass", lecass.codass);
144
- }
145
- if (lecass.orgcod !== null && this.follow.has("lecass.org")) {
146
- this.request("org", lecass.orgcod);
147
- }
148
- if (this.follow.has("lecass.auds")) {
149
- this.request("aud_by_lecassidt", lecass.lecassidt);
150
- }
151
- if (this.follow.has("lecass.datesSeances")) {
152
- this.request("date_seance_by_lecassidt", lecass.lecassidt);
153
- }
154
- if (this.follow.has("lecass.debats")) {
155
- this.request("debat_by_lecassidt", lecass.lecassidt);
156
- }
157
- if (this.follow.has("lecass.lecassraps")) {
158
- this.request("lecassrap_by_lecassidt", lecass.lecassidt);
159
- }
160
- if (this.follow.has("lecass.textes")) {
161
- this.request("texte_by_lecassidt", lecass.lecassidt);
162
- }
163
- }
164
- addLecassrap(lecassrap) {
165
- let objectById = this.objectByIdByTableName.lecassrap;
166
- if (objectById === undefined) {
167
- objectById = this.objectByIdByTableName.lecassrap = {};
168
- }
169
- objectById[`${lecassrap.lecassidt} ${lecassrap.rapcod}`] = lecassrap;
170
- if (this.follow.has("lecassrap.rap")) {
171
- this.request("rap", lecassrap.rapcod.toString());
172
- }
173
- }
174
- addLecture(lecture) {
175
- let objectById = this.objectByIdByTableName.lecture;
176
- if (objectById === undefined) {
177
- objectById = this.objectByIdByTableName.lecture = {};
178
- }
179
- objectById[lecture.lecidt] = lecture;
180
- if (this.follow.has("lecture.typlec")) {
181
- this.request("typlec", lecture.typleccod);
182
- }
183
- if (this.follow.has("lecture.lecasss")) {
184
- this.request("lecasss_by_lecidt", lecture.lecidt);
185
- }
186
- }
187
- addLoi(loi) {
188
- let objectById = this.objectByIdByTableName.loi;
189
- if (objectById === undefined) {
190
- objectById = this.objectByIdByTableName.loi = {};
191
- }
192
- objectById[loi.loicod] = loi;
193
- if (this.follow.has("loi.typloi")) {
194
- this.request("typloi", loi.typloicod);
195
- }
196
- if (this.follow.has("loi.etaloi") && loi.etaloicod !== null) {
197
- this.request("etaloi", loi.etaloicod);
198
- }
199
- if (this.follow.has("loi.deccoc") && loi.deccoccod !== null) {
200
- this.request("deccoc", loi.deccoccod);
201
- }
202
- if (this.follow.has("loi.lectures")) {
203
- this.request("lectures_by_loicod", loi.loicod);
204
- }
205
- }
206
- addOrg(org) {
207
- let objectById = this.objectByIdByTableName.org;
208
- if (objectById === undefined) {
209
- objectById = this.objectByIdByTableName.org = {};
210
- }
211
- objectById[org.orgcod] = org;
212
- // TODO
213
- }
214
- addOritxt(oritxt) {
215
- let objectById = this.objectByIdByTableName.oritxt;
216
- if (objectById === undefined) {
217
- objectById = this.objectByIdByTableName.oritxt = {};
218
- }
219
- objectById[oritxt.oritxtcod] = oritxt;
220
- // TODO
221
- }
222
- addQua(qua) {
223
- let objectById = this.objectByIdByTableName.qua;
224
- if (objectById === undefined) {
225
- objectById = this.objectByIdByTableName.qua = {};
226
- }
227
- objectById[qua.quacod] = qua;
228
- }
229
- addQuestion(question) {
230
- let objectById = this.objectByIdByTableName.tam_questions;
231
- if (objectById === undefined) {
232
- objectById = this.objectByIdByTableName.tam_questions = {};
233
- }
234
- objectById[question.id] = question;
235
- }
236
- addRap(rap) {
237
- let objectById = this.objectByIdByTableName.rap;
238
- if (objectById === undefined) {
239
- objectById = this.objectByIdByTableName.rap = {};
240
- }
241
- objectById[rap.rapcod.toString()] = rap;
242
- if (this.follow.has("rap.denrap")) {
243
- this.request("denrap", rap.coddenrap);
244
- }
245
- if (this.follow.has("rap.docatts")) {
246
- this.request("docatt_by_rapcod", rap.rapcod.toString());
247
- }
248
- if (this.follow.has("rap.ecrs")) {
249
- this.request("ecr_by_rapcod", rap.rapcod.toString());
250
- }
251
- if (this.follow.has("rap.orgs")) {
252
- this.request("org_by_rapcod", rap.rapcod.toString());
253
- }
254
- // TODO
255
- }
256
- addScr(scr) {
257
- let objectById = this.objectByIdByTableName.scr;
258
- if (objectById === undefined) {
259
- objectById = this.objectByIdByTableName.scr = {};
260
- }
261
- objectById[`${scr.sesann} ${scr.scrnum}`] = scr;
262
- // TODO
263
- }
264
- addSes(ses) {
265
- let objectById = this.objectByIdByTableName.ses;
266
- if (objectById === undefined) {
267
- objectById = this.objectByIdByTableName.ses = {};
268
- }
269
- objectById[ses.id] = ses;
270
- }
271
- addSub(sub) {
272
- let objectById = this.objectByIdByTableName.sub;
273
- if (objectById === undefined) {
274
- objectById = this.objectByIdByTableName.sub = {};
275
- }
276
- objectById[sub.id] = sub;
277
- // TODO
278
- }
279
- addTexte(texte) {
280
- let objectById = this.objectByIdByTableName.texte;
281
- if (objectById === undefined) {
282
- objectById = this.objectByIdByTableName.texte = {};
283
- }
284
- objectById[texte.texcod] = texte;
285
- if (this.follow.has("texte.ecrs")) {
286
- this.request("ecr_by_texcod", texte.texcod.toString());
287
- }
288
- if (texte.orgcod !== null && this.follow.has("texte.org")) {
289
- this.request("org", texte.orgcod);
290
- }
291
- if (texte.oritxtcod !== null && this.follow.has("texte.oritxt")) {
292
- this.request("oritxt", texte.oritxtcod);
293
- }
294
- if (texte.sesann !== null &&
295
- texte.texnum !== null &&
296
- this.follow.has("texte.txtAmeli")) {
297
- this.request("ses_by_ann", texte.sesann.toString());
298
- this.request("txt_ameli_by_sesann_num", `${texte.sesann} ${texte.texnum}`);
299
- }
300
- if (texte.typtxtcod !== null && this.follow.has("texte.typtxt")) {
301
- this.request("typtxt", texte.typtxtcod);
302
- }
303
- if (texte.typurl !== null && this.follow.has("texte.typurl")) {
304
- this.request("typurl", texte.typurl);
305
- }
306
- }
307
- addTxtAmeli(txtAmeli) {
308
- let objectById = this.objectByIdByTableName.txt_ameli;
309
- if (objectById === undefined) {
310
- objectById = this.objectByIdByTableName.txt_ameli = {};
311
- }
312
- objectById[txtAmeli.id] = txtAmeli;
313
- if (this.follow.has("txtAmeli.subs")) {
314
- this.request("sub_by_txtid", txtAmeli.id.toString());
315
- }
316
- // TODO
317
- }
318
- addTypatt(typatt) {
319
- let objectById = this.objectByIdByTableName.typatt;
320
- if (objectById === undefined) {
321
- objectById = this.objectByIdByTableName.typatt = {};
322
- }
323
- objectById[typatt.typattcod] = typatt;
324
- }
325
- addTyplec(typlec) {
326
- let objectById = this.objectByIdByTableName.typlec;
327
- if (objectById === undefined) {
328
- objectById = this.objectByIdByTableName.typlec = {};
329
- }
330
- objectById[typlec.typleccod] = typlec;
331
- }
332
- addTyploi(typloi) {
333
- let objectById = this.objectByIdByTableName.typloi;
334
- if (objectById === undefined) {
335
- objectById = this.objectByIdByTableName.typloi = {};
336
- }
337
- objectById[typloi.typloicod] = typloi;
338
- // TODO
339
- }
340
- addTyptxt(typtxt) {
341
- let objectById = this.objectByIdByTableName.typtxt;
342
- if (objectById === undefined) {
343
- objectById = this.objectByIdByTableName.typtxt = {};
344
- }
345
- objectById[typtxt.typtxtcod] = typtxt;
346
- }
347
- addTypurl(typurl) {
348
- let objectById = this.objectByIdByTableName.typurl;
349
- if (objectById === undefined) {
350
- objectById = this.objectByIdByTableName.typurl = {};
351
- }
352
- objectById[typurl.typurl] = typurl;
353
- }
354
- async getAll() {
355
- while (Object.keys(this.requestedIdsByTableName).length > 0) {
356
- for (const [tableName, requestedIdsSet] of Object.entries(this.requestedIdsByTableName)) {
357
- const requestedIds = [...requestedIdsSet];
358
- delete this.requestedIdsByTableName[tableName];
359
- switch (tableName) {
360
- case "ass": {
361
- break;
362
- }
363
- case "aud_by_lecassidt": {
364
- break;
365
- }
366
- case "auteur": {
367
- break;
368
- }
369
- case "date_seance_by_lecassidt": {
370
- break;
371
- }
372
- case "debat_by_lecassidt": {
373
- (await getDebatsFromLecassidts(requestedIds)).map(this.addDebat.bind(this));
374
- break;
375
- }
376
- case "debats": {
377
- (await getDebats(requestedIds)).map(this.addDebat.bind(this));
378
- break;
379
- }
380
- case "deccoc": {
381
- break;
382
- }
383
- case "denrap": {
384
- break;
385
- }
386
- case "docatt_by_rapcod": {
387
- break;
388
- }
389
- case "ecr_by_rapcod": {
390
- break;
391
- }
392
- case "ecr_by_texcod": {
393
- break;
394
- }
395
- case "etaloi": {
396
- break;
397
- }
398
- case "lecasss_by_lecidt": {
399
- break;
400
- }
401
- case "lecassrap_by_lecassidt": {
402
- break;
403
- }
404
- case "lectures_by_loicod": {
405
- break;
406
- }
407
- case "loi": {
408
- break;
409
- }
410
- case "org": {
411
- break;
412
- }
413
- case "org_by_rapcod": {
414
- break;
415
- }
416
- case "oritxt": {
417
- break;
418
- }
419
- case "qua": {
420
- break;
421
- }
422
- case "rap": {
423
- break;
424
- }
425
- case "scr_by_code": {
426
- break;
427
- }
428
- case "texte_by_lecassidt": {
429
- break;
430
- }
431
- case "typatt": {
432
- break;
433
- }
434
- case "typlec": {
435
- break;
436
- }
437
- case "typloi": {
438
- break;
439
- }
440
- case "typtxt": {
441
- break;
442
- }
443
- case "typurl": {
444
- break;
445
- }
446
- default:
447
- throw new Error(`Unhandled table: ${tableName}`);
448
- }
449
- const visitedIds = this.visitedIdsByTableName[tableName];
450
- this.visitedIdsByTableName[tableName] =
451
- visitedIds === undefined
452
- ? new Set(requestedIds)
453
- : new Set([...visitedIds, ...requestedIds]);
454
- }
455
- }
456
- // Add "1 to many" and other computed references.
457
- if (this.follow.has("dateSeance.scrs")) {
458
- const scrById = this.objectByIdByTableName.scr;
459
- const dateSeanceByCode = this.objectByIdByTableName.date_seance;
460
- if (scrById !== undefined && dateSeanceByCode !== undefined) {
461
- for (const scr of Object.values(scrById)) {
462
- const scrCode = scr.code;
463
- if (scrCode === null) {
464
- continue;
465
- }
466
- const dateSeance = dateSeanceByCode[scrCode];
467
- if (dateSeance !== undefined) {
468
- let scrids = dateSeance.scrids;
469
- if (scrids === undefined) {
470
- scrids = dateSeance.scrids = [];
471
- }
472
- scrids.push(`${scr.sesann} ${scr.scrnum}`);
473
- }
474
- }
475
- }
476
- }
477
- if (this.follow.has("lecass.auds")) {
478
- const audByAudcle = this.objectByIdByTableName.aud;
479
- const lecassByLecassidt = this.objectByIdByTableName.lecass;
480
- if (audByAudcle !== undefined && lecassByLecassidt !== undefined) {
481
- for (const aud of Object.values(audByAudcle)) {
482
- const lecass = lecassByLecassidt[aud.lecassidt];
483
- if (lecass !== undefined) {
484
- let audcles = lecass.audcles;
485
- if (audcles === undefined) {
486
- audcles = lecass.audcles = [];
487
- }
488
- audcles.push(aud.audcle);
489
- }
490
- }
491
- }
492
- }
493
- if (this.follow.has("lecass.datesSeances")) {
494
- const dateSeanceByCode = this.objectByIdByTableName.date_seance;
495
- const lecassByLecassidt = this.objectByIdByTableName.lecass;
496
- if (dateSeanceByCode !== undefined && lecassByLecassidt !== undefined) {
497
- for (const dateSeance of Object.values(dateSeanceByCode)) {
498
- const lecassidt = dateSeance.lecidt;
499
- if (lecassidt === null) {
500
- continue;
501
- }
502
- const lecass = lecassByLecassidt[lecassidt];
503
- if (lecass !== undefined) {
504
- let datesSeancesCodes = lecass.datesSeancesCodes;
505
- if (datesSeancesCodes === undefined) {
506
- datesSeancesCodes = lecass.datesSeancesCodes = [];
507
- }
508
- datesSeancesCodes.push(dateSeance.code);
509
- }
510
- }
511
- }
512
- }
513
- if (this.follow.has("lecass.debats")) {
514
- const debatById = this.objectByIdByTableName.debats;
515
- const lecassByLecassidt = this.objectByIdByTableName.lecass;
516
- if (debatById !== undefined && lecassByLecassidt !== undefined) {
517
- const lecassdebs = await getLecAssDebsFromDatseas(Object.keys(debatById));
518
- for (const lecassdeb of lecassdebs) {
519
- const lecass = lecassByLecassidt[lecassdeb.lecassidt];
520
- if (lecass !== undefined) {
521
- let debatdatseas = lecass.debatdatseas;
522
- if (debatdatseas === undefined) {
523
- debatdatseas = lecass.debatdatseas = [];
524
- }
525
- debatdatseas.push(lecassdeb.datsea);
526
- }
527
- }
528
- }
529
- }
530
- if (this.follow.has("lecass.lecassraps")) {
531
- const lecassrapById = this.objectByIdByTableName.lecassrap;
532
- const lecassByLecassidt = this.objectByIdByTableName.lecass;
533
- if (lecassrapById !== undefined && lecassByLecassidt !== undefined) {
534
- for (const lecassrap of Object.values(lecassrapById)) {
535
- const lecass = lecassByLecassidt[lecassrap.lecassidt];
536
- if (lecass !== undefined) {
537
- let lecassrapids = lecass.lecassrapids;
538
- if (lecassrapids === undefined) {
539
- lecassrapids = lecass.lecassrapids = [];
540
- }
541
- lecassrapids.push(`${lecassrap.lecassidt} ${lecassrap.rapcod}`);
542
- }
543
- }
544
- }
545
- }
546
- if (this.follow.has("lecass.textes")) {
547
- const texteByTexcod = this.objectByIdByTableName.texte;
548
- const lecassByLecassidt = this.objectByIdByTableName.lecass;
549
- if (texteByTexcod !== undefined && lecassByLecassidt !== undefined) {
550
- for (const texte of Object.values(texteByTexcod)) {
551
- const lecass = lecassByLecassidt[texte.lecassidt];
552
- if (lecass !== undefined) {
553
- let texcods = lecass.texcods;
554
- if (texcods === undefined) {
555
- texcods = lecass.texcods = [];
556
- }
557
- texcods.push(texte.texcod);
558
- }
559
- }
560
- }
561
- }
562
- if (this.follow.has("lecture.lecasss")) {
563
- const lecassByLecassidt = this.objectByIdByTableName.lecass;
564
- const lectureByLecidt = this.objectByIdByTableName.lecture;
565
- if (lecassByLecassidt !== undefined && lectureByLecidt !== undefined) {
566
- for (const lecass of Object.values(lecassByLecassidt)) {
567
- const lecture = lectureByLecidt[lecass.lecidt];
568
- if (lecture !== undefined) {
569
- let lecassidts = lecture.lecassidts;
570
- if (lecassidts === undefined) {
571
- lecassidts = lecture.lecassidts = [];
572
- }
573
- lecassidts.push(lecass.lecassidt);
574
- }
575
- }
576
- }
577
- }
578
- if (this.follow.has("loi.lectures")) {
579
- const lectureByLecidt = this.objectByIdByTableName.lecture;
580
- const loiByLoicod = this.objectByIdByTableName.loi;
581
- if (lectureByLecidt !== undefined && loiByLoicod !== undefined) {
582
- for (const lecture of Object.values(lectureByLecidt)) {
583
- const loi = loiByLoicod[lecture.loicod];
584
- if (loi !== undefined) {
585
- let lecidts = loi.lecidts;
586
- if (lecidts === undefined) {
587
- lecidts = loi.lecidts = [];
588
- }
589
- lecidts.push(lecture.lecidt);
590
- }
591
- }
592
- }
593
- }
594
- if (this.follow.has("rap.docatts")) {
595
- const docattByDocattcle = this.objectByIdByTableName.docatt;
596
- const rapById = this.objectByIdByTableName.rap;
597
- if (docattByDocattcle !== undefined && rapById !== undefined) {
598
- for (const docatt of Object.values(docattByDocattcle)) {
599
- const rapcod = docatt.rapcod;
600
- if (rapcod === null) {
601
- continue;
602
- }
603
- const rap = rapById[rapcod];
604
- if (rap !== undefined) {
605
- let docattcles = rap.docattcles;
606
- if (docattcles === undefined) {
607
- docattcles = rap.docattcles = [];
608
- }
609
- docattcles.push(docatt.docattcle);
610
- }
611
- }
612
- }
613
- }
614
- if (this.follow.has("rap.ecrs")) {
615
- const ecrByEcrnum = this.objectByIdByTableName.ecr;
616
- const rapById = this.objectByIdByTableName.rap;
617
- if (ecrByEcrnum !== undefined && rapById !== undefined) {
618
- for (const ecr of Object.values(ecrByEcrnum)) {
619
- const rapcod = ecr.rapcod;
620
- if (rapcod === null) {
621
- continue;
622
- }
623
- const rap = rapById[rapcod];
624
- if (rap !== undefined) {
625
- let ecrnums = rap.ecrnums;
626
- if (ecrnums === undefined) {
627
- ecrnums = rap.ecrnums = [];
628
- }
629
- ecrnums.push(ecr.ecrnum);
630
- }
631
- }
632
- }
633
- }
634
- if (this.follow.has("rap.orgs")) {
635
- const orgByOrgcod = this.objectByIdByTableName.org;
636
- const rapById = this.objectByIdByTableName.rap;
637
- if (orgByOrgcod !== undefined && rapById !== undefined) {
638
- }
639
- }
640
- if (this.follow.has("texte.ecrs")) {
641
- const ecrByEcrnum = this.objectByIdByTableName.ecr;
642
- const texteById = this.objectByIdByTableName.texte;
643
- if (ecrByEcrnum !== undefined && texteById !== undefined) {
644
- for (const ecr of Object.values(ecrByEcrnum)) {
645
- const texcod = ecr.texcod;
646
- if (texcod === null) {
647
- continue;
648
- }
649
- const texte = texteById[texcod];
650
- if (texte !== undefined) {
651
- let ecrnums = texte.ecrnums;
652
- if (ecrnums === undefined) {
653
- ecrnums = texte.ecrnums = [];
654
- }
655
- ecrnums.push(ecr.ecrnum);
656
- }
657
- }
658
- }
659
- }
660
- if (this.follow.has("texte.txtAmeli")) {
661
- const sesById = this.objectByIdByTableName.ses;
662
- const texteById = this.objectByIdByTableName.texte;
663
- const txtAmeliById = this.objectByIdByTableName.txt_ameli;
664
- if (sesById !== undefined &&
665
- texteById !== undefined &&
666
- txtAmeliById !== undefined) {
667
- for (const txtAmeli of Object.values(txtAmeliById)) {
668
- const sesinsid = txtAmeli.sesinsid;
669
- const num = parseInt(txtAmeli.num);
670
- if (sesinsid !== null) {
671
- const sesins = sesById[sesinsid];
672
- if (sesins !== undefined) {
673
- for (const texte of Object.values(texteById)) {
674
- if (texte.sesann === sesins.ann && texte.texnum === num) {
675
- texte.txtAmeliId = txtAmeli.id;
676
- }
677
- }
678
- }
679
- }
680
- }
681
- }
682
- }
683
- if (this.follow.has("txtAmeli.subs")) {
684
- const subById = this.objectByIdByTableName.sub;
685
- const txtAmeliById = this.objectByIdByTableName.txt_ameli;
686
- if (subById !== undefined && txtAmeliById !== undefined) {
687
- for (const sub of Object.values(subById)) {
688
- const txtAmeli = txtAmeliById[sub.txtid];
689
- if (txtAmeli !== undefined) {
690
- let subids = txtAmeli.subids;
691
- if (subids === undefined) {
692
- subids = txtAmeli.subids = [];
693
- }
694
- subids.push(sub.id);
695
- }
696
- }
697
- }
698
- }
699
- }
700
- request(tableName, id) {
701
- const visitedIds = this.visitedIdsByTableName[tableName];
702
- if (visitedIds === undefined || !visitedIds.has(id)) {
703
- let requestedIds = this.requestedIdsByTableName[tableName];
704
- if (requestedIds === undefined) {
705
- requestedIds = this.requestedIdsByTableName[tableName] = new Set();
706
- }
707
- requestedIds.add(id);
708
- }
709
- }
710
- toJson() {
711
- return this.objectByIdByTableName;
712
- }
713
- }