@tricoteuses/tisseuse 0.10.0 → 0.11.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.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as e, $t as t, A as n, An as r, At as i, B as a, Bt as o, C as s, Cn as c, Ct as l, D as u, Dn as d, Dt as f, E as p, En as m, Et as ee, F as te, Ft as ne, G as re, Gt as ie, H as ae, Ht as oe, I as se, It as ce, J as le, Jt as ue, K as de, Kt as fe, L as pe, Lt as me, M as he, Mn as ge, Mt as h, N as _e, Nn as ve, Nt as g, O as ye, On as be, Ot as xe, P as Se, Pn as _, Pt as Ce, Q as we, Qt as Te, R as Ee, Rt as De, S as Oe, Sn as ke, St as Ae, T as je, Tn as v, Tt as Me, U as Ne, Ut as Pe, V as Fe, Vt as y, W as Ie, Wt as Le, X as Re, Xt as ze, Y as Be, Yt as Ve, Z as He, Zt as Ue, _ as b, _n as x, _t as We, a as Ge, an as Ke, at as qe, b as Je, bn as S, bt as Ye, c as Xe, cn as Ze, ct as Qe, d as $e, dn as et, dt as tt, en as nt, et as rt, f as it, fn as at, ft as ot, g as st, gn as C, gt as ct, h as lt, hn as w, ht as ut, i as T, in as dt, it as ft, j as E, jn as pt, jt as mt, k as ht, kn as gt, kt as _t, l as vt, ln as yt, lt as bt, m as xt, mn as D, mt as St, n as Ct, nn as wt, nt as Tt, o as Et, on as Dt, ot as Ot, p as kt, pn as At, pt as jt, q as Mt, qt as Nt, r as Pt, rn as Ft, rt as It, s as Lt, sn as Rt, st as zt, t as Bt, tn as Vt, tt as Ht, u as Ut, un as Wt, ut as Gt, v as Kt, vn as O, vt as qt, w as Jt, wn as Yt, wt as Xt, x as Zt, xn as Qt, xt as $t, y as en, yn as tn, yt as nn, z as rn, zt as an } from "./html-B_uf_8Zi.js";
1
+ import { $ as e, $t as t, A as n, An as r, At as i, B as a, Bt as o, C as s, Cn as c, Ct as l, D as u, Dn as d, Dt as f, E as p, En as m, Et as ee, F as te, Ft as ne, G as re, Gt as ie, H as ae, Ht as oe, I as se, It as ce, J as le, Jt as ue, K as de, Kt as fe, L as pe, Lt as me, M as he, Mn as ge, Mt as h, N as _e, Nn as ve, Nt as g, O as ye, On as be, Ot as xe, P as Se, Pn as _, Pt as Ce, Q as we, Qt as Te, R as Ee, Rt as De, S as Oe, Sn as ke, St as Ae, T as je, Tn as v, Tt as Me, U as Ne, Ut as Pe, V as Fe, Vt as y, W as Ie, Wt as Le, X as Re, Xt as ze, Y as Be, Yt as Ve, Z as He, Zt as Ue, _ as b, _n as x, _t as We, a as Ge, an as Ke, at as qe, b as Je, bn as S, bt as Ye, c as Xe, cn as Ze, ct as Qe, d as $e, dn as et, dt as tt, en as nt, et as rt, f as it, fn as at, ft as ot, g as st, gn as C, gt as ct, h as lt, hn as w, ht as ut, i as T, in as dt, it as ft, j as E, jn as pt, jt as mt, k as ht, kn as gt, kt as _t, l as vt, ln as yt, lt as bt, m as xt, mn as D, mt as St, n as Ct, nn as wt, nt as Tt, o as Et, on as Dt, ot as Ot, p as kt, pn as At, pt as jt, q as Mt, qt as Nt, r as Pt, rn as Ft, rt as It, s as Lt, sn as Rt, st as zt, t as Bt, tn as Vt, tt as Ht, u as Ut, un as Wt, ut as Gt, v as Kt, vn as O, vt as qt, w as Jt, wn as Yt, wt as Xt, x as Zt, xn as Qt, xt as $t, y as en, yn as tn, yt as nn, z as rn, zt as an } from "./html-DfrdIKTl.js";
2
2
  //#region ../../node_modules/@tricoteuses/legifrance/dist/legal/index.js
