@dssp/project 1.0.0-alpha.20 → 1.0.0-alpha.21

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.
@@ -1 +1 @@
1
- {"version":3,"file":"parse-excel.js","sourceRoot":"","sources":["../../server/controllers/parse-excel.ts"],"names":[],"mappings":";;AAKA,4DAgFC;;AArFD,8DAA6B;AAG7B,+CAA2C;AAEpC,KAAK,UAAU,wBAAwB,CAAC,MAAc,EAAE,OAAgB,EAAE,OAAwB;IACvG,oBAAoB;IACpB,MAAM,QAAQ,GAAG,IAAI,iBAAO,CAAC,QAAQ,EAAE,CAAA;IACvC,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAEhC,uBAAuB;IACvB,MAAM,SAAS,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA,CAAC,kCAAkC;IAE7E,8BAA8B;IAC9B,MAAM,OAAO,GAAa,EAAE,CAAA;IAC5B,IAAI,mBAAmB,GAAG,CAAC,CAAC,CAAA;IAE5B,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IACrC,SAAS,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAA;QACvC,OAAO,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,UAAU,CAAA,CAAC,4BAA4B;QAEhE,IAAI,UAAU,KAAK,MAAM,EAAE,CAAC;YAC1B,mBAAmB,GAAG,SAAS,CAAA,CAAC,oCAAoC;QACtE,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,IAAI,mBAAmB,KAAK,CAAC,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAA;IAC1C,CAAC;IAED,iCAAiC;IACjC,MAAM,KAAK,GAAc,EAAE,CA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C;QACH,CAAC;QAED,MAAM,IAAI,GAAY;YACpB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC;YACtB,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC;YACtB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC;YACtB,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC;YACxB,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC;YAC1B,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC;YAC7B,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC;YACzB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;YACzD,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;YACzE,KAAK,EAAE,OAAO;YACd,QAAQ,EAAE,EAAE;SACb,CAAA;QAED,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YAC3B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClB,CAAC;IACH,CAAC;IAED,qCAAqC;IACrC,MAAM,IAAA,yBAAW,EAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAA;AAC5C,CAAC","sourcesContent":["import ExcelJS from 'exceljs'\nimport { RawTask } from './types'\nimport { Project } from '../service/project/project'\nimport { importTasks } from './import-task'\n\nexport async function parseExcelAndImportTasks(buffer: Buffer, project: Project, context: ResolverContext) {\n // 1. 엑셀 파일을 읽어들입니다.\n const workbook = new ExcelJS.Workbook()\n await workbook.xlsx.load(buffer)\n\n // 2. 첫 번째 워크시트를 가져옵니다.\n const worksheet = workbook.getWorksheet(1) // Index or sheet name can be used\n\n // 3. 첫 번째 row를 header로 사용합니다.\n const headers: string[] = []\n let taskCodeColumnIndex = -1\n\n const headerRow = worksheet.getRow(1)\n headerRow.eachCell((cell, colNumber) => {\n const headerText = cell.text.toString()\n headers[colNumber - 1] = headerText // Store headers in an array\n\n if (headerText === '작업코드') {\n taskCodeColumnIndex = colNumber // Store the column index for \"작업코드\"\n }\n })\n\n if (taskCodeColumnIndex === -1) {\n throw new Error('작업코드 column not found')\n }\n\n // 4. 엑셀 데이터를 RawTask 형식으로 변환합니다.\n const tasks: RawTask[] = []\n\n // Start processing from the second row onward to skip the header\n for (let rowIndex = 2; rowIndex <= worksheet.rowCount; rowIndex++) {\n const row = worksheet.getRow(rowIndex)\n const taskData: any = {}\n\n row.eachCell((cell, colNumber) => {\n const header = headers[colNumber - 1]\n\n // Check if the cell has a formula(or sharedFormula) and use the formula result\n let cellValue: any = cell.value\n if (cellValue && typeof cellValue === 'object' && ('formula' in cellValue || 'sharedFormula' in cellValue)) {\n // Cell contains a formula, use the calculated result if available\n cellValue = cellValue.result ?? cellValue.value // Use the result, or fallback to value if result is not calculated\n }\n\n taskData[header] = cellValue\n })\n\n const taskCodeCell = row.getCell(taskCodeColumnIndex)\n let bgColor = '#FFFFFF'\n const fill = taskCodeCell.style.fill\n\n if (fill && fill.type === 'pattern' && fill.pattern === 'solid') {\n const fgColor = fill.fgColor\n if (fgColor && fgColor.argb) {\n // ARGB is a color in the format AARRGGBB, remove the alpha channel (first two characters)\n bgColor = `#${fgColor.argb.slice(2)}`\n }\n }\n\n const task: RawTask = {\n code: taskData['작업코드'],\n title: taskData['작업명'],\n type: taskData['세부공종'],\n duration: taskData['기간'],\n startDate: taskData['시작일'],\n dependsOn: taskData['선행작업코드'],\n progress: taskData['진척율'],\n tags: taskData['Tags'] ? taskData['Tags'].split(',') : [],\n resources: taskData['Resources'] ? JSON.parse(taskData['Resources']) : [],\n style: bgColor,\n children: []\n }\n\n if (task.code && task.type) {\n tasks.push(task)\n }\n }\n\n // 5. 변환된 데이터를 importTasks 함수로 전달합니다.\n await importTasks(project, tasks, context)\n}\n"]}
1
+ {"version":3,"file":"parse-excel.js","sourceRoot":"","sources":["../../server/controllers/parse-excel.ts"],"names":[],"mappings":";;AAKA,4DAgFC;;AArFD,8DAA6B;AAG7B,+CAA2C;AAEpC,KAAK,UAAU,wBAAwB,CAAC,MAAc,EAAE,OAAgB,EAAE,OAAwB;IACvG,oBAAoB;IACpB,MAAM,QAAQ,GAAG,IAAI,iBAAO,CAAC,QAAQ,EAAE,CAAA;IACvC,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAa,CAAC,CAAA;IAEvC,uBAAuB;IACvB,MAAM,SAAS,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA,CAAC,kCAAkC;IAE7E,8BAA8B;IAC9B,MAAM,OAAO,GAAa,EAAE,CAAA;IAC5B,IAAI,mBAAmB,GAAG,CAAC,CAAC,CAAA;IAE5B,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IACrC,SAAS,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAA;QACvC,OAAO,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,UAAU,CAAA,CAAC,4BAA4B;QAEhE,IAAI,UAAU,KAAK,MAAM,EAAE,CAAC;YAC1B,mBAAmB,GAAG,SAAS,CAAA,CAAC,oCAAoC;QACtE,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,IAAI,mBAAmB,KAAK,CAAC,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAA;IAC1C,CAAC;IAED,iCAAiC;IACjC,MAAM,KAAK,GAAc,EAAE,CAAA;IAE3B,iEAAiE;IACjE,KAAK,IAAI,QAAQ,GAAG,CAAC,EAAE,QAAQ,IAAI,SAAS,CAAC,QAAQ,E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,QAAQ,CAAC,KAAK,CAAC;YACtB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC;YACtB,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC;YACxB,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC;YAC1B,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC;YAC7B,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC;YACzB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;YACzD,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;YACzE,KAAK,EAAE,OAAO;YACd,QAAQ,EAAE,EAAE;SACb,CAAA;QAED,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YAC3B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClB,CAAC;IACH,CAAC;IAED,qCAAqC;IACrC,MAAM,IAAA,yBAAW,EAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAA;AAC5C,CAAC","sourcesContent":["import ExcelJS from 'exceljs'\nimport { RawTask } from './types'\nimport { Project } from '../service/project/project'\nimport { importTasks } from './import-task'\n\nexport async function parseExcelAndImportTasks(buffer: Buffer, project: Project, context: ResolverContext) {\n // 1. 엑셀 파일을 읽어들입니다.\n const workbook = new ExcelJS.Workbook()\n await workbook.xlsx.load(buffer as any)\n\n // 2. 첫 번째 워크시트를 가져옵니다.\n const worksheet = workbook.getWorksheet(1) // Index or sheet name can be used\n\n // 3. 첫 번째 row를 header로 사용합니다.\n const headers: string[] = []\n let taskCodeColumnIndex = -1\n\n const headerRow = worksheet.getRow(1)\n headerRow.eachCell((cell, colNumber) => {\n const headerText = cell.text.toString()\n headers[colNumber - 1] = headerText // Store headers in an array\n\n if (headerText === '작업코드') {\n taskCodeColumnIndex = colNumber // Store the column index for \"작업코드\"\n }\n })\n\n if (taskCodeColumnIndex === -1) {\n throw new Error('작업코드 column not found')\n }\n\n // 4. 엑셀 데이터를 RawTask 형식으로 변환합니다.\n const tasks: RawTask[] = []\n\n // Start processing from the second row onward to skip the header\n for (let rowIndex = 2; rowIndex <= worksheet.rowCount; rowIndex++) {\n const row = worksheet.getRow(rowIndex)\n const taskData: any = {}\n\n row.eachCell((cell, colNumber) => {\n const header = headers[colNumber - 1]\n\n // Check if the cell has a formula(or sharedFormula) and use the formula result\n let cellValue: any = cell.value\n if (cellValue && typeof cellValue === 'object' && ('formula' in cellValue || 'sharedFormula' in cellValue)) {\n // Cell contains a formula, use the calculated result if available\n cellValue = cellValue.result ?? cellValue.value // Use the result, or fallback to value if result is not calculated\n }\n\n taskData[header] = cellValue\n })\n\n const taskCodeCell = row.getCell(taskCodeColumnIndex)\n let bgColor = '#FFFFFF'\n const fill = taskCodeCell.style.fill\n\n if (fill && fill.type === 'pattern' && fill.pattern === 'solid') {\n const fgColor = fill.fgColor\n if (fgColor && fgColor.argb) {\n // ARGB is a color in the format AARRGGBB, remove the alpha channel (first two characters)\n bgColor = `#${fgColor.argb.slice(2)}`\n }\n }\n\n const task: RawTask = {\n code: taskData['작업코드'],\n title: taskData['작업명'],\n type: taskData['세부공종'],\n duration: taskData['기간'],\n startDate: taskData['시작일'],\n dependsOn: taskData['선행작업코드'],\n progress: taskData['진척율'],\n tags: taskData['Tags'] ? taskData['Tags'].split(',') : [],\n resources: taskData['Resources'] ? JSON.parse(taskData['Resources']) : [],\n style: bgColor,\n children: []\n }\n\n if (task.code && task.type) {\n tasks.push(task)\n }\n }\n\n // 5. 변환된 데이터를 importTasks 함수로 전달합니다.\n await importTasks(project, tasks, context)\n}\n"]}
@@ -9,7 +9,7 @@ export * from './manager/manager';
9
9
  export * from './manager/manager-type';
