@prodcycle/prodcycle 0.4.1 → 0.4.2
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/dist/api-client.d.ts +1 -1
- package/dist/api-client.js +6 -1
- package/dist/cli.js +12 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/api-client.d.ts
CHANGED
|
@@ -21,6 +21,6 @@ export declare class ComplianceApiClient {
|
|
|
21
21
|
private apiKey;
|
|
22
22
|
constructor(apiUrl?: string, apiKey?: string);
|
|
23
23
|
validate(files: Record<string, string>, frameworks: string[], options?: ScanOptions): Promise<any>;
|
|
24
|
-
hook(files: Record<string, string>, frameworks: string[]): Promise<any>;
|
|
24
|
+
hook(files: Record<string, string>, frameworks: string[], options?: ScanOptions): Promise<any>;
|
|
25
25
|
private post;
|
|
26
26
|
}
|
package/dist/api-client.js
CHANGED
|
@@ -22,10 +22,15 @@ class ComplianceApiClient {
|
|
|
22
22
|
},
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
async hook(files, frameworks) {
|
|
25
|
+
async hook(files, frameworks, options = {}) {
|
|
26
26
|
return this.post('/v1/compliance/hook', {
|
|
27
27
|
files,
|
|
28
28
|
frameworks,
|
|
29
|
+
options: {
|
|
30
|
+
severity_threshold: options.severityThreshold,
|
|
31
|
+
fail_on: options.failOn,
|
|
32
|
+
...options.config,
|
|
33
|
+
},
|
|
29
34
|
});
|
|
30
35
|
}
|
|
31
36
|
async post(endpoint, data) {
|
package/dist/cli.js
CHANGED
|
@@ -95,10 +95,21 @@ function parseList(val) {
|
|
|
95
95
|
.filter(Boolean);
|
|
96
96
|
}
|
|
97
97
|
const program = new commander_1.Command();
|
|
98
|
+
// Load version from package.json at runtime so CLI --version stays in sync with
|
|
99
|
+
// the published package version without requiring a source edit per release.
|
|
100
|
+
const PKG_VERSION = (() => {
|
|
101
|
+
try {
|
|
102
|
+
const pkgPath = path.join(__dirname, '..', 'package.json');
|
|
103
|
+
return JSON.parse(fs.readFileSync(pkgPath, 'utf-8')).version ?? '0.0.0';
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
return '0.0.0';
|
|
107
|
+
}
|
|
108
|
+
})();
|
|
98
109
|
program
|
|
99
110
|
.name('prodcycle')
|
|
100
111
|
.description('Multi-framework policy-as-code compliance scanner for infrastructure and application code.')
|
|
101
|
-
.version(
|
|
112
|
+
.version(PKG_VERSION);
|
|
102
113
|
// ── scan ────────────────────────────────────────────────────────────────────
|
|
103
114
|
program
|
|
104
115
|
.command('scan [repo_path]')
|
package/dist/index.js
CHANGED
|
@@ -53,7 +53,7 @@ async function scan(params) {
|
|
|
53
53
|
async function gate(options) {
|
|
54
54
|
const { files, frameworks = ['soc2'], ...scanOpts } = options;
|
|
55
55
|
const client = new api_client_1.ComplianceApiClient(options.apiUrl, options.apiKey);
|
|
56
|
-
const response = await client.hook(files, frameworks);
|
|
56
|
+
const response = await client.hook(files, frameworks, scanOpts);
|
|
57
57
|
return {
|
|
58
58
|
passed: response.passed,
|
|
59
59
|
exitCode: response.passed ? 0 : 1,
|
package/package.json
CHANGED