ide-assi 0.176.0 → 0.177.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.
@@ -176644,7 +176644,7 @@ function requireAgent () {
176644
176644
  return agent;
176645
176645
  }
176646
176646
 
176647
- var api = {};
176647
+ var api$1 = {};
176648
176648
 
176649
176649
  var apiRequest = {exports: {}};
176650
176650
 
@@ -177994,15 +177994,15 @@ function requireApiConnect () {
177994
177994
  var hasRequiredApi;
177995
177995
 
177996
177996
  function requireApi () {
177997
- if (hasRequiredApi) return api;
177997
+ if (hasRequiredApi) return api$1;
177998
177998
  hasRequiredApi = 1;
177999
177999
 
178000
- api.request = requireApiRequest();
178001
- api.stream = requireApiStream();
178002
- api.pipeline = requireApiPipeline();
178003
- api.upgrade = requireApiUpgrade();
178004
- api.connect = requireApiConnect();
178005
- return api;
178000
+ api$1.request = requireApiRequest();
178001
+ api$1.stream = requireApiStream();
178002
+ api$1.pipeline = requireApiPipeline();
178003
+ api$1.upgrade = requireApiUpgrade();
178004
+ api$1.connect = requireApiConnect();
178005
+ return api$1;
178006
178006
  }
178007
178007
 
178008
178008
  var mockErrors;
@@ -193673,12 +193673,55 @@ class IdeAi
193673
193673
  }
193674
193674
  }
193675
193675
 
193676
+ class IdeFetch {
193677
+ static baseUrl = "/api";
193678
+
193679
+ static #request = (method, url, data = {}) => {
193680
+
193681
+ console.log(method, url, data);
193682
+
193683
+ const fullUrl = method === "GET"
193684
+ ? `${IdeFetch.baseUrl}/${url}?${new URLSearchParams(data)}`
193685
+ : `${IdeFetch.baseUrl}/${url}`;
193686
+
193687
+ const options = {
193688
+ method,
193689
+ headers: { "Content-Type": "application/json" }
193690
+ };
193691
+
193692
+ if (method !== "GET") {
193693
+ options.body = JSON.stringify(data);
193694
+ }
193695
+
193696
+ return fetch(fullUrl, options)
193697
+ .then(res => {
193698
+ if (!res.ok) {
193699
+ return res.text().then(text => {
193700
+ throw new Error(`API 오류 (${res.status}): ${text}`);
193701
+ });
193702
+ }
193703
+ return res.json();
193704
+ })
193705
+ .catch(err => {
193706
+ console.error(`[fetch.${method.toLowerCase()}] ${url} 실패:`, err);
193707
+ throw err;
193708
+ });
193709
+ };
193710
+
193711
+ static get = (url, data = {}) => IdeFetch.#request("GET", url, data);
193712
+
193713
+ static post = (url, data = {}) => IdeFetch.#request("POST", url, data);
193714
+ }
193715
+
193716
+ const api = IdeFetch;
193717
+
193676
193718
  class IdeAssi extends HTMLElement
193677
193719
  {
193678
193720
  #ing = false;
193679
193721
  #ai;
193680
193722
 
193681
193723
  settings;
193724
+ config;
193682
193725
 
193683
193726
  constructor() {
193684
193727
  super();
@@ -193726,12 +193769,7 @@ class IdeAssi extends HTMLElement
193726
193769
  };
193727
193770
 
193728
193771
  #config = async () => {
193729
- const res = await fetch(`/api/config/get`, {
193730
- method: "POST",
193731
- headers: {"Content-Type": "application/json"},
193732
- });
193733
-
193734
- console.log(res);
193772
+ this.config = await api.post("/config/get");
193735
193773
  };
193736
193774
 
193737
193775
  #init = (info) => {
@@ -194003,46 +194041,6 @@ class ideAssiSettings extends HTMLElement
194003
194041
 
194004
194042
  customElements.define("ide-assi-settings", ideAssiSettings);
194005
194043
 
