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:
Waleed Latif
2026-04-17 12:51:14 -07:00
parent a05b4422ad
commit df416cc098

View File

@@ -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')
/**