@scayle/storefront-devtools 0.2.0-alpha.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/CHANGELOG.md +15 -0
- package/README.md +222 -0
- package/dist/_chunks/clipboard-DrVHc2QA.mjs +61 -0
- package/dist/_chunks/diff-DzJ5arJj.mjs +169 -0
- package/dist/_chunks/panel-uV5ITqhY.mjs +51 -0
- package/dist/_chunks/redact-DmIF-iyk.mjs +96 -0
- package/dist/_chunks/useStore-Db8RZW8T.mjs +10 -0
- package/dist/group.d.ts +42 -0
- package/dist/group.d.ts.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +178 -0
- package/dist/inertia/client/index.d.mts +13 -0
- package/dist/inertia/client/index.d.ts +7 -0
- package/dist/inertia/client/index.d.ts.map +1 -0
- package/dist/inertia/client/index.mjs +694 -0
- package/dist/inertia/core/capture.d.ts +15 -0
- package/dist/inertia/core/capture.d.ts.map +1 -0
- package/dist/inertia/core/correlator.d.ts +91 -0
- package/dist/inertia/core/correlator.d.ts.map +1 -0
- package/dist/inertia/core/diagnostics.d.ts +10 -0
- package/dist/inertia/core/diagnostics.d.ts.map +1 -0
- package/dist/inertia/core/diff.d.ts +33 -0
- package/dist/inertia/core/diff.d.ts.map +1 -0
- package/dist/inertia/core/events-tab.d.ts +20 -0
- package/dist/inertia/core/events-tab.d.ts.map +1 -0
- package/dist/inertia/core/feature-info.d.ts +14 -0
- package/dist/inertia/core/feature-info.d.ts.map +1 -0
- package/dist/inertia/core/features.d.ts +27 -0
- package/dist/inertia/core/features.d.ts.map +1 -0
- package/dist/inertia/core/history-capture.d.ts +15 -0
- package/dist/inertia/core/history-capture.d.ts.map +1 -0
- package/dist/inertia/core/interceptors.d.ts +69 -0
- package/dist/inertia/core/interceptors.d.ts.map +1 -0
- package/dist/inertia/core/markdown.d.ts +10 -0
- package/dist/inertia/core/markdown.d.ts.map +1 -0
- package/dist/inertia/core/network.d.ts +34 -0
- package/dist/inertia/core/network.d.ts.map +1 -0
- package/dist/inertia/core/protocol.d.ts +38 -0
- package/dist/inertia/core/protocol.d.ts.map +1 -0
- package/dist/inertia/core/request-tree.d.ts +18 -0
- package/dist/inertia/core/request-tree.d.ts.map +1 -0
- package/dist/inertia/core/response.d.ts +39 -0
- package/dist/inertia/core/response.d.ts.map +1 -0
- package/dist/inertia/core/session.d.ts +18 -0
- package/dist/inertia/core/session.d.ts.map +1 -0
- package/dist/inertia/core/store.d.ts +40 -0
- package/dist/inertia/core/store.d.ts.map +1 -0
- package/dist/inertia/core/types.d.ts +112 -0
- package/dist/inertia/core/types.d.ts.map +1 -0
- package/dist/inertia/core/url.d.ts +11 -0
- package/dist/inertia/core/url.d.ts.map +1 -0
- package/dist/inertia/plugin.d.ts +11 -0
- package/dist/inertia/plugin.d.ts.map +1 -0
- package/dist/inertia/renderer/index.d.mts +16 -0
- package/dist/inertia/renderer/index.mjs +771 -0
- package/dist/inject.d.ts +12 -0
- package/dist/inject.d.ts.map +1 -0
- package/dist/orpc/client/index.d.mts +13 -0
- package/dist/orpc/client/index.d.ts +7 -0
- package/dist/orpc/client/index.d.ts.map +1 -0
- package/dist/orpc/client/index.mjs +502 -0
- package/dist/orpc/core/capture.d.ts +32 -0
- package/dist/orpc/core/capture.d.ts.map +1 -0
- package/dist/orpc/core/classify.d.ts +14 -0
- package/dist/orpc/core/classify.d.ts.map +1 -0
- package/dist/orpc/core/curl.d.ts +11 -0
- package/dist/orpc/core/curl.d.ts.map +1 -0
- package/dist/orpc/core/markdown.d.ts +12 -0
- package/dist/orpc/core/markdown.d.ts.map +1 -0
- package/dist/orpc/core/orpc-error.d.ts +18 -0
- package/dist/orpc/core/orpc-error.d.ts.map +1 -0
- package/dist/orpc/core/serialize.d.ts +12 -0
- package/dist/orpc/core/serialize.d.ts.map +1 -0
- package/dist/orpc/core/session.d.ts +15 -0
- package/dist/orpc/core/session.d.ts.map +1 -0
- package/dist/orpc/core/store.d.ts +50 -0
- package/dist/orpc/core/store.d.ts.map +1 -0
- package/dist/orpc/core/types.d.ts +67 -0
- package/dist/orpc/core/types.d.ts.map +1 -0
- package/dist/orpc/core/url.d.ts +12 -0
- package/dist/orpc/core/url.d.ts.map +1 -0
- package/dist/orpc/plugin.d.ts +10 -0
- package/dist/orpc/plugin.d.ts.map +1 -0
- package/dist/orpc/renderer/index.d.mts +16 -0
- package/dist/orpc/renderer/index.mjs +457 -0
- package/dist/resource-center/client/index.mjs +21 -0
- package/dist/resource-center/client.d.ts +3 -0
- package/dist/resource-center/client.d.ts.map +1 -0
- package/dist/resource-center/plugin.d.ts +12 -0
- package/dist/resource-center/plugin.d.ts.map +1 -0
- package/dist/shared/clipboard.d.ts +9 -0
- package/dist/shared/clipboard.d.ts.map +1 -0
- package/dist/shared/redact.d.ts +27 -0
- package/dist/shared/redact.d.ts.map +1 -0
- package/dist/shared/safe-clone.d.ts +46 -0
- package/dist/shared/safe-clone.d.ts.map +1 -0
- package/dist/shared/session-storage.d.ts +18 -0
- package/dist/shared/session-storage.d.ts.map +1 -0
- package/dist/shared/use-window-store.d.ts +18 -0
- package/dist/shared/use-window-store.d.ts.map +1 -0
- package/dist/storefront/plugin.d.ts +9 -0
- package/dist/storefront/plugin.d.ts.map +1 -0
- package/dist/storefront/renderer/index.d.mts +16 -0
- package/dist/storefront/renderer/index.mjs +124 -0
- package/dist/vue-devtools/client/index.mjs +4912 -0
- package/dist/vue-devtools/client.d.ts +2 -0
- package/dist/vue-devtools/client.d.ts.map +1 -0
- package/dist/vue-devtools/plugin.d.ts +14 -0
- package/dist/vue-devtools/plugin.d.ts.map +1 -0
- package/dist/vue-devtools/ui/assets/css-8QJvnqUH.js +1 -0
- package/dist/vue-devtools/ui/assets/css-CaJ9TzKE.js +1 -0
- package/dist/vue-devtools/ui/assets/diff-woXpYk--.js +1 -0
- package/dist/vue-devtools/ui/assets/html-BHDw6EPc.js +1 -0
- package/dist/vue-devtools/ui/assets/html-GueGcY0x.js +1 -0
- package/dist/vue-devtools/ui/assets/index-Dby9TIQH.js +156 -0
- package/dist/vue-devtools/ui/assets/index-sSkqWPzY.css +1 -0
- package/dist/vue-devtools/ui/assets/javascript-BzbQS41l.js +1 -0
- package/dist/vue-devtools/ui/assets/javascript-Yelw-5ZN.js +1 -0
- package/dist/vue-devtools/ui/assets/json-B88Oqtu5.js +1 -0
- package/dist/vue-devtools/ui/assets/json-CaljABEy.js +1 -0
- package/dist/vue-devtools/ui/assets/shellscript-CLZ0U2zV.js +1 -0
- package/dist/vue-devtools/ui/assets/typescript-Utq2Cl8c.js +1 -0
- package/dist/vue-devtools/ui/assets/typescript-j_1H8WHN.js +1 -0
- package/dist/vue-devtools/ui/assets/vitesse-dark-BZCL-v6S.js +1 -0
- package/dist/vue-devtools/ui/assets/vitesse-light-VbXTXTou.js +1 -0
- package/dist/vue-devtools/ui/assets/vue-B1Tf5CHw.js +1 -0
- package/dist/vue-devtools/ui/assets/vue-html-CGMs_6qn.js +1 -0
- package/dist/vue-devtools/ui/assets/yaml-rwi0_p6S.js +1 -0
- package/dist/vue-devtools/ui/index.html +13 -0
- package/package.json +101 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { OrpcCall, OrpcErrorKind, OrpcState, ProcedureStat, OrpcCallSummary } from './types';
|
|
2
|
+
type Subscriber = (state: OrpcState) => void;
|
|
3
|
+
interface StartInit {
|
|
4
|
+
procedure: string;
|
|
5
|
+
method: string;
|
|
6
|
+
url: string;
|
|
7
|
+
input?: unknown;
|
|
8
|
+
rawInput?: unknown;
|
|
9
|
+
headers?: Record<string, string>;
|
|
10
|
+
}
|
|
11
|
+
interface FinishResult {
|
|
12
|
+
status?: number;
|
|
13
|
+
ok?: boolean;
|
|
14
|
+
output?: unknown;
|
|
15
|
+
error?: unknown;
|
|
16
|
+
errorKind?: OrpcErrorKind;
|
|
17
|
+
streaming?: boolean;
|
|
18
|
+
rawOutput?: unknown;
|
|
19
|
+
rawError?: unknown;
|
|
20
|
+
responseHeaders?: Record<string, string>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Central state store for the oRPC devtools panel. Records one `OrpcCall` per
|
|
24
|
+
* captured request, exposes a framework-agnostic `subscribe()` pattern, and
|
|
25
|
+
* persists a compact previous-session summary to sessionStorage.
|
|
26
|
+
*/
|
|
27
|
+
export declare class OrpcStore {
|
|
28
|
+
private ordered;
|
|
29
|
+
private maxCalls;
|
|
30
|
+
private nextId;
|
|
31
|
+
private _paused;
|
|
32
|
+
private subscribers;
|
|
33
|
+
private previousSession;
|
|
34
|
+
private saveTimer;
|
|
35
|
+
constructor(maxCalls?: number);
|
|
36
|
+
get calls(): OrpcCall[];
|
|
37
|
+
get paused(): boolean;
|
|
38
|
+
get previousSessionCalls(): OrpcCallSummary[];
|
|
39
|
+
getState(): OrpcState;
|
|
40
|
+
startCall(init: StartInit): number;
|
|
41
|
+
finishCall(id: number, result: FinishResult): void;
|
|
42
|
+
getProcedureStats(): ProcedureStat[];
|
|
43
|
+
subscribe(fn: Subscriber): () => void;
|
|
44
|
+
setPaused(value: boolean): void;
|
|
45
|
+
clear(): void;
|
|
46
|
+
private evictOldest;
|
|
47
|
+
private notify;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/orpc/core/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EACb,SAAS,EACT,aAAa,EACb,eAAe,EAChB,MAAM,SAAS,CAAA;AA0BhB,KAAK,UAAU,GAAG,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAA;AAE5C,UAAU,SAAS;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC;AAED,UAAU,YAAY;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,SAAS,CAAC,EAAE,aAAa,CAAA;IACzB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACzC;AAED;;;;GAIG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,MAAM,CAAI;IAClB,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,WAAW,CAA6B;IAChD,OAAO,CAAC,eAAe,CAAuC;IAC9D,OAAO,CAAC,SAAS,CAA2C;gBAEhD,QAAQ,GAAE,MAAkB;IAKxC,IAAI,KAAK,IAAI,QAAQ,EAAE,CAOtB;IAED,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,IAAI,oBAAoB,IAAI,eAAe,EAAE,CAE5C;IAED,QAAQ,IAAI,SAAS;IAOrB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM;IAuBlC,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI;IAmBlD,iBAAiB,IAAI,aAAa,EAAE;IA2CpC,SAAS,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM,IAAI;IAOrC,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAK/B,KAAK,IAAI,IAAI;IAQb,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,MAAM;CAYf"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/** Classifies an oRPC failure by where it originated. */
|
|
2
|
+
export type OrpcErrorKind = 'validation' | 'server' | 'network';
|
|
3
|
+
/** A single captured oRPC call. */
|
|
4
|
+
export interface OrpcCall {
|
|
5
|
+
id: number;
|
|
6
|
+
/** Procedure path, for example `basket/add`. */
|
|
7
|
+
procedure: string;
|
|
8
|
+
method: string;
|
|
9
|
+
url: string;
|
|
10
|
+
status?: number;
|
|
11
|
+
ok?: boolean;
|
|
12
|
+
/** `performance.now()` at request start. */
|
|
13
|
+
startedAt: number;
|
|
14
|
+
finishedAt?: number;
|
|
15
|
+
duration?: number;
|
|
16
|
+
/** Parsed, safe-cloned request body. */
|
|
17
|
+
input?: unknown;
|
|
18
|
+
/** Parsed, safe-cloned success response body. */
|
|
19
|
+
output?: unknown;
|
|
20
|
+
/** Parsed ORPCError body or the thrown error. */
|
|
21
|
+
error?: unknown;
|
|
22
|
+
errorKind?: OrpcErrorKind;
|
|
23
|
+
/** True for an SSE/event-iterator response whose body is not buffered. */
|
|
24
|
+
streaming?: boolean;
|
|
25
|
+
/** Lowercased request headers (for example `x-shop-country-id`). */
|
|
26
|
+
headers?: Record<string, string>;
|
|
27
|
+
/** Raw `{ json, meta }` request envelope, before structured-type decoding. */
|
|
28
|
+
rawInput?: unknown;
|
|
29
|
+
/** Raw `{ json, meta }` success response envelope, before decoding. */
|
|
30
|
+
rawOutput?: unknown;
|
|
31
|
+
/** Raw `{ json, meta }` error envelope, before decoding. */
|
|
32
|
+
rawError?: unknown;
|
|
33
|
+
/** Allowlisted cache-relevant response headers (for example `x-cache`). */
|
|
34
|
+
responseHeaders?: Record<string, string>;
|
|
35
|
+
}
|
|
36
|
+
/** Snapshot of oRPC capture state exposed to subscribers. */
|
|
37
|
+
export interface OrpcState {
|
|
38
|
+
/** A fresh array on every update, so Vue `computed` dependents re-run. */
|
|
39
|
+
calls: OrpcCall[];
|
|
40
|
+
paused: boolean;
|
|
41
|
+
}
|
|
42
|
+
/** Aggregated timing for one procedure across captured calls. */
|
|
43
|
+
export interface ProcedureStat {
|
|
44
|
+
procedure: string;
|
|
45
|
+
count: number;
|
|
46
|
+
/** Number of completed calls that failed (`ok === false`). */
|
|
47
|
+
errorCount: number;
|
|
48
|
+
/** Mean duration in ms over calls that completed with a duration. */
|
|
49
|
+
avgDuration: number;
|
|
50
|
+
/** Duration in ms of the most recent completed call. */
|
|
51
|
+
lastDuration: number;
|
|
52
|
+
}
|
|
53
|
+
/** Compact call summary persisted to sessionStorage. */
|
|
54
|
+
export interface OrpcCallSummary {
|
|
55
|
+
id: number;
|
|
56
|
+
procedure: string;
|
|
57
|
+
method: string;
|
|
58
|
+
status?: number;
|
|
59
|
+
duration?: number;
|
|
60
|
+
errorKind?: OrpcErrorKind;
|
|
61
|
+
}
|
|
62
|
+
/** Persisted snapshot of a previous capture session. */
|
|
63
|
+
export interface OrpcSnapshot {
|
|
64
|
+
savedAt: number;
|
|
65
|
+
calls: OrpcCallSummary[];
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/orpc/core/types.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,QAAQ,GAAG,SAAS,CAAA;AAE/D,mCAAmC;AACnC,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,wCAAwC;IACxC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,iDAAiD;IACjD,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,iDAAiD;IACjD,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,SAAS,CAAC,EAAE,aAAa,CAAA;IACzB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,uEAAuE;IACvE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,2EAA2E;IAC3E,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACzC;AAED,6DAA6D;AAC7D,MAAM,WAAW,SAAS;IACxB,0EAA0E;IAC1E,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB,MAAM,EAAE,OAAO,CAAA;CAChB;AAED,iEAAiE;AACjE,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAA;IAClB,qEAAqE;IACrE,WAAW,EAAE,MAAM,CAAA;IACnB,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,wDAAwD;AACxD,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,aAAa,CAAA;CAC1B;AAED,wDAAwD;AACxD,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,eAAe,EAAE,CAAA;CACzB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extracts the oRPC procedure path from a request URL, relative to the API
|
|
3
|
+
* prefix. Used both to decide whether a request is an oRPC call and to label it
|
|
4
|
+
* by its procedure (for example `basket/add`).
|
|
5
|
+
*
|
|
6
|
+
* @param url - Absolute or relative request URL.
|
|
7
|
+
* @param prefix - The oRPC endpoint prefix, for example `/api`.
|
|
8
|
+
* @returns The path after the prefix with surrounding slashes stripped, or
|
|
9
|
+
* `null` when the request path does not start with the prefix.
|
|
10
|
+
*/
|
|
11
|
+
export declare function procedureFromUrl(url: string, prefix: string): string | null;
|
|
12
|
+
//# sourceMappingURL=url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/orpc/core/url.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAc3E"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
/**
|
|
3
|
+
* Creates the Vite plugin that registers the oRPC devtools panel: a
|
|
4
|
+
* custom-render dock entry whose renderer mounts the Vue panel directly into
|
|
5
|
+
* the dock panel DOM, reading the capture store off `window`. The capture
|
|
6
|
+
* client (a `window.fetch` patch) is injected into the app entry alongside the
|
|
7
|
+
* other panels' clients; see `src/index.ts`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createOrpcPlugin(): Plugin;
|
|
10
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/orpc/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AASlC;;;;;;GAMG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAOzC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
|
@@ -0,0 +1,457 @@
|
|
|
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 };
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|