@tricoteuses/tisseuse 0.4.0 → 0.5.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/dist/index.js +344 -316
- package/dist/lib/articles.d.ts +2 -2
- package/dist/lib/cache.d.ts +12 -0
- package/dist/lib/index.d.ts +3 -1
- package/dist/lib/loaders/assemblee.d.ts +6 -0
- package/dist/lib/loaders/legifrance.d.ts +18 -0
- package/dist/scripts/add_links_to_assemblee_documents.d.ts +1 -0
- package/package.json +2 -2
- package/dist/lib/loaders.d.ts +0 -19
package/dist/lib/articles.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JorfArticle, LegiArticle } from '@tricoteuses/legifrance';
|
|
2
2
|
import { Sql } from 'postgres';
|
|
3
|
-
import {
|
|
3
|
+
import { LegifranceObjectCache } from './cache.js';
|
|
4
4
|
/**
|
|
5
5
|
* TODO: Migrate to @tricoteuses/legifrance
|
|
6
6
|
*/
|
|
@@ -10,4 +10,4 @@ export declare function getArticleDateSignature(article: JorfArticle | LegiArtic
|
|
|
10
10
|
* - Handle date to filter articles outside date
|
|
11
11
|
* - Migrate everything @tricoteuses/legifrance.
|
|
12
12
|
*/
|
|
13
|
-
export declare function getOrLoadArticleSiblingId(legiDb: Sql,
|
|
13
|
+
export declare function getOrLoadArticleSiblingId(legiDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string, offset: -1 | 1): Promise<string | undefined>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JorfCategorieTag, LegiCategorieTag } from '@tricoteuses/legifrance';
|
|
2
|
+
import { JSONValue } from 'postgres';
|
|
3
|
+
export type AssembleeObjectType = "Document" | "DossierParlementaire";
|
|
4
|
+
export type AssembleeObjectCache = Map<AssembleeObjectType, Map<string, JSONValue>>;
|
|
5
|
+
export type LegifranceObjectCache = Map<JorfCategorieTag | LegiCategorieTag, Map<string, JSONValue>>;
|
|
6
|
+
export type ObjectCache = {
|
|
7
|
+
assemblee: AssembleeObjectCache;
|
|
8
|
+
legifrance: LegifranceObjectCache;
|
|
9
|
+
};
|
|
10
|
+
export declare const newAssembleeObjectCache: () => AssembleeObjectCache;
|
|
11
|
+
export declare const newLegifranceObjectCache: () => LegifranceObjectCache;
|
|
12
|
+
export declare const newObjectCache: () => ObjectCache;
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export { getArticleDateSignature, getOrLoadArticleSiblingId, } from './articles.js';
|
|
2
2
|
export { assertNever } from './asserts.js';
|
|
3
|
+
export { newAssembleeObjectCache, newLegifranceObjectCache, newObjectCache, type AssembleeObjectCache, type AssembleeObjectType, type LegifranceObjectCache, type ObjectCache, } from './cache.js';
|
|
3
4
|
export { formatLongDate } from './dates.js';
|
|
4
5
|
export { jsonReplacer } from './json.js';
|
|
5
|
-
export {
|
|
6
|
+
export { getOrLoadDocument, getOrLoadDocumentsByDossierParlementaireUid, getOrLoadDossierParlementaire, } from './loaders/assemblee.js';
|
|
7
|
+
export { extendLoadedArticle, getOrLoadArticle, getOrLoadJo, getOrLoadSectionTa, getOrLoadSectionsTa, getOrLoadTextelr, getOrLoadTexteVersion, type ArticleExtension, type JorfArticleExtended, type LegiArticleExtended, } from './loaders/legifrance.js';
|
|
6
8
|
export { action } from './text_parsers/actions.js';
|
|
7
9
|
export { article, articles, definitionArticle, designationArticle, listeArticles, nomArticle, nomSpecialArticle, } from './text_parsers/articles.js';
|
|
8
10
|
export { compoundReferencesSeparators, divisionTypes, europeanLawNatures, frenchLawNatures, internationalLawNatures, isTextAstAtomicReference, isTextAstDivision, isTextAstPortion, lawNatures, localizationAdverbs, portionTypes, type CompoundReferencesSeparator, type DivisionType, type EuropeanLawNature, type FrenchLawNature, type InternationalLawNature, type LawNature, type LocalizationAdverb, type PortionType, type TextAst, type TextAstAction, type TextAstArticle, type TextAstAtomicReference, type TextAstBoundedInterval, type TextAstCitation, type TextAstCompoundReference, type TextAstConseilConstitutionnelDecision, type TextAstCountedInterval, type TextAstDivision, type TextAstEnumeration, type TextAstExclusion, type TextAstIncompleteHeader, type TextAstLocalization, type TextAstNumber, type TextAstParentChild, type TextAstPortion, type TextAstPosition, type TextAstReference, type TextAstReferenceAndAction, type TextAstText, type TextAstTextIdentification, type TextAstTextInfos, type TextInfosByWordsTree, type TextInfosByWordsTreeNode, } from './text_parsers/ast.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Document, DossierParlementaire } from '@tricoteuses/assemblee';
|
|
2
|
+
import { Sql } from 'postgres';
|
|
3
|
+
import { AssembleeObjectCache } from '../cache.js';
|
|
4
|
+
export declare function getOrLoadDocument(assembleeDb: Sql, assembleeObjectCache: AssembleeObjectCache, uid: string): Promise<Document | undefined>;
|
|
5
|
+
export declare function getOrLoadDocumentsByDossierParlementaireUid(assembleeDb: Sql, assembleeObjectCache: AssembleeObjectCache, dossierUid: string): Promise<Document[]>;
|
|
6
|
+
export declare function getOrLoadDossierParlementaire(assembleeDb: Sql, assembleeObjectCache: AssembleeObjectCache, uid: string): Promise<DossierParlementaire | undefined>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Jo, JorfArticle, JorfSectionTa, JorfTextelr, JorfTexteVersion, LegiArticle, LegiSectionTa, LegiTextelr, LegiTexteVersion } from '@tricoteuses/legifrance';
|
|
2
|
+
import { Sql } from 'postgres';
|
|
3
|
+
import { LegifranceObjectCache } from '../cache.js';
|
|
4
|
+
export interface ArticleExtension {
|
|
5
|
+
num?: string;
|
|
6
|
+
}
|
|
7
|
+
export type JorfArticleExtended = JorfArticle & ArticleExtension;
|
|
8
|
+
export type LegiArticleExtended = LegiArticle & ArticleExtension;
|
|
9
|
+
export declare function extendLoadedArticle<ArticleType extends JorfArticle | LegiArticle>({ data: article, num, }: {
|
|
10
|
+
data: ArticleType;
|
|
11
|
+
num: string | null;
|
|
12
|
+
}): ArticleType & ArticleExtension;
|
|
13
|
+
export declare function getOrLoadArticle<ArticleType extends JorfArticle | LegiArticle>(legiDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string): Promise<(ArticleType & ArticleExtension) | undefined>;
|
|
14
|
+
export declare function getOrLoadJo<JoType extends Jo>(legiDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string): Promise<JoType | undefined>;
|
|
15
|
+
export declare function getOrLoadSectionTa<SectionTaType extends JorfSectionTa | LegiSectionTa>(legiDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string): Promise<SectionTaType | undefined>;
|
|
16
|
+
export declare function getOrLoadSectionsTa<SectionTaType extends JorfSectionTa | LegiSectionTa>(legiDb: Sql, legifranceObjectCache: LegifranceObjectCache, ids: string[]): Promise<SectionTaType[]>;
|
|
17
|
+
export declare function getOrLoadTextelr<TextelrType extends JorfTextelr | LegiTextelr>(legiDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string): Promise<TextelrType | undefined>;
|
|
18
|
+
export declare function getOrLoadTexteVersion<TexteVersionType extends JorfTexteVersion | LegiTexteVersion>(legiDb: Sql, legifranceObjectCache: LegifranceObjectCache, id: string): Promise<TexteVersionType | undefined>;
|
|
@@ -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.5.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Assemblée nationale",
|
|
7
7
|
"France",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@auditors/core": "^0.7.4",
|
|
55
|
-
"@tricoteuses/assemblee": "^2.
|
|
55
|
+
"@tricoteuses/assemblee": "^2.4.1",
|
|
56
56
|
"@tricoteuses/legifrance": "^0.16.0",
|
|
57
57
|
"@types/fs-extra": "^11.0.4",
|
|
58
58
|
"@types/node": "^24.8.1",
|
package/dist/lib/loaders.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Jo, JorfArticle, JorfCategorieTag, JorfSectionTa, JorfTextelr, JorfTexteVersion, LegiArticle, LegiCategorieTag, LegiSectionTa, LegiTextelr, LegiTexteVersion } from '@tricoteuses/legifrance';
|
|
2
|
-
import { JSONValue, Sql } from 'postgres';
|
|
3
|
-
export interface ArticleExtension {
|
|
4
|
-
num?: string;
|
|
5
|
-
}
|
|
6
|
-
export type JorfArticleExtended = JorfArticle & ArticleExtension;
|
|
7
|
-
export type LegalObjectCacheByIdByCategorieTag = Map<JorfCategorieTag | LegiCategorieTag, Map<string, JSONValue>>;
|
|
8
|
-
export type LegiArticleExtended = LegiArticle & ArticleExtension;
|
|
9
|
-
export declare function extendLoadedArticle<ArticleType extends JorfArticle | LegiArticle>({ data: article, num, }: {
|
|
10
|
-
data: ArticleType;
|
|
11
|
-
num: string | null;
|
|
12
|
-
}): ArticleType & ArticleExtension;
|
|
13
|
-
export declare function getOrLoadArticle<ArticleType extends JorfArticle | LegiArticle>(legiDb: Sql, legalObjectCacheByIdByCategorieTag: LegalObjectCacheByIdByCategorieTag, id: string): Promise<(ArticleType & ArticleExtension) | undefined>;
|
|
14
|
-
export declare function getOrLoadJo<JoType extends Jo>(legiDb: Sql, legalObjectCacheByIdByCategorieTag: LegalObjectCacheByIdByCategorieTag, id: string): Promise<JoType | undefined>;
|
|
15
|
-
export declare function getOrLoadSectionTa<SectionTaType extends JorfSectionTa | LegiSectionTa>(legiDb: Sql, legalObjectCacheByIdByCategorieTag: LegalObjectCacheByIdByCategorieTag, id: string): Promise<SectionTaType | undefined>;
|
|
16
|
-
export declare function getOrLoadSectionsTa<SectionTaType extends JorfSectionTa | LegiSectionTa>(legiDb: Sql, legalObjectCacheByIdByCategorieTag: LegalObjectCacheByIdByCategorieTag, ids: string[]): Promise<SectionTaType[]>;
|
|
17
|
-
export declare function getOrLoadTextelr<TextelrType extends JorfTextelr | LegiTextelr>(legiDb: Sql, legalObjectCacheByIdByCategorieTag: LegalObjectCacheByIdByCategorieTag, id: string): Promise<TextelrType | undefined>;
|
|
18
|
-
export declare function getOrLoadTexteVersion<TexteVersionType extends JorfTexteVersion | LegiTexteVersion>(legiDb: Sql, legalObjectCacheByIdByCategorieTag: LegalObjectCacheByIdByCategorieTag, id: string): Promise<TexteVersionType | undefined>;
|
|
19
|
-
export declare const newLegalObjectCacheByIdByCategorieTag: () => LegalObjectCacheByIdByCategorieTag;
|