@tricoteuses/tisseuse 0.11.0 → 0.12.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.
Files changed (96) hide show
  1. package/dist/{html-DfrdIKTl.js → html-Ds2IZ1nn.js} +2106 -2074
  2. package/dist/index.js +596 -327
  3. package/dist/server.js +1 -1
  4. package/dist/{lib → src/lib}/extractors/action_directives.d.ts +4 -3
  5. package/dist/{lib → src/lib}/extractors/article_portions.d.ts +1 -1
  6. package/dist/src/lib/extractors/definitions.d.ts +3 -0
  7. package/dist/{lib → src/lib}/extractors/links.d.ts +4 -4
  8. package/dist/{lib → src/lib}/extractors/references.d.ts +3 -3
  9. package/dist/{lib → src/lib}/extractors/table_of_contents.d.ts +4 -4
  10. package/dist/{lib → src/lib}/linkers/html.d.ts +4 -4
  11. package/dist/{lib → src/lib}/linkers/markdown.d.ts +2 -2
  12. package/dist/{lib → src/lib}/loaders/assemblee.d.ts +1 -1
  13. package/dist/{lib → src/lib}/loaders/legifrance.d.ts +1 -1
  14. package/dist/src/lib/server/auditors/config.d.ts +1 -0
  15. package/dist/{lib → src/lib}/server/config.d.ts +1 -1
  16. package/dist/{lib → src/lib}/server/linkers/html.d.ts +1 -1
  17. package/dist/{lib → src/lib}/server/text_parsers/transformers.d.ts +1 -1
  18. package/dist/{lib → src/lib}/text_parsers/numbers.d.ts +5 -0
  19. package/dist/src/scripts/simplify_word_html.d.ts +1 -0
  20. package/package.json +11 -9
  21. package/dist/lib/extractors/definitions.d.ts +0 -3
  22. package/dist/lib/server/auditors/config.d.ts +0 -4
  23. /package/dist/{lib → src/lib}/alineas/alineas_numbers.d.ts +0 -0
  24. /package/dist/{lib → src/lib}/articles.d.ts +0 -0
  25. /package/dist/{lib → src/lib}/articles.test.d.ts +0 -0
  26. /package/dist/{lib → src/lib}/asserts.d.ts +0 -0
  27. /package/dist/{lib → src/lib}/cache.d.ts +0 -0
  28. /package/dist/{lib → src/lib}/dates.d.ts +0 -0
  29. /package/dist/{lib → src/lib}/extractors/action_directives.test.d.ts +0 -0
  30. /package/dist/{lib → src/lib}/extractors/article_portions.test.d.ts +0 -0
  31. /package/dist/{lib → src/lib}/extractors/links.test.d.ts +0 -0
  32. /package/dist/{lib → src/lib}/extractors/references.test.d.ts +0 -0
  33. /package/dist/{lib → src/lib}/index.d.ts +0 -0
  34. /package/dist/{lib → src/lib}/json.d.ts +0 -0
  35. /package/dist/{lib → src/lib}/links.d.ts +0 -0
  36. /package/dist/{lib → src/lib}/markdown.d.ts +0 -0
  37. /package/dist/{lib → src/lib}/server/alineas/alineas_images_utils.d.ts +0 -0
  38. /package/dist/{lib → src/lib}/server/databases/index.d.ts +0 -0
  39. /package/dist/{lib → src/lib}/server/html_simplifier.d.ts +0 -0
  40. /package/dist/{lib → src/lib}/server/html_simplifier.test.d.ts +0 -0
  41. /package/dist/{lib → src/lib}/server/index.d.ts +0 -0
  42. /package/dist/{lib → src/lib}/server/tables_of_contents.d.ts +0 -0
  43. /package/dist/{lib → src/lib}/text_parsers/actions.d.ts +0 -0
  44. /package/dist/{lib → src/lib}/text_parsers/actions.test.d.ts +0 -0
  45. /package/dist/{lib → src/lib}/text_parsers/articles.d.ts +0 -0
  46. /package/dist/{lib → src/lib}/text_parsers/articles.test.d.ts +0 -0
  47. /package/dist/{lib → src/lib}/text_parsers/ast.d.ts +0 -0
  48. /package/dist/{lib → src/lib}/text_parsers/citations.d.ts +0 -0
  49. /package/dist/{lib → src/lib}/text_parsers/citations.test.d.ts +0 -0
  50. /package/dist/{lib → src/lib}/text_parsers/dates.d.ts +0 -0
  51. /package/dist/{lib → src/lib}/text_parsers/dates.test.d.ts +0 -0
  52. /package/dist/{lib → src/lib}/text_parsers/divisions.d.ts +0 -0
  53. /package/dist/{lib → src/lib}/text_parsers/divisions.test.d.ts +0 -0
  54. /package/dist/{lib → src/lib}/text_parsers/fragments.d.ts +0 -0
  55. /package/dist/{lib → src/lib}/text_parsers/helpers.d.ts +0 -0
  56. /package/dist/{lib → src/lib}/text_parsers/numbers.test.d.ts +0 -0
  57. /package/dist/{lib → src/lib}/text_parsers/parsers.d.ts +0 -0
  58. /package/dist/{lib → src/lib}/text_parsers/parsers.test.d.ts +0 -0
  59. /package/dist/{lib → src/lib}/text_parsers/portions.d.ts +0 -0
  60. /package/dist/{lib → src/lib}/text_parsers/portions.test.d.ts +0 -0
  61. /package/dist/{lib → src/lib}/text_parsers/prepositions.d.ts +0 -0
  62. /package/dist/{lib → src/lib}/text_parsers/prepositions.test.d.ts +0 -0
  63. /package/dist/{lib → src/lib}/text_parsers/references.d.ts +0 -0
  64. /package/dist/{lib → src/lib}/text_parsers/references.test.d.ts +0 -0
  65. /package/dist/{lib → src/lib}/text_parsers/relative_locations.d.ts +0 -0
  66. /package/dist/{lib → src/lib}/text_parsers/relative_locations.test.d.ts +0 -0
  67. /package/dist/{lib → src/lib}/text_parsers/search_queries.d.ts +0 -0
  68. /package/dist/{lib → src/lib}/text_parsers/search_queries.test.d.ts +0 -0
  69. /package/dist/{lib → src/lib}/text_parsers/separators.d.ts +0 -0
  70. /package/dist/{lib → src/lib}/text_parsers/simplifiers.d.ts +0 -0
  71. /package/dist/{lib → src/lib}/text_parsers/simplifiers.test.d.ts +0 -0
  72. /package/dist/{lib → src/lib}/text_parsers/texts.d.ts +0 -0
  73. /package/dist/{lib → src/lib}/text_parsers/texts.test.d.ts +0 -0
  74. /package/dist/{lib → src/lib}/text_parsers/transformers.d.ts +0 -0
  75. /package/dist/{lib → src/lib}/text_parsers/typography.d.ts +0 -0
  76. /package/dist/{lib → src/lib}/text_parsers/typography.test.d.ts +0 -0
  77. /package/dist/{lib → src/lib}/textes.d.ts +0 -0
  78. /package/dist/{scripts → src/scripts}/add_links_to_assemblee_parsed_documents.d.ts +0 -0
  79. /package/dist/{scripts → src/scripts}/add_links_to_html_document.d.ts +0 -0
  80. /package/dist/{scripts → src/scripts}/add_links_to_legifrance.d.ts +0 -0
  81. /package/dist/{scripts → src/scripts}/add_links_to_senat_parsed_documents.d.ts +0 -0
  82. /package/dist/{scripts → src/scripts}/add_positions_to_table_of_contents.d.ts +0 -0
  83. /package/dist/{scripts → src/scripts}/add_references_to_html_document.d.ts +0 -0
  84. /package/dist/{scripts → src/scripts}/associate_jorf_textes_with_assemblee_commissions.d.ts +0 -0
  85. /package/dist/{scripts → src/scripts}/associate_jorf_textes_with_dossiers_legislatifs_assemblee.d.ts +0 -0
  86. /package/dist/{scripts → src/scripts}/configure.d.ts +0 -0
  87. /package/dist/{scripts → src/scripts}/enrich_assemblee_documents.d.ts +0 -0
  88. /package/dist/{scripts/extract_texts_titles_infos.d.ts → src/scripts/enrich_senat_documents.d.ts} +0 -0
  89. /package/dist/{scripts → src/scripts}/extract_alineas_images.d.ts +0 -0
  90. /package/dist/{scripts/html_document_to_text.d.ts → src/scripts/extract_texts_titles_infos.d.ts} +0 -0
  91. /package/dist/{scripts → src/scripts}/generate_alineas_numbers_review.d.ts +0 -0
  92. /package/dist/{scripts/simplified_html_bill_to_table_of_contents.d.ts → src/scripts/html_document_to_text.d.ts} +0 -0
  93. /package/dist/{scripts → src/scripts}/index_typesense.d.ts +0 -0
  94. /package/dist/{scripts → src/scripts}/merge_reviewed_alineas_numbers.d.ts +0 -0
  95. /package/dist/{scripts → src/scripts}/set_articles_missing_num.d.ts +0 -0
  96. /package/dist/{scripts/simplify_word_html.d.ts → src/scripts/simplified_html_bill_to_table_of_contents.d.ts} +0 -0
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-DfrdIKTl.js";
1
+ import { $ as e, a as t, g as n, gn as r, o as i, t as a } from "./html-Ds2IZ1nn.js";
2
2
  import * as o from "node:crypto";
