ide-assi 0.216.0 → 0.218.0

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.
@@ -193457,7 +193457,7 @@ class IdeAi
193457
193457
  #getMenuInfo = () => {
193458
193458
  let arr = [];
193459
193459
 
193460
- ninegrid.querySelectorAll("nx-side-menu-item[url][title]").forEach(elem => {
193460
+ ninegrid.querySelectorAll("nx-side-menu-item[href][title]").forEach(elem => {
193461
193461
  arr.push({
193462
193462
  //menuId: elem.getAttribute("menu-id"),
193463
193463
  url: elem.getAttribute("href"),
@@ -193704,22 +193704,74 @@ class IdeAi
193704
193704
  };*/
193705
193705
  };
193706
193706
 
193707
- generateSourceClient = async (userPrompt) => {
193707
+ #createSource = async (userPrompt) => {
193708
+ const where = await this.#where(userPrompt, this.#getMenuInfo(), await this.#getTableList());
193709
+ this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.");
193708
193710
 
193709
- this.#createModel();
193710
193711
 
193711
- const what = await this.#what(userPrompt);
193712
- this.#parent.addMessage("명령을 이해했습니다.");
193712
+ console.log(where);
193713
+
193714
+ const srcPath = this.#getSourcePath(where.menu.url);
193713
193715
 
193714
- console.log(what);
193716
+ console.log(srcPath);
193715
193717
 
193716
- if (what.result === "1") {
193717
- console.log("111");
193718
- }
193719
- else if (what.result === "2") {
193720
- console.log("222");
193721
- }
193718
+ const columnInfo = await this.#getColumnInfo(where.table);
193719
+
193720
+ const mybatisXmlSource = await this.#generateTmplFile("/prompts/meta/BuildMyBatisMapper.txt", "mybatis.xml", {
193721
+ userPrompt: userPrompt,
193722
+ resultType: srcPath.resultType,
193723
+ namespace: srcPath.namespace,
193724
+ tableDefinitions: columnInfo
193725
+ });
193726
+ this.#parent.addMessage("MyBatis 소스파일을 생성했습니다.");
193727
+
193728
+ const serviceSrc = await this.#generateTmplFile("/prompts/meta/BuildService.txt", "service.java", {
193729
+ userPrompt: userPrompt,
193730
+ baseClass: srcPath.baseClass,
193731
+ myBatisPath: srcPath.mybatis,
193732
+ namespace: srcPath.namespace,
193733
+ package: srcPath.package + ".service",
193734
+ mybatisXmlSource: mybatisXmlSource,
193735
+ });
193736
+ this.#parent.addMessage("Java(Service) 소스파일을 생성했습니다.");
193737
+
193738
+ const controllerSrc = await this.#generateTmplFile("/prompts/meta/BuildController.txt", "controller.java", {
193739
+ userPrompt: userPrompt,
193740
+ baseClass: srcPath.baseClass,
193741
+ menuUrl: where.menu.url,
193742
+ package: srcPath.package + ".controller",
193743
+ serviceSource: serviceSrc,
193744
+ });
193745
+ this.#parent.addMessage("Java(Controller) 소스파일을 생성했습니다.");
193746
+
193747
+ await this.#generateTmplFile("/prompts/meta/BuildReactJsx.txt", "react.jsx", {
193748
+ userPrompt: userPrompt,
193749
+ menuUrl: where.menu.url,
193750
+ menuName: where.menu.name,
193751
+ baseClass: srcPath.baseClass,
193752
+ controllerSource: controllerSrc,
193753
+ tableDefinitions: columnInfo,
193754
+ });
193755
+ this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
193722
193756
 
193757
+ await this.#generateRealFile(srcPath);
193758
+ };
193759
+
193760
+ #modifySource = async (userPrompt) => {
193761
+
193762
+ const el = ninegrid.querySelector("nx-side-menu-item.active");
193763
+ if (el) throw new Error("관련 메뉴를 찾을 수 없습니다.");
193764
+
193765
+ const href = el.getAttribute("href");
193766
+ el.getAttribute("title");
193767
+
193768
+ const srcPath1 = this.#getSourcePath(href);
193769
+ console.log(srcPath1);
193770
+
193771
+ const template = await api.post("/api/source/read", srcPath);
193772
+ console.log(template);
193773
+
193774
+ //const template = await fetch(path).then(res => res.text());
193723
193775
 
