@tricoteuses/tisseuse 0.13.3 → 0.13.4
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 +76 -0
- package/dist/index.js +73 -64
- package/dist/server.js +21514 -21262
- package/dist/src/lib/articles.d.ts +18 -4
- package/dist/src/lib/cache.d.ts +2 -1
- package/dist/src/lib/index.d.ts +2 -2
- package/dist/src/lib/loaders/legifrance.d.ts +11 -9
- package/dist/src/lib/server/assemblee_amendment_search.d.ts +13 -0
- package/dist/src/lib/server/assemblee_amendment_search.test.d.ts +1 -0
- package/dist/src/lib/server/assemblee_document_search.d.ts +29 -0
- package/dist/src/lib/server/assemblee_document_search.test.d.ts +1 -0
- package/dist/src/lib/server/databases/index.d.ts +2 -2
- package/dist/src/lib/server/index.d.ts +5 -0
- package/dist/src/lib/server/legifrance_article_search.d.ts +23 -0
- package/dist/src/lib/server/legifrance_article_search.test.d.ts +1 -0
- package/dist/src/lib/server/parsed_bills.d.ts +1 -0
- package/dist/src/lib/server/senat_amendment_search.d.ts +12 -0
- package/dist/src/lib/server/senat_amendment_search.test.d.ts +1 -0
- package/dist/src/lib/server/senat_document_search.d.ts +17 -0
- package/dist/src/lib/server/senat_document_search.test.d.ts +1 -0
- package/dist/src/lib/server/senat_document_sources.d.ts +15 -0
- package/dist/src/lib/textes.d.ts +4 -4
- package/dist/src/scripts/configure_postgres_assemblee_document_triggers.d.ts +1 -0
- package/dist/src/scripts/configure_postgres_senat_document_triggers.d.ts +1 -0
- package/dist/src/scripts/index_postgres_assemblee_amendments.d.ts +1 -0
- package/dist/src/scripts/index_postgres_assemblee_texts.d.ts +1 -0
- package/dist/src/scripts/index_postgres_legifrance_articles.d.ts +1 -0
- package/dist/src/scripts/index_postgres_senat_amendments.d.ts +1 -0
- package/dist/src/scripts/index_postgres_senat_texts.d.ts +1 -0
- package/dist/src/scripts/profile_assemblee_document_parsing.d.ts +1 -0
- package/dist/src/scripts/sync_postgres_assemblee_document_content.d.ts +1 -0
- package/dist/src/scripts/sync_postgres_senat_document_content.d.ts +1 -0
- package/dist/{textes-Enqe3lpa.js → textes-BIJjrNwg.js} +2281 -2271
- package/package.json +16 -2
- /package/dist/src/{scripts/enrich_senat_documents.d.ts → lib/article_temporal_status.test.d.ts} +0 -0
|
@@ -1,14 +1,28 @@
|
|
|
1
|
-
import { JorfArticle, LegiArticle } from '@tricoteuses/legifrance';
|
|
1
|
+
import { JorfArticle, KaliArticle, LegiArticle } from '@tricoteuses/legifrance';
|
|
2
2
|
import { Sql } from 'postgres';
|
|
3
3
|
import { LegifranceObjectCache } from './cache.js';
|
|
4
|
+
export type ArticleTemporalStatus = "dated" | "never_effective" | "open_ended" | "unknown";
|
|
5
|
+
export declare function isLegifranceSentinelDate(value: string | undefined): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Classifies an article's legal applicability period from its raw Légifrance
|
|
8
|
+
* bounds and the start date resolved by getArticleDateDebut. The resolved date
|
|
9
|
+
* is necessary because Légifrance frequently uses a sentinel start date for an
|
|
10
|
+
* otherwise open or dated article. Raw non-sentinel bounds remain authoritative
|
|
11
|
+
* for identifying articles that were never effective.
|
|
12
|
+
*/
|
|
13
|
+
export declare function classifyArticleTemporalStatus({ dateDebut, sourceDateDebut, sourceDateFin, }: {
|
|
14
|
+
dateDebut: string | undefined;
|
|
15
|
+
sourceDateDebut: string | undefined;
|
|
16
|
+
sourceDateFin: string | undefined;
|
|
17
|
+
}): ArticleTemporalStatus;
|
|
4
18
|
/**
|
|
5
19
|
* TODO: Migrate to @tricoteuses/legifrance
|
|
6
20
|
*/
|
|
7
|
-
export declare const getArticleDateDebut: (article: JorfArticle | LegiArticle) => string;
|
|
21
|
+
export declare const getArticleDateDebut: (article: JorfArticle | KaliArticle | LegiArticle) => string;
|
|
8
22
|
/**
|
|
9
23
|
* TODO: Migrate to @tricoteuses/legifrance
|
|
10
24
|
*/
|
|
11
|
-
export declare const getArticleDateSignature: (article: JorfArticle | LegiArticle) => string;
|
|
25
|
+
export declare const getArticleDateSignature: (article: JorfArticle | KaliArticle | LegiArticle) => string;
|
|
12
26
|
/**
|
|
13
27
|
* TODO:
|
|
14
28
|
* - Handle date to filter articles outside date
|
|
@@ -18,4 +32,4 @@ export declare function getOrLoadArticleSiblingId(canutesDb: Sql, legifranceObje
|
|
|
18
32
|
/**
|
|
19
33
|
* TODO: Migrate to @tricoteuses/legifrance
|
|
20
34
|
*/
|
|
21
|
-
export declare const sortArticlesByDate: (dateFromArticle: (article: JorfArticle | LegiArticle) => string) => (article1: JorfArticle | LegiArticle, article2: JorfArticle | LegiArticle) => number;
|
|
35
|
+
export declare const sortArticlesByDate: (dateFromArticle: (article: JorfArticle | KaliArticle | LegiArticle) => string) => (article1: JorfArticle | KaliArticle | LegiArticle, article2: JorfArticle | KaliArticle | LegiArticle) => number;
|
package/dist/src/lib/cache.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import { JorfCategorieTag, LegiCategorieTag } from '@tricoteuses/legifrance';
|
|
|
2
2
|
import { JSONValue } from 'postgres';
|
|
3
3
|
export type AssembleeObjectType = "Document" | "DossierParlementaire";
|
|
4
4
|
export type AssembleeObjectCache = Map<AssembleeObjectType, Map<string, JSONValue>>;
|
|
5
|
-
export type
|
|
5
|
+
export type LegifranceObjectType = JorfCategorieTag | LegiCategorieTag | "TEXTEKALI";
|
|
6
|
+
export type LegifranceObjectCache = Map<LegifranceObjectType, Map<string, JSONValue>>;
|
|
6
7
|
export type ObjectCache = {
|
|
7
8
|
assemblee: AssembleeObjectCache;
|
|
8
9
|
legifrance: LegifranceObjectCache;
|
package/dist/src/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { addLinksToMarkdown } from './linkers/markdown.js';
|
|
2
|
-
export { getArticleDateDebut, getArticleDateSignature, getOrLoadArticleSiblingId, sortArticlesByDate, } from './articles.js';
|
|
2
|
+
export { classifyArticleTemporalStatus, getArticleDateDebut, getArticleDateSignature, getOrLoadArticleSiblingId, isLegifranceSentinelDate, sortArticlesByDate, type ArticleTemporalStatus, } from './articles.js';
|
|
3
3
|
export { assertNever } from './asserts.js';
|
|
4
4
|
export { newAssembleeObjectCache, newLegifranceObjectCache, newObjectCache, type AssembleeObjectCache, type AssembleeObjectType, type LegifranceObjectCache, type ObjectCache, } from './cache.js';
|
|
5
5
|
export { formatLongDate } from './dates.js';
|
|
@@ -19,7 +19,7 @@ export declare const addLinksToText: typeof addLinksToMarkdown;
|
|
|
19
19
|
export { addLinksToMarkdown };
|
|
20
20
|
export { linkTypes, urlFromLegalId, type LinkType } from './links.js';
|
|
21
21
|
export { getOrLoadDocument, getOrLoadDocumentsByDossierParlementaireUid, getOrLoadDossierParlementaire, } from './loaders/assemblee.js';
|
|
22
|
-
export { extendLoadedArticle, getOrLoadArticle, getOrLoadJo, getOrLoadSectionTa, getOrLoadSectionsTa, getOrLoadTextelr, getOrLoadTexteslr, getOrLoadTextesVersions, getOrLoadTexteVersion, loadArticles, type ArticleExtension, type JorfArticleExtended, type LegiArticleExtended, } from './loaders/legifrance.js';
|
|
22
|
+
export { extendLoadedArticle, getOrLoadArticle, getOrLoadJo, getOrLoadSectionTa, getOrLoadSectionsTa, getOrLoadTextelr, getOrLoadTextekali, getOrLoadTexteslr, getOrLoadTextesVersions, getOrLoadTexteVersion, loadArticles, type ArticleExtension, type JorfArticleExtended, type KaliArticleExtended, type LegiArticleExtended, } from './loaders/legifrance.js';
|
|
23
23
|
export { action } from './text_parsers/actions.js';
|
|
24
24
|
export { actionDirective } from './text_parsers/action_directives.js';
|
|
25
25
|
export { article, articles, definitionArticleDansCitation, definitionArticleDansProjetOuPropositionLoi, designationArticle, listeArticles, nomArticle, nomSpecialArticle, } from './text_parsers/articles.js';
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { Jo, JorfArticle, JorfSectionTa, JorfTextelr, JorfTexteVersion, LegiArticle, LegiSectionTa, LegiTextelr, LegiTexteVersion } from '@tricoteuses/legifrance';
|
|
1
|
+
import { Jo, JorfArticle, JorfSectionTa, JorfTextelr, JorfTexteVersion, KaliArticle, KaliSectionTa, KaliTextekali, KaliTexteVersion, LegiArticle, LegiSectionTa, LegiTextelr, LegiTexteVersion } from '@tricoteuses/legifrance';
|
|
2
2
|
import { PendingQuery, Row, Sql } from 'postgres';
|
|
3
3
|
import { LegifranceObjectCache } from '../cache.js';
|
|
4
4
|
export interface ArticleExtension {
|
|
5
5
|
num?: string;
|
|
6
6
|
}
|
|
7
7
|
export type JorfArticleExtended = JorfArticle & ArticleExtension;
|
|
8
|
+
export type KaliArticleExtended = KaliArticle & ArticleExtension;
|
|
8
9
|
export type LegiArticleExtended = LegiArticle & ArticleExtension;
|
|
9
|
-
export declare function extendLoadedArticle<ArticleType extends JorfArticle | LegiArticle>({ data: article, num, }: {
|
|
10
|
+
export declare function extendLoadedArticle<ArticleType extends JorfArticle | KaliArticle | LegiArticle>({ data: article, num, }: {
|
|
10
11
|
data: ArticleType;
|
|
11
12
|
num: string | null;
|
|
12
13
|
}): 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>>;
|
|
14
|
+
export declare function getOrLoadArticle<ArticleType extends JorfArticle | KaliArticle | LegiArticle>(canutesDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string): Promise<(ArticleType & ArticleExtension) | undefined>;
|
|
15
|
+
export declare function getOrLoadArticles<ArticleType extends JorfArticle | KaliArticle | LegiArticle>(canutesDb: Sql, legifranceObjectCache: LegifranceObjectCache, ids: string[]): Promise<Array<ArticleType & ArticleExtension>>;
|
|
15
16
|
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[]>;
|
|
17
|
+
export declare function getOrLoadSectionTa<SectionTaType extends JorfSectionTa | KaliSectionTa | LegiSectionTa>(canutesDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string): Promise<SectionTaType | undefined>;
|
|
18
|
+
export declare function getOrLoadSectionsTa<SectionTaType extends JorfSectionTa | KaliSectionTa | LegiSectionTa>(canutesDb: Sql, legifranceObjectCache: LegifranceObjectCache, ids: string[]): Promise<SectionTaType[]>;
|
|
18
19
|
export declare function getOrLoadTextelr<TextelrType extends JorfTextelr | LegiTextelr>(canutesDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string): Promise<TextelrType | undefined>;
|
|
20
|
+
export declare function getOrLoadTextekali(canutesDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string): Promise<KaliTextekali | undefined>;
|
|
19
21
|
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>>;
|
|
22
|
+
export declare function getOrLoadTextesVersions<TexteVersionType extends JorfTexteVersion | KaliTexteVersion | LegiTexteVersion>(canutesDb: Sql, legifranceObjectCache: LegifranceObjectCache, ids: string[]): Promise<Array<TexteVersionType>>;
|
|
23
|
+
export declare function getOrLoadTexteVersion<TexteVersionType extends JorfTexteVersion | KaliTexteVersion | LegiTexteVersion>(canutesDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string): Promise<TexteVersionType | undefined>;
|
|
24
|
+
export declare function loadArticles<ArticleType extends JorfArticle | KaliArticle | LegiArticle>(canutesDb: Sql, legifranceObjectCache: LegifranceObjectCache, whereClause: PendingQuery<Row[]> | Array<PendingQuery<Row[]>>): Promise<Array<ArticleType & ArticleExtension>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type AssembleeAmendmentSearchItemKind = "dispositif" | "expose_sommaire";
|
|
2
|
+
export interface AssembleeAmendmentSearchItem {
|
|
3
|
+
content: string;
|
|
4
|
+
itemKind: AssembleeAmendmentSearchItemKind;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Keeps the amending wording separate from the author's explanatory statement:
|
|
9
|
+
* they have different parliamentary functions and must remain independently
|
|
10
|
+
* searchable and filterable.
|
|
11
|
+
*/
|
|
12
|
+
export declare function extractAssembleeAmendmentSearchItems(data: unknown): AssembleeAmendmentSearchItem[];
|
|
13
|
+
export declare function hashAssembleeAmendmentSearchItem(item: AssembleeAmendmentSearchItem, metadata: Record<string, string | number | null>): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ParsedBillToc } from './parsed_bills.js';
|
|
2
|
+
export type AssembleeSearchItemKind = "article" | "expose_des_motifs";
|
|
3
|
+
export interface AssembleeSearchItem {
|
|
4
|
+
anchor: string | null;
|
|
5
|
+
articleNumber: string | null;
|
|
6
|
+
content: string;
|
|
7
|
+
itemId: string;
|
|
8
|
+
itemKind: AssembleeSearchItemKind;
|
|
9
|
+
label: string;
|
|
10
|
+
title: string | null;
|
|
11
|
+
}
|
|
12
|
+
export interface ParsedAssembleeDocumentSearchContent {
|
|
13
|
+
items: AssembleeSearchItem[];
|
|
14
|
+
tableOfContents: ParsedBillToc;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Extracts explanatory statements independently from the articles. They are
|
|
18
|
+
* deliberately not added to an article: an exposé explains a whole document
|
|
19
|
+
* and has a different parliamentary authority from its dispositif.
|
|
20
|
+
*/
|
|
21
|
+
export declare function extractAssembleeExposesDesMotifs(html: string): AssembleeSearchItem[];
|
|
22
|
+
export declare function parseAssembleeDocumentSearchContent({ date, html, linkBaseUrl, linkType, }: {
|
|
23
|
+
date?: string;
|
|
24
|
+
html: string;
|
|
25
|
+
linkBaseUrl: string;
|
|
26
|
+
linkType: "Exploratrice" | "Forgejo";
|
|
27
|
+
}): Promise<ParsedAssembleeDocumentSearchContent>;
|
|
28
|
+
export declare function hashAssembleeSearchItem(item: AssembleeSearchItem, metadata: Record<string, string | number | null>): string;
|
|
29
|
+
export declare function isoDateFromAssembleeDocument(data: unknown): string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,8 +5,8 @@ export interface Version {
|
|
|
5
5
|
export declare const canutesDb: postgres.Sql<{}>;
|
|
6
6
|
export declare const assembleeVersionNumber = 7;
|
|
7
7
|
export declare const legiAnomaliesVersionNumber = 1;
|
|
8
|
-
export declare const legiVersionNumber =
|
|
9
|
-
export declare const tisseuseVersionNumber =
|
|
8
|
+
export declare const legiVersionNumber = 23;
|
|
9
|
+
export declare const tisseuseVersionNumber = 10;
|
|
10
10
|
export declare function checkAssembleeDb(): Promise<void>;
|
|
11
11
|
export declare function checkLegiAnomaliesDb(): Promise<void>;
|
|
12
12
|
export declare function checkLegiDb(): Promise<void>;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export { extractAssembleeAmendmentSearchItems, hashAssembleeAmendmentSearchItem, type AssembleeAmendmentSearchItem, type AssembleeAmendmentSearchItemKind, } from './assemblee_amendment_search.js';
|
|
2
|
+
export { extractAssembleeExposesDesMotifs, hashAssembleeSearchItem, isoDateFromAssembleeDocument, parseAssembleeDocumentSearchContent, type AssembleeSearchItem, type AssembleeSearchItemKind, type ParsedAssembleeDocumentSearchContent, } from './assemblee_document_search.js';
|
|
3
|
+
export { extractSenatAmendmentSearchItems, hashSenatAmendmentSearchItem, type SenatAmendmentSearchItem, type SenatAmendmentSearchItemKind, } from './senat_amendment_search.js';
|
|
4
|
+
export { hashSenatSearchItem, parseSenatDocumentSearchContent, type SenatSearchItem, type SenatSearchItemKind, } from './senat_document_search.js';
|
|
5
|
+
export { isAkomaNtosoXml, resolveSenatAkomaNtosoSource, type SenatAkomaNtosoSource, } from './senat_document_sources.js';
|
|
1
6
|
export { simplifyWordHtml, simplifyWordHtmlToDocument, type SimplifyHtmlOptions, } from './html_simplifier.js';
|
|
2
7
|
export { addLinksOrReferencesToHtmlFile } from './linkers/html.js';
|
|
3
8
|
export { linkAkomaNtosoBillRaw, linkAssembleeBillRaw, parseAkomaNtosoBillRaw, parseAssembleeBillRaw, renderAkomaNtosoBillRaw, type LinkedBillDocument, type ParsedBillArticle, type ParsedBillBlock, type ParsedBillBlockKind, type ParsedBillDirective, type ParsedBillDocument, type ParsedBillLink, type ParsedBillSourceFormat, type ParsedBillToc, type ParseBillRawOptions, } from './parsed_bills.js';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ArticleTemporalStatus } from '../articles.js';
|
|
2
|
+
export interface LegifranceArticleSearchDocument {
|
|
3
|
+
articleNumber: string | null;
|
|
4
|
+
content: string;
|
|
5
|
+
dateDebut: string | null;
|
|
6
|
+
dateFin: string | null;
|
|
7
|
+
id: string;
|
|
8
|
+
sourceDateDebut: string | null;
|
|
9
|
+
sourceDateFin: string | null;
|
|
10
|
+
temporalStatus: ArticleTemporalStatus;
|
|
11
|
+
nota: string | null;
|
|
12
|
+
sourceHash: string;
|
|
13
|
+
texteCid: string | null;
|
|
14
|
+
texteNature: string | null;
|
|
15
|
+
texteTitle: string | null;
|
|
16
|
+
}
|
|
17
|
+
export declare function cleanLegifranceHtml(html: string | null | undefined): string;
|
|
18
|
+
export declare function createLegifranceArticleSearchDocument({ data, id, linkedBlocTextuel, linkedNota, }: {
|
|
19
|
+
data: unknown;
|
|
20
|
+
id: string;
|
|
21
|
+
linkedBlocTextuel: string | null;
|
|
22
|
+
linkedNota: string | null;
|
|
23
|
+
}): LegifranceArticleSearchDocument | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -73,6 +73,7 @@ export type ParsedBillInternalArticleDefinition = ParsedBillInternalArticleTarge
|
|
|
73
73
|
export type ParseBillRawOptions = {
|
|
74
74
|
canutesDb?: Sql;
|
|
75
75
|
date?: string;
|
|
76
|
+
includeDirectiveAnalysis?: boolean;
|
|
76
77
|
legiResolver?: LegiResolver;
|
|
77
78
|
linkBaseUrl: string;
|
|
78
79
|
linkType: LinkType;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type SenatAmendmentSearchItemKind = "dispositif" | "expose_sommaire";
|
|
2
|
+
export interface SenatAmendmentSearchItem {
|
|
3
|
+
content: string;
|
|
4
|
+
itemKind: SenatAmendmentSearchItemKind;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
/** Keeps the normative wording distinct from the author's explanation. */
|
|
8
|
+
export declare function extractSenatAmendmentSearchItems({ dispositifHtml, objetHtml, }: {
|
|
9
|
+
dispositifHtml: string | null;
|
|
10
|
+
objetHtml: string | null;
|
|
11
|
+
}): SenatAmendmentSearchItem[];
|
|
12
|
+
export declare function hashSenatAmendmentSearchItem(item: SenatAmendmentSearchItem, metadata: Record<string, string | number | null>): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type SenatSearchItemKind = "article" | "expose_des_motifs";
|
|
2
|
+
export interface SenatSearchItem {
|
|
3
|
+
anchor: string | null;
|
|
4
|
+
articleNumber: string | null;
|
|
5
|
+
content: string;
|
|
6
|
+
itemId: string;
|
|
7
|
+
itemKind: SenatSearchItemKind;
|
|
8
|
+
label: string;
|
|
9
|
+
title: string | null;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Extracts searchable fragments from the stable HTML rendered from an Akoma
|
|
13
|
+
* Ntoso document. This deliberately does not need the original XML, allowing
|
|
14
|
+
* ordinary reindexing to stay entirely inside PostgreSQL.
|
|
15
|
+
*/
|
|
16
|
+
export declare function parseSenatDocumentSearchContent(html: string): SenatSearchItem[];
|
|
17
|
+
export declare function hashSenatSearchItem(item: SenatSearchItem, metadata: Record<string, string | number | null>): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type SenatAkomaNtosoSource = {
|
|
2
|
+
akomaNtosoUrl: string;
|
|
3
|
+
publicUrl: string;
|
|
4
|
+
status: "available";
|
|
5
|
+
} | {
|
|
6
|
+
publicUrl: string | null;
|
|
7
|
+
status: "no_url" | "unsupported_source";
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Resolves a `dosleg_texte.texurl` value to the institutional Akoma Ntoso
|
|
11
|
+
* endpoint. Sénat's `/leg/*.xml` path is not the Akoma endpoint and can
|
|
12
|
+
* return an HTML error page with a successful HTTP status.
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveSenatAkomaNtosoSource(value: string | null | undefined): SenatAkomaNtosoSource;
|
|
15
|
+
export declare function isAkomaNtosoXml(value: string): boolean;
|
package/dist/src/lib/textes.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { JorfTexteVersion, LegiTexteVersion } from '@tricoteuses/legifrance';
|
|
1
|
+
import { JorfTexteVersion, KaliTexteVersion, LegiTexteVersion } from '@tricoteuses/legifrance';
|
|
2
2
|
export declare const cleanTexteTitle: <StringOrUndefined extends string | undefined>(title: StringOrUndefined) => StringOrUndefined;
|
|
3
3
|
/**
|
|
4
4
|
* TODO: Migrate to @tricoteuses/legifrance
|
|
5
5
|
*/
|
|
6
|
-
export declare const getTexteVersionDateDebut: (texteVersion: JorfTexteVersion | LegiTexteVersion) => string;
|
|
6
|
+
export declare const getTexteVersionDateDebut: (texteVersion: JorfTexteVersion | KaliTexteVersion | LegiTexteVersion) => string;
|
|
7
7
|
/**
|
|
8
8
|
* TODO: Migrate to @tricoteuses/legifrance
|
|
9
9
|
*/
|
|
10
|
-
export declare const getTexteVersionDateSignature: (texteVersion: JorfTexteVersion | LegiTexteVersion) => string;
|
|
10
|
+
export declare const getTexteVersionDateSignature: (texteVersion: JorfTexteVersion | KaliTexteVersion | LegiTexteVersion) => string;
|
|
11
11
|
/**
|
|
12
12
|
* TODO: Migrate to @tricoteuses/legifrance
|
|
13
13
|
*/
|
|
14
|
-
export declare const sortTextesVersionsByDate: (dateFromTexteVersion: (texteVersion: JorfTexteVersion | LegiTexteVersion) => string) => (texteVersion1: JorfTexteVersion | LegiTexteVersion, texteVersion2: JorfTexteVersion | LegiTexteVersion) => number;
|
|
14
|
+
export declare const sortTextesVersionsByDate: (dateFromTexteVersion: (texteVersion: JorfTexteVersion | KaliTexteVersion | LegiTexteVersion) => string) => (texteVersion1: JorfTexteVersion | KaliTexteVersion | LegiTexteVersion, texteVersion2: JorfTexteVersion | KaliTexteVersion | LegiTexteVersion) => number;
|
|
@@ -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 {};
|