@nodesecure/rc 1.3.0 → 1.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.
Files changed (39) hide show
  1. package/README.md +75 -20
  2. package/dist/constants.d.ts +2 -2
  3. package/dist/constants.js +2 -2
  4. package/dist/functions/memoize.d.ts +14 -0
  5. package/dist/functions/memoize.js +20 -0
  6. package/dist/functions/memoize.js.map +1 -0
  7. package/dist/functions/read.d.ts +27 -21
  8. package/dist/functions/read.js +33 -31
  9. package/dist/functions/read.js.map +1 -1
  10. package/dist/functions/write.d.ts +19 -19
  11. package/dist/functions/write.js +25 -27
  12. package/dist/functions/write.js.map +1 -1
  13. package/dist/index.d.ts +5 -4
  14. package/dist/index.js +5 -4
  15. package/dist/index.js.map +1 -1
  16. package/dist/projects/ci.d.ts +25 -25
  17. package/dist/projects/ci.js +10 -10
  18. package/dist/projects/report.d.ts +69 -69
  19. package/dist/projects/report.js +32 -32
  20. package/dist/projects/scanner.d.ts +18 -0
  21. package/dist/projects/scanner.js +7 -0
  22. package/dist/projects/scanner.js.map +1 -0
  23. package/dist/rc.d.ts +43 -40
  24. package/dist/rc.js +33 -32
  25. package/dist/rc.js.map +1 -1
  26. package/dist/schema/defs/author.json +13 -0
  27. package/dist/schema/defs/ci.json +58 -58
  28. package/dist/schema/defs/ciWarnings.json +8 -8
  29. package/dist/schema/defs/report.json +98 -98
  30. package/dist/schema/defs/reportChart.json +27 -27
  31. package/dist/schema/defs/scanner.json +12 -0
  32. package/dist/schema/loader.d.ts +1 -1
  33. package/dist/schema/loader.js +19 -19
  34. package/dist/schema/nodesecurerc.json +42 -39
  35. package/dist/utils/index.d.ts +1 -1
  36. package/dist/utils/index.js +1 -1
  37. package/dist/utils/readJSON.d.ts +1 -1
  38. package/dist/utils/readJSON.js +6 -6
  39. package/package.json +16 -17
