refactor: inherit default curl parser values (#2169)
This commit is contained in:
@@ -1,31 +1,5 @@
|
||||
import {
|
||||
HoppRESTReqBody,
|
||||
HoppRESTHeader,
|
||||
HoppRESTParam,
|
||||
HoppRESTAuth,
|
||||
} from "@hoppscotch/data"
|
||||
import { flow } from "fp-ts/function"
|
||||
import cloneDeep from "lodash/cloneDeep"
|
||||
import { parseCurlCommand, requestToHoppRequest } from "./curlparser"
|
||||
import { parseCurlCommand } from "./curlparser"
|
||||
|
||||
export type CurlParserRequest = {
|
||||
urlString: string
|
||||
urlObject: URL | undefined
|
||||
compressed: boolean
|
||||
queries: HoppRESTParam[]
|
||||
hoppHeaders: HoppRESTHeader[]
|
||||
method: string
|
||||
contentType: HoppRESTReqBody["contentType"]
|
||||
body: HoppRESTReqBody["body"]
|
||||
cookies: Record<string, string> | undefined
|
||||
cookieString: string
|
||||
multipartUploads: Record<string, string>
|
||||
isDataBinary: boolean
|
||||
auth: HoppRESTAuth
|
||||
}
|
||||
|
||||
export const parseCurlToHoppRESTReq = flow(
|
||||
parseCurlCommand,
|
||||
requestToHoppRequest,
|
||||
cloneDeep
|
||||
)
|
||||
export const parseCurlToHoppRESTReq = flow(parseCurlCommand, cloneDeep)
|
||||
|
||||
Reference in New Issue
Block a user