@bimatrix-aud-platform/aud_mcp_server 1.1.18 → 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.
@@ -54,6 +54,8 @@ export function fixMtsd(filePath) {
54
54
  fixDataSourceReferences(doc, dsNameToId, dsIdSet, fixes);
55
55
  // Rule 2: OlapGrid DataSource 기반 Fields 자동 생성
56
56
  fixOlapGridFields(doc, datas, fixes);
57
+ // Rule 2-2: OlapGrid Fields 내 CreateType=1 (Measures) 필드 보정
58
+ fixOlapMeasuresField(doc, fixes);
57
59
  // Rule 3: DataSource Params에 Value 누락 보정
58
60
  //fixParamsMissingValue(datas, fixes);
59
61
  // Rule 4: DataSource Columns에 Type 누락 보정
@@ -193,6 +195,38 @@ function fixOlapGridFields(doc, datas, fixes) {
193
195
  });
194
196
  }
195
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
+ }
196
230
  // ---- Rule 3: Params Value 누락 보정 ----
197
231
  // function fixParamsMissingValue(datas: any[], fixes: string[]) {
198
232
  // for (const ds of datas) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bimatrix-aud-platform/aud_mcp_server",
3
- "version": "1.1.18",
3
+ "version": "1.1.19",
4
4
  "description": "MCP Server for i-AUD MTSD document validation and generation",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -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: Default, 1: CustomTotal, 2: CustomDimension, 3: HierarchyGroup) */
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;
@@ -1031,7 +1031,7 @@
1031
1031
  "RefFormula": { "type": "string", "description": "참조 수식" },
1032
1032
  "Width": { "type": "number", "description": "필드 너비" },
1033
1033
  "Unit": { "type": "string", "description": "단위" },
1034
- "CreateType": { "type": "number", "description": "생성 유형 (0:Default, 1:CustomTotal, 2:CustomDimension, 3:HierarchyGroup)" },
1034
+ "CreateType": { "type": "number", "description": "생성 유형 (0:Default, 1:Measures(특수필드로 다른 Measure필드의 집합, Files내 1개만 자동 생성됨), 2:DimensionGroup, 3:HierarchyGroup)" },
1035
1035
  "SortType": { "type": "number", "description": "정렬 유형 (0:None, 1:Asc, 2:Desc)" },
1036
1036
  "MeasureSortField": { "type": "string", "description": "측정값 정렬 기준 필드" },
1037
1037
  "SortBaseField": { "type": "string", "description": "정렬 기준 필드" },