@nodesecure/rc 1.2.0 → 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 -11
- 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 +19 -18
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,13 +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
|
+

|
|
7
9
|
|
|
8
10
|
NodeSecure runtime configuration.
|
|
9
11
|
|
|
10
12
|
## Requirements
|
|
13
|
+
|
|
11
14
|
- [Node.js](https://nodejs.org/en/) v16 or higher
|
|
12
15
|
|
|
13
16
|
## Getting Started
|
|
@@ -34,18 +37,17 @@ console.log(configurationPayload);
|
|
|
34
37
|
```
|
|
35
38
|
|
|
36
39
|
Write:
|
|
40
|
+
|
|
37
41
|
```ts
|
|
38
42
|
import assert from "node:assert/strict";
|
|
39
43
|
import * as RC from "@nodesecure/rc";
|
|
40
44
|
|
|
41
45
|
const writeOpts: RC.writeOptions = {
|
|
42
46
|
payload: { version: "2.0.0" },
|
|
43
|
-
partialUpdate: true
|
|
47
|
+
partialUpdate: true,
|
|
44
48
|
};
|
|
45
49
|
|
|
46
|
-
const result = (
|
|
47
|
-
await RC.write(void 0, writeOpts)
|
|
48
|
-
).unwrap();
|
|
50
|
+
const result = (await RC.write(void 0, writeOpts)).unwrap();
|
|
49
51
|
assert.strictEqual(result, void 0);
|
|
50
52
|
```
|
|
51
53
|
|
|
@@ -73,7 +75,10 @@ interface createReadOptions {
|
|
|
73
75
|
createMode?: RCGenerationMode | RCGenerationMode[];
|
|
74
76
|
}
|
|
75
77
|
|
|
76
|
-
export type readOptions = RequireAtLeastOne<
|
|
78
|
+
export type readOptions = RequireAtLeastOne<
|
|
79
|
+
createReadOptions,
|
|
80
|
+
"createIfDoesNotExist" | "createMode"
|
|
81
|
+
>;
|
|
77
82
|
```
|
|
78
83
|
|
|
79
84
|
The `createIfDoesNotExist` argument can be ignored if `createMode` is provided.
|
|
@@ -145,7 +150,7 @@ Note that you can combine several modes:
|
|
|
145
150
|
```ts
|
|
146
151
|
import * as RC from "@nodesecure/rc";
|
|
147
152
|
|
|
148
|
-
await RC.read(void 0, { createMode: ["ci", "report"] })
|
|
153
|
+
await RC.read(void 0, { createMode: ["ci", "report"] });
|
|
149
154
|
```
|
|
150
155
|
|
|
151
156
|
## JSON Schema
|
|
@@ -153,6 +158,7 @@ await RC.read(void 0, { createMode: ["ci", "report"] })
|
|
|
153
158
|
The runtime configuration is validated with a JSON Schema: `./src/schema/nodesecurerc.json`.
|
|
154
159
|
|
|
155
160
|
It can be retrieved by API if required:
|
|
161
|
+
|
|
156
162
|
```ts
|
|
157
163
|
import * as RC from "@nodesecure/rc";
|
|
158
164
|
|
|
@@ -162,7 +168,9 @@ console.log(RC.JSONSchema);
|
|
|
162
168
|
## Contributors ✨
|
|
163
169
|
|
|
164
170
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
171
|
+
|
|
165
172
|
[](#contributors-)
|
|
173
|
+
|
|
166
174
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
167
175
|
|
|
168
176
|
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
|
@@ -184,4 +192,5 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
184
192
|
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
185
193
|
|
|
186
194
|
## License
|
|
195
|
+
|
|
187
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,30 +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": "^
|
|
42
|
-
"@types/node": "^18.
|
|
41
|
+
"@types/mocha": "^10.0.1",
|
|
42
|
+
"@types/node": "^18.11.18",
|
|
43
43
|
"@types/zen-observable": "^0.8.3",
|
|
44
|
-
"ajv": "^8.
|
|
45
|
-
"c8": "^7.
|
|
46
|
-
"chai": "^4.3.
|
|
47
|
-
"eslint": "^8.
|
|
44
|
+
"ajv": "^8.12.0",
|
|
45
|
+
"c8": "^7.12.0",
|
|
46
|
+
"chai": "^4.3.7",
|
|
47
|
+
"eslint": "^8.32.0",
|
|
48
48
|
"lodash.merge": "^4.6.2",
|
|
49
|
-
"mocha": "^
|
|
50
|
-
"tape": "^5.
|
|
51
|
-
"ts-node": "^10.
|
|
52
|
-
"tsd": "^0.
|
|
53
|
-
"typescript": "^4.
|
|
49
|
+
"mocha": "^10.2.0",
|
|
50
|
+
"tape": "^5.6.3",
|
|
51
|
+
"ts-node": "^10.9.1",
|
|
52
|
+
"tsd": "^0.25.0",
|
|
53
|
+
"typescript": "^4.9.4"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@nodesecure/i18n": "^1.
|
|
57
|
-
"@nodesecure/js-x-ray": "^5.0
|
|
56
|
+
"@nodesecure/i18n": "^2.1.1",
|
|
57
|
+
"@nodesecure/js-x-ray": "^5.1.0",
|
|
58
58
|
"@nodesecure/vuln": "^1.7.0",
|
|
59
|
-
"@slimio/config": "^1.0
|
|
59
|
+
"@slimio/config": "^1.2.0",
|
|
60
60
|
"ts-results": "^3.3.0",
|
|
61
|
-
"
|
|
61
|
+
"tslib": "^2.4.1",
|
|
62
|
+
"type-fest": "^3.5.3"
|
|
62
63
|
},
|
|
63
64
|
"tsd": {
|
|
64
65
|
"directory": "test/types",
|