10
10
  export * from './task/task';
11
11
  export * from './project/project';
12
- export declare const entities: (typeof import("./project/project").Project | typeof import("./task/task").Task | typeof import("./task-checklist-binding/task-checklist-binding").TaskChecklistBinding | typeof import("./task-resource/task-resource").TaskResource | typeof import("./resource/resource").Resource | typeof import("./construction-detail-type/construction-detail-type").ConstructionDetailType | typeof import("./construction-type/construction-type").ConstructionType | typeof import("./inspection-drawing-type/inspection-drawing-type").InspectionDrawingType | typeof import("./inspection-part/inspection-part").InspectionPart | typeof import("./worker-type/worker-type").WorkerType | typeof import("./manager/manager").Manager)[];
12
+ export declare const entities: (typeof import("./project/project").Project | typeof import("./task/task").Task | typeof import("./task-checklist-binding/task-checklist-binding").TaskChecklistBinding | typeof import("./task-resource/task-resource").TaskResource | typeof import("./resource/resource").Resource | typeof import("./construction-type/construction-type").ConstructionType | typeof import("./construction-detail-type/construction-detail-type").ConstructionDetailType | typeof import("./inspection-part/inspection-part").InspectionPart | typeof import("./inspection-drawing-type/inspection-drawing-type").InspectionDrawingType | typeof import("./worker-type/worker-type").WorkerType | typeof import("./manager/manager").Manager)[];
13
13
  export declare const schema: {
14
- resolverClasses: (typeof import("./task-resource/task-resource-query").TaskResourceQuery | typeof import("./task-resource/task-resource-mutation").TaskResourceMutation | typeof import("./resource/resource-query").ResourceQuery | typeof import("./resource/resource-mutation").ResourceMutation | typeof import("./task/task-query").TaskQuery | typeof import("./task/task-mutation").TaskMutation | typeof import("./project/project-query").ProjectQuery | typeof import("./project/project-mutation").ProjectMutation | typeof import("./task-checklist-binding/task-checklist-binding-query").TaskChecklistBindingQuery | typeof import("./task-checklist-binding/task-checklist-binding-mutation").TaskChecklistBindingMutation | typeof import("./construction-detail-type/construction-detail-type-query").ConstructionDetailTypeQuery | typeof import("./construction-detail-type/construction-detail-type-mutation").ConstructionDetailTypeMutation | typeof import("./construction-type/construction-type-query").ConstructionTypeQuery | typeof import("./construction-type/construction-type-mutation").ConstructionTypeMutation | typeof import("./inspection-drawing-type/inspection-drawing-type-query").InspectionDrawingTypeQuery | typeof import("./inspection-drawing-type/inspection-drawing-type-mutation").InspectionDrawingTypeMutation | typeof import("./inspection-part/inspection-part-query").InspectionPartQuery | typeof import("./inspection-part/inspection-part-mutation").InspectionPartMutation | typeof import("./worker-type/worker-type-query").WorkerTypeQuery | typeof import("./worker-type/worker-type-mutation").WorkerTypeMutation | typeof import("./manager/manager-query").ManagerQuery | typeof import("./manager/manager-mutation").ManagerMutation)[];
14
+ resolverClasses: (typeof import("./task-resource/task-resource-query").TaskResourceQuery | typeof import("./task-resource/task-resource-mutation").TaskResourceMutation | typeof import("./resource/resource-query").ResourceQuery | typeof import("./resource/resource-mutation").ResourceMutation | typeof import("./construction-detail-type/construction-detail-type-query").ConstructionDetailTypeQuery | typeof import("./construction-detail-type/construction-detail-type-mutation").ConstructionDetailTypeMutation | typeof import("./construction-type/construction-type-query").ConstructionTypeQuery | typeof import("./construction-type/construction-type-mutation").ConstructionTypeMutation | typeof import("./inspection-drawing-type/inspection-drawing-type-query").InspectionDrawingTypeQuery | typeof import("./inspection-drawing-type/inspection-drawing-type-mutation").InspectionDrawingTypeMutation | typeof import("./inspection-part/inspection-part-query").InspectionPartQuery | typeof import("./inspection-part/inspection-part-mutation").InspectionPartMutation | typeof import("./worker-type/worker-type-query").WorkerTypeQuery | typeof import("./worker-type/worker-type-mutation").WorkerTypeMutation | typeof import("./manager/manager-query").ManagerQuery | typeof import("./manager/manager-mutation").ManagerMutation | typeof import("./task/task-query").TaskQuery | typeof import("./task/task-mutation").TaskMutation | typeof import("./project/project-query").ProjectQuery | typeof import("./project/project-mutation").ProjectMutation | typeof import("./task-checklist-binding/task-checklist-binding-query").TaskChecklistBindingQuery | typeof import("./task-checklist-binding/task-checklist-binding-mutation").TaskChecklistBindingMutation)[];
15
15
  };