@tricoteuses/tisseuse 0.13.8 → 0.13.10
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/README.md +34 -35
- package/dist/{textes-BIJjrNwg.js → html-DhGw-Yqr.js} +3875 -5243
- package/dist/index.js +280 -147
- package/dist/resolver-DZS-DNp6.js +1848 -0
- package/dist/server-f-legi.js +532 -0
- package/dist/server.js +542 -2161
- package/dist/src/lib/extractors/links.d.ts +6 -4
- package/dist/src/lib/f_legi/resolver.d.ts +5 -7
- package/dist/src/lib/index.d.ts +2 -0
- package/dist/src/lib/legi/canutes_resolver.d.ts +5 -6
- package/dist/src/lib/legi/resolver.d.ts +15 -12
- package/dist/src/lib/legi/resolver.test.d.ts +1 -0
- package/dist/src/lib/legi/text_titles_infos.d.ts +26 -0
- package/dist/src/lib/linkers/html.d.ts +15 -4
- package/dist/src/lib/linkers/markdown.d.ts +4 -2
- package/dist/src/lib/server/atomic_files.d.ts +8 -0
- package/dist/src/lib/server/atomic_files.test.d.ts +1 -0
- package/dist/src/lib/server/document_git_checkpoint.d.ts +6 -0
- package/dist/src/lib/server/document_git_checkpoint.test.d.ts +1 -0
- package/dist/src/lib/server/enriched_document_checkpoint.d.ts +3 -0
- package/dist/src/lib/server/enriched_document_checkpoint.test.d.ts +1 -0
- package/dist/src/lib/server/f_legi/index.d.ts +1 -0
- package/dist/src/lib/server/index.d.ts +2 -1
- package/dist/src/lib/server/legi/resolvers.d.ts +2 -7
- package/dist/src/lib/server/linkers/html.d.ts +4 -2
- package/dist/src/scripts/enrich_senat_documents.d.ts +1 -0
- package/package.json +7 -1
- package/dist/src/lib/f_legi/extractors/links.d.ts +0 -134
- package/dist/src/lib/f_legi/linkers/html.d.ts +0 -51
- package/dist/src/lib/server/f_legi/databases/index.d.ts +0 -2
- package/dist/src/lib/server/f_legi/linkers/html.d.ts +0 -20
- package/dist/src/scripts/f_legi/add_links_to_html_document.d.ts +0 -0
- /package/dist/src/{scripts/extract_texts_titles_infos.d.ts → lib/f_legi/resolver.test.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -96,6 +96,17 @@ npm run index:postgres:assemblee -- --all
|
|
|
96
96
|
|
|
97
97
|
La première commande consomme la file des documents à acquérir, simplifier et enrichir. La seconde indexe dans `tisseuse.assemblee_text_search` les articles et les exposés des motifs comme résultats distincts. Les déclencheurs sur `assemblee.documents`, le hash du contenu et les files PostgreSQL permettent les mises à jour ciblées ; les options `--all` demandent une réconciliation complète.
|
|
98
98
|
|
|
99
|
+
Pour acquérir et indexer immédiatement quelques documents indépendamment de leur position dans les files durables :
|
|
100
|
+
|
|
101
|
+
```sh
|
|
102
|
+
npm run sync:postgres:assemblee-content -- \
|
|
103
|
+
--document-uids PRJLANR5L17BTC2765,PRJLANR5L17BTC3067
|
|
104
|
+
npm run index:postgres:assemblee -- \
|
|
105
|
+
--document-uids PRJLANR5L17BTC2765,PRJLANR5L17BTC3067
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Le mode ciblé refuse les UID absents de `assemblee.documents` et ne peut pas être combiné avec `--all`.
|
|
109
|
+
|
|
99
110
|
Exploratrice et Moulineuse ne téléchargent jamais un document pendant une lecture. Lorsqu’un document source existe mais que son contenu n’est pas encore disponible, son état est conservé en base et l’interface doit l’indiquer au lieu de servir une copie locale périmée.
|
|
100
111
|
|
|
101
112
|
### Première itération de recherche plein texte Sénat
|
|
@@ -133,46 +144,34 @@ Les documents sans URL, externes au Sénat, sans Akoma Ntoso ou en échec de par
|
|
|
133
144
|
|
|
134
145
|
## Legal reference resolver
|
|
135
146
|
|
|
136
|
-
Tisseuse resolves legal references through
|
|
137
|
-
|
|
138
|
-
`
|
|
147
|
+
Tisseuse resolves legal references through the Canutes-backed `LegiResolver`.
|
|
148
|
+
`LegiResolver` is exported as an abstract class from both
|
|
149
|
+
`@tricoteuses/tisseuse` and `@tricoteuses/tisseuse/server`, so applications can
|
|
150
|
+
provide another storage-backed implementation. At process startup, the Canutes
|
|
151
|
+
resolver reads the title metadata it needs directly from
|
|
152
|
+
`legifrance.texte_version` and builds the parser indexes in memory. Concurrent
|
|
153
|
+
callers share the same preload operation, and the resulting indexes remain fixed
|
|
154
|
+
for the lifetime of the process.
|
|
139
155
|
|
|
140
|
-
|
|
156
|
+
No generated title index belongs in the source tree. Tests that resolve the full
|
|
157
|
+
Légifrance title corpus need access to the configured Canutes database and call
|
|
158
|
+
the same preload operation as production code.
|
|
141
159
|
|
|
142
|
-
|
|
143
|
-
`text_titles_infos.json` file.
|
|
144
|
-
- `canutes`: uses the Canutes database and requires generating
|
|
145
|
-
`src/lib/text_parsers/text_titles_infos.json` before running tests that parse
|
|
146
|
-
or resolve French text titles.
|
|
160
|
+
### `f_legi` server adapter
|
|
147
161
|
|
|
148
|
-
|
|
162
|
+
Applications backed by a `f_legi` database can import the optional server-only
|
|
163
|
+
adapter from the same package:
|
|
149
164
|
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
npx tsx src/scripts/parse_assemblee_bill_raw.ts bill.html.raw --resolver f_legi
|
|
153
|
-
```
|
|
165
|
+
```ts
|
|
166
|
+
import { FlegiResolver } from "@tricoteuses/tisseuse/server/f-legi"
|
|
154
167
|
|
|
155
|
-
|
|
156
|
-
the tests:
|
|
157
|
-
|
|
158
|
-
```sh
|
|
159
|
-
npx tsx src/scripts/extract_texts_titles_infos.ts
|
|
160
|
-
npm test
|
|
168
|
+
const resolver = new FlegiResolver(sql)
|
|
161
169
|
```
|
|
162
170
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
If you need to keep the generated file outside the working tree, pass it through
|
|
167
|
-
`TISSEUSE_TEXT_TITLES_INFOS_PATH` or script options instead:
|
|
168
|
-
|
|
169
|
-
```sh
|
|
170
|
-
TISSEUSE_TEXT_TITLES_INFOS_PATH=/path/to/text_titles_infos.json npm test
|
|
171
|
-
npx tsx src/scripts/parse_akoma_ntoso_bill_raw.ts bill.akn.xml.raw --text-titles-infos /path/to/text_titles_infos.json
|
|
172
|
-
```
|
|
171
|
+
The caller owns the PostgreSQL client and its lifecycle. Importing the adapter
|
|
172
|
+
does not open a connection, read environment variables, or preload title data.
|
|
173
|
+
The generic Tisseuse entry points do not load this adapter.
|
|
173
174
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
generated data and is not loaded through Vitest global setup; tests that need it
|
|
178
|
-
preload it explicitly through the selected resolver.
|
|
175
|
+
External adapters can extend the public `LegiResolver` class. The public package
|
|
176
|
+
also exports the resolver option types and `buildAndInstallTextTitlesInfos`, so
|
|
177
|
+
an adapter does not need deep imports into Tisseuse.
|