@@ -1,98 +1,98 @@
1
- {
2
- "title": "Report configuration",
3
- "type": "object",
4
- "additionalProperties": false,
5
- "required": [
6
- "title",
7
- "logoUrl"
8
- ],
9
- "properties": {
10
- "theme": {
11
- "type": "string",
12
- "enum": [
13
- "light",
14
- "dark"
15
- ],
16
- "default": "light"
17
- },
18
- "title": {
19
- "type": "string",
20
- "description": "Report title",
21
- "default": "Default report title"
22
- },
23
- "logoUrl": {
24
- "type": "string",
25
- "description": "Logo",
26
- "default": "https://avatars0.githubusercontent.com/u/29552883?s=200&v=4"
27
- },
28
- "includeTransitiveInternal": {
29
- "type": "boolean",
30
- "default": false,
31
- "description": "Show/categorize internal dependencies as transitive"
32
- },
33
- "npm": {
34
- "type": "object",
35
- "additionalProperties": false,
36
- "required": [
37
- "organizationPrefix",
38
- "packages"
39
- ],
40
- "properties": {
41
- "organizationPrefix": {
42
- "type": "string",
43
- "description": "NPM organization prefix starting with @"
44
- },
45
- "packages": {
46
- "type": "array",
47
- "items": {
48
- "type": "string"
49
- },
50
- "uniqueItems": true
51
- }
52
- }
53
- },
54
- "git": {
55
- "type": "object",
56
- "additionalProperties": false,
57
- "required": [
58
- "organizationUrl",
59
- "repositories"
60
- ],
61
- "properties": {
62
- "organizationUrl": {
63
- "type": "string",
64
- "description": "GitHub organization URL"
65
- },
66
- "repositories": {
67
- "type": "array",
68
- "description": "List of repositories (name are enough, no need to provide .git url or any equivalent)",
69
- "items": {
70
- "type": "string"
71
- },
72
- "uniqueItems": true
73
- }
74
- }
75
- },
76
- "reporters": {
77
- "type": "array",
78
- "uniqueItems": true,
79
- "items": {
80
- "type": "string",
81
- "enum": [
82
- "html",
83
- "pdf"
84
- ]
85
- },
86
- "default": [
87
- "html",
88
- "pdf"
89
- ]
90
- },
91
- "charts": {
92
- "type": "array",
93
- "items": {
94
- "$ref": "#/$defs/reportChart"
95
- }
96
- }
97
- }
98
- }
1
+ {
2
+ "title": "Report configuration",
3
+ "type": "object",
4
+ "additionalProperties": false,
5
+ "required": [
6
+ "title",
7
+ "logoUrl"
8
+ ],
9
+ "properties": {
10
+ "theme": {
11
+ "type": "string",
12
+ "enum": [
13
+ "light",
14
+ "dark"
15
+ ],
16
+ "default": "light"
17
+ },
18
+ "title": {
19
+ "type": "string",
20
+ "description": "Report title",
21
+ "default": "Default report title"
22
+ },
23
+ "logoUrl": {
24
+ "type": "string",
25
+ "description": "Logo",
26
+ "default": "https://avatars0.githubusercontent.com/u/29552883?s=200&v=4"
27
+ },
28
+ "includeTransitiveInternal": {
29
+ "type": "boolean",
30
+ "default": false,
31
+ "description": "Show/categorize internal dependencies as transitive"
32
+ },
33
+ "npm": {
34
+ "type": "object",
35
+ "additionalProperties": false,
36
+ "required": [
37
+ "organizationPrefix",
38
+ "packages"
39
+ ],
40
+ "properties": {
41
+ "organizationPrefix": {
42
+ "type": "string",
43
+ "description": "NPM organization prefix starting with @"
44
+ },
45
+ "packages": {
46
+ "type": "array",
47
+ "items": {
48
+ "type": "string"
49
+ },
50
+ "uniqueItems": true
51
+ }
52
+ }
53
+ },
54
+ "git": {
55
+ "type": "object",
56
+ "additionalProperties": false,
57
+ "required": [
58
+ "organizationUrl",
59
+ "repositories"
60
+ ],
61
+ "properties": {
62
+ "organizationUrl": {
63
+ "type": "string",
64
+ "description": "GitHub organization URL"
65
+ },
66
+ "repositories": {
67
+ "type": "array",
68
+ "description": "List of repositories (name are enough, no need to provide .git url or any equivalent)",
69
+ "items": {
70
+ "type": "string"
71
+ },
72
+ "uniqueItems": true
73
+ }
74
+ }
75
+ },
76
+ "reporters": {
77
+ "type": "array",
78
+ "uniqueItems": true,
79
+ "items": {
80
+ "type": "string",
81
+ "enum": [
82
+ "html",
83
+ "pdf"
84
+ ]
85
+ },
86
+ "default": [
87
+ "html",
88
+ "pdf"
89
+ ]
90
+ },
91
+ "charts": {
92
+ "type": "array",
93
+ "items": {
94
+ "$ref": "#/$defs/reportChart"
95
+ }
96
+ }
97
+ }
98
+ }
@@ -1,27 +1,27 @@
1
- {
2
- "type": "object",
3
- "additionalProperties": false,
4
- "required": [
5
- "name"
6
- ],
7
- "properties": {
8
- "name": {
9
- "type": "string",
10
- "enum": ["Extensions", "Licenses", "Warnings", "Flags"]
11
- },
12
- "display": {
13
- "type": "boolean",
14
- "default": true
15
- },
16
- "type": {
17
- "type": "string",
18
- "enum": ["bar", "horizontalBar", "polarArea", "doughnut"],
19
- "default": "bar",
20
- "description": "Chart.js chart type."
21
- },
22
- "interpolation": {
23
- "type": "string",
24
- "description": "D3.js chromatic interpolation set of colors"
25
- }
26
- }
27
- }
1
+ {
2
+ "type": "object",
3
+ "additionalProperties": false,
4
+ "required": [
5
+ "name"
6
+ ],
7
+ "properties": {
8
+ "name": {
9
+ "type": "string",
10
+ "enum": ["Extensions", "Licenses", "Warnings", "Flags"]
11
+ },
12
+ "display": {
13
+ "type": "boolean",
14
+ "default": true
15
+ },
16
+ "type": {
17
+ "type": "string",
18
+ "enum": ["bar", "horizontalBar", "polarArea", "doughnut"],
19
+ "default": "bar",
20
+ "description": "Chart.js chart type."
21
+ },
22
+ "interpolation": {
23
+ "type": "string",
24
+ "description": "D3.js chromatic interpolation set of colors"
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "flaggedAuthors": {
5
+ "type": "array",
6
+ "items": {
7
+ "$ref": "#/$defs/author"
8
+ }
9
+ }
10
+ },
11
+ "additionalProperties": false
12
+ }
@@ -1 +1 @@
1
- export declare function loadJSONSchemaSync(): any;
1
+ export declare function loadJSONSchemaSync(): any;
@@ -1,20 +1,20 @@
1
- // Import Node.js Dependencies
2
- import { readdirSync } from "node:fs";
3
- import path from "node:path";
4
- // Import Internal Dependencies
5
- import { readJSONSync } from "../utils/index.js";
6
- // CONSTANTS
7
- const kDefsDirectory = new URL("./defs", import.meta.url);
8
- function loadJSONSchemaDefinition($defs, fileName) {
9
- const defName = path.basename(fileName, ".json");
10
- const jsonSchema = readJSONSync(`./defs/${fileName}`, import.meta.url);
11
- return { ...$defs, [defName]: jsonSchema };
12
- }
13
- export function loadJSONSchemaSync() {
14
- const mainSchema = readJSONSync("./nodesecurerc.json", import.meta.url);
15
- const $defs = readdirSync(kDefsDirectory)
16
- .filter((fileName) => path.extname(fileName) === ".json")
17
- .reduce(loadJSONSchemaDefinition, {});
18
- return Object.assign(mainSchema, { $defs });
19
- }
1
+ // Import Node.js Dependencies
2
+ import { readdirSync } from "node:fs";
3
+ import path from "node:path";
4
+ // Import Internal Dependencies
5
+ import { readJSONSync } from "../utils/index.js";
6
+ // CONSTANTS
7
+ const kDefsDirectory = new URL("./defs", import.meta.url);
8
+ function loadJSONSchemaDefinition($defs, fileName) {
9
+ const defName = path.basename(fileName, ".json");
10
+ const jsonSchema = readJSONSync(`./defs/${fileName}`, import.meta.url);
11
+ return { ...$defs, [defName]: jsonSchema };
12
+ }
13
+ export function loadJSONSchemaSync() {
14
+ const mainSchema = readJSONSync("./nodesecurerc.json", import.meta.url);
15
+ const $defs = readdirSync(kDefsDirectory)
16
+ .filter((fileName) => path.extname(fileName) === ".json")
17
+ .reduce(loadJSONSchemaDefinition, {});
18
+ return Object.assign(mainSchema, { $defs });
19
+ }
20
20
  //# sourceMappingURL=loader.js.map
@@ -1,39 +1,42 @@
1
- {
2
- "type": "object",
3
- "properties": {
4
- "version": {
5
- "type": "string",
6
- "description": "version of the rc package used to generate the nodesecurerc file"
7
- },
8
- "i18n": {
9
- "type": "string",
10
- "enum": [
11
- "french",
12
- "english"
13
- ],
14
- "default": "english",
15
- "description": "Language to use for i18n"
16
- },
17
- "strategy": {
18
- "type": "string",
19
- "enum": [
20
- "npm",
21
- "node",
22
- "snyk",
23
- "none"
24
- ],
25
- "default": "npm",
26
- "description": "Vulnerability strategy to use"
27
- },
28
- "ci": {
29
- "$ref": "#/$defs/ci"
30
- },
31
- "report": {
32
- "$ref": "#/$defs/report"
33
- }
34
- },
35
- "required": [
36
- "version"
37
- ],
38
- "additionalProperties": false
39
- }
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "version": {
5
+ "type": "string",
6
+ "description": "version of the rc package used to generate the nodesecurerc file"
7
+ },
8
+ "i18n": {
9
+ "type": "string",
10
+ "enum": [
11
+ "french",
12
+ "english"
13
+ ],
14
+ "default": "english",
15
+ "description": "Language to use for i18n"
16
+ },
17
+ "strategy": {
18
+ "type": "string",
19
+ "enum": [
20
+ "npm",
21
+ "node",
22
+ "snyk",
23
+ "none"
24
+ ],
25
+ "default": "npm",
26
+ "description": "Vulnerability strategy to use"
27
+ },
28
+ "scanner": {
29
+ "$ref": "#/$defs/scanner"
30
+ },
31
+ "ci": {
32
+ "$ref": "#/$defs/ci"
33
+ },
34
+ "report": {
35
+ "$ref": "#/$defs/report"
36
+ }
37
+ },
38
+ "required": [
39
+ "version"
40
+ ],
41
+ "additionalProperties": false
42
+ }
@@ -1 +1 @@
1
- export * from "./readJSON.js";
1
+ export * from "./readJSON.js";
@@ -1,2 +1,2 @@
1
- export * from "./readJSON.js";
1
+ export * from "./readJSON.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- export declare function readJSONSync(path: string, base?: string | URL): any;
1
+ export declare function readJSONSync(path: string, base?: string | URL): any;
@@ -1,7 +1,7 @@
1
- // Import Node.js Dependencies
2
- import { readFileSync } from "node:fs";
3
- export function readJSONSync(path, base) {
4
- const buf = readFileSync(typeof base === "string" ? new URL(path, base) : path);
5
- return JSON.parse(buf.toString());
6
- }
1
+ // Import Node.js Dependencies
2
+ import { readFileSync } from "node:fs";
3
+ export function readJSONSync(path, base) {
4
+ const buf = readFileSync(typeof base === "string" ? new URL(path, base) : path);
5
+ return JSON.parse(buf.toString());
6
+ }
7
7
  //# sourceMappingURL=readJSON.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nodesecure/rc",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "NodeSecure runtime configuration",
