fix: parsing of protocol correctly (#2088)
Co-authored-by: Liyas Thomas <hi@liyasthomas.com> Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com> Co-authored-by: liyasthomas <liyascthomas@gmail.com> Co-authored-by: Rishabh Agarwal <45998880+RishabhAgarwal-2001@users.noreply.github.com>
This commit is contained in:
29
packages/hoppscotch-app/helpers/curl/index.ts
Normal file
29
packages/hoppscotch-app/helpers/curl/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import {
|
||||
HoppRESTReqBody,
|
||||
HoppRESTHeader,
|
||||
HoppRESTParam,
|
||||
HoppRESTAuth,
|
||||
} from "@hoppscotch/data"
|
||||
import { flow } from "fp-ts/function"
|
||||
import { parseCurlCommand, requestToHoppRequest } 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
|
||||
)
|
||||
Reference in New Issue
Block a user