mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-28 03:00:29 -04:00
fix(agiloft): remove import type from .server module to fix client bundle build
Turbopack resolves .server.ts modules even for type-only imports, pulling dns/promises into client bundles. Define SecureFetchResponse locally instead.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { createLogger } from '@sim/logger'
|
||||
import type { SecureFetchResponse } from '@/lib/core/security/input-validation.server'
|
||||
import type {
|
||||
AgiloftAttachmentInfoParams,
|
||||
AgiloftBaseParams,
|
||||
@@ -14,6 +13,21 @@ import type {
|
||||
} from '@/tools/agiloft/types'
|
||||
import type { HttpMethod, ToolResponse } from '@/tools/types'
|
||||
|
||||
/**
|
||||
* Mirrors the shape of SecureFetchResponse from input-validation.server.ts.
|
||||
* Defined locally to avoid importing the .server module into client bundles
|
||||
* (it pulls in dns/promises which is Node-only).
|
||||
*/
|
||||
interface SecureFetchResponse {
|
||||
ok: boolean
|
||||
status: number
|
||||
statusText: string
|
||||
headers: { get(name: string): string | null }
|
||||
text: () => Promise<string>
|
||||
json: () => Promise<unknown>
|
||||
arrayBuffer: () => Promise<ArrayBuffer>
|
||||
}
|
||||
|
||||
const logger = createLogger('AgiloftAuth')
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user