ide-assi 0.8.0 → 0.10.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.
@@ -193257,13 +193257,68 @@ window.jQuery = window.$ = $$1;
193257
193257
 
193258
193258
  //export default new ninegrid();
193259
193259
 
193260
+ class IdeAi
193261
+ {
193262
+ #API_URL = "http://localhost:8091";
193263
+
193264
+ constructor() {
193265
+ }
193266
+
193267
+ #getMenuInfo = (question) => {
193268
+ let arr = [];
193269
+
193270
+ ninegrid.querySelectorAll("nx-side-menu-item[url][title]").forEach(elem => {
193271
+ arr.push({
193272
+ //menuId: elem.getAttribute("menu-id"),
193273
+ url: elem.getAttribute("url"),
193274
+ title: elem.getAttribute("title"),
193275
+ });
193276
+ });
193277
+
193278
+ return arr;
193279
+ };
193280
+
193281
+ #getTableInfo = async (question) => {
193282
+ const response = await fetch(`${this.#API_URL}/api/meta/tables`, {
193283
+ method: "POST",
193284
+ headers: { "Content-Type": "application/json" },
193285
+ body: JSON.stringify({
193286
+ schema: "aidemo",
193287
+ })
193288
+ });
193289
+
193290
+ console.log(response);
193291
+ console.log(await response.json());
193292
+ };
193293
+
193294
+
193295
+ /**
193296
+ * 1. 소스 명칭 package 예) tmpl.population
193297
+ * 2. 소스가 없으면 소스 생성
193298
+ * 3.
193299
+ *
193300
+ * 1. 메뉴정보, 테이블정보로 해당 패키지, URL, 소스명칭을 유추
193301
+ */
193302
+ generateSource = async (question) => {
193303
+
193304
+ const menuInfo = this.#getMenuInfo();
193305
+ const tableInfo = await this.#getTableInfo();
193306
+
193307
+ console.log(menuInfo);
193308
+ console.log(tableInfo);
193309
+ };
193310
+ }
193311
+
193260
193312
  class IdeAssi extends HTMLElement
193261
193313
  {
193314
+ #ai;
193262
193315
  #ing = false;
193263
193316
 
193264
193317
  constructor() {
193265
193318
  super();
193266
193319
  this.attachShadow({ mode: 'open' });
193320
+
193321
+ this.#ai = new IdeAi();
193267
193322
  }
193268
193323
 
193269
193324
  connectedCallback() {
@@ -193314,46 +193369,7 @@ class IdeAssi extends HTMLElement
193314
193369
  };
193315
193370
 
193316
193371
 
193317
- #getMenuInfo = (question) => {
193318
- let arr = [];
193319
193372
 
193320
- ninegrid.querySelectorAll("nx-side-menu-item[url][title]").forEach(elem => {
193321
- arr.push({
193322
- //menuId: elem.getAttribute("menu-id"),
193323
- url: elem.getAttribute("url"),
193324
- title: elem.getAttribute("title"),
193325
- });
193326
- });
193327
-
193328
- return arr;
193329
- };
193330
-
193331
- #getTableInfo = async (question) => {
193332
- const response = await fetch("/api/meta/tables", {
193333
- method: "POST",
193334
- headers: { "Content-Type": "application/json" },
193335
- body: JSON.stringify({
193336
- //filename: "HelloWorld.java",
193337
- //filename: "Test.jsx",
193338
- //content: js
193339
- })
193340
- });
193341
-
193342
- console.log(response);
193343
-
193344
- };
193345
-
193346
-
193347
- /**
193348
- * 1. 소스 명칭 package 예) tmpl.population
193349
- * 2. 소스가 없으면 소스 생성
193350
- * 3.
193351
- */
193352
- #generateSource = async (question) => {
193353
-
193354
- this.#getMenuInfo();
193355
- await this.#getTableInfo();
193356
- };
193357
193373
 
193358
193374
  #keydownHandler = async (e) => {
193359
193375
  if (e.key !== "Enter") return;
@@ -193380,7 +193396,7 @@ class IdeAssi extends HTMLElement
193380
193396
  elAiChat.add("ing", question);
193381
193397
 