193724
193776
 
193725
193777
  const where = await this.#where(userPrompt, this.#getMenuInfo(), await this.#getTableList());
@@ -193771,6 +193823,21 @@ class IdeAi
193771
193823
  this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
193772
193824
 
193773
193825
  await this.#generateRealFile(srcPath);
193826
+ };
193827
+
193828
+ generateSourceClient = async (userPrompt) => {
193829
+
193830
+ this.#createModel();
193831
+
193832
+ const what = await this.#what(userPrompt);
193833
+ this.#parent.addMessage("명령을 이해했습니다.");
193834
+
193835
+ if (what === "1") {
193836
+ await this.#createSource(userPrompt);
193837
+ }
193838
+ else if (what === "2") {
193839
+ await this.#modifySource(userPrompt);
193840
+ }
193774
193841
 
193775
193842
  return "OK";
193776
193843
  }
@@ -193453,7 +193453,7 @@ class IdeAi
193453
193453
  #getMenuInfo = () => {
193454
193454
  let arr = [];
193455
193455
 
193456
- ninegrid.querySelectorAll("nx-side-menu-item[url][title]").forEach(elem => {
193456
+ ninegrid.querySelectorAll("nx-side-menu-item[href][title]").forEach(elem => {
193457
193457
  arr.push({
193458
193458
  //menuId: elem.getAttribute("menu-id"),
193459
193459
  url: elem.getAttribute("href"),
@@ -193700,22 +193700,74 @@ class IdeAi
193700
193700
  };*/
193701
193701
  };
193702
193702
 
193703
- generateSourceClient = async (userPrompt) => {
193703
+ #createSource = async (userPrompt) => {
193704
+ const where = await this.#where(userPrompt, this.#getMenuInfo(), await this.#getTableList());
193705
+ this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.");
193704
193706
 
193705
- this.#createModel();
193706
193707
 
193707
- const what = await this.#what(userPrompt);
193708
- this.#parent.addMessage("명령을 이해했습니다.");
193708
+ console.log(where);
193709
+
193710
+ const srcPath = this.#getSourcePath(where.menu.url);
193709
193711
 
193710
- console.log(what);
193712
+ console.log(srcPath);
193711
193713
 
193712
- if (what.result === "1") {
193713
- console.log("111");
193714
- }
193715
- else if (what.result === "2") {
193716
- console.log("222");
193717
- }
193714
+ const columnInfo = await this.#getColumnInfo(where.table);
193715
+
193716
+ const mybatisXmlSource = await this.#generateTmplFile("/prompts/meta/BuildMyBatisMapper.txt", "mybatis.xml", {
193717
+ userPrompt: userPrompt,
193718
+ resultType: srcPath.resultType,
193719
+ namespace: srcPath.namespace,
193720
+ tableDefinitions: columnInfo
193721
+ });
193722
+ this.#parent.addMessage("MyBatis 소스파일을 생성했습니다.");
193723
+
193724
+ const serviceSrc = await this.#generateTmplFile("/prompts/meta/BuildService.txt", "service.java", {
193725
+ userPrompt: userPrompt,
193726
+ baseClass: srcPath.baseClass,
193727
+ myBatisPath: srcPath.mybatis,
193728
+ namespace: srcPath.namespace,
193729
+ package: srcPath.package + ".service",
193730
+ mybatisXmlSource: mybatisXmlSource,
193731
+ });
193732
+ this.#parent.addMessage("Java(Service) 소스파일을 생성했습니다.");
193733
+
193734
+ const controllerSrc = await this.#generateTmplFile("/prompts/meta/BuildController.txt", "controller.java", {
193735
+ userPrompt: userPrompt,
193736
+ baseClass: srcPath.baseClass,
193737
+ menuUrl: where.menu.url,
193738
+ package: srcPath.package + ".controller",
193739
+ serviceSource: serviceSrc,
193740
+ });
193741
+ this.#parent.addMessage("Java(Controller) 소스파일을 생성했습니다.");
193742
+
193743
+ await this.#generateTmplFile("/prompts/meta/BuildReactJsx.txt", "react.jsx", {
193744
+ userPrompt: userPrompt,
193745
+ menuUrl: where.menu.url,
193746
+ menuName: where.menu.name,
193747
+ baseClass: srcPath.baseClass,
193748
+ controllerSource: controllerSrc,
193749
+ tableDefinitions: columnInfo,
193750
+ });
193751
+ this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
193718
193752
 
