fix(FEEDBACK-0001): complete iteration 0 - harden context search
This commit is contained in:
@@ -1,3 +1,78 @@
|
||||
export interface ContextRepositoryJsonDtoProps {
|
||||
id: string;
|
||||
title: string;
|
||||
source: 'github' | 'local';
|
||||
sourceUrl: string;
|
||||
branch: string | null;
|
||||
isLocal: boolean;
|
||||
}
|
||||
|
||||
export class ContextRepositoryJsonDto {
|
||||
id: string;
|
||||
title: string;
|
||||
source: 'github' | 'local';
|
||||
sourceUrl: string;
|
||||
branch: string | null;
|
||||
isLocal: boolean;
|
||||
|
||||
constructor(props: ContextRepositoryJsonDtoProps) {
|
||||
this.id = props.id;
|
||||
this.title = props.title;
|
||||
this.source = props.source;
|
||||
this.sourceUrl = props.sourceUrl;
|
||||
this.branch = props.branch;
|
||||
this.isLocal = props.isLocal;
|
||||
}
|
||||
}
|
||||
|
||||
export interface ContextVersionJsonDtoProps {
|
||||
requested: string | null;
|
||||
resolved: string | null;
|
||||
id: string | null;
|
||||
}
|
||||
|
||||
export class ContextVersionJsonDto {
|
||||
requested: string | null;
|
||||
resolved: string | null;
|
||||
id: string | null;
|
||||
|
||||
constructor(props: ContextVersionJsonDtoProps) {
|
||||
this.requested = props.requested;
|
||||
this.resolved = props.resolved;
|
||||
this.id = props.id;
|
||||
}
|
||||
}
|
||||
|
||||
export interface SnippetOriginJsonDtoProps {
|
||||
repositoryId: string;
|
||||
repositoryTitle: string;
|
||||
source: 'github' | 'local';
|
||||
sourceUrl: string;
|
||||
version: string | null;
|
||||
versionId: string | null;
|
||||
isLocal: boolean;
|
||||
}
|
||||
|
||||
export class SnippetOriginJsonDto {
|
||||
repositoryId: string;
|
||||
repositoryTitle: string;
|
||||
source: 'github' | 'local';
|
||||
sourceUrl: string;
|
||||
version: string | null;
|
||||
versionId: string | null;
|
||||
isLocal: boolean;
|
||||
|
||||
constructor(props: SnippetOriginJsonDtoProps) {
|
||||
this.repositoryId = props.repositoryId;
|
||||
this.repositoryTitle = props.repositoryTitle;
|
||||
this.source = props.source;
|
||||
this.sourceUrl = props.sourceUrl;
|
||||
this.version = props.version;
|
||||
this.versionId = props.versionId;
|
||||
this.isLocal = props.isLocal;
|
||||
}
|
||||
}
|
||||
|
||||
export class LibrarySearchJsonResultDto {
|
||||
id: string;
|
||||
title: string;
|
||||
@@ -57,6 +132,7 @@ export class CodeSnippetJsonDto {
|
||||
id: string;
|
||||
tokenCount: number | null;
|
||||
pageTitle: string | null;
|
||||
origin: SnippetOriginJsonDto | null;
|
||||
|
||||
constructor(props: Omit<CodeSnippetJsonDto, 'type'>) {
|
||||
this.title = props.title;
|
||||
@@ -66,6 +142,7 @@ export class CodeSnippetJsonDto {
|
||||
this.id = props.id;
|
||||
this.tokenCount = props.tokenCount;
|
||||
this.pageTitle = props.pageTitle;
|
||||
this.origin = props.origin;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,12 +152,14 @@ export class InfoSnippetJsonDto {
|
||||
breadcrumb: string | null;
|
||||
pageId: string;
|
||||
tokenCount: number | null;
|
||||
origin: SnippetOriginJsonDto | null;
|
||||
|
||||
constructor(props: Omit<InfoSnippetJsonDto, 'type'>) {
|
||||
this.text = props.text;
|
||||
this.breadcrumb = props.breadcrumb;
|
||||
this.pageId = props.pageId;
|
||||
this.tokenCount = props.tokenCount;
|
||||
this.origin = props.origin;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,10 +169,18 @@ export class ContextJsonResponseDto {
|
||||
snippets: SnippetJsonDto[];
|
||||
rules: string[];
|
||||
totalTokens: number;
|
||||
localSource: boolean;
|
||||
repository: ContextRepositoryJsonDto | null;
|
||||
version: ContextVersionJsonDto | null;
|
||||
resultCount: number;
|
||||
|
||||
constructor(props: ContextJsonResponseDto) {
|
||||
this.snippets = props.snippets;
|
||||
this.rules = props.rules;
|
||||
this.totalTokens = props.totalTokens;
|
||||
this.localSource = props.localSource;
|
||||
this.repository = props.repository;
|
||||
this.version = props.version;
|
||||
this.resultCount = props.resultCount;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user