@nwire/studio 0.12.1 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -3
- package/src/App.vue +62 -56
- package/src/components/BcCard.stories.ts +47 -0
- package/src/components/BcCard.vue +152 -0
- package/src/components/DurationBar.stories.ts +55 -0
- package/src/components/DurationBar.vue +72 -0
- package/src/components/ErrorCard.stories.ts +133 -0
- package/src/components/ErrorCard.vue +153 -0
- package/src/components/GraphCanvas.stories.ts +48 -0
- package/src/components/GraphCanvas.vue +88 -0
- package/src/components/KpiTile.stories.ts +32 -0
- package/src/components/KpiTile.vue +39 -0
- package/src/components/LiveTable.stories.ts +78 -0
- package/src/components/LiveTable.vue +186 -0
- package/src/components/MetadataInspector.stories.ts +53 -0
- package/src/components/MetadataInspector.vue +105 -0
- package/src/components/NodeCard.stories.ts +44 -0
- package/src/components/NodeCard.vue +150 -0
- package/src/components/RcaPanel.stories.ts +95 -0
- package/src/components/RcaPanel.vue +223 -0
- package/src/components/ServiceNode.vue +134 -0
- package/src/components/SourceDrawer.vue +6 -4
- package/src/components/SourcePill.vue +10 -3
- package/src/components/StatusBadge.stories.ts +33 -0
- package/src/components/StatusBadge.vue +54 -0
- package/src/components/Waterfall.stories.ts +85 -0
- package/src/components/Waterfall.vue +53 -0
- package/src/components/WaterfallRow.vue +74 -0
- package/src/components/__tests__/BcCard.test.ts +53 -0
- package/src/components/__tests__/DurationBar.test.ts +31 -0
- package/src/components/__tests__/ErrorCard.test.ts +71 -0
- package/src/components/__tests__/KpiTile.test.ts +23 -0
- package/src/components/__tests__/LiveTable.test.ts +100 -0
- package/src/components/__tests__/MetadataInspector.test.ts +38 -0
- package/src/components/__tests__/NodeCard.test.ts +116 -0
- package/src/components/__tests__/RcaPanel.test.ts +81 -0
- package/src/components/__tests__/StatusBadge.test.ts +23 -0
- package/src/components/__tests__/Waterfall.test.ts +54 -0
- package/src/components/index.ts +13 -0
- package/src/composables/__tests__/composables-context.test.ts +107 -0
- package/src/composables/__tests__/useTelemetry.test.ts +104 -0
- package/src/composables/__tests__/useTelemetryRuns.test.ts +282 -0
- package/src/composables/useDiscovery.ts +73 -0
- package/src/composables/useEndpoints.ts +94 -0
- package/src/composables/useLogTail.ts +51 -0
- package/src/composables/useManifest.ts +43 -0
- package/src/composables/useProcesses.ts +114 -0
- package/src/composables/useProject.ts +34 -0
- package/src/composables/useTelemetry.ts +270 -0
- package/src/lib/__tests__/bc-graph.test.ts +218 -0
- package/src/lib/__tests__/dispatch-form.test.ts +113 -0
- package/src/lib/__tests__/error-friendly.test.ts +198 -0
- package/src/lib/__tests__/home.test.ts +231 -0
- package/src/lib/__tests__/inspect.test.ts +160 -0
- package/src/lib/__tests__/kind-colors.test.ts +59 -0
- package/src/lib/__tests__/live-table.test.ts +194 -0
- package/src/lib/__tests__/manifest-health.test.ts +120 -0
- package/src/lib/__tests__/manifest.test.ts +87 -0
- package/src/lib/__tests__/metadata.test.ts +47 -0
- package/src/lib/__tests__/node-metrics.test.ts +144 -0
- package/src/lib/__tests__/operate.test.ts +97 -0
- package/src/lib/__tests__/pipeline-flow.test.ts +79 -0
- package/src/lib/__tests__/rca.test.ts +124 -0
- package/src/lib/__tests__/telemetry.test.ts +91 -0
- package/src/lib/__tests__/topology-graph.test.ts +331 -0
- package/src/lib/__tests__/topology-view.test.ts +154 -0
- package/src/lib/__tests__/waterfall.test.ts +165 -0
- package/src/lib/bc-graph.ts +298 -0
- package/src/lib/dispatch-form.ts +160 -0
- package/src/lib/error-friendly.ts +288 -0
- package/src/lib/home.ts +191 -0
- package/src/lib/inspect.ts +226 -0
- package/src/lib/kind-colors.ts +132 -0
- package/src/lib/live-table.ts +204 -0
- package/src/lib/manifest-health.ts +71 -0
- package/src/lib/manifest.ts +139 -0
- package/src/lib/metadata.ts +52 -0
- package/src/lib/node-metrics.ts +242 -0
- package/src/lib/operate.ts +114 -0
- package/src/lib/pipeline-flow.ts +120 -0
- package/src/lib/rca.ts +193 -0
- package/src/lib/telemetry.ts +155 -0
- package/src/lib/topology-graph.ts +551 -0
- package/src/lib/topology-view.ts +185 -0
- package/src/lib/waterfall.ts +148 -0
- package/src/main.ts +63 -29
- package/src/pages/Errors.vue +272 -0
- package/src/pages/Home.stories.ts +7 -8
- package/src/pages/Home.vue +255 -540
- package/src/pages/Hooks.stories.ts +44 -0
- package/src/pages/Hooks.vue +165 -164
- package/src/pages/Inspect.vue +240 -0
- package/src/pages/Map.vue +187 -0
- package/src/pages/Operate.vue +74 -0
- package/src/pages/Plugins.stories.ts +1 -1
- package/src/pages/Plugins.vue +174 -238
- package/src/pages/Projects.vue +62 -60
- package/src/pages/Streams.vue +344 -0
- package/src/pages/Topology.vue +318 -136
- package/src/pages/Trace.vue +174 -412
- package/src/pages/__tests__/Home.test.ts +109 -54
- package/src/pages/__tests__/Hooks.test.ts +5 -5
- package/src/pages/__tests__/Inspect.test.ts +111 -0
- package/src/pages/__tests__/Plugins.test.ts +85 -35
- package/src/pages/__tests__/Trace.test.ts +117 -0
- package/src/pages/operate/CommandsPanel.vue +186 -0
- package/src/pages/{Dispatch.vue → operate/DispatchPanel.vue} +100 -203
- package/src/pages/operate/EndpointPicker.vue +56 -0
- package/src/pages/operate/RunPanel.vue +316 -0
- package/src/server/__tests__/nwire-read.test.ts +80 -0
- package/src/server/nwire-read.ts +63 -0
- package/vite.config.ts +220 -2
- package/src/lib/__tests__/normalize-cache.test.ts +0 -105
- package/src/lib/cache.ts +0 -312
- package/src/lib/normalize-cache.ts +0 -92
- package/src/pages/Actions.vue +0 -171
- package/src/pages/Apps.vue +0 -177
- package/src/pages/Commands.vue +0 -262
- package/src/pages/Events.vue +0 -210
- package/src/pages/Live.vue +0 -249
- package/src/pages/Overview.vue +0 -161
- package/src/pages/Projections.vue +0 -148
- package/src/pages/Queries.vue +0 -148
- package/src/pages/Run.vue +0 -618
- package/src/pages/Sinks.vue +0 -124
- package/src/pages/TraceNode.vue +0 -164
- package/src/pages/Workflows.vue +0 -184
- package/src/pages/__tests__/Actions.test.ts +0 -98
- package/src/pages/__tests__/Projections.test.ts +0 -90
- package/src/pages/__tests__/Queries.test.ts +0 -86
package/src/pages/Queries.vue
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* Queries — read endpoints over the CQRS surface. Each query reads from
|
|
4
|
-
* a projection (eventually consistent over events) or runs a handler
|
|
5
|
-
* (anything outside the projection store).
|
|
6
|
-
*/
|
|
7
|
-
import { computed, onMounted, ref, watch } from "vue";
|
|
8
|
-
import { useRoute, useRouter } from "vue-router";
|
|
9
|
-
import { useCache } from "@/lib/cache";
|
|
10
|
-
import { Search, Database, Globe, Lock } from "lucide-vue-next";
|
|
11
|
-
import {
|
|
12
|
-
PageHeader,
|
|
13
|
-
FilterInput,
|
|
14
|
-
KindBadge,
|
|
15
|
-
EmptyState,
|
|
16
|
-
MasterDetail,
|
|
17
|
-
SourcePill,
|
|
18
|
-
SourceDrawer,
|
|
19
|
-
ListRow,
|
|
20
|
-
} from "@/components";
|
|
21
|
-
|
|
22
|
-
const route = useRoute();
|
|
23
|
-
const router = useRouter();
|
|
24
|
-
const { cache } = useCache();
|
|
25
|
-
const filter = ref("");
|
|
26
|
-
const selected = ref<string | null>(null);
|
|
27
|
-
const sourcePreview = ref<{ file: string; line: number; column?: number } | null>(null);
|
|
28
|
-
|
|
29
|
-
function applyQueryPreselect(): void {
|
|
30
|
-
const name = route.query.name;
|
|
31
|
-
if (typeof name !== "string" || name.length === 0) return;
|
|
32
|
-
const found = cache.value?.queries.find((q) => q.name === name);
|
|
33
|
-
if (found) selected.value = `${found.app}::${found.name}`;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
onMounted(applyQueryPreselect);
|
|
37
|
-
watch(() => route.query.name, applyQueryPreselect);
|
|
38
|
-
watch(() => cache.value, applyQueryPreselect);
|
|
39
|
-
|
|
40
|
-
const filtered = computed(() => {
|
|
41
|
-
if (!cache.value) return [];
|
|
42
|
-
const q = filter.value.toLowerCase();
|
|
43
|
-
return cache.value.queries.filter(
|
|
44
|
-
(qe) =>
|
|
45
|
-
!q ||
|
|
46
|
-
qe.name.toLowerCase().includes(q) ||
|
|
47
|
-
qe.app.toLowerCase().includes(q) ||
|
|
48
|
-
(qe.projection ?? "").toLowerCase().includes(q),
|
|
49
|
-
);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
const key = (q: { app: string; name: string }) => `${q.app}::${q.name}`;
|
|
53
|
-
const detail = computed(() => filtered.value.find((q) => key(q) === selected.value) ?? null);
|
|
54
|
-
</script>
|
|
55
|
-
|
|
56
|
-
<template>
|
|
57
|
-
<div v-if="cache" class="h-full flex flex-col" data-testid="queries-page">
|
|
58
|
-
<div class="p-6 pb-3 border-b border-zinc-800">
|
|
59
|
-
<PageHeader
|
|
60
|
-
title="Queries"
|
|
61
|
-
subtitle="Read endpoints — projection-backed or direct-handler."
|
|
62
|
-
:icon="Search"
|
|
63
|
-
icon-color="text-emerald-400"
|
|
64
|
-
:count="filtered.length"
|
|
65
|
-
:total="cache.queries.length"
|
|
66
|
-
/>
|
|
67
|
-
</div>
|
|
68
|
-
|
|
69
|
-
<EmptyState
|
|
70
|
-
v-if="cache.queries.length === 0"
|
|
71
|
-
title="No queries in cache"
|
|
72
|
-
hint="Queries are declared via defineQuery(projection, { name, input, execute }) or defineQuery({ name, input, handler })."
|
|
73
|
-
:icon="Search"
|
|
74
|
-
/>
|
|
75
|
-
|
|
76
|
-
<MasterDetail v-else class="flex-1">
|
|
77
|
-
<template #listHeader>
|
|
78
|
-
<FilterInput v-model="filter" placeholder="filter by name, app, projection…" />
|
|
79
|
-
</template>
|
|
80
|
-
|
|
81
|
-
<template #list>
|
|
82
|
-
<ListRow
|
|
83
|
-
v-for="q in filtered"
|
|
84
|
-
:key="key(q)"
|
|
85
|
-
:selected="selected === key(q)"
|
|
86
|
-
@click="selected = key(q)"
|
|
87
|
-
>
|
|
88
|
-
<template #title>
|
|
89
|
-
<Search class="w-3 h-3 text-emerald-400 shrink-0" />
|
|
90
|
-
<span class="font-mono text-sm truncate">{{ q.name }}</span>
|
|
91
|
-
</template>
|
|
92
|
-
<template #meta>
|
|
93
|
-
<component
|
|
94
|
-
:is="q.public ? Globe : Lock"
|
|
95
|
-
class="w-3 h-3"
|
|
96
|
-
:class="q.public ? 'text-emerald-400' : 'text-zinc-500'"
|
|
97
|
-
:title="q.public ? 'public — exposed across the system' : 'private'"
|
|
98
|
-
/>
|
|
99
|
-
<span class="text-[10px] text-zinc-500">{{ q.app }}</span>
|
|
100
|
-
</template>
|
|
101
|
-
<template v-if="q.projection" #description>
|
|
102
|
-
<div>
|
|
103
|
-
<span class="text-zinc-500">reads</span>
|
|
104
|
-
<span class="font-mono ml-1">{{ q.projection }}</span>
|
|
105
|
-
</div>
|
|
106
|
-
</template>
|
|
107
|
-
</ListRow>
|
|
108
|
-
</template>
|
|
109
|
-
|
|
110
|
-
<template #empty>Select a query to view its projection and source.</template>
|
|
111
|
-
|
|
112
|
-
<template v-if="detail" #detail>
|
|
113
|
-
<div class="p-6 space-y-5" data-testid="query-detail">
|
|
114
|
-
<div>
|
|
115
|
-
<div class="text-[10px] uppercase tracking-wide text-zinc-500">{{ detail.app }}</div>
|
|
116
|
-
<h2 class="font-mono text-xl mt-1">{{ detail.name }}</h2>
|
|
117
|
-
<p v-if="detail.description" class="text-sm text-zinc-400 mt-2 max-w-2xl">
|
|
118
|
-
{{ detail.description }}
|
|
119
|
-
</p>
|
|
120
|
-
</div>
|
|
121
|
-
|
|
122
|
-
<div class="flex flex-wrap gap-2">
|
|
123
|
-
<KindBadge :variant="detail.public ? 'public' : 'private'">
|
|
124
|
-
{{ detail.public ? "public" : "private" }}
|
|
125
|
-
</KindBadge>
|
|
126
|
-
</div>
|
|
127
|
-
|
|
128
|
-
<div v-if="detail.projection" class="space-y-3">
|
|
129
|
-
<h3 class="text-xs uppercase tracking-wide text-zinc-500">Reads from</h3>
|
|
130
|
-
<button
|
|
131
|
-
type="button"
|
|
132
|
-
class="flex items-center gap-2 font-mono text-sm text-left hover:text-cyan-300"
|
|
133
|
-
@click="router.push({ path: '/projections', query: { name: detail.projection } })"
|
|
134
|
-
>
|
|
135
|
-
<Database class="w-3.5 h-3.5 text-cyan-400" />
|
|
136
|
-
<span class="underline-offset-2 hover:underline">{{ detail.projection }}</span>
|
|
137
|
-
</button>
|
|
138
|
-
</div>
|
|
139
|
-
|
|
140
|
-
<div v-if="detail.source" class="pt-2">
|
|
141
|
-
<SourcePill :source="detail.source" @click="sourcePreview = detail.source!" />
|
|
142
|
-
</div>
|
|
143
|
-
</div>
|
|
144
|
-
</template>
|
|
145
|
-
</MasterDetail>
|
|
146
|
-
<SourceDrawer :source="sourcePreview" @close="sourcePreview = null" />
|
|
147
|
-
</div>
|
|
148
|
-
</template>
|