193753
+ await this.#generateRealFile(srcPath);
193754
+ };
193755
+
193756
+ #modifySource = async (userPrompt) => {
193757
+
193758
+ const el = ninegrid.querySelector("nx-side-menu-item.active");
193759
+ if (el) throw new Error("관련 메뉴를 찾을 수 없습니다.");
193760
+
193761
+ const href = el.getAttribute("href");
193762
+ el.getAttribute("title");
193763
+
193764
+ const srcPath1 = this.#getSourcePath(href);
193765
+ console.log(srcPath1);
193766
+
193767
+ const template = await api.post("/api/source/read", srcPath);
193768
+ console.log(template);
193769
+
193770
+ //const template = await fetch(path).then(res => res.text());
193719
193771
 
193720
193772
 
193721
193773
  const where = await this.#where(userPrompt, this.#getMenuInfo(), await this.#getTableList());
@@ -193767,6 +193819,21 @@ class IdeAi
193767
193819
  this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
193768
193820
 
193769
193821
  await this.#generateRealFile(srcPath);
193822
+ };
193823
+
193824
+ generateSourceClient = async (userPrompt) => {
193825
+
193826
+ this.#createModel();
193827
+
193828
+ const what = await this.#what(userPrompt);
193829
+ this.#parent.addMessage("명령을 이해했습니다.");
193830
+
193831
+ if (what === "1") {
193832
+ await this.#createSource(userPrompt);
193833
+ }
193834
+ else if (what === "2") {
193835
+ await this.#modifySource(userPrompt);
193836
+ }
193770
193837
 
193771
193838
  return "OK";
193772
193839
  }
@@ -41,7 +41,7 @@ export class IdeAi
41
41
  #getMenuInfo = () => {
42
42
  let arr = [];
43
43
 
