@nwire/studio 0.12.1 → 0.13.1
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
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Queries page — renders the list from cache and cross-links to the
|
|
3
|
-
* backing projection when the query is projection-form.
|
|
4
|
-
*/
|
|
5
|
-
import { describe, it, expect, beforeEach, vi } from "vitest";
|
|
6
|
-
import { mount, flushPromises } from "@vue/test-utils";
|
|
7
|
-
import { createRouter, createMemoryHistory } from "vue-router";
|
|
8
|
-
import Queries from "../Queries.vue";
|
|
9
|
-
|
|
10
|
-
const counterQuery = {
|
|
11
|
-
name: "counter.get-count",
|
|
12
|
-
app: "shop",
|
|
13
|
-
public: true,
|
|
14
|
-
projection: "counter-total",
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
beforeEach(() => {
|
|
18
|
-
globalThis.fetch = vi.fn((url: string | URL) => {
|
|
19
|
-
const u = String(url);
|
|
20
|
-
if (u.includes("/__nwire/manifest.json")) {
|
|
21
|
-
return Promise.resolve(
|
|
22
|
-
new Response(
|
|
23
|
-
JSON.stringify({
|
|
24
|
-
generatedAt: new Date().toISOString(),
|
|
25
|
-
apps: [],
|
|
26
|
-
modules: [],
|
|
27
|
-
actions: [],
|
|
28
|
-
events: [],
|
|
29
|
-
actors: [],
|
|
30
|
-
projections: [],
|
|
31
|
-
queries: [counterQuery],
|
|
32
|
-
resolvers: [],
|
|
33
|
-
routes: [],
|
|
34
|
-
workflows: [],
|
|
35
|
-
externalCalls: [],
|
|
36
|
-
inboundWebhooks: [],
|
|
37
|
-
outboxes: [],
|
|
38
|
-
inboxes: [],
|
|
39
|
-
crons: [],
|
|
40
|
-
hooks: [],
|
|
41
|
-
plugins: [],
|
|
42
|
-
bindings: [],
|
|
43
|
-
graph: { events: [] },
|
|
44
|
-
}),
|
|
45
|
-
{ status: 200 },
|
|
46
|
-
),
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
return Promise.resolve(new Response("", { status: 404 }));
|
|
50
|
-
}) as typeof fetch;
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
function makeRouter() {
|
|
54
|
-
return createRouter({
|
|
55
|
-
history: createMemoryHistory(),
|
|
56
|
-
routes: [
|
|
57
|
-
{ path: "/queries", name: "queries", component: Queries },
|
|
58
|
-
{ path: "/projections", name: "projections", component: { template: "<div/>" } },
|
|
59
|
-
],
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
describe("Queries", () => {
|
|
64
|
-
it("renders queries from the cache", async () => {
|
|
65
|
-
const router = makeRouter();
|
|
66
|
-
await router.push("/queries");
|
|
67
|
-
const wrapper = mount(Queries, { global: { plugins: [router] } });
|
|
68
|
-
await flushPromises();
|
|
69
|
-
await flushPromises();
|
|
70
|
-
|
|
71
|
-
expect(wrapper.text()).toContain("counter.get-count");
|
|
72
|
-
expect(wrapper.find("[data-testid=queries-page]").exists()).toBe(true);
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it("deep-links via ?name=… and shows the backing projection", async () => {
|
|
76
|
-
const router = makeRouter();
|
|
77
|
-
await router.push("/queries?name=counter.get-count");
|
|
78
|
-
const wrapper = mount(Queries, { global: { plugins: [router] } });
|
|
79
|
-
await flushPromises();
|
|
80
|
-
await flushPromises();
|
|
81
|
-
|
|
82
|
-
const detail = wrapper.find("[data-testid=query-detail]");
|
|
83
|
-
expect(detail.exists()).toBe(true);
|
|
84
|
-
expect(detail.text()).toContain("counter-total");
|
|
85
|
-
});
|
|
86
|
-
});
|