refactor(imports): added aliased imports everywhere (#799)

* refactor(imports): added aliased imports everywhere

* more aliased imports

* add barrel exports

* add more barrel exports

* cleanup

---------

Co-authored-by: waleedlatif <waleedlatif@waleedlatifs-MacBook-Pro.local>
This commit is contained in:
Waleed Latif
2025-07-26 16:10:32 -07:00
committed by GitHub
parent 93f68a9092
commit 0414aa5f6d
378 changed files with 2046 additions and 1425 deletions

View File

@@ -65,7 +65,7 @@ describe('Function Execute API Route', () => {
timeout: 5000,
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
const data = await response.json()
@@ -80,7 +80,7 @@ describe('Function Execute API Route', () => {
timeout: 5000,
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
const data = await response.json()
@@ -94,7 +94,7 @@ describe('Function Execute API Route', () => {
code: 'return "test"',
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
expect(response.status).toBe(200)
@@ -116,7 +116,7 @@ describe('Function Execute API Route', () => {
},
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
expect(response.status).toBe(200)
@@ -131,7 +131,7 @@ describe('Function Execute API Route', () => {
},
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
expect(response.status).toBe(200)
@@ -149,7 +149,7 @@ describe('Function Execute API Route', () => {
},
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
expect(response.status).toBe(200)
@@ -165,7 +165,7 @@ describe('Function Execute API Route', () => {
},
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
expect(response.status).toBe(200)
@@ -199,7 +199,7 @@ describe('Function Execute API Route', () => {
params: gmailData,
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
expect(response.status).toBe(200)
@@ -221,7 +221,7 @@ describe('Function Execute API Route', () => {
params: complexEmailData,
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
expect(response.status).toBe(200)
@@ -234,7 +234,7 @@ describe('Function Execute API Route', () => {
code: 'return "freestyle test"',
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
await POST(req)
expect(mockFreestyleExecuteScript).toHaveBeenCalled()
@@ -250,7 +250,7 @@ describe('Function Execute API Route', () => {
code: 'return "fallback test"',
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
expect(mockFreestyleExecuteScript).toHaveBeenCalled()
@@ -271,7 +271,7 @@ describe('Function Execute API Route', () => {
code: 'return undefinedVariable',
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
expect(response.status).toBe(500)
@@ -293,7 +293,7 @@ describe('Function Execute API Route', () => {
code: 'return "vm test"',
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
await POST(req)
expect(mockFreestyleExecuteScript).not.toHaveBeenCalled()
@@ -319,7 +319,7 @@ describe('Function Execute API Route', () => {
code: 'return invalidCode(',
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
expect(response.status).toBe(500)
@@ -339,7 +339,7 @@ describe('Function Execute API Route', () => {
isCustomTool: true,
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
expect(response.status).toBe(200)
@@ -355,7 +355,7 @@ describe('Function Execute API Route', () => {
headers: { 'Content-Type': 'application/json' },
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
expect(response.status).toBe(500)
@@ -367,7 +367,7 @@ describe('Function Execute API Route', () => {
timeout: 10000,
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
await POST(req)
expect(mockLogger.info).toHaveBeenCalledWith(
@@ -384,7 +384,7 @@ describe('Function Execute API Route', () => {
params: {},
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
expect(response.status).toBe(200)
@@ -417,7 +417,7 @@ SyntaxError: Invalid or unexpected token
timeout: 5000,
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
const data = await response.json()
@@ -460,7 +460,7 @@ SyntaxError: Invalid or unexpected token
timeout: 5000,
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
const data = await response.json()
@@ -501,7 +501,7 @@ SyntaxError: Invalid or unexpected token
timeout: 5000,
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
const data = await response.json()
@@ -531,7 +531,7 @@ SyntaxError: Invalid or unexpected token
timeout: 5000,
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
const data = await response.json()
@@ -567,7 +567,7 @@ SyntaxError: Invalid or unexpected token
timeout: 5000,
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
const data = await response.json()
@@ -598,7 +598,7 @@ SyntaxError: Invalid or unexpected token
timeout: 5000,
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
const data = await response.json()
@@ -620,7 +620,7 @@ SyntaxError: Invalid or unexpected token
},
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
expect(response.status).toBe(200)
@@ -644,7 +644,7 @@ SyntaxError: Invalid or unexpected token
},
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
expect(response.status).toBe(200)
@@ -705,7 +705,7 @@ describe('Function Execute API - Template Variable Edge Cases', () => {
},
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
const data = await response.json()
@@ -730,7 +730,7 @@ describe('Function Execute API - Template Variable Edge Cases', () => {
},
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
const data = await response.json()
@@ -752,7 +752,7 @@ describe('Function Execute API - Template Variable Edge Cases', () => {
params: {},
})
const { POST } = await import('./route')
const { POST } = await import('@/app/api/function/execute/route')
const response = await POST(req)
const data = await response.json()