@dataparade/cli 0.0.6 → 0.0.8
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 +3 -2
- package/dist/package.json +2 -2
- package/dist/src/ai-enrichment/providers/families/chat-completions-family.js +4 -1
- package/dist/src/ai-enrichment/providers/families/generate-content-family.js +3 -1
- package/dist/src/ai-enrichment/providers/families/messages-family.js +1 -1
- package/dist/src/ai-enrichment/providers/families/ollama-generate-family.js +1 -1
- package/dist/src/ai-enrichment/providers/types.d.ts +6 -0
- package/dist/src/cli.js +85 -41
- package/dist/src/config/env.js +7 -2
- package/dist/src/config/load-cli-env.d.ts +2 -0
- package/dist/src/config/load-cli-env.js +11 -2
- package/dist/src/config/redact.js +3 -0
- package/dist/src/config/validate-scan-ai.js +13 -7
- package/dist/src/core/pipeline/ai-orchestrator-options.js +8 -4
- package/dist/src/core/pipeline/orchestrator.js +1 -1
- package/dist/src/core/schema/scan-config.schema.d.ts +1 -0
- package/dist/src/core/schema/scan-config.schema.js +1 -0
- package/dist/src/core/types/config.d.ts +5 -0
- package/dist/src/platform-api/anonymous-ai-session-client.d.ts +14 -0
- package/dist/src/platform-api/anonymous-ai-session-client.js +40 -0
- package/dist/src/platform-api/read-cli-api-error-message.d.ts +18 -0
- package/dist/src/platform-api/read-cli-api-error-message.js +31 -0
- package/dist/src/platform-api/scan-quota-client.d.ts +5 -0
- package/dist/src/platform-api/scan-quota-client.js +24 -14
- package/dist/src/platform-api/upload-client.d.ts +10 -3
- package/dist/src/platform-api/upload-client.js +35 -16
- package/dist/src/platform-api/upload.types.d.ts +10 -5
- package/dist/src/upload/build-preview-url.d.ts +1 -0
- package/dist/src/upload/build-preview-url.js +6 -0
- package/dist/src/upload/run-upload.js +20 -4
- package/dist/src/upload/types.d.ts +2 -2
- package/dist/tests/cli/cli.spec.js +17 -3
- package/dist/tests/unit/ai-enrichment/provider-prompt-backend-contract.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/provider-prompt-backend-contract.spec.js +134 -0
- package/dist/tests/unit/ai-enrichment/providers/system-prompt-override.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/providers/system-prompt-override.spec.js +91 -0
- package/dist/tests/unit/cli/scan-command-ai-flags.spec.js +19 -0
- package/dist/tests/unit/cli/scan-command-diagram-graph.spec.js +10 -1
- package/dist/tests/unit/cli/scan-command-e2e-monorepo-app-plus-terraform.spec.js +12 -8
- package/dist/tests/unit/cli/scan-command-e2e-monorepo-front-back-sections.spec.js +10 -1
- package/dist/tests/unit/cli/scan-command-e2e-python-basic.spec.js +10 -1
- package/dist/tests/unit/cli/scan-command-e2e-terraform-basic.spec.js +12 -8
- package/dist/tests/unit/cli/scan-command-e2e-ts-sample.spec.js +10 -1
- package/dist/tests/unit/cli/scan-command-e2e-ts-sentry-route-env.spec.js +1 -1
- package/dist/tests/unit/cli/scan-command-exit-code.spec.js +23 -0
- package/dist/tests/unit/cli/scan-quota-flow.spec.js +44 -1
- package/dist/tests/unit/config/load-cli-env.spec.d.ts +1 -0
- package/dist/tests/unit/config/load-cli-env.spec.js +52 -0
- package/dist/tests/unit/config/redact.spec.js +1 -1
- package/dist/tests/unit/config/resolve-config.spec.js +1 -1
- package/dist/tests/unit/config/validate-scan-ai.spec.js +25 -0
- package/dist/tests/unit/core/ai-orchestrator-options-anon.spec.d.ts +1 -0
- package/dist/tests/unit/core/ai-orchestrator-options-anon.spec.js +29 -0
- package/dist/tests/unit/core/dependency-manifest-performance-budgets.spec.js +1 -1
- package/dist/tests/unit/core/graph-mapping.spec.js +1 -1
- package/dist/tests/unit/core/invariant-tests-dedupe-determinism.spec.js +1 -1
- package/dist/tests/unit/core/no-source-code-leakage.spec.js +1 -1
- package/dist/tests/unit/core/orchestrator.spec.js +12 -12
- package/dist/tests/unit/core/output-json.spec.js +2 -2
- package/dist/tests/unit/core/parsing-error-handling-nonfatal.spec.js +1 -1
- package/dist/tests/unit/core/scan-result-language-stats.spec.js +1 -1
- package/dist/tests/unit/core/structural-scan.spec.js +1 -1
- package/dist/tests/unit/core/terraform-json-overlay.spec.js +1 -1
- package/dist/tests/unit/platform-api/anonymous-ai-session-client.spec.d.ts +1 -0
- package/dist/tests/unit/platform-api/anonymous-ai-session-client.spec.js +35 -0
- package/dist/tests/unit/platform-api/read-cli-api-error-message.spec.d.ts +1 -0
- package/dist/tests/unit/platform-api/read-cli-api-error-message.spec.js +38 -0
- package/dist/tests/unit/upload/build-preview-url.spec.js +16 -0
- package/dist/tests/unit/upload/run-upload.spec.d.ts +1 -0
- package/dist/tests/unit/upload/run-upload.spec.js +43 -0
- package/package.json +2 -2
|
@@ -17,3 +17,19 @@ describe("buildImportPreviewUrl", () => {
|
|
|
17
17
|
expect(url).toBe("http://localhost:3001/dashboard?importDraft=draft-abc");
|
|
18
18
|
});
|
|
19
19
|
});
|
|
20
|
+
describe("buildAnonymousCliPreviewUrl", () => {
|
|
21
|
+
const original = process.env.DATAPARADE_APP_URL;
|
|
22
|
+
afterEach(() => {
|
|
23
|
+
if (original === undefined) {
|
|
24
|
+
delete process.env.DATAPARADE_APP_URL;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
process.env.DATAPARADE_APP_URL = original;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
it("builds signup deep link with claim token path segment", () => {
|
|
31
|
+
process.env.DATAPARADE_APP_URL = "http://localhost:3001";
|
|
32
|
+
const url = (0, build_preview_url_1.buildAnonymousCliPreviewUrl)("claim-token-xyz");
|
|
33
|
+
expect(url).toBe("http://localhost:3001/preview/cli/claim-token-xyz");
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const run_upload_1 = require("../../../src/upload/run-upload");
|
|
4
|
+
jest.mock("../../../src/platform-api/upload-client", () => ({
|
|
5
|
+
cliUploadAnonymousPreview: jest.fn(),
|
|
6
|
+
cliUploadPreview: jest.fn(),
|
|
7
|
+
}));
|
|
8
|
+
jest.mock("../../../src/upload/build-preview-url", () => ({
|
|
9
|
+
buildAnonymousCliPreviewUrl: jest.fn((token) => `https://app.example/preview/cli/${token}`),
|
|
10
|
+
buildImportPreviewUrl: jest.fn((draftId) => `https://app.example/dashboard?importDraft=${draftId}`),
|
|
11
|
+
}));
|
|
12
|
+
const upload_client_1 = require("../../../src/platform-api/upload-client");
|
|
13
|
+
describe("runDataflowUpload anonymous path", () => {
|
|
14
|
+
const logSpy = jest.spyOn(console, "log").mockImplementation(() => undefined);
|
|
15
|
+
afterEach(() => {
|
|
16
|
+
jest.clearAllMocks();
|
|
17
|
+
});
|
|
18
|
+
afterAll(() => {
|
|
19
|
+
logSpy.mockRestore();
|
|
20
|
+
});
|
|
21
|
+
it("passes scanJobId to anonymous upload and mentions claim quota", async () => {
|
|
22
|
+
upload_client_1.cliUploadAnonymousPreview.mockResolvedValue({
|
|
23
|
+
claimToken: "claim-1",
|
|
24
|
+
expiresAt: new Date().toISOString(),
|
|
25
|
+
projectName: "Proj",
|
|
26
|
+
});
|
|
27
|
+
const result = await (0, run_upload_1.runDataflowUpload)({
|
|
28
|
+
dataflow: { schemaVersion: "1.0" },
|
|
29
|
+
projectName: "Proj",
|
|
30
|
+
scanJobId: "job-anon-1",
|
|
31
|
+
logPrefix: "[scan]",
|
|
32
|
+
});
|
|
33
|
+
expect(upload_client_1.cliUploadAnonymousPreview).toHaveBeenCalledWith({
|
|
34
|
+
dataflow: { schemaVersion: "1.0" },
|
|
35
|
+
projectName: "Proj",
|
|
36
|
+
scanJobId: "job-anon-1",
|
|
37
|
+
});
|
|
38
|
+
expect(upload_client_1.cliUploadPreview).not.toHaveBeenCalled();
|
|
39
|
+
expect(result.previewUrl).toContain("claim-1");
|
|
40
|
+
expect(logSpy).toHaveBeenCalledWith(expect.stringContaining("Claiming this preview after signup uses 1 scan slot"));
|
|
41
|
+
expect(logSpy).toHaveBeenCalledWith(expect.stringContaining("platform AI tokens"));
|
|
42
|
+
});
|
|
43
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dataparade/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "dataPARADE CLI — scan codebases for privacy and security data flows",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"license": "GPL-3.0-or-later",
|
|
10
10
|
"author": "DataParade",
|
|
11
|
-
"homepage": "https://
|
|
11
|
+
"homepage": "https://dataparade.io",
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
14
|
"url": "git+https://github.com/DataParade-io/dataparade-cli.git"
|