@nodesecure/rc 1.4.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.
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  <img src="https://img.shields.io/badge/dynamic/json.svg?style=for-the-badge&url=https://raw.githubusercontent.com/NodeSecure/rc/master/package.json&query=$.version&label=Version" alt="npm version">
8
8
  </a>
9
9
  <a href="https://github.com/NodeSecure/rc/blob/master/LICENSE">
10
- <img src="https://img.shields.io/github/license/Naereen/StrapDown.js.svg?style=for-the-badge" alt="license">
10
+ <img src="https://img.shields.io/github/license/NodeSecure/rc.svg?style=for-the-badge" alt="license">
11
11
  </a>
12
12
  <a href="https://api.securityscorecards.dev/projects/github.com/NodeSecure/rc">
13
13
  <img src="https://api.securityscorecards.dev/projects/github.com/NodeSecure/rc/badge?style=for-the-badge" alt="ossf scorecard">
@@ -77,7 +77,7 @@ const memoizedPayload = RC.memoized();
77
77
  assert.deepEqual(configurationPayload, memoizedPayload);
78
78
  ```
79
79
 
80
- > 👀 .read and .write return Rust like [Result](https://doc.rust-lang.org/std/result/) object. Under the hood we use [ts-results](https://github.com/vultix/ts-results) to achieve this.
80
+ > 👀 .read and .write return Rust like [Result](https://doc.rust-lang.org/std/result/) object.
81
81
 
82
82
  ## API
83
83
 
@@ -194,7 +194,7 @@ assert.strictEqual(RC.CONSTANTS.CONFIGURATION_NAME, ".nodesecurerc");
194
194
  We provide by default a configuration generation that we consider `minimal`. On the contrary, a `complete` value will indicate the generation with all possible default keys.
195
195
 
196
196
  ```ts