3
3
  function on(e, t) {
4
4
  if (e != null) {
@@ -974,67 +974,66 @@ function X(e) {
974
974
  }
975
975
  //#endregion
976
976
  //#region src/lib/linkers/markdown.ts
977
- async function Jn({ date: e, europeDb: t, legiDb: r, linkBaseUrl: i, linkType: a, previousContext: o, text: s }) {
978
- let c = b(s), l = new D(c.output);
979
- l.currentArticle = o?.currentArticle, l.currentText = o?.currentText;
980
- let u = s, d = 0;
981
- for await (let o of Xe({
982
- context: l,
983
- date: e,
984
- europeDb: t,
985
- legiDb: r,
986
- transformation: c
987
- })) switch (o.type) {
977
+ async function Jn({ canutesDb: e, date: t, linkBaseUrl: r, linkType: i, previousContext: a, text: o }) {
978
+ let s = b(o), c = new D(s.output);
979
+ c.currentArticle = a?.currentArticle, c.currentText = a?.currentText;
980
+ let l = o, u = 0;
981
+ for await (let a of Xe({
982
+ canutesDb: e,
983
+ context: c,
984
+ date: t,
985
+ transformation: s
986
+ })) switch (a.type) {
988
987
  case "article_definition": break;
989
988
  case "external_article": {
990
- let { articleId: e, originalTransformation: t } = o;
989
+ let { articleId: e, originalTransformation: t } = a;
991
990
  if (e !== void 0) {
992
- if (t === void 0) throw Error(`Missing originalTransformation attribute in external article link: ${JSON.stringify(o, null, 2)}`);
993
- let r = E(t, `[${X(n(u, t, d))}](${T(a, i, e)})`);
994
- u = u.slice(0, t.position.start + d) + r + u.slice(t.position.stop + d), d += r.length - (t.position.stop - t.position.start);
991
+ if (t === void 0) throw Error(`Missing originalTransformation attribute in external article link: ${JSON.stringify(a, null, 2)}`);
992
+ let o = E(t, `[${X(n(l, t, u))}](${T(i, r, e)})`);
993
+ l = l.slice(0, t.position.start + u) + o + l.slice(t.position.stop + u), u += o.length - (t.position.stop - t.position.start);
995
994
  }
996
995
  break;
997
996
  }
998
997
  case "external_division": {
999
- let { originalTransformation: e, sectionTaId: t } = o;
998
+ let { originalTransformation: e, sectionTaId: t } = a;
1000
999
  if (t !== void 0) {
1001
- if (e === void 0) throw Error(`Missing originalTransformation attribute in external division link: ${JSON.stringify(o, null, 2)}`);
1002
- let r = E(e, `[${X(n(u, e, d))}](${T(a, i, t)})`);
1003
- u = u.slice(0, e.position.start + d) + r + u.slice(e.position.stop + d), d += r.length - (e.position.stop - e.position.start);
1000
+ if (e === void 0) throw Error(`Missing originalTransformation attribute in external division link: ${JSON.stringify(a, null, 2)}`);
1001
+ let o = E(e, `[${X(n(l, e, u))}](${T(i, r, t)})`);
1002
+ l = l.slice(0, e.position.start + u) + o + l.slice(e.position.stop + u), u += o.length - (e.position.stop - e.position.start);
1004
1003
  }
1005
1004
  break;
1006
1005
  }
1007
1006
  case "external_text": {
1008
- let { originalTransformation: e, text: t } = o;
1007
+ let { originalTransformation: e, text: t } = a;
1009
1008
  if (t.cid === void 0) {
1010
- t.relative !== 0 && console.error(`Link to text "${l.text(t.position)}" without CID: ${JSON.stringify(t, null, 2)}`);
1009
+ t.relative !== 0 && console.error(`Link to text "${c.text(t.position)}" without CID: ${JSON.stringify(t, null, 2)}`);
1011
1010
  continue;
1012
1011
  }
1013
- if (e === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(o, null, 2)}`);
1014
- let r = E(e, `[${X(n(u, e, d))}](${T(a, i, t.cid)})`);
1015
- u = u.slice(0, e.position.start + d) + r + u.slice(e.position.stop + d), d += r.length - (e.position.stop - e.position.start);
1012
+ if (e === void 0) throw Error(`Missing originalTransformation attribute in external text link: ${JSON.stringify(a, null, 2)}`);
1013
+ let o = E(e, `[${X(n(l, e, u))}](${T(i, r, t.cid)})`);
1014
+ l = l.slice(0, e.position.start + u) + o + l.slice(e.position.stop + u), u += o.length - (e.position.stop - e.position.start);
1016
1015
  break;
1017
1016
  }
1018
1017
  case "internal_article": {
1019
- let { definition: e, originalTransformation: t } = o;
1020
- if (t === void 0) throw Error(`Missing originalTransformation attribute in internal article link: ${JSON.stringify(o, null, 2)}`);
1021
- let r = E(t, `[${X(n(u, t, d))}](#definition_article_${e.textId}_${e.article.num.replaceAll(" ", "_")})`);
1022
- u = u.slice(0, t.position.start + d) + r + u.slice(t.position.stop + d), d += r.length - (t.position.stop - t.position.start);
1018
+ let { definition: e, originalTransformation: t } = a;
1019
+ if (t === void 0) throw Error(`Missing originalTransformation attribute in internal article link: ${JSON.stringify(a, null, 2)}`);
1020
+ let r = E(t, `[${X(n(l, t, u))}](#definition_article_${e.textId}_${e.article.num.replaceAll(" ", "_")})`);
1021
+ l = l.slice(0, t.position.start + u) + r + l.slice(t.position.stop + u), u += r.length - (t.position.stop - t.position.start);
1023
1022
  break;
1024
1023
  }
1025
1024
  case "european_text": {
1026
- let { url: e, originalTransformation: t } = o;
1025
+ let { url: e, originalTransformation: t } = a;
1027
1026
  if (e === void 0) continue;
1028
- if (t === void 0) throw Error(`Missing originalTransformation attribute in european text link: ${JSON.stringify(o, null, 2)}`);
1029
- let r = E(t, `<a class="lien_texte_european" href="${e}" target="_blank">${n(u, t, d)}</a>`);
1030
- u = u.slice(0, t.position.start + d) + r + u.slice(t.position.stop + d), d += r.length - (t.position.stop - t.position.start);
1027
+ if (t === void 0) throw Error(`Missing originalTransformation attribute in european text link: ${JSON.stringify(a, null, 2)}`);
1028
+ let r = E(t, `<a class="lien_texte_european" href="${e}" target="_blank">${n(l, t, u)}</a>`);
1029
+ l = l.slice(0, t.position.start + u) + r + l.slice(t.position.stop + u), u += r.length - (t.position.stop - t.position.start);
1031
1030
  break;
1032
1031
  }
1033
- default: _("Link", o);
1032
+ default: _("Link", a);
1034
1033
  }
1035
1034
  return {
1036
- context: l,
1037
- output: u === s ? null : u
1035
+ context: c,
1036
+ output: l === o ? null : l
1038
1037
  };
1039
1038
  }
1040
1039
  //#endregion
@@ -1045,7 +1044,7 @@ async function Yn(e, t, n) {
1045
1044
  let i = r.get(n);
1046
1045
  return i === void 0 && (i = (await e`
1047
1046
  SELECT data
1048
- FROM documents
1047
+ FROM assemblee.documents
1049
1048
  WHERE uid = ${n}
1050
1049
  `)[0]?.data, r.set(n, i ?? null)), i ?? void 0;
1051
1050
  }
@@ -1053,7 +1052,7 @@ async function Xn(e, t, n) {
1053
1052
  let r = t.get("Document");
1054
1053
  return r === void 0 && (r = /* @__PURE__ */ new Map(), t.set("Document", r)), (await e`
1055
1054
  SELECT data, uid
1056
- FROM documents
1055
+ FROM assemblee.documents
1057
1056
  WHERE dossier_uid = ${n}
1058
1057
  `).map(({ data: e, uid: t }) => (r.set(t, e ?? null), e));
1059
1058
  }
@@ -1063,7 +1062,7 @@ async function Zn(e, t, n) {
1063
1062
  let i = r.get(n);
1064
1063
  return i === void 0 && (i = (await e`
1065
1064
  SELECT data
1066
- FROM dossiers
1065
+ FROM assemblee.dossiers
1067
1066
  WHERE uid = ${n}
1068
1067
  `)[0]?.data, r.set(n, i ?? null)), i ?? void 0;
1069
1068
  }
@@ -14,7 +14,7 @@ export declare const getArticleDateSignature: (article: JorfArticle | LegiArticl
14
14
  * - Handle date to filter articles outside date
15
15
  * - Migrate everything @tricoteuses/legifrance.
16
16
  */
17
- export declare function getOrLoadArticleSiblingId(legiDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string, offset: -1 | 1): Promise<string | undefined>;
17
+ export declare function getOrLoadArticleSiblingId(canutesDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string, offset: -1 | 1): Promise<string | undefined>;
18
18
  /**
19
19
  * TODO: Migrate to @tricoteuses/legifrance
20
20
  */
@@ -101,11 +101,10 @@ export interface TextLinksParserState {
101
101
  sectionTaId?: string;
102
102
  textId?: string;
103
103
  }
104
- export declare function extractTextLinks({ context, date, europeDb, legiDb, logIgnoredReferencesTypes, logPartialReferences, logReferences, state: inputState, transformation, }: {
104
+ export declare function extractTextLinks({ context, date, canutesDb, logIgnoredReferencesTypes, logPartialReferences, logReferences, state: inputState, transformation, }: {
105
105
  context: TextParserContext;
106
106
  date: string;
107
- europeDb: Sql;
108
- legiDb: Sql;
107
+ canutesDb: Sql;
109
108
  logIgnoredReferencesTypes?: boolean;
110
109
  logPartialReferences?: boolean;
111
110
  logReferences?: boolean;
@@ -117,12 +116,11 @@ export declare function extractTextLinks({ context, date, europeDb, legiDb, logI
117
116
  state?: TextLinksParserState;
118
117
  transformation?: Transformation;
119
118
  }): AsyncGenerator<DefinitionOrLink, void>;
120
- export declare function iterReferenceLinks({ articleDefinitionByNumByTextId: articleDefinitionByNumByTextIdInput, context, date, europeDb, legiDb, logIgnoredReferencesTypes, logPartialReferences, originalPositionsFromTransformedIterator, reference, state: inputState, }: {
119
+ export declare function iterReferenceLinks({ articleDefinitionByNumByTextId: articleDefinitionByNumByTextIdInput, canutesDb, context, date, logIgnoredReferencesTypes, logPartialReferences, originalPositionsFromTransformedIterator, reference, state: inputState, }: {
121
120
  articleDefinitionByNumByTextId?: Record<string, Record<string, ArticleDefinition>>;
121
+ canutesDb: Sql;
122
122
  context: TextParserContext;
123
123
  date: string;
124
- europeDb: Sql;
125
- legiDb: Sql;
126
124
  logIgnoredReferencesTypes?: boolean;
127
125
  logPartialReferences?: boolean;
128
126
  originalPositionsFromTransformedIterator?: Generator<FragmentReverseTransformation, void, FragmentPosition | undefined>;
@@ -3,11 +3,10 @@ import { DefinitionOrLink, TextLinksParserState } from '../extractors/links.js';
3
3
  import { LinkType } from '../links.js';
4
4
  import { TextParserContext } from '../text_parsers/parsers.js';
5
5
  import { Transformation } from '../text_parsers/transformers.js';
6
- export declare function addLinksToHtml({ date, europeDb, html, legiDb, linkBaseUrl, linkType, logIgnoredReferencesTypes, logPartialReferences, logReferences, onLink, previousContext, state, }: {
6
+ export declare function addLinksToHtml({ canutesDb, date, html, linkBaseUrl, linkType, logIgnoredReferencesTypes, logPartialReferences, logReferences, onLink, previousContext, state, }: {
7
+ canutesDb: Sql;
7
8
  date: string;
8
- europeDb: Sql;
9
9
  html: string;
10
- legiDb: Sql;
11
10
  linkBaseUrl: string;
12
11
  linkType: LinkType;
13
12
  logIgnoredReferencesTypes?: boolean;
@@ -25,13 +24,12 @@ export type OutputByType = Partial<Record<OutputType, {
25
24
  offset: number;
26
25
  }>>;
27
26
  export type OutputType = "links" | "links_or_references" | "references";
28
- export declare function addLinksOrReferencesToHtmlPage({ date, defaultTextId, europeDb, htmlTransformation, inputHtml, legiDb, linkBaseUrl, linkType, logIgnoredReferencesTypes, logPartialReferences, logReferences, outputTypes: requestedOutputTypes, referredLegifranceTextsInfos, }: {
27
+ export declare function addLinksOrReferencesToHtmlPage({ canutesDb, date, defaultTextId, htmlTransformation, inputHtml, linkBaseUrl, linkType, logIgnoredReferencesTypes, logPartialReferences, logReferences, outputTypes: requestedOutputTypes, referredLegifranceTextsInfos, }: {
28
+ canutesDb: Sql;
29
29
  date: string;
30
30
  defaultTextId?: string;
31
- europeDb: Sql;
32
31
  htmlTransformation: Transformation;
33
32
  inputHtml: string;
34
- legiDb: Sql;
35
33
  linkBaseUrl: string;
36
34
  linkType: LinkType;
37
35
  logIgnoredReferencesTypes?: boolean;
@@ -1,10 +1,9 @@
1
1
  import { Sql } from 'postgres';
2
2
  import { LinkType } from '../links.js';
3
3
  import { TextParserContext } from '../text_parsers/parsers.js';
4
- export declare function addLinksToMarkdown({ date, europeDb, legiDb, linkBaseUrl, linkType, previousContext, text, }: {
4
+ export declare function addLinksToMarkdown({ canutesDb, date, linkBaseUrl, linkType, previousContext, text, }: {
5
+ canutesDb: Sql;
5
6
  date: string;
6
- europeDb: Sql;
7
- legiDb: Sql;
8
7
  linkBaseUrl: string;
9
8
  linkType: LinkType;
10
9
  previousContext?: TextParserContext;
@@ -1,6 +1,6 @@
1
1
  import { Document, DossierParlementaire } from '@tricoteuses/assemblee';
2
2
  import { Sql } from 'postgres';
3
3
  import { AssembleeObjectCache } from '../cache.js';
4
- export declare function getOrLoadDocument(assembleeDb: Sql, assembleeObjectCache: AssembleeObjectCache, uid: string): Promise<Document | undefined>;
5
- export declare function getOrLoadDocumentsByDossierParlementaireUid(assembleeDb: Sql, assembleeObjectCache: AssembleeObjectCache, dossierUid: string): Promise<Document[]>;
6
- export declare function getOrLoadDossierParlementaire(assembleeDb: Sql, assembleeObjectCache: AssembleeObjectCache, uid: string): Promise<DossierParlementaire | undefined>;
4
+ export declare function getOrLoadDocument(canutesDb: Sql, assembleeObjectCache: AssembleeObjectCache, uid: string): Promise<Document | undefined>;
5
+ export declare function getOrLoadDocumentsByDossierParlementaireUid(canutesDb: Sql, assembleeObjectCache: AssembleeObjectCache, dossierUid: string): Promise<Document[]>;
6
+ export declare function getOrLoadDossierParlementaire(canutesDb: Sql, assembleeObjectCache: AssembleeObjectCache, uid: string): Promise<DossierParlementaire | undefined>;
@@ -10,13 +10,13 @@ export declare function extendLoadedArticle<ArticleType extends JorfArticle | Le
10
10
  data: ArticleType;
11
11
  num: string | null;
12
12
  }): ArticleType & ArticleExtension;
13
- export declare function getOrLoadArticle<ArticleType extends JorfArticle | LegiArticle>(legiDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string): Promise<(ArticleType & ArticleExtension) | undefined>;
14
- export declare function getOrLoadArticles<ArticleType extends JorfArticle | LegiArticle>(legiDb: Sql, legifranceObjectCache: LegifranceObjectCache, ids: string[]): Promise<Array<ArticleType & ArticleExtension>>;
15
- export declare function getOrLoadJo<JoType extends Jo>(legiDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string): Promise<JoType | undefined>;
16
- export declare function getOrLoadSectionTa<SectionTaType extends JorfSectionTa | LegiSectionTa>(legiDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string): Promise<SectionTaType | undefined>;
17
- export declare function getOrLoadSectionsTa<SectionTaType extends JorfSectionTa | LegiSectionTa>(legiDb: Sql, legifranceObjectCache: LegifranceObjectCache, ids: string[]): Promise<SectionTaType[]>;
18
- export declare function getOrLoadTextelr<TextelrType extends JorfTextelr | LegiTextelr>(legiDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string): Promise<TextelrType | undefined>;
19
- export declare function getOrLoadTexteslr<TextelrType extends JorfTextelr | LegiTextelr>(legiDb: Sql, legifranceObjectCache: LegifranceObjectCache, ids: string[]): Promise<Array<TextelrType>>;
20
- export declare function getOrLoadTextesVersions<TexteVersionType extends JorfTexteVersion | LegiTexteVersion>(legiDb: Sql, legifranceObjectCache: LegifranceObjectCache, ids: string[]): Promise<Array<TexteVersionType>>;
21
- export declare function getOrLoadTexteVersion<TexteVersionType extends JorfTexteVersion | LegiTexteVersion>(legiDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string): Promise<TexteVersionType | undefined>;
22
- export declare function loadArticles<ArticleType extends JorfArticle | LegiArticle>(legiDb: Sql, legifranceObjectCache: LegifranceObjectCache, whereClause: PendingQuery<Row[]> | Array<PendingQuery<Row[]>>): Promise<Array<ArticleType & ArticleExtension>>;
13
+ export declare function getOrLoadArticle<ArticleType extends JorfArticle | LegiArticle>(canutesDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string): Promise<(ArticleType & ArticleExtension) | undefined>;
14
+ export declare function getOrLoadArticles<ArticleType extends JorfArticle | LegiArticle>(canutesDb: Sql, legifranceObjectCache: LegifranceObjectCache, ids: string[]): Promise<Array<ArticleType & ArticleExtension>>;
15
+ export declare function getOrLoadJo<JoType extends Jo>(canutesDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string): Promise<JoType | undefined>;
16
+ export declare function getOrLoadSectionTa<SectionTaType extends JorfSectionTa | LegiSectionTa>(canutesDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string): Promise<SectionTaType | undefined>;
17
+ export declare function getOrLoadSectionsTa<SectionTaType extends JorfSectionTa | LegiSectionTa>(canutesDb: Sql, legifranceObjectCache: LegifranceObjectCache, ids: string[]): Promise<SectionTaType[]>;
18
+ export declare function getOrLoadTextelr<TextelrType extends JorfTextelr | LegiTextelr>(canutesDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string): Promise<TextelrType | undefined>;
19
+ export declare function getOrLoadTexteslr<TextelrType extends JorfTextelr | LegiTextelr>(canutesDb: Sql, legifranceObjectCache: LegifranceObjectCache, ids: string[]): Promise<Array<TextelrType>>;
20
+ export declare function getOrLoadTextesVersions<TexteVersionType extends JorfTexteVersion | LegiTexteVersion>(canutesDb: Sql, legifranceObjectCache: LegifranceObjectCache, ids: string[]): Promise<Array<TexteVersionType>>;
21
+ export declare function getOrLoadTexteVersion<TexteVersionType extends JorfTexteVersion | LegiTexteVersion>(canutesDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string): Promise<TexteVersionType | undefined>;
22
+ export declare function loadArticles<ArticleType extends JorfArticle | LegiArticle>(canutesDb: Sql, legifranceObjectCache: LegifranceObjectCache, whereClause: PendingQuery<Row[]> | Array<PendingQuery<Row[]>>): Promise<Array<ArticleType & ArticleExtension>>;
@@ -1,9 +1,6 @@
1
1
  import { LinkType } from '../links';
2
2
  export interface Config {
3
- assembleeDb: DatabaseConfig;
4
- europeDb: DatabaseConfig;
5
- legiAnomaliesDb: DatabaseConfig;
6
- legiDb: DatabaseConfig;
3
+ canutesDb: DatabaseConfig;
7
4
  linkBaseUrl: string;
8
5
  linkType: LinkType;
9
6
  }
@@ -2,23 +2,13 @@ import { default as postgres } from 'postgres';
2
2
  export interface Version {
3
3
  number: number;
4
4
  }
5
- export declare const assembleeDb: postgres.Sql<{}>;
5
+ export declare const canutesDb: postgres.Sql<{}>;
6
6
  export declare const assembleeVersionNumber = 7;
7
- export declare const europeDb: postgres.Sql<{}>;
8
- export declare const legiAnomaliesDb: postgres.Sql<{}>;
9
7
  export declare const legiAnomaliesVersionNumber = 1;
10
- export declare const legiDb: postgres.Sql<{}>;
11
8
  export declare const legiVersionNumber = 19;
12
9
  export declare const tisseuseVersionNumber = 3;
13
- /**
14
- * Check that assemblee database exists and is up to date.
15
- */
16
10
  export declare function checkAssembleeDb(): Promise<void>;
17
- /**
18
- * Check that legi_anomalies database exists and is up to date.
19
- */
20
11
  export declare function checkLegiAnomaliesDb(): Promise<void>;
21
- /**
22
- * Check that legi database exists and is up to date.
23
- */
24
12
  export declare function checkLegiDb(): Promise<void>;
13
+ export declare function checkTisseuseDb(): Promise<void>;
14
+ export declare function configureTisseuseDatabase(): Promise<void>;
@@ -1,9 +1,9 @@
1
1
  import { LinkType } from '../../links.js';
2
2
  import { Sql } from 'postgres';
3
- export declare function addLinksOrReferencesToHtmlFile({ date, defaultTextId, europeDb, htmlFilePath, htmlTransformationsInputDir, htmlTransformationsOutputDir, htmlWithLinksFilePath, htmlWithLinksOrReferencesFilePath, htmlWithLinksTransformationsOutputDir, htmlWithReferencesFilePath, legiDb, linkBaseUrl, linkType, logIgnoredReferencesTypes, logPartialReferences, logReferences, referredLegifranceTextsInfosFilePath, }: {
3
+ export declare function addLinksOrReferencesToHtmlFile({ canutesDb, date, defaultTextId, htmlFilePath, htmlTransformationsInputDir, htmlTransformationsOutputDir, htmlWithLinksFilePath, htmlWithLinksOrReferencesFilePath, htmlWithLinksTransformationsOutputDir, htmlWithReferencesFilePath, linkBaseUrl, linkType, logIgnoredReferencesTypes, logPartialReferences, logReferences, referredLegifranceTextsInfosFilePath, }: {
4
+ canutesDb: Sql;
4
5
  date: string;
5
6
  defaultTextId?: string;
6
- europeDb: Sql;
7
7
  htmlFilePath: string;
8
8
  htmlTransformationsInputDir?: string;
9
9
  htmlTransformationsOutputDir?: string;
@@ -11,7 +11,6 @@ export declare function addLinksOrReferencesToHtmlFile({ date, defaultTextId, eu
11
11
  htmlWithLinksOrReferencesFilePath?: string;
12
12
  htmlWithLinksTransformationsOutputDir?: string;
13
13
  htmlWithReferencesFilePath?: string;
14
- legiDb: Sql;
15
14
  linkBaseUrl: string;
16
15
  linkType: LinkType;
17
16
  logIgnoredReferencesTypes?: boolean;
@@ -0,0 +1 @@
1
+ export declare function configure(): Promise<void>;
package/dist/server.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as e, a as t, g as n, mn as r, o as i, t as a } from "./html-B_uf_8Zi.js";
1
+ import { $ as e, a as t, g as n, mn as r, o as i, t as a } from "./html-DfrdIKTl.js";
2
2
  import * as o from "node:crypto";
3
3
  import s from "fs-extra";
4
4
  import c from "node:path";
@@ -19445,32 +19445,31 @@ function N(e, t, n = "1") {
19445
19445
  }
19446
19446
  //#endregion
19447
19447
  //#region src/lib/server/linkers/html.ts
19448
- async function P({ date: e, defaultTextId: t, europeDb: r, htmlFilePath: i, htmlTransformationsInputDir: o, htmlTransformationsOutputDir: c, htmlWithLinksFilePath: l, htmlWithLinksOrReferencesFilePath: u, htmlWithLinksTransformationsOutputDir: d, htmlWithReferencesFilePath: f, legiDb: p, linkBaseUrl: m, linkType: h, logIgnoredReferencesTypes: g, logPartialReferences: _, logReferences: v, referredLegifranceTextsInfosFilePath: y }) {
19449
- let b = await s.readFile(i, { encoding: "utf-8" }), x;
19450
- o === void 0 ? (x = n({ removeAWithHref: !0 })(b), c !== void 0 && N(x, c)) : x = j(b, o);
19451
- let S = [];
19452
- l !== void 0 && S.push("links"), u !== void 0 && S.push("links_or_references"), f !== void 0 && S.push("references");
19453
- let { outputByType: C, referredLegifranceTextCountByCid: w } = await a({
19454
- date: e,
19455
- defaultTextId: t,
19456
- europeDb: r,
19457
- htmlTransformation: x,
19458
- inputHtml: b,
19459
- legiDb: p,
19460
- linkBaseUrl: m,
19461
- linkType: h,
19462
- logIgnoredReferencesTypes: g,
19463
- logPartialReferences: _,
19464
- logReferences: v,
19465
- outputTypes: S,
19466
- referredLegifranceTextsInfos: y !== void 0
19467
- }), T = {};
19468
- l !== void 0 && (T.links = l), u !== void 0 && (T.links_or_references = u), f !== void 0 && (T.references = f);
19469
- for (let [e, t] of Object.entries(C)) {
19470
- let n = T[e];
19448
+ async function P({ canutesDb: e, date: t, defaultTextId: r, htmlFilePath: i, htmlTransformationsInputDir: o, htmlTransformationsOutputDir: c, htmlWithLinksFilePath: l, htmlWithLinksOrReferencesFilePath: u, htmlWithLinksTransformationsOutputDir: d, htmlWithReferencesFilePath: f, linkBaseUrl: p, linkType: m, logIgnoredReferencesTypes: h, logPartialReferences: g, logReferences: _, referredLegifranceTextsInfosFilePath: v }) {
19449
+ let y = await s.readFile(i, { encoding: "utf-8" }), b;
19450
+ o === void 0 ? (b = n({ removeAWithHref: !0 })(y), c !== void 0 && N(b, c)) : b = j(y, o);
19451
+ let x = [];
19452
+ l !== void 0 && x.push("links"), u !== void 0 && x.push("links_or_references"), f !== void 0 && x.push("references");
19453
+ let { outputByType: S, referredLegifranceTextCountByCid: C } = await a({
19454
+ canutesDb: e,
19455
+ date: t,
19456
+ defaultTextId: r,
19457
+ htmlTransformation: b,
19458
+ inputHtml: y,
19459
+ linkBaseUrl: p,
19460
+ linkType: m,
19461
+ logIgnoredReferencesTypes: h,
19462
+ logPartialReferences: g,
19463
+ logReferences: _,
19464
+ outputTypes: x,
19465
+ referredLegifranceTextsInfos: v !== void 0
19466
+ }), w = {};
19467
+ l !== void 0 && (w.links = l), u !== void 0 && (w.links_or_references = u), f !== void 0 && (w.references = f);
19468
+ for (let [e, t] of Object.entries(S)) {
19469
+ let n = w[e];
19471
19470
  n !== void 0 && await s.writeFile(n, t.html, { encoding: "utf-8" });
19472
19471
  }
19473
- C.links !== void 0 && d !== void 0 && N(n()(C.links.html), d), y !== void 0 && await s.writeJson(y, w, {
19472
+ S.links !== void 0 && d !== void 0 && N(n()(S.links.html), d), v !== void 0 && await s.writeJson(v, C, {
19474
19473
  encoding: "utf-8",
19475
19474
  spaces: 2
19476
19475
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tricoteuses/tisseuse",
3
3
  "description": "Find links in/to French legislative documents",
4
- "version": "0.10.0",
4
+ "version": "0.11.0",
5
5
  "keywords": [
6
6
  "Assemblée nationale",
7
7
  "France",
@@ -50,6 +50,8 @@
50
50
  "access": "public"
51
51
  },
52
52
  "scripts": {
53
+ "associate:jorf:commissions": "tsx src/scripts/associate_jorf_textes_with_assemblee_commissions.ts",
54
+ "associate:jorf:dossiers": "tsx src/scripts/associate_jorf_textes_with_dossiers_legislatifs_assemblee.ts",
53
55
  "build": "vite build",
54
56
  "configure": "tsx src/scripts/configure.ts",
55
57
  "format": "prettier --write \"src/**/*.ts\" \"*.md\"",
@@ -62,26 +64,28 @@
62
64
  },
63
65
  "devDependencies": {
64
66
  "@auditors/core": "^0.7.4",
65
- "@tricoteuses/assemblee": "^3.0.18",
66
- "@tricoteuses/legifrance": "^0.17.0",
67
+ "@tricoteuses/assemblee": "^3.2.0",
68
+ "@tricoteuses/legifrance": "^0.18.0",
67
69
  "@tricoteuses/senat": "^2.22.16",
68
70
  "@types/fs-extra": "^11.0.4",
69
71
  "@types/node": "^25.5.0",
70
- "@typescript-eslint/eslint-plugin": "^8.57.1",
71
- "@typescript-eslint/parser": "^8.57.1",
72
+ "@types/papaparse": "^5.5.2",
73
+ "@typescript-eslint/eslint-plugin": "^8.57.2",
74
+ "@typescript-eslint/parser": "^8.57.2",
72
75
  "cheerio": "^1.2.0",
73
76
  "dedent-js": "^1.0.1",
74
77
  "dotenv": "^17.3.1",
75
- "eslint": "^10.0.3",
78
+ "eslint": "^10.1.0",
76
79
  "fs-extra": "^11.3.4",
80
+ "papaparse": "^5.5.3",
77
81
  "postgres": "^3.4.8",
78
82
  "prettier": "^3.8.1",
79
83
  "sade": "^1.8.1",
80
84
  "tsx": "^4.21.0",
81
85
  "typescript": "^5.9.3",
82
- "typesense": "^3.0.3",
83
- "vite": "^8.0.0",
86
+ "typesense": "^3.0.4",
87
+ "vite": "^8.0.3",
84
88
  "vite-plugin-dts": "^4.5.4",
85
- "vitest": "^4.1.0"
89
+ "vitest": "^4.1.2"
86
90
  }
87
91
  }