Skip to content

Commit c5ecc19

Browse files
committed
lint
1 parent dac7dda commit c5ecc19

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed

apps/sim/app/api/chat/[identifier]/otp/route.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ vi.mock('@/lib/core/security/deployment', () => ({
146146
const atIndex = email.indexOf('@')
147147
if (atIndex > 0) {
148148
const domain = email.substring(atIndex + 1)
149-
if (domain && allowedEmails.some((allowed: string) => allowed === `@${domain}`))
150-
return true
149+
if (domain && allowedEmails.some((allowed: string) => allowed === `@${domain}`)) return true
151150
}
152151
return false
153152
},

apps/sim/app/api/chat/[identifier]/otp/route.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function decodeOTPValue(value: string): { otp: string; attempts: number } {
3636
const lastColon = value.lastIndexOf(':')
3737
return {
3838
otp: value.slice(0, lastColon),
39-
attempts: parseInt(value.slice(lastColon + 1), 10),
39+
attempts: Number.parseInt(value.slice(lastColon + 1), 10),
4040
}
4141
}
4242

@@ -261,7 +261,9 @@ export async function PUT(
261261
const newAttempts = attempts + 1
262262
if (newAttempts >= MAX_OTP_ATTEMPTS) {
263263
await deleteOTP(email, deployment.id)
264-
logger.warn(`[${requestId}] OTP invalidated after ${newAttempts} failed attempts for ${email}`)
264+
logger.warn(
265+
`[${requestId}] OTP invalidated after ${newAttempts} failed attempts for ${email}`
266+
)
265267
return addCorsHeaders(
266268
createErrorResponse('Too many failed attempts. Please request a new code.', 429),
267269
request

apps/sim/app/api/chat/utils.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ import { authorizeWorkflowByWorkspacePermission } from '@/lib/workflows/utils'
1313

1414
const logger = createLogger('ChatAuthUtils')
1515

16-
export function setChatAuthCookie(
17-
response: NextResponse,
18-
chatId: string,
19-
type: string
20-
): void {
16+
export function setChatAuthCookie(response: NextResponse, chatId: string, type: string): void {
2117
setDeploymentAuthCookie(response, 'chat', chatId, type)
2218
}
2319

apps/sim/app/api/form/utils.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ import { authorizeWorkflowByWorkspacePermission } from '@/lib/workflows/utils'
1313

1414
const logger = createLogger('FormAuthUtils')
1515

16-
export function setFormAuthCookie(
17-
response: NextResponse,
18-
formId: string,
19-
type: string
20-
): void {
16+
export function setFormAuthCookie(response: NextResponse, formId: string, type: string): void {
2117
setDeploymentAuthCookie(response, 'form', formId, type)
2218
}
2319

apps/sim/app/api/tools/onepassword/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@ async function validateConnectServerUrl(serverUrl: string): Promise<void> {
255255
throw new Error('1Password server URL is not a valid URL')
256256
}
257257

258-
const clean = hostname.startsWith('[') && hostname.endsWith(']') ? hostname.slice(1, -1) : hostname
258+
const clean =
259+
hostname.startsWith('[') && hostname.endsWith(']') ? hostname.slice(1, -1) : hostname
259260

260261
if (ipaddr.isValid(clean)) {
261262
const addr = ipaddr.process(clean)

apps/sim/lib/mcp/domain-check.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ vi.mock('@/lib/core/security/input-validation.server', () => ({
1616
isPrivateOrReservedIP: (ip: string) => {
1717
if (ip.startsWith('10.') || ip.startsWith('192.168.')) return true
1818
if (ip.startsWith('172.')) {
19-
const second = parseInt(ip.split('.')[1], 10)
19+
const second = Number.parseInt(ip.split('.')[1], 10)
2020
if (second >= 16 && second <= 31) return true
2121
}
2222
if (ip.startsWith('169.254.')) return true
@@ -367,9 +367,9 @@ describe('validateMcpServerSsrf', () => {
367367
})
368368

369369
it('throws McpSsrfError for cloud metadata IP literal', async () => {
370-
await expect(
371-
validateMcpServerSsrf('http://169.254.169.254/latest/meta-data/')
372-
).rejects.toThrow(McpSsrfError)
370+
await expect(validateMcpServerSsrf('http://169.254.169.254/latest/meta-data/')).rejects.toThrow(
371+
McpSsrfError
372+
)
373373
expect(mockDnsLookup).not.toHaveBeenCalled()
374374
})
375375

apps/sim/tools/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,13 @@ async function executeToolRequest(
11641164
}
11651165

11661166
const headers = new Headers(requestParams.headers)
1167-
await addInternalAuthIfNeeded(headers, isInternalRoute, requestId, toolId, params._context?.userId)
1167+
await addInternalAuthIfNeeded(
1168+
headers,
1169+
isInternalRoute,
1170+
requestId,
1171+
toolId,
1172+
params._context?.userId
1173+
)
11681174

11691175
const shouldPropagateCallChain = isInternalRoute || isSelfOriginUrl(fullUrl)
11701176
if (shouldPropagateCallChain) {

0 commit comments

Comments
 (0)