ide-assi 0.176.0 → 0.178.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,52 @@ class IdeAi
193673
193673
  }
193674
193674
  }
193675
193675
 
193676
+ class IdeFetch {
193677
+
193678
+ static #request = (method, url, data = {}) => {
193679
+
193680
+ //console.log(method, url, data);
193681
+
193682
+ if (method === "GET") url += `?${new URLSearchParams(data)}`;
193683
+
193684
+ const options = {
193685
+ method,
193686
+ headers: { "Content-Type": "application/json" }
193687
+ };
193688
+
193689
+ if (method !== "GET") {
193690
+ options.body = JSON.stringify(data);
193691
+ }
193692
+
193693
+ return fetch(url, options)
193694
+ .then(res => {
193695
+ if (!res.ok) {
193696
+ return res.text().then(text => {
193697
+ throw new Error(`API 오류 (${res.status}): ${text}`);
193698
+ });
193699
+ }
193700
+ return res.json();
193701
+ })
193702
+ .catch(err => {
193703
+ console.error(`[fetch.${method.toLowerCase()}] ${url} 실패:`, err);
193704
+ throw err;
193705
+ });
193706
+ };
193707
+
193708
+ static get = (url, data = {}) => IdeFetch.#request("GET", url, data);
193709
+
193710
+ static post = (url, data = {}) => IdeFetch.#request("POST", url, data);
193711
+ }
193712
+
193713
+ const api = IdeFetch;
193714
+
193676
193715
  class IdeAssi extends HTMLElement
193677
193716
  {
193678
193717
  #ing = false;
193679
193718
  #ai;
193680
193719
 
193681
193720
  settings;
193721
+ config;
193682
193722
 
193683
193723
  constructor() {
193684
193724
  super();
@@ -193726,12 +193766,7 @@ class IdeAssi extends HTMLElement
193726
193766
  };
193727
193767
 
193728
193768
  #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);
193769
+ this.config = await api.post("/config/get");
193735
193770
  };
193736
193771
 
193737
193772
  #init = (info) => {
@@ -194003,46 +194038,6 @@ class ideAssiSettings extends HTMLElement
194003
194038
 
194004
194039
  customElements.define("ide-assi-settings", ideAssiSettings);
194005
194040
 
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
194041
  //import "./components/ideAssi.js";
194047
194042
 
194048
194043
 
@@ -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,52 @@ class IdeAi
193669
193669
  }
193670
193670
  }
193671
193671
 
193672
+ class IdeFetch {
193673
+
193674
+ static #request = (method, url, data = {}) => {
193675
+
193676
+ //console.log(method, url, data);
193677
+
193678
+ if (method === "GET") url += `?${new URLSearchParams(data)}`;
193679
+
193680
+ const options = {
193681
+ method,
193682
+ headers: { "Content-Type": "application/json" }
193683
+ };
193684
+
193685
+ if (method !== "GET") {
193686
+ options.body = JSON.stringify(data);
193687
+ }
193688
+
193689
+ return fetch(url, options)
193690
+ .then(res => {
193691
+ if (!res.ok) {
193692
+ return res.text().then(text => {
193693
+ throw new Error(`API 오류 (${res.status}): ${text}`);
193694
+ });
193695
+ }
193696
+ return res.json();
193697
+ })
193698
+ .catch(err => {
193699
+ console.error(`[fetch.${method.toLowerCase()}] ${url} 실패:`, err);
193700
+ throw err;
193701
+ });
193702
+ };
193703
+
193704
+ static get = (url, data = {}) => IdeFetch.#request("GET", url, data);
193705
+
193706
+ static post = (url, data = {}) => IdeFetch.#request("POST", url, data);
193707
+ }
193708
+
193709
+ const api = IdeFetch;
193710
+
193672
193711
  class IdeAssi extends HTMLElement
193673
193712
  {
193674
193713
  #ing = false;
193675
193714
  #ai;
193676
193715
 
193677
193716
  settings;
193717
+ config;
193678
193718
 
193679
193719
  constructor() {
193680
193720
  super();
@@ -193722,12 +193762,7 @@ class IdeAssi extends HTMLElement
193722
193762
  };
193723
193763
 
193724
193764
  #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);
193765
+ this.config = await api.post("/config/get");
193731
193766
  };
193732
193767
 
193733
193768
  #init = (info) => {
@@ -193999,46 +194034,6 @@ class ideAssiSettings extends HTMLElement
193999
194034
 
194000
194035
  customElements.define("ide-assi-settings", ideAssiSettings);
194001
194036
 
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
194037
  //import "./components/ideAssi.js";
194043
194038
 
194044
194039
 
@@ -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) => {
@@ -1,13 +1,10 @@
1
1
  export class IdeFetch {
2
- static baseUrl = "/api";
3
2
 
4
3
  static #request = (method, url, data = {}) => {
5
4
 
6
- console.log(method, url, data);
5
+ //console.log(method, url, data);
7
6
 
8
- const fullUrl = method === "GET"
9
- ? `${IdeFetch.baseUrl}/${url}?${new URLSearchParams(data)}`
10
- : `${IdeFetch.baseUrl}/${url}`;
7
+ if (method === "GET") url += `?${new URLSearchParams(data)}`;
11
8
 
12
9
  const options = {
13
10
  method,
@@ -18,7 +15,7 @@ export class IdeFetch {
18
15
  options.body = JSON.stringify(data);
19
16
  }
20
17
 
21
- return fetch(fullUrl, options)
18
+ return fetch(url, options)
22
19
  .then(res => {
23
20
  if (!res.ok) {
24
21
  return res.text().then(text => {
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.178.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) => {
@@ -1,13 +1,10 @@
1
1
  export class IdeFetch {
2
- static baseUrl = "/api";
3
2
 
4
3
  static #request = (method, url, data = {}) => {
5
4
 
6
- console.log(method, url, data);
5
+ //console.log(method, url, data);
7
6
 
8
- const fullUrl = method === "GET"
9
- ? `${IdeFetch.baseUrl}/${url}?${new URLSearchParams(data)}`
10
- : `${IdeFetch.baseUrl}/${url}`;
7
+ if (method === "GET") url += `?${new URLSearchParams(data)}`;
11
8
 
12
9
  const options = {
13
10
  method,
@@ -18,7 +15,7 @@ export class IdeFetch {
18
15
  options.body = JSON.stringify(data);
19
16
  }
20
17
 
21
- return fetch(fullUrl, options)
18
+ return fetch(url, options)
22
19
  .then(res => {
23
20
  if (!res.ok) {
24
21
  return res.text().then(text => {