@lastbrain/ai-ui-core 1.0.15 → 1.0.16
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.
|
@@ -14,4 +14,9 @@ export declare function PUT(request: NextRequest, context: {
|
|
|
14
14
|
path: string[];
|
|
15
15
|
}>;
|
|
16
16
|
}): Promise<NextResponse<any>>;
|
|
17
|
+
export declare function DELETE(request: NextRequest, context: {
|
|
18
|
+
params: Promise<{
|
|
19
|
+
path: string[];
|
|
20
|
+
}>;
|
|
21
|
+
}): Promise<NextResponse<any>>;
|
|
17
22
|
//# sourceMappingURL=enhanced-gateway.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enhanced-gateway.d.ts","sourceRoot":"","sources":["../../../src/route-handlers/nextjs/enhanced-gateway.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"enhanced-gateway.d.ts","sourceRoot":"","sources":["../../../src/route-handlers/nextjs/enhanced-gateway.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA4JxD,wBAAsB,GAAG,CACvB,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE;IAAE,MAAM,EAAE,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAA;CAAE,8BAGjD;AAED,wBAAsB,IAAI,CACxB,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE;IAAE,MAAM,EAAE,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAA;CAAE,8BAGjD;AAED,wBAAsB,GAAG,CACvB,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE;IAAE,MAAM,EAAE,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAA;CAAE,8BAGjD;AAED,wBAAsB,MAAM,CAC1B,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE;IAAE,MAAM,EAAE,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAA;CAAE,8BAGjD"}
|
|
@@ -25,15 +25,23 @@ function mapAuthRouteToPublicRoute(path) {
|
|
|
25
25
|
// Prompts
|
|
26
26
|
"auth/prompts": "prompts",
|
|
27
27
|
"auth/prompts/stats": "prompts/stats",
|
|
28
|
-
// AI Models
|
|
28
|
+
// AI Models - Available
|
|
29
29
|
"auth/ai-models-available": "ai/models/available",
|
|
30
|
+
"ai-models-available": "ai/models/available",
|
|
31
|
+
// AI Models - User models
|
|
30
32
|
"auth/ai-models-user": "ai/user/models",
|
|
31
33
|
"auth/user-models": "ai/user/models",
|
|
34
|
+
"ai-models-user": "ai/user/models",
|
|
35
|
+
"user-models": "ai/user/models",
|
|
36
|
+
// AI Models - Toggle
|
|
32
37
|
"auth/ai-models-toggle": "ai/user/models/toggle",
|
|
38
|
+
"ai-models-toggle": "ai/user/models/toggle",
|
|
33
39
|
// Text generation
|
|
34
40
|
"auth/generate-text": "text-ai",
|
|
41
|
+
"generate-text": "text-ai",
|
|
35
42
|
// Image generation
|
|
36
43
|
"auth/generate-image": "image-ai",
|
|
44
|
+
"generate-image": "image-ai",
|
|
37
45
|
// Status and provider
|
|
38
46
|
status: "status",
|
|
39
47
|
provider: "provider",
|
|
@@ -73,7 +81,9 @@ async function handleRequest(request, context) {
|
|
|
73
81
|
"Content-Type": "application/json",
|
|
74
82
|
};
|
|
75
83
|
let body;
|
|
76
|
-
if (request.method === "POST" ||
|
|
84
|
+
if (request.method === "POST" ||
|
|
85
|
+
request.method === "PUT" ||
|
|
86
|
+
request.method === "DELETE") {
|
|
77
87
|
try {
|
|
78
88
|
const json = await request.json();
|
|
79
89
|
body = JSON.stringify(json);
|
|
@@ -109,3 +119,6 @@ export async function POST(request, context) {
|
|
|
109
119
|
export async function PUT(request, context) {
|
|
110
120
|
return handleRequest(request, context);
|
|
111
121
|
}
|
|
122
|
+
export async function DELETE(request, context) {
|
|
123
|
+
return handleRequest(request, context);
|
|
124
|
+
}
|
package/package.json
CHANGED
|
@@ -35,17 +35,27 @@ function mapAuthRouteToPublicRoute(path: string): string {
|
|
|
35
35
|
"auth/prompts": "prompts",
|
|
36
36
|
"auth/prompts/stats": "prompts/stats",
|
|
37
37
|
|
|
38
|
-
// AI Models
|
|
38
|
+
// AI Models - Available
|
|
39
39
|
"auth/ai-models-available": "ai/models/available",
|
|
40
|
+
"ai-models-available": "ai/models/available",
|
|
41
|
+
|
|
42
|
+
// AI Models - User models
|
|
40
43
|
"auth/ai-models-user": "ai/user/models",
|
|
41
44
|
"auth/user-models": "ai/user/models",
|
|
45
|
+
"ai-models-user": "ai/user/models",
|
|
46
|
+
"user-models": "ai/user/models",
|
|
47
|
+
|
|
48
|
+
// AI Models - Toggle
|
|
42
49
|
"auth/ai-models-toggle": "ai/user/models/toggle",
|
|
50
|
+
"ai-models-toggle": "ai/user/models/toggle",
|
|
43
51
|
|
|
44
52
|
// Text generation
|
|
45
53
|
"auth/generate-text": "text-ai",
|
|
54
|
+
"generate-text": "text-ai",
|
|
46
55
|
|
|
47
56
|
// Image generation
|
|
48
57
|
"auth/generate-image": "image-ai",
|
|
58
|
+
"generate-image": "image-ai",
|
|
49
59
|
|
|
50
60
|
// Status and provider
|
|
51
61
|
status: "status",
|
|
@@ -105,7 +115,11 @@ async function handleRequest(
|
|
|
105
115
|
};
|
|
106
116
|
|
|
107
117
|
let body: string | undefined;
|
|
108
|
-
if (
|
|
118
|
+
if (
|
|
119
|
+
request.method === "POST" ||
|
|
120
|
+
request.method === "PUT" ||
|
|
121
|
+
request.method === "DELETE"
|
|
122
|
+
) {
|
|
109
123
|
try {
|
|
110
124
|
const json = await request.json();
|
|
111
125
|
body = JSON.stringify(json);
|
|
@@ -160,3 +174,10 @@ export async function PUT(
|
|
|
160
174
|
) {
|
|
161
175
|
return handleRequest(request, context);
|
|
162
176
|
}
|
|
177
|
+
|
|
178
|
+
export async function DELETE(
|
|
179
|
+
request: NextRequest,
|
|
180
|
+
context: { params: Promise<{ path: string[] }> }
|
|
181
|
+
) {
|
|
182
|
+
return handleRequest(request, context);
|
|
183
|
+
}
|