@aizu-chat/react 0.0.8 → 0.0.10

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.
Files changed (146) hide show
  1. package/dist/{chunk-75Q3MZEF.mjs → chunk-2TI7IWH7.mjs} +21 -6
  2. package/dist/chunk-HDOMF6SD.mjs +1370 -0
  3. package/dist/chunk-TXBCCMO7.mjs +1186 -0
  4. package/dist/components.d.mts +13 -15
  5. package/dist/components.d.ts +13 -15
  6. package/dist/components.js +885 -336
  7. package/dist/components.mjs +3 -5
  8. package/dist/index.d.mts +1 -2
  9. package/dist/index.d.ts +1 -2
  10. package/dist/index.js +885 -380
  11. package/dist/index.mjs +2 -10
  12. package/dist/sdk.d.mts +1 -2
  13. package/dist/sdk.d.ts +1 -2
  14. package/dist/sdk.js +21 -6
  15. package/dist/sdk.mjs +1 -1
  16. package/package.json +1 -1
  17. package/dist/chunk-27KHUFCW.mjs +0 -826
  18. package/dist/chunk-2E7KQQED.mjs +0 -816
  19. package/dist/chunk-2PRXGXTN.mjs +0 -826
  20. package/dist/chunk-2UZJYWLD.mjs +0 -49
  21. package/dist/chunk-2ZNJT52V.mjs +0 -814
  22. package/dist/chunk-34B6VEJC.mjs +0 -677
  23. package/dist/chunk-35JN2QFA.mjs +0 -784
  24. package/dist/chunk-3FHGECHR.mjs +0 -829
  25. package/dist/chunk-3IU2OVAG.mjs +0 -780
  26. package/dist/chunk-3QKHSOJ4.mjs +0 -728
  27. package/dist/chunk-3XKU4RH2.mjs +0 -814
  28. package/dist/chunk-432NOVMD.mjs +0 -822
  29. package/dist/chunk-4FW2X356.mjs +0 -653
  30. package/dist/chunk-4KUZUKKS.mjs +0 -776
  31. package/dist/chunk-4UO5EJ54.mjs +0 -826
  32. package/dist/chunk-66DXSMQL.mjs +0 -826
  33. package/dist/chunk-6IIUDDOD.mjs +0 -775
  34. package/dist/chunk-6LVL2AO4.mjs +0 -660
  35. package/dist/chunk-6OMCLP7J.mjs +0 -727
  36. package/dist/chunk-6SYZLU5L.mjs +0 -782
  37. package/dist/chunk-6XLUHLNW.mjs +0 -826
  38. package/dist/chunk-6Z4U3TJM.mjs +0 -728
  39. package/dist/chunk-6ZNP2727.mjs +0 -686
  40. package/dist/chunk-A4YWLH3K.mjs +0 -751
  41. package/dist/chunk-AT5CG6CS.mjs +0 -53
  42. package/dist/chunk-B4CPQFKO.mjs +0 -826
  43. package/dist/chunk-BH52V6JW.mjs +0 -776
  44. package/dist/chunk-BYPRKP6J.mjs +0 -782
  45. package/dist/chunk-BZVP32PP.mjs +0 -826
  46. package/dist/chunk-C6T755JT.mjs +0 -780
  47. package/dist/chunk-CCFEXIKG.mjs +0 -815
  48. package/dist/chunk-CTYW4VK4.mjs +0 -815
  49. package/dist/chunk-D2UMLUGP.mjs +0 -685
  50. package/dist/chunk-D4DQP4GI.mjs +0 -817
  51. package/dist/chunk-DIBJNQPT.mjs +0 -782
  52. package/dist/chunk-DJQK65LJ.mjs +0 -822
  53. package/dist/chunk-DLQEX6QS.mjs +0 -661
  54. package/dist/chunk-EADN4TWS.mjs +0 -819
  55. package/dist/chunk-EAW7EHJI.mjs +0 -826
  56. package/dist/chunk-EBU5NLRJ.mjs +0 -661
  57. package/dist/chunk-EDBTUKCC.mjs +0 -738
  58. package/dist/chunk-EHQQJPCV.mjs +0 -53
  59. package/dist/chunk-EKELJTME.mjs +0 -674
  60. package/dist/chunk-ELAN3AIY.mjs +0 -784
  61. package/dist/chunk-EWW3DF5X.mjs +0 -814
  62. package/dist/chunk-EXJ5M326.mjs +0 -826
  63. package/dist/chunk-F3DEI4YK.mjs +0 -682
  64. package/dist/chunk-FBJJFSCR.mjs +0 -778
  65. package/dist/chunk-G7M72PUZ.mjs +0 -776
  66. package/dist/chunk-GFVIBK25.mjs +0 -673
  67. package/dist/chunk-GYZ6ICY2.mjs +0 -685
  68. package/dist/chunk-H733EISO.mjs +0 -826
  69. package/dist/chunk-H7C7VETZ.mjs +0 -776
  70. package/dist/chunk-HD2IHWNW.mjs +0 -776
  71. package/dist/chunk-HKAXD2CX.mjs +0 -776
  72. package/dist/chunk-HLRWI4YU.mjs +0 -778
  73. package/dist/chunk-HNPNRGTG.mjs +0 -686
  74. package/dist/chunk-HQYDHSWS.mjs +0 -678
  75. package/dist/chunk-HVPJAO66.mjs +0 -654
  76. package/dist/chunk-I36Q4NZE.mjs +0 -675
  77. package/dist/chunk-ICOCFEPA.mjs +0 -776
  78. package/dist/chunk-IMM7TFAT.mjs +0 -685
  79. package/dist/chunk-J5OEYYWK.mjs +0 -728
  80. package/dist/chunk-JDR62NUF.mjs +0 -729
  81. package/dist/chunk-JEOWW4D7.mjs +0 -49
  82. package/dist/chunk-JIAD2PHZ.mjs +0 -779
  83. package/dist/chunk-JMHZ4OMV.mjs +0 -814
  84. package/dist/chunk-JUYVQ5F6.mjs +0 -673
  85. package/dist/chunk-K2EPLJ4A.mjs +0 -728
  86. package/dist/chunk-K2WK46MB.mjs +0 -776
  87. package/dist/chunk-KM4P2EHL.mjs +0 -729
  88. package/dist/chunk-KR4PTVQ4.mjs +0 -779
  89. package/dist/chunk-KUHNPG4Q.mjs +0 -796
  90. package/dist/chunk-KXFNNAMR.mjs +0 -814
  91. package/dist/chunk-LEZIDZXE.mjs +0 -831
  92. package/dist/chunk-LMFIKGQM.mjs +0 -782
  93. package/dist/chunk-LT43AVHN.mjs +0 -780
  94. package/dist/chunk-MBHPFGVB.mjs +0 -782
  95. package/dist/chunk-MDMZAAPV.mjs +0 -685
  96. package/dist/chunk-MFFRGYEX.mjs +0 -728
  97. package/dist/chunk-O3U6ONKJ.mjs +0 -677
  98. package/dist/chunk-OEPSB4XZ.mjs +0 -686
  99. package/dist/chunk-OJ5M55LN.mjs +0 -660
  100. package/dist/chunk-OSHAWBTV.mjs +0 -800
  101. package/dist/chunk-OVDFBN6H.mjs +0 -800
  102. package/dist/chunk-OWFM4DXQ.mjs +0 -686
  103. package/dist/chunk-P4FEBZ5I.mjs +0 -829
  104. package/dist/chunk-QBXYSNTR.mjs +0 -675
  105. package/dist/chunk-QDS6QW7Y.mjs +0 -738
  106. package/dist/chunk-QN5L3XNN.mjs +0 -830
  107. package/dist/chunk-QOK4APM5.mjs +0 -728
  108. package/dist/chunk-QR37WSLB.mjs +0 -826
  109. package/dist/chunk-QS7TKK6W.mjs +0 -685
  110. package/dist/chunk-QTL5KRV3.mjs +0 -686
  111. package/dist/chunk-QV2LQKNI.mjs +0 -686
  112. package/dist/chunk-QV74GE66.mjs +0 -778
  113. package/dist/chunk-R3NQ7SPU.mjs +0 -780
  114. package/dist/chunk-R3Z7JF73.mjs +0 -673
  115. package/dist/chunk-S63OOCED.mjs +0 -781
  116. package/dist/chunk-SJJDDFKI.mjs +0 -830
  117. package/dist/chunk-SLS4OSOJ.mjs +0 -826
  118. package/dist/chunk-SRFLVMCW.mjs +0 -685
  119. package/dist/chunk-SUOZPZBK.mjs +0 -826
  120. package/dist/chunk-TBBN7SM4.mjs +0 -660
  121. package/dist/chunk-TLJKLZBR.mjs +0 -734
  122. package/dist/chunk-U4ODVQIJ.mjs +0 -728
  123. package/dist/chunk-UA2YL34U.mjs +0 -782
  124. package/dist/chunk-UOQWXJXH.mjs +0 -779
  125. package/dist/chunk-UYBDUWOL.mjs +0 -776
  126. package/dist/chunk-UZD3IED4.mjs +0 -676
  127. package/dist/chunk-V2YCL6RC.mjs +0 -798
  128. package/dist/chunk-V5ROKX6T.mjs +0 -779
  129. package/dist/chunk-VBZLGI7W.mjs +0 -819
  130. package/dist/chunk-VEAZMIG4.mjs +0 -830
  131. package/dist/chunk-VMG4TRFB.mjs +0 -750
  132. package/dist/chunk-VOLA2PFJ.mjs +0 -676
  133. package/dist/chunk-VTBZU2XN.mjs +0 -826
  134. package/dist/chunk-WC37DM4U.mjs +0 -816
  135. package/dist/chunk-WDLA4JJY.mjs +0 -778
  136. package/dist/chunk-WQ6BKSTC.mjs +0 -815
  137. package/dist/chunk-WXSNIINA.mjs +0 -778
  138. package/dist/chunk-WYBPKSFQ.mjs +0 -816
  139. package/dist/chunk-XFRN7OPZ.mjs +0 -686
  140. package/dist/chunk-XLRF64SW.mjs +0 -53
  141. package/dist/chunk-YLNMIJBD.mjs +0 -728
  142. package/dist/chunk-YUGESFKI.mjs +0 -819
  143. package/dist/chunk-YVDMWPWQ.mjs +0 -776
  144. package/dist/chunk-Z6L7TEVJ.mjs +0 -828
  145. package/dist/chunk-Z72DRRM6.mjs +0 -829
  146. package/dist/chunk-ZXF3RMZZ.mjs +0 -685
