/** * ๐ŸŽฏ ํ†ตํ•ฉ ํƒ€์ž… ์‹œ์Šคํ…œ Index * * ๋ชจ๋“  ํƒ€์ž… ์ •์˜๋ฅผ ์ค‘์•™์—์„œ ๊ด€๋ฆฌํ•˜๊ณ  re-exportํ•ฉ๋‹ˆ๋‹ค. * ์ด ํŒŒ์ผ์„ ํ†ตํ•ด ๋ชจ๋“  ํƒ€์ž…์— ์ผ๊ด€์„ฑ ์žˆ๊ฒŒ ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. */ // ===== ํ•ต์‹ฌ ๊ณตํ†ต ํƒ€์ž…๋“ค ===== export * from "./unified-core"; // ===== ์‹œ์Šคํ…œ๋ณ„ ์ „์šฉ ํƒ€์ž…๋“ค ===== export * from "./screen-management"; export * from "./control-management"; export * from "./table-management"; // ===== ๊ธฐ์กด ํ˜ธํ™˜์„ฑ์„ ์œ„ํ•œ re-export ===== // unified-core์—์„œ ์ œ๊ณตํ•˜๋Š” ์ฃผ์š” ํƒ€์ž…๋“ค์„ ์ง์ ‘ export export type { // ํ•ต์‹ฌ ํƒ€์ž…๋“ค WebType, DynamicWebType, ButtonActionType, ComponentType, Position, Size, CommonStyle, ValidationRule, ConditionOperator, // API ๊ด€๋ จ BaseApiResponse, PaginatedResponse, // ๊ณตํ†ต ํ•„๋“œ๋“ค CompanyCode, ActiveStatus, TimestampFields, AuditFields, // ์ด๋ฒคํŠธ ํƒ€์ž…๋“ค WebTypeEvent, ComponentEvent, } from "./unified-core"; // screen-management์—์„œ ์ œ๊ณตํ•˜๋Š” ์ฃผ์š” ํƒ€์ž…๋“ค export type { // ์ปดํฌ๋„ŒํŠธ ํƒ€์ž…๋“ค ComponentData, BaseComponent, WidgetComponent, ContainerComponent, GroupComponent, DataTableComponent, FileComponent, // ์›นํƒ€์ž… ์„ค์ •๋“ค WebTypeConfig, DateTypeConfig, NumberTypeConfig, SelectTypeConfig, TextTypeConfig, FileTypeConfig, EntityTypeConfig, ButtonTypeConfig, // ํ™”๋ฉด ๊ด€๋ จ ScreenDefinition, CreateScreenRequest, UpdateScreenRequest, LayoutData, GridSettings, ScreenTemplate, ScreenResolution, GroupState, // ํ™”๋ฉด ํ•ด์ƒ๋„ ์ƒ์ˆ˜ SCREEN_RESOLUTIONS, // ๋ฐ์ดํ„ฐ ํ…Œ์ด๋ธ” DataTableColumn, DataTableFilter, // ํŒŒ์ผ ์—…๋กœ๋“œ UploadedFile, } from "./screen-management"; // control-management์—์„œ ์ œ๊ณตํ•˜๋Š” ์ฃผ์š” ํƒ€์ž…๋“ค export type { // ๋ฒ„ํŠผ ์ œ์–ด ExtendedButtonTypeConfig, ButtonDataflowConfig, ControlDataSource, // ๋ฐ์ดํ„ฐํ”Œ๋กœ์šฐ DataflowCondition, DataflowAction, ActionType, DatabaseOperation, NotificationType, // ํŠธ๋žœ์žญ์…˜ ๊ด€๋ฆฌ TransactionGroup, RollbackStrategy, FailureHandling, ConditionalExecutionPlan, ExecutionCondition, // ์‹คํ–‰ ๊ฒฐ๊ณผ ActionExecutionResult, TransactionExecutionState, DataflowExecutionResult, // ์ปจํ…์ŠคํŠธ ExtendedControlContext, QuickValidationResult, // ๋ฒ„ํŠผ ์•ก์…˜ ํ‘œ์ค€ ButtonActionStandard, ButtonActionFormData, } from "./control-management"; // table-management์—์„œ ์ œ๊ณตํ•˜๋Š” ์ฃผ์š” ํƒ€์ž…๋“ค export type { // ํ…Œ์ด๋ธ” ์ •๋ณด TableInfo, UnifiedColumnInfo, ColumnTypeInfo, ColumnSettings, // ์›นํƒ€์ž… ํ‘œ์ค€ WebTypeStandard, WebTypeDefinition, // ๋ผ๋ฒจ ๊ด€๋ฆฌ TableLabels, ColumnLabels, // ์—”ํ‹ฐํ‹ฐ ์กฐ์ธ EntityJoinConfig, EntityJoinResponse, BatchLookupRequest, BatchLookupResponse, // ํ…Œ์ด๋ธ” ๊ด€๊ณ„ TableRelationship, DataRelationshipBridge, // ์ปฌ๋Ÿผ ์›นํƒ€์ž… ์„ค์ • ColumnWebTypeSetting, // API ์‘๋‹ต๋“ค TableListResponse, ColumnListResponse, ColumnTypeInfoResponse, WebTypeStandardListResponse, TableDataResponse, } from "./table-management"; // ===== ํƒ€์ž… ๊ฐ€๋“œ ํ•จ์ˆ˜๋“ค ํ†ตํ•ฉ export ===== // unified-core ํƒ€์ž… ๊ฐ€๋“œ๋“ค export { isWebType, isButtonActionType, isComponentType, ynToBoolean, booleanToYN } from "./unified-core"; // screen-management ํƒ€์ž… ๊ฐ€๋“œ๋“ค export { isWidgetComponent, isContainerComponent, isGroupComponent, isDataTableComponent, isFileComponent, asWidgetComponent, asContainerComponent, asGroupComponent, asDataTableComponent, asFileComponent, } from "./screen-management"; // control-management ํƒ€์ž… ๊ฐ€๋“œ๋“ค export { isSingleCondition, isGroupCondition, isDatabaseAction, isApiAction, isActionSuccess, isTransactionCompleted, } from "./control-management"; // table-management ํƒ€์ž… ๊ฐ€๋“œ๋“ค export { isReferenceWebType, isNumericWebType, isDateWebType, isSelectWebType, isRequiredColumn, isSystemColumn, mapWebTypeStandardToDefinition, mapColumnTypeInfoToUnified, mapUnifiedToColumnTypeInfo, } from "./table-management"; // ===== ์ƒ์ˆ˜๋“ค ํ†ตํ•ฉ export ===== // table-management ์ƒ์ˆ˜๋“ค export { WEB_TYPE_OPTIONS } from "./table-management"; // ===== ํƒ€์ž… ๋ณ„์นญ (๊ธฐ์กด ํ˜ธํ™˜์„ฑ) ===== /** * @deprecated screen.ts์—์„œ ์ด์ „ํ•˜์„ธ์š”. unified-core.ts์˜ WebType์„ ์‚ฌ์šฉํ•˜์„ธ์š”. */ export type LegacyWebType = WebType; /** * @deprecated screen.ts์—์„œ ์ด์ „ํ•˜์„ธ์š”. unified-core.ts์˜ ButtonActionType์„ ์‚ฌ์šฉํ•˜์„ธ์š”. */ export type LegacyButtonActionType = ButtonActionType; /** * @deprecated screen.ts์—์„œ ์ด์ „ํ•˜์„ธ์š”. screen-management.ts์˜ ComponentData๋ฅผ ์‚ฌ์šฉํ•˜์„ธ์š”. */ export type LegacyComponentData = ComponentData; // ===== ์œ ํ‹ธ๋ฆฌํ‹ฐ ํƒ€์ž…๋“ค ===== /** * ์ปดํฌ๋„ŒํŠธ ์—…๋ฐ์ดํŠธ๋ฅผ ์œ„ํ•œ ๋ถ€๋ถ„ ํƒ€์ž… */ export type ComponentUpdate = Partial> & { id: string; type: T["type"]; }; /** * API ์š”์ฒญ์„ ์œ„ํ•œ ๊ธฐ๋ณธ ํŒŒ๋ผ๋ฏธํ„ฐ */ export interface BaseRequestParams { companyCode?: CompanyCode; page?: number; size?: number; sortBy?: string; sortDirection?: "asc" | "desc"; searchTerm?: string; } /** * ํผ ๋ฐ์ดํ„ฐ ํƒ€์ž… (๋ชจ๋“  ์‹œ์Šคํ…œ์—์„œ ๊ณตํ†ต ์‚ฌ์šฉ) */ export type FormData = Record; /** * ์„ ํƒ๋œ ํ–‰ ๋ฐ์ดํ„ฐ ํƒ€์ž… */ export type SelectedRowData = Record; /** * ํ…Œ์ด๋ธ” ๋ฐ์ดํ„ฐ ํƒ€์ž… */ export type TableData = Record[]; // ===== ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜ ๋„์šฐ๋ฏธ ===== /** * ๊ธฐ์กด screen.ts ํƒ€์ž…์„ ์ƒˆ๋กœ์šด ํ†ตํ•ฉ ํƒ€์ž…์œผ๋กœ ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜ํ•˜๋Š” ๋„์šฐ๋ฏธ */ export namespace Migration { /** * ๊ธฐ์กด screen.ts์˜ WebType์„ ์ƒˆ๋กœ์šด WebType์œผ๋กœ ๋ณ€ํ™˜ */ export const migrateWebType = (oldWebType: string): WebType => { // ๊ธฐ์กด ํƒ€์ž…์ด ์ƒˆ๋กœ์šด WebType์— ํฌํ•จ๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธ if (isWebType(oldWebType)) { return oldWebType as WebType; } // ํ˜ธํ™˜๋˜์ง€ ์•Š๋Š” ํƒ€์ž…์˜ ๊ฒฝ์šฐ ๊ธฐ๋ณธ๊ฐ’ ๋ฐ˜ํ™˜ console.warn(`Unknown WebType: ${oldWebType}, defaulting to 'text'`); return "text"; }; /** * ๊ธฐ์กด ButtonActionType์„ ์ƒˆ๋กœ์šด ButtonActionType์œผ๋กœ ๋ณ€ํ™˜ */ export const migrateButtonActionType = (oldActionType: string): ButtonActionType => { if (isButtonActionType(oldActionType)) { return oldActionType as ButtonActionType; } console.warn(`Unknown ButtonActionType: ${oldActionType}, defaulting to 'submit'`); return "submit"; }; /** * Y/N ๋ฌธ์ž์—ด์„ boolean์œผ๋กœ ๋ณ€ํ™˜ (DB ํ˜ธํ™˜์„ฑ) */ export const migrateYNToBoolean = (value: string | undefined): boolean => { return value === "Y"; }; /** * boolean์„ Y/N ๋ฌธ์ž์—ด๋กœ ๋ณ€ํ™˜ (DB ํ˜ธํ™˜์„ฑ) */ export const migrateBooleanToYN = (value: boolean): string => { return value ? "Y" : "N"; }; } // ===== ํƒ€์ž… ๊ฒ€์ฆ ๋„์šฐ๋ฏธ ===== /** * ๋Ÿฐํƒ€์ž„์—์„œ ํƒ€์ž… ์•ˆ์ „์„ฑ์„ ๋ณด์žฅํ•˜๋Š” ๊ฒ€์ฆ ํ•จ์ˆ˜๋“ค */ export namespace TypeValidation { /** * ๊ฐ์ฒด๊ฐ€ BaseComponent ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ๋งŒ์กฑํ•˜๋Š”์ง€ ๊ฒ€์ฆ */ export const validateBaseComponent = (obj: unknown): obj is BaseComponent => { if (typeof obj !== "object" || obj === null) return false; const component = obj as Record; return ( typeof component.id === "string" && typeof component.type === "string" && isComponentType(component.type as string) && typeof component.position === "object" && typeof component.size === "object" ); }; /** * ๊ฐ์ฒด๊ฐ€ WebTypeConfig๋ฅผ ๋งŒ์กฑํ•˜๋Š”์ง€ ๊ฒ€์ฆ */ export const validateWebTypeConfig = (obj: unknown): obj is WebTypeConfig => { return typeof obj === "object" && obj !== null; }; /** * ๋ฌธ์ž์—ด์ด ์œ ํšจํ•œ CompanyCode์ธ์ง€ ๊ฒ€์ฆ */ export const validateCompanyCode = (code: unknown): code is CompanyCode => { return typeof code === "string" && code.length > 0; }; }