ide-assi 0.174.0 → 0.176.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.
@@ -193726,7 +193726,7 @@ class IdeAssi extends HTMLElement
193726
193726
  };
193727
193727
 
193728
193728
  #config = async () => {
193729
- const res = await fetch(`/api/config/basePackage`, {
193729
+ const res = await fetch(`/api/config/get`, {
193730
193730
  method: "POST",
193731
193731
  headers: {"Content-Type": "application/json"},
193732
193732
  });
@@ -194003,6 +194003,46 @@ class ideAssiSettings extends HTMLElement
194003
194003
 
194004
194004
  customElements.define("ide-assi-settings", ideAssiSettings);
194005
194005
 
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
+
194006
194046
  //import "./components/ideAssi.js";
194007
194047
 
194008
194048
 
@@ -194015,5 +194055,6 @@ function defineCustomElements() {
194015
194055
  }
194016
194056
 
194017
194057
  exports.IdeAssi = IdeAssi;
194058
+ exports.api = IdeFetch;
194018
194059
  exports.default = IdeAssi;
194019
194060
  exports.defineCustomElements = defineCustomElements;
@@ -193722,7 +193722,7 @@ class IdeAssi extends HTMLElement
193722
193722
  };
193723
193723
 
193724
193724
  #config = async () => {
193725
- const res = await fetch(`/api/config/basePackage`, {
193725
+ const res = await fetch(`/api/config/get`, {
193726
193726
  method: "POST",
193727
193727
  headers: {"Content-Type": "application/json"},
193728
193728
  });
@@ -193999,6 +193999,46 @@ class ideAssiSettings extends HTMLElement
193999
193999
 
194000
194000
  customElements.define("ide-assi-settings", ideAssiSettings);
194001
194001
 
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
+
194002
194042
  //import "./components/ideAssi.js";
194003
194043
 
194004
194044
 
@@ -194010,4 +194050,4 @@ function defineCustomElements() {
194010
194050
  }
194011
194051
  }
194012
194052
 
194013
- export { IdeAssi, IdeAssi as default, defineCustomElements };
194053
+ export { IdeAssi, IdeFetch as api, IdeAssi as default, defineCustomElements };
@@ -54,7 +54,7 @@ export class IdeAssi extends HTMLElement
54
54
  };
55
55
 
56
56
  #config = async () => {
57
- const res = await fetch(`/api/config/basePackage`, {
57
+ const res = await fetch(`/api/config/get`, {
58
58
  method: "POST",
59
59
  headers: {"Content-Type": "application/json"},
60
60
  });
@@ -0,0 +1,41 @@
1
+ export class IdeFetch {
2
+ static baseUrl = "/api";
3
+
4
+ static #request = (method, url, data = {}) => {
5
+
6
+ console.log(method, url, data);
7
+
8
+ const fullUrl = method === "GET"
9
+ ? `${IdeFetch.baseUrl}/${url}?${new URLSearchParams(data)}`
10
+ : `${IdeFetch.baseUrl}/${url}`;
11
+
12
+ const options = {
13
+ method,
14
+ headers: { "Content-Type": "application/json" }
15
+ };
16
+
17
+ if (method !== "GET") {
18
+ options.body = JSON.stringify(data);
19
+ }
20
+
21
+ return fetch(fullUrl, options)
22
+ .then(res => {
23
+ if (!res.ok) {
24
+ return res.text().then(text => {
25
+ throw new Error(`API 오류 (${res.status}): ${text}`);
26
+ });
27
+ }
28
+ return res.json();
29
+ })
30
+ .catch(err => {
31
+ console.error(`[fetch.${method.toLowerCase()}] ${url} 실패:`, err);
32
+ throw err;
33
+ });
34
+ };
35
+
36
+ static get = (url, data = {}) => IdeFetch.#request("GET", url, data);
37
+
38
+ static post = (url, data = {}) => IdeFetch.#request("POST", url, data);
39
+ }
40
+
41
+ export const api = IdeFetch;
package/dist/index.js CHANGED
@@ -2,8 +2,9 @@
2
2
 
3
3
  import { IdeAssi } from "./components/ideAssi.js";
4
4
  import "./components/ideAssiSettings.js";
5
+ import { IdeFetch } from "./components/ideFetch.js";
5
6
 
6
- export { IdeAssi }; // Named Export
7
+ export { IdeAssi, IdeFetch as api }; // Named Export
7
8
 
8
9
 
9
10
  // ✅ Custom Elements 등록 함수 정의
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.174.0",
4
+ "version": "0.176.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -54,7 +54,7 @@ export class IdeAssi extends HTMLElement
54
54
  };
55
55
 
56
56
  #config = async () => {
57
- const res = await fetch(`/api/config/basePackage`, {
57
+ const res = await fetch(`/api/config/get`, {
58
58
  method: "POST",
59
59
  headers: {"Content-Type": "application/json"},
60
60
  });
@@ -0,0 +1,41 @@
1
+ export class IdeFetch {
2
+ static baseUrl = "/api";
3
+
4
+ static #request = (method, url, data = {}) => {
5
+
6
+ console.log(method, url, data);
7
+
8
+ const fullUrl = method === "GET"
9
+ ? `${IdeFetch.baseUrl}/${url}?${new URLSearchParams(data)}`
10
+ : `${IdeFetch.baseUrl}/${url}`;
11
+
12
+ const options = {
13
+ method,
14
+ headers: { "Content-Type": "application/json" }
15
+ };
16
+
17
+ if (method !== "GET") {
18
+ options.body = JSON.stringify(data);
19
+ }
20
+
21
+ return fetch(fullUrl, options)
22
+ .then(res => {
23
+ if (!res.ok) {
24
+ return res.text().then(text => {
25
+ throw new Error(`API 오류 (${res.status}): ${text}`);
26
+ });
27
+ }
28
+ return res.json();
29
+ })
30
+ .catch(err => {
31
+ console.error(`[fetch.${method.toLowerCase()}] ${url} 실패:`, err);
32
+ throw err;
33
+ });
34
+ };
35
+
36
+ static get = (url, data = {}) => IdeFetch.#request("GET", url, data);
37
+
38
+ static post = (url, data = {}) => IdeFetch.#request("POST", url, data);
39
+ }
40
+
41
+ export const api = IdeFetch;
package/src/index.js CHANGED
@@ -2,8 +2,9 @@
2
2
 
3
3
  import { IdeAssi } from "./components/ideAssi.js";
4
4
  import "./components/ideAssiSettings.js";
5
+ import { IdeFetch } from "./components/ideFetch.js";
5
6
 
6
- export { IdeAssi }; // Named Export
7
+ export { IdeAssi, IdeFetch as api }; // Named Export
7
8
 
8
9
 
9
10
  // ✅ Custom Elements 등록 함수 정의