@tricoteuses/tisseuse 0.21.2 → 0.22.1
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 +18 -0
- package/dist/{html-DWNF_0Ek.js → html-BTaoaqX5.js} +6688 -5737
- package/dist/index.js +72 -72
- package/dist/{src/lib → lib}/extractors/article_portions.d.ts +14 -0
- package/dist/{src/lib → lib}/extractors/links.d.ts +117 -3
- package/dist/{src/lib → lib}/f_legi/resolver.d.ts +23 -4
- package/dist/lib/legi/article_abrogation.d.ts +25 -0
- package/dist/lib/legi/article_history.d.ts +11 -0
- package/dist/lib/legi/article_structure.d.ts +9 -0
- package/dist/{src/lib → lib}/legi/canutes_resolver.d.ts +17 -16
- package/dist/lib/legi/law_article.d.ts +13 -0
- package/dist/lib/legi/named_text_article.d.ts +22 -0
- package/dist/lib/legi/publication_components.d.ts +22 -0
- package/dist/lib/legi/publication_components.fixture.d.ts +3 -0
- package/dist/{src/lib → lib}/legi/resolver.d.ts +40 -0
- package/dist/lib/linkers/enumeration_scope.fixture.d.ts +19 -0
- package/dist/{src/lib → lib}/linkers/html.d.ts +16 -3
- package/dist/lib/linkers/html_decision_capture.d.ts +18 -0
- package/dist/lib/linkers/link_decision_html.d.ts +4 -0
- package/dist/lib/linkers/link_decision_metadata.d.ts +15 -0
- package/dist/{src/lib → lib}/linkers/markdown.d.ts +7 -1
- package/dist/lib/linkers/named_text_article.d.ts +1 -0
- package/dist/lib/linkers/quoted_section.fixture.d.ts +1 -0
- package/dist/lib/linkers/table_column_texts.d.ts +4 -0
- package/dist/{src/lib → lib}/server/parsed_bills.d.ts +19 -0
- package/dist/{src/lib → lib}/text_parsers/ast.d.ts +13 -3
- package/dist/lib/text_parsers/historical_versions.d.ts +18 -0
- package/dist/{src/lib → lib}/text_parsers/parsers.d.ts +2 -0
- package/dist/{src/lib → lib}/text_parsers/repeated_actions.d.ts +1 -0
- package/dist/{src/lib → lib}/text_parsers/texts.d.ts +12 -0
- package/dist/link-decision-metadata.js +32 -0
- package/dist/{resolver-BBrU9oGB.js → resolver-GT7457lQ.js} +316 -127
- package/dist/scripts/enrich_assemblee_documents.d.ts +1 -0
- package/dist/scripts/enrich_senat_documents.d.ts +1 -0
- package/dist/scripts/html_document_to_text.d.ts +1 -0
- package/dist/scripts/index_postgres_assemblee_amendments.d.ts +1 -0
- package/dist/scripts/index_postgres_assemblee_texts.d.ts +1 -0
- package/dist/scripts/index_postgres_judilibre.d.ts +1 -0
- package/dist/scripts/index_postgres_legifrance_articles.d.ts +1 -0
- package/dist/scripts/index_postgres_legifrance_jurisprudence.d.ts +1 -0
- package/dist/scripts/index_postgres_senat_amendments.d.ts +1 -0
- package/dist/scripts/index_postgres_senat_texts.d.ts +1 -0
- package/dist/scripts/parse_akoma_ntoso_bill_raw.d.ts +1 -0
- package/dist/scripts/parse_assemblee_bill_raw.d.ts +1 -0
- package/dist/scripts/profile_assemblee_document_parsing.d.ts +1 -0
- package/dist/scripts/profile_canutes_bill.d.ts +1 -0
- package/dist/scripts/replay_linker_scope.d.ts +1 -0
- package/dist/scripts/shared/assemblee_legislature.test.d.ts +1 -0
- package/dist/scripts/shared/checkpoint_cli_options.test.d.ts +1 -0
- package/dist/scripts/simplified_html_bill_to_table_of_contents.d.ts +1 -0
- package/dist/scripts/simplify_word_html.d.ts +1 -0
- package/dist/scripts/sync_postgres_assemblee_document_content.d.ts +1 -0
- package/dist/scripts/sync_postgres_senat_document_content.d.ts +1 -0
- package/dist/scripts/test_canutes_titles_cache.d.ts +1 -0
- package/dist/scripts/warm_canutes_text_titles_cache.d.ts +1 -0
- package/dist/server-f-legi.js +200 -94
- package/dist/server.js +1080 -959
- package/package.json +9 -4
- package/dist/{src/lib → lib}/alineas/alineas_numbers.d.ts +0 -0
- package/dist/{src/lib → lib}/article_temporal_status.test.d.ts +0 -0
- package/dist/{src/lib → lib}/articles.d.ts +0 -0
- package/dist/{src/lib → lib}/articles.test.d.ts +0 -0
- package/dist/{src/lib → lib}/assemblee_document_date.d.ts +0 -0
- package/dist/{src/lib → lib}/assemblee_document_date.test.d.ts +0 -0
- package/dist/{src/lib → lib}/asserts.d.ts +0 -0
- package/dist/{src/lib → lib}/cache.d.ts +0 -0
- package/dist/{src/lib → lib}/dates.d.ts +0 -0
- package/dist/{src/lib → lib}/extractors/action_directives.d.ts +0 -0
- package/dist/{src/lib → lib}/extractors/action_directives.test.d.ts +0 -0
- package/dist/{src/lib → lib}/extractors/action_directives_cpu.test.d.ts +0 -0
- package/dist/{src/lib → lib}/extractors/article_action_effects.d.ts +0 -0
- package/dist/{src/lib → lib}/extractors/article_action_effects.test.d.ts +0 -0
- package/dist/{src/lib → lib}/extractors/article_action_effects_long.test.d.ts +0 -0
- package/dist/{src/lib → lib}/extractors/article_action_targets.d.ts +0 -0
- package/dist/{src/lib → lib}/extractors/article_action_targets.test.d.ts +0 -0
- package/dist/{src/lib → lib}/extractors/article_portions.test.d.ts +0 -0
- package/dist/{src/lib → lib}/extractors/definitions.d.ts +0 -0
- package/dist/{src/lib/extractors/links.citation_scope.test.d.ts → lib/extractors/link_decisions.test.d.ts} +0 -0
- package/dist/{src/lib/extractors/links.code_titles.test.d.ts → lib/extractors/links.citation_scope.test.d.ts} +0 -0
- package/dist/{src/lib/extractors/links.doctrinal.test.d.ts → lib/extractors/links.code_titles.test.d.ts} +0 -0
- package/dist/{src/lib/extractors/links.european.test.d.ts → lib/extractors/links.doctrinal.test.d.ts} +0 -0
- package/dist/{src/lib/extractors/links.test.d.ts → lib/extractors/links.european.test.d.ts} +0 -0
- package/dist/{src/lib/extractors/portion_references.test.d.ts → lib/extractors/links.test.d.ts} +0 -0
- package/dist/{src/lib → lib}/extractors/portion_references.d.ts +0 -0
- package/dist/{src/lib/extractors/portion_references_cpu.test.d.ts → lib/extractors/portion_references.test.d.ts} +0 -0
- package/dist/{src/lib/extractors/qualified_versions.test.d.ts → lib/extractors/portion_references_cpu.test.d.ts} +0 -0
- package/dist/{src/lib → lib}/extractors/qualified_versions.d.ts +0 -0
- package/dist/{src/lib/extractors/references.test.d.ts → lib/extractors/qualified_versions.test.d.ts} +0 -0
- package/dist/{src/lib → lib}/extractors/quoted_text.d.ts +0 -0
- package/dist/{src/lib → lib}/extractors/references.d.ts +0 -0
- package/dist/{src/lib/text_parsers → lib/extractors}/references.test.d.ts +0 -0
- package/dist/{src/lib → lib}/extractors/table_of_contents.d.ts +0 -0
- package/dist/{src/lib → lib}/extractors/table_of_contents.test.d.ts +0 -0
- package/dist/{src/lib → lib}/f_legi/resolver.test.d.ts +0 -0
- package/dist/{src/lib → lib}/index.d.ts +0 -0
- package/dist/{src/lib → lib}/json.d.ts +0 -0
- package/dist/{src/lib/legi/canutes_article_preload.test.d.ts → lib/legi/article_abrogation.test.d.ts} +0 -0
- package/dist/{src/lib/legi/canutes_candidates.test.d.ts → lib/legi/article_history.test.d.ts} +0 -0
- package/dist/{src/lib/legi/canutes_resolver.test.d.ts → lib/legi/canutes_article_preload.test.d.ts} +0 -0
- package/dist/{src/lib/legi/canutes_resolver_cache.test.d.ts → lib/legi/canutes_candidates.test.d.ts} +0 -0
- package/dist/{src/lib/legi/canutes_resolver_europe.test.d.ts → lib/legi/canutes_resolver.test.d.ts} +0 -0
- package/dist/{src/lib/legi/canutes_root_cid_index.integration.test.d.ts → lib/legi/canutes_resolver_cache.test.d.ts} +0 -0
- package/dist/{src/lib/legi/canutes_section_roots.test.d.ts → lib/legi/canutes_resolver_europe.test.d.ts} +0 -0
- package/dist/{src/lib/legi/canutes_text_titles_cache.integration.test.d.ts → lib/legi/canutes_root_cid_index.integration.test.d.ts} +0 -0
- package/dist/{src/lib/legi/resolver.test.d.ts → lib/legi/canutes_section_roots.test.d.ts} +0 -0
- package/dist/{src/lib → lib}/legi/canutes_sql.d.ts +0 -0
- package/dist/{src/lib → lib}/legi/canutes_text_titles_cache.d.ts +0 -0
- package/dist/{src/lib/linkers/cited-article.test.d.ts → lib/legi/canutes_text_titles_cache.integration.test.d.ts} +0 -0
- package/dist/{src/lib → lib}/legi/canutes_titles_metrics.d.ts +0 -0
- package/dist/{src/lib/linkers/reference-mode.test.d.ts → lib/legi/modifying_act_article_real.test.d.ts} +0 -0
- package/dist/{src/lib/server/administrative_acts_autocompletion.test.d.ts → lib/legi/publication_components.test.d.ts} +0 -0
- package/dist/{src/lib/server/akn_rendering.test.d.ts → lib/legi/resolver.test.d.ts} +0 -0
- package/dist/{src/lib → lib}/legi/text_titles_infos.d.ts +0 -0
- package/dist/{src/lib/server/ameli_autocompletion.test.d.ts → lib/linkers/ambiguous_publication.test.d.ts} +0 -0
- package/dist/{src/lib/server/assemblee_amendment_search.test.d.ts → lib/linkers/cited-article.test.d.ts} +0 -0
- package/dist/{src/lib/server/assemblee_document_search.test.d.ts → lib/linkers/enumeration_scope.test.d.ts} +0 -0
- package/dist/{src/lib/server/atomic_files.test.d.ts → lib/linkers/html_decision_capture.test.d.ts} +0 -0
- package/dist/{src/lib/server/bill_action_resolver_invariance.test.d.ts → lib/linkers/html_named_text_article.test.d.ts} +0 -0
- package/dist/{src/lib/server/bill_citation_anaphora.test.d.ts → lib/linkers/html_publication_93_859_real.test.d.ts} +0 -0
- package/dist/{src/lib/server/bill_comparison.test.d.ts → lib/linkers/html_structure_real.test.d.ts} +0 -0
- package/dist/{src/lib/server/bill_target_scope.test.d.ts → lib/linkers/html_undecidable_real.test.d.ts} +0 -0
- package/dist/{src/lib/server/bofip_autocompletion.test.d.ts → lib/linkers/link_decision_html.test.d.ts} +0 -0
- package/dist/{src/lib/server/boss_autocompletion.test.d.ts → lib/linkers/named_text_article.test.d.ts} +0 -0
- package/dist/{src/lib/server/canutes_only_compatibility.test.d.ts → lib/linkers/quoted_section_scope.test.d.ts} +0 -0
- package/dist/{src/lib/server/document_git_checkpoint.test.d.ts → lib/linkers/reference-mode.test.d.ts} +0 -0
- package/dist/{src/lib → lib}/links.d.ts +6 -6
- /package/dist/{src/lib/server/enriched_document_checkpoint.test.d.ts → lib/links.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/loaders/assemblee.d.ts +0 -0
- /package/dist/{src/lib → lib}/loaders/legifrance.d.ts +0 -0
- /package/dist/{src/lib → lib}/markdown.d.ts +0 -0
- /package/dist/{src/lib → lib}/server/administrative_acts_autocompletion.d.ts +0 -0
- /package/dist/{src/lib/server/europe_autocompletion.test.d.ts → lib/server/administrative_acts_autocompletion.test.d.ts} +0 -0
- /package/dist/{src/lib/server/flegi_profiling.test.d.ts → lib/server/akn_rendering.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/alineas/alineas_images_utils.d.ts +0 -0
- /package/dist/{src/lib → lib}/server/ameli_autocompletion.d.ts +0 -0
- /package/dist/{src/lib/server/html_simplifier.test.d.ts → lib/server/ameli_autocompletion.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/assemblee_amendment_search.d.ts +0 -0
- /package/dist/{src/lib/server/international_treaties_autocompletion.test.d.ts → lib/server/assemblee_amendment_search.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/assemblee_document_search.d.ts +0 -0
- /package/dist/{src/lib/server/judilibre_search.test.d.ts → lib/server/assemblee_document_search.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/atomic_files.d.ts +0 -0
- /package/dist/{src/lib/server/jurisprudence_citations.test.d.ts → lib/server/atomic_files.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/auditors/config.d.ts +0 -0
- /package/dist/{src/lib/server/jurisprudence_jade.test.d.ts → lib/server/bill_action_resolver_invariance.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/bill_action_target_fixtures.d.ts +0 -0
- /package/dist/{src/lib/server/jurisprudence_store.integration.test.d.ts → lib/server/bill_citation_anaphora.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/bill_comparison.d.ts +0 -0
- /package/dist/{src/lib/server/jurisprudence_store_closed.test.d.ts → lib/server/bill_comparison.test.d.ts} +0 -0
- /package/dist/{src/lib/server/legifrance_article_search.test.d.ts → lib/server/bill_target_scope.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/bofip_autocompletion.d.ts +0 -0
- /package/dist/{src/lib/server/legifrance_jurisprudence_search.test.d.ts → lib/server/bofip_autocompletion.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/boss_autocompletion.d.ts +0 -0
- /package/dist/{src/lib/server/local_acts_autocompletion.test.d.ts → lib/server/boss_autocompletion.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/canutes_legacy_candidates.d.ts +0 -0
- /package/dist/{src/lib/server/masquage-typesense.test.d.ts → lib/server/canutes_only_compatibility.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/config.d.ts +0 -0
- /package/dist/{src/lib → lib}/server/databases/canutes_root_cid_index.d.ts +0 -0
- /package/dist/{src/lib → lib}/server/databases/canutes_text_titles_cache.d.ts +0 -0
- /package/dist/{src/lib → lib}/server/databases/index.d.ts +0 -0
- /package/dist/{src/lib → lib}/server/document_git_checkpoint.d.ts +0 -0
- /package/dist/{src/lib/server/parsed_amendments.test.d.ts → lib/server/document_git_checkpoint.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/enriched_document_checkpoint.d.ts +0 -0
- /package/dist/{src/lib/server/parsed_bills.test.d.ts → lib/server/enriched_document_checkpoint.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/europe_autocompletion.d.ts +0 -0
- /package/dist/{src/lib/server/raa_autocompletion.test.d.ts → lib/server/europe_autocompletion.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/f_legi/index.d.ts +0 -0
- /package/dist/{src/lib → lib}/server/flegi_profiling.d.ts +0 -0
- /package/dist/{src/lib/server/senat_amendment_search.test.d.ts → lib/server/flegi_profiling.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/html_simplifier.d.ts +0 -0
- /package/dist/{src/lib/server/senat_document_search.test.d.ts → lib/server/html_simplifier.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/index.d.ts +0 -0
- /package/dist/{src/lib → lib}/server/international_treaties_autocompletion.d.ts +0 -0
- /package/dist/{src/lib/server/shared_legal_text_sections.test.d.ts → lib/server/international_treaties_autocompletion.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/judilibre_search.d.ts +0 -0
- /package/dist/{src/lib/server/sql_profiling.test.d.ts → lib/server/judilibre_search.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/jurisprudence_citations.d.ts +0 -0
- /package/dist/{src/lib/server/sync_administrative_act_titles.test.d.ts → lib/server/jurisprudence_citations.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/jurisprudence_consultation.d.ts +0 -0
- /package/dist/{src/lib → lib}/server/jurisprudence_jade.d.ts +0 -0
- /package/dist/{src/lib/server/sync_assemblee_legal_texts.test.d.ts → lib/server/jurisprudence_jade.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/jurisprudence_store.d.ts +0 -0
- /package/dist/{src/lib/server/sync_local_act_titles.test.d.ts → lib/server/jurisprudence_store.integration.test.d.ts} +0 -0
- /package/dist/{src/lib/server/typesense_blue_green.test.d.ts → lib/server/jurisprudence_store_closed.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/legi/resolvers.d.ts +0 -0
- /package/dist/{src/lib → lib}/server/legifrance_article_search.d.ts +0 -0
- /package/dist/{src/lib/server/typesense_index_lock.test.d.ts → lib/server/legifrance_article_search.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/legifrance_jurisprudence_search.d.ts +0 -0
- /package/dist/{src/lib/text_parsers/action_citation_patterns.test.d.ts → lib/server/legifrance_jurisprudence_search.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/linkers/html.d.ts +0 -0
- /package/dist/{src/lib → lib}/server/local_acts_autocompletion.d.ts +0 -0
- /package/dist/{src/lib/text_parsers/action_directives.test.d.ts → lib/server/local_acts_autocompletion.test.d.ts} +0 -0
- /package/dist/{src/lib/text_parsers/action_occurrences.test.d.ts → lib/server/masquage-typesense.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/masquage_typesense.d.ts +0 -0
- /package/dist/{src/lib/text_parsers/action_position_cues.test.d.ts → lib/server/named_text_article_decisions.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/parsed_amendments.d.ts +0 -0
- /package/dist/{src/lib/text_parsers/action_words.test.d.ts → lib/server/parsed_amendments.test.d.ts} +0 -0
- /package/dist/{src/lib/text_parsers/actions.test.d.ts → lib/server/parsed_bill_abrogation.test.d.ts} +0 -0
- /package/dist/{src/lib/text_parsers/articles.test.d.ts → lib/server/parsed_bill_future_consultation.test.d.ts} +0 -0
- /package/dist/{src/lib/text_parsers/citations.test.d.ts → lib/server/parsed_bill_link_decisions.test.d.ts} +0 -0
- /package/dist/{src/lib/text_parsers/dates.test.d.ts → lib/server/parsed_bills.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/raa_autocompletion.d.ts +0 -0
- /package/dist/{src/lib/text_parsers/divisions.test.d.ts → lib/server/raa_autocompletion.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/senat_amendment_search.d.ts +0 -0
- /package/dist/{src/lib/text_parsers/doctrinal_references.test.d.ts → lib/server/senat_amendment_search.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/senat_document_search.d.ts +0 -0
- /package/dist/{src/lib/text_parsers/numbers.test.d.ts → lib/server/senat_document_search.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/senat_document_sources.d.ts +0 -0
- /package/dist/{src/lib → lib}/server/shared_legal_text_sections.d.ts +0 -0
- /package/dist/{src/lib/text_parsers/parsers.test.d.ts → lib/server/shared_legal_text_sections.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/sql_profiling.d.ts +0 -0
- /package/dist/{src/lib/text_parsers/portions.test.d.ts → lib/server/sql_profiling.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/sync_administrative_act_titles.d.ts +0 -0
- /package/dist/{src/lib/text_parsers/prepositions.test.d.ts → lib/server/sync_administrative_act_titles.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/sync_ameli_titles.d.ts +0 -0
- /package/dist/{src/lib → lib}/server/sync_assemblee_legal_texts.d.ts +0 -0
- /package/dist/{src/lib/text_parsers/relative_locations.test.d.ts → lib/server/sync_assemblee_legal_texts.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/sync_boss_titles.d.ts +0 -0
- /package/dist/{src/lib → lib}/server/sync_europe_titles.d.ts +0 -0
- /package/dist/{src/lib → lib}/server/sync_international_treaty_titles.d.ts +0 -0
- /package/dist/{src/lib → lib}/server/sync_local_act_titles.d.ts +0 -0
- /package/dist/{src/lib/text_parsers/repeated_actions.test.d.ts → lib/server/sync_local_act_titles.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/sync_raa_titles.d.ts +0 -0
- /package/dist/{src/lib → lib}/server/tables_of_contents.d.ts +0 -0
- /package/dist/{src/lib → lib}/server/text_parsers/transformers.d.ts +0 -0
- /package/dist/{src/lib → lib}/server/typesense_blue_green.d.ts +0 -0
- /package/dist/{src/lib/text_parsers/search_queries.test.d.ts → lib/server/typesense_blue_green.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/server/typesense_index_lock.d.ts +0 -0
- /package/dist/{src/lib/text_parsers/simplifiers.test.d.ts → lib/server/typesense_index_lock.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/test/text_titles_infos.d.ts +0 -0
- /package/dist/{src/lib → lib}/text_parsers/action_citation_patterns.d.ts +0 -0
- /package/dist/{src/lib/text_parsers/texts.test.d.ts → lib/text_parsers/action_citation_patterns.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/text_parsers/action_directives.d.ts +0 -0
- /package/dist/{src/lib/text_parsers/typography.test.d.ts → lib/text_parsers/action_directives.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/text_parsers/action_occurrences.d.ts +0 -0
- /package/dist/{src/scripts/add_links_to_assemblee_parsed_documents.d.ts → lib/text_parsers/action_occurrences.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/text_parsers/action_position_cues.d.ts +0 -0
- /package/dist/{src/scripts/add_links_to_html_document.d.ts → lib/text_parsers/action_position_cues.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/text_parsers/action_target_scopes.d.ts +0 -0
- /package/dist/{src/lib → lib}/text_parsers/action_words.d.ts +0 -0
- /package/dist/{src/scripts/add_links_to_legifrance.d.ts → lib/text_parsers/action_words.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/text_parsers/actions.d.ts +0 -0
- /package/dist/{src/scripts/add_links_to_senat_comptes_rendus.d.ts → lib/text_parsers/actions.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/text_parsers/amendment_action_directives.d.ts +0 -0
- /package/dist/{src/lib → lib}/text_parsers/articles.d.ts +0 -0
- /package/dist/{src/scripts/add_links_to_senat_parsed_documents.d.ts → lib/text_parsers/articles.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/text_parsers/citations.d.ts +0 -0
- /package/dist/{src/scripts/alimenter_jurisprudence_pilote.d.ts → lib/text_parsers/citations.test.d.ts} +0 -0
- /package/dist/{src/scripts/associate_jorf_textes_with_assemblee_commissions.d.ts → lib/text_parsers/code_annexes.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/text_parsers/dates.d.ts +0 -0
- /package/dist/{src/scripts/associate_jorf_textes_with_dossiers_legislatifs_assemblee.d.ts → lib/text_parsers/dates.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/text_parsers/divisions.d.ts +0 -0
- /package/dist/{src/scripts/compare_legi_bills.d.ts → lib/text_parsers/divisions.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/text_parsers/doctrinal_references.d.ts +0 -0
- /package/dist/{src/scripts/configure_postgres_assemblee_document_triggers.d.ts → lib/text_parsers/doctrinal_references.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/text_parsers/fragments.d.ts +0 -0
- /package/dist/{src/lib → lib}/text_parsers/helpers.d.ts +0 -0
- /package/dist/{src/scripts/configure_postgres_legi_resolver.d.ts → lib/text_parsers/historical_versions.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/text_parsers/legal_text_aliases.d.ts +0 -0
- /package/dist/{src/lib → lib}/text_parsers/numbers.d.ts +0 -0
- /package/dist/{src/scripts/configure_postgres_root_cid_index.d.ts → lib/text_parsers/numbers.test.d.ts} +0 -0
- /package/dist/{src/scripts/configure_postgres_senat_document_triggers.d.ts → lib/text_parsers/parsers.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/text_parsers/portions.d.ts +0 -0
- /package/dist/{src/scripts/enrich_assemblee_documents.d.ts → lib/text_parsers/portions.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/text_parsers/prepositions.d.ts +0 -0
- /package/dist/{src/scripts/enrich_senat_documents.d.ts → lib/text_parsers/prepositions.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/text_parsers/qualified_versions.d.ts +0 -0
- /package/dist/{src/lib → lib}/text_parsers/references.d.ts +0 -0
- /package/dist/{src/scripts/html_document_to_text.d.ts → lib/text_parsers/references.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/text_parsers/relative_locations.d.ts +0 -0
- /package/dist/{src/scripts/index_postgres_assemblee_amendments.d.ts → lib/text_parsers/relative_locations.test.d.ts} +0 -0
- /package/dist/{src/scripts/index_postgres_assemblee_texts.d.ts → lib/text_parsers/repeated_actions.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/text_parsers/search_queries.d.ts +0 -0
- /package/dist/{src/scripts/index_postgres_judilibre.d.ts → lib/text_parsers/search_queries.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/text_parsers/separators.d.ts +0 -0
- /package/dist/{src/lib → lib}/text_parsers/simplifiers.d.ts +0 -0
- /package/dist/{src/scripts/index_postgres_legifrance_articles.d.ts → lib/text_parsers/simplifiers.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/text_parsers/table_row_targets.d.ts +0 -0
- /package/dist/{src/lib → lib}/text_parsers/table_unit_notes.d.ts +0 -0
- /package/dist/{src/scripts/index_postgres_legifrance_jurisprudence.d.ts → lib/text_parsers/texts.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/text_parsers/transformers.d.ts +0 -0
- /package/dist/{src/lib → lib}/text_parsers/typography.d.ts +0 -0
- /package/dist/{src/scripts/index_postgres_senat_amendments.d.ts → lib/text_parsers/typography.test.d.ts} +0 -0
- /package/dist/{src/lib → lib}/textes.d.ts +0 -0
- /package/dist/{src/lib → lib}/timings.d.ts +0 -0
- /package/dist/{src/scripts/index_postgres_senat_texts.d.ts → scripts/add_links_to_assemblee_parsed_documents.d.ts} +0 -0
- /package/dist/{src/scripts/parse_akoma_ntoso_bill_raw.d.ts → scripts/add_links_to_html_document.d.ts} +0 -0
- /package/dist/{src/scripts/parse_assemblee_bill_raw.d.ts → scripts/add_links_to_legifrance.d.ts} +0 -0
- /package/dist/{src/scripts/profile_assemblee_document_parsing.d.ts → scripts/add_links_to_senat_comptes_rendus.d.ts} +0 -0
- /package/dist/{src/scripts/profile_canutes_bill.d.ts → scripts/add_links_to_senat_parsed_documents.d.ts} +0 -0
- /package/dist/{src/scripts → scripts}/add_positions_to_table_of_contents.d.ts +0 -0
- /package/dist/{src/scripts → scripts}/add_references_to_html_document.d.ts +0 -0
- /package/dist/{src/scripts/shared/assemblee_legislature.test.d.ts → scripts/alimenter_jurisprudence_pilote.d.ts} +0 -0
- /package/dist/{src/scripts/shared/checkpoint_cli_options.test.d.ts → scripts/associate_jorf_textes_with_assemblee_commissions.d.ts} +0 -0
- /package/dist/{src/scripts/simplified_html_bill_to_table_of_contents.d.ts → scripts/associate_jorf_textes_with_dossiers_legislatifs_assemblee.d.ts} +0 -0
- /package/dist/{src/scripts → scripts}/audit_doctrinal_references.d.ts +0 -0
- /package/dist/{src/scripts/simplify_word_html.d.ts → scripts/compare_legi_bills.d.ts} +0 -0
- /package/dist/{src/scripts → scripts}/configure.d.ts +0 -0
- /package/dist/{src/scripts/sync_postgres_assemblee_document_content.d.ts → scripts/configure_postgres_assemblee_document_triggers.d.ts} +0 -0
- /package/dist/{src/scripts/sync_postgres_senat_document_content.d.ts → scripts/configure_postgres_legi_resolver.d.ts} +0 -0
- /package/dist/{src/scripts/test_canutes_titles_cache.d.ts → scripts/configure_postgres_root_cid_index.d.ts} +0 -0
- /package/dist/{src/scripts/warm_canutes_text_titles_cache.d.ts → scripts/configure_postgres_senat_document_triggers.d.ts} +0 -0
- /package/dist/{src/scripts → scripts}/extract_alineas_images.d.ts +0 -0
- /package/dist/{src/scripts → scripts}/generate_alineas_numbers_review.d.ts +0 -0
- /package/dist/{src/scripts → scripts}/index_typesense.d.ts +0 -0
- /package/dist/{src/scripts → scripts}/merge_reviewed_alineas_numbers.d.ts +0 -0
- /package/dist/{src/scripts → scripts}/set_articles_missing_num.d.ts +0 -0
- /package/dist/{src/scripts → scripts}/shared/assemblee_legislature.d.ts +0 -0
- /package/dist/{src/scripts → scripts}/shared/checkpoint_cli_options.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/server-f-legi.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as e, c as t, h as n, i as r, n as i, r as a, s as o, t as s, u as c } from "./resolver-GT7457lQ.js";
|
|
2
2
|
//#region src/lib/f_legi/resolver.ts
|
|
3
|
-
var
|
|
3
|
+
var l = [
|
|
4
4
|
"article_location_diffs",
|
|
5
5
|
"article_num_candidate_stats",
|
|
6
6
|
"article_num_candidates",
|
|
@@ -11,24 +11,38 @@ var a = [
|
|
|
11
11
|
"scta",
|
|
12
12
|
"text_titles_infos",
|
|
13
13
|
"text_titles_infos_parser_cache"
|
|
14
|
-
],
|
|
15
|
-
async function
|
|
14
|
+
], u, d;
|
|
15
|
+
async function f(e) {
|
|
16
16
|
let t = await e`
|
|
17
17
|
SELECT required.name
|
|
18
|
-
FROM unnest(${e.array([...
|
|
18
|
+
FROM unnest(${e.array([...l])}::text[]) AS required(name)
|
|
19
19
|
WHERE to_regclass(required.name) IS NULL
|
|
20
20
|
ORDER BY required.name
|
|
21
21
|
`;
|
|
22
22
|
if (t.length > 0) throw Error(`The f_legi database is missing required relations: ${t.map(({ name: e }) => e).join(", ")}`);
|
|
23
23
|
}
|
|
24
|
-
var
|
|
24
|
+
var p = class l extends s {
|
|
25
25
|
flegiDb;
|
|
26
|
+
articleHistoryInfoByTextAndNum = /* @__PURE__ */ new Map();
|
|
27
|
+
async getArticleHistoryInfo({ num: t, textId: n }) {
|
|
28
|
+
if (t === void 0) return;
|
|
29
|
+
let r = `${n}\0${t}`;
|
|
30
|
+
if (this.articleHistoryInfoByTextAndNum.has(r)) return this.articleHistoryInfoByTextAndNum.get(r);
|
|
31
|
+
let i = e(await this.flegiDb`
|
|
32
|
+
SELECT a.legi_id AS id, a.date_debut::text AS "dateDebut",
|
|
33
|
+
(SELECT jsonb_build_object('VERSION', jsonb_agg(
|
|
34
|
+
jsonb_build_object('LIEN_ART', jsonb_build_object('@id', v.legi_id_lien))
|
|
35
|
+
)) FROM versions v WHERE v.legi_id = a.legi_id) AS versions
|
|
36
|
+
FROM legiarti a
|
|
37
|
+
WHERE a.context_text_cid = ${n} AND a.num = ${t}
|
|
38
|
+
`);
|
|
39
|
+
return this.articleHistoryInfoByTextAndNum.set(r, i), i;
|
|
40
|
+
}
|
|
26
41
|
articleRowsByNumByTextAndDate = /* @__PURE__ */ new Map();
|
|
27
42
|
articleNumsLoadedByTextAndDate = /* @__PURE__ */ new Map();
|
|
28
43
|
articleRowsByContextTextId = /* @__PURE__ */ new Map();
|
|
29
44
|
directSectionChildrenByParentAndDate = /* @__PURE__ */ new Map();
|
|
30
|
-
|
|
31
|
-
directSectionChildrenRootPromises = /* @__PURE__ */ new Map();
|
|
45
|
+
directSectionChildrenParentPromises = /* @__PURE__ */ new Map();
|
|
32
46
|
globalArticleRowsByNumAndDate = /* @__PURE__ */ new Map();
|
|
33
47
|
rootTextIdsByTextId = /* @__PURE__ */ new Map();
|
|
34
48
|
contextTextIdsByTextId = /* @__PURE__ */ new Map();
|
|
@@ -41,14 +55,115 @@ var l = class extends i {
|
|
|
41
55
|
async getActiveArticlesByTextAndNum({ date: e, num: t, textId: n }) {
|
|
42
56
|
return t === void 0 ? [] : (await this.getActiveArticleRowsByNum(n, e, t)).get(t) ?? [];
|
|
43
57
|
}
|
|
44
|
-
async
|
|
45
|
-
|
|
58
|
+
async getLawArticleType({ articleId: e, textId: t }) {
|
|
59
|
+
if (!e.startsWith("LEGIARTI") || !t.startsWith("JORFTEXT")) return;
|
|
60
|
+
let [n] = await this.flegiDb`
|
|
61
|
+
SELECT types.article_type AS "articleType"
|
|
62
|
+
FROM legiarti a
|
|
63
|
+
JOIN articles_types types ON types.id = a.article_type
|
|
64
|
+
JOIN jorftext j ON j.cid = ${t}
|
|
65
|
+
JOIN textes_natures n ON n.id = j.nature
|
|
66
|
+
AND n.nature IN ('LOI', 'ORDONNANCE', 'DECRET')
|
|
67
|
+
WHERE a.legi_id = ${e} AND a.context_text_cid = ${t}
|
|
68
|
+
`;
|
|
69
|
+
return n?.articleType === "AUTONOME" || n?.articleType === "ENTIEREMENT_MODIF" || n?.articleType === "PARTIELLEMENT_MODIF" ? n.articleType : void 0;
|
|
70
|
+
}
|
|
71
|
+
async getVerifiedPublicationComponents(e) {
|
|
72
|
+
if (!(e.length !== 2 || e.some((e) => !/^JORFTEXT\d{12}$/.test(e)))) return (await this.flegiDb.begin("isolation level repeatable read read only", async (t) => ({ proof: r(e, await t`
|
|
73
|
+
SELECT j.cid, n.nature, j.num, j.date_texte::text AS "dateTexte",
|
|
74
|
+
j.date_publi::text AS "datePubli", j.nor,
|
|
75
|
+
coalesce(length(j.visas), 0) > 0 AS "hasVisas",
|
|
76
|
+
coalesce(length(j.signataires), 0) > 0 AS "hasSignataires",
|
|
77
|
+
(SELECT jsonb_agg(jsonb_build_object(
|
|
78
|
+
'id', subpath(s.chemin, 1, 1)::text, 'kind', s.type_objet, 'title', s.titre))
|
|
79
|
+
FROM scta s WHERE subltree(s.chemin, 0, 1) = j.cid::ltree
|
|
80
|
+
AND nlevel(s.chemin) = 2) AS children
|
|
81
|
+
FROM jorftext j JOIN textes_natures n ON n.id = j.nature
|
|
82
|
+
WHERE j.cid = ANY(${t.array(e)}::text[])
|
|
83
|
+
`) }))).proof;
|
|
84
|
+
}
|
|
85
|
+
async getVerifiedArticleAbrogation({ date: e, num: t, textId: n }) {
|
|
86
|
+
if (/^LEGITEXT\d{12}$/.test(n)) return this.flegiDb.begin("isolation level repeatable read read only", async (r) => {
|
|
87
|
+
let i = await r`
|
|
88
|
+
SELECT a.legi_id AS id, a.num, a.context_text_cid AS "textId",
|
|
89
|
+
a.date_debut::text AS "dateDebut", a.date_fin::text AS "dateFin",
|
|
90
|
+
e.etat,
|
|
91
|
+
(SELECT count(*)::int
|
|
92
|
+
FROM article_location_diffs d
|
|
93
|
+
JOIN legiarti missing ON missing.legi_id = d.article_id
|
|
94
|
+
WHERE d.diff_type = 'missing_from_contexte'
|
|
95
|
+
AND missing.num = ${t}) AS "missingContext",
|
|
96
|
+
(SELECT jsonb_agg(jsonb_build_object(
|
|
97
|
+
'id', v.legi_id_lien, 'dateDebut', v.debut::text,
|
|
98
|
+
'dateFin', v.fin::text, 'etat', ve.etat
|
|
99
|
+
) ORDER BY v.legi_id_lien)
|
|
100
|
+
FROM versions v JOIN etats ve ON ve.id = v.etat
|
|
101
|
+
WHERE v.legi_id = a.legi_id) AS versions
|
|
102
|
+
FROM legiarti a JOIN etats e ON e.id = a.etat
|
|
103
|
+
WHERE a.context_text_cid = ${n} AND a.num = ${t}
|
|
104
|
+
LIMIT 129
|
|
105
|
+
`;
|
|
106
|
+
if (i.length === 0 || i.length > 128) return { proof: void 0 };
|
|
107
|
+
let o = i[0].missingContext;
|
|
108
|
+
return o === 0 ? { proof: a({
|
|
109
|
+
candidates: await new l(r).getActiveArticlesByTextAndNum({
|
|
110
|
+
date: e,
|
|
111
|
+
num: t,
|
|
112
|
+
textId: n
|
|
113
|
+
}),
|
|
114
|
+
date: e,
|
|
115
|
+
missingContext: o,
|
|
116
|
+
num: t,
|
|
117
|
+
rows: i,
|
|
118
|
+
textId: n
|
|
119
|
+
}) } : { proof: void 0 };
|
|
120
|
+
}).then(({ proof: e }) => e);
|
|
121
|
+
}
|
|
122
|
+
async getVerifiedArticleStructure({ date: e, num: t, textId: n }) {
|
|
123
|
+
if (/^LEGITEXT\d{12}$/.test(n)) return this.flegiDb.begin("isolation level repeatable read read only", async (r) => {
|
|
124
|
+
let a = await new l(r).getActiveArticlesByTextAndNum({
|
|
125
|
+
date: e,
|
|
126
|
+
num: t,
|
|
127
|
+
textId: n
|
|
128
|
+
});
|
|
129
|
+
if (a.length < 2 || a.length > 128) return { proof: void 0 };
|
|
130
|
+
let o = a.filter(({ dateDebut: t, dateFin: n }) => t < n && t <= e && e < n);
|
|
131
|
+
if (o.length < 2) return { proof: void 0 };
|
|
132
|
+
let s = await r`
|
|
133
|
+
SELECT article_path.dernier_segment AS "articleId",
|
|
134
|
+
article_path.chemin::text AS "articlePath",
|
|
135
|
+
edge.chemin::text AS path, edge.type_objet AS type,
|
|
136
|
+
edge.date_debut::text AS "dateDebut", edge.date_fin::text AS "dateFin"
|
|
137
|
+
FROM scta article_path
|
|
138
|
+
JOIN scta edge ON edge.chemin @> article_path.chemin
|
|
139
|
+
-- Every non-empty ancestor has the article's root. Include the
|
|
140
|
+
-- empty path too: malformed extra edges must still fail the proof.
|
|
141
|
+
-- This lets PostgreSQL use the root index instead of scanning all
|
|
142
|
+
-- texts for each candidate (there need not be a GiST path index).
|
|
143
|
+
AND subltree(edge.chemin, 0, 1) = ANY(ARRAY[${n}::ltree, ''::ltree])
|
|
144
|
+
WHERE article_path.type_objet = 'art'
|
|
145
|
+
AND article_path.dernier_segment = ANY(${r.array(o.map(({ id: e }) => e))}::text[])
|
|
146
|
+
AND subltree(article_path.chemin, 0, 1) = ${n}::ltree
|
|
147
|
+
ORDER BY article_path.dernier_segment, nlevel(edge.chemin)
|
|
148
|
+
`, c = /* @__PURE__ */ new Map();
|
|
149
|
+
for (let { id: e } of o) {
|
|
150
|
+
let t = s.filter(({ articleId: t }) => t === e), r = t[0]?.articlePath, i = r?.split("."), a = i !== void 0 && i.length >= 3 && i[0] === n && i.at(-1) === e && t.length === i.length - 1 && t.every(({ articlePath: e, path: n, type: a }, o) => e === r && n === i.slice(0, o + 2).join(".") && a === (o === t.length - 1 ? "art" : "scta"));
|
|
151
|
+
c.set(e, a ? t.map(({ dateDebut: e, dateFin: t }) => ({
|
|
152
|
+
dateDebut: e,
|
|
153
|
+
dateFin: t
|
|
154
|
+
})) : void 0);
|
|
155
|
+
}
|
|
156
|
+
return { proof: i(a, c, e, n, t) };
|
|
157
|
+
}).then(({ proof: e }) => e);
|
|
158
|
+
}
|
|
159
|
+
async getDirectSectionChildren({ date: e, parentPath: t }) {
|
|
160
|
+
let r = `${t}\0${e}`, i = this.directSectionChildrenByParentAndDate.get(r);
|
|
46
161
|
if (i === void 0) {
|
|
47
|
-
let a = new
|
|
48
|
-
if (await a.time("
|
|
49
|
-
o = await a.time("getRootTextIdsFromTextId", () => this.getRootTextIdsFromTextId(
|
|
50
|
-
let
|
|
51
|
-
|
|
162
|
+
let a = new n("f_legi.getDirectSectionChildren"), o, s = !1;
|
|
163
|
+
if (await a.time("preloadDirectSectionChildrenByParentPath", () => this.preloadDirectSectionChildrenByParentPath(t, e)), i = this.directSectionChildrenByParentAndDate.get(r) ?? [], i.length === 0 && !t.includes(".")) {
|
|
164
|
+
o = await a.time("getRootTextIdsFromTextId", () => this.getRootTextIdsFromTextId(t));
|
|
165
|
+
let n = o;
|
|
166
|
+
n.length > 1 && (s = !0, i = await a.time("queryRootDirectSectionChildren", () => this.flegiDb`
|
|
52
167
|
SELECT
|
|
53
168
|
dernier_segment AS id,
|
|
54
169
|
chemin::text AS path,
|
|
@@ -57,11 +172,11 @@ var l = class extends i {
|
|
|
57
172
|
date_fin::text AS "dateFin"
|
|
58
173
|
FROM scta
|
|
59
174
|
WHERE
|
|
60
|
-
subltree(chemin, 0, 1) = ANY(${this.flegiDb.array(
|
|
175
|
+
subltree(chemin, 0, 1) = ANY(${this.flegiDb.array(n)}::ltree[])
|
|
61
176
|
AND nlevel(chemin) = 2
|
|
62
177
|
AND type_objet = 'scta'
|
|
63
|
-
AND date_debut <= ${
|
|
64
|
-
AND date_fin >= ${
|
|
178
|
+
AND date_debut <= ${e}::date
|
|
179
|
+
AND date_fin >= ${e}::date
|
|
65
180
|
ORDER BY tri_hierarchique
|
|
66
181
|
`, { count: o.length }));
|
|
67
182
|
}
|
|
@@ -69,7 +184,7 @@ var l = class extends i {
|
|
|
69
184
|
exactResultCount: o === void 0 ? i.length : 0,
|
|
70
185
|
fallbackResultCount: s ? i.length : void 0,
|
|
71
186
|
fallbackRootTextIdCount: o?.length,
|
|
72
|
-
parentPath:
|
|
187
|
+
parentPath: t,
|
|
73
188
|
resultCount: i.length,
|
|
74
189
|
usedFallbackQuery: s
|
|
75
190
|
}), this.directSectionChildrenByParentAndDate.set(r, i);
|
|
@@ -80,34 +195,34 @@ var l = class extends i {
|
|
|
80
195
|
let t = this.textIdBySegmentId.get(e);
|
|
81
196
|
return t === void 0 && (t = await this.getTextIdFromSegmentIdUsingContextHeuristic(e) ?? await this.getTextIdFromSegmentIdUsingSctaHeuristic(e) ?? null, this.textIdBySegmentId.set(e, t)), t ?? void 0;
|
|
82
197
|
}
|
|
83
|
-
async preloadTextTitlesInfos(
|
|
84
|
-
let
|
|
85
|
-
|
|
198
|
+
async preloadTextTitlesInfos(e = {}) {
|
|
199
|
+
let t = (t, n = {}) => {
|
|
200
|
+
e.onProgress?.({
|
|
86
201
|
...n,
|
|
87
|
-
phase:
|
|
202
|
+
phase: t,
|
|
88
203
|
resolver: "f_legi"
|
|
89
204
|
});
|
|
90
|
-
}, r = new
|
|
91
|
-
if (this.schemaValidationPromise ??=
|
|
205
|
+
}, r = new n("f_legi.preloadTextTitlesInfos");
|
|
206
|
+
if (this.schemaValidationPromise ??= f(this.flegiDb).catch((e) => {
|
|
92
207
|
throw this.schemaValidationPromise = void 0, e;
|
|
93
208
|
}), await this.schemaValidationPromise, this.textTitlesInfosLoaded) {
|
|
94
209
|
let e = await this.getTextTitlesInfosParserCacheMeta(r);
|
|
95
|
-
if (e !== void 0 && e.formatVersion === 2 && e.generatedAt ===
|
|
96
|
-
|
|
210
|
+
if (e !== void 0 && e.formatVersion === 2 && e.generatedAt === u) {
|
|
211
|
+
t("already-loaded");
|
|
97
212
|
return;
|
|
98
213
|
}
|
|
99
214
|
this.textTitlesInfosLoaded = !1;
|
|
100
215
|
}
|
|
101
|
-
|
|
102
|
-
progress:
|
|
216
|
+
d === void 0 ? d = (async () => await this.loadOrBuildTextTitlesInfosParserCache({
|
|
217
|
+
progress: t,
|
|
103
218
|
timings: r
|
|
104
219
|
}))().catch((e) => {
|
|
105
|
-
throw
|
|
106
|
-
}) :
|
|
220
|
+
throw d = void 0, e;
|
|
221
|
+
}) : t("waiting-for-shared-preload"), u = await d, d = void 0, t("setTextTitlesInfos:done"), r.log(), this.textTitlesInfosLoaded = !0;
|
|
107
222
|
}
|
|
108
|
-
async buildAndCacheTextTitlesInfos({ progress: e, sql:
|
|
109
|
-
await
|
|
110
|
-
let
|
|
223
|
+
async buildAndCacheTextTitlesInfos({ progress: e, sql: n, timings: r }) {
|
|
224
|
+
await r.time("lockTextTitlesInfos", () => n`SELECT lock_text_titles_infos_for_parser_cache()`), e("queryTextTitlesInfos:start");
|
|
225
|
+
let i = await r.time("queryTextTitlesInfos", () => n`
|
|
111
226
|
SELECT
|
|
112
227
|
t.cid,
|
|
113
228
|
v.debut::text AS "dateDebut",
|
|
@@ -124,14 +239,14 @@ var l = class extends i {
|
|
|
124
239
|
AND v.legi_id_lien = t.legi_id
|
|
125
240
|
ORDER BY t.legi_id
|
|
126
241
|
`);
|
|
127
|
-
e("queryTextTitlesInfos:done", { count:
|
|
128
|
-
let
|
|
129
|
-
|
|
130
|
-
count:
|
|
131
|
-
durationMs: Math.round((performance.now() -
|
|
242
|
+
e("queryTextTitlesInfos:done", { count: i.length }), e("buildTextTitlesInfos:start", { count: i.length });
|
|
243
|
+
let a = performance.now(), s = await o(i, { onProgress: ({ count: t, phase: n }) => e(`buildTextTitlesInfos:${n}`, { count: t }) });
|
|
244
|
+
r.add({
|
|
245
|
+
count: i.length,
|
|
246
|
+
durationMs: Math.round((performance.now() - a) * 10) / 10,
|
|
132
247
|
phase: "buildTextTitlesInfos"
|
|
133
|
-
}), e("buildTextTitlesInfos:done"), e("writeTextTitlesInfosParserCache:start", { count:
|
|
134
|
-
let [l] = await
|
|
248
|
+
}), e("buildTextTitlesInfos:done"), e("writeTextTitlesInfosParserCache:start", { count: i.length });
|
|
249
|
+
let [l] = await r.time("writeTextTitlesInfosParserCache", () => n`
|
|
135
250
|
INSERT INTO text_titles_infos_parser_cache (
|
|
136
251
|
key,
|
|
137
252
|
format_version,
|
|
@@ -139,11 +254,11 @@ var l = class extends i {
|
|
|
139
254
|
generated_at,
|
|
140
255
|
data
|
|
141
256
|
) VALUES (
|
|
142
|
-
${
|
|
257
|
+
${c},
|
|
143
258
|
${2},
|
|
144
|
-
${
|
|
259
|
+
${i.length},
|
|
145
260
|
now(),
|
|
146
|
-
${this.flegiDb.json(
|
|
261
|
+
${this.flegiDb.json(s)}
|
|
147
262
|
)
|
|
148
263
|
ON CONFLICT (key)
|
|
149
264
|
DO UPDATE SET
|
|
@@ -153,7 +268,7 @@ var l = class extends i {
|
|
|
153
268
|
data = EXCLUDED.data
|
|
154
269
|
RETURNING generated_at::text AS "generatedAt"
|
|
155
270
|
`);
|
|
156
|
-
return e("writeTextTitlesInfosParserCache:done", { count:
|
|
271
|
+
return e("writeTextTitlesInfosParserCache:done", { count: i.length }), t(s), l.generatedAt;
|
|
157
272
|
}
|
|
158
273
|
async getTextTitlesInfosParserCacheMeta(e) {
|
|
159
274
|
let [t] = await e.time("queryTextTitlesInfosParserCacheMeta", () => this.flegiDb`
|
|
@@ -162,37 +277,37 @@ var l = class extends i {
|
|
|
162
277
|
generated_at::text AS "generatedAt",
|
|
163
278
|
source_row_count AS "sourceRowCount"
|
|
164
279
|
FROM text_titles_infos_parser_cache
|
|
165
|
-
WHERE key = ${
|
|
280
|
+
WHERE key = ${c}
|
|
166
281
|
`);
|
|
167
282
|
return t;
|
|
168
283
|
}
|
|
169
|
-
async loadTextTitlesInfosParserCache({ progress: e, sql:
|
|
170
|
-
let
|
|
284
|
+
async loadTextTitlesInfosParserCache({ progress: e, sql: n, timings: r }) {
|
|
285
|
+
let i = n ?? this.flegiDb;
|
|
171
286
|
e("queryTextTitlesInfosParserCache:start");
|
|
172
|
-
let [
|
|
287
|
+
let [a] = await r.time("queryTextTitlesInfosParserCache", () => i`
|
|
173
288
|
SELECT
|
|
174
289
|
data,
|
|
175
290
|
format_version AS "formatVersion",
|
|
176
291
|
generated_at::text AS "generatedAt",
|
|
177
292
|
source_row_count AS "sourceRowCount"
|
|
178
293
|
FROM text_titles_infos_parser_cache
|
|
179
|
-
WHERE key = ${
|
|
294
|
+
WHERE key = ${c}
|
|
180
295
|
`);
|
|
181
|
-
if (
|
|
296
|
+
if (a === void 0) {
|
|
182
297
|
e("queryTextTitlesInfosParserCache:miss");
|
|
183
298
|
return;
|
|
184
299
|
}
|
|
185
|
-
if (
|
|
300
|
+
if (a.formatVersion !== 2) {
|
|
186
301
|
e("queryTextTitlesInfosParserCache:format-mismatch");
|
|
187
302
|
return;
|
|
188
303
|
}
|
|
189
|
-
e("queryTextTitlesInfosParserCache:done", { count:
|
|
190
|
-
let
|
|
191
|
-
return t(
|
|
192
|
-
count:
|
|
193
|
-
durationMs: Math.round((performance.now() -
|
|
304
|
+
e("queryTextTitlesInfosParserCache:done", { count: a.sourceRowCount });
|
|
305
|
+
let o = performance.now();
|
|
306
|
+
return t(a.data), r.add({
|
|
307
|
+
count: a.sourceRowCount,
|
|
308
|
+
durationMs: Math.round((performance.now() - o) * 10) / 10,
|
|
194
309
|
phase: "installTextTitlesInfosParserCache"
|
|
195
|
-
}),
|
|
310
|
+
}), a.generatedAt;
|
|
196
311
|
}
|
|
197
312
|
async loadOrBuildTextTitlesInfosParserCache({ progress: e, timings: t }) {
|
|
198
313
|
let n = await this.loadTextTitlesInfosParserCache({
|
|
@@ -218,16 +333,16 @@ var l = class extends i {
|
|
|
218
333
|
let n = `${t}\0${e}`, r = this.globalArticleRowsByNumAndDate.get(n);
|
|
219
334
|
return r === void 0 && (r = await this.queryUniqueActiveArticlesByNumsUsingContextHeuristic([t]), this.globalArticleRowsByNumAndDate.set(n, r)), r;
|
|
220
335
|
}
|
|
221
|
-
async preloadUniqueActiveArticlesByNums({ date:
|
|
336
|
+
async preloadUniqueActiveArticlesByNums({ date: e, nums: t }) {
|
|
222
337
|
let r = [], i = /* @__PURE__ */ new Set();
|
|
223
|
-
for (let
|
|
224
|
-
if (
|
|
225
|
-
i.add(
|
|
226
|
-
let
|
|
227
|
-
this.globalArticleRowsByNumAndDate.has(
|
|
338
|
+
for (let n of t) {
|
|
339
|
+
if (n === void 0 || i.has(n)) continue;
|
|
340
|
+
i.add(n);
|
|
341
|
+
let t = `${n}\0${e}`;
|
|
342
|
+
this.globalArticleRowsByNumAndDate.has(t) || r.push(n);
|
|
228
343
|
}
|
|
229
344
|
if (r.length === 0) return;
|
|
230
|
-
let a = new
|
|
345
|
+
let a = new n("f_legi.preloadUniqueActiveArticlesByNums"), o = await a.time("queryGloballyUniqueArticleRowsByNums", () => this.queryGloballyUniqueArticleRowsByNums(r), { count: r.length }), s = new Set(o.map(({ num: e }) => e).filter((e) => e !== null)), c = r.filter((e) => !s.has(e)), l = await a.time("queryUniqueActiveArticlesByNumsUsingContextHeuristic", () => this.queryUniqueActiveArticlesByNumsUsingContextHeuristic(c), { count: c.length }), u = [...o, ...l].toSorted((e, t) => e.id < t.id ? -1 : +(e.id > t.id)), d = /* @__PURE__ */ new Map();
|
|
231
346
|
for (let e of r) d.set(e, []);
|
|
232
347
|
let f = /* @__PURE__ */ new Map();
|
|
233
348
|
for (let e of u) {
|
|
@@ -235,7 +350,7 @@ var l = class extends i {
|
|
|
235
350
|
let t = f.get(e.num) ?? 0;
|
|
236
351
|
f.set(e.num, t + 1), !(t >= 100) && d.get(e.num)?.push(e);
|
|
237
352
|
}
|
|
238
|
-
for (let [
|
|
353
|
+
for (let [t, n] of d) this.globalArticleRowsByNumAndDate.set(`${t}\0${e}`, n);
|
|
239
354
|
a.log({
|
|
240
355
|
articleRowCount: u.length,
|
|
241
356
|
globallyUniqueArticleRowCount: o.length,
|
|
@@ -244,23 +359,23 @@ var l = class extends i {
|
|
|
244
359
|
numCount: r.length
|
|
245
360
|
});
|
|
246
361
|
}
|
|
247
|
-
async preloadActiveArticlesByTextIds({ date:
|
|
248
|
-
let i =
|
|
249
|
-
if (
|
|
250
|
-
let n = `${
|
|
362
|
+
async preloadActiveArticlesByTextIds({ date: e, nums: t, textIds: r }) {
|
|
363
|
+
let i = t === void 0 ? void 0 : [...new Set(t)].filter(Boolean), a = [...new Set(r)].filter((t) => {
|
|
364
|
+
if (t === void 0) return !1;
|
|
365
|
+
let n = `${t}\0${e}`;
|
|
251
366
|
if (this.articleRowsByNumByTextAndDate.get(n) === void 0) return !0;
|
|
252
367
|
let r = this.articleNumsLoadedByTextAndDate.get(n);
|
|
253
368
|
return r === "all" ? !1 : i === void 0 ? !0 : i.some((e) => !r?.has(e));
|
|
254
369
|
});
|
|
255
370
|
if (a.length === 0) return;
|
|
256
|
-
let o = new
|
|
371
|
+
let o = new n("f_legi.preloadActiveArticlesByTextIds"), s = await o.time("getContextTextIdsByTextIds", () => this.getContextTextIdsByTextIds(a)), c = [...new Set([...s.values()].flat())], l = await o.time("getActiveArticleRowsForContextTextIds", () => i === void 0 ? this.getActiveArticleRowsForContextTextIdsWithRoots(c) : this.queryActiveArticleRowsForContextTextIds(c, i), { count: c.length }), u = /* @__PURE__ */ new Map(), d = (e, t) => {
|
|
257
372
|
if (e === null) return;
|
|
258
373
|
let n = u.get(e);
|
|
259
374
|
n === void 0 ? u.set(e, [t]) : n.push(t);
|
|
260
375
|
};
|
|
261
376
|
for (let e of l) d(e.rootTextId, e), d(e.textId, e);
|
|
262
|
-
for (let
|
|
263
|
-
let n = `${
|
|
377
|
+
for (let t of a) {
|
|
378
|
+
let n = `${t}\0${e}`, r = s.get(t) ?? [t], a = /* @__PURE__ */ new Map();
|
|
264
379
|
for (let e of r) for (let t of u.get(e) ?? []) a.set(`${t.id}\0${t.textId}`, {
|
|
265
380
|
id: t.id,
|
|
266
381
|
textId: t.textId,
|
|
@@ -269,11 +384,10 @@ var l = class extends i {
|
|
|
269
384
|
dateFin: t.dateFin
|
|
270
385
|
});
|
|
271
386
|
let o = this.articleRowsByNumByTextAndDate.get(n) ?? /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
|
|
272
|
-
for (let [e, t] of o) c.set(e, new Set(t.map((e) => `${e.id}\0${e.textId}`)));
|
|
273
387
|
for (let e of a.values()) {
|
|
274
388
|
if (e.num === null) continue;
|
|
275
389
|
let t = `${e.id}\0${e.textId}`, n = c.get(e.num);
|
|
276
|
-
n === void 0 && (n =
|
|
390
|
+
n === void 0 && (n = new Set((o.get(e.num) ?? []).map((e) => `${e.id}\0${e.textId}`)), c.set(e.num, n));
|
|
277
391
|
let r = o.get(e.num);
|
|
278
392
|
r === void 0 ? (o.set(e.num, [e]), n.add(t)) : n.has(t) || (r.push(e), n.add(t));
|
|
279
393
|
}
|
|
@@ -512,17 +626,13 @@ var l = class extends i {
|
|
|
512
626
|
article_rows.order_id
|
|
513
627
|
`).toSorted((e, t) => e.id.localeCompare(t.id));
|
|
514
628
|
}
|
|
515
|
-
async
|
|
516
|
-
let n = e.split(".", 1)[0], r = `${
|
|
517
|
-
if (this.
|
|
518
|
-
|
|
519
|
-
return;
|
|
520
|
-
}
|
|
521
|
-
let i = this.directSectionChildrenRootPromises.get(r);
|
|
629
|
+
async preloadDirectSectionChildrenByParentPath(e, t) {
|
|
630
|
+
let n = e.split(".", 1)[0], r = `${e}\0${t}`;
|
|
631
|
+
if (this.directSectionChildrenByParentAndDate.has(r)) return;
|
|
632
|
+
let i = this.directSectionChildrenParentPromises.get(r);
|
|
522
633
|
i === void 0 && (i = (async () => {
|
|
523
|
-
let i =
|
|
634
|
+
let i = await this.flegiDb`
|
|
524
635
|
SELECT
|
|
525
|
-
subltree(chemin, 0, nlevel(chemin) - 1)::text AS "parentPath",
|
|
526
636
|
dernier_segment AS id,
|
|
527
637
|
chemin::text AS path,
|
|
528
638
|
titre AS title,
|
|
@@ -531,21 +641,17 @@ var l = class extends i {
|
|
|
531
641
|
FROM scta
|
|
532
642
|
WHERE
|
|
533
643
|
subltree(chemin, 0, 1) = ${n}::ltree
|
|
534
|
-
AND nlevel(chemin)
|
|
644
|
+
AND nlevel(chemin) = nlevel(${e}::ltree) + 1
|
|
645
|
+
AND subltree(chemin, 0, nlevel(chemin) - 1) = ${e}::ltree
|
|
535
646
|
AND type_objet = 'scta'
|
|
536
647
|
AND date_debut <= ${t}::date
|
|
537
648
|
AND date_fin >= ${t}::date
|
|
538
649
|
ORDER BY tri_hierarchique
|
|
539
650
|
`;
|
|
540
|
-
|
|
541
|
-
let n = i.get(e);
|
|
542
|
-
n === void 0 ? i.set(e, [t]) : n.push(t);
|
|
543
|
-
}
|
|
544
|
-
for (let [e, n] of i) this.directSectionChildrenByParentAndDate.set(`${e}\0${t}`, n);
|
|
545
|
-
this.directSectionChildrenByParentAndDate.set(`${e}\0${t}`, i.get(e) ?? []), this.directSectionChildrenLoadedRootsAndDate.add(r);
|
|
651
|
+
this.directSectionChildrenByParentAndDate.set(r, i);
|
|
546
652
|
})().finally(() => {
|
|
547
|
-
this.
|
|
548
|
-
}), this.
|
|
653
|
+
this.directSectionChildrenParentPromises.delete(r);
|
|
654
|
+
}), this.directSectionChildrenParentPromises.set(r, i)), await i;
|
|
549
655
|
}
|
|
550
656
|
async getTextIdFromSegmentIdUsingContextHeuristic(e) {
|
|
551
657
|
if (e.startsWith("LEGIARTI")) return (await this.flegiDb`
|
|
@@ -645,4 +751,4 @@ var l = class extends i {
|
|
|
645
751
|
}
|
|
646
752
|
};
|
|
647
753
|
//#endregion
|
|
648
|
-
export {
|
|
754
|
+
export { p as FlegiResolver, f as checkFlegiResolverDatabase };
|