Skip to content

Commit 4da81c8

Browse files
authored
chore(web): sync chat ops callers to v2 (#1681)
1 parent 14c6935 commit 4da81c8

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

tests/unit_test/test_web_typed_api_contract.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@ def test_phase1_fe_complete_identity_auth_admin_audit_adapter_boundary():
11621162
bot_client_api = (REPO_ROOT / "web/src/features/bot/client-api.ts").read_text()
11631163
assert "uploadChatDocument" in bot_client_api
11641164
assert "getChatDocument" in bot_client_api
1165-
assert "'/api/v1/chats/{chat_id}/documents'" in bot_client_api
1165+
assert "'/api/v2/chats/{chat_id}/documents'" in bot_client_api
11661166

11671167
# feature-visibility.ts — document residual swaps
11681168
# `RebuildIndexesRequestIndexTypesEnum` → `DOCUMENT_INDEX_TYPES`.

web/src/api-v2/schema.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@ export interface paths {
12881288
patch?: never;
12891289
trace?: never;
12901290
};
1291-
"/api/v1/chats/{chat_id}/feedback": {
1291+
"/api/v2/chats/{chat_id}/feedback": {
12921292
parameters: {
12931293
query?: never;
12941294
header?: never;
@@ -1305,7 +1305,7 @@ export interface paths {
13051305
patch?: never;
13061306
trace?: never;
13071307
};
1308-
"/api/v1/chats/{chat_id}/turns/{turn_id}/feedback": {
1308+
"/api/v2/chats/{chat_id}/turns/{turn_id}/feedback": {
13091309
parameters: {
13101310
query?: never;
13111311
header?: never;
@@ -1323,7 +1323,7 @@ export interface paths {
13231323
patch?: never;
13241324
trace?: never;
13251325
};
1326-
"/api/v1/chats/{chat_id}/search": {
1326+
"/api/v2/chats/{chat_id}/search": {
13271327
parameters: {
13281328
query?: never;
13291329
header?: never;
@@ -1343,7 +1343,7 @@ export interface paths {
13431343
patch?: never;
13441344
trace?: never;
13451345
};
1346-
"/api/v1/chats/{chat_id}/documents": {
1346+
"/api/v2/chats/{chat_id}/documents": {
13471347
parameters: {
13481348
query?: never;
13491349
header?: never;
@@ -1363,7 +1363,7 @@ export interface paths {
13631363
patch?: never;
13641364
trace?: never;
13651365
};
1366-
"/api/v1/chats/{chat_id}/documents/{document_id}": {
1366+
"/api/v2/chats/{chat_id}/documents/{document_id}": {
13671367
parameters: {
13681368
query?: never;
13691369
header?: never;

web/src/components/chat/chat-messages.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { ChatInput, ChatInputSubmitParams } from './chat-input';
2424
import { MessagePartsAi } from './message-parts-ai';
2525
import { MessagePartsUser } from './message-parts-user';
2626

27-
const API_BASE_PATH = `${process.env.NEXT_PUBLIC_BASE_PATH || ''}/api/v1`;
27+
const API_BASE_PATH = `${process.env.NEXT_PUBLIC_BASE_PATH || ''}/api/v2`;
2828
const AGENT_RUNTIME_BASE_PATH = `${process.env.NEXT_PUBLIC_BASE_PATH || ''}/api/v2/agent`;
2929
const ACTIVE_TURN_STORAGE_PREFIX = 'agent-runtime-v3:active-turn:';
3030

web/src/features/bot/client-api.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export async function generateBotChatTitle(
173173
}
174174

175175
// Chat document attachment (for chat-input.tsx). Thin typed wrap of
176-
// `/api/v1/chats/{chat_id}/documents` (POST multipart upload +
176+
// `/api/v2/chats/{chat_id}/documents` (POST multipart upload +
177177
// GET {document_id} status poll). Lives in bot feature because chats are
178178
// owned by the bot domain; no separate features/chat/* surface per
179179
// design-lock msg=5f0a370b decision 2d.
@@ -183,7 +183,7 @@ export async function uploadChatDocument(
183183
file: File,
184184
): Promise<Document> {
185185
const { data } = await browserApiClient.POST(
186-
'/api/v1/chats/{chat_id}/documents',
186+
'/api/v2/chats/{chat_id}/documents',
187187
{
188188
params: { path: { chat_id: chatId } },
189189
body: { file: file as unknown as string },
@@ -205,7 +205,7 @@ export async function getChatDocument(
205205
documentId: string,
206206
): Promise<Document> {
207207
const { data } = await browserApiClient.GET(
208-
'/api/v1/chats/{chat_id}/documents/{document_id}',
208+
'/api/v2/chats/{chat_id}/documents/{document_id}',
209209
{
210210
params: { path: { chat_id: chatId, document_id: documentId } },
211211
},

0 commit comments

Comments
 (0)