[agent-pipeline] pipe-20260330021427-v9fb round-2
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
|
||||
export interface WebTypeMapping {
|
||||
webType: string;
|
||||
web_type: string;
|
||||
componentId: string;
|
||||
description: string;
|
||||
}
|
||||
@@ -346,7 +346,7 @@ export function getSupportedComponentIds(): string[] {
|
||||
*/
|
||||
export function getWebTypeMappings(): WebTypeMapping[] {
|
||||
return Object.entries(WEB_TYPE_V2_MAPPING).map(([webType, mapping]) => ({
|
||||
webType,
|
||||
web_type: webType,
|
||||
componentId: mapping.componentType,
|
||||
description: `${webType} → ${mapping.componentType}`,
|
||||
}));
|
||||
|
||||
@@ -132,17 +132,17 @@ export class StressTestSuite {
|
||||
// 다양한 잘못된 데이터들로 타입 시스템 공격
|
||||
const corruptedInputs = [
|
||||
// 잘못된 WebType들
|
||||
{ webType: null, expected: false },
|
||||
{ webType: undefined, expected: false },
|
||||
{ webType: "", expected: false },
|
||||
{ webType: "invalid_type", expected: false },
|
||||
{ webType: "VARCHAR(255)", expected: false },
|
||||
{ webType: "submit", expected: false }, // ButtonActionType과 혼동
|
||||
{ webType: "widget", expected: false }, // ComponentType과 혼동
|
||||
{ webType: 123, expected: false },
|
||||
{ webType: {}, expected: false },
|
||||
{ webType: [], expected: false },
|
||||
{ webType: "text", expected: true }, // 유일한 올바른 값
|
||||
{ web_type: null, expected: false },
|
||||
{ web_type: undefined, expected: false },
|
||||
{ web_type: "", expected: false },
|
||||
{ web_type: "invalid_type", expected: false },
|
||||
{ web_type: "VARCHAR(255)", expected: false },
|
||||
{ web_type: "submit", expected: false }, // ButtonActionType과 혼동
|
||||
{ web_type: "widget", expected: false }, // ComponentType과 혼동
|
||||
{ web_type: 123, expected: false },
|
||||
{ web_type: {}, expected: false },
|
||||
{ web_type: [], expected: false },
|
||||
{ web_type: "text", expected: true }, // 유일한 올바른 값
|
||||
|
||||
// 잘못된 ButtonActionType들
|
||||
{ buttonAction: "insert", expected: false },
|
||||
@@ -160,15 +160,15 @@ export class StressTestSuite {
|
||||
console.log("🦠 타입 오염 데이터 검증 중...");
|
||||
|
||||
corruptedInputs.forEach((input, index) => {
|
||||
if ("webType" in input) {
|
||||
const isValid = isWebType(input.webType as unknown);
|
||||
if ("web_type" in input) {
|
||||
const isValid = isWebType(input.web_type as unknown);
|
||||
if (isValid === input.expected) {
|
||||
passedChecks++;
|
||||
} else {
|
||||
failedChecks++;
|
||||
console.warn(
|
||||
`❌ WebType 검증 실패 #${index}:`,
|
||||
input.webType,
|
||||
input.web_type,
|
||||
"expected:",
|
||||
input.expected,
|
||||
"got:",
|
||||
|
||||
@@ -478,19 +478,19 @@ export class StressTestScenarios {
|
||||
|
||||
// API로부터 받을 수 있는 다양한 잘못된 데이터들
|
||||
const corruptedData = [
|
||||
{ webType: "text_area", expected: false }, // 기존 잘못된 타입
|
||||
{ webType: "VARCHAR(255)", expected: false }, // DB 타입 혼입
|
||||
{ webType: "submit", expected: false }, // ButtonActionType 혼입
|
||||
{ webType: "", expected: false }, // 빈 문자열
|
||||
{ webType: null, expected: false }, // null
|
||||
{ webType: undefined, expected: false }, // undefined
|
||||
{ webType: 123, expected: false }, // 숫자
|
||||
{ webType: {}, expected: false }, // 객체
|
||||
{ webType: "text", expected: true }, // 올바른 타입
|
||||
{ web_type: "text_area", expected: false }, // 기존 잘못된 타입
|
||||
{ web_type: "VARCHAR(255)", expected: false }, // DB 타입 혼입
|
||||
{ web_type: "submit", expected: false }, // ButtonActionType 혼입
|
||||
{ web_type: "", expected: false }, // 빈 문자열
|
||||
{ web_type: null, expected: false }, // null
|
||||
{ web_type: undefined, expected: false }, // undefined
|
||||
{ web_type: 123, expected: false }, // 숫자
|
||||
{ web_type: {}, expected: false }, // 객체
|
||||
{ web_type: "text", expected: true }, // 올바른 타입
|
||||
];
|
||||
|
||||
corruptedData.forEach(({ webType, expected }) => {
|
||||
const result = isWebType(webType as any);
|
||||
corruptedData.forEach(({ web_type, expected }) => {
|
||||
const result = isWebType(web_type as any);
|
||||
console.assert(
|
||||
result === expected,
|
||||
`타입 검증 실패: ${JSON.stringify(webType)} → expected: ${expected}, got: ${result}`,
|
||||
|
||||
@@ -713,7 +713,7 @@ export interface ColumnInfo {
|
||||
export interface ColumnWebTypeSetting {
|
||||
tableName: string;
|
||||
columnName: string;
|
||||
webType: WebType;
|
||||
web_type: WebType;
|
||||
columnLabel?: string;
|
||||
detailSettings?: Record<string, any>;
|
||||
codeCategory?: string;
|
||||
|
||||
Reference in New Issue
Block a user