@lastbrain/ai-ui-react 1.0.45 → 1.0.46

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.
@@ -52,7 +52,7 @@ export function usePrompts() {
52
52
  let endpoint;
53
53
  if (options?.public) {
54
54
  endpoint = isExternalProxy
55
- ? `${baseUrl}/ai/public/prompts?${params}`
55
+ ? `${baseUrl}/public/prompts?${params}`
56
56
  : isPublicApi
57
57
  ? `${baseUrl}/prompts?${params}`
58
58
  : baseUrl
@@ -61,7 +61,7 @@ export function usePrompts() {
61
61
  }
62
62
  else {
63
63
  endpoint = isExternalProxy
64
- ? `${baseUrl}/ai/auth/prompts?${params}`
64
+ ? `${baseUrl}/auth/prompts?${params}`
65
65
  : isPublicApi
66
66
  ? `${baseUrl}/prompts?${params}`
67
67
  : baseUrl
@@ -107,7 +107,7 @@ export function usePrompts() {
107
107
  setError(null);
108
108
  const isExternalProxy = baseUrl && baseUrl.includes("/api/lastbrain");
109
109
  const endpoint = isExternalProxy
110
- ? `${baseUrl}/prompts` // Proxy handles auth routes
110
+ ? `${baseUrl}/auth/prompts` // Proxy ajoutera /api/ai/
111
111
  : "/api/ai/auth/prompts";
112
112
  const headers = { "Content-Type": "application/json" };
113
113
  if (!isExternalProxy && apiKeyId) {
@@ -141,7 +141,7 @@ export function usePrompts() {
141
141
  const isExternalProxy = baseUrl && baseUrl.includes("/api/lastbrain");
142
142
  const isPublicApi = baseUrl && baseUrl.includes("/api/public/v1");
143
143
  const endpoint = isExternalProxy
144
- ? `${baseUrl}/ai/auth/prompts`
144
+ ? `${baseUrl}/auth/prompts`
145
145
  : isPublicApi
146
146
  ? `${baseUrl}/prompts`
147
147
  : baseUrl
@@ -179,7 +179,7 @@ export function usePrompts() {
179
179
  const isExternalProxy = baseUrl && baseUrl.includes("/api/lastbrain");
180
180
  const isPublicApi = baseUrl && baseUrl.includes("/api/public/v1");
181
181
  const endpoint = isExternalProxy
182
- ? `${baseUrl}/prompts?id=${id}` // Proxy handles auth routes
182
+ ? `${baseUrl}/auth/prompts?id=${id}` // Proxy ajoutera /api/ai/
183
183
  : isPublicApi
184
184
  ? `${baseUrl}/prompts?id=${id}`
185
185
  : baseUrl
@@ -215,7 +215,7 @@ export function usePrompts() {
215
215
  const isExternalProxy = baseUrl && baseUrl.includes("/api/lastbrain");
216
216
  const isPublicApi = baseUrl && baseUrl.includes("/api/public/v1");
217
217
  const endpoint = isExternalProxy
218
- ? `${baseUrl}/prompts/stats` // Proxy handles auth routes internally
218
+ ? `${baseUrl}/auth/prompts/stats` // Proxy ajoutera /api/ai/
219
219
  : isPublicApi
220
220
  ? `${baseUrl}/prompts/stats`
221
221
  : baseUrl
@@ -19,7 +19,7 @@ export async function toggleUserModel(modelId, isActive, options = {}) {
19
19
  const endpoint = isPublicApi
20
20
  ? `${baseUrl}/ai/user/models/toggle`
21
21
  : isExternalProxy
22
- ? `${baseUrl}/ai/user/models/toggle` // Gateway mappe automatiquement
22
+ ? `${baseUrl}/auth/ai-models-toggle` // Proxy ajoutera /api/ai/
23
23
  : baseUrl
24
24
  ? `${baseUrl}/auth/ai-models-toggle`
25
25
  : `/api/ai/auth/ai-models-toggle`;
@@ -77,7 +77,7 @@ export async function getUserModels(options = {}) {
77
77
  const isExternalProxy = baseUrl && baseUrl.includes("/api/lastbrain");
78
78
  const isPublicApi = baseUrl && baseUrl.includes("/api/public/v1");
79
79
  const endpoint = isExternalProxy
80
- ? `${baseUrl}/ai/user/models` // Proxy routes to public API
80
+ ? `${baseUrl}/auth/user-models` // Proxy ajoutera /api/ai/
81
81
  : isPublicApi
82
82
  ? `${baseUrl}/ai/user/models` // → /api/public/v1/ai/user/models
83
83
  : baseUrl
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lastbrain/ai-ui-react",
3
- "version": "1.0.45",
3
+ "version": "1.0.46",
4
4
  "description": "Headless React components for LastBrain AI UI Kit",
5
5
  "private": false,
6
6
  "type": "module",
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "lucide-react": "^0.257.0",
51
- "@lastbrain/ai-ui-core": "1.0.33"
51
+ "@lastbrain/ai-ui-core": "1.0.36"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/react": "^19.2.0",
@@ -113,7 +113,7 @@ export function usePrompts(): UsePromptsReturn {
113
113
  let endpoint: string;
114
114
  if (options?.public) {
115
115
  endpoint = isExternalProxy
116
- ? `${baseUrl}/ai/public/prompts?${params}`
116
+ ? `${baseUrl}/public/prompts?${params}`
117
117
  : isPublicApi
118
118
  ? `${baseUrl}/prompts?${params}`
119
119
  : baseUrl
@@ -121,7 +121,7 @@ export function usePrompts(): UsePromptsReturn {
121
121
  : `/api/ai/public/prompts?${params}`;
122
122
  } else {
123
123
  endpoint = isExternalProxy
124
- ? `${baseUrl}/ai/auth/prompts?${params}`
124
+ ? `${baseUrl}/auth/prompts?${params}`
125
125
  : isPublicApi
126
126
  ? `${baseUrl}/prompts?${params}`
127
127
  : baseUrl
@@ -175,7 +175,7 @@ export function usePrompts(): UsePromptsReturn {
175
175
 
176
176
  const isExternalProxy = baseUrl && baseUrl.includes("/api/lastbrain");
177
177
  const endpoint = isExternalProxy
178
- ? `${baseUrl}/prompts` // Proxy handles auth routes
178
+ ? `${baseUrl}/auth/prompts` // Proxy ajoutera /api/ai/
179
179
  : "/api/ai/auth/prompts";
180
180
 
181
181
  const headers: HeadersInit = { "Content-Type": "application/json" };
@@ -217,7 +217,7 @@ export function usePrompts(): UsePromptsReturn {
217
217
  const isPublicApi = baseUrl && baseUrl.includes("/api/public/v1");
218
218
 
219
219
  const endpoint = isExternalProxy
220
- ? `${baseUrl}/ai/auth/prompts`
220
+ ? `${baseUrl}/auth/prompts`
221
221
  : isPublicApi
222
222
  ? `${baseUrl}/prompts`
223
223
  : baseUrl
@@ -263,7 +263,7 @@ export function usePrompts(): UsePromptsReturn {
263
263
  const isPublicApi = baseUrl && baseUrl.includes("/api/public/v1");
264
264
 
265
265
  const endpoint = isExternalProxy
266
- ? `${baseUrl}/prompts?id=${id}` // Proxy handles auth routes
266
+ ? `${baseUrl}/auth/prompts?id=${id}` // Proxy ajoutera /api/ai/
267
267
  : isPublicApi
268
268
  ? `${baseUrl}/prompts?id=${id}`
269
269
  : baseUrl
@@ -306,7 +306,7 @@ export function usePrompts(): UsePromptsReturn {
306
306
  const isPublicApi = baseUrl && baseUrl.includes("/api/public/v1");
307
307
 
308
308
  const endpoint = isExternalProxy
309
- ? `${baseUrl}/prompts/stats` // Proxy handles auth routes internally
309
+ ? `${baseUrl}/auth/prompts/stats` // Proxy ajoutera /api/ai/
310
310
  : isPublicApi
311
311
  ? `${baseUrl}/prompts/stats`
312
312
  : baseUrl
@@ -33,7 +33,7 @@ export async function toggleUserModel(
33
33
  const endpoint = isPublicApi
34
34
  ? `${baseUrl}/ai/user/models/toggle`
35
35
  : isExternalProxy
36
- ? `${baseUrl}/ai/user/models/toggle` // Gateway mappe automatiquement
36
+ ? `${baseUrl}/auth/ai-models-toggle` // Proxy ajoutera /api/ai/
37
37
  : baseUrl
38
38
  ? `${baseUrl}/auth/ai-models-toggle`
39
39
  : `/api/ai/auth/ai-models-toggle`;
@@ -129,7 +129,7 @@ export async function getUserModels(
129
129
  const isPublicApi = baseUrl && baseUrl.includes("/api/public/v1");
130
130
 
131
131
  const endpoint = isExternalProxy
132
- ? `${baseUrl}/ai/user/models` // Proxy routes to public API
132
+ ? `${baseUrl}/auth/user-models` // Proxy ajoutera /api/ai/
133
133
  : isPublicApi
134
134
  ? `${baseUrl}/ai/user/models` // → /api/public/v1/ai/user/models
135
135
  : baseUrl