194006
- class IdeFetch {
194007
- static baseUrl = "/api";
194008
-
194009
- static #request = (method, url, data = {}) => {
194010
-
194011
- console.log(method, url, data);
194012
-
194013
- const fullUrl = method === "GET"
194014
- ? `${IdeFetch.baseUrl}/${url}?${new URLSearchParams(data)}`
194015
- : `${IdeFetch.baseUrl}/${url}`;
194016
-
194017
- const options = {
194018
- method,
194019
- headers: { "Content-Type": "application/json" }
194020
- };
194021
-
194022
- if (method !== "GET") {
194023
- options.body = JSON.stringify(data);
194024
- }
194025
-
194026
- return fetch(fullUrl, options)
194027
- .then(res => {
194028
- if (!res.ok) {
194029
- return res.text().then(text => {
194030
- throw new Error(`API 오류 (${res.status}): ${text}`);
194031
- });
194032
- }
194033
- return res.json();
194034
- })
194035
- .catch(err => {
194036
- console.error(`[fetch.${method.toLowerCase()}] ${url} 실패:`, err);
194037
- throw err;
194038
- });
194039
- };
194040
-
194041
- static get = (url, data = {}) => IdeFetch.#request("GET", url, data);
194042
-
194043
- static post = (url, data = {}) => IdeFetch.#request("POST", url, data);
194044
- }
194045
-
194046
194044
  //import "./components/ideAssi.js";
194047
194045
 
194048
194046
 
@@ -176640,7 +176640,7 @@ function requireAgent () {
176640
176640
  return agent;
176641
176641
  }
176642
176642
 
176643
- var api = {};
176643
+ var api$1 = {};
176644
176644
 
176645
176645
  var apiRequest = {exports: {}};
176646
176646
 
@@ -177990,15 +177990,15 @@ function requireApiConnect () {
177990
177990
  var hasRequiredApi;
177991
177991
 
177992
177992
  function requireApi () {
177993
- if (hasRequiredApi) return api;
177993
+ if (hasRequiredApi) return api$1;
177994
177994
  hasRequiredApi = 1;
177995
177995
 
177996
- api.request = requireApiRequest();
177997
- api.stream = requireApiStream();
177998
- api.pipeline = requireApiPipeline();
177999
- api.upgrade = requireApiUpgrade();
178000
- api.connect = requireApiConnect();
178001
- return api;
177996
+ api$1.request = requireApiRequest();
177997
+ api$1.stream = requireApiStream();
177998
+ api$1.pipeline = requireApiPipeline();
177999
+ api$1.upgrade = requireApiUpgrade();
178000
+ api$1.connect = requireApiConnect();
178001
+ return api$1;
178002
178002
  }
178003
178003
 
178004
178004
  var mockErrors;
@@ -193669,12 +193669,55 @@ class IdeAi
193669
193669
  }
193670
193670
  }
193671
193671
 
193672
+ class IdeFetch {
193673
+ static baseUrl = "/api";
193674
+
193675
+ static #request = (method, url, data = {}) => {
193676
+
193677
+ console.log(method, url, data);
193678
+
193679
+ const fullUrl = method === "GET"
193680
+ ? `${IdeFetch.baseUrl}/${url}?${new URLSearchParams(data)}`
193681
+ : `${IdeFetch.baseUrl}/${url}`;
193682
+
193683
+ const options = {
193684
+ method,
193685
+ headers: { "Content-Type": "application/json" }
193686
+ };
193687
+
193688
+ if (method !== "GET") {
193689
+ options.body = JSON.stringify(data);
193690
+ }
193691
+
193692
+ return fetch(fullUrl, options)
193693
+ .then(res => {
193694
+ if (!res.ok) {
193695
+ return res.text().then(text => {
193696
+ throw new Error(`API 오류 (${res.status}): ${text}`);
193697
+ });
193698
+ }
193699
+ return res.json();
193700
+ })
193701
+ .catch(err => {
193702
+ console.error(`[fetch.${method.toLowerCase()}] ${url} 실패:`, err);
193703
+ throw err;
193704
+ });
193705
+ };
193706
+
193707
+ static get = (url, data = {}) => IdeFetch.#request("GET", url, data);
193708
+
193709
+ static post = (url, data = {}) => IdeFetch.#request("POST", url, data);
193710
+ }
193711
+
193712
+ const api = IdeFetch;
193713
+
193672
193714
  class IdeAssi extends HTMLElement