44
- ninegrid.querySelectorAll("nx-side-menu-item[url][title]").forEach(elem => {
44
+ ninegrid.querySelectorAll("nx-side-menu-item[href][title]").forEach(elem => {
45
45
  arr.push({
46
46
  //menuId: elem.getAttribute("menu-id"),
47
47
  url: elem.getAttribute("href"),
@@ -288,22 +288,74 @@ export class IdeAi
288
288
  };*/
289
289
  };
290
290
 
291
- generateSourceClient = async (userPrompt) => {
291
+ #createSource = async (userPrompt) => {
292
+ const where = await this.#where(userPrompt, this.#getMenuInfo(), await this.#getTableList());
293
+ this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.")
292
294
 
293
- this.#createModel();
294
295
 
295
- const what = await this.#what(userPrompt);
296
- this.#parent.addMessage("명령을 이해했습니다.");
296
+ console.log(where);
297
297
 
298
- console.log(what);
298
+ const srcPath = this.#getSourcePath(where.menu.url);
299
299
 
300
- if (what.result === "1") {
301
- console.log("111")
302
- }
303
- else if (what.result === "2") {
304
- console.log("222")
305
- }
300
+ console.log(srcPath);
306
301
 
302
+ const columnInfo = await this.#getColumnInfo(where.table);
303
+
304
+ const mybatisXmlSource = await this.#generateTmplFile("/prompts/meta/BuildMyBatisMapper.txt", "mybatis.xml", {
305
+ userPrompt: userPrompt,
306
+ resultType: srcPath.resultType,
307
+ namespace: srcPath.namespace,
308
+ tableDefinitions: columnInfo
309
+ });
310
+ this.#parent.addMessage("MyBatis 소스파일을 생성했습니다.");
311
+
312
+ const serviceSrc = await this.#generateTmplFile("/prompts/meta/BuildService.txt", "service.java", {
313
+ userPrompt: userPrompt,
314
+ baseClass: srcPath.baseClass,
315
+ myBatisPath: srcPath.mybatis,
316
+ namespace: srcPath.namespace,
317
+ package: srcPath.package + ".service",
318
+ mybatisXmlSource: mybatisXmlSource,
319
+ });
320
+ this.#parent.addMessage("Java(Service) 소스파일을 생성했습니다.");
321
+
322
+ const controllerSrc = await this.#generateTmplFile("/prompts/meta/BuildController.txt", "controller.java", {
323
+ userPrompt: userPrompt,
324
+ baseClass: srcPath.baseClass,
325
+ menuUrl: where.menu.url,
326
+ package: srcPath.package + ".controller",
327
+ serviceSource: serviceSrc,
328
+ });
329
+ this.#parent.addMessage("Java(Controller) 소스파일을 생성했습니다.");
330
+
331
+ const jsSrc = await this.#generateTmplFile("/prompts/meta/BuildReactJsx.txt", "react.jsx", {
332
+ userPrompt: userPrompt,
333
+ menuUrl: where.menu.url,
334
+ menuName: where.menu.name,
335
+ baseClass: srcPath.baseClass,
336
+ controllerSource: controllerSrc,
337
+ tableDefinitions: columnInfo,
338
+ });
339
+ this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
340
+
341
+ await this.#generateRealFile(srcPath);
342
+ };
343
+
344
+ #modifySource = async (userPrompt) => {
345
+
346
+ const el = ninegrid.querySelector("nx-side-menu-item.active");
347
+ if (el) throw new Error("관련 메뉴를 찾을 수 없습니다.");
348
+
349
+ const href = el.getAttribute("href");
350
+ const title = el.getAttribute("title");
351
+
352
+ const srcPath1 = this.#getSourcePath(href);
353
+ console.log(srcPath1);
354
+
355
+ const template = await api.post("/api/source/read", srcPath);
356
+ console.log(template);
357
+
358
+ //const template = await fetch(path).then(res => res.text());
307
359
 
308
360
 
309
361
  const where = await this.#where(userPrompt, this.#getMenuInfo(), await this.#getTableList());
@@ -355,6 +407,21 @@ export class IdeAi
355
407
  this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
356
408
 
357
409
  await this.#generateRealFile(srcPath);
