@scayle/storefront-devtools 0.2.0-alpha.1 → 0.2.0-alpha.2
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/CHANGELOG.md +10 -0
- package/README.md +113 -83
- package/dist/_chunks/coalesce-cmmfn4qq.mjs +1585 -0
- package/dist/group.d.ts +29 -21
- package/dist/group.d.ts.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +40 -65
- package/dist/inertia/channel.d.ts +54 -0
- package/dist/inertia/channel.d.ts.map +1 -0
- package/dist/inertia/client/index.d.ts +1 -6
- package/dist/inertia/client/index.d.ts.map +1 -1
- package/dist/inertia/client/index.mjs +246 -109
- package/dist/inertia/client/publish.d.ts +24 -0
- package/dist/inertia/client/publish.d.ts.map +1 -0
- package/dist/inertia/core/network.d.ts +1 -1
- package/dist/inertia/core/network.d.ts.map +1 -1
- package/dist/inertia/core/response.d.ts +3 -3
- package/dist/inertia/core/response.d.ts.map +1 -1
- package/dist/inertia/plugin.d.ts +8 -6
- package/dist/inertia/plugin.d.ts.map +1 -1
- package/dist/orpc/channel.d.ts +29 -0
- package/dist/orpc/channel.d.ts.map +1 -0
- package/dist/orpc/client/index.d.ts +1 -6
- package/dist/orpc/client/index.d.ts.map +1 -1
- package/dist/orpc/client/index.mjs +152 -137
- package/dist/orpc/client/publish.d.ts +15 -0
- package/dist/orpc/client/publish.d.ts.map +1 -0
- package/dist/orpc/core/serialize.d.ts +1 -1
- package/dist/orpc/core/stats.d.ts +10 -0
- package/dist/orpc/core/stats.d.ts.map +1 -0
- package/dist/orpc/core/store.d.ts +1 -2
- package/dist/orpc/core/store.d.ts.map +1 -1
- package/dist/orpc/plugin.d.ts +8 -5
- package/dist/orpc/plugin.d.ts.map +1 -1
- package/dist/shared/clipboard.d.ts +2 -3
- package/dist/shared/clipboard.d.ts.map +1 -1
- package/dist/shared/coalesce.d.ts +14 -0
- package/dist/shared/coalesce.d.ts.map +1 -0
- package/dist/shared/panel-channel.d.ts +49 -0
- package/dist/shared/panel-channel.d.ts.map +1 -0
- package/dist/shared/publish-options.d.ts +13 -0
- package/dist/shared/publish-options.d.ts.map +1 -0
- package/dist/shared/safe-clone.d.ts +2 -1
- package/dist/shared/safe-clone.d.ts.map +1 -1
- package/dist/storefront/plugin.d.ts +6 -4
- package/dist/storefront/plugin.d.ts.map +1 -1
- package/dist/ui/assets/App-BlEKD1MK.js +4 -0
- package/dist/ui/assets/App-C1rr07m5.js +1 -0
- package/dist/ui/assets/App-C5-JscO0.css +1 -0
- package/dist/ui/assets/App-M0iU7c4p.css +1 -0
- package/dist/ui/assets/App-VElUrn9P.js +5 -0
- package/dist/ui/assets/App-jiQKInbo.css +1 -0
- package/dist/ui/assets/_plugin-vue_export-helper-BDNMzG2s.js +1 -0
- package/dist/ui/assets/channel-D7V7aU79.js +1 -0
- package/dist/ui/assets/clipboard-BnEeWyfh.css +1 -0
- package/dist/ui/assets/clipboard-n-T06WI3.js +1 -0
- package/dist/ui/assets/panel-channel-DjMENemf.js +2 -0
- package/dist/ui/assets/panels-B4LTsmli.css +1 -0
- package/dist/ui/assets/panels-BLV_p6Kz.js +2 -0
- package/dist/ui/assets/preload-helper-J6bGWMBq.js +2 -0
- package/dist/{vue-devtools/ui/assets/index-Dby9TIQH.js → ui/assets/vue-BAMMushd.js} +19 -20
- package/dist/{vue-devtools/ui/assets/index-sSkqWPzY.css → ui/assets/vue-Kq4tvBbL.css} +1 -1
- package/dist/ui/panels/index.html +15 -0
- package/dist/{vue-devtools/ui → ui/vue}/index.html +4 -2
- package/dist/vue-devtools/client/index.mjs +0 -1
- package/dist/vue-devtools/plugin.d.ts +10 -9
- package/dist/vue-devtools/plugin.d.ts.map +1 -1
- package/package.json +11 -29
- package/dist/_chunks/clipboard-DrVHc2QA.mjs +0 -61
- package/dist/_chunks/diff-DzJ5arJj.mjs +0 -169
- package/dist/_chunks/panel-uV5ITqhY.mjs +0 -51
- package/dist/_chunks/redact-DmIF-iyk.mjs +0 -96
- package/dist/_chunks/useStore-Db8RZW8T.mjs +0 -10
- package/dist/inertia/client/index.d.mts +0 -13
- package/dist/inertia/renderer/index.d.mts +0 -16
- package/dist/inertia/renderer/index.mjs +0 -771
- package/dist/orpc/client/index.d.mts +0 -13
- package/dist/orpc/renderer/index.d.mts +0 -16
- package/dist/orpc/renderer/index.mjs +0 -457
- package/dist/resource-center/client/index.mjs +0 -21
- package/dist/resource-center/client.d.ts +0 -3
- package/dist/resource-center/client.d.ts.map +0 -1
- package/dist/resource-center/plugin.d.ts +0 -12
- package/dist/resource-center/plugin.d.ts.map +0 -1
- package/dist/shared/use-window-store.d.ts +0 -18
- package/dist/shared/use-window-store.d.ts.map +0 -1
- package/dist/storefront/renderer/index.d.mts +0 -16
- package/dist/storefront/renderer/index.mjs +0 -124
- /package/dist/{vue-devtools/ui → ui}/assets/css-8QJvnqUH.js +0 -0
- /package/dist/{vue-devtools/ui → ui}/assets/css-CaJ9TzKE.js +0 -0
- /package/dist/{vue-devtools/ui → ui}/assets/diff-woXpYk--.js +0 -0
- /package/dist/{vue-devtools/ui → ui}/assets/html-BHDw6EPc.js +0 -0
- /package/dist/{vue-devtools/ui → ui}/assets/html-GueGcY0x.js +0 -0
- /package/dist/{vue-devtools/ui → ui}/assets/javascript-BzbQS41l.js +0 -0
- /package/dist/{vue-devtools/ui → ui}/assets/javascript-Yelw-5ZN.js +0 -0
- /package/dist/{vue-devtools/ui → ui}/assets/json-B88Oqtu5.js +0 -0
- /package/dist/{vue-devtools/ui → ui}/assets/json-CaljABEy.js +0 -0
- /package/dist/{vue-devtools/ui → ui}/assets/shellscript-CLZ0U2zV.js +0 -0
- /package/dist/{vue-devtools/ui → ui}/assets/typescript-Utq2Cl8c.js +0 -0
- /package/dist/{vue-devtools/ui → ui}/assets/typescript-j_1H8WHN.js +0 -0
- /package/dist/{vue-devtools/ui → ui}/assets/vitesse-dark-BZCL-v6S.js +0 -0
- /package/dist/{vue-devtools/ui → ui}/assets/vitesse-light-VbXTXTou.js +0 -0
- /package/dist/{vue-devtools/ui → ui}/assets/vue-B1Tf5CHw.js +0 -0
- /package/dist/{vue-devtools/ui → ui}/assets/vue-html-CGMs_6qn.js +0 -0
- /package/dist/{vue-devtools/ui → ui}/assets/yaml-rwi0_p6S.js +0 -0
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export {}
|
|
2
|
-
|
|
3
|
-
declare global {
|
|
4
|
-
interface Window {
|
|
5
|
-
/**
|
|
6
|
-
* The in-page oRPC devtools store, set by the injected client bootstrap.
|
|
7
|
-
* Typed as `unknown` because this side-effect entry exposes no API.
|
|
8
|
-
* Consumers `import '@scayle/storefront-devtools/orpc/client'` only to start
|
|
9
|
-
* capture. The dock renderer reads the concrete store off `window`.
|
|
10
|
-
*/
|
|
11
|
-
__STOREFRONT_DEVTOOLS_ORPC_STORE__?: unknown
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { DockClientScriptContext } from '@vitejs/devtools-kit/client'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Custom-render entry that mounts a devtools panel's Vue app into the dock
|
|
5
|
-
* panel DOM via `mountPanel` (see `src/shared/mount-panel.ts`). The Vite
|
|
6
|
-
* DevTools dock imports this by module specifier at runtime. This
|
|
7
|
-
* hand-authored declaration is the typed contract shared by the `./inertia/renderer`,
|
|
8
|
-
* `./orpc/renderer`, and `./storefront/renderer` exports. The Vue UI each
|
|
9
|
-
* renderer mounts has no emittable types and is excluded from declaration
|
|
10
|
-
* generation.
|
|
11
|
-
*
|
|
12
|
-
* @param ctx - The dock client-script context provided by the Vite DevTools dock.
|
|
13
|
-
*/
|
|
14
|
-
declare function setupRenderer(ctx: DockClientScriptContext): void
|
|
15
|
-
|
|
16
|
-
export default setupRenderer
|
|
@@ -1,457 +0,0 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "../../_chunks/panel-uV5ITqhY.mjs";
|
|
2
|
-
import { n as r, r as i, t as a } from "../../_chunks/clipboard-DrVHc2QA.mjs";
|
|
3
|
-
import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, normalizeClass as h, openBlock as g, ref as _, renderList as v, toDisplayString as y, useTemplateRef as b, vModelText as x, watch as S, withDirectives as C } from "vue";
|
|
4
|
-
//#region src/orpc/panel/useStore.ts
|
|
5
|
-
function w() {
|
|
6
|
-
return e(() => window.__STOREFRONT_DEVTOOLS_ORPC_STORE__);
|
|
7
|
-
}
|
|
8
|
-
function T() {
|
|
9
|
-
return window.__STOREFRONT_DEVTOOLS_ORPC_STORE__;
|
|
10
|
-
}
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/orpc/panel/CallList.vue?vue&type=script&setup=true&lang.ts
|
|
13
|
-
var E = ["aria-activedescendant"], D = {
|
|
14
|
-
class: "sf-dt-filters",
|
|
15
|
-
role: "group",
|
|
16
|
-
"aria-label": "Filter by domain"
|
|
17
|
-
}, O = ["aria-pressed", "onClick"], ee = {
|
|
18
|
-
key: 0,
|
|
19
|
-
class: "sf-dt-prev"
|
|
20
|
-
}, te = ["aria-expanded"], k = {
|
|
21
|
-
key: 0,
|
|
22
|
-
id: "sf-dt-prev-calls",
|
|
23
|
-
class: "sf-dt-prev-rows"
|
|
24
|
-
}, A = { class: "sf-dt-method" }, j = { class: "sf-dt-proc" }, M = {
|
|
25
|
-
key: 0,
|
|
26
|
-
class: "sf-dt-timing"
|
|
27
|
-
}, N = { class: "sf-dt-rows" }, P = [
|
|
28
|
-
"id",
|
|
29
|
-
"aria-selected",
|
|
30
|
-
"onClick"
|
|
31
|
-
], F = { class: "sf-dt-method" }, I = { class: "sf-dt-proc" }, L = { class: "sf-dt-timing" }, R = {
|
|
32
|
-
key: 1,
|
|
33
|
-
class: "sf-dt-empty"
|
|
34
|
-
}, z = {
|
|
35
|
-
class: "sf-dt-visually-hidden",
|
|
36
|
-
role: "status",
|
|
37
|
-
"aria-live": "polite"
|
|
38
|
-
}, B = /*#__PURE__*/ n(/* @__PURE__ */ m({
|
|
39
|
-
__name: "CallList",
|
|
40
|
-
props: {
|
|
41
|
-
calls: {},
|
|
42
|
-
selectedId: {},
|
|
43
|
-
paused: { type: Boolean }
|
|
44
|
-
},
|
|
45
|
-
emits: ["select"],
|
|
46
|
-
setup(e, { expose: t, emit: n }) {
|
|
47
|
-
let r = e, i = n, a = _(""), c = _("all"), p = _(!1), m = s(() => {
|
|
48
|
-
let e = /* @__PURE__ */ new Set();
|
|
49
|
-
for (let t of r.calls) e.add(t.procedure.split("/")[0]);
|
|
50
|
-
return ["all", ...Array.from(e)];
|
|
51
|
-
}), S = s(() => r.calls.filter((e) => {
|
|
52
|
-
let t = c.value === "all" || e.procedure.split("/")[0] === c.value, n = a.value.trim().toLowerCase(), r = !n || e.procedure.toLowerCase().includes(n);
|
|
53
|
-
return t && r;
|
|
54
|
-
})), w = s(() => T()?.previousSessionCalls ?? []);
|
|
55
|
-
function B(e) {
|
|
56
|
-
return e.ok ? "is-ok" : e.errorKind === "validation" ? "is-warn" : e.errorKind ? "is-error" : "";
|
|
57
|
-
}
|
|
58
|
-
function V(e) {
|
|
59
|
-
let t = S.value;
|
|
60
|
-
if (!t.length) return;
|
|
61
|
-
let n = t.findIndex((e) => e.id === r.selectedId);
|
|
62
|
-
e.key === "ArrowDown" ? (e.preventDefault(), i("select", t[Math.min(n + 1, t.length - 1)].id)) : e.key === "ArrowUp" && (e.preventDefault(), i("select", t[Math.max(n - 1, 0)].id));
|
|
63
|
-
}
|
|
64
|
-
let H = b("listEl");
|
|
65
|
-
return t({ focus: () => H.value?.focus() }), (t, n) => (g(), u("div", {
|
|
66
|
-
ref_key: "listEl",
|
|
67
|
-
ref: H,
|
|
68
|
-
class: "sf-dt-list",
|
|
69
|
-
tabindex: "0",
|
|
70
|
-
role: "listbox",
|
|
71
|
-
"aria-label": "oRPC calls",
|
|
72
|
-
"aria-activedescendant": e.selectedId == null ? void 0 : `sf-dt-call-${e.selectedId}`,
|
|
73
|
-
onKeydown: V
|
|
74
|
-
}, [
|
|
75
|
-
d("div", D, [(g(!0), u(o, null, v(m.value, (e) => (g(), u("button", {
|
|
76
|
-
key: e,
|
|
77
|
-
class: h(["sf-dt-filter", { "is-active": c.value === e }]),
|
|
78
|
-
"aria-pressed": c.value === e,
|
|
79
|
-
onClick: (t) => c.value = e
|
|
80
|
-
}, y(e), 11, O))), 128))]),
|
|
81
|
-
C(d("input", {
|
|
82
|
-
"onUpdate:modelValue": n[0] ||= (e) => a.value = e,
|
|
83
|
-
class: "sf-dt-search",
|
|
84
|
-
type: "search",
|
|
85
|
-
placeholder: "Filter by procedure",
|
|
86
|
-
"aria-label": "Filter calls by procedure"
|
|
87
|
-
}, null, 512), [[x, a.value]]),
|
|
88
|
-
w.value.length ? (g(), u("div", ee, [d("button", {
|
|
89
|
-
class: "sf-dt-prev-toggle",
|
|
90
|
-
"aria-expanded": p.value,
|
|
91
|
-
"aria-controls": "sf-dt-prev-calls",
|
|
92
|
-
onClick: n[1] ||= (e) => p.value = !p.value
|
|
93
|
-
}, y(p.value ? "▾" : "▸") + " Previous session (" + y(w.value.length) + ") ", 9, te), p.value ? (g(), u("ul", k, [(g(!0), u(o, null, v(w.value, (e) => (g(), u("li", {
|
|
94
|
-
key: e.id,
|
|
95
|
-
class: "sf-dt-prev-row"
|
|
96
|
-
}, [
|
|
97
|
-
d("span", A, y(e.method), 1),
|
|
98
|
-
d("span", j, y(e.procedure), 1),
|
|
99
|
-
e.status ? (g(), u("span", M, y(e.status), 1)) : l("", !0)
|
|
100
|
-
]))), 128))])) : l("", !0)])) : l("", !0),
|
|
101
|
-
d("ul", N, [(g(!0), u(o, null, v(S.value, (t) => (g(), u("li", {
|
|
102
|
-
id: `sf-dt-call-${t.id}`,
|
|
103
|
-
key: t.id,
|
|
104
|
-
class: h(["sf-dt-row", { "is-selected": t.id === e.selectedId }]),
|
|
105
|
-
role: "option",
|
|
106
|
-
"aria-selected": t.id === e.selectedId,
|
|
107
|
-
onClick: (e) => i("select", t.id)
|
|
108
|
-
}, [
|
|
109
|
-
d("span", F, y(t.method), 1),
|
|
110
|
-
d("span", I, y(t.procedure), 1),
|
|
111
|
-
d("span", { class: h(["sf-dt-status", B(t)]) }, y(t.status ?? "…"), 3),
|
|
112
|
-
d("span", L, y(t.duration == null ? "" : `${Math.round(t.duration)}ms`), 1)
|
|
113
|
-
], 10, P))), 128))]),
|
|
114
|
-
S.value.length ? l("", !0) : (g(), u("div", R, [r.calls.length ? (g(), u(o, { key: 0 }, [f("No calls match this filter")], 64)) : e.paused ? (g(), u(o, { key: 1 }, [f(" Capture is paused. Resume to see new calls. ")], 64)) : (g(), u(o, { key: 2 }, [f("Use the app to see oRPC calls appear here.")], 64))])),
|
|
115
|
-
d("div", z, y(S.value.length) + " call" + y(S.value.length === 1 ? "" : "s") + " captured ", 1)
|
|
116
|
-
], 40, E));
|
|
117
|
-
}
|
|
118
|
-
}), [["__scopeId", "data-v-d23a53a8"]]);
|
|
119
|
-
//#endregion
|
|
120
|
-
//#region src/orpc/core/curl.ts
|
|
121
|
-
function V(e) {
|
|
122
|
-
return `'${e.replace(/'/g, "'\\''")}'`;
|
|
123
|
-
}
|
|
124
|
-
function H(e) {
|
|
125
|
-
let t = [`curl -X ${e.method} ${V(e.url)}`];
|
|
126
|
-
return t.push(`-H ${V("Content-Type: application/json")}`), e.input !== void 0 && t.push(`-d ${V(JSON.stringify(e.input))}`), t.join(" ");
|
|
127
|
-
}
|
|
128
|
-
//#endregion
|
|
129
|
-
//#region src/orpc/core/markdown.ts
|
|
130
|
-
function U(e) {
|
|
131
|
-
let t;
|
|
132
|
-
t = e.duration == null ? e.finishedAt && e.startedAt ? `${Math.round(e.finishedAt - e.startedAt)}ms` : "in-flight" : `${Math.round(e.duration)}ms`;
|
|
133
|
-
let n = `${e.method} ${e.url}`;
|
|
134
|
-
e.status && (n += ` → ${e.status}`), n += ` (${t})`;
|
|
135
|
-
let r = [
|
|
136
|
-
"## oRPC Call",
|
|
137
|
-
"",
|
|
138
|
-
`**Procedure:** \`${e.procedure}\``,
|
|
139
|
-
`**Request:** ${n}`
|
|
140
|
-
];
|
|
141
|
-
return e.errorKind && r.push(`**Error kind:** ${e.errorKind}`), e.streaming && r.push("**Streaming:** Yes"), r.join("\n");
|
|
142
|
-
}
|
|
143
|
-
function W(e, t) {
|
|
144
|
-
return `### ${e}\n\n\`\`\`json\n${JSON.stringify(t, null, 2)}\n\`\`\``;
|
|
145
|
-
}
|
|
146
|
-
function G(e) {
|
|
147
|
-
let t = [U(e)];
|
|
148
|
-
return e.input !== void 0 && t.push(W("Input", e.input)), e.error === void 0 ? e.output !== void 0 && t.push(W("Output", e.output)) : t.push(W("Error", e.error)), e.headers && Object.keys(e.headers).length > 0 && t.push(W("Request headers", e.headers)), e.responseHeaders && Object.keys(e.responseHeaders).length > 0 && t.push(W("Response headers", e.responseHeaders)), t.join("\n\n");
|
|
149
|
-
}
|
|
150
|
-
//#endregion
|
|
151
|
-
//#region src/orpc/core/orpc-error.ts
|
|
152
|
-
function K(e) {
|
|
153
|
-
if (typeof e != "object" || !e) return null;
|
|
154
|
-
let t = e;
|
|
155
|
-
return typeof t.code == "string" ? {
|
|
156
|
-
code: t.code,
|
|
157
|
-
status: typeof t.status == "number" ? t.status : void 0,
|
|
158
|
-
message: typeof t.message == "string" ? t.message : void 0,
|
|
159
|
-
data: t.data
|
|
160
|
-
} : null;
|
|
161
|
-
}
|
|
162
|
-
//#endregion
|
|
163
|
-
//#region src/orpc/panel/DataTab.vue?vue&type=script&setup=true&lang.ts
|
|
164
|
-
var q = { class: "sf-dt-data-tab" }, J = { class: "sf-dt-section" }, Y = { class: "sf-dt-section-head" }, X = {
|
|
165
|
-
key: 0,
|
|
166
|
-
class: "sf-dt-section"
|
|
167
|
-
}, Z = {
|
|
168
|
-
key: 0,
|
|
169
|
-
class: "sf-dt-error-fields"
|
|
170
|
-
}, Q = {
|
|
171
|
-
key: 1,
|
|
172
|
-
class: "sf-dt-section"
|
|
173
|
-
}, ne = {
|
|
174
|
-
key: 2,
|
|
175
|
-
class: "sf-dt-section"
|
|
176
|
-
}, re = { class: "sf-dt-section-head" }, ie = "https://orpc.dev/docs/error-handling", ae = "https://orpc.dev/docs/event-iterator", oe = /*#__PURE__*/ n(/* @__PURE__ */ m({
|
|
177
|
-
__name: "DataTab",
|
|
178
|
-
props: { call: {} },
|
|
179
|
-
setup(e) {
|
|
180
|
-
let t = e, n = _(!1), r = _(!1);
|
|
181
|
-
function a(e, t) {
|
|
182
|
-
return e !== void 0 && JSON.stringify(e) !== JSON.stringify(t);
|
|
183
|
-
}
|
|
184
|
-
let c = s(() => a(t.call.rawInput, t.call.input)), m = s(() => a(t.call.rawOutput, t.call.output)), h = s(() => K(t.call.error));
|
|
185
|
-
return (t, a) => (g(), u("div", q, [d("section", J, [d("div", Y, [a[2] ||= d("h4", { class: "sf-dt-heading" }, "Input", -1), c.value ? (g(), u("button", {
|
|
186
|
-
key: 0,
|
|
187
|
-
class: "sf-dt-raw-toggle",
|
|
188
|
-
onClick: a[0] ||= (e) => n.value = !n.value
|
|
189
|
-
}, y(n.value ? "decoded" : "raw envelope"), 1)) : l("", !0)]), p(i, {
|
|
190
|
-
label: n.value ? "rawInput" : "input",
|
|
191
|
-
value: n.value ? e.call.rawInput : e.call.input
|
|
192
|
-
}, null, 8, ["label", "value"])]), e.call.error === void 0 ? e.call.streaming ? (g(), u("section", Q, [a[9] ||= d("h4", { class: "sf-dt-heading" }, "Output", -1), d("p", { class: "sf-dt-muted" }, [a[8] ||= f(" (streaming response, body not captured) ", -1), d("a", {
|
|
193
|
-
class: "sf-dt-doclink",
|
|
194
|
-
href: ae,
|
|
195
|
-
target: "_blank",
|
|
196
|
-
rel: "noreferrer"
|
|
197
|
-
}, "docs")])])) : (g(), u("section", ne, [d("div", re, [a[10] ||= d("h4", { class: "sf-dt-heading" }, "Output", -1), m.value ? (g(), u("button", {
|
|
198
|
-
key: 0,
|
|
199
|
-
class: "sf-dt-raw-toggle",
|
|
200
|
-
onClick: a[1] ||= (e) => r.value = !r.value
|
|
201
|
-
}, y(r.value ? "decoded" : "raw envelope"), 1)) : l("", !0)]), p(i, {
|
|
202
|
-
label: r.value ? "rawOutput" : "output",
|
|
203
|
-
value: r.value ? e.call.rawOutput : e.call.output
|
|
204
|
-
}, null, 8, ["label", "value"])])) : (g(), u("section", X, [
|
|
205
|
-
d("div", { class: "sf-dt-section-head" }, [a[3] ||= d("h4", { class: "sf-dt-heading" }, "Error", -1), d("a", {
|
|
206
|
-
class: "sf-dt-doclink",
|
|
207
|
-
href: ie,
|
|
208
|
-
target: "_blank",
|
|
209
|
-
rel: "noreferrer"
|
|
210
|
-
}, "docs")]),
|
|
211
|
-
h.value ? (g(), u("dl", Z, [
|
|
212
|
-
a[7] ||= d("dt", null, "Code", -1),
|
|
213
|
-
d("dd", null, y(h.value.code), 1),
|
|
214
|
-
h.value.status ? (g(), u(o, { key: 0 }, [a[4] ||= d("dt", null, "Status", -1), d("dd", null, y(h.value.status), 1)], 64)) : l("", !0),
|
|
215
|
-
h.value.message ? (g(), u(o, { key: 1 }, [a[5] ||= d("dt", null, "Message", -1), d("dd", null, y(h.value.message), 1)], 64)) : l("", !0),
|
|
216
|
-
h.value.data === void 0 ? l("", !0) : (g(), u(o, { key: 2 }, [a[6] ||= d("dt", null, "Data", -1), d("dd", null, [p(i, {
|
|
217
|
-
label: "data",
|
|
218
|
-
value: h.value.data
|
|
219
|
-
}, null, 8, ["value"])])], 64))
|
|
220
|
-
])) : l("", !0),
|
|
221
|
-
p(i, {
|
|
222
|
-
label: "error",
|
|
223
|
-
value: e.call.error
|
|
224
|
-
}, null, 8, ["value"])
|
|
225
|
-
]))]));
|
|
226
|
-
}
|
|
227
|
-
}), [["__scopeId", "data-v-b4a3d433"]]), se = { class: "sf-dt-headers-tab" }, ce = {
|
|
228
|
-
key: 0,
|
|
229
|
-
class: "sf-dt-section"
|
|
230
|
-
}, le = {
|
|
231
|
-
key: 1,
|
|
232
|
-
class: "sf-dt-section"
|
|
233
|
-
}, ue = {
|
|
234
|
-
key: 2,
|
|
235
|
-
class: "sf-dt-muted"
|
|
236
|
-
}, de = /*#__PURE__*/ n(/* @__PURE__ */ m({
|
|
237
|
-
__name: "HeadersTab",
|
|
238
|
-
props: { call: {} },
|
|
239
|
-
setup(e) {
|
|
240
|
-
return (t, n) => (g(), u("div", se, [
|
|
241
|
-
e.call.headers && Object.keys(e.call.headers).length ? (g(), u("section", ce, [n[0] ||= d("h4", { class: "sf-dt-heading" }, "Request headers", -1), p(r, { headers: e.call.headers }, null, 8, ["headers"])])) : l("", !0),
|
|
242
|
-
e.call.responseHeaders && Object.keys(e.call.responseHeaders).length ? (g(), u("section", le, [n[1] ||= d("h4", { class: "sf-dt-heading" }, "Response headers", -1), p(r, { headers: e.call.responseHeaders }, null, 8, ["headers"])])) : l("", !0),
|
|
243
|
-
!Object.keys(e.call.headers ?? {}).length && !Object.keys(e.call.responseHeaders ?? {}).length ? (g(), u("p", ue, " No headers captured for this call. ")) : l("", !0)
|
|
244
|
-
]));
|
|
245
|
-
}
|
|
246
|
-
}), [["__scopeId", "data-v-2b32ad4e"]]), fe = { class: "sf-dt-detail" }, pe = { class: "sf-dt-detail-head" }, me = {
|
|
247
|
-
key: 0,
|
|
248
|
-
class: "sf-dt-toast",
|
|
249
|
-
role: "status"
|
|
250
|
-
}, he = { class: "sf-dt-overview" }, ge = {
|
|
251
|
-
class: "sf-dt-subtabs",
|
|
252
|
-
role: "tablist",
|
|
253
|
-
"aria-label": "Call detail views"
|
|
254
|
-
}, _e = [
|
|
255
|
-
"id",
|
|
256
|
-
"aria-selected",
|
|
257
|
-
"onClick"
|
|
258
|
-
], ve = ["aria-labelledby"], ye = /*#__PURE__*/ n(/* @__PURE__ */ m({
|
|
259
|
-
__name: "CallDetail",
|
|
260
|
-
props: { call: {} },
|
|
261
|
-
emits: ["back"],
|
|
262
|
-
setup(e) {
|
|
263
|
-
let t = e, n = ["data", "headers"], r = _("data");
|
|
264
|
-
S(() => t.call.id, () => {
|
|
265
|
-
r.value = "data";
|
|
266
|
-
});
|
|
267
|
-
let i = _(null), f;
|
|
268
|
-
function p() {
|
|
269
|
-
i.value = "Copied", clearTimeout(f), f = setTimeout(() => {
|
|
270
|
-
i.value = null;
|
|
271
|
-
}, 2e3);
|
|
272
|
-
}
|
|
273
|
-
function m() {
|
|
274
|
-
a(H(t.call)), p();
|
|
275
|
-
}
|
|
276
|
-
function b() {
|
|
277
|
-
a(G(t.call)), p();
|
|
278
|
-
}
|
|
279
|
-
let x = s(() => t.call.headers?.["x-shop-country-id"]);
|
|
280
|
-
return (t, a) => (g(), u("div", fe, [
|
|
281
|
-
d("div", pe, [
|
|
282
|
-
d("button", {
|
|
283
|
-
class: "sf-dt-copy sf-dt-back",
|
|
284
|
-
onClick: a[0] ||= (e) => t.$emit("back")
|
|
285
|
-
}, " ← Back "),
|
|
286
|
-
d("button", {
|
|
287
|
-
class: "sf-dt-copy",
|
|
288
|
-
onClick: m
|
|
289
|
-
}, "Copy as curl"),
|
|
290
|
-
d("button", {
|
|
291
|
-
class: "sf-dt-copy",
|
|
292
|
-
onClick: b
|
|
293
|
-
}, "Copy as markdown"),
|
|
294
|
-
i.value ? (g(), u("span", me, y(i.value), 1)) : l("", !0)
|
|
295
|
-
]),
|
|
296
|
-
d("section", he, [d("dl", null, [
|
|
297
|
-
a[5] ||= d("dt", null, "Procedure", -1),
|
|
298
|
-
d("dd", null, y(e.call.procedure), 1),
|
|
299
|
-
a[6] ||= d("dt", null, "Method", -1),
|
|
300
|
-
d("dd", null, y(e.call.method), 1),
|
|
301
|
-
a[7] ||= d("dt", null, "URL", -1),
|
|
302
|
-
d("dd", null, y(e.call.url), 1),
|
|
303
|
-
e.call.status ? (g(), u(o, { key: 0 }, [a[1] ||= d("dt", null, "Status", -1), d("dd", null, y(e.call.status), 1)], 64)) : l("", !0),
|
|
304
|
-
e.call.duration == null ? l("", !0) : (g(), u(o, { key: 1 }, [a[2] ||= d("dt", null, "Duration", -1), d("dd", null, y(Math.round(e.call.duration)) + "ms", 1)], 64)),
|
|
305
|
-
e.call.errorKind ? (g(), u(o, { key: 2 }, [a[3] ||= d("dt", null, "Error", -1), d("dd", null, y(e.call.errorKind), 1)], 64)) : l("", !0),
|
|
306
|
-
x.value ? (g(), u(o, { key: 3 }, [a[4] ||= d("dt", null, "Shop country", -1), d("dd", null, y(x.value), 1)], 64)) : l("", !0)
|
|
307
|
-
])]),
|
|
308
|
-
a[8] ||= d("hr", { class: "sf-dt-meta-divider" }, null, -1),
|
|
309
|
-
d("nav", ge, [(g(), u(o, null, v(n, (e) => d("button", {
|
|
310
|
-
id: `sf-dt-subtab-${e}`,
|
|
311
|
-
key: e,
|
|
312
|
-
class: h(["sf-dt-subtab", { "is-active": r.value === e }]),
|
|
313
|
-
role: "tab",
|
|
314
|
-
"aria-selected": r.value === e,
|
|
315
|
-
"aria-controls": "sf-dt-subtabpanel",
|
|
316
|
-
onClick: (t) => r.value = e
|
|
317
|
-
}, y(e), 11, _e)), 64))]),
|
|
318
|
-
d("div", {
|
|
319
|
-
id: "sf-dt-subtabpanel",
|
|
320
|
-
class: "sf-dt-tabpanel",
|
|
321
|
-
role: "tabpanel",
|
|
322
|
-
"aria-labelledby": `sf-dt-subtab-${r.value}`
|
|
323
|
-
}, [r.value === "data" ? (g(), c(oe, {
|
|
324
|
-
key: 0,
|
|
325
|
-
call: e.call
|
|
326
|
-
}, null, 8, ["call"])) : (g(), c(de, {
|
|
327
|
-
key: 1,
|
|
328
|
-
call: e.call
|
|
329
|
-
}, null, 8, ["call"]))], 8, ve)
|
|
330
|
-
]));
|
|
331
|
-
}
|
|
332
|
-
}), [["__scopeId", "data-v-13e1a486"]]), be = { class: "sf-dt-stats" }, $ = { key: 0 }, xe = { class: "sf-dt-proc" }, Se = {
|
|
333
|
-
key: 1,
|
|
334
|
-
class: "sf-dt-empty"
|
|
335
|
-
}, Ce = /*#__PURE__*/ n(/* @__PURE__ */ m({
|
|
336
|
-
__name: "ProcedureStats",
|
|
337
|
-
props: { stats: {} },
|
|
338
|
-
setup(e) {
|
|
339
|
-
let t = e, n = _("count"), r = _(!0);
|
|
340
|
-
function i(e) {
|
|
341
|
-
n.value === e ? r.value = !r.value : (n.value = e, r.value = !0);
|
|
342
|
-
}
|
|
343
|
-
function a(e) {
|
|
344
|
-
return n.value === e ? r.value ? " ▾" : " ▴" : "";
|
|
345
|
-
}
|
|
346
|
-
let c = s(() => {
|
|
347
|
-
let e = r.value ? 1 : -1;
|
|
348
|
-
return [...t.stats].sort((t, r) => (r[n.value] - t[n.value]) * e);
|
|
349
|
-
});
|
|
350
|
-
return (e, t) => (g(), u("div", be, [c.value.length ? (g(), u("table", $, [d("thead", null, [d("tr", null, [
|
|
351
|
-
t[3] ||= d("th", null, "Procedure", -1),
|
|
352
|
-
d("th", {
|
|
353
|
-
class: h(["sf-dt-sortable", { "is-active": n.value === "count" }]),
|
|
354
|
-
onClick: t[0] ||= (e) => i("count")
|
|
355
|
-
}, " Count" + y(a("count")), 3),
|
|
356
|
-
d("th", {
|
|
357
|
-
class: h(["sf-dt-sortable", { "is-active": n.value === "errorCount" }]),
|
|
358
|
-
onClick: t[1] ||= (e) => i("errorCount")
|
|
359
|
-
}, " Errors" + y(a("errorCount")), 3),
|
|
360
|
-
d("th", {
|
|
361
|
-
class: h(["sf-dt-sortable", { "is-active": n.value === "avgDuration" }]),
|
|
362
|
-
onClick: t[2] ||= (e) => i("avgDuration")
|
|
363
|
-
}, " Avg" + y(a("avgDuration")), 3),
|
|
364
|
-
t[4] ||= d("th", null, "Last", -1)
|
|
365
|
-
])]), d("tbody", null, [(g(!0), u(o, null, v(c.value, (e) => (g(), u("tr", { key: e.procedure }, [
|
|
366
|
-
d("td", xe, y(e.procedure), 1),
|
|
367
|
-
d("td", null, y(e.count), 1),
|
|
368
|
-
d("td", { class: h({ "sf-dt-has-errors": e.errorCount > 0 }) }, y(e.errorCount), 3),
|
|
369
|
-
d("td", null, y(Math.round(e.avgDuration)) + "ms", 1),
|
|
370
|
-
d("td", null, y(Math.round(e.lastDuration)) + "ms", 1)
|
|
371
|
-
]))), 128))])])) : (g(), u("div", Se, "No oRPC calls captured yet"))]));
|
|
372
|
-
}
|
|
373
|
-
}), [["__scopeId", "data-v-37db1106"]]), we = { class: "sf-devtools" }, Te = {
|
|
374
|
-
class: "sf-dt-tabs",
|
|
375
|
-
role: "tablist",
|
|
376
|
-
"aria-label": "oRPC panel views"
|
|
377
|
-
}, Ee = ["aria-selected"], De = ["aria-selected"], Oe = ["aria-pressed"], ke = {
|
|
378
|
-
key: 1,
|
|
379
|
-
class: "sf-dt-empty"
|
|
380
|
-
}, Ae = {
|
|
381
|
-
key: 1,
|
|
382
|
-
id: "sf-dt-tabpanel-orpc",
|
|
383
|
-
class: "sf-dt-body",
|
|
384
|
-
role: "tabpanel",
|
|
385
|
-
"aria-labelledby": "sf-dt-tab-stats"
|
|
386
|
-
}, je = /* @__PURE__ */ m({
|
|
387
|
-
__name: "App",
|
|
388
|
-
setup(e) {
|
|
389
|
-
let t = w(), n = _("calls"), r = _(null), i = s(() => t.value?.calls ?? []), a = s(() => t.value?.paused ?? !1), o = s(() => i.value.find((e) => e.id === r.value) ?? null), l = s(() => T()?.getProcedureStats() ?? []);
|
|
390
|
-
function f() {
|
|
391
|
-
let e = T();
|
|
392
|
-
e && e.setPaused(!e.paused);
|
|
393
|
-
}
|
|
394
|
-
let m = b("callList");
|
|
395
|
-
function v() {
|
|
396
|
-
T()?.clear(), r.value = null, m.value?.focus();
|
|
397
|
-
}
|
|
398
|
-
function x() {
|
|
399
|
-
r.value = null;
|
|
400
|
-
}
|
|
401
|
-
return (e, t) => (g(), u("div", we, [d("nav", Te, [
|
|
402
|
-
d("button", {
|
|
403
|
-
id: "sf-dt-tab-calls",
|
|
404
|
-
class: h(["sf-dt-tab", { "is-active": n.value === "calls" }]),
|
|
405
|
-
role: "tab",
|
|
406
|
-
"aria-selected": n.value === "calls",
|
|
407
|
-
"aria-controls": "sf-dt-tabpanel-orpc",
|
|
408
|
-
onClick: t[0] ||= (e) => n.value = "calls"
|
|
409
|
-
}, " Calls ", 10, Ee),
|
|
410
|
-
d("button", {
|
|
411
|
-
id: "sf-dt-tab-stats",
|
|
412
|
-
class: h(["sf-dt-tab", { "is-active": n.value === "stats" }]),
|
|
413
|
-
role: "tab",
|
|
414
|
-
"aria-selected": n.value === "stats",
|
|
415
|
-
"aria-controls": "sf-dt-tabpanel-orpc",
|
|
416
|
-
onClick: t[1] ||= (e) => n.value = "stats"
|
|
417
|
-
}, " Stats ", 10, De),
|
|
418
|
-
d("button", {
|
|
419
|
-
class: "sf-dt-tab sf-dt-tabs-spacer",
|
|
420
|
-
"aria-pressed": a.value,
|
|
421
|
-
onClick: f
|
|
422
|
-
}, y(a.value ? "Resume" : "Pause"), 9, Oe),
|
|
423
|
-
d("button", {
|
|
424
|
-
class: "sf-dt-tab sf-dt-tabs-clear",
|
|
425
|
-
onClick: v
|
|
426
|
-
}, "Clear")
|
|
427
|
-
]), n.value === "calls" ? (g(), u("div", {
|
|
428
|
-
key: 0,
|
|
429
|
-
id: "sf-dt-tabpanel-orpc",
|
|
430
|
-
class: h(["sf-dt-body", { "has-selection": o.value }]),
|
|
431
|
-
role: "tabpanel",
|
|
432
|
-
"aria-labelledby": "sf-dt-tab-calls"
|
|
433
|
-
}, [p(B, {
|
|
434
|
-
ref_key: "callList",
|
|
435
|
-
ref: m,
|
|
436
|
-
calls: i.value,
|
|
437
|
-
"selected-id": r.value,
|
|
438
|
-
paused: a.value,
|
|
439
|
-
onSelect: t[2] ||= (e) => r.value = e
|
|
440
|
-
}, null, 8, [
|
|
441
|
-
"calls",
|
|
442
|
-
"selected-id",
|
|
443
|
-
"paused"
|
|
444
|
-
]), o.value ? (g(), c(ye, {
|
|
445
|
-
key: 0,
|
|
446
|
-
call: o.value,
|
|
447
|
-
onBack: x
|
|
448
|
-
}, null, 8, ["call"])) : (g(), u("div", ke, "Select a call to inspect it"))], 2)) : (g(), u("div", Ae, [p(Ce, { stats: l.value }, null, 8, ["stats"])]))]));
|
|
449
|
-
}
|
|
450
|
-
});
|
|
451
|
-
//#endregion
|
|
452
|
-
//#region src/orpc/panel/renderer.ts
|
|
453
|
-
function Me(e) {
|
|
454
|
-
t(e, je);
|
|
455
|
-
}
|
|
456
|
-
//#endregion
|
|
457
|
-
export { Me as default };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
//#region src/resource-center/client.ts
|
|
2
|
-
var e = "storefront-devtools-iframe-bg";
|
|
3
|
-
function t() {
|
|
4
|
-
let t = document.querySelector("vite-devtools-dock-embedded")?.shadowRoot;
|
|
5
|
-
if (!t) return !1;
|
|
6
|
-
if (!t.getElementById(e)) {
|
|
7
|
-
let n = document.createElement("style");
|
|
8
|
-
n.id = e, n.textContent = "iframe{background:#fff}", t.appendChild(n);
|
|
9
|
-
}
|
|
10
|
-
return !0;
|
|
11
|
-
}
|
|
12
|
-
if (typeof window < "u" && typeof document < "u" && !t()) {
|
|
13
|
-
let e = new MutationObserver(() => {
|
|
14
|
-
t() && e.disconnect();
|
|
15
|
-
});
|
|
16
|
-
e.observe(document.documentElement, {
|
|
17
|
-
childList: !0,
|
|
18
|
-
subtree: !0
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
//#endregion
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/resource-center/client.ts"],"names":[],"mappings":"AAUA,QAAA,MAAM,QAAQ,kCAAkC,CAAA;AAEhD,iBAAS,SAAS,IAAI,OAAO,CAY5B"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Plugin } from 'vite';
|
|
2
|
-
/**
|
|
3
|
-
* Creates the Vite plugin that registers the "Resource Center" dock entry: an
|
|
4
|
-
* iframe linking to the SCAYLE Storefront documentation, attached to the
|
|
5
|
-
* "SCAYLE Storefront" dock group via `groupId`. Its companion client script,
|
|
6
|
-
* which gives the iframe a white background, is injected into the host entry
|
|
7
|
-
* alongside the other panels' clients; see `src/index.ts`. The dock paints
|
|
8
|
-
* its iframe container transparent over the dark chrome and exposes no
|
|
9
|
-
* per-entry background option.
|
|
10
|
-
*/
|
|
11
|
-
export declare function createResourceCenterPlugin(): Plugin;
|
|
12
|
-
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/resource-center/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAWlC;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CAgBnD"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Ref } from 'vue';
|
|
2
|
-
/** A devtools capture store, as read off `window` by {@link useWindowStore}. */
|
|
3
|
-
export interface WindowStore<TState> {
|
|
4
|
-
getState: () => TState;
|
|
5
|
-
subscribe: (fn: (state: TState) => void) => () => void;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Resolves an in-page devtools store (set by an injected client on `window`)
|
|
9
|
-
* and mirrors its state into a reactive `shallowRef`. The custom-render panel
|
|
10
|
-
* runs in the same page context as the capture client, so it reads the store
|
|
11
|
-
* directly off `window` with no cross-frame crossing. Polls briefly when the
|
|
12
|
-
* panel opens before the first capture creates the store.
|
|
13
|
-
*
|
|
14
|
-
* @param readStore - Reads the store off `window`, or `undefined` if the client hasn't created it yet.
|
|
15
|
-
* @returns A reactive ref holding the latest state, or null until the store appears.
|
|
16
|
-
*/
|
|
17
|
-
export declare function useWindowStore<TState>(readStore: () => WindowStore<TState> | undefined): Ref<TState | null>;
|
|
18
|
-
//# sourceMappingURL=use-window-store.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-window-store.d.ts","sourceRoot":"","sources":["../../src/shared/use-window-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAG9B,gFAAgF;AAChF,MAAM,WAAW,WAAW,CAAC,MAAM;IACjC,QAAQ,EAAE,MAAM,MAAM,CAAA;IACtB,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,KAAK,MAAM,IAAI,CAAA;CACvD;AAKD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,MAAM,EACnC,SAAS,EAAE,MAAM,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,GAC/C,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,CAkCpB"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { DockClientScriptContext } from '@vitejs/devtools-kit/client'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Custom-render entry that mounts a devtools panel's Vue app into the dock
|
|
5
|
-
* panel DOM via `mountPanel` (see `src/shared/mount-panel.ts`). The Vite
|
|
6
|
-
* DevTools dock imports this by module specifier at runtime. This
|
|
7
|
-
* hand-authored declaration is the typed contract shared by the `./inertia/renderer`,
|
|
8
|
-
* `./orpc/renderer`, and `./storefront/renderer` exports. The Vue UI each
|
|
9
|
-
* renderer mounts has no emittable types and is excluded from declaration
|
|
10
|
-
* generation.
|
|
11
|
-
*
|
|
12
|
-
* @param ctx - The dock client-script context provided by the Vite DevTools dock.
|
|
13
|
-
*/
|
|
14
|
-
declare function setupRenderer(ctx: DockClientScriptContext): void
|
|
15
|
-
|
|
16
|
-
export default setupRenderer
|