193382
193398
  try {
193383
- this.#generateSource(question);
193399
+ this.#ai.generateSource(question);
193384
193400
  } catch (error) {
193385
193401
  console.error(error);
193386
193402
  elAiChat.add("ai", error);
@@ -193253,13 +193253,68 @@ window.jQuery = window.$ = $$1;
193253
193253
 
193254
193254
  //export default new ninegrid();
193255
193255
 
193256
+ class IdeAi
193257
+ {
193258
+ #API_URL = "http://localhost:8091";
193259
+
193260
+ constructor() {
193261
+ }
193262
+
193263
+ #getMenuInfo = (question) => {
193264
+ let arr = [];
193265
+
193266
+ ninegrid.querySelectorAll("nx-side-menu-item[url][title]").forEach(elem => {
193267
+ arr.push({
193268
+ //menuId: elem.getAttribute("menu-id"),
193269
+ url: elem.getAttribute("url"),
193270
+ title: elem.getAttribute("title"),
193271
+ });
193272
+ });
193273
+
193274
+ return arr;
193275
+ };
193276
+
193277
+ #getTableInfo = async (question) => {
193278
+ const response = await fetch(`${this.#API_URL}/api/meta/tables`, {
193279
+ method: "POST",
193280
+ headers: { "Content-Type": "application/json" },
193281
+ body: JSON.stringify({
193282
+ schema: "aidemo",
193283
+ })
193284
+ });
193285
+
193286
+ console.log(response);
193287
+ console.log(await response.json());
193288
+ };
193289
+
193290
+
193291
+ /**
193292
+ * 1. 소스 명칭 package 예) tmpl.population
193293
+ * 2. 소스가 없으면 소스 생성
193294
+ * 3.
193295
+ *
193296
+ * 1. 메뉴정보, 테이블정보로 해당 패키지, URL, 소스명칭을 유추
193297
+ */
193298
+ generateSource = async (question) => {
193299
+
193300
+ const menuInfo = this.#getMenuInfo();
193301
+ const tableInfo = await this.#getTableInfo();
193302
+
193303
+ console.log(menuInfo);
193304
+ console.log(tableInfo);
193305
+ };
193306
+ }
193307
+
193256
193308
  class IdeAssi extends HTMLElement
193257
193309
  {
193310
+ #ai;
193258
193311
  #ing = false;
193259
193312
 
193260
193313
  constructor() {
193261
193314
  super();
193262
193315
  this.attachShadow({ mode: 'open' });
193316
+
193317
+ this.#ai = new IdeAi();
193263
193318
  }
193264
193319
 
193265
193320
  connectedCallback() {
@@ -193310,46 +193365,7 @@ class IdeAssi extends HTMLElement
193310
193365
  };
193311
193366
 
193312
193367
 
193313
- #getMenuInfo = (question) => {
193314
- let arr = [];
193315
193368
 
193316
- ninegrid.querySelectorAll("nx-side-menu-item[url][title]").forEach(elem => {
193317
- arr.push({
193318
- //menuId: elem.getAttribute("menu-id"),
193319
- url: elem.getAttribute("url"),
193320
- title: elem.getAttribute("title"),
193321
- });
193322
- });
193323
-
193324
- return arr;
193325
- };
193326
-
193327
- #getTableInfo = async (question) => {
193328
- const response = await fetch("/api/meta/tables", {
193329
- method: "POST",
193330
- headers: { "Content-Type": "application/json" },
193331
- body: JSON.stringify({
193332
- //filename: "HelloWorld.java",
193333
- //filename: "Test.jsx",
193334
- //content: js
193335
- })
193336
- });
193337
-
193338
- console.log(response);
193339
-
193340
- };
193341
-
193342
-
193343
- /**
193344
- * 1. 소스 명칭 package 예) tmpl.population
193345
- * 2. 소스가 없으면 소스 생성
193346
- * 3.
193347
- */
193348
- #generateSource = async (question) => {
193349
-
193350
- this.#getMenuInfo();
193351
- await this.#getTableInfo();
193352
- };
193353
193369
 
193354
193370
  #keydownHandler = async (e) => {
193355
193371
  if (e.key !== "Enter") return;
@@ -193376,7 +193392,7 @@ class IdeAssi extends HTMLElement
193376
193392
  elAiChat.add("ing", question);
193377
193393
 