193673
193715
  {
193674
193716
  #ing = false;
193675
193717
  #ai;
193676
193718
 
193677
193719
  settings;
193720
+ config;
193678
193721
 
193679
193722
  constructor() {
193680
193723
  super();
@@ -193722,12 +193765,7 @@ class IdeAssi extends HTMLElement
193722
193765
  };
193723
193766
 
193724
193767
  #config = async () => {
193725
- const res = await fetch(`/api/config/get`, {
193726
- method: "POST",
193727
- headers: {"Content-Type": "application/json"},
193728
- });
193729
-
193730
- console.log(res);
193768
+ this.config = await api.post("/config/get");
193731
193769
  };
193732
193770
 
193733
193771
  #init = (info) => {
@@ -193999,46 +194037,6 @@ class ideAssiSettings extends HTMLElement
193999
194037
 
194000
194038
  customElements.define("ide-assi-settings", ideAssiSettings);
194001
194039
 
194002
- class IdeFetch {
194003
- static baseUrl = "/api";
194004
-
194005
- static #request = (method, url, data = {}) => {
194006
-
194007
- console.log(method, url, data);
194008
-
194009
- const fullUrl = method === "GET"
194010
- ? `${IdeFetch.baseUrl}/${url}?${new URLSearchParams(data)}`
194011
- : `${IdeFetch.baseUrl}/${url}`;
194012
-
194013
- const options = {
194014
- method,
194015
- headers: { "Content-Type": "application/json" }
194016
- };
194017
-
194018
- if (method !== "GET") {
194019
- options.body = JSON.stringify(data);
194020
- }
194021
-
194022
- return fetch(fullUrl, options)
194023
- .then(res => {
194024
- if (!res.ok) {
194025
- return res.text().then(text => {
194026
- throw new Error(`API 오류 (${res.status}): ${text}`);
194027
- });
194028
- }
194029
- return res.json();
194030
- })
194031
- .catch(err => {
194032
- console.error(`[fetch.${method.toLowerCase()}] ${url} 실패:`, err);
194033
- throw err;
194034
- });
194035
- };
194036
-
194037
- static get = (url, data = {}) => IdeFetch.#request("GET", url, data);
194038
-
194039
- static post = (url, data = {}) => IdeFetch.#request("POST", url, data);
194040
- }
194041
-
194042
194040
  //import "./components/ideAssi.js";
194043
194041
 
194044
194042
 
@@ -1,5 +1,6 @@
1
1
  import ninegrid from "ninegrid2";
2
2
  import { IdeAi } from "./ideAi.js";
3
+ import { api } from "./ideFetch.js";
3
4
 
4
5
  export class IdeAssi extends HTMLElement
5
6
  {
@@ -7,6 +8,7 @@ export class IdeAssi extends HTMLElement
7
8
  #ai;
8
9
 
9
10
  settings;
11
+ config;
10
12
 
11
13
  constructor() {
12
14
  super();
@@ -54,12 +56,7 @@ export class IdeAssi extends HTMLElement
54
56
  };
55
57
 
56
58
  #config = async () => {
57
- const res = await fetch(`/api/config/get`, {
58
- method: "POST",
59
- headers: {"Content-Type": "application/json"},
60
- });
61
-
62
- console.log(res);
59
+ this.config = await api.post("/config/get");
63
60
  };
64
61
 
65
62
  #init = (info) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.176.0",
4
+ "version": "0.177.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -1,5 +1,6 @@
1
1
  import ninegrid from "ninegrid2";
2
2
  import { IdeAi } from "./ideAi.js";
3
+ import { api } from "./ideFetch.js";
3
4
 
4
5
  export class IdeAssi extends HTMLElement
5
6
  {
@@ -7,6 +8,7 @@ export class IdeAssi extends HTMLElement
7
8
  #ai;
8
9
 
9
10
  settings;
11
+ config;
10
12
 
11
13
  constructor() {
12
14
  super();
@@ -54,12 +56,7 @@ export class IdeAssi extends HTMLElement
54
56
  };
55
57
 
56
58
  #config = async () => {
57
- const res = await fetch(`/api/config/get`, {
58
- method: "POST",
59
- headers: {"Content-Type": "application/json"},
60
- });
61
-
62
- console.log(res);
59
+ this.config = await api.post("/config/get");
63
60
  };
64
61
 
65
62
  #init = (info) => {