5
5
  "exports": "./dist/index.js",
6
6
  "type": "module",
@@ -35,31 +35,30 @@
35
35
  },
36
36
  "homepage": "https://github.com/NodeSecure/rc#readme",
37
37
  "devDependencies": {
38
- "@nodesecure/eslint-config": "^1.6.0",
39
- "@types/chai": "^4.3.4",
38
+ "@nodesecure/eslint-config": "^1.8.0",
39
+ "@types/chai": "^4.3.5",
40
40
  "@types/lodash.merge": "^4.6.7",
41
41
  "@types/mocha": "^10.0.1",
42
- "@types/node": "^18.11.18",
43
- "@types/zen-observable": "^0.8.3",
42
+ "@types/node": "^20.5.8",
43
+ "@types/zen-observable": "^0.8.4",
44
44
  "ajv": "^8.12.0",
45
- "c8": "^7.12.0",
46
- "chai": "^4.3.7",
47
- "eslint": "^8.32.0",
48
- "lodash.merge": "^4.6.2",
45
+ "c8": "^8.0.1",
46
+ "chai": "^4.3.8",
47
+ "eslint": "^8.48.0",
49
48
  "mocha": "^10.2.0",
50
- "tape": "^5.6.3",
49
+ "tape": "^5.6.6",
51
50
  "ts-node": "^10.9.1",
52
- "tsd": "^0.25.0",
53
- "typescript": "^4.9.4"
51
+ "tsd": "^0.29.0",
52
+ "typescript": "^5.2.2"
54
53
  },
55
54
  "dependencies": {
56
- "@nodesecure/i18n": "^2.1.1",
57
- "@nodesecure/js-x-ray": "^5.1.0",
55
+ "@nodesecure/i18n": "^3.3.0",
56
+ "@nodesecure/js-x-ray": "^6.1.1",
58
57
  "@nodesecure/vuln": "^1.7.0",
58
+ "@openally/result": "^1.2.0",
59
59
  "@slimio/config": "^1.2.0",
60
- "ts-results": "^3.3.0",
61
- "tslib": "^2.4.1",
62
- "type-fest": "^3.5.3"
60
+ "lodash.merge": "^4.6.2",
61
+ "type-fest": "^4.3.1"
63
62
  },
64
63
  "tsd": {
65
64
  "directory": "test/types",