@socialgouv/cdtn-utils 4.209.1 → 4.211.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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const idcc_1 = require("../idcc");
4
+ describe("IDCC mappings", () => {
5
+ describe("IDCC_SPLIT", () => {
6
+ it("should contain valid split mapping for IDCC 1740", () => {
7
+ expect(idcc_1.IDCC_SPLIT[1740]).toEqual([1596, 1597]);
8
+ });
9
+ it("should have all values as arrays", () => {
10
+ Object.values(idcc_1.IDCC_SPLIT).forEach((value) => {
11
+ expect(Array.isArray(value)).toBe(true);
12
+ expect(value.length).toBeGreaterThan(0);
13
+ });
14
+ });
15
+ it("should have all values as numbers", () => {
16
+ Object.values(idcc_1.IDCC_SPLIT).forEach((idccs) => {
17
+ idccs.forEach((idcc) => {
18
+ expect(typeof idcc).toBe("number");
19
+ });
20
+ });
21
+ });
22
+ });
23
+ describe("IDCC_MERGE", () => {
24
+ it("should contain valid merge mapping for IDCC 3248", () => {
25
+ expect(idcc_1.IDCC_MERGE[3248]).toBeDefined();
26
+ expect(Array.isArray(idcc_1.IDCC_MERGE[3248])).toBe(true);
27
+ expect(idcc_1.IDCC_MERGE[3248].length).toBeGreaterThan(70);
28
+ expect(idcc_1.IDCC_MERGE[3248]).toContain(54);
29
+ expect(idcc_1.IDCC_MERGE[3248]).toContain(650);
30
+ });
31
+ it("should contain valid merge mapping for IDCC 275", () => {
32
+ expect(idcc_1.IDCC_MERGE[275]).toEqual([1391]);
33
+ });
34
+ it("should contain valid merge mapping for IDCC 1586", () => {
35
+ expect(idcc_1.IDCC_MERGE[1586]).toEqual([1543]);
36
+ });
37
+ it("should contain valid merge mapping for IDCC 3245", () => {
38
+ expect(idcc_1.IDCC_MERGE[3245]).toEqual([1710, 412]);
39
+ });
40
+ it("should have all values as arrays", () => {
41
+ Object.values(idcc_1.IDCC_MERGE).forEach((value) => {
42
+ expect(Array.isArray(value)).toBe(true);
43
+ expect(value.length).toBeGreaterThan(0);
44
+ });
45
+ });
46
+ it("should have all values as numbers", () => {
47
+ Object.values(idcc_1.IDCC_MERGE).forEach((idccs) => {
48
+ idccs.forEach((idcc) => {
49
+ expect(typeof idcc).toBe("number");
50
+ });
51
+ });
52
+ });
53
+ it("should have all keys as numbers", () => {
54
+ Object.keys(idcc_1.IDCC_MERGE).forEach((key) => {
55
+ expect(Number.isNaN(Number(key))).toBe(false);
56
+ });
57
+ });
58
+ });
59
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const naf_1 = require("../naf");
4
+ describe("nafMapper", () => {
5
+ it("should contain valid NAF codes", () => {
6
+ expect(naf_1.nafMapper["01.11Z"]).toContain("Culture de céréales");
7
+ expect(naf_1.nafMapper["10.71C"]).toBe("Boulangerie et boulangerie-pâtisserie");
8
+ expect(naf_1.nafMapper["62.01Z"]).toBe("Programmation informatique");
9
+ });
10
+ it("should have codes in correct format", () => {
11
+ const codes = Object.keys(naf_1.nafMapper);
12
+ codes.forEach((code) => {
13
+ expect(code).toMatch(/^\d{2}\.\d{2}[A-Z]$/);
14
+ });
15
+ });
16
+ it("should have all values as non-empty strings", () => {
17
+ Object.values(naf_1.nafMapper).forEach((description) => {
18
+ expect(typeof description).toBe("string");
19
+ expect(description.length).toBeGreaterThan(0);
20
+ });
21
+ });
22
+ it("should contain expected number of NAF codes", () => {
23
+ const codesCount = Object.keys(naf_1.nafMapper).length;
24
+ // NAF rév. 2 contains 732 codes
25
+ expect(codesCount).toBeGreaterThan(700);
26
+ });
27
+ it("should include first and last NAF codes", () => {
28
+ // First code in agriculture section
29
+ expect(naf_1.nafMapper["01.11Z"]).toBeDefined();
30
+ // Last code for extraterritorial organizations
31
+ expect(naf_1.nafMapper["99.00Z"]).toBe("Activités des organisations et organismes extraterritoriaux");
32
+ });
33
+ it("should include service codes", () => {
34
+ expect(naf_1.nafMapper["47.11F"]).toBe("Hypermarchés");
35
+ expect(naf_1.nafMapper["56.10A"]).toBe("Restauration traditionnelle");
36
+ expect(naf_1.nafMapper["85.10Z"]).toBe("Enseignement pré-primaire");
37
+ });
38
+ it("should include manufacturing codes", () => {
39
+ expect(naf_1.nafMapper["10.13B"]).toBe("Charcuterie");
40
+ expect(naf_1.nafMapper["29.10Z"]).toBe("Construction de véhicules automobiles");
41
+ expect(naf_1.nafMapper["32.50A"]).toBe("Fabrication de matériel médico-chirurgical et dentaire");
42
+ });
43
+ it("should include construction codes", () => {
44
+ expect(naf_1.nafMapper["41.20A"]).toBe("Construction de maisons individuelles");
45
+ expect(naf_1.nafMapper["43.21A"]).toContain("installation électrique");
46
+ });
47
+ });
@@ -0,0 +1,72 @@
1
+ /**
2
+ * IDCC (Identifiant de Convention Collective) mappings
3
+ *
4
+ * Ces mappings gèrent les redirections et fusions de conventions collectives
5
+ */
6
+ /**
7
+ * IDCC_SPLIT: Conventions collectives qui ont été divisées
8
+ *
9
+ * Clé: IDCC source
10
+ * Valeur: Tableau des nouveaux IDCC résultants de la division
11
+ */
12
+ export declare const IDCC_SPLIT: {
13
+ readonly 1740: readonly [1596, 1597];
14
+ };
15
+ /**
16
+ * IDCC_MERGE: Conventions collectives qui ont été fusionnées
17
+ *
18
+ * Clé: IDCC de destination (nouvelle CC)
19
+ * Valeur: Tableau des IDCC sources qui ont été fusionnés dans cette CC
20
+ */
21
+ export declare const IDCC_MERGE: {
22
+ readonly 3248: readonly [54, 650, 714, 822, 827, 828, 829, 836, 860, 863, 878, 887, 898, 899, 911, 914, 920, 923, 930, 934, 937, 943, 948, 965, 979, 984, 1007, 1059, 1159, 1164, 1274, 1315, 1353, 1365, 1369, 1387, 1472, 1525, 1560, 1564, 1572, 1576, 1577, 1578, 1592, 1604, 1626, 1627, 1628, 1634, 1635, 1732, 1813, 1867, 1885, 1902, 1912, 1960, 1966, 1967, 2003, 2126, 2221, 2266, 2294, 2489, 2542, 2579, 2615, 2630, 2700, 2755, 2980, 2992, 3053, 3209, 3231, 2344];
23
+ readonly 275: readonly [1391];
24
+ readonly 1586: readonly [1543];
25
+ readonly 3245: readonly [1710, 412];
26
+ readonly 3238: readonly [1492, 1495, 700, 707];
27
+ readonly 3241: readonly [2411];
28
+ readonly 573: readonly [1761, 1624, 635];
29
+ readonly 3229: readonly [1974, 2174];
30
+ readonly 3236: readonly [1423];
31
+ readonly 158: readonly [172];
32
+ readonly 2528: readonly [207, 1561];
33
+ readonly 303: readonly [673, 418, 780];
34
+ readonly 489: readonly [715];
35
+ readonly 413: readonly [1001];
36
+ readonly 1557: readonly [1618];
37
+ readonly 18: readonly [1942];
38
+ readonly 787: readonly [3160, 1237];
39
+ readonly 1539: readonly [706];
40
+ readonly 3255: readonly [1747, 2075];
41
+ readonly 7026: readonly [7012, 7013, 7014];
42
+ readonly 2121: readonly [1194, 1016, 2770];
43
+ readonly 2642: readonly [1734];
44
+ readonly 1875: readonly [2564];
45
+ readonly 3243: readonly [731, 1383];
46
+ readonly 3251: readonly [1044, 567];
47
+ readonly 3250: readonly [2785, 1921];
48
+ readonly 7520: readonly [7509];
49
+ readonly 184: readonly [614];
50
+ readonly 3224: readonly [925, 802];
51
+ readonly 1558: readonly [1800];
52
+ readonly 2264: readonly [2104];
53
+ readonly 3249: readonly [3227, 211, 135, 87];
54
+ readonly 7027: readonly [7008, 7021];
55
+ readonly 2336: readonly [1278];
56
+ readonly 3216: readonly [1947];
57
+ readonly 1518: readonly [3203, 1031];
58
+ readonly 3252: readonly [2717, 2397];
59
+ readonly 2609: readonly [2707];
60
+ readonly 3254: readonly [1504, 992];
61
+ readonly 3220: readonly [1588];
62
+ readonly 1486: readonly [2230];
63
+ readonly 653: readonly [438];
64
+ readonly 3253: readonly [1000, 1850];
65
+ };
66
+ /**
67
+ * Types dérivés des constantes
68
+ */
69
+ export type IdccSplitKeys = keyof typeof IDCC_SPLIT;
70
+ export type IdccMergeKeys = keyof typeof IDCC_MERGE;
71
+ export type IdccSplitValues = (typeof IDCC_SPLIT)[IdccSplitKeys][number];
72
+ export type IdccMergeValues = (typeof IDCC_MERGE)[IdccMergeKeys][number];
package/build/idcc.js ADDED
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ /**
3
+ * IDCC (Identifiant de Convention Collective) mappings
4
+ *
5
+ * Ces mappings gèrent les redirections et fusions de conventions collectives
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.IDCC_MERGE = exports.IDCC_SPLIT = void 0;
9
+ /**
10
+ * IDCC_SPLIT: Conventions collectives qui ont été divisées
11
+ *
12
+ * Clé: IDCC source
13
+ * Valeur: Tableau des nouveaux IDCC résultants de la division
14
+ */
15
+ exports.IDCC_SPLIT = {
16
+ 1740: [1596, 1597],
17
+ };
18
+ /**
19
+ * IDCC_MERGE: Conventions collectives qui ont été fusionnées
20
+ *
21
+ * Clé: IDCC de destination (nouvelle CC)
22
+ * Valeur: Tableau des IDCC sources qui ont été fusionnés dans cette CC
23
+ */
24
+ exports.IDCC_MERGE = {
25
+ 3248: [
26
+ 54, 650, 714, 822, 827, 828, 829, 836, 860, 863, 878, 887, 898, 899, 911,
27
+ 914, 920, 923, 930, 934, 937, 943, 948, 965, 979, 984, 1007, 1059, 1159,
28
+ 1164, 1274, 1315, 1353, 1365, 1369, 1387, 1472, 1525, 1560, 1564, 1572,
29
+ 1576, 1577, 1578, 1592, 1604, 1626, 1627, 1628, 1634, 1635, 1732, 1813,
30
+ 1867, 1885, 1902, 1912, 1960, 1966, 1967, 2003, 2126, 2221, 2266, 2294,
31
+ 2489, 2542, 2579, 2615, 2630, 2700, 2755, 2980, 2992, 3053, 3209, 3231,
32
+ 2344,
33
+ ],
34
+ 275: [1391],
35
+ 1586: [1543],
36
+ 3245: [1710, 412],
37
+ 3238: [1492, 1495, 700, 707],
38
+ 3241: [2411],
39
+ 573: [1761, 1624, 635],
40
+ 3229: [1974, 2174],
41
+ 3236: [1423],
42
+ 158: [172],
43
+ 2528: [207, 1561],
44
+ 303: [673, 418, 780],
45
+ 489: [715],
46
+ 413: [1001],
47
+ 1557: [1618],
48
+ 18: [1942],
49
+ 787: [3160, 1237],
50
+ 1539: [706],
51
+ 3255: [1747, 2075],
52
+ 7026: [7012, 7013, 7014],
53
+ 2121: [1194, 1016, 2770],
54
+ 2642: [1734],
55
+ 1875: [2564],
56
+ 3243: [731, 1383],
57
+ 3251: [1044, 567],
58
+ 3250: [2785, 1921],
59
+ 7520: [7509],
60
+ 184: [614],
61
+ 3224: [925, 802],
62
+ 1558: [1800],
63
+ 2264: [2104],
64
+ 3249: [3227, 211, 135, 87],
65
+ 7027: [7008, 7021],
66
+ 2336: [1278],
67
+ 3216: [1947],
68
+ 1518: [3203, 1031],
69
+ 3252: [2717, 2397],
70
+ 2609: [2707],
71
+ 3254: [1504, 992],
72
+ 3220: [1588],
73
+ 1486: [2230],
74
+ 653: [438],
75
+ 3253: [1000, 1850],
76
+ };
package/build/index.d.ts CHANGED
@@ -2,3 +2,5 @@ export * from "./sources";
2
2
  export * from "./slugify";
3
3
  export * from "./icons/themes";
4
4
  export * from "./icons/ThemeIcons";
5
+ export * from "./idcc";
6
+ export * from "./naf";
package/build/index.js CHANGED
@@ -18,3 +18,5 @@ __exportStar(require("./sources"), exports);
18
18
  __exportStar(require("./slugify"), exports);
19
19
  __exportStar(require("./icons/themes"), exports);
20
20
  __exportStar(require("./icons/ThemeIcons"), exports);
21
+ __exportStar(require("./idcc"), exports);
22
+ __exportStar(require("./naf"), exports);