feat: add support to audio and video API responses (#3044)
This commit is contained in:
16
packages/hoppscotch-common/src/helpers/lenses/audioLens.ts
Normal file
16
packages/hoppscotch-common/src/helpers/lenses/audioLens.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { defineAsyncComponent } from "vue"
|
||||
import { Lens } from "./lenses"
|
||||
|
||||
const audioLens: Lens = {
|
||||
lensName: "response.audio",
|
||||
isSupportedContentType: (contentType) =>
|
||||
/\baudio\/(?:wav|mpeg|mp4|aac|aacp|ogg|webm|x-caf|flac|mp3|)\b/i.test(
|
||||
contentType
|
||||
),
|
||||
renderer: "audiores",
|
||||
rendererImport: defineAsyncComponent(
|
||||
() => import("~/components/lenses/renderers/AudioLensRenderer.vue")
|
||||
),
|
||||
}
|
||||
|
||||
export default audioLens
|
||||
@@ -5,6 +5,8 @@ import imageLens from "./imageLens"
|
||||
import htmlLens from "./htmlLens"
|
||||
import xmlLens from "./xmlLens"
|
||||
import pdfLens from "./pdfLens"
|
||||
import audioLens from "./audioLens"
|
||||
import videoLens from "./videoLens"
|
||||
import { defineAsyncComponent } from "vue"
|
||||
|
||||
export type Lens = {
|
||||
@@ -20,6 +22,8 @@ export const lenses: Lens[] = [
|
||||
htmlLens,
|
||||
xmlLens,
|
||||
pdfLens,
|
||||
audioLens,
|
||||
videoLens,
|
||||
rawLens,
|
||||
]
|
||||
|
||||
|
||||
16
packages/hoppscotch-common/src/helpers/lenses/videoLens.ts
Normal file
16
packages/hoppscotch-common/src/helpers/lenses/videoLens.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { defineAsyncComponent } from "vue"
|
||||
import { Lens } from "./lenses"
|
||||
|
||||
const videoLens: Lens = {
|
||||
lensName: "response.video",
|
||||
isSupportedContentType: (contentType) =>
|
||||
/\bvideo\/(?:webm|x-m4v|quicktime|x-ms-wmv|x-flv|mpeg|x-msvideo|x-ms-asf|mp4|)\b/i.test(
|
||||
contentType
|
||||
),
|
||||
renderer: "videores",
|
||||
rendererImport: defineAsyncComponent(
|
||||
() => import("~/components/lenses/renderers/VideoLensRenderer.vue")
|
||||
),
|
||||
}
|
||||
|
||||
export default videoLens
|
||||
Reference in New Issue
Block a user