193378
193394
  try {
193379
- this.#generateSource(question);
193395
+ this.#ai.generateSource(question);
193380
193396
  } catch (error) {
193381
193397
  console.error(error);
193382
193398
  elAiChat.add("ai", error);
@@ -0,0 +1,11 @@
1
+ export class AI
2
+ {
3
+
4
+ constructor() {
5
+ }
6
+
7
+ test = () => {
8
+ console.log("test");
9
+ }
10
+ }
11
+
@@ -0,0 +1,54 @@
1
+ import ninegrid from "ninegrid2";
2
+
3
+ export class IdeAi
4
+ {
5
+ #API_URL = "http://localhost:8091";
6
+
7
+ constructor() {
8
+ }
9
+
10
+ #getMenuInfo = (question) => {
11
+ let arr = [];
12
+
13
+ ninegrid.querySelectorAll("nx-side-menu-item[url][title]").forEach(elem => {
14
+ arr.push({
15
+ //menuId: elem.getAttribute("menu-id"),
16
+ url: elem.getAttribute("url"),
17
+ title: elem.getAttribute("title"),
18
+ })
19
+ });
20
+
21
+ return arr;
22
+ };
23
+
24
+ #getTableInfo = async (question) => {
25
+ const response = await fetch(`${this.#API_URL}/api/meta/tables`, {
26
+ method: "POST",
27
+ headers: { "Content-Type": "application/json" },
28
+ body: JSON.stringify({
29
+ schema: "aidemo",
30
+ })
31
+ });
32
+
33
+ console.log(response);
34
+ console.log(await response.json());
35
+ };
36
+
37
+
38
+ /**
39
+ * 1. 소스 명칭 package 예) tmpl.population
40
+ * 2. 소스가 없으면 소스 생성
41
+ * 3.
42
+ *
43
+ * 1. 메뉴정보, 테이블정보로 해당 패키지, URL, 소스명칭을 유추
44
+ */
45
+ generateSource = async (question) => {
46
+
47
+ const menuInfo = this.#getMenuInfo();
48
+ const tableInfo = await this.#getTableInfo();
49
+
50
+ console.log(menuInfo);
51
+ console.log(tableInfo);
52
+ };
53
+ }
54
+
@@ -1,12 +1,16 @@
1
1
  import ninegrid from "ninegrid2";
2
+ import { IdeAi } from "./ideAi.js";
2
3
 
3
4
  export class IdeAssi extends HTMLElement
4
5
  {
6
+ #ai;
5
7
  #ing = false;
6
8
 
7
9
  constructor() {
8
10
  super();
9
11
  this.attachShadow({ mode: 'open' });
12
+
13
+ this.#ai = new IdeAi();
10
14
  }
11
15
 
12
16
  connectedCallback() {
@@ -57,46 +61,7 @@ export class IdeAssi extends HTMLElement
57
61
  };
58
62
 
59
63
 
60
- #getMenuInfo = (question) => {
61
- let arr = [];
62
-
63
- ninegrid.querySelectorAll("nx-side-menu-item[url][title]").forEach(elem => {
64
- arr.push({
65
- //menuId: elem.getAttribute("menu-id"),
66
- url: elem.getAttribute("url"),
67
- title: elem.getAttribute("title"),
68
- })
69
- });
70
-
71
- return arr;
72
- };
73
-
74
- #getTableInfo = async (question) => {
75
- const response = await fetch("/api/meta/tables", {
76
- method: "POST",
77
- headers: { "Content-Type": "application/json" },
78
- body: JSON.stringify({
79
- //filename: "HelloWorld.java",
80
- //filename: "Test.jsx",
81
- //content: js
82
- })
83
- });
84
64
 
85
- console.log(response);
86
-
87
- };
88
-
89
-
90
- /**
91
- * 1. 소스 명칭 package 예) tmpl.population
92
- * 2. 소스가 없으면 소스 생성
93
- * 3.
94
- */
95
- #generateSource = async (question) => {
96
-
97
- const menuInfo = this.#getMenuInfo();
98
- const tableInfo = await this.#getTableInfo();
99
- };
100
65
 
101
66
  #keydownHandler = async (e) => {
102
67
  if (e.key !== "Enter") return;
@@ -123,7 +88,7 @@ export class IdeAssi extends HTMLElement
123
88
  elAiChat.add("ing", question);
124
89
 