410
+ };
411
+
412
+ generateSourceClient = async (userPrompt) => {
413
+
414
+ this.#createModel();
415
+
416
+ const what = await this.#what(userPrompt);
417
+ this.#parent.addMessage("명령을 이해했습니다.");
418
+
419
+ if (what === "1") {
420
+ await this.#createSource(userPrompt);
421
+ }
422
+ else if (what === "2") {
423
+ await this.#modifySource(userPrompt);
424
+ }
358
425
 
359
426
  return "OK";
360
427
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.216.0",
4
+ "version": "0.218.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -41,7 +41,7 @@ export class IdeAi
41
41
  #getMenuInfo = () => {
42
42
  let arr = [];
43
43
 
44
- ninegrid.querySelectorAll("nx-side-menu-item[url][title]").forEach(elem => {
44
+ ninegrid.querySelectorAll("nx-side-menu-item[href][title]").forEach(elem => {
45
45
  arr.push({
46
46
  //menuId: elem.getAttribute("menu-id"),
47
47
  url: elem.getAttribute("href"),
@@ -288,22 +288,74 @@ export class IdeAi
288
288
  };*/
289
289
  };
290
290
 
291
- generateSourceClient = async (userPrompt) => {
291
+ #createSource = async (userPrompt) => {
292
+ const where = await this.#where(userPrompt, this.#getMenuInfo(), await this.#getTableList());
293
+ this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.")
292
294
 
293
- this.#createModel();
294
295
 
295
- const what = await this.#what(userPrompt);
296
- this.#parent.addMessage("명령을 이해했습니다.");
296
+ console.log(where);
297
297
 
298
- console.log(what);
298
+ const srcPath = this.#getSourcePath(where.menu.url);
299
299
 
300
- if (what.result === "1") {
301
- console.log("111")
302
- }
303
- else if (what.result === "2") {
304
- console.log("222")
305
- }
300
+ console.log(srcPath);
306
301
 
302
+ const columnInfo = await this.#getColumnInfo(where.table);
303
+
304
+ const mybatisXmlSource = await this.#generateTmplFile("/prompts/meta/BuildMyBatisMapper.txt", "mybatis.xml", {
305
+ userPrompt: userPrompt,
306
+ resultType: srcPath.resultType,
307
+ namespace: srcPath.namespace,
308
+ tableDefinitions: columnInfo
309
+ });
310
+ this.#parent.addMessage("MyBatis 소스파일을 생성했습니다.");
311
+
312
+ const serviceSrc = await this.#generateTmplFile("/prompts/meta/BuildService.txt", "service.java", {
313
+ userPrompt: userPrompt,
314
+ baseClass: srcPath.baseClass,
315
+ myBatisPath: srcPath.mybatis,
316
+ namespace: srcPath.namespace,
317
+ package: srcPath.package + ".service",
318
+ mybatisXmlSource: mybatisXmlSource,
319
+ });
320
+ this.#parent.addMessage("Java(Service) 소스파일을 생성했습니다.");
321
+
322
+ const controllerSrc = await this.#generateTmplFile("/prompts/meta/BuildController.txt", "controller.java", {
323
+ userPrompt: userPrompt,
324
+ baseClass: srcPath.baseClass,
325
+ menuUrl: where.menu.url,
326
+ package: srcPath.package + ".controller",
327
+ serviceSource: serviceSrc,
328
+ });
329
+ this.#parent.addMessage("Java(Controller) 소스파일을 생성했습니다.");
330
+
331
+ const jsSrc = await this.#generateTmplFile("/prompts/meta/BuildReactJsx.txt", "react.jsx", {
332
+ userPrompt: userPrompt,
333
+ menuUrl: where.menu.url,
334
+ menuName: where.menu.name,
335
+ baseClass: srcPath.baseClass,
336
+ controllerSource: controllerSrc,
337
+ tableDefinitions: columnInfo,
338
+ });
339
+ this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
340
+
341
+ await this.#generateRealFile(srcPath);
342
+ };
343
+
344
+ #modifySource = async (userPrompt) => {
345
+
346
+ const el = ninegrid.querySelector("nx-side-menu-item.active");
347
+ if (el) throw new Error("관련 메뉴를 찾을 수 없습니다.");
348
+
349
+ const href = el.getAttribute("href");
350
+ const title = el.getAttribute("title");
351
+
352
+ const srcPath1 = this.#getSourcePath(href);
353
+ console.log(srcPath1);
354
+
355
+ const template = await api.post("/api/source/read", srcPath);
356
+ console.log(template);
357
+
358
+ //const template = await fetch(path).then(res => res.text());
307
359
 
308
360
 
309
361
  const where = await this.#where(userPrompt, this.#getMenuInfo(), await this.#getTableList());
@@ -355,6 +407,21 @@ export class IdeAi
355
407
  this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
356
408
 
357
409
  await this.#generateRealFile(srcPath);
410
+ };
411
+
412
+ generateSourceClient = async (userPrompt) => {
413
+
414
+ this.#createModel();
415
+
416
+ const what = await this.#what(userPrompt);
417
+ this.#parent.addMessage("명령을 이해했습니다.");
418
+
419
+ if (what === "1") {
420
+ await this.#createSource(userPrompt);
421
+ }
422
+ else if (what === "2") {
423
+ await this.#modifySource(userPrompt);
424
+ }
358
425
 
359
426
  return "OK";
360
427
  }