package/dist/index.mjs CHANGED
@@ -3,24 +3,16 @@ import {
3
3
  AizuChat,
4
4
  Button,
5
5
  Loading,
6
- QuickMenus,
7
- TestComponent
8
- } from "./chunk-SJJDDFKI.mjs";
6
+ QuickMenus
7
+ } from "./chunk-HDOMF6SD.mjs";
9
8
  import {
10
9
  useCustom
11
10
  } from "./chunk-KLPKNMIP.mjs";
12
- import {
13
- AizuClient,
14
- createAizuClient
15
- } from "./chunk-75Q3MZEF.mjs";
16
11
  import "./chunk-33CPD3DF.mjs";
17
12
  export {
18
13
  AizuChat,
19
- AizuClient,
20
14
  Button,
21
15
  Loading,
22
16
  QuickMenus,
23
- TestComponent,
24
- createAizuClient,
25
17
  useCustom
26
18
  };
package/dist/sdk.d.mts CHANGED
@@ -30,10 +30,9 @@ declare class AizuClient {
30
30
  private request;
31
31
  chat(params: ChatRequest): Promise<ChatResponse>;
32
32
  }
33
- declare const createAizuClient: ({ hostUrl, apiKey, options, }: {
33
+ declare const createAizuClient: ({ hostUrl, apiKey, }: {
34
34
  hostUrl: string;
35
35
  apiKey: string;
36
- options?: Partial<AizuClientConfig>;
37
36
  }) => AizuClient;
38
37
 
39
38
  export { AizuClient, type AizuClientConfig, type ChatRequest, type ChatResponse, type Product, createAizuClient };
package/dist/sdk.d.ts CHANGED
@@ -30,10 +30,9 @@ declare class AizuClient {
30
30
  private request;
31
31
  chat(params: ChatRequest): Promise<ChatResponse>;
32
32
  }
33
- declare const createAizuClient: ({ hostUrl, apiKey, options, }: {
33
+ declare const createAizuClient: ({ hostUrl, apiKey, }: {
34
34
  hostUrl: string;
35
35
  apiKey: string;
36
- options?: Partial<AizuClientConfig>;
37
36
  }) => AizuClient;
38
37
 
39
38
  export { AizuClient, type AizuClientConfig, type ChatRequest, type ChatResponse, type Product, createAizuClient };
package/dist/sdk.js CHANGED
@@ -78,8 +78,19 @@ module.exports = __toCommonJS(sdk_exports);
78
78
  // src/sdk/client.ts
79
79
  var AizuClient = class {
80
80
  constructor(config) {
81
- this.hostUrl = config.hostUrl;
82
- this.apiKey = config.apiKey;
81
+ const { hostUrl, apiKey } = config;
82
+ if (typeof hostUrl !== "string" || hostUrl.trim().length === 0) {
83
+ throw new Error(
84
+ "Invalid AizuClient configuration: 'hostUrl' must be a non-empty string."
85
+ );
86
+ }
87
+ if (typeof apiKey !== "string" || apiKey.trim().length === 0) {
88
+ throw new Error(
89
+ "Invalid AizuClient configuration: 'apiKey' must be a non-empty string."
90
+ );
91
+ }
92
+ this.hostUrl = hostUrl;
93
+ this.apiKey = apiKey;
83
94
  }
84
95
  request(_0) {
85
96
  return __async(this, arguments, function* (path, options = {}) {
@@ -93,13 +104,18 @@ var AizuClient = class {
93
104
  body: body ? JSON.stringify(body) : void 0
94
105
  }));
95
106
  if (!response.ok) {
96
- throw new Error(`API Error: ${response.statusText}`);
107
+ const errorBody = yield response.text().catch(() => "");
108
+ const errorMessage = `API Error: ${response.status} ${response.statusText}${errorBody ? ` - ${errorBody}` : ""}`;
109
+ throw new Error(errorMessage);
97
110
  }
98
111
  return yield response.json();
99
112
  });
100
113
  }
101
114
  chat(params) {
102
115
  return __async(this, null, function* () {
116
+ if (!params.query.trim()) {
117
+ throw new Error("Query is required");
118
+ }
103
119
  return this.request("/chat/query", {
104
120
  method: "POST",
105
121
  body: params
@@ -109,10 +125,9 @@ var AizuClient = class {
109
125
  };
110
126
  var createAizuClient = ({
111
127
  hostUrl,
112
- apiKey,
113
- options
128
+ apiKey
114
129
  }) => {
115
- return new AizuClient(__spreadValues({ hostUrl, apiKey }, options));
130
+ return new AizuClient({ hostUrl, apiKey });
116
131
  };
117
132
  // Annotate the CommonJS export names for ESM import in node:
118
133
  0 && (module.exports = {
package/dist/sdk.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  AizuClient,
4
4
  createAizuClient
5
- } from "./chunk-75Q3MZEF.mjs";
5
+ } from "./chunk-2TI7IWH7.mjs";
6
6
  import "./chunk-33CPD3DF.mjs";
7
7
  export {
8
8
  AizuClient,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aizu-chat/react",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "sideEffects": ["*.css", "dist/**/*.css"],
5
5
  "license": "MIT",
6
6
  "files": ["dist"],