3
3
  import s from "fs-extra";
4
4
  import c from "node:path";
@@ -1,6 +1,6 @@
1
- import { PortionSelector } from './article_portions.js';
2
- import { ActionTarget, TextAstReference } from '../text_parsers/ast.js';
3
- import { FragmentPosition } from '../text_parsers/fragments.js';
1
+ import { PortionSelector } from '../../../lib/extractors/article_portions.js';
2
+ import { ActionTarget, TextAstReference } from '../../../lib/text_parsers/ast.js';
3
+ import { FragmentPosition } from '../../../lib/text_parsers/fragments.js';
4
4
  export type ActionDirective = {
5
5
  kind: "insert_after" | "insert_before";
6
6
  targetType: ActionTarget;
@@ -33,6 +33,7 @@ export type ActionDirective = {
33
33
  reference: TextAstReference;
34
34
  portionSelectors: PortionSelector[];
35
35
  targetText: string;
36
+ occurrenceIndex?: number;
36
37
  sourcePosition: FragmentPosition;
37
38
  sourceText: string;
38
39
  } | {
@@ -1,4 +1,4 @@
1
- import { DivisionType, PortionType, TextAstLocalization, TextAstReference } from '../text_parsers/ast.js';
1
+ import { DivisionType, PortionType, TextAstLocalization, TextAstReference } from '../../../lib/text_parsers/ast.js';
2
2
  export type PortionSelectorStep = {
3
3
  type: PortionType | DivisionType;
4
4
  index?: number;
@@ -0,0 +1,3 @@
1
+ import { TextAstArticle, TextAstDivision } from '../../../lib/text_parsers/ast.js';
2
+ import { TextParserContext } from '../../../lib/text_parsers/parsers.js';
3
+ export declare function extractBillDefinitions(context: TextParserContext): Generator<TextAstArticle | TextAstDivision, void, unknown>;
@@ -1,8 +1,8 @@
1
1
  import { Sql } from 'postgres';
2
- import { TextAstArticle, TextAstDivision, TextAstPosition, TextAstReference, TextAstText } from '../text_parsers/ast.js';
3
- import { FragmentPosition, FragmentReverseTransformation } from '../text_parsers/fragments.js';
4
- import { TextParserContext } from '../text_parsers/parsers.js';
5
- import { Transformation } from '../text_parsers/transformers.js';
2
+ import { TextAstArticle, TextAstDivision, TextAstPosition, TextAstReference, TextAstText } from '../../../lib/text_parsers/ast.js';
3
+ import { FragmentPosition, FragmentReverseTransformation } from '../../../lib/text_parsers/fragments.js';
4
+ import { TextParserContext } from '../../../lib/text_parsers/parsers.js';
5
+ import { Transformation } from '../../../lib/text_parsers/transformers.js';
6
6
  export type DefinitionOrLink = ArticleDefinition | ArticleLink | DivisionLink | TextLink;
7
7
  export interface ArticleDefinition {
8
8
  article: TextAstArticle;
@@ -1,6 +1,6 @@
1
- import { TextAstCitation, TextAstReference } from '../text_parsers/ast.js';
2
- import { TextParserContext } from '../text_parsers/parsers.js';
3
- import { Transformation } from '../text_parsers/transformers.js';
1
+ import { TextAstCitation, TextAstReference } from '../../../lib/text_parsers/ast.js';
2
+ import { TextParserContext } from '../../../lib/text_parsers/parsers.js';
3
+ import { Transformation } from '../../../lib/text_parsers/transformers.js';
4
4
  export declare function extractCitationReferences(context: TextParserContext, citation: TextAstCitation): Generator<TextAstReference, void>;
5
5
  export declare function extractReferences(context: TextParserContext): Generator<TextAstReference, void>;
6
6
  export declare function extractReferencesWithOriginalTransformations(context: TextParserContext, transformation: Transformation): Generator<TextAstReference, void>;
@@ -1,7 +1,7 @@
1
- import { DivisionType } from '../text_parsers/ast.js';
2
- import { FragmentPosition, FragmentReverseTransformation } from '../text_parsers/fragments.js';
3
- import { TextParserContext } from '../text_parsers/parsers.js';
4
- import { Transformation } from '../text_parsers/transformers.js';
1
+ import { DivisionType } from '../../../lib/text_parsers/ast.js';
2
+ import { FragmentPosition, FragmentReverseTransformation } from '../../../lib/text_parsers/fragments.js';
3
+ import { TextParserContext } from '../../../lib/text_parsers/parsers.js';
4
+ import { Transformation } from '../../../lib/text_parsers/transformers.js';
5
5
  export interface TableOfContents {
6
6
  articles?: TableOfContentsArticle[];
7
7
  divisions?: TableOfContentsDivision[];
@@ -1,8 +1,8 @@
1
1
  import { Sql } from 'postgres';
2
- import { DefinitionOrLink, TextLinksParserState } from '../extractors/links.js';
3
- import { LinkType } from '../links.js';
4
- import { TextParserContext } from '../text_parsers/parsers.js';
5
- import { Transformation } from '../text_parsers/transformers.js';
2
+ import { DefinitionOrLink, TextLinksParserState } from '../../../lib/extractors/links.js';
3
+ import { LinkType } from '../../../lib/links.js';
4
+ import { TextParserContext } from '../../../lib/text_parsers/parsers.js';
5
+ import { Transformation } from '../../../lib/text_parsers/transformers.js';
6
6
  export declare function addLinksToHtml({ canutesDb, date, html, linkBaseUrl, linkType, logIgnoredReferencesTypes, logPartialReferences, logReferences, onLink, previousContext, state, }: {
7
7
  canutesDb: Sql;
8
8
  date: string;
@@ -1,6 +1,6 @@
1
1
  import { Sql } from 'postgres';
2
- import { LinkType } from '../links.js';
3
- import { TextParserContext } from '../text_parsers/parsers.js';
2
+ import { LinkType } from '../../../lib/links.js';
3
+ import { TextParserContext } from '../../../lib/text_parsers/parsers.js';
4
4
  export declare function addLinksToMarkdown({ canutesDb, date, linkBaseUrl, linkType, previousContext, text, }: {
5
5
  canutesDb: Sql;
6
6
  date: string;
@@ -1,6 +1,6 @@
1
1
  import { Document, DossierParlementaire } from '@tricoteuses/assemblee';
2
2
  import { Sql } from 'postgres';
3
- import { AssembleeObjectCache } from '../cache.js';
3
+ import { AssembleeObjectCache } from '../../../lib/cache.js';
4
4
  export declare function getOrLoadDocument(canutesDb: Sql, assembleeObjectCache: AssembleeObjectCache, uid: string): Promise<Document | undefined>;
5
5
  export declare function getOrLoadDocumentsByDossierParlementaireUid(canutesDb: Sql, assembleeObjectCache: AssembleeObjectCache, dossierUid: string): Promise<Document[]>;
6
6
  export declare function getOrLoadDossierParlementaire(canutesDb: Sql, assembleeObjectCache: AssembleeObjectCache, uid: string): Promise<DossierParlementaire | undefined>;
@@ -1,6 +1,6 @@
1
1
  import { Jo, JorfArticle, JorfSectionTa, JorfTextelr, JorfTexteVersion, LegiArticle, LegiSectionTa, LegiTextelr, LegiTexteVersion } from '@tricoteuses/legifrance';
2
2
  import { PendingQuery, Row, Sql } from 'postgres';
3
- import { LegifranceObjectCache } from '../cache.js';
3
+ import { LegifranceObjectCache } from '../../../lib/cache.js';
4
4
  export interface ArticleExtension {
5
5
  num?: string;
6
6
  }
@@ -0,0 +1 @@
1
+ export declare function validateConfig(data: unknown): [unknown, unknown];
@@ -1,4 +1,4 @@
1
- import { LinkType } from '../links';
1
+ import { LinkType } from '../../../lib/links';
2
2
  export interface Config {
3
3
  canutesDb: DatabaseConfig;
4
4
  linkBaseUrl: string;
@@ -1,4 +1,4 @@
1
- import { LinkType } from '../../links.js';
1
+ import { LinkType } from '../../../../lib/links.js';
2
2
  import { Sql } from 'postgres';
3
3
  export declare function addLinksOrReferencesToHtmlFile({ canutesDb, date, defaultTextId, htmlFilePath, htmlTransformationsInputDir, htmlTransformationsOutputDir, htmlWithLinksFilePath, htmlWithLinksOrReferencesFilePath, htmlWithLinksTransformationsOutputDir, htmlWithReferencesFilePath, linkBaseUrl, linkType, logIgnoredReferencesTypes, logPartialReferences, logReferences, referredLegifranceTextsInfosFilePath, }: {
4
4
  canutesDb: Sql;
@@ -1,3 +1,3 @@
1
- import { Transformation } from '../../text_parsers/transformers.js';
1
+ import { Transformation } from '../../../../lib/text_parsers/transformers.js';
2
2
  export declare function readTransformation(inputDocument: string, transformationDir: string): Transformation;
3
3
  export declare function writeTransformation(transformation: Transformation, transformationDir: string, indexesPath?: string): void;
@@ -16,4 +16,9 @@ export declare const adjectifNumeralCardinalLong: import('./parsers.js').TextPar
16
16
  export declare const adjectifNumeralCardinal: import('./parsers.js').TextParser<TextAst>;
17
17
  export declare const adjectifNumeralOrdinalLong: import('./parsers.js').TextParser<TextAst>;
18
18
  export declare const adjectifNumeralOrdinal: import('./parsers.js').TextParser<TextAst>;
19
+ export declare const multiplicativeLatinSuffixes: Array<{
20
+ pattern: string;
21
+ value: number;
22
+ }>;
23
+ export declare const multiplicativeLatinSuffixPattern: string;
19
24
  export declare const adverbeMultiplicatifLatin: import('./parsers.js').TextParser<TextAst>;
@@ -0,0 +1 @@
1
+ export {};
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.11.0",
4
+ "version": "0.12.1",
5
5
  "keywords": [
6
6
  "Assemblée nationale",
7
7
  "France",
@@ -18,7 +18,7 @@
18
18
  "bugs": {
19
19
  "url": "https://git.tricoteuses.fr/logiciels/tricoteuses-juridique/issues"
20
20
  },
21
- "homepage": "https://tricoteuses.fr/",
21
+ "homepage": "https://www.tricoteuses.fr/",
22
22
  "license": "AGPL-3.0-or-later",
23
23
  "repository": {
24
24
  "type": "git",
@@ -37,12 +37,12 @@
37
37
  ".": {
38
38
  "typedoc": "./src/lib/index.ts",
39
39
  "import": "./dist/index.js",
40
- "types": "./dist/lib/index.d.ts"
40
+ "types": "./dist/src/lib/index.d.ts"
41
41
  },
42
42
  "./server": {
43
- "typedoc": "./src/server/index.ts",
43
+ "typedoc": "./src/lib/server/index.ts",
44
44
  "import": "./dist/server.js",
45
- "types": "./dist/lib/server/index.d.ts"
45
+ "types": "./dist/src/lib/server/index.d.ts"
46
46
  },
47
47
  "./package.json": "./package.json"
48
48
  },
@@ -63,10 +63,9 @@
63
63
  "test:unit": "vitest"
64
64
  },
65
65
  "devDependencies": {
66
- "@auditors/core": "^0.7.4",
67
66
  "@tricoteuses/assemblee": "^3.2.0",
68
- "@tricoteuses/legifrance": "^0.18.0",
69
- "@tricoteuses/senat": "^2.22.16",
67
+ "@tricoteuses/legifrance": "^0.18.5",
68
+ "@tricoteuses/senat": "^3.0.1",
70
69
  "@types/fs-extra": "^11.0.4",
71
70
  "@types/node": "^25.5.0",
72
71
  "@types/papaparse": "^5.5.2",
@@ -82,10 +81,13 @@
82
81
  "prettier": "^3.8.1",
83
82
  "sade": "^1.8.1",
84
83
  "tsx": "^4.21.0",
85
- "typescript": "^5.9.3",
84
+ "typescript": "^6.0.2",
86
85
  "typesense": "^3.0.4",
87
86
  "vite": "^8.0.3",
88
87
  "vite-plugin-dts": "^4.5.4",
89
88
  "vitest": "^4.1.2"
89
+ },
90
+ "dependencies": {
91
+ "zod": "^4.3.6"
90
92
  }
91
93
  }
@@ -1,3 +0,0 @@
1
- import { TextAstArticle, TextAstDivision } from '../text_parsers/ast.js';
2
- import { TextParserContext } from '../text_parsers/parsers.js';
3
- export declare function extractBillDefinitions(context: TextParserContext): Generator<TextAstArticle | TextAstDivision, void, unknown>;
@@ -1,4 +0,0 @@
1
- import { Audit } from '@auditors/core';
2
- export declare function auditConfig(audit: Audit, dataUnknown: unknown): [unknown, unknown];
3
- export declare function auditDb(audit: Audit, dataUnknown: unknown): [unknown, unknown];
4
- export declare function validateConfig(data: unknown): [unknown, unknown];
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes