@scalar/api-client
Version:
the open source API testing client
130 lines (129 loc) • 4.39 kB
JavaScript
import { defineComponent as m, createElementBlock as p, openBlock as h, createElementVNode as y, createVNode as o, withCtx as s, unref as n } from "vue";
import v from "../../../components/ViewLayout/ViewLayout.vue.js";
import f from "../../../components/ViewLayout/ViewLayoutContent.vue.js";
import { createStoreEvents as c } from "../../../store/events.js";
import B from "./components/Header.vue.js";
import g from "../request-block/RequestBlock.vue.js";
import S from "../response-block/ResponseBlock.vue.js";
const q = { class: "bg-b-1 flex h-full flex-col" }, b = { class: "lg:min-h-header flex w-full flex-wrap items-center justify-center p-2 lg:p-1" }, U = {
name: "OperationBlock"
}, M = /* @__PURE__ */ m({
...U,
props: {
eventBus: {},
appVersion: {},
path: {},
method: {},
layout: {},
server: {},
servers: {},
history: {},
requestLoadingPercentage: {},
response: {},
request: {},
totalPerformedRequests: {},
isSidebarOpen: { type: Boolean },
showSidebar: { type: Boolean },
hideClientButton: { type: Boolean },
integration: {},
documentUrl: {},
source: {},
operation: {},
exampleKey: {},
authMeta: {},
securitySchemes: {},
selectedSecurity: {},
security: {},
plugins: {},
environment: {}
},
emits: ["update:servers"],
setup(t, { emit: i }) {
const u = i, r = () => t.eventBus.emit("operation:send:request", {
meta: { path: t.path, method: t.method, exampleKey: t.exampleKey }
}), l = (e) => t.eventBus.emit("operation:update:method", {
meta: {
method: t.method,
path: t.path
},
payload: {
method: e.value
}
}), d = (e) => t.eventBus.emit(
"operation:update:path",
{
meta: {
method: t.method,
path: t.path
},
payload: {
path: e.value
}
},
{ debounceKey: "operation-update-path" }
);
return (e, a) => (h(), p("div", q, [
y("div", b, [
o(B, {
documentUrl: e.documentUrl,
environment: e.environment,
eventBus: e.eventBus,
hideClientButton: e.hideClientButton,
history: e.history,
integration: e.integration,
isSidebarOpen: e.isSidebarOpen,
layout: e.layout,
method: e.method,
path: e.path,
percentage: e.requestLoadingPercentage,
server: e.server,
servers: e.servers,
showSidebar: e.showSidebar,
source: e.source,
onExecute: r,
"onUpdate:method": l,
"onUpdate:path": d,
"onUpdate:servers": a[0] || (a[0] = (w) => u("update:servers"))
}, null, 8, ["documentUrl", "environment", "eventBus", "hideClientButton", "history", "integration", "isSidebarOpen", "layout", "method", "path", "percentage", "server", "servers", "showSidebar", "source"])
]),
o(v, null, {
default: s(() => [
o(f, { class: "flex flex-1" }, {
default: s(() => [
o(n(g), {
authMeta: e.authMeta,
environment: e.environment,
eventBus: e.eventBus,
exampleKey: e.exampleKey,
layout: e.layout,
method: e.method,
operation: e.operation,
path: e.path,
plugins: e.plugins,
security: e.security,
securitySchemes: e.securitySchemes,
selectedSecurity: e.selectedSecurity
}, null, 8, ["authMeta", "environment", "eventBus", "exampleKey", "layout", "method", "operation", "path", "plugins", "security", "securitySchemes", "selectedSecurity"]),
o(n(S), {
appVersion: e.appVersion,
eventBus: e.eventBus,
events: n(c)(),
layout: e.layout,
plugins: e.plugins,
request: e.request,
response: e.response,
totalPerformedRequests: e.totalPerformedRequests,
onSendRequest: r
}, null, 8, ["appVersion", "eventBus", "events", "layout", "plugins", "request", "response", "totalPerformedRequests"])
]),
_: 1
})
]),
_: 1
})
]));
}
});
export {
M as default
};