Skip to content

Commit a342c2e

Browse files
committed
fix: build errors
1 parent e12d523 commit a342c2e

File tree

4 files changed

+27
-13
lines changed

4 files changed

+27
-13
lines changed

apps/sim/app/credential-account/[token]/page.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,10 @@ export default function CredentialAccountInvitePage() {
221221
label: 'Create an account',
222222
onClick: () =>
223223
router.push(`/signup?callbackUrl=${callbackUrl}&invite_flow=true&new=true`),
224-
variant: 'outline' as const,
225224
},
226225
{
227226
label: 'Return to Home',
228227
onClick: () => router.push('/'),
229-
variant: 'ghost' as const,
230228
},
231229
]}
232230
/>
@@ -260,7 +258,6 @@ export default function CredentialAccountInvitePage() {
260258
{
261259
label: 'Return to Home',
262260
onClick: () => router.push('/'),
263-
variant: 'ghost' as const,
264261
},
265262
]}
266263
/>

apps/sim/lib/api-key/auth.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,10 @@ describe('API key lifecycle', () => {
351351

352352
it('should reject key if storage is tampered', async () => {
353353
const key = generateApiKey()
354-
const tamperedStorage = `${key.slice(0, -1)}X` // Change last character
354+
const lastChar = key.slice(-1)
355+
// Ensure tampered character is different from original (handles edge case where key ends in 'X')
356+
const tamperedChar = lastChar === 'X' ? 'Y' : 'X'
357+
const tamperedStorage = `${key.slice(0, -1)}${tamperedChar}`
355358
const result = await authenticateApiKey(key, tamperedStorage)
356359
expectApiKeyInvalid(result)
357360
})

apps/sim/lib/workflows/operations/import-export.ts

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import { createLogger } from '@sim/logger'
22
import JSZip from 'jszip'
3-
import { sanitizeForExport } from '@/lib/workflows/sanitization/json-sanitizer'
3+
import {
4+
type ExportWorkflowState,
5+
sanitizeForExport,
6+
} from '@/lib/workflows/sanitization/json-sanitizer'
7+
import { regenerateWorkflowIds } from '@/stores/workflows/utils'
48
import type { Variable, WorkflowState } from '@/stores/workflows/workflow/types'
59

610
const logger = createLogger('WorkflowImportExport')
@@ -431,19 +435,27 @@ export function generateWorkflowJson(
431435
workflowState: WorkflowState,
432436
options: GenerateWorkflowJsonOptions
433437
): string {
434-
const stateWithMetadata = {
438+
const variablesRecord: Record<string, Variable> | undefined = options.variables?.reduce(
439+
(acc, v) => {
440+
acc[v.id] = {
441+
id: v.id,
442+
name: v.name,
443+
type: v.type,
444+
value: v.value,
445+
}
446+
return acc
447+
},
448+
{} as Record<string, Variable>
449+
)
450+
451+
const stateWithMetadata: WorkflowState = {
435452
...workflowState,
436453
metadata: {
437454
name: options.name,
438455
description: options.description,
439456
exportedAt: new Date().toISOString(),
440457
},
441-
variables: options.variables?.map((v) => ({
442-
id: v.id,
443-
name: v.name,
444-
type: v.type,
445-
value: v.value,
446-
})),
458+
variables: variablesRecord,
447459
}
448460

449461
const exportState: ExportWorkflowState = sanitizeForExport(stateWithMetadata)

apps/sim/providers/utils.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ import {
3434
updateOllamaProviderModels,
3535
} from '@/providers/utils'
3636

37-
const isHostedSpy = vi.spyOn(environmentModule, 'isHosted', 'get')
37+
const isHostedSpy = vi.spyOn(environmentModule, 'isHosted', 'get') as unknown as {
38+
mockReturnValue: (value: boolean) => void
39+
}
3840
const mockGetRotatingApiKey = vi.fn().mockReturnValue('rotating-server-key')
3941
const originalRequire = module.require
4042

0 commit comments

Comments
 (0)