Skip to content

Commit 2b307ae

Browse files
committed
move postAgentRunsSteps into app/
1 parent a27a50e commit 2b307ae

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

web/src/api/v1/agent-runs/[runId]/__tests__/steps.test.ts renamed to web/src/app/api/v1/agent-runs/[runId]/steps/__tests__/steps.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { TEST_USER_ID } from '@codebuff/common/old-constants'
22
import { beforeEach, describe, expect, test } from 'bun:test'
33
import { NextRequest } from 'next/server'
44

5-
import { agentRunsStepsPost } from '../steps'
5+
import { postAgentRunsSteps } from '../_post'
66

77
import type { TrackEventFn } from '@codebuff/common/types/contracts/analytics'
88
import type { GetUserInfoFromApiKeyFn } from '@codebuff/common/types/contracts/database'
@@ -68,7 +68,7 @@ describe('agentRunsStepsPost', () => {
6868
},
6969
)
7070

71-
const response = await agentRunsStepsPost({
71+
const response = await postAgentRunsSteps({
7272
req,
7373
runId: 'run-123',
7474
getUserInfoFromApiKey: mockGetUserInfoFromApiKey,
@@ -92,7 +92,7 @@ describe('agentRunsStepsPost', () => {
9292
},
9393
)
9494

95-
const response = await agentRunsStepsPost({
95+
const response = await postAgentRunsSteps({
9696
req,
9797
runId: 'run-123',
9898
getUserInfoFromApiKey: mockGetUserInfoFromApiKey,
@@ -116,7 +116,7 @@ describe('agentRunsStepsPost', () => {
116116
},
117117
)
118118

119-
const response = await agentRunsStepsPost({
119+
const response = await postAgentRunsSteps({
120120
req,
121121
runId: 'run-123',
122122
getUserInfoFromApiKey: mockGetUserInfoFromApiKey,
@@ -140,7 +140,7 @@ describe('agentRunsStepsPost', () => {
140140
},
141141
)
142142

143-
const response = await agentRunsStepsPost({
143+
const response = await postAgentRunsSteps({
144144
req,
145145
runId: 'run-123',
146146
getUserInfoFromApiKey: mockGetUserInfoFromApiKey,
@@ -175,7 +175,7 @@ describe('agentRunsStepsPost', () => {
175175
},
176176
)
177177

178-
const response = await agentRunsStepsPost({
178+
const response = await postAgentRunsSteps({
179179
req,
180180
runId: 'run-123',
181181
getUserInfoFromApiKey: mockGetUserInfoFromApiKey,
@@ -210,7 +210,7 @@ describe('agentRunsStepsPost', () => {
210210
},
211211
)
212212

213-
const response = await agentRunsStepsPost({
213+
const response = await postAgentRunsSteps({
214214
req,
215215
runId: 'run-123',
216216
getUserInfoFromApiKey: mockGetUserInfoFromApiKey,
@@ -234,7 +234,7 @@ describe('agentRunsStepsPost', () => {
234234
},
235235
)
236236

237-
const response = await agentRunsStepsPost({
237+
const response = await postAgentRunsSteps({
238238
req,
239239
runId: 'run-123',
240240
getUserInfoFromApiKey: mockGetUserInfoFromApiKey,
@@ -264,7 +264,7 @@ describe('agentRunsStepsPost', () => {
264264
},
265265
)
266266

267-
const response = await agentRunsStepsPost({
267+
const response = await postAgentRunsSteps({
268268
req,
269269
runId: 'run-123',
270270
getUserInfoFromApiKey: mockGetUserInfoFromApiKey,
@@ -305,7 +305,7 @@ describe('agentRunsStepsPost', () => {
305305
},
306306
)
307307

308-
const response = await agentRunsStepsPost({
308+
const response = await postAgentRunsSteps({
309309
req,
310310
runId: 'run-123',
311311
getUserInfoFromApiKey: mockGetUserInfoFromApiKey,

web/src/api/v1/agent-runs/[runId]/steps.ts renamed to web/src/app/api/v1/agent-runs/[runId]/steps/_post.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const addAgentStepSchema = z.object({
2424
startTime: z.string().datetime().optional(),
2525
})
2626

27-
export async function agentRunsStepsPost(params: {
27+
export async function postAgentRunsSteps(params: {
2828
req: NextRequest
2929
runId: string
3030
getUserInfoFromApiKey: GetUserInfoFromApiKeyFn

web/src/app/api/v1/agent-runs/[runId]/steps/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { trackEvent } from '@codebuff/common/analytics'
22
import db from '@codebuff/internal/db'
33

4+
import { postAgentRunsSteps } from './_post'
5+
46
import type { NextRequest } from 'next/server'
57

6-
import { agentRunsStepsPost } from '@/api/v1/agent-runs/[runId]/steps'
78
import { getUserInfoFromApiKey } from '@/db/user'
89
import { logger } from '@/util/logger'
910

@@ -12,7 +13,7 @@ export async function POST(
1213
{ params }: { params: { runId: string } },
1314
) {
1415
const { runId } = params
15-
return agentRunsStepsPost({
16+
return postAgentRunsSteps({
1617
req,
1718
runId,
1819
getUserInfoFromApiKey,

0 commit comments

Comments
 (0)