@bimatrix-aud-platform/aud_mcp_server 1.1.17 → 1.1.19
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.
|
@@ -40,7 +40,7 @@ export function generateDataSource(input) {
|
|
|
40
40
|
// Params 배열 (스키마: Name, Value 필수)
|
|
41
41
|
const params = paramNames.map((name) => ({
|
|
42
42
|
Name: name.startsWith(":") ? name : `:${name}`,
|
|
43
|
-
|
|
43
|
+
ParamType: "String",
|
|
44
44
|
}));
|
|
45
45
|
// Columns 배열 (스키마: Name, Type 필수)
|
|
46
46
|
const columns = (input.columns || []).map((col) => ({
|
package/dist/generators/fixer.js
CHANGED
|
@@ -39,6 +39,14 @@ export function fixMtsd(filePath) {
|
|
|
39
39
|
if (ds.Id && ds.Name) {
|
|
40
40
|
dsNameToId.set(ds.Name, ds.Id);
|
|
41
41
|
dsIdSet.add(ds.Id);
|
|
42
|
+
if (ds.Params) {
|
|
43
|
+
//파라미터 fix
|
|
44
|
+
for (let i = 0, i2 = ds.Params.length; i < i2; i++) {
|
|
45
|
+
if (!ds.Params[i].ParamType) {
|
|
46
|
+
ds.Params[i].ParamType = ds.Params[i].Name.toUpperCase().indexOf("VN_") ? "Numeric" : "String";
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
42
50
|
}
|
|
43
51
|
}
|
|
44
52
|
// 3. 보정 규칙 적용
|
|
@@ -46,6 +54,8 @@ export function fixMtsd(filePath) {
|
|
|
46
54
|
fixDataSourceReferences(doc, dsNameToId, dsIdSet, fixes);
|
|
47
55
|
// Rule 2: OlapGrid DataSource 기반 Fields 자동 생성
|
|
48
56
|
fixOlapGridFields(doc, datas, fixes);
|
|
57
|
+
// Rule 2-2: OlapGrid Fields 내 CreateType=1 (Measures) 필드 보정
|
|
58
|
+
fixOlapMeasuresField(doc, fixes);
|
|
49
59
|
// Rule 3: DataSource Params에 Value 누락 보정
|
|
50
60
|
//fixParamsMissingValue(datas, fixes);
|
|
51
61
|
// Rule 4: DataSource Columns에 Type 누락 보정
|
|
@@ -185,6 +195,38 @@ function fixOlapGridFields(doc, datas, fixes) {
|
|
|
185
195
|
});
|
|
186
196
|
}
|
|
187
197
|
}
|
|
198
|
+
// ---- Rule 2-2: OlapGrid Fields 내 CreateType=1 (Measures) 필드 보정 ----
|
|
199
|
+
// CreateType=1은 Key="#MEASURES_HEADER#"인 항목만 가질 수 있다.
|
|
200
|
+
// CreateType=1이 2개 이상이면, Key가 "#MEASURES_HEADER#"가 아닌 필드의 CreateType을 0으로 변경한다.
|
|
201
|
+
function fixOlapMeasuresField(doc, fixes) {
|
|
202
|
+
const forms = doc.Forms || [];
|
|
203
|
+
for (const form of forms) {
|
|
204
|
+
const elements = form.Elements || [];
|
|
205
|
+
walkElements(elements, (el, path) => {
|
|
206
|
+
if (el.Type !== "OlapGrid")
|
|
207
|
+
return;
|
|
208
|
+
const fields = el.iOLAPView?.Fields;
|
|
209
|
+
if (!fields || !Array.isArray(fields) || fields.length === 0)
|
|
210
|
+
return;
|
|
211
|
+
// CreateType=1인 필드 수집
|
|
212
|
+
const createType1Fields = [];
|
|
213
|
+
for (const field of fields) {
|
|
214
|
+
if (field.CreateType === 1) {
|
|
215
|
+
createType1Fields.push(field);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
// 2개 이상일 때만 보정
|
|
219
|
+
if (createType1Fields.length < 2)
|
|
220
|
+
return;
|
|
221
|
+
for (const field of createType1Fields) {
|
|
222
|
+
if (field.Key !== "#MEASURES_HEADER#") {
|
|
223
|
+
field.CreateType = 0; // enOlapFieldCreateType.Default
|
|
224
|
+
fixes.push(`[Rule2-2] ${path}.Fields["${field.Key}"]: CreateType 1→0 보정 (#MEASURES_HEADER#만 CreateType=1 가능)`);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
}
|
|
188
230
|
// ---- Rule 3: Params Value 누락 보정 ----
|
|
189
231
|
// function fixParamsMissingValue(datas: any[], fixes: string[]) {
|
|
190
232
|
// for (const ds of datas) {
|
package/package.json
CHANGED
|
@@ -107,14 +107,14 @@ export interface IDataSource {
|
|
|
107
107
|
Id: string;
|
|
108
108
|
/** 데이터소스의 표시 이름 */
|
|
109
109
|
Name: string;
|
|
110
|
-
/** 메타 데이터소스 사용 여부
|
|
111
|
-
UseMeta:
|
|
112
|
-
/** 쿼리 결과 캐싱 사용 여부
|
|
113
|
-
UseCache:
|
|
110
|
+
/** 메타 데이터소스 사용 여부 */
|
|
111
|
+
UseMeta: boolean;
|
|
112
|
+
/** 쿼리 결과 캐싱 사용 여부 */
|
|
113
|
+
UseCache: boolean;
|
|
114
114
|
/** 연결된 DB 커넥션 코드 */
|
|
115
115
|
ConnectionCode: string;
|
|
116
|
-
/** SQL 쿼리 암호화 여부
|
|
117
|
-
Encrypted:
|
|
116
|
+
/** SQL 쿼리 암호화 여부 */
|
|
117
|
+
Encrypted: boolean;
|
|
118
118
|
/** 데이터소스 타입 (0: DataSource, 1: MetaData, 2: Template, 3: ServerDataSource) */
|
|
119
119
|
DSType: number;
|
|
120
120
|
/** 실행할 SQL 쿼리문 */
|
|
@@ -1425,7 +1425,7 @@ export interface IOlapTopFilter {
|
|
|
1425
1425
|
* @see src/control/olapgrid/iOLAP.Model.ts - OlapField.Serialize()
|
|
1426
1426
|
*/
|
|
1427
1427
|
export interface IOlapField {
|
|
1428
|
-
/** 필드 키 */
|
|
1428
|
+
/** 필드 키 (데이터 소스의 컬럼명, 계산 필드일 경우 동적으로 생성)*/
|
|
1429
1429
|
Key: string;
|
|
1430
1430
|
/** 필드 캡션 */
|
|
1431
1431
|
Caption: string;
|
|
@@ -1457,7 +1457,7 @@ export interface IOlapField {
|
|
|
1457
1457
|
Width?: number;
|
|
1458
1458
|
/** 단위 */
|
|
1459
1459
|
Unit?: string;
|
|
1460
|
-
/** 생성 유형 (0:
|
|
1460
|
+
/** 생성 유형 (0:Default, 1:Measures(특수필드로 다른 Measure필드의 집합, Files내 1개만 자동 생성됨), 2:DimensionGroup, 3:HierarchyGroup) */
|
|
1461
1461
|
CreateType?: number;
|
|
1462
1462
|
/** 정렬 유형 (0: None, 1: Asc, 2: Desc) */
|
|
1463
1463
|
SortType?: number;
|
package/schemas/mtsd.schema.json
CHANGED
|
@@ -98,10 +98,10 @@
|
|
|
98
98
|
"properties": {
|
|
99
99
|
"Id": { "type": "string", "description": "데이터소스의 고유 ID" },
|
|
100
100
|
"Name": { "type": "string", "description": "데이터소스의 표시 이름" },
|
|
101
|
-
"UseMeta": { "type": "
|
|
102
|
-
"UseCache": { "type": "
|
|
101
|
+
"UseMeta": { "type": "boolean", "description": "메타 데이터소스 사용 여부" },
|
|
102
|
+
"UseCache": { "type": "boolean", "description": "쿼리 결과 캐싱 사용 여부" },
|
|
103
103
|
"ConnectionCode": { "type": "string", "description": "연결된 DB 커넥션 코드" },
|
|
104
|
-
"Encrypted": { "type": "
|
|
104
|
+
"Encrypted": { "type": "boolean", "description": "SQL 쿼리 암호화 여부" },
|
|
105
105
|
"DSType": { "type": "integer", "enum": [0, 1, 2, 3], "description": "데이터소스 타입 (0:DataSource, 1:MetaData, 2:Template, 3:ServerDataSource)" },
|
|
106
106
|
"SQL": { "type": "string", "description": "실행할 SQL 쿼리문" },
|
|
107
107
|
"Params": {
|
|
@@ -117,11 +117,10 @@
|
|
|
117
117
|
"DataSourceParam": {
|
|
118
118
|
"type": "object",
|
|
119
119
|
"description": "데이터소스 파라미터",
|
|
120
|
-
"required": ["Name", "
|
|
120
|
+
"required": ["Name", "ParamType"],
|
|
121
121
|
"properties": {
|
|
122
|
-
"Name": { "type": "string" },
|
|
123
|
-
"
|
|
124
|
-
"Type": { "type": "string" }
|
|
122
|
+
"Name": { "type": "string" },
|
|
123
|
+
"ParamType": { "type": "string" }
|
|
125
124
|
}
|
|
126
125
|
},
|
|
127
126
|
"DataSourceColumn": {
|
|
@@ -1032,7 +1031,7 @@
|
|
|
1032
1031
|
"RefFormula": { "type": "string", "description": "참조 수식" },
|
|
1033
1032
|
"Width": { "type": "number", "description": "필드 너비" },
|
|
1034
1033
|
"Unit": { "type": "string", "description": "단위" },
|
|
1035
|
-
"CreateType": { "type": "number", "description": "생성 유형 (0:Default, 1:
|
|
1034
|
+
"CreateType": { "type": "number", "description": "생성 유형 (0:Default, 1:Measures(특수필드로 다른 Measure필드의 집합, Files내 1개만 자동 생성됨), 2:DimensionGroup, 3:HierarchyGroup)" },
|
|
1036
1035
|
"SortType": { "type": "number", "description": "정렬 유형 (0:None, 1:Asc, 2:Desc)" },
|
|
1037
1036
|
"MeasureSortField": { "type": "string", "description": "측정값 정렬 기준 필드" },
|
|
1038
1037
|
"SortBaseField": { "type": "string", "description": "정렬 기준 필드" },
|