@nodesecure/rc 1.2.1 → 1.3.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/LICENSE +21 -21
- package/README.md +20 -9
- package/dist/functions/read.d.ts +1 -1
- package/dist/functions/write.d.ts +1 -1
- package/dist/projects/ci.d.ts +1 -1
- package/dist/rc.d.ts +1 -1
- package/package.json +15 -15
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021 NodeSecure
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 NodeSecure
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
# rc
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
[
|
|
4
|
+
[](https://github.com/NodeSecure/rc/commit-activity)
|
|
5
|
+
[](https://github.com/NodeSecure/rc/blob/master/LICENSE)
|
|
6
|
+
[](https://api.securityscorecards.dev/projects/github.com/NodeSecure/rc)
|
|
8
|
+

|
|
5
9
|
|
|
6
10
|
NodeSecure runtime configuration.
|
|
7
11
|
|
|
8
12
|
## Requirements
|
|
13
|
+
|
|
9
14
|
- [Node.js](https://nodejs.org/en/) v16 or higher
|
|
10
15
|
|
|
11
16
|
## Getting Started
|
|
@@ -32,18 +37,17 @@ console.log(configurationPayload);
|
|
|
32
37
|
```
|
|
33
38
|
|
|
34
39
|
Write:
|
|
40
|
+
|
|
35
41
|
```ts
|
|
36
42
|
import assert from "node:assert/strict";
|
|
37
43
|
import * as RC from "@nodesecure/rc";
|
|
38
44
|
|
|
39
45
|
const writeOpts: RC.writeOptions = {
|
|
40
46
|
payload: { version: "2.0.0" },
|
|
41
|
-
partialUpdate: true
|
|
47
|
+
partialUpdate: true,
|
|
42
48
|
};
|
|
43
49
|
|
|
44
|
-
const result = (
|
|
45
|
-
await RC.write(void 0, writeOpts)
|
|
46
|
-
).unwrap();
|
|
50
|
+
const result = (await RC.write(void 0, writeOpts)).unwrap();
|
|
47
51
|
assert.strictEqual(result, void 0);
|
|
48
52
|
```
|
|
49
53
|
|
|
@@ -71,7 +75,10 @@ interface createReadOptions {
|
|
|
71
75
|
createMode?: RCGenerationMode | RCGenerationMode[];
|
|
72
76
|
}
|
|
73
77
|
|
|
74
|
-
export type readOptions = RequireAtLeastOne<
|
|
78
|
+
export type readOptions = RequireAtLeastOne<
|
|
79
|
+
createReadOptions,
|
|
80
|
+
"createIfDoesNotExist" | "createMode"
|
|
81
|
+
>;
|
|
75
82
|
```
|
|
76
83
|
|
|
77
84
|
The `createIfDoesNotExist` argument can be ignored if `createMode` is provided.
|
|
@@ -143,7 +150,7 @@ Note that you can combine several modes:
|
|
|
143
150
|
```ts
|
|
144
151
|
import * as RC from "@nodesecure/rc";
|
|
145
152
|
|
|
146
|
-
await RC.read(void 0, { createMode: ["ci", "report"] })
|
|
153
|
+
await RC.read(void 0, { createMode: ["ci", "report"] });
|
|
147
154
|
```
|
|
148
155
|
|
|
149
156
|
## JSON Schema
|
|
@@ -151,6 +158,7 @@ await RC.read(void 0, { createMode: ["ci", "report"] })
|
|
|
151
158
|
The runtime configuration is validated with a JSON Schema: `./src/schema/nodesecurerc.json`.
|
|
152
159
|
|
|
153
160
|
It can be retrieved by API if required:
|
|
161
|
+
|
|
154
162
|
```ts
|
|
155
163
|
import * as RC from "@nodesecure/rc";
|
|
156
164
|
|
|
@@ -160,7 +168,9 @@ console.log(RC.JSONSchema);
|
|
|
160
168
|
## Contributors ✨
|
|
161
169
|
|
|
162
170
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
171
|
+
|
|
163
172
|
[](#contributors-)
|
|
173
|
+
|
|
164
174
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
165
175
|
|
|
166
176
|
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
|
@@ -182,4 +192,5 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
182
192
|
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
183
193
|
|
|
184
194
|
## License
|
|
195
|
+
|
|
185
196
|
MIT
|
package/dist/functions/read.d.ts
CHANGED
|
@@ -16,6 +16,6 @@ interface createReadOptions {
|
|
|
16
16
|
*/
|
|
17
17
|
createMode?: RCGenerationMode | RCGenerationMode[];
|
|
18
18
|
}
|
|
19
|
-
export
|
|
19
|
+
export type readOptions = RequireAtLeastOne<createReadOptions, "createIfDoesNotExist" | "createMode">;
|
|
20
20
|
export declare function read(location?: string, options?: readOptions): Promise<Result<RC, NodeJS.ErrnoException>>;
|
|
21
21
|
export {};
|
|
@@ -15,5 +15,5 @@ export interface writePartialPayload {
|
|
|
15
15
|
payload: Partial<RC>;
|
|
16
16
|
partialUpdate: true;
|
|
17
17
|
}
|
|
18
|
-
export
|
|
18
|
+
export type writeOptions = writeCompletePayload | writePartialPayload;
|
|
19
19
|
export declare function write(location: string | undefined, options: writeOptions): Promise<Result<void, NodeJS.ErrnoException>>;
|
package/dist/projects/ci.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface CiConfiguration {
|
|
|
19
19
|
*/
|
|
20
20
|
warnings?: CiWarnings | Record<jsxray.WarningName, CiWarnings>;
|
|
21
21
|
}
|
|
22
|
-
export
|
|
22
|
+
export type CiWarnings = "off" | "error" | "warning";
|
|
23
23
|
export declare function generateCIConfiguration(): {
|
|
24
24
|
ci: CiConfiguration;
|
|
25
25
|
};
|
package/dist/rc.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export interface RC {
|
|
|
26
26
|
/** NodeSecure report Object configuration */
|
|
27
27
|
report?: ReportConfiguration;
|
|
28
28
|
}
|
|
29
|
-
export
|
|
29
|
+
export type RCGenerationMode = "minimal" | "ci" | "report" | "complete";
|
|
30
30
|
/**
|
|
31
31
|
* @example
|
|
32
32
|
* generateDefaultRC("complete");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nodesecure/rc",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "NodeSecure runtime configuration",
|
|
5
5
|
"exports": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -35,31 +35,31 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/NodeSecure/rc#readme",
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@nodesecure/eslint-config": "^1.
|
|
39
|
-
"@types/chai": "^4.3.
|
|
38
|
+
"@nodesecure/eslint-config": "^1.6.0",
|
|
39
|
+
"@types/chai": "^4.3.4",
|
|
40
40
|
"@types/lodash.merge": "^4.6.7",
|
|
41
|
-
"@types/mocha": "^10.0.
|
|
42
|
-
"@types/node": "^18.11.
|
|
41
|
+
"@types/mocha": "^10.0.1",
|
|
42
|
+
"@types/node": "^18.11.18",
|
|
43
43
|
"@types/zen-observable": "^0.8.3",
|
|
44
|
-
"ajv": "^8.
|
|
44
|
+
"ajv": "^8.12.0",
|
|
45
45
|
"c8": "^7.12.0",
|
|
46
|
-
"chai": "^4.3.
|
|
47
|
-
"eslint": "^8.
|
|
46
|
+
"chai": "^4.3.7",
|
|
47
|
+
"eslint": "^8.32.0",
|
|
48
48
|
"lodash.merge": "^4.6.2",
|
|
49
|
-
"mocha": "^10.
|
|
50
|
-
"tape": "^5.6.
|
|
49
|
+
"mocha": "^10.2.0",
|
|
50
|
+
"tape": "^5.6.3",
|
|
51
51
|
"ts-node": "^10.9.1",
|
|
52
|
-
"tsd": "^0.
|
|
53
|
-
"typescript": "^4.
|
|
52
|
+
"tsd": "^0.25.0",
|
|
53
|
+
"typescript": "^4.9.4"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@nodesecure/i18n": "^1.
|
|
56
|
+
"@nodesecure/i18n": "^2.1.1",
|
|
57
57
|
"@nodesecure/js-x-ray": "^5.1.0",
|
|
58
58
|
"@nodesecure/vuln": "^1.7.0",
|
|
59
|
-
"@slimio/config": "^1.
|
|
59
|
+
"@slimio/config": "^1.2.0",
|
|
60
60
|
"ts-results": "^3.3.0",
|
|
61
61
|
"tslib": "^2.4.1",
|
|
62
|
-
"type-fest": "^3.
|
|
62
|
+
"type-fest": "^3.5.3"
|
|
63
63
|
},
|
|
64
64
|
"tsd": {
|
|
65
65
|
"directory": "test/types",
|