@lab-anssi/lib 1.4.0 → 1.4.2
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/cms/adaptateurCmsCrisp.d.ts +1 -4
- package/dist/cms/cmsCrisp.d.ts +3 -21
- package/dist/cms/cmsCrisp.js +1 -1
- package/dist/cms/crispMarkdown.d.ts +2 -1
- package/dist/cms/types.d.ts +22 -0
- package/dist/cms/types.js +2 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/package.json +1 -1
@@ -1,3 +1,4 @@
|
|
1
|
+
import { SectionCrisp } from './types';
|
1
2
|
export type ArticleMarkdownCrisp = {
|
2
3
|
titre: string;
|
3
4
|
contenuMarkdown: string;
|
@@ -12,10 +13,6 @@ export type ResumeArticleCrisp = {
|
|
12
13
|
nom?: string;
|
13
14
|
};
|
14
15
|
};
|
15
|
-
export type SectionCrisp = {
|
16
|
-
id: string;
|
17
|
-
nom: string;
|
18
|
-
};
|
19
16
|
export declare class AdaptateurCmsCrisp {
|
20
17
|
readonly urlBase: string;
|
21
18
|
readonly enteteCrisp: {
|
package/dist/cms/cmsCrisp.d.ts
CHANGED
@@ -1,31 +1,13 @@
|
|
1
|
-
import { AdaptateurCmsCrisp
|
1
|
+
import { AdaptateurCmsCrisp } from './adaptateurCmsCrisp';
|
2
2
|
import CrispMarkdown from './crispMarkdown';
|
3
|
-
|
4
|
-
titre: string;
|
5
|
-
contenu: string | null;
|
6
|
-
description: string;
|
7
|
-
tableDesMatieres: any[];
|
8
|
-
};
|
9
|
-
type ArticleMarkdownCrispAvecSection = {
|
10
|
-
titre: string;
|
11
|
-
contenuMarkdown: string;
|
12
|
-
description: string;
|
13
|
-
section: {
|
14
|
-
id?: string;
|
15
|
-
nom?: string;
|
16
|
-
};
|
17
|
-
};
|
18
|
-
type ResumeArticleCrispAvecSlug = ResumeArticleCrisp & {
|
19
|
-
slug: string | null;
|
20
|
-
};
|
3
|
+
import { ArticleCrispAvecSection, PageHtmlCrisp, ResumeArticleCrispAvecSlug, SectionCrisp } from './types';
|
21
4
|
export declare class CmsCrisp {
|
22
5
|
adaptateurCmsCrisp: AdaptateurCmsCrisp;
|
23
6
|
constructeurCrispMarkdown: (contenuMarkdown: string) => CrispMarkdown;
|
24
7
|
constructor(idSite: string, cleApi: string);
|
25
8
|
recupereArticle(id: string): Promise<PageHtmlCrisp>;
|
26
|
-
recupereArticleCategorie(slug: string, idCategorie: string): Promise<
|
9
|
+
recupereArticleCategorie(slug: string, idCategorie: string): Promise<ArticleCrispAvecSection>;
|
27
10
|
recupereSectionsCategorie(idCategorie: string): Promise<SectionCrisp[]>;
|
28
11
|
recupereArticlesCategorie(idCategorie: string): Promise<ResumeArticleCrispAvecSlug[]>;
|
29
12
|
private extraitSlugArticle;
|
30
13
|
}
|
31
|
-
export {};
|
package/dist/cms/cmsCrisp.js
CHANGED
@@ -31,7 +31,7 @@ class CmsCrisp {
|
|
31
31
|
if (!article) {
|
32
32
|
throw new erreurs_1.ErreurArticleCrispIntrouvable();
|
33
33
|
}
|
34
|
-
const articleCrisp = await this.
|
34
|
+
const articleCrisp = await this.recupereArticle(article.id);
|
35
35
|
return {
|
36
36
|
...articleCrisp,
|
37
37
|
section: { id: article.section.id, nom: article.section.nom },
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { EntreeTableDesMatieres } from './types';
|
1
2
|
declare class CrispMarkdown {
|
2
3
|
private contenuMarkdown;
|
3
4
|
private contenuHTML;
|
@@ -7,6 +8,6 @@ declare class CrispMarkdown {
|
|
7
8
|
constructor(contenuMarkdown: string);
|
8
9
|
parseLeMarkdown(): void;
|
9
10
|
versHTML(): string | null;
|
10
|
-
tableDesMatieres():
|
11
|
+
tableDesMatieres(): EntreeTableDesMatieres[];
|
11
12
|
}
|
12
13
|
export default CrispMarkdown;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { ResumeArticleCrisp } from './adaptateurCmsCrisp';
|
2
|
+
export type EntreeTableDesMatieres = {
|
3
|
+
id: string;
|
4
|
+
texte: string;
|
5
|
+
profondeur: number;
|
6
|
+
};
|
7
|
+
export type PageHtmlCrisp = {
|
8
|
+
titre: string;
|
9
|
+
contenu: string | null;
|
10
|
+
description: string;
|
11
|
+
tableDesMatieres: EntreeTableDesMatieres[];
|
12
|
+
};
|
13
|
+
export type ResumeArticleCrispAvecSlug = ResumeArticleCrisp & {
|
14
|
+
slug: string | null;
|
15
|
+
};
|
16
|
+
export type SectionCrisp = {
|
17
|
+
id: string;
|
18
|
+
nom: string;
|
19
|
+
};
|
20
|
+
export type ArticleCrispAvecSection = PageHtmlCrisp & {
|
21
|
+
section: Partial<SectionCrisp>;
|
22
|
+
};
|
package/dist/index.d.ts
CHANGED
@@ -1,2 +1,4 @@
|
|
1
|
-
export {
|
1
|
+
export { type EntreeTableDesMatieres, type PageHtmlCrisp, type ResumeArticleCrispAvecSlug, type SectionCrisp, type ArticleCrispAvecSection, } from './cms/types';
|
2
|
+
export { CmsCrisp } from './cms/cmsCrisp';
|
2
3
|
export { AdaptateurProfilAnssi } from './profilAnssi/adaptateurProfilAnssi';
|
4
|
+
export { ErreurArticleCrispIntrouvable } from './erreurs';
|
package/dist/index.js
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.AdaptateurProfilAnssi = exports.CmsCrisp = void 0;
|
3
|
+
exports.ErreurArticleCrispIntrouvable = exports.AdaptateurProfilAnssi = exports.CmsCrisp = void 0;
|
4
4
|
var cmsCrisp_1 = require("./cms/cmsCrisp");
|
5
5
|
Object.defineProperty(exports, "CmsCrisp", { enumerable: true, get: function () { return cmsCrisp_1.CmsCrisp; } });
|
6
6
|
var adaptateurProfilAnssi_1 = require("./profilAnssi/adaptateurProfilAnssi");
|
7
7
|
Object.defineProperty(exports, "AdaptateurProfilAnssi", { enumerable: true, get: function () { return adaptateurProfilAnssi_1.AdaptateurProfilAnssi; } });
|
8
|
+
var erreurs_1 = require("./erreurs");
|
9
|
+
Object.defineProperty(exports, "ErreurArticleCrispIntrouvable", { enumerable: true, get: function () { return erreurs_1.ErreurArticleCrispIntrouvable; } });
|