ide-assi 0.21.0 → 0.23.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.
@@ -193325,19 +193325,23 @@ class IdeAi
193325
193325
  })
193326
193326
  });
193327
193327
 
193328
- console.log(response);
193328
+ const res = await response.json();
193329
193329
 
193330
- const response2 = await fetch(`${this.#API_URL}/ai/generateSource`, {
193331
- method: "POST",
193332
- headers: { "Content-Type": "application/json" },
193333
- body: JSON.stringify({
193334
- userPrompt: userPrompt,
193335
- menus: menus,
193336
- tables: tables.list,
193337
- })
193338
- });
193330
+ if (res.result == "1") {
193331
+ const response2 = await fetch(`${this.#API_URL}/ai/generateSource`, {
193332
+ method: "POST",
193333
+ headers: { "Content-Type": "application/json" },
193334
+ body: JSON.stringify({
193335
+ userPrompt: userPrompt,
193336
+ menus: menus,
193337
+ tables: tables.list,
193338
+ })
193339
+ });
193340
+
193341
+ return await response2.json();
193342
+ }
193339
193343
 
193340
- return await response2.json();
193344
+ return null;
193341
193345
  };
193342
193346
  }
193343
193347
 
@@ -193321,19 +193321,23 @@ class IdeAi
193321
193321
  })
193322
193322
  });
193323
193323
 
193324
- console.log(response);
193324
+ const res = await response.json();
193325
193325
 
193326
- const response2 = await fetch(`${this.#API_URL}/ai/generateSource`, {
193327
- method: "POST",
193328
- headers: { "Content-Type": "application/json" },
193329
- body: JSON.stringify({
193330
- userPrompt: userPrompt,
193331
- menus: menus,
193332
- tables: tables.list,
193333
- })
193334
- });
193326
+ if (res.result == "1") {
193327
+ const response2 = await fetch(`${this.#API_URL}/ai/generateSource`, {
193328
+ method: "POST",
193329
+ headers: { "Content-Type": "application/json" },
193330
+ body: JSON.stringify({
193331
+ userPrompt: userPrompt,
193332
+ menus: menus,
193333
+ tables: tables.list,
193334
+ })
193335
+ });
193336
+
193337
+ return await response2.json();
193338
+ }
193335
193339
 
193336
- return await response2.json();
193340
+ return null;
193337
193341
  };
193338
193342
  }
193339
193343
 
@@ -68,19 +68,23 @@ export class IdeAi
68
68
  })
69
69
  });
70
70
 
71
- console.log(response);
72
-
73
- const response2 = await fetch(`${this.#API_URL}/ai/generateSource`, {
74
- method: "POST",
75
- headers: { "Content-Type": "application/json" },
76
- body: JSON.stringify({
77
- userPrompt: userPrompt,
78
- menus: menus,
79
- tables: tables.list,
80
- })
81
- });
82
-
83
- return await response2.json();
71
+ const res = await response.json();
72
+
73
+ if (res.result == "1") {
74
+ const response2 = await fetch(`${this.#API_URL}/ai/generateSource`, {
75
+ method: "POST",
76
+ headers: { "Content-Type": "application/json" },
77
+ body: JSON.stringify({
78
+ userPrompt: userPrompt,
79
+ menus: menus,
80
+ tables: tables.list,
81
+ })
82
+ });
83
+
84
+ return await response2.json();
85
+ }
86
+
87
+ return null;
84
88
  };
85
89
  }
86
90
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.21.0",
4
+ "version": "0.23.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -68,19 +68,23 @@ export class IdeAi
68
68
  })
69
69
  });
70
70
 
71
- console.log(response);
72
-
73
- const response2 = await fetch(`${this.#API_URL}/ai/generateSource`, {
74
- method: "POST",
75
- headers: { "Content-Type": "application/json" },
76
- body: JSON.stringify({
77
- userPrompt: userPrompt,
78
- menus: menus,
79
- tables: tables.list,
80
- })
81
- });
82
-
83
- return await response2.json();
71
+ const res = await response.json();
72
+
73
+ if (res.result == "1") {
74
+ const response2 = await fetch(`${this.#API_URL}/ai/generateSource`, {
75
+ method: "POST",
76
+ headers: { "Content-Type": "application/json" },
77
+ body: JSON.stringify({
78
+ userPrompt: userPrompt,
79
+ menus: menus,
80
+ tables: tables.list,
81
+ })
82
+ });
83
+
84
+ return await response2.json();
85
+ }
86
+
87
+ return null;
84
88
  };
85
89
  }
86
90