197
- export type RCGenerationMode = "minimal" | "ci" | "report" | "complete";
197
+ export type RCGenerationMode = "minimal" | "ci" | "report" | "scanner" | "complete";
198
198
  ```
199
199
 
200
200
  However, depending on the NodeSecure tool you are working on, it can be interesting to generate a configuration with some property sets specific to your needs.
@@ -1,2 +1,2 @@
1
- export declare const CONFIGURATION_NAME = ".nodesecurerc";
2
- export declare const GLOBAL_CONFIGURATION_DIRECTORY = "nodesecure";
1
+ export declare const CONFIGURATION_NAME = ".nodesecurerc";
2
+ export declare const GLOBAL_CONFIGURATION_DIRECTORY = "nodesecure";
package/dist/constants.js CHANGED
@@ -1,3 +1,3 @@
1
- export const CONFIGURATION_NAME = ".nodesecurerc";
2
- export const GLOBAL_CONFIGURATION_DIRECTORY = "nodesecure";
1
+ export const CONFIGURATION_NAME = ".nodesecurerc";
2
+ export const GLOBAL_CONFIGURATION_DIRECTORY = "nodesecure";
3
3
  //# sourceMappingURL=constants.js.map
@@ -1,14 +1,14 @@
1
- import { RC } from "../rc.js";
2
- export interface memoizeOptions {
3
- /**
4
- * If enabled it will overwrite (crush) the previous memoized RC
5
- * @default true
6
- */
7
- overwrite?: boolean;
8
- }
9
- export declare function memoize(payload: Partial<RC>, options?: memoizeOptions): void;
10
- export interface memoizedOptions {
11
- defaultValue: Partial<RC>;
12
- }
13
- export declare function memoized(options?: memoizedOptions): Partial<RC> | null;
14
- export declare function clearMemoized(): void;
1
+ import { RC } from "../rc.js";
2
+ export interface memoizeOptions {
3
+ /**
4
+ * If enabled it will overwrite (crush) the previous memoized RC
5
+ * @default true
6
+ */
7
+ overwrite?: boolean;
8
+ }
9
+ export declare function memoize(payload: Partial<RC>, options?: memoizeOptions): void;
10
+ export interface memoizedOptions {
11
+ defaultValue: Partial<RC>;
12
+ }
13
+ export declare function memoized(options?: memoizedOptions): Partial<RC> | null;
14
+ export declare function clearMemoized(): void;
@@ -1,20 +1,20 @@
1
- // Import Third-party Dependencies
2
- import merge from "lodash.merge";
3
- let memoizedValue = null;
4
- export function memoize(payload, options = {}) {
5
- const { overwrite = true } = options;
6
- if (memoizedValue === null || overwrite) {
7
- memoizedValue = payload;
8
- }
9
- else {
10
- memoizedValue = merge({}, memoizedValue, payload);
11
- }
12
- }
13
- export function memoized(options) {
14
- const { defaultValue = null } = options ?? {};
15
- return memoizedValue ?? defaultValue;
16
- }
17
- export function clearMemoized() {
18
- memoizedValue = null;
19
- }
1
+ // Import Third-party Dependencies
2
+ import merge from "lodash.merge";
3
+ let memoizedValue = null;
4
+ export function memoize(payload, options = {}) {
5
+ const { overwrite = true } = options;
6
+ if (memoizedValue === null || overwrite) {
7
+ memoizedValue = payload;
8
+ }
9
+ else {
10
+ memoizedValue = merge({}, memoizedValue, payload);
11
+ }
12
+ }
13
+ export function memoized(options) {
14
+ const { defaultValue = null } = options ?? {};
15
+ return memoizedValue ?? defaultValue;
16
+ }
17
+ export function clearMemoized() {
18
+ memoizedValue = null;
19
+ }
20
20
  //# sourceMappingURL=memoize.js.map
@@ -1,27 +1,27 @@
1
- /// <reference types="node" />
2
- import { Result } from "ts-results";
3
- import { RequireAtLeastOne } from "type-fest";
4
- import { RC, RCGenerationMode } from "../rc.js";
5
- interface createReadOptions {
6
- /**
7
- * If enabled the file will be created if it does not exist on the disk.
8
- *
9
- * @default false
10
- */
11
- createIfDoesNotExist?: boolean;
12
- /**
13
- * RC Generation mode. This option allows to generate a more or less complete configuration for some NodeSecure tools.
14
- *
15
- * @default `minimal`
16
- */
17
- createMode?: RCGenerationMode | RCGenerationMode[];
18
- /**
19
- * RC automatic caching option. This option allows to cache a configuration passed in parameter.
20
- *
21
- * @default false
22
- */
23
- memoize?: boolean;
24
- }
25
- export type readOptions = RequireAtLeastOne<createReadOptions, "createIfDoesNotExist" | "createMode">;
26
- export declare function read(location?: string, options?: readOptions): Promise<Result<RC, NodeJS.ErrnoException>>;
27
- export {};
1
+ /// <reference types="node" />
2
+ import { Result } from "@openally/result";
3
+ import { RequireAtLeastOne } from "type-fest";
4
+ import { RC, RCGenerationMode } from "../rc.js";
5
+ interface createReadOptions {
6
+ /**
7
+ * If enabled the file will be created if it does not exist on the disk.
8
+ *
9
+ * @default false
10
+ */
11
+ createIfDoesNotExist?: boolean;
12
+ /**
13
+ * RC Generation mode. This option allows to generate a more or less complete configuration for some NodeSecure tools.
14
+ *
15
+ * @default `minimal`
16
+ */
17
+ createMode?: RCGenerationMode | RCGenerationMode[];
18
+ /**
19
+ * RC automatic caching option. This option allows to cache a configuration passed in parameter.
20
+ *
21
+ * @default false
22
+ */
23
+ memoize?: boolean;
24
+ }
25
+ export type readOptions = RequireAtLeastOne<createReadOptions, "createIfDoesNotExist" | "createMode">;
26
+ export declare function read(location?: string, options?: readOptions): Promise<Result<RC, NodeJS.ErrnoException>>;
27
+ export {};
@@ -1,36 +1,34 @@
1
- // Import Node.js Dependencies
2
- import path from "node:path";
3
- import { once } from "node:events";
4
- // Import Third-party Dependencies
5
- import Config from "@slimio/config";
6
- import TR from "ts-results";
7
- // Import Internal Dependencies
8
- import { JSONSchema, generateDefaultRC } from "../rc.js";
9
- import * as CONSTANTS from "../constants.js";
10
- import { memoize } from "./memoize.js";
11
- // CONSTANTS
12
- const { Ok, Err } = TR;
13
- export async function read(location = process.cwd(), options = Object.create(null)) {
14
- try {
15
- const { createIfDoesNotExist = Boolean(options.createMode), createMode, memoize: memoizeRc = false } = options;
16
- const cfgPath = path.join(location, CONSTANTS.CONFIGURATION_NAME);
17
- const cfg = new Config(cfgPath, {
18
- defaultSchema: JSONSchema,
19
- createOnNoEntry: createIfDoesNotExist
20
- });
21
- await cfg.read(createIfDoesNotExist ? generateDefaultRC(createMode) : void 0);
22
- if (createIfDoesNotExist) {
23
- await once(cfg, "configWritten");
24
- }
25
- const result = cfg.payload;
26
- if (memoizeRc) {
27
- memoize(result);
28
- }
29
- await cfg.close();
30
- return new Ok(result);
31
- }
32
- catch (error) {
33
- return new Err(error);
34
- }
35
- }
1
+ // Import Node.js Dependencies
2
+ import path from "node:path";
3
+ import { once } from "node:events";
4
+ // Import Third-party Dependencies
5
+ import Config from "@slimio/config";
6
+ import { Ok, Err } from "@openally/result";
7
+ // Import Internal Dependencies
8
+ import { JSONSchema, generateDefaultRC } from "../rc.js";
9
+ import * as CONSTANTS from "../constants.js";
10
+ import { memoize } from "./memoize.js";
11
+ export async function read(location = process.cwd(), options = Object.create(null)) {
12
+ try {
13
+ const { createIfDoesNotExist = Boolean(options.createMode), createMode, memoize: memoizeRc = false } = options;
14
+ const cfgPath = path.join(location, CONSTANTS.CONFIGURATION_NAME);
15
+ const cfg = new Config(cfgPath, {
16
+ defaultSchema: JSONSchema,
17
+ createOnNoEntry: createIfDoesNotExist
18
+ });
19
+ await cfg.read(createIfDoesNotExist ? generateDefaultRC(createMode) : void 0);
20
+ if (createIfDoesNotExist) {
21
+ await once(cfg, "configWritten");
22
+ }
23
+ const result = cfg.payload;
24
+ if (memoizeRc) {
25
+ memoize(result);
26
+ }
27
+ await cfg.close();
28
+ return Ok(result);
29
+ }
30
+ catch (error) {
31
+ return Err(error);
32
+ }
33
+ }
36
34
  //# sourceMappingURL=read.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"read.js","sourceRoot":"","sources":["../../src/functions/read.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,kCAAkC;AAClC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAc,MAAM,YAAY,CAAC;AAGxC,+BAA+B;AAC/B,OAAO,EAAM,UAAU,EAAE,iBAAiB,EAAoB,MAAM,UAAU,CAAC;AAC/E,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,YAAY;AACZ,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AA0BvB,MAAM,CAAC,KAAK,UAAU,IAAI,CACxB,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,EACxB,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAE1C,IAAI;QACF,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC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AI,CACxB,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,EACxB,UAAuB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAE1C,IAAI;QACF,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;QAE/G,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,kBAAkB,CAAC,CAAC;QAClE,MAAM,GAAG,GAAG,IAAI,MAAM,CAAK,OAAO,EAAE;YAClC,aAAa,EAAE,UAAU;YACzB,eAAe,EAAE,oBAAoB;SACtC,CAAC,CAAC;QAEH,MAAM,GAAG,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QAC9E,IAAI,oBAAoB,EAAE;YACxB,MAAM,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;SAClC;QACD,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;QAE3B,IAAI,SAAS,EAAE;YACb,OAAO,CAAC,MAAM,CAAC,CAAC;SACjB;QAED,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC;QAElB,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC;KACnB;IACD,OAAO,KAAK,EAAE;QACZ,OAAO,GAAG,CAAC,KAA8B,CAAC,CAAC;KAC5C;AACH,CAAC"}
@@ -1,19 +1,19 @@
1
- /// <reference types="node" />
2
- import { Result } from "ts-results";
3
- import { RC } from "../rc.js";
4
- /**
5
- * Overwrite the complete payload. partialUpdate property is mandatory.
6
- */
7
- export interface writeCompletePayload {
8
- payload: RC;
9
- partialUpdate?: false;
10
- }
11
- /**
12
- * Partially update the payload. This implies not to rewrite the content of the file when enabled.
13
- **/
14
- export interface writePartialPayload {
15
- payload: Partial<RC>;
16
- partialUpdate: true;
17
- }
18
- export type writeOptions = writeCompletePayload | writePartialPayload;
19
- export declare function write(location: string | undefined, options: writeOptions): Promise<Result<void, NodeJS.ErrnoException>>;
1
+ /// <reference types="node" />
2
+ import { Result } from "@openally/result";
3
+ import { RC } from "../rc.js";
4
+ /**
5
+ * Overwrite the complete payload. partialUpdate property is mandatory.
6
+ */
7
+ export interface writeCompletePayload {
8
+ payload: RC;
9
+ partialUpdate?: false;
10
+ }
11
+ /**
12
+ * Partially update the payload. This implies not to rewrite the content of the file when enabled.
13
+ **/
14
+ export interface writePartialPayload {
15
+ payload: Partial<RC>;
16
+ partialUpdate: true;
17
+ }
18
+ export type writeOptions = writeCompletePayload | writePartialPayload;
19
+ export declare function write(location: string | undefined, options: writeOptions): Promise<Result<void, NodeJS.ErrnoException>>;
@@ -1,28 +1,26 @@
1
- // Import Node.js Dependencies
2
- import path from "path";
3
- // Import Third-party Dependencies
4
- import Config from "@slimio/config";
5
- import TR from "ts-results";
6
- // Import Internal Dependencies
7
- import { JSONSchema } from "../rc.js";
8
- import * as CONSTANTS from "../constants.js";
9
- // CONSTANTS
10
- const { Ok, Err } = TR;
11
- export async function write(location = process.cwd(), options) {
12
- try {
13
- const { payload, partialUpdate = false } = options;
14
- const cfgPath = path.join(location, CONSTANTS.CONFIGURATION_NAME);
15
- const cfg = new Config(cfgPath, {
16
- defaultSchema: JSONSchema
17
- });
18
- await cfg.read();
19
- const newPayloadValue = partialUpdate ? Object.assign(cfg.payload, payload) : payload;
20
- cfg.payload = newPayloadValue;
21
- await cfg.close();
22
- return new Ok(void 0);
23
- }
24
- catch (error) {
25
- return new Err(error);
26
- }
27
- }
1
+ // Import Node.js Dependencies
2
+ import path from "path";
3
+ // Import Third-party Dependencies
4
+ import Config from "@slimio/config";
5
+ import { Ok, Err } from "@openally/result";
6
+ // Import Internal Dependencies
7
+ import { JSONSchema } from "../rc.js";
8
+ import * as CONSTANTS from "../constants.js";
9
+ export async function write(location = process.cwd(), options) {
10
+ try {
11
+ const { payload, partialUpdate = false } = options;
12
+ const cfgPath = path.join(location, CONSTANTS.CONFIGURATION_NAME);
13
+ const cfg = new Config(cfgPath, {
14
+ defaultSchema: JSONSchema
15
+ });
16
+ await cfg.read();
17
+ const newPayloadValue = partialUpdate ? Object.assign(cfg.payload, payload) : payload;
18
+ cfg.payload = newPayloadValue;
19
+ await cfg.close();
20
+ return Ok(void 0);
21
+ }
22
+ catch (error) {
23
+ return Err(error);
24
+ }
25
+ }
28
26
  //# sourceMappingURL=write.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"write.js","sourceRoot":"","sources":["../../src/functions/write.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,kCAAkC;AAClC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAc,MAAM,YAAY,CAAC;AAExC,+BAA+B;AAC/B,OAAO,EAAM,UAAU,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAC;AAE7C,YAAY;AACZ,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAoBvB,MAAM,CAAC,KAAK,UAAU,KAAK,CACzB,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,EACxB,OAAqB;IAErB,IAAI;QACF,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;QAEnD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,kBAAkB,CAAC,CAAC;QAClE,MAAM,GAAG,GAAG,IAAI,MAAM,CAAK,OAAO,EAAE;YAClC,aAAa,EAAE,UAAU;SAC1B,CAAC,CAAC;QACH,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAEjB,MAAM,eAAe,GAAG,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,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AAC;QAE9B,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC;QAElB,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;KACnB;IACD,OAAO,KAAK,EAAE;QACZ,OAAO,GAAG,CAAC,KAA8B,CAAC,CAAC;KAC5C;AACH,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export * from "./functions/read.js";
2
- export * from "./functions/write.js";
3
- export * from "./functions/memoize.js";
4
- export * as CONSTANTS from "./constants.js";
5
- export { RC, JSONSchema, homedir } from "./rc.js";
1
+ export * from "./functions/read.js";
2
+ export * from "./functions/write.js";
3
+ export * from "./functions/memoize.js";
4
+ export * as CONSTANTS from "./constants.js";
5
+ export { RC, Author, JSONSchema, homedir } from "./rc.js";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export * from "./functions/read.js";
2
- export * from "./functions/write.js";
3
- export * from "./functions/memoize.js";
4
- export * as CONSTANTS from "./constants.js";
5
- export { JSONSchema, homedir } from "./rc.js";
1
+ export * from "./functions/read.js";
2
+ export * from "./functions/write.js";
3
+ export * from "./functions/memoize.js";
4
+ export * as CONSTANTS from "./constants.js";
5
+ export { JSONSchema, homedir } from "./rc.js";
6
6
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAM,UAAU,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAc,UAAU,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC"}
@@ -1,25 +1,25 @@
1
- import * as jsxray from "@nodesecure/js-x-ray";
2
- /**
3
- * Configuration dedicated for NodeSecure CI (or nsci)
4
- * @see https://github.com/NodeSecure/ci
5
- * @see https://github.com/NodeSecure/ci-action
6
- */
7
- export interface CiConfiguration {
8
- /**
9
- * List of enabled reporters
10
- * @see https://github.com/NodeSecure/ci#reporters
11
- */
12
- reporters?: ("console" | "html")[];
13
- vulnerabilities?: {
14
- severity?: "medium" | "high" | "critical" | "all";
15
- };
16
- /**
17
- * JS-X-Ray warnings configuration
18
- * @see https://github.com/NodeSecure/js-x-ray#warnings-legends-v20
19
- */
20
- warnings?: CiWarnings | Record<jsxray.WarningName, CiWarnings>;
21
- }
22
- export type CiWarnings = "off" | "error" | "warning";
23
- export declare function generateCIConfiguration(): {
24
- ci: CiConfiguration;
25
- };
1
+ import * as jsxray from "@nodesecure/js-x-ray";
2
+ /**
3
+ * Configuration dedicated for NodeSecure CI (or nsci)
4
+ * @see https://github.com/NodeSecure/ci
5
+ * @see https://github.com/NodeSecure/ci-action
6
+ */
7
+ export interface CiConfiguration {
8
+ /**
9
+ * List of enabled reporters
10
+ * @see https://github.com/NodeSecure/ci#reporters
11
+ */
12
+ reporters?: ("console" | "html")[];
13
+ vulnerabilities?: {
14
+ severity?: "medium" | "high" | "critical" | "all";
15
+ };
16
+ /**
17
+ * JS-X-Ray warnings configuration
18
+ * @see https://github.com/NodeSecure/js-x-ray#warnings-legends-v20
19
+ */
20
+ warnings?: CiWarnings | Record<jsxray.WarningName, CiWarnings>;
21
+ }
22
+ export type CiWarnings = "off" | "error" | "warning";
23
+ export declare function generateCIConfiguration(): {
24
+ ci: CiConfiguration;
25
+ };
@@ -1,11 +1,11 @@
1
- export function generateCIConfiguration() {
2
- const ci = {
3
- reporters: ["console"],
4
- vulnerabilities: {
5
- severity: "medium"
6
- },
7
- warnings: "error"
8
- };
9
- return { ci };
10
- }
1
+ export function generateCIConfiguration() {
2
+ const ci = {
3
+ reporters: ["console"],
4
+ vulnerabilities: {
5
+ severity: "medium"
6
+ },
7
+ warnings: "error"
8
+ };
9
+ return { ci };
10
+ }
11
11
  //# sourceMappingURL=ci.js.map
@@ -1,69 +1,69 @@
1
- /**
2
- * Configuration dedicated for NodeSecure Report
3
- * @see https://github.com/NodeSecure/report
4
- */
5
- export interface ReportConfiguration {
6
- /**
7
- * @default `light`
8
- */
9
- theme?: "light" | "dark";
10
- title: string;
11
- /**
12
- * URL to a logo to show on the final HTML/PDF Report
13
- */
14
- logoUrl: string;
15
- /**
16
- * Show/categorize internal dependencies as transitive
17
- * @default false
18
- */
19
- includeTransitiveInternal?: boolean;
20
- npm?: {
21
- /**
22
- * NPM organization prefix starting with @
23
- * @example `@nodesecure`
24
- */
25
- organizationPrefix: string;
26
- packages: string[];
27
- };
28
- git?: {
29
- /**
30
- * GitHub organization URL
31
- * @example `https://github.com/NodeSecure`
32
- */
33
- organizationUrl: string;
34
- /**
35
- * List of repositories (name are enough, no need to provide .git url or any equivalent)
36
- */
37
- repositories: string[];
38
- };
39
- /**
40
- * @default html,pdf
41
- */
42
- reporters?: ("html" | "pdf")[];
43
- charts?: ReportChart[];
44
- }
45
- export interface ReportChart {
46
- /**
47
- * List of available charts.
48
- */
49
- name: "Extensions" | "Licenses" | "Warnings" | "Flags";
50
- /**
51
- * @default true
52
- */
53
- display?: boolean;
54
- /**
55
- * Chart.js chart type.
56
- *
57
- * @see https://www.chartjs.org/docs/latest/charts
58
- * @default `bar`
59
- */
60
- type?: "bar" | "horizontalBar" | "polarArea" | "doughnut";
61
- /**
62
- * D3 Interpolation color. Will be picked randomly by default if not provided.
63
- * @see https://github.com/d3/d3-scale-chromatic/blob/main/README.md
64
- */
65
- interpolation?: string;
66
- }
67
- export declare function generateReportConfiguration(): {
68
- report: Partial<ReportConfiguration>;
69
- };
1
+ /**
2
+ * Configuration dedicated for NodeSecure Report
3
+ * @see https://github.com/NodeSecure/report
4
+ */
5
+ export interface ReportConfiguration {
6
+ /**
7
+ * @default `light`
8
+ */
9
+ theme?: "light" | "dark";
10
+ title: string;
11
+ /**
12
+ * URL to a logo to show on the final HTML/PDF Report
13
+ */
14
+ logoUrl: string;
15
+ /**
16
+ * Show/categorize internal dependencies as transitive
17
+ * @default false
18
+ */
19
+ includeTransitiveInternal?: boolean;
20
+ npm?: {
21
+ /**
22
+ * NPM organization prefix starting with @
23
+ * @example `@nodesecure`
24
+ */
25
+ organizationPrefix: string;
26
+ packages: string[];
27
+ };
28
+ git?: {
29
+ /**
30
+ * GitHub organization URL
31
+ * @example `https://github.com/NodeSecure`
32
+ */
33
+ organizationUrl: string;
34
+ /**
35
+ * List of repositories (name are enough, no need to provide .git url or any equivalent)
36
+ */
37
+ repositories: string[];
38
+ };
39
+ /**
40
+ * @default html,pdf
41
+ */
42
+ reporters?: ("html" | "pdf")[];
43
+ charts?: ReportChart[];
44
+ }
45
+ export interface ReportChart {
46
+ /**
47
+ * List of available charts.
48
+ */
49
+ name: "Extensions" | "Licenses" | "Warnings" | "Flags";
50
+ /**
51
+ * @default true
52
+ */
53
+ display?: boolean;
54
+ /**
55
+ * Chart.js chart type.
56
+ *
57
+ * @see https://www.chartjs.org/docs/latest/charts
58
+ * @default `bar`
59
+ */
60
+ type?: "bar" | "horizontalBar" | "polarArea" | "doughnut";
61
+ /**
62
+ * D3 Interpolation color. Will be picked randomly by default if not provided.
63
+ * @see https://github.com/d3/d3-scale-chromatic/blob/main/README.md
64
+ */
65
+ interpolation?: string;
66
+ }
67
+ export declare function generateReportConfiguration(): {
68
+ report: Partial<ReportConfiguration>;
69
+ };