@tricoteuses/tisseuse 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -0
- package/dist/{html-C07GdZ0O.js → html-jaUHsXKQ.js} +5810 -5370
- package/dist/index.js +126 -126
- package/dist/{resolver-4v_fWVor.js → resolver-CzmDH4S3.js} +138 -130
- package/dist/server-f-legi.js +73 -92
- package/dist/server.js +554 -516
- package/dist/src/lib/extractors/action_directives_cpu.test.d.ts +1 -0
- package/dist/src/lib/extractors/links.citation_scope.test.d.ts +1 -0
- package/dist/src/lib/extractors/portion_references_cpu.test.d.ts +1 -0
- package/dist/src/lib/extractors/references.d.ts +8 -8
- package/dist/src/lib/f_legi/resolver.d.ts +0 -2
- package/dist/src/lib/index.d.ts +1 -0
- package/dist/src/lib/legi/canutes_article_preload.test.d.ts +1 -0
- package/dist/src/lib/legi/canutes_candidates.test.d.ts +1 -0
- package/dist/src/lib/legi/canutes_resolver.d.ts +5 -4
- package/dist/src/lib/legi/canutes_resolver_cache.test.d.ts +1 -0
- package/dist/src/lib/legi/canutes_section_roots.test.d.ts +1 -0
- package/dist/src/lib/legi/canutes_sql.d.ts +4 -0
- package/dist/src/lib/legi/canutes_text_titles_cache.d.ts +24 -0
- package/dist/src/lib/legi/canutes_text_titles_cache.integration.test.d.ts +1 -0
- package/dist/src/lib/legi/canutes_titles_metrics.d.ts +13 -0
- package/dist/src/lib/legi/text_titles_infos.d.ts +1 -0
- package/dist/src/lib/linkers/html.d.ts +3 -3
- package/dist/src/lib/linkers/markdown.d.ts +2 -2
- package/dist/src/lib/server/akn_rendering.test.d.ts +1 -0
- package/dist/src/lib/server/bill_action_resolver_invariance.test.d.ts +1 -0
- package/dist/src/lib/server/bill_action_target_fixtures.d.ts +7 -0
- package/dist/src/lib/server/bill_citation_anaphora.test.d.ts +1 -0
- package/dist/src/lib/server/bill_comparison.d.ts +42 -0
- package/dist/src/lib/server/bill_comparison.test.d.ts +1 -0
- package/dist/src/lib/server/bill_target_scope.test.d.ts +1 -0
- package/dist/src/lib/server/canutes_legacy_candidates.d.ts +19 -0
- package/dist/src/lib/server/canutes_only_compatibility.test.d.ts +1 -0
- package/dist/src/lib/server/databases/canutes_text_titles_cache.d.ts +8 -0
- package/dist/src/lib/server/flegi_profiling.d.ts +14 -0
- package/dist/src/lib/server/flegi_profiling.test.d.ts +1 -0
- package/dist/src/lib/server/masquage-typesense.test.d.ts +1 -0
- package/dist/src/lib/server/masquage_typesense.d.ts +36 -0
- package/dist/src/lib/server/sql_profiling.d.ts +30 -0
- package/dist/src/lib/server/sql_profiling.test.d.ts +1 -0
- package/dist/src/lib/text_parsers/action_words.d.ts +2 -0
- package/dist/src/lib/text_parsers/action_words.test.d.ts +1 -0
- package/dist/src/lib/text_parsers/texts.d.ts +1 -0
- package/dist/src/scripts/compare_legi_bills.d.ts +1 -0
- package/dist/src/scripts/configure_postgres_legi_resolver.d.ts +1 -0
- package/dist/src/scripts/profile_canutes_bill.d.ts +1 -0
- package/dist/src/scripts/test_canutes_titles_cache.d.ts +1 -0
- package/dist/src/scripts/warm_canutes_text_titles_cache.d.ts +1 -0
- package/package.json +7 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,15 +5,15 @@ export type ExtractReferencesDiagnostics = {
|
|
|
5
5
|
citationCount: number;
|
|
6
6
|
fastPath: FastPathExtractDiagnostics;
|
|
7
7
|
};
|
|
8
|
-
|
|
9
|
-
diagnostics?: ExtractReferencesDiagnostics;
|
|
10
|
-
}): Generator<TextAstReference, void>;
|
|
11
|
-
export declare function extractReferences(context: TextParserContext, options?: {
|
|
8
|
+
type ExtractReferencesOptions = {
|
|
12
9
|
diagnostics?: ExtractReferencesDiagnostics;
|
|
13
10
|
overlapWindowForCandidate?: (anchor: string) => number;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
/** Scoping metadata for flattened standalone quotations; never added to the AST. */
|
|
12
|
+
onStandaloneCitationReference?: (reference: TextAstReference, citation: TextAstCitation) => void;
|
|
13
|
+
};
|
|
14
|
+
export declare function extractCitationReferences(context: TextParserContext, citation: TextAstCitation, options?: ExtractReferencesOptions): Generator<TextAstReference, void>;
|
|
15
|
+
export declare function extractReferences(context: TextParserContext, options?: ExtractReferencesOptions): Generator<TextAstReference, void>;
|
|
16
|
+
export declare function extractReferencesWithOriginalTransformations(context: TextParserContext, transformation: Transformation, options?: ExtractReferencesOptions): Generator<TextAstReference, void>;
|
|
18
17
|
export declare const getExtractedReferences: (context: TextParserContext) => TextAstReference[];
|
|
19
18
|
export declare const getExtractedReferencesWithOriginalTransformations: (context: TextParserContext, transformation: Transformation) => TextAstReference[];
|
|
19
|
+
export {};
|
|
@@ -45,13 +45,11 @@ export declare class FlegiResolver extends LegiResolver {
|
|
|
45
45
|
private queryUniqueActiveArticlesByNumsUsingContextHeuristic;
|
|
46
46
|
private queryGloballyUniqueArticleRowsByNums;
|
|
47
47
|
private getActiveArticleRowsByNum;
|
|
48
|
-
private getActiveArticleRowsForContextTextIds;
|
|
49
48
|
private getActiveArticleRowsForContextTextIdsWithRoots;
|
|
50
49
|
private queryActiveArticleRowsForContextTextIds;
|
|
51
50
|
private preloadDirectSectionChildrenByRootPath;
|
|
52
51
|
private getTextIdFromSegmentIdUsingContextHeuristic;
|
|
53
52
|
private getTextIdFromSegmentIdUsingSctaHeuristic;
|
|
54
|
-
private getContextTextIdsFromTextId;
|
|
55
53
|
private getContextTextIdsByTextIds;
|
|
56
54
|
private getRootTextIdsFromTextId;
|
|
57
55
|
private getRootTextIdsByTextIds;
|
package/dist/src/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { addLinksToMarkdown } from './linkers/markdown.js';
|
|
2
2
|
export { classifyArticleTemporalStatus, getArticleDateDebut, getArticleDateSignature, getOrLoadArticleSiblingId, isLegifranceSentinelDate, sortArticlesByDate, type ArticleTemporalStatus, } from './articles.js';
|
|
3
3
|
export { assertNever } from './asserts.js';
|
|
4
|
+
export { startCanutesTitlesMetrics } from './legi/canutes_titles_metrics.js';
|
|
4
5
|
export { newAssembleeObjectCache, newLegifranceObjectCache, newObjectCache, type AssembleeObjectCache, type AssembleeObjectType, type LegifranceObjectCache, type ObjectCache, } from './cache.js';
|
|
5
6
|
export { formatLongDate } from './dates.js';
|
|
6
7
|
export { extractBillDefinitions } from './extractors/definitions.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LegiResolver, LegiArticleHistoryInfo, LegiArticleInfo, LegiSectionInfo, PreloadTextTitlesInfosOptions } from './resolver.js';
|
|
1
|
+
import { CanutesSql } from './canutes_sql.js';
|
|
2
|
+
import { LegiResolver, LegiArticleHistoryInfo, LegiArticleInfo, LegiSectionInfo, PreloadActiveArticlesByTextIdsOptions, PreloadTextTitlesInfosOptions } from './resolver.js';
|
|
3
3
|
/**
|
|
4
4
|
* Minimal structural view of a Légifrance article row needed to compute an
|
|
5
5
|
* article history entry point; shared with the audit preload.
|
|
@@ -23,17 +23,18 @@ export declare class CanutesResolver extends LegiResolver {
|
|
|
23
23
|
private readonly canutesDb;
|
|
24
24
|
private readonly articleHistoryInfoByTextAndNum;
|
|
25
25
|
private readonly articleRowsByNumByTextAndDate;
|
|
26
|
+
private readonly articleNumsLoadedByTextAndDate;
|
|
26
27
|
private readonly directSectionChildrenByParentAndDate;
|
|
27
28
|
private readonly globalArticleRowsByNumAndDate;
|
|
28
29
|
private readonly europeanTextUrlByTitleId;
|
|
29
30
|
private readonly textIdBySegmentId;
|
|
30
|
-
|
|
31
|
-
constructor(canutesDb: Sql);
|
|
31
|
+
constructor(canutesDb: CanutesSql);
|
|
32
32
|
getActiveArticlesByTextAndNum({ date, num, textId, }: {
|
|
33
33
|
date: string;
|
|
34
34
|
num: string | undefined;
|
|
35
35
|
textId: string;
|
|
36
36
|
}): Promise<LegiArticleInfo[]>;
|
|
37
|
+
preloadActiveArticlesByTextIds({ date, nums, textIds, }: PreloadActiveArticlesByTextIdsOptions): Promise<void>;
|
|
37
38
|
getArticleHistoryInfo({ num, textId, }: {
|
|
38
39
|
num: string | undefined;
|
|
39
40
|
textId: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Sql, TransactionSql } from 'postgres';
|
|
2
|
+
export type CanutesSql = Sql | TransactionSql;
|
|
3
|
+
/** Reuse a caller-owned stable snapshot, or open a read-only one on a pool. */
|
|
4
|
+
export declare function withCanutesReadOnlySnapshot<T>(db: CanutesSql, read: (sql: TransactionSql) => Promise<T>): Promise<T>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Sql } from 'postgres';
|
|
2
|
+
import { PreloadTextTitlesInfosOptions } from './resolver.js';
|
|
3
|
+
import { CanutesSql } from './canutes_sql.js';
|
|
4
|
+
import { TextTitlesInfoRow } from './text_titles_infos.js';
|
|
5
|
+
type QuerySql = CanutesSql;
|
|
6
|
+
export type CanutesTitlesCacheMeta = {
|
|
7
|
+
guarded: boolean;
|
|
8
|
+
revision: string | null;
|
|
9
|
+
cacheRevision: string | null;
|
|
10
|
+
formatVersion: number | null;
|
|
11
|
+
generatedAt: string | null;
|
|
12
|
+
sourceRowCount: number | null;
|
|
13
|
+
};
|
|
14
|
+
export declare function readCanutesTitlesCacheMeta(sql: QuerySql): Promise<CanutesTitlesCacheMeta | undefined>;
|
|
15
|
+
export declare function readCanutesTextTitleRows(sql: QuerySql): Promise<TextTitlesInfoRow[]>;
|
|
16
|
+
export declare function preloadCanutesTextTitlesInfos(db: CanutesSql, options?: PreloadTextTitlesInfosOptions): Promise<void>;
|
|
17
|
+
export declare function warmCanutesTextTitlesCache(db: Sql, options?: PreloadTextTitlesInfosOptions & {
|
|
18
|
+
maxAttempts?: number;
|
|
19
|
+
force?: boolean;
|
|
20
|
+
}): Promise<{
|
|
21
|
+
revision: string;
|
|
22
|
+
sourceRowCount: number;
|
|
23
|
+
}>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type Scope = "pool" | "transaction";
|
|
2
|
+
type Path = "metadata" | "source" | "persistent" | "memory" | "coalesced";
|
|
3
|
+
type Outcome = "success" | "error";
|
|
4
|
+
export type CanutesTitlesMetric = {
|
|
5
|
+
path: Path;
|
|
6
|
+
end: (outcome: Outcome) => void;
|
|
7
|
+
};
|
|
8
|
+
/** Start zero-inclusive heartbeats, without enabling general PJL diagnostics.
|
|
9
|
+
* An absolute deadline is mandatory and may be at most 24 hours away.
|
|
10
|
+
*/
|
|
11
|
+
export declare function startCanutesTitlesMetrics(): void;
|
|
12
|
+
export declare function beginCanutesTitlesMetric(sqlScope: Scope): CanutesTitlesMetric | undefined;
|
|
13
|
+
export {};
|
|
@@ -30,6 +30,7 @@ export declare function buildAndInstallTextTitlesInfos(rows: TextTitlesInfoRow[]
|
|
|
30
30
|
onProgress?: (progress: BuildTextTitlesInfosProgress) => void;
|
|
31
31
|
}): Promise<void>;
|
|
32
32
|
export declare function installTextTitlesInfos(textTitlesInfos: TextTitlesInfos): void;
|
|
33
|
+
export declare function isTextTitlesInfosInstalled(textTitlesInfos: TextTitlesInfos): boolean;
|
|
33
34
|
export declare function buildTextTitlesInfos(rows: TextTitlesInfoRow[], { onProgress, }?: {
|
|
34
35
|
onProgress?: (progress: BuildTextTitlesInfosProgress) => void;
|
|
35
36
|
}): Promise<TextTitlesInfos>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CanutesSql } from '../legi/canutes_sql.js';
|
|
2
2
|
import { DefinitionOrLink, TextLinksParserState } from '../extractors/links.js';
|
|
3
3
|
import { LegiResolver } from '../legi/resolver.js';
|
|
4
4
|
import { LinkType } from '../links.js';
|
|
@@ -6,7 +6,7 @@ import { FragmentPosition } from '../text_parsers/fragments.js';
|
|
|
6
6
|
import { TextParserContext } from '../text_parsers/parsers.js';
|
|
7
7
|
import { Transformation } from '../text_parsers/transformers.js';
|
|
8
8
|
export declare function addLinksToHtml({ canutesDb, excludedHtmlRanges, includeInternalArticleLinks, legiResolver: providedLegiResolver, date, html, linkBaseUrl, linkType, logIgnoredReferencesTypes, logPartialReferences, logReferences, onLink, previousContext, state, }: {
|
|
9
|
-
canutesDb?:
|
|
9
|
+
canutesDb?: CanutesSql;
|
|
10
10
|
excludedHtmlRanges?: FragmentPosition[];
|
|
11
11
|
includeInternalArticleLinks?: boolean;
|
|
12
12
|
legiResolver?: LegiResolver;
|
|
@@ -37,7 +37,7 @@ interface HtmlReplacement {
|
|
|
37
37
|
stop: number;
|
|
38
38
|
}
|
|
39
39
|
export declare function addLinksOrReferencesToHtmlPage({ canutesDb, legiResolver: providedLegiResolver, date, defaultTextId, htmlTransformation, inputHtml, linkBaseUrl, linkType, logIgnoredReferencesTypes, logPartialReferences, logReferences, outputTypes: requestedOutputTypes, referredLegifranceTextsInfos, }: {
|
|
40
|
-
canutesDb?:
|
|
40
|
+
canutesDb?: CanutesSql;
|
|
41
41
|
legiResolver?: LegiResolver;
|
|
42
42
|
date: string;
|
|
43
43
|
defaultTextId?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CanutesSql } from '../legi/canutes_sql.js';
|
|
2
2
|
import { LegiResolver } from '../legi/resolver.js';
|
|
3
3
|
import { LinkType } from '../links.js';
|
|
4
4
|
import { TextParserContext } from '../text_parsers/parsers.js';
|
|
5
5
|
export declare function addLinksToMarkdown({ canutesDb, legiResolver: providedLegiResolver, date, linkBaseUrl, linkType, previousContext, text, }: {
|
|
6
|
-
canutesDb?:
|
|
6
|
+
canutesDb?: CanutesSql;
|
|
7
7
|
legiResolver?: LegiResolver;
|
|
8
8
|
date: string;
|
|
9
9
|
linkBaseUrl: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const actionTargetAnchor: (id: string, label: string, type?: string) => string;
|
|
2
|
+
export declare const actionTargetFixtures: {
|
|
3
|
+
name: string;
|
|
4
|
+
paragraphs: string[];
|
|
5
|
+
}[];
|
|
6
|
+
export declare function actionTargetHtml(paragraphs: string[]): string;
|
|
7
|
+
export declare function installActionTargetTitles(): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ParsedBillDirective } from './parsed_bills.js';
|
|
2
|
+
export type SavedBillOutput = {
|
|
3
|
+
html: string;
|
|
4
|
+
directives: ParsedBillDirective[];
|
|
5
|
+
};
|
|
6
|
+
/** Compare exact output, grammatical ASTs, per-directive targets and link multisets separately. */
|
|
7
|
+
export declare function compareBillOutputs(left: SavedBillOutput, right: SavedBillOutput, maxExamples?: number): {
|
|
8
|
+
exactHtmlEqual: boolean;
|
|
9
|
+
exactDirectivesEqual: boolean;
|
|
10
|
+
directiveCounts: {
|
|
11
|
+
left: number;
|
|
12
|
+
right: number;
|
|
13
|
+
};
|
|
14
|
+
grammarDifferences: number;
|
|
15
|
+
targetDifferences: number;
|
|
16
|
+
directiveExamples: {
|
|
17
|
+
index: number;
|
|
18
|
+
articleId: string;
|
|
19
|
+
blockId: string | undefined;
|
|
20
|
+
kind: "delete" | "insert_after" | "insert_before" | "replace" | "replace_portion" | "delete_portion" | "delete_article" | "compound";
|
|
21
|
+
sourcePosition: import('../index.js').FragmentPosition;
|
|
22
|
+
grammarEqual: boolean;
|
|
23
|
+
leftTargets: string[];
|
|
24
|
+
rightTargets: string[];
|
|
25
|
+
}[];
|
|
26
|
+
links: {
|
|
27
|
+
leftOnly: number;
|
|
28
|
+
rightOnly: number;
|
|
29
|
+
differencesByClass: Record<string, {
|
|
30
|
+
leftOnly: number;
|
|
31
|
+
rightOnly: number;
|
|
32
|
+
}>;
|
|
33
|
+
examples: {
|
|
34
|
+
leftCount: number;
|
|
35
|
+
rightCount: number;
|
|
36
|
+
className: string;
|
|
37
|
+
href: string;
|
|
38
|
+
text: string;
|
|
39
|
+
count: number;
|
|
40
|
+
}[];
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Sql } from 'postgres';
|
|
2
|
+
import { CanutesResolver } from '../legi/canutes_resolver.js';
|
|
3
|
+
import { LegiArticleInfo } from '../legi/resolver.js';
|
|
4
|
+
/** Profiling reference only: the original full-transfer global preload.
|
|
5
|
+
* Keep outside the production resolver so before/after uses the same parser,
|
|
6
|
+
* titles and SQL connection. Like the original, row order is unspecified. */
|
|
7
|
+
export declare class CanutesLegacyCandidatesResolver extends CanutesResolver {
|
|
8
|
+
private readonly legacyDb;
|
|
9
|
+
private readonly globals;
|
|
10
|
+
constructor(legacyDb: Sql);
|
|
11
|
+
getUniqueActiveArticlesByNum({ date, num, }: {
|
|
12
|
+
date: string;
|
|
13
|
+
num: string | undefined;
|
|
14
|
+
}): Promise<LegiArticleInfo[]>;
|
|
15
|
+
preloadUniqueActiveArticlesByNums({ date, nums, }: {
|
|
16
|
+
date: string;
|
|
17
|
+
nums: Iterable<string | undefined>;
|
|
18
|
+
}): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Sql } from 'postgres';
|
|
2
|
+
export declare function configureCanutesTextTitlesCache(db: Sql): Promise<void>;
|
|
3
|
+
export declare function configureCanutesTextTitlesTriggers(db: Sql): Promise<void>;
|
|
4
|
+
export declare function grantCanutesTextTitlesCacheRoles(db: Sql, options?: {
|
|
5
|
+
readers?: string[];
|
|
6
|
+
builders?: string[];
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
export declare function ensureCanutesArticleNumberIndex(db: Sql): Promise<string>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Sql } from 'postgres';
|
|
2
|
+
import { FlegiResolver } from '../f_legi/resolver.js';
|
|
3
|
+
export type ProfilingTitleStages = {
|
|
4
|
+
rows: number;
|
|
5
|
+
queryMs: number;
|
|
6
|
+
buildInstallMs: number;
|
|
7
|
+
cacheHit?: boolean;
|
|
8
|
+
};
|
|
9
|
+
/** Profiling only: never invoke FlegiResolver's cache builder, locks or DML. */
|
|
10
|
+
export declare function createReadOnlyFlegiProfilingResolver(db: Sql, titleMode: "source" | "cache"): {
|
|
11
|
+
create: () => FlegiResolver;
|
|
12
|
+
getTitleStages: () => ProfilingTitleStages | undefined;
|
|
13
|
+
titlesLoaded: () => boolean;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Titres occultés du pilote masquage, pour la projection Typesense publique
|
|
3
|
+
* (`textes_juridiques`) : quand un texte est couvert par une copie, son
|
|
4
|
+
* titre — et celui des autres versions du même CID — est remplacé par le
|
|
5
|
+
* titre occulté, afin qu'aucun nom ne soit indexé ni retrouvable par nom.
|
|
6
|
+
*
|
|
7
|
+
* Le rôle de lecture doit posséder USAGE sur le schéma `masquage` et SELECT
|
|
8
|
+
* sur `masquage.public_document`. Sans ces droits, l'occultation est
|
|
9
|
+
* désactivée avec un avertissement explicite (titres bruts servis comme
|
|
10
|
+
* aujourd'hui) : la reconstruction ne doit jamais échouer faute de droits,
|
|
11
|
+
* et l'écart est détecté par le sondage Typesense de #280.
|
|
12
|
+
*/
|
|
13
|
+
export interface TitresOccultes {
|
|
14
|
+
/** Titre occulté, par identifiant JORFTEXT couvert. */
|
|
15
|
+
parId: Map<string, string>;
|
|
16
|
+
/** Titre occulté, par CID ayant au moins une version couverte. */
|
|
17
|
+
parCid: Map<string, string>;
|
|
18
|
+
}
|
|
19
|
+
/** Titres occultés (cache process d'une minute). */
|
|
20
|
+
export declare function chargerTitresOccultes(): Promise<TitresOccultes>;
|
|
21
|
+
/** Réinitialise le cache ; réservé aux tests. */
|
|
22
|
+
export declare function _videCachePourTests(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Dérive, à partir des descriptions brutes, les descriptions à indexer dans
|
|
25
|
+
* la collection publique : pour tout CID couvert par une copie (et donc pour
|
|
26
|
+
* toutes ses versions), le titre des cartouches devient le titre occulté.
|
|
27
|
+
* Sans occultation active, les descriptions sont retournées telles quelles.
|
|
28
|
+
*/
|
|
29
|
+
export declare function deriverDescriptionsOccultees<D extends {
|
|
30
|
+
cid: string;
|
|
31
|
+
cartouches: ArrayLike<{
|
|
32
|
+
titre: string;
|
|
33
|
+
}>;
|
|
34
|
+
}>(descriptions: Map<string, D>, titres: {
|
|
35
|
+
parCid: Map<string, string>;
|
|
36
|
+
}): Map<string, D>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Sql } from 'postgres';
|
|
2
|
+
export type SqlProfileEntry = {
|
|
3
|
+
signature: string;
|
|
4
|
+
calls: number;
|
|
5
|
+
errors: number;
|
|
6
|
+
rows: number;
|
|
7
|
+
totalMs: number;
|
|
8
|
+
maxMs: number;
|
|
9
|
+
};
|
|
10
|
+
/** Client wall time: includes connection setup, transfer and decoding, not
|
|
11
|
+
* just PostgreSQL execution. Parameters/credentials are never recorded. */
|
|
12
|
+
export declare class SqlQueryProfiler {
|
|
13
|
+
private entries;
|
|
14
|
+
reset(): void;
|
|
15
|
+
summary(): SqlProfileEntry[];
|
|
16
|
+
private observe;
|
|
17
|
+
/** Instruments the awaited tagged/unsafe queries used by the resolver.
|
|
18
|
+
* Identifier/list/json fragments stay untouched; transaction callbacks get
|
|
19
|
+
* the same instrumentation. Streaming/cursor queries are not profiled. */
|
|
20
|
+
wrap<T extends Sql>(sql: T): T;
|
|
21
|
+
}
|
|
22
|
+
export type CapturedTiming = {
|
|
23
|
+
label: string;
|
|
24
|
+
details: Record<string, unknown>;
|
|
25
|
+
};
|
|
26
|
+
/** CLI-only capture of existing timing diagnostics. No runtime parser changes. */
|
|
27
|
+
export declare function captureTimingDiagnostics<T>(task: () => Promise<T>, timings?: CapturedTiming[]): Promise<{
|
|
28
|
+
result: T;
|
|
29
|
+
timings: CapturedTiming[];
|
|
30
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export declare const ACTION_VERB_RE: RegExp;
|
|
2
2
|
export declare function normalizeActionText(text: string): string;
|
|
3
|
+
/** Create a bounded cache owned by one synchronous directive extraction. */
|
|
4
|
+
export declare function createActionTextNormalizer(): typeof normalizeActionText;
|
|
3
5
|
export declare function hasActionRedactionIntro(normalizedActionScope: string, normalizedText?: string, actionScope?: string): boolean;
|
|
4
6
|
export declare function hasAfterCue(normalizedActionScope: string): boolean;
|
|
5
7
|
export declare function hasBeforeCue(normalizedActionScope: string): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare function getTextTitlesInfosInstallationVersion(): number;
|
|
1
2
|
export declare function setTextTitlesInfos(textTitlesInfos: unknown): void;
|
|
2
3
|
/** Keep the successive titles of one CID together when ranking code editions. */
|
|
3
4
|
export declare function rankCodeTitleCids(cids: string[], date: string): string[];
|
|
@@ -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/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.
|
|
4
|
+
"version": "0.21.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Assemblée nationale",
|
|
7
7
|
"France",
|
|
@@ -65,6 +65,12 @@
|
|
|
65
65
|
"configure": "tsx src/scripts/configure.ts",
|
|
66
66
|
"configure:postgres:assemblee-triggers": "tsx src/scripts/configure_postgres_assemblee_document_triggers.ts",
|
|
67
67
|
"configure:postgres:senat-triggers": "tsx src/scripts/configure_postgres_senat_document_triggers.ts",
|
|
68
|
+
"configure:postgres:legi-resolver": "tsx src/scripts/configure_postgres_legi_resolver.ts",
|
|
69
|
+
"warm:postgres:legi-titles": "tsx src/scripts/warm_canutes_text_titles_cache.ts",
|
|
70
|
+
"test:postgres:legi-cache": "tsx src/scripts/test_canutes_titles_cache.ts",
|
|
71
|
+
"profile:canutes-bill": "tsx src/scripts/profile_canutes_bill.ts",
|
|
72
|
+
"profile:legi-bill": "tsx src/scripts/profile_canutes_bill.ts",
|
|
73
|
+
"compare:legi-bills": "tsx src/scripts/compare_legi_bills.ts",
|
|
68
74
|
"format": "prettier --write \"src/**/*.ts\" \"*.md\"",
|
|
69
75
|
"index:jos": "tsx src/scripts/extract_jos_infos.ts",
|
|
70
76
|
"index:postgres:assemblee": "tsx src/scripts/index_postgres_assemblee_texts.ts",
|