@visulima/ono 2.0.0-alpha.3 → 2.0.0-alpha.31

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +233 -0
  2. package/LICENSE.md +1 -1
  3. package/dist/error-inspector/page/create-request-context.d.ts +41 -3
  4. package/dist/error-inspector/page/create-request-context.js +48 -48
  5. package/dist/index.d.ts +34 -18
  6. package/dist/index.js +238 -186
  7. package/dist/packem_chunks/min-dark.js +1 -0
  8. package/dist/packem_chunks/min-light.js +1 -0
  9. package/dist/packem_shared/clipboard-DbMCKslu.js +1 -0
  10. package/dist/packem_shared/process-BO_aZsiL.js +1 -0
  11. package/dist/packem_shared/types.d-CDlBu_Vx.d.ts +50 -0
  12. package/dist/server/open-in-editor.d.ts +22 -22
  13. package/dist/server/open-in-editor.js +1 -1
  14. package/package.json +70 -70
  15. package/dist/error-inspector/components/causes-viewer/index.d.ts +0 -7
  16. package/dist/error-inspector/components/copy-button.d.ts +0 -8
  17. package/dist/error-inspector/components/copy-dropdown.d.ts +0 -10
  18. package/dist/error-inspector/components/error-card/index.d.ts +0 -13
  19. package/dist/error-inspector/components/error-card/solutions.d.ts +0 -7
  20. package/dist/error-inspector/components/error-card/sticky-header.d.ts +0 -5
  21. package/dist/error-inspector/components/header-bar/editor-selector.d.ts +0 -3
  22. package/dist/error-inspector/components/header-bar/index.d.ts +0 -11
  23. package/dist/error-inspector/components/header-bar/theme-toggle.d.ts +0 -6
  24. package/dist/error-inspector/components/header-tabs.d.ts +0 -10
  25. package/dist/error-inspector/components/raw-stack-trace.d.ts +0 -2
  26. package/dist/error-inspector/components/shortcuts-button.d.ts +0 -5
  27. package/dist/error-inspector/components/stack-trace-viewer/index.d.ts +0 -7
  28. package/dist/error-inspector/components/stack-trace-viewer/types.d.ts +0 -5
  29. package/dist/error-inspector/components/stack-trace-viewer/utils/get-type.d.ts +0 -3
  30. package/dist/error-inspector/components/stack-trace-viewer/utils/group-similar-types.d.ts +0 -4
  31. package/dist/error-inspector/components/tooltip.d.ts +0 -4
  32. package/dist/error-inspector/index.d.ts +0 -6
  33. package/dist/error-inspector/layout.d.ts +0 -12
  34. package/dist/error-inspector/page/stack.d.ts +0 -15
  35. package/dist/error-inspector/page/types.d.ts +0 -62
  36. package/dist/error-inspector/types.d.ts +0 -43
  37. package/dist/error-inspector/utils/cn.d.ts +0 -2
  38. package/dist/error-inspector/utils/sanitize.d.ts +0 -7
  39. package/dist/packem_chunks/github-dark-default.js +0 -1
  40. package/dist/packem_chunks/github-light.js +0 -1
  41. package/dist/packem_shared/clipboard-BS03XwiW.js +0 -1
  42. package/dist/packem_shared/process-B37didfB.js +0 -1
  43. package/dist/types.d.ts +0 -1
  44. package/dist/utils/process.d.ts +0 -7
  45. package/dist/utils/revision-hash.d.ts +0 -2
  46. package/dist/utils/runtimes.d.ts +0 -3
