Skip to content

Commit b7cb636

Browse files
author
waleed
committed
add relative imports instead of absolute ones
1 parent dffa5a3 commit b7cb636

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

apps/sim/app/api/files/upload/route.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ const ALLOWED_EXTENSIONS = new Set([
3030
'yml',
3131
])
3232

33-
/**
34-
* Validates file extension against allowlist
35-
*/
3633
function validateFileExtension(filename: string): boolean {
3734
const extension = filename.split('.').pop()?.toLowerCase()
3835
if (!extension) return false

apps/sim/lib/uploads/core/setup.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { mkdir } from 'fs/promises'
33
import path, { join } from 'path'
44
import { env } from '@/lib/env'
55
import { createLogger } from '@/lib/logs/console/logger'
6-
import { getStorageProvider, USE_BLOB_STORAGE, USE_S3_STORAGE } from '../config'
6+
import { getStorageProvider, USE_BLOB_STORAGE, USE_S3_STORAGE } from '@/lib/uploads/config'
77

88
const logger = createLogger('UploadsSetup')
99

apps/sim/lib/uploads/core/storage-client.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { createLogger } from '@/lib/logs/console/logger'
2+
import { USE_BLOB_STORAGE, USE_S3_STORAGE } from '@/lib/uploads/config'
23
import type { BlobConfig } from '@/lib/uploads/providers/blob/types'
34
import type { S3Config } from '@/lib/uploads/providers/s3/types'
4-
import { USE_BLOB_STORAGE, USE_S3_STORAGE } from '../config'
5-
import type { FileInfo, StorageConfig } from '../shared/types'
6-
import { sanitizeFileKey } from '../utils/file-utils'
5+
import type { FileInfo, StorageConfig } from '@/lib/uploads/shared/types'
6+
import { sanitizeFileKey } from '@/lib/uploads/utils/file-utils'
77

88
const logger = createLogger('StorageClient')
99

10-
export type { FileInfo, StorageConfig } from '../shared/types'
10+
export type { FileInfo, StorageConfig } from '@/lib/uploads/shared/types'
1111

1212
/**
1313
* Validate and resolve local file path ensuring it's within the allowed directory
@@ -283,7 +283,7 @@ export async function getFileMetadata(
283283

284284
if (USE_BLOB_STORAGE) {
285285
const { getBlobServiceClient } = await import('@/lib/uploads/providers/blob/client')
286-
const { BLOB_CONFIG } = await import('../config')
286+
const { BLOB_CONFIG } = await import('@/lib/uploads/config')
287287

288288
let blobServiceClient = await getBlobServiceClient()
289289
let containerName = BLOB_CONFIG.containerName
@@ -314,7 +314,7 @@ export async function getFileMetadata(
314314
if (USE_S3_STORAGE) {
315315
const { getS3Client } = await import('@/lib/uploads/providers/s3/client')
316316
const { HeadObjectCommand } = await import('@aws-sdk/client-s3')
317-
const { S3_CONFIG } = await import('../config')
317+
const { S3_CONFIG } = await import('@/lib/uploads/config')
318318

319319
const s3Client = getS3Client()
320320
const bucket = customConfig?.bucket || S3_CONFIG.bucket

apps/sim/lib/uploads/core/storage-service.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createLogger } from '@/lib/logs/console/logger'
2-
import { getStorageConfig, USE_BLOB_STORAGE, USE_S3_STORAGE } from '../config'
3-
import type { BlobConfig } from '../providers/blob/types'
4-
import type { S3Config } from '../providers/s3/types'
2+
import { getStorageConfig, USE_BLOB_STORAGE, USE_S3_STORAGE } from '@/lib/uploads/config'
3+
import type { BlobConfig } from '@/lib/uploads/providers/blob/types'
4+
import type { S3Config } from '@/lib/uploads/providers/s3/types'
55
import type {
66
DeleteFileOptions,
77
DownloadFileOptions,
@@ -11,12 +11,12 @@ import type {
1111
StorageConfig,
1212
StorageContext,
1313
UploadFileOptions,
14-
} from '../shared/types'
14+
} from '@/lib/uploads/shared/types'
1515
import {
1616
sanitizeFileKey,
1717
sanitizeFilenameForMetadata,
1818
sanitizeStorageMetadata,
19-
} from '../utils/file-utils'
19+
} from '@/lib/uploads/utils/file-utils'
2020

2121
const logger = createLogger('StorageService')
2222

0 commit comments

Comments
 (0)