refactor: inherit default curl parser values (#2169)

This commit is contained in:
kyteinsky
2022-04-04 21:38:12 +05:30
committed by GitHub
parent dcbc3b6356
commit eea8a44746
16 changed files with 1354 additions and 977 deletions

View File

@@ -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)