Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ export interface DownloadMetadata {
repoType: RepoType;
}

export interface Header {
value: string[];
}

export interface UserContext {
/** The username or subject */
id: string;
Expand Down Expand Up @@ -92,22 +88,6 @@ export interface RepoPath {
isFolder: boolean;
}

/** One entry from the Xray `/xray/api/v1/artifacts` search response */
export interface XrayArtifact {
name: string;
repo_path: string;
repo_full_path: string;
sec_issues: {
critical: number;
high: number;
medium: number;
low: number;
total: number;
};
violations: number;
}

export interface XrayArtifactsSearchResponse {
data: XrayArtifact[];
offset: number;
export interface Header {
value: string[];
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PlatformContext } from 'jfrog-workers';
import { AfterDownloadRequest, AfterDownloadResponse, XrayArtifactsSearchResponse } from './types';
import { AfterDownloadRequest, AfterDownloadResponse } from './types';

export default async (context: PlatformContext, data: AfterDownloadRequest): Promise<AfterDownloadResponse> => {
// Configurable via the worker's "properties" (manifest.json / Platform UI); fall back to these defaults if unset
Expand Down Expand Up @@ -139,3 +139,24 @@ async function askClaudeForRiskSummary(
}
return text;
}

// Declared here rather than in types.ts: 'jf worker deploy' only uploads worker.ts and compiles it
// against the platform's own event types.
interface XrayArtifact {
name: string;
repo_path: string;
repo_full_path: string;
sec_issues: {
critical: number;
high: number;
medium: number;
low: number;
total: number;
};
violations: number;
}

interface XrayArtifactsSearchResponse {
data: XrayArtifact[];
offset: number;
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ export interface DownloadMetadata {
repoType: RepoType;
}

export interface Header {
value: string[];
}

export interface UserContext {
/** The username or subject */
id: string;
Expand Down Expand Up @@ -92,22 +88,6 @@ export interface RepoPath {
isFolder: boolean;
}

/** One entry from the Xray `/xray/api/v1/artifacts` search response */
export interface XrayArtifact {
name: string;
repo_path: string;
repo_full_path: string;
sec_issues: {
critical: number;
high: number;
medium: number;
low: number;
total: number;
};
violations: number;
}

export interface XrayArtifactsSearchResponse {
data: XrayArtifact[];
offset: number;
export interface Header {
value: string[];
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PlatformContext } from 'jfrog-workers';
import { AfterDownloadRequest, AfterDownloadResponse, XrayArtifactsSearchResponse } from './types';
import { AfterDownloadRequest, AfterDownloadResponse } from './types';

export default async (context: PlatformContext, data: AfterDownloadRequest): Promise<AfterDownloadResponse> => {
// Configurable via the worker's "properties" (manifest.json / Platform UI); fall back to these defaults if unset
Expand Down Expand Up @@ -136,3 +136,24 @@ async function askOpenAiForRiskSummary(
}
return text;
}

// Declared here rather than in types.ts: 'jf worker deploy' only uploads worker.ts and compiles it
// against the platform's own event types.
interface XrayArtifact {
name: string;
repo_path: string;
repo_full_path: string;
sec_issues: {
critical: number;
high: number;
medium: number;
low: number;
total: number;
};
violations: number;
}

interface XrayArtifactsSearchResponse {
data: XrayArtifact[];
offset: number;
}