125
90
  try {
126
- this.#generateSource(question);
91
+ this.#ai.generateSource(question);
127
92
  } catch (error) {
128
93
  console.error(error);
129
94
  elAiChat.add("ai", error);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.8.0",
4
+ "version": "0.10.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -0,0 +1,54 @@
1
+ import ninegrid from "ninegrid2";
2
+
3
+ export class IdeAi
4
+ {
5
+ #API_URL = "http://localhost:8091";
6
+
7
+ constructor() {
8
+ }
9
+
10
+ #getMenuInfo = (question) => {
11
+ let arr = [];
12
+
13
+ ninegrid.querySelectorAll("nx-side-menu-item[url][title]").forEach(elem => {
14
+ arr.push({
15
+ //menuId: elem.getAttribute("menu-id"),
16
+ url: elem.getAttribute("url"),
17
+ title: elem.getAttribute("title"),
18
+ })
19
+ });
20
+
21
+ return arr;
22
+ };
23
+
24
+ #getTableInfo = async (question) => {
25
+ const response = await fetch(`${this.#API_URL}/api/meta/tables`, {
26
+ method: "POST",
27
+ headers: { "Content-Type": "application/json" },
28
+ body: JSON.stringify({
29
+ schema: "aidemo",
30
+ })
31
+ });
32
+
33
+ console.log(response);
34
+ console.log(await response.json());
35
+ };
36
+
37
+
38
+ /**
39
+ * 1. 소스 명칭 package 예) tmpl.population
40
+ * 2. 소스가 없으면 소스 생성
41
+ * 3.
42
+ *
43
+ * 1. 메뉴정보, 테이블정보로 해당 패키지, URL, 소스명칭을 유추
44
+ */
45
+ generateSource = async (question) => {
46
+
47
+ const menuInfo = this.#getMenuInfo();
48
+ const tableInfo = await this.#getTableInfo();
49
+
50
+ console.log(menuInfo);
51
+ console.log(tableInfo);
52
+ };
53
+ }
54
+
@@ -1,12 +1,16 @@
1
1
  import ninegrid from "ninegrid2";
2
+ import { IdeAi } from "./ideAi.js";
2
3
 
3
4
  export class IdeAssi extends HTMLElement
4
5
  {
6
+ #ai;
5
7
  #ing = false;
6
8
 
7
9
  constructor() {
8
10
  super();
9
11
  this.attachShadow({ mode: 'open' });
12
+
13
+ this.#ai = new IdeAi();
10
14
  }
11
15
 
12
16
  connectedCallback() {
@@ -57,46 +61,7 @@ export class IdeAssi extends HTMLElement
57
61
  };
58
62
 
59
63
 
60
- #getMenuInfo = (question) => {
61
- let arr = [];
62
-
63
- ninegrid.querySelectorAll("nx-side-menu-item[url][title]").forEach(elem => {
64
- arr.push({
65
- //menuId: elem.getAttribute("menu-id"),
66
- url: elem.getAttribute("url"),
67
- title: elem.getAttribute("title"),
68
- })
69
- });
70
-
71
- return arr;
72
- };
73
-
74
- #getTableInfo = async (question) => {
75
- const response = await fetch("/api/meta/tables", {
76
- method: "POST",
77
- headers: { "Content-Type": "application/json" },
78
- body: JSON.stringify({
79
- //filename: "HelloWorld.java",
80
- //filename: "Test.jsx",
81
- //content: js
82
- })
83
- });
84
64
 
85
- console.log(response);
86
-
87
- };
88
-
89
-
90
- /**
91
- * 1. 소스 명칭 package 예) tmpl.population
92
- * 2. 소스가 없으면 소스 생성
93
- * 3.
94
- */
95
- #generateSource = async (question) => {
96
-
97
- const menuInfo = this.#getMenuInfo();
98
- const tableInfo = await this.#getTableInfo();
99
- };
100
65
 
101
66
  #keydownHandler = async (e) => {
102
67
  if (e.key !== "Enter") return;
@@ -123,7 +88,7 @@ export class IdeAssi extends HTMLElement
123
88
  elAiChat.add("ing", question);
124
89
 
125
90
  try {
126
- this.#generateSource(question);
91
+ this.#ai.generateSource(question);
127
92
  } catch (error) {
128
93
  console.error(error);
129
94
  elAiChat.add("ai", error);