package/CHANGELOG.md CHANGED
@@ -1,3 +1,236 @@
1
+ ## @visulima/ono [2.0.0-alpha.31](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.30...@visulima/ono@2.0.0-alpha.31) (2026-05-26)
2
+
3
+
4
+ ### Dependencies
5
+
6
+ * **@visulima/error:** upgraded to 6.0.0-alpha.28
7
+
8
+ ## @visulima/ono [2.0.0-alpha.30](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.29...@visulima/ono@2.0.0-alpha.30) (2026-05-20)
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * **@visulima/error:** upgraded to 6.0.0-alpha.27
14
+
15
+ ## @visulima/ono [2.0.0-alpha.29](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.28...@visulima/ono@2.0.0-alpha.29) (2026-05-19)
16
+
17
+
18
+ ### Dependencies
19
+
20
+ * **@visulima/error:** upgraded to 6.0.0-alpha.26
21
+
22
+ ## @visulima/ono [2.0.0-alpha.28](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.27...@visulima/ono@2.0.0-alpha.28) (2026-05-16)
23
+
24
+
25
+ ### Dependencies
26
+
27
+ * **@visulima/error:** upgraded to 6.0.0-alpha.25
28
+
29
+ ## @visulima/ono [2.0.0-alpha.27](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.26...@visulima/ono@2.0.0-alpha.27) (2026-05-14)
30
+
31
+
32
+ ### Dependencies
33
+
34
+ * **@visulima/error:** upgraded to 6.0.0-alpha.24
35
+
36
+ ## @visulima/ono [2.0.0-alpha.26](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.25...@visulima/ono@2.0.0-alpha.26) (2026-05-11)
37
+
38
+
39
+ ### Dependencies
40
+
41
+ * **@visulima/error:** upgraded to 6.0.0-alpha.23
42
+
43
+ ## @visulima/ono [2.0.0-alpha.25](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.24...@visulima/ono@2.0.0-alpha.25) (2026-05-11)
44
+
45
+
46
+ ### Dependencies
47
+
48
+ * **@visulima/error:** upgraded to 6.0.0-alpha.22
49
+
50
+ ## @visulima/ono [2.0.0-alpha.24](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.23...@visulima/ono@2.0.0-alpha.24) (2026-05-10)
51
+
52
+
53
+ ### Dependencies
54
+
55
+ * **@visulima/error:** upgraded to 6.0.0-alpha.21
56
+
57
+ ## @visulima/ono [2.0.0-alpha.23](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.22...@visulima/ono@2.0.0-alpha.23) (2026-05-10)
58
+
59
+
60
+ ### Dependencies
61
+
62
+ * **@visulima/error:** upgraded to 6.0.0-alpha.20
63
+
64
+ ## @visulima/ono [2.0.0-alpha.22](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.21...@visulima/ono@2.0.0-alpha.22) (2026-05-07)
65
+
66
+
67
+ ### Dependencies
68
+
69
+ * **@visulima/error:** upgraded to 6.0.0-alpha.19
70
+
71
+ ## @visulima/ono [2.0.0-alpha.21](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.20...@visulima/ono@2.0.0-alpha.21) (2026-05-07)
72
+
73
+
74
+ ### Dependencies
75
+
76
+ * **@visulima/error:** upgraded to 6.0.0-alpha.18
77
+
78
+ ## @visulima/ono [2.0.0-alpha.20](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.19...@visulima/ono@2.0.0-alpha.20) (2026-05-06)
79
+
80
+
81
+ ### Dependencies
82
+
83
+ * **@visulima/error:** upgraded to 6.0.0-alpha.17
84
+
85
+ ## @visulima/ono [2.0.0-alpha.19](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.18...@visulima/ono@2.0.0-alpha.19) (2026-05-06)
86
+
87
+ ### Bug Fixes
88
+
89
+ * **ono:** collapse stringifiedBody to a single toString() call ([1847db9](https://github.com/visulima/visulima/commit/1847db944e78349f932bb6dc51e3247c5a71b01e))
90
+
91
+
92
+ ### Dependencies
93
+
94
+ * **@visulima/error:** upgraded to 6.0.0-alpha.16
95
+
96
+ ## @visulima/ono [2.0.0-alpha.18](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.17...@visulima/ono@2.0.0-alpha.18) (2026-05-04)
97
+
98
+
99
+ ### Dependencies
100
+
101
+ * **@visulima/error:** upgraded to 6.0.0-alpha.15
102
+
103
+ ## @visulima/ono [2.0.0-alpha.17](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.16...@visulima/ono@2.0.0-alpha.17) (2026-04-30)
104
+
105
+
106
+ ### Dependencies
107
+
108
+ * **@visulima/error:** upgraded to 6.0.0-alpha.14
109
+
110
+ ## @visulima/ono [2.0.0-alpha.16](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.15...@visulima/ono@2.0.0-alpha.16) (2026-04-28)
111
+
112
+ ## @visulima/ono [2.0.0-alpha.15](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.14...@visulima/ono@2.0.0-alpha.15) (2026-04-22)
113
+
114
+ ### Bug Fixes
115
+
116
+ * Remove JSR configuration generation script and generated jsr.json files ([#616](https://github.com/visulima/visulima/issues/616)) ([533744b](https://github.com/visulima/visulima/commit/533744b103b74896941db5b727173e617a27a63b))
117
+
118
+
119
+ ### Dependencies
120
+
121
+ * **@visulima/error:** upgraded to 6.0.0-alpha.13
122
+ * **@visulima/path:** upgraded to 3.0.0-alpha.10
123
+
124
+ ## @visulima/ono [2.0.0-alpha.14](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.13...@visulima/ono@2.0.0-alpha.14) (2026-04-21)
125
+
126
+
127
+ ### Dependencies
128
+
129
+ * **@visulima/error:** upgraded to 6.0.0-alpha.12
130
+
131
+ ## @visulima/ono [2.0.0-alpha.13](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.12...@visulima/ono@2.0.0-alpha.13) (2026-04-21)
132
+
133
+
134
+ ### Dependencies
135
+
136
+ * **@visulima/error:** upgraded to 6.0.0-alpha.11
137
+
138
+ ## @visulima/ono [2.0.0-alpha.12](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.11...@visulima/ono@2.0.0-alpha.12) (2026-04-21)
139
+
140
+
141
+ ### Dependencies
142
+
143
+ * **@visulima/error:** upgraded to 6.0.0-alpha.10
144
+
145
+ ## @visulima/ono [2.0.0-alpha.11](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.10...@visulima/ono@2.0.0-alpha.11) (2026-04-15)
146
+
147
+ ### Bug Fixes
148
+
149
+ * **error-debugging:** resolve eslint and type-safety issues ([886dbff](https://github.com/visulima/visulima/commit/886dbffe3f744c9493fcc54e781de3fd21eebf78))
150
+ * **ono:** resolve eslint and formatting issues ([3113c1f](https://github.com/visulima/visulima/commit/3113c1fbd668a0f99016f8f590977b033d19aa96))
151
+
152
+
153
+ ### Dependencies
154
+
155
+ * **@visulima/error:** upgraded to 6.0.0-alpha.9
156
+ * **@visulima/path:** upgraded to 3.0.0-alpha.9
157
+
158
+ ## @visulima/ono [2.0.0-alpha.10](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.9...@visulima/ono@2.0.0-alpha.10) (2026-04-09)
159
+
160
+ ## @visulima/ono [2.0.0-alpha.9](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.8...@visulima/ono@2.0.0-alpha.9) (2026-04-08)
161
+
162
+ ### Bug Fixes
163
+
164
+ * **ono:** properly fix eslint errors in code ([ca1d1a2](https://github.com/visulima/visulima/commit/ca1d1a2aa4d4db69f2f38d2b85d8df5e32b906fb))
165
+ * **ono:** remove remaining eslint suppressions with proper code fixes ([ab20811](https://github.com/visulima/visulima/commit/ab20811c01df07a836303c4b4a478de79d1d338c))
166
+ * **ono:** resolve eslint errors ([4d8e045](https://github.com/visulima/visulima/commit/4d8e0455f2420bef082e3aa3f00e76461e8c17c8))
167
+ * **ono:** use min-dark/min-light shiki themes for code highlighting ([793a345](https://github.com/visulima/visulima/commit/793a345bbb9dc6520ce8d37a3488a83b1cbe8ce2))
168
+ * remove deprecated baseUrl and downlevelIteration from tsconfigs ([a708366](https://github.com/visulima/visulima/commit/a708366b5c3bc73cfde480a712ed397bd921fb93))
169
+
170
+
171
+ ### Dependencies
172
+
173
+ * **@visulima/error:** upgraded to 6.0.0-alpha.8
174
+ * **@visulima/path:** upgraded to 3.0.0-alpha.8
175
+
176
+ ## @visulima/ono [2.0.0-alpha.8](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.7...@visulima/ono@2.0.0-alpha.8) (2026-03-26)
177
+
178
+ ### Features
179
+
180
+ * **web:** auto-generate packages page from workspace metadata ([623e520](https://github.com/visulima/visulima/commit/623e5207693a7fe720f5f2f179593a3654c880e3))
181
+
182
+
183
+ ### Dependencies
184
+
185
+ * **@visulima/error:** upgraded to 6.0.0-alpha.7
186
+ * **@visulima/path:** upgraded to 3.0.0-alpha.7
187
+
188
+ ## @visulima/ono [2.0.0-alpha.7](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.6...@visulima/ono@2.0.0-alpha.7) (2026-03-26)
189
+
190
+ ### Bug Fixes
191
+
192
+ * **ono:** use workspace:* for internal [@visulima](https://github.com/visulima) deps ([2e4ff1a](https://github.com/visulima/visulima/commit/2e4ff1a1ae8f849f9fb4cf26e7b58446bb47c1f1))
193
+ * **web:** improve build setup with incremental stats caching and prod install ([fe33e75](https://github.com/visulima/visulima/commit/fe33e75827586779b4b3a0c6d57b39f889ee6207))
194
+
195
+
196
+ ### Dependencies
197
+
198
+ * **@visulima/error:** upgraded to 6.0.0-alpha.6
199
+ * **@visulima/path:** upgraded to 3.0.0-alpha.6
200
+
201
+ ## @visulima/ono [2.0.0-alpha.6](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.5...@visulima/ono@2.0.0-alpha.6) (2026-03-06)
202
+
203
+ ### Bug Fixes
204
+
205
+ * **ono:** update packem to 2.0.0-alpha.54 ([e3bf220](https://github.com/visulima/visulima/commit/e3bf220c8813bb04a1d5061c62e1897010f5340b))
206
+
207
+
208
+ ### Dependencies
209
+
210
+ * **@visulima/error:** upgraded to 6.0.0-alpha.5
211
+ * **@visulima/path:** upgraded to 3.0.0-alpha.5
212
+
213
+ ## @visulima/ono [2.0.0-alpha.5](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.4...@visulima/ono@2.0.0-alpha.5) (2026-01-17)
214
+
215
+
216
+ ### Dependencies
217
+
218
+ * **@visulima/error:** upgraded to 6.0.0-alpha.4
219
+
220
+ ## @visulima/ono [2.0.0-alpha.4](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.3...@visulima/ono@2.0.0-alpha.4) (2025-12-27)
221
+
222
+ ### Bug Fixes
223
+
224
+ * **dependencies:** update hono and isomorphic-dompurify to versions 4.11.3 and 2.35.0 in package.json files ([0169fa9](https://github.com/visulima/visulima/commit/0169fa94d187c5e6a22e2ed48353124953996aee))
225
+ * **dependencies:** update hono and related packages to version 4.11.2 and update @hono/swagger-ui to version 0.5.3 ([5d3eed5](https://github.com/visulima/visulima/commit/5d3eed57d30d8216bf91484f35d39678938651fb))
226
+ * **ono:** update package files ([2e8a1dd](https://github.com/visulima/visulima/commit/2e8a1dd987c061f57e9e60c64a40245c499f8c98))
227
+
228
+
229
+ ### Dependencies
230
+
231
+ * **@visulima/error:** upgraded to 6.0.0-alpha.3
232
+ * **@visulima/path:** upgraded to 3.0.0-alpha.4
233
+
1
234
  ## @visulima/ono [2.0.0-alpha.3](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.2...@visulima/ono@2.0.0-alpha.3) (2025-12-11)
2
235
 
3
236
  ### Bug Fixes
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 visulima
3
+ Copyright (c) 2026 visulima
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,4 +1,42 @@
1
- import type { ContentPage } from "../types.d.ts";
2
- import type { ContextContentOptions, RequestLike } from "./types.d.ts";
1
+ import { C as ContentPage } from "../../packem_shared/types.d-CDlBu_Vx.js";
2
+ import { IncomingMessage } from 'node:http';
3
+ type NativeRequest = typeof globalThis.Request;
4
+ type NativeHeaders = typeof globalThis.Headers;
5
+ interface CustomHeaders {
6
+ entries: () => IterableIterator<[string, string]>;
7
+ forEach: (callback: (value: string, key: string) => void) => void;
8
+ get: (name: string) => string | null;
9
+ }
10
+ interface CustomRequest {
11
+ clone?: () => CustomRequest;
12
+ headers?: Record<string, string | string[]> | CustomHeaders;
13
+ json?: () => Promise<unknown>;
14
+ method?: string;
15
+ text?: () => Promise<string>;
16
+ url?: string;
17
+ }
18
+ type HeadersLike = NativeHeaders | CustomHeaders;
19
+ type RequestLike = NativeRequest | (IncomingMessage & {
20
+ body?: unknown;
21
+ clone?: () => RequestLike;
22
+ json?: () => Promise<unknown>;
23
+ text?: () => Promise<string>;
24
+ }) | CustomRequest | {
25
+ body?: unknown;
26
+ headers?: Record<string, string | string[]> | HeadersLike;
27
+ method?: string;
28
+ off?: (event: string, handler: (chunk: unknown) => void) => void;
29
+ on?: (event: string, handler: (chunk: unknown) => void) => void;
30
+ setEncoding?: (encoding: string) => void;
31
+ url?: string;
32
+ };
33
+ type ContextContentOptions = {
34
+ context?: Record<string, unknown>;
35
+ headerAllowlist?: string[];
36
+ headerDenylist?: string[];
37
+ maskValue?: string;
38
+ previewBytes?: number;
39
+ totalCapBytes?: number;
40
+ };
3
41
  declare const createRequestContext: (request: RequestLike, options: ContextContentOptions) => Promise<ContentPage | undefined>;
4
- export default createRequestContext;
42
+ export { createRequestContext as default };
@@ -1,7 +1,7 @@
1
- var ie=Object.defineProperty;var T=(e,o)=>ie(e,"name",{value:o,configurable:!0});import{a as P,s as G,n as X,e as W,d as de,g as le,c as ce}from"../../packem_shared/clipboard-BS03XwiW.js";const q="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-braces%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M8%203H7a2%202%200%200%200-2%202v5a2%202%200%200%201-2%202%202%202%200%200%201%202%202v5c0%201.1.9%202%202%202h1%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2021h1a2%202%200%200%200%202-2v-5c0-1.1.9-2%202-2a2%202%200%200%201-2-2V5a2%202%200%200%200-2-2h-1%22%20%2F%3E%20%3C%2Fsvg%3E",J="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-cookie%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M12%202a10%2010%200%201%200%2010%2010%204%204%200%200%201-5-5%204%204%200%200%201-5-5%22%20%2F%3E%20%3Cpath%20d%3D%22M8.5%208.5v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2015.5v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M12%2012v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M11%2017v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M7%2014v.01%22%20%2F%3E%20%3C%2Fsvg%3E",S="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-file-text%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M6%2022a2%202%200%200%201-2-2V4a2%202%200%200%201%202-2h8a2.4%202.4%200%200%201%201.704.706l3.588%203.588A2.4%202.4%200%200%201%2020%208v12a2%202%200%200%201-2%202z%22%20%2F%3E%20%3Cpath%20d%3D%22M14%202v5a1%201%200%200%200%201%201h5%22%20%2F%3E%20%3Cpath%20d%3D%22M10%209H8%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2013H8%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2017H8%22%20%2F%3E%20%3C%2Fsvg%3E",I="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-globe%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%20%2F%3E%20%3Cpath%20d%3D%22M12%202a14.5%2014.5%200%200%200%200%2020%2014.5%2014.5%200%200%200%200-20%22%20%2F%3E%20%3Cpath%20d%3D%22M2%2012h20%22%20%2F%3E%20%3C%2Fsvg%3E",R="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-user%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M19%2021v-2a4%204%200%200%200-4-4H9a4%204%200%200%200-4%204v2%22%20%2F%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%227%22%20r%3D%224%22%20%2F%3E%20%3C%2Fsvg%3E";var ue=Object.defineProperty,ve=T((e,o)=>ue(e,"name",{value:o,configurable:!0}),"s$2");const O=ve(({label:e="Copy",successText:o="Copied!",targetId:r})=>{const c=P(r),h=P(e),x=G(e),l=G(o);return{html:`
1
+ var ie=Object.defineProperty;var J=(e,r)=>ie(e,"name",{value:r,configurable:!0});import{a as G,s as P,n as X,e as W,d as de,g as le,c as ce}from"../../packem_shared/clipboard-DbMCKslu.js";const T="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-braces%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M8%203H7a2%202%200%200%200-2%202v5a2%202%200%200%201-2%202%202%202%200%200%201%202%202v5c0%201.1.9%202%202%202h1%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2021h1a2%202%200%200%200%202-2v-5c0-1.1.9-2%202-2a2%202%200%200%201-2-2V5a2%202%200%200%200-2-2h-1%22%20%2F%3E%20%3C%2Fsvg%3E",q="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-cookie%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M12%202a10%2010%200%201%200%2010%2010%204%204%200%200%201-5-5%204%204%200%200%201-5-5%22%20%2F%3E%20%3Cpath%20d%3D%22M8.5%208.5v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2015.5v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M12%2012v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M11%2017v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M7%2014v.01%22%20%2F%3E%20%3C%2Fsvg%3E",O="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-file-text%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M6%2022a2%202%200%200%201-2-2V4a2%202%200%200%201%202-2h8a2.4%202.4%200%200%201%201.704.706l3.588%203.588A2.4%202.4%200%200%201%2020%208v12a2%202%200%200%201-2%202z%22%20%2F%3E%20%3Cpath%20d%3D%22M14%202v5a1%201%200%200%200%201%201h5%22%20%2F%3E%20%3Cpath%20d%3D%22M10%209H8%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2013H8%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2017H8%22%20%2F%3E%20%3C%2Fsvg%3E",I="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-globe%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%20%2F%3E%20%3Cpath%20d%3D%22M12%202a14.5%2014.5%200%200%200%200%2020%2014.5%2014.5%200%200%200%200-20%22%20%2F%3E%20%3Cpath%20d%3D%22M2%2012h20%22%20%2F%3E%20%3C%2Fsvg%3E",V="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-user%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M19%2021v-2a4%204%200%200%200-4-4H9a4%204%200%200%200-4%204v2%22%20%2F%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%227%22%20r%3D%224%22%20%2F%3E%20%3C%2Fsvg%3E";var ue=Object.defineProperty,ve=J((e,r)=>ue(e,"name",{value:r,configurable:!0}),"s$2");const S=ve(({label:e="Copy",successText:r="Copied!",targetId:o})=>{const c=G(o),m=G(e),x=P(e),l=P(r);return{html:`
2
2
  <button
3
3
  type="button"
4
- aria-label="${h}"
4
+ aria-label="${m}"
5
5
  title="${x}"
6
6
  class="ono-copy-btn relative inline-flex justify-center items-center size-8 rounded-[var(--ono-radius-md)] shadow-[var(--ono-elevation-1)] bg-[var(--ono-surface)] text-[var(--ono-text)] hover:bg-[var(--ono-hover-overlay)] focus:outline-hidden focus:bg-[var(--ono-hover-overlay)] disabled:opacity-50 disabled:pointer-events-none cursor-pointer"
7
7
  data-target="#${c}"
@@ -11,50 +11,50 @@ var ie=Object.defineProperty;var T=(e,o)=>ie(e,"name",{value:o,configurable:!0})
11
11
  <span class="ono-copy-success dui hidden size-4 text-[var(--ono-red-orange)]" style="-webkit-mask-image: url('${W}'); mask-image: url('${W}')"></span>
12
12
  <span class="sr-only">${x}</span>
13
13
  </button>
14
- `}},"copyButton");var pe=Object.defineProperty,j=T((e,o)=>pe(e,"name",{value:o,configurable:!0}),"s$1");const xe=typeof globalThis<"u"&&"Request"in globalThis,Z=j((e,o)=>o in e,"hasProperty"),V=j((e,o)=>Z(e,o)&&typeof e[o]=="function","hasMethod"),ee=j((e,o)=>Z(e,o)&&typeof e[o]=="string","hasStringProperty"),me=j(e=>xe&&V(e,"clone"),"isNativeRequest"),be=j(e=>V(e,"on")&&ee(e,"method"),"isIncomingMessage");j(e=>!me(e)&&!be(e)&&ee(e,"method"),"isExpressRequest");const L=j(e=>typeof e=="object"&&e!==null&&V(e,"forEach")&&V(e,"get"),"isHeadersObject");var ge=Object.defineProperty,s=T((e,o)=>ge(e,"name",{value:o,configurable:!0}),"s");const he=[/authorization/i,/cookie/i,/set-cookie/i,/x-api-key/i,/api-key/i,/x-auth/i,/token/i,/secret/i],H=s((e,o)=>{if(typeof e=="object"&&e!==null&&o in e)return e[o]},"safeGetProperty"),p=s((e,o)=>{const r=H(e,o);return typeof r=="function"?r:void 0},"safeGetMethod"),A=s((e,o)=>{const r=H(e,o);return typeof r=="string"?r:void 0},"safeGetString"),fe=s((e,o)=>o&&o.some(r=>r.toLowerCase()===e.toLowerCase())?!0:he.some(r=>r.test(e)),"isSensitiveHeader"),ye=s(e=>{if(!e)return[];if(L(e)){const o=p(e,"entries");if(o)return[...o()].map(([r,c])=>[r,c])}return Object.entries(e)},"normalizeHeadersToEntries"),we=s((e,o)=>!o||o.length===0?!0:o.some(r=>r.toLowerCase()===e.toLowerCase()),"shouldIncludeHeader"),$e=s((e,o)=>!e||!o?e:Array.isArray(e)?e.map(()=>o):o,"maskHeaderValue"),ke=s((e,o,r,c="[masked]")=>{const h=ye(e);if(h.length===0)return;const x={};for(const[l,a]of h){if(!we(l,o)||a===void 0)continue;const m=fe(l.toLowerCase(),r)?c:void 0;x[l]=$e(a,m)}return x},"filterHeaders"),Y=s(e=>{try{return JSON.stringify(e,null,2)}catch{return String(e)}},"safeJsonStringify"),De=s(e=>{if(!e)return{};const o={};return e.split(";").map(r=>r.trim()).filter(Boolean).forEach(r=>{const c=r.indexOf("=");if(c===-1)return;const h=r.slice(0,c).trim(),x=r.slice(c+1).trim();o[h]=x}),o},"parseCookieString"),Ce=s(async(e,o)=>{try{const r=String(A(e,"method")||"GET").toUpperCase();if(r==="GET"||r==="HEAD")return;const c=H(e,"headers"),h=L(c)?p(c,"get")?.("content-type")||"":String(c?.["content-type"]||""),x=p(e,"clone"),l=x?x():e;if(p(l,"json")&&String(h).includes("application/json"))try{const a=p(l,"json");return a?await a():void 0}catch{try{const a=p(l,"text");return a?await a()||"":void 0}catch{return}}if(p(l,"text"))try{const a=p(l,"text");return a?await a():void 0}catch{return}return p(e,"on")?await new Promise(a=>{try{let m="",N=!1;const C=p(e,"setEncoding");C&&C("utf8");const k=s(y=>{if(N)return;const M=typeof y=="string"?y:String(y);if(m.length+M.length>o){const D=Math.max(0,o-m.length);m+=M.slice(0,D),N=!0,b(),a(`${m}
15
- … [truncated]`);return}m+=M},"onData"),E=s(()=>{b(),a(m||void 0)},"onEnd"),B=s(()=>{b(),a(void 0)},"onError"),b=s(()=>{const y=p(e,"off");y?.("data",k),y?.("end",E),y?.("error",B)},"cleanup"),F=p(e,"on");F?.("data",k),F?.("end",E),F?.("error",B)}catch{a(void 0)}}):void 0}catch{return}},"readRequestBody"),Fe=s(async(e,o)=>{const r=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,11)}`,{headerAllowlist:c,headerDenylist:h,maskValue:x="[masked]"}=o||{},l=ke(H(e,"headers"),c,h,x),a=s(t=>{if(t!==void 0)return Array.isArray(t)?t.join(", "):t},"toSingle"),m=s(t=>`'${String(t).replaceAll("'",String.raw`'\''`)}'`,"shellQuote"),N=s(t=>{if(!t)return;const n=[];for(const[i,d]of Object.entries(t)){const g=a(d)??"";n.push(`${i}=${g}`)}return n.length>0?n.join("; "):void 0},"buildCookieHeader");let C;const k=H(e,"headers");if(L(k)){const t=p(k,"get")?.("cookie");C=typeof t=="string"?t:void 0}else if(Array.isArray(k?.cookie))C=k?.cookie?.[0];else{const t=k?.cookie;C=typeof t=="string"?t:void 0}const E=De(C),B=Math.max(0,Number(o?.previewBytes??64e3)),b=await Ce(e,B),F=s(()=>{const t=String(A(e,"method")||"GET").toUpperCase(),n=String(A(e,"url")||""),i=[],d={};if(l)for(const[w,$]of Object.entries(l)){const Q=a($);Q!==void 0&&(d[w]=Q)}const g=N(E);g&&!d.cookie&&(d.Cookie=g);for(const[w,$]of Object.entries(d))i.push(`-H ${m(`${w}: ${$}`)}`);let v="";if(e&&b!==void 0&&b!==null&&t!=="GET"){const w=typeof b=="string"?b:Y(b);v=`--data ${m(w)}`}const u=["curl","-X",t];return i.length>0&&u.push("\\",` ${i.join(` \\
16
- `)}`),v&&u.push("\\",` ${v}`),u.push("\\",` ${m(n)}`),u.join(" ")},"buildCurl")(),y=(await de(["bash"])).codeToHtml(F,{lang:"bash",themes:{dark:"github-dark-default",light:"github-light"}}),M=le(y),D=s(t=>P(t),"attributeEscape"),f=s(t=>G(t),"escapeHtml"),U=s(t=>!t||Object.keys(t).length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty)</div>':`<div class="px-4 pb-4">${Object.entries(t).map(([n,i])=>{const d=Array.isArray(i)?i.join(", "):i;return`<div class="grid grid-cols-[200px_1fr] gap-3 items-start py-2 border-b border-[var(--ono-border)]">
17
- <div class="text-[11px] uppercase tracking-wide text-[var(--ono-text-muted)]">${f(n)}</div>
18
- <div class="text-sm break-words whitespace-pre-wrap text-[var(--ono-text)]">${f(String(d))}</div>
19
- </div>`}).join("")}</div>`,"renderKeyValueTable"),te=s(t=>`<span class="text-[var(--ono-red-orange)]">${typeof t=="string"?`"${f(t)}"`:String(t)}</span>`,"renderPrimitiveValue"),oe=s(t=>`<span class="italic text-[var(--ono-text-muted)]">${t===null?"null":"undefined"}</span>`,"renderNullishValue"),re=s((t,n)=>{if(Object.keys(t).length===0)return'<span class="italic text-[var(--ono-text-muted)]">(empty object)</span>';if(n>=3)return`<span class="italic text-[var(--ono-text-muted)]">{Object with ${Object.keys(t).length} keys}</span>`;const i=Object.entries(t).slice(0,10).map(([g,v])=>{const u=z(v,n+1);return`
14
+ `}},"copyButton");var pe=Object.defineProperty,j=J((e,r)=>pe(e,"name",{value:r,configurable:!0}),"s$1");const me=typeof globalThis<"u"&&"Request"in globalThis,Z=j((e,r)=>r in e,"hasProperty"),R=j((e,r)=>Z(e,r)&&typeof e[r]=="function","hasMethod"),ee=j((e,r)=>Z(e,r)&&typeof e[r]=="string","hasStringProperty"),xe=j(e=>me&&R(e,"clone"),"isNativeRequest"),be=j(e=>R(e,"on")&&ee(e,"method"),"isIncomingMessage");j(e=>!xe(e)&&!be(e)&&ee(e,"method"),"isExpressRequest");const L=j(e=>typeof e=="object"&&e!==null&&R(e,"forEach")&&R(e,"get"),"isHeadersObject");var ge=Object.defineProperty,s=J((e,r)=>ge(e,"name",{value:r,configurable:!0}),"s");const he=[/authorization/i,/cookie/i,/set-cookie/i,/x-api-key/i,/api-key/i,/x-auth/i,/token/i,/secret/i],H=s((e,r)=>{if(typeof e=="object"&&e!==null&&r in e)return e[r]},"safeGetProperty"),p=s((e,r)=>{const o=H(e,r);return typeof o=="function"?o:void 0},"safeGetMethod"),A=s((e,r)=>{const o=H(e,r);return typeof o=="string"?o:void 0},"safeGetString"),fe=s((e,r)=>r?.some(o=>o.toLowerCase()===e.toLowerCase())?!0:he.some(o=>o.test(e)),"isSensitiveHeader"),ye=s(e=>{if(!e)return[];if(L(e)){const r=p(e,"entries");if(r){const o=r();return Array.from(o,([c,m])=>[c,m])}}return Object.entries(e)},"normalizeHeadersToEntries"),we=s((e,r)=>!r||r.length===0?!0:r.some(o=>o.toLowerCase()===e.toLowerCase()),"shouldIncludeHeader"),$e=s((e,r)=>!e||!r?e:Array.isArray(e)?e.map(()=>r):r,"maskHeaderValue"),ke=s((e,r,o,c="[masked]")=>{const m=ye(e);if(m.length===0)return;const x={};return m.forEach(([l,n])=>{if(!we(l,r)||n===void 0)return;const b=fe(l.toLowerCase(),o)?c:void 0;x[l]=$e(n,b)}),x},"filterHeaders"),Y=s(e=>{try{return JSON.stringify(e,null,2)}catch{return String(e)}},"safeJsonStringify"),De=s(e=>{if(!e)return{};const r={};return e.split(";").map(o=>o.trim()).filter(Boolean).forEach(o=>{const c=o.indexOf("=");if(c===-1)return;const m=o.slice(0,c).trim(),x=o.slice(c+1).trim();r[m]=x}),r},"parseCookieString"),Ce=s(async(e,r)=>{try{const o=(A(e,"method")??"GET").toUpperCase();if(o==="GET"||o==="HEAD")return;const c=H(e,"headers"),m=L(c)?p(c,"get")?.("content-type")??"":String(c["content-type"]??""),x=p(e,"clone"),l=x?x():e;if(p(l,"json")&&m.includes("application/json"))try{const n=p(l,"json");return n?await n():void 0}catch{try{const n=p(l,"text");return n?await n()??"":void 0}catch{return}}if(p(l,"text"))try{const n=p(l,"text");return n?await n():void 0}catch{return}return p(e,"on")?await new Promise(n=>{try{let b="",N=!1;const D=p(e,"setEncoding");D&&D("utf8");const C=s(w=>{if(N)return;const M=typeof w=="string"?w:String(w);if(b.length+M.length>r){const k=Math.max(0,r-b.length);b+=M.slice(0,k),N=!0,f(),n(`${b}
15
+ … [truncated]`);return}b+=M},"onData"),E=s(()=>{f(),n(b||void 0)},"onEnd"),B=s(()=>{f(),n(void 0)},"onError"),f=s(()=>{const w=p(e,"off");w?.("data",C),w?.("end",E),w?.("error",B)},"cleanup"),F=p(e,"on");F?.("data",C),F?.("end",E),F?.("error",B)}catch{n(void 0)}}):void 0}catch{return}},"readRequestBody"),Fe=s(async(e,r)=>{const o=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,11)}`,{headerAllowlist:c,headerDenylist:m,maskValue:x="[masked]"}=r,l=ke(H(e,"headers"),c,m,x),n=s(t=>{if(t!==void 0)return Array.isArray(t)?t.join(", "):t},"toSingle"),b=s(t=>`'${t.replaceAll("'",String.raw`'\''`)}'`,"shellQuote"),N=s(t=>{if(!t)return;const a=[];return Object.entries(t).forEach(([i,d])=>{const g=n(d)??"";a.push(`${i}=${g}`)}),a.length>0?a.join("; "):void 0},"buildCookieHeader");let D;const C=H(e,"headers");if(L(C)){const t=p(C,"get")?.("cookie");D=typeof t=="string"?t:void 0}else if(C!==void 0){const t=C;if(Array.isArray(t.cookie))[D]=t.cookie;else{const a=t.cookie;D=typeof a=="string"?a:void 0}}const E=De(D),B=Math.max(0,r.previewBytes??64e3),f=await Ce(e,B),F=s(()=>{const t=(A(e,"method")??"GET").toUpperCase(),a=A(e,"url")??"",i=[],d={};l&&Object.entries(l).forEach(([h,$])=>{const Q=n($);Q!==void 0&&(d[h]=Q)});const g=N(E);g&&!d.cookie&&(d.Cookie=g),Object.entries(d).forEach(([h,$])=>{i.push(`-H ${b(`${h}: ${$}`)}`)});let v="";if(f!=null&&t!=="GET"){const h=typeof f=="string"?f:Y(f);v=`--data ${b(h)}`}const u=["curl","-X",t];return i.length>0&&u.push("\\",` ${i.join(` \\
16
+ `)}`),v&&u.push("\\",` ${v}`),u.push("\\",` ${b(a)}`),u.join(" ")},"buildCurl")(),w=(await de(["bash"])).codeToHtml(F,{lang:"bash",themes:{dark:"min-dark",light:"min-light"}}),M=le(w),k=s(t=>G(t),"attributeEscape"),y=s(t=>P(t),"escapeHtml"),U=s(t=>!t||Object.keys(t).length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty)</div>':`<div class="px-4 pb-4">${Object.entries(t).map(([a,i])=>{const d=Array.isArray(i)?i.join(", "):i;return`<div class="grid grid-cols-[200px_1fr] gap-3 items-start py-2 border-b border-[var(--ono-border)]">
17
+ <div class="text-[11px] uppercase tracking-wide text-[var(--ono-text-muted)]">${y(a)}</div>
18
+ <div class="text-sm break-words whitespace-pre-wrap text-[var(--ono-text)]">${y(d)}</div>
19
+ </div>`}).join("")}</div>`,"renderKeyValueTable"),te=s(t=>`<span class="text-[var(--ono-red-orange)]">${typeof t=="string"?`"${y(t)}"`:String(t)}</span>`,"renderPrimitiveValue"),re=s(t=>`<span class="italic text-[var(--ono-text-muted)]">${t===null?"null":"undefined"}</span>`,"renderNullishValue"),oe=s((t,a)=>{if(Object.keys(t).length===0)return'<span class="italic text-[var(--ono-text-muted)]">(empty object)</span>';if(a>=3)return`<span class="italic text-[var(--ono-text-muted)]">{Object with ${String(Object.keys(t).length)} keys}</span>`;const i=Object.entries(t).slice(0,10).map(([g,v])=>{const u=z(v,a+1);return`
20
20
  <div class="ml-4 pl-3 py-1 border-l-2 border-[var(--ono-border)]">
21
- <span class="font-medium text-[var(--ono-text)]">${f(g)}:</span> ${u}
22
- </div>`}).join(""),d=Object.keys(t).length>10?`<div class="ml-4 italic text-[var(--ono-text-muted)]">... and ${Object.keys(t).length-10} more keys</div>`:"";return`<div class="space-y-1">${i}${d}</div>`},"renderObjectValue"),z=s((t,n=0)=>{if(t==null)return oe(t);if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return te(t);if(Array.isArray(t)){if(t.length===0)return'<span class="italic text-[var(--ono-text-muted)]">(empty array)</span>';if(n>=3)return`<span class="italic text-[var(--ono-text-muted)]">[Array with ${t.length} items]</span>`;const i=t.slice(0,10).map((g,v)=>{const u=z(g,n+1);return`
21
+ <span class="font-medium text-[var(--ono-text)]">${y(g)}:</span> ${u}
22
+ </div>`}).join(""),d=Object.keys(t).length>10?`<div class="ml-4 italic text-[var(--ono-text-muted)]">... and ${String(Object.keys(t).length-10)} more keys</div>`:"";return`<div class="space-y-1">${i}${d}</div>`},"renderObjectValue"),z=s((t,a=0)=>{if(t==null)return re(t);if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return te(t);if(Array.isArray(t)){if(t.length===0)return'<span class="italic text-[var(--ono-text-muted)]">(empty array)</span>';if(a>=3)return`<span class="italic text-[var(--ono-text-muted)]">[Array with ${String(t.length)} items]</span>`;const d=t.slice(0,10).map((v,u)=>{const h=z(v,a+1);return`
23
23
  <div class="ml-4 pl-3 py-1 border-l-2 border-[var(--ono-border)]">
24
- <span class="text-xs text-[var(--ono-text-muted)]">[${v}]:</span> ${u}
25
- </div>`}).join(""),d=t.length>10?`<div class="ml-4 text-sm italic text-[var(--ono-text-muted)]">... and ${t.length-10} more items</div>`:"";return`<div class="space-y-1">${i}${d}</div>`}return typeof t=="object"?re(t,n):`<span class="text-[var(--ono-text)]">${f(String(t))}</span>`},"renderValue"),_=s(t=>!t||Object.keys(t).length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty)</div>':`<div class="px-4 pb-4">${Object.entries(t).map(([n,i])=>{const d=z(i);return`<div class="grid grid-cols-[200px_1fr] gap-3 items-start py-2 border-b border-[var(--ono-border)]">
26
- <div class="text-[11px] uppercase tracking-wide text-[var(--ono-text-muted)]">${f(n)}</div>
24
+ <span class="text-xs text-[var(--ono-text-muted)]">[${String(u)}]:</span> ${h}
25
+ </div>`}).join(""),g=t.length>10?`<div class="ml-4 text-sm italic text-[var(--ono-text-muted)]">... and ${String(t.length-10)} more items</div>`:"";return`<div class="space-y-1">${d}${g}</div>`}if(typeof t=="object")return oe(t,a);const i=typeof t=="symbol"||typeof t=="bigint"||typeof t=="function"?t.toString():JSON.stringify(t);return`<span class="text-[var(--ono-text)]">${y(i)}</span>`},"renderValue"),_=s(t=>!t||Object.keys(t).length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty)</div>':`<div class="px-4 pb-4">${Object.entries(t).map(([a,i])=>{const d=z(i);return`<div class="grid grid-cols-[200px_1fr] gap-3 items-start py-2 border-b border-[var(--ono-border)]">
26
+ <div class="text-[11px] uppercase tracking-wide text-[var(--ono-text-muted)]">${y(a)}</div>
27
27
  <div class="text-sm break-words text-[var(--ono-text)]">${d}</div>
28
- </div>`}).join("")}</div>`,"renderObjectTable"),se=s(t=>t==null?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(no body)</div>':typeof t=="string"?t.trim()===""?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty string)</div>':`<div class="px-4 pb-4">
29
- <div class="text-sm break-words whitespace-pre-wrap font-mono p-3 rounded border border-[var(--ono-border)] bg-[var(--ono-surface-muted)] text-[var(--ono-text)]">${f(t)}</div>
30
- </div>`:typeof t=="object"?Array.isArray(t)?t.length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty array)</div>':`<div class="px-4 pb-4">
28
+ </div>`}).join("")}</div>`,"renderObjectTable"),se=s(t=>{if(t==null)return'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(no body)</div>';if(typeof t=="string")return t.trim()===""?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty string)</div>':`<div class="px-4 pb-4">
29
+ <div class="text-sm break-words whitespace-pre-wrap font-mono p-3 rounded border border-[var(--ono-border)] bg-[var(--ono-surface-muted)] text-[var(--ono-text)]">${y(t)}</div>
30
+ </div>`;if(typeof t=="object")return Array.isArray(t)?t.length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty array)</div>':`<div class="px-4 pb-4">
31
31
  <div class="text-sm break-words p-3 rounded border border-[var(--ono-border)] bg-[var(--ono-surface-muted)] text-[var(--ono-text)]">${z(t)}</div>
32
32
  </div>`:Object.keys(t).length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty object)</div>':`<div class="px-4 pb-4">
33
33
  <div class="text-sm break-words p-3 rounded border border-[var(--ono-border)] bg-[var(--ono-surface-muted)] text-[var(--ono-text)]">${z(t)}</div>
34
- </div>`:`<div class="px-4 pb-4">
35
- <div class="text-sm break-words whitespace-pre-wrap font-mono p-3 rounded border border-[var(--ono-border)] bg-[var(--ono-surface-muted)] text-[var(--ono-text)]">${f(String(t))}</div>
36
- </div>`,"renderBodyContent"),K=s(t=>{if(!t)return{content:"",sidebar:""};const n=new Set(["request"]),i=Object.keys(t).filter(v=>!n.has(v));if(i.length===0)return{content:"",sidebar:""};let d="",g="";return i.forEach(v=>{const u=t[v];if(u&&typeof u=="object"&&(Array.isArray(u)||Object.keys(u).length>0)){const w=v.charAt(0).toUpperCase()+v.slice(1),$=`context-${v}`;d+=`
34
+ </div>`;const a=t.toString();return`<div class="px-4 pb-4">
35
+ <div class="text-sm break-words whitespace-pre-wrap font-mono p-3 rounded border border-[var(--ono-border)] bg-[var(--ono-surface-muted)] text-[var(--ono-text)]">${y(a)}</div>
36
+ </div>`},"renderBodyContent"),K=s(t=>{if(!t)return{content:"",sidebar:""};const a=new Set(["request"]),i=Object.keys(t).filter(v=>!a.has(v));if(i.length===0)return{content:"",sidebar:""};let d="",g="";return i.forEach(v=>{const u=t[v];if(u&&typeof u=="object"&&(Array.isArray(u)||Object.keys(u).length>0)){const h=v.charAt(0).toUpperCase()+v.slice(1),$=`context-${v}`;d+=`
37
37
  <div>
38
- <div class="text-[11px] uppercase tracking-wide mb-2 text-[var(--ono-text-muted)]">${w}</div>
38
+ <div class="text-[11px] uppercase tracking-wide mb-2 text-[var(--ono-text-muted)]">${h}</div>
39
39
  <ul class="space-y-1 text-sm">
40
40
  <li>
41
41
  <a href="#${$}" class="flex items-center gap-2 px-2 py-1 rounded text-[var(--ono-text)] hover:bg-[var(--ono-surface-muted)] ono-scrollspy-active:bg-[var(--ono-surface-muted)] ono-scrollspy-active:font-semibold">
42
- <span class="dui size-3" style="-webkit-mask-image:url('${S}'); mask-image:url('${S}')"></span>
43
- <span>${w}</span>
42
+ <span class="dui size-3" style="-webkit-mask-image:url('${O}'); mask-image:url('${O}')"></span>
43
+ <span>${h}</span>
44
44
  </a>
45
45
  </li>
46
46
  </ul>
47
47
  </div>`,g+=`
48
- <input type="hidden" id="clipboard-${$}-${r}" value="${D(JSON.stringify(u))}">
48
+ <input type="hidden" id="clipboard-${$}-${o}" value="${k(JSON.stringify(u))}">
49
49
  <section id="${$}" class="mb-4 rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-1)] overflow-hidden bg-[var(--ono-surface)] border border-[var(--ono-border)]">
50
50
  <div class="px-4 py-2 flex items-center gap-2 bg-[var(--ono-surface-muted)] border-b border-[var(--ono-border)]">
51
- <h3 class="text-sm font-semibold text-[var(--ono-text)]">${w}</h3>
51
+ <h3 class="text-sm font-semibold text-[var(--ono-text)]">${h}</h3>
52
52
  <div class="grow"></div>
53
53
  <a href="#${$}" class="text-xs text-[var(--ono-text-muted)]" aria-label="Anchor">#</a>
54
- ${O({label:"Copy JSON",targetId:`clipboard-${$}-${r}`}).html}
54
+ ${S({label:"Copy JSON",targetId:`clipboard-${$}-${o}`}).html}
55
55
  </div>
56
56
  <div class="max-w-full overflow-auto mt-2">${_(u)}</div>
57
- </section>`}}),{content:g,sidebar:d}},"generateContextSections")(o.context),ae=`
57
+ </section>`}}),{content:g,sidebar:d}},"generateContextSections")(r.context),ae=`
58
58
  <aside class="shrink-0 w-64 sticky top-4 self-start">
59
59
  <nav aria-label="Context sections" class="p-3 rounded-[var(--ono-radius-md)] shadow-[var(--ono-elevation-1)] space-y-4 overflow-auto bg-[var(--ono-surface)] border border-[var(--ono-border)] max-h-[calc(100dvh-2rem)]">
60
60
  <div>
@@ -68,25 +68,25 @@ var ie=Object.defineProperty;var T=(e,o)=>ie(e,"name",{value:o,configurable:!0})
68
68
  </li>
69
69
  <li>
70
70
  <a href="#context-headers" class="flex items-center gap-2 px-2 py-1 rounded text-[var(--ono-text)] hover:bg-[var(--ono-surface-muted)]">
71
- <span class="dui size-3" style="-webkit-mask-image:url('${S}'); mask-image:url('${S}')"></span>
71
+ <span class="dui size-3" style="-webkit-mask-image:url('${O}'); mask-image:url('${O}')"></span>
72
72
  <span>Headers</span>
73
73
  </a>
74
74
  </li>
75
75
  <li>
76
76
  <a href="#context-body" class="flex items-center gap-2 px-2 py-1 rounded text-[var(--ono-text)] hover:bg-[var(--ono-surface-muted)]">
77
- <span class="dui size-3" style="-webkit-mask-image:url('${q}'); mask-image:url('${q}')"></span>
77
+ <span class="dui size-3" style="-webkit-mask-image:url('${T}'); mask-image:url('${T}')"></span>
78
78
  <span>Body</span>
79
79
  </a>
80
80
  </li>
81
81
  <li>
82
82
  <a href="#context-session" class="flex items-center gap-2 px-2 py-1 rounded text-[var(--ono-text)] hover:bg-[var(--ono-surface-muted)]">
83
- <span class="dui size-3" style="-webkit-mask-image:url('${R}'); mask-image:url('${R}')"></span>
83
+ <span class="dui size-3" style="-webkit-mask-image:url('${V}'); mask-image:url('${V}')"></span>
84
84
  <span>Session</span>
85
85
  </a>
86
86
  </li>
87
87
  <li>
88
88
  <a href="#context-cookies" class="flex items-center gap-2 px-2 py-1 rounded text-[var(--ono-text)] hover:bg-[var(--ono-surface-muted)]">
89
- <span class="dui size-3" style="-webkit-mask-image:url('${J}'); mask-image:url('${J}')"></span>
89
+ <span class="dui size-3" style="-webkit-mask-image:url('${q}'); mask-image:url('${q}')"></span>
90
90
  <span>Cookies</span>
91
91
  </a>
92
92
  </li>
@@ -95,63 +95,63 @@ var ie=Object.defineProperty;var T=(e,o)=>ie(e,"name",{value:o,configurable:!0})
95
95
  </nav>
96
96
  </aside>`,ne=`
97
97
  <div class="grow min-w-0">
98
- <input type="hidden" id="clipboard-curl-${r}" value="${D(F)}">
98
+ <input type="hidden" id="clipboard-curl-${o}" value="${k(F)}">
99
99
  <section id="context-request" class="mb-4 rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-1)] overflow-hidden bg-[var(--ono-surface)] border border-[var(--ono-border)]">
100
100
  <div class="px-4 py-2 flex items-center gap-3 min-w-0 bg-[var(--ono-surface-muted)] border-b border-[var(--ono-border)]">
101
101
  <span class="dui size-4" style="-webkit-mask-image:url('${I}'); mask-image:url('${I}')"></span>
102
102
  <h2 class="text-sm font-semibold text-[var(--ono-text)]">Request</h2>
103
- <a class="text-sm truncate text-[var(--ono-red-orange)]" href="${ce(A(e,"url")||"#")}">${f(A(e,"url")||"")}</a>
104
- <span class="inline-block text-[10px] px-2 py-0.5 rounded-full bg-[var(--ono-chip-bg)] text-[var(--ono-chip-text)]">${f(String(A(e,"method")||"GET"))}</span>
103
+ <a class="text-sm truncate text-[var(--ono-red-orange)]" href="${ce(A(e,"url")??"#")}">${y(A(e,"url")??"")}</a>
104
+ <span class="inline-block text-[10px] px-2 py-0.5 rounded-full bg-[var(--ono-chip-bg)] text-[var(--ono-chip-text)]">${y(A(e,"method")??"GET")}</span>
105
105
  <div class="grow"></div>
106
- ${O({label:"Copy cURL",targetId:`clipboard-curl-${r}`}).html}
106
+ ${S({label:"Copy cURL",targetId:`clipboard-curl-${o}`}).html}
107
107
  </div>
108
108
  <div class="px-4 pb-4 overflow-auto mt-2">${M}</div>
109
109
  </section>
110
110
 
111
- <input type="hidden" id="clipboard-headers-${r}" value="${D(JSON.stringify(l||{}))}">
111
+ <input type="hidden" id="clipboard-headers-${o}" value="${k(JSON.stringify(l??{}))}">
112
112
  <section id="context-headers" class="mb-4 rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-1)] overflow-hidden bg-[var(--ono-surface)] border border-[var(--ono-border)]">
113
113
  <div class="px-4 py-2 flex items-center gap-2 bg-[var(--ono-surface-muted)] border-b border-[var(--ono-border)]">
114
- <span class="dui size-4" style="-webkit-mask-image:url('${S}'); mask-image:url('${S}')"></span>
114
+ <span class="dui size-4" style="-webkit-mask-image:url('${O}'); mask-image:url('${O}')"></span>
115
115
  <h3 class="text-sm font-semibold text-[var(--ono-text)]">Headers</h3>
116
116
  <div class="grow"></div>
117
117
  <a href="#context-headers" class="text-xs text-[var(--ono-text-muted)]" aria-label="Anchor">#</a>
118
- ${O({label:"Copy JSON",targetId:`clipboard-headers-${r}`}).html}
118
+ ${S({label:"Copy JSON",targetId:`clipboard-headers-${o}`}).html}
119
119
  </div>
120
120
  <div class="max-w-full overflow-auto mt-2">${U(l)}</div>
121
121
  </section>
122
122
 
123
- <input type="hidden" id="clipboard-body-${r}" value="${D(Y(b??{}))}">
123
+ <input type="hidden" id="clipboard-body-${o}" value="${k(Y(f??{}))}">
124
124
  <section id="context-body" class="mb-4 rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-1)] overflow-hidden bg-[var(--ono-surface)] border border-[var(--ono-border)]">
125
125
  <div class="px-4 py-2 flex items-center gap-2 bg-[var(--ono-surface-muted)] border-b border-[var(--ono-border)]">
126
- <span class="dui size-4" style="-webkit-mask-image:url('${q}'); mask-image:url('${q}')"></span>
126
+ <span class="dui size-4" style="-webkit-mask-image:url('${T}'); mask-image:url('${T}')"></span>
127
127
  <h3 class="text-sm font-semibold text-[var(--ono-text)]">Body</h3>
128
128
  <div class="grow"></div>
129
129
  <a href="#context-body" class="text-xs text-[var(--ono-text-muted)]" aria-label="Anchor">#</a>
130
- ${O({label:"Copy JSON",targetId:`clipboard-body-${r}`}).html}
130
+ ${S({label:"Copy JSON",targetId:`clipboard-body-${o}`}).html}
131
131
  </div>
132
- <div class="max-w-full overflow-auto mt-2">${se(b)}</div>
132
+ <div class="max-w-full overflow-auto mt-2">${se(f)}</div>
133
133
  </section>
134
134
 
135
- <input type="hidden" id="clipboard-session-${r}" value="${D(JSON.stringify(e?.session??{}))}">
135
+ <input type="hidden" id="clipboard-session-${o}" value="${k(JSON.stringify(e.session??{}))}">
136
136
  <section id="context-session" class="mb-4 rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-1)] overflow-hidden bg-[var(--ono-surface)] border border-[var(--ono-border)]">
137
137
  <div class="px-4 py-2 flex items-center gap-2 bg-[var(--ono-surface-muted)] border-b border-[var(--ono-border)]">
138
- <span class="dui size-4" style="-webkit-mask-image:url('${R}'); mask-image:url('${R}')"></span>
138
+ <span class="dui size-4" style="-webkit-mask-image:url('${V}'); mask-image:url('${V}')"></span>
139
139
  <h3 class="text-sm font-semibold text-[var(--ono-text)]">Session</h3>
140
140
  <div class="grow"></div>
141
141
  <a href="#context-session" class="text-xs text-[var(--ono-text-muted)]" aria-label="Anchor">#</a>
142
- ${O({label:"Copy JSON",targetId:`clipboard-session-${r}`}).html}
142
+ ${S({label:"Copy JSON",targetId:`clipboard-session-${o}`}).html}
143
143
  </div>
144
- <div class="max-w-full overflow-auto mt-2">${_(e?.session)}</div>
144
+ <div class="max-w-full overflow-auto mt-2">${_(e.session)}</div>
145
145
  </section>
146
146
 
147
- <input type="hidden" id="clipboard-cookies-${r}" value="${D(JSON.stringify(E||{}))}">
147
+ <input type="hidden" id="clipboard-cookies-${o}" value="${k(JSON.stringify(E))}">
148
148
  <section id="context-cookies" class="mb-4 rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-1)] overflow-hidden bg-[var(--ono-surface)] border border-[var(--ono-border)]">
149
149
  <div class="px-4 py-2 flex items-center gap-2 bg-[var(--ono-surface-muted)] border-b border-[var(--ono-border)]">
150
- <span class="dui size-4" style="-webkit-mask-image:url('${J}'); mask-image:url('${J}')"></span>
150
+ <span class="dui size-4" style="-webkit-mask-image:url('${q}'); mask-image:url('${q}')"></span>
151
151
  <h3 class="text-sm font-semibold text-[var(--ono-text)]">Cookies</h3>
152
152
  <div class="grow"></div>
153
153
  <a href="#context-cookies" class="text-xs text-[var(--ono-text-muted)]" aria-label="Anchor">#</a>
154
- ${O({label:"Copy JSON",targetId:`clipboard-cookies-${r}`}).html}
154
+ ${S({label:"Copy JSON",targetId:`clipboard-cookies-${o}`}).html}
155
155
  </div>
156
156
  <div class="max-w-full overflow-auto mt-2">${U(E)}
157
157
  </div>
package/dist/index.d.ts CHANGED
@@ -1,20 +1,36 @@
1
- import type { SolutionFinder } from "@visulima/error/solution";
2
- import type { BaseCliOptions } from "../../../../shared/utils/cli-error-builder.d.ts";
3
- import type { TemplateOptions as BaseTemplateOptions } from "./error-inspector/types.d.ts";
4
- export type TemplateOptions = BaseTemplateOptions & {
5
- solutionFinders?: SolutionFinder[];
1
+ import { SolutionFinder } from '@visulima/error/solution';
2
+ import { RenderErrorOptions } from '@visulima/error/error';
3
+ import { T as TemplateOptions$1 } from "./packem_shared/types.d-CDlBu_Vx.js";
4
+ type ColorizeMethod = (value: string) => string;
5
+ type BaseCliOptions = {
6
+ solutionTitle?: string;
7
+ solutionFinders?: SolutionFinder[];
8
+ debug?: boolean;
9
+ } & Partial<Omit<RenderErrorOptions, "color">> & {
10
+ color?: {
11
+ codeFrame?: RenderErrorOptions["color"];
12
+ boxen?: {
13
+ headerTextColor?: ColorizeMethod;
14
+ textColor?: ColorizeMethod;
15
+ borderColor?: ColorizeMethod;
16
+ };
17
+ };
6
18
  };
7
- export type CliOptions = BaseCliOptions;
8
- export declare class Ono {
9
- /**
10
- * Render error to HTML.
11
- */
12
- toHTML(error: unknown, options?: TemplateOptions): Promise<string>;
13
- /**
14
- * Render error to ANSI output.
15
- */
16
- toANSI(error: unknown, options?: CliOptions): Promise<{
17
- errorAnsi: string;
18
- solutionBox: undefined | string;
19
- }>;
19
+ type TemplateOptions = TemplateOptions$1 & {
20
+ solutionFinders?: SolutionFinder[];
21
+ };
22
+ type CliOptions = BaseCliOptions;
23
+ declare class Ono {
24
+ /**
25
+ * Render error to HTML.
26
+ */
27
+ toHTML(error: unknown, options?: TemplateOptions): Promise<string>;
28
+ /**
29
+ * Render error to ANSI output.
30
+ */
31
+ toANSI(error: unknown, options?: CliOptions): Promise<{
32
+ errorAnsi: string;
33
+ solutionBox: undefined | string;
34
+ }>;
20
35
  }
36
+ export { CliOptions, Ono, TemplateOptions };