@lensjs/core 2.4.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/dist/abstracts/adapter.d.cts +1 -0
  2. package/dist/abstracts/adapter.d.ts +1 -0
  3. package/dist/abstracts/store.cjs +3 -0
  4. package/dist/abstracts/store.d.cts +2 -0
  5. package/dist/abstracts/store.d.ts +2 -0
  6. package/dist/abstracts/store.js +3 -0
  7. package/dist/context/container.d.cts +1 -0
  8. package/dist/context/container.d.ts +1 -0
  9. package/dist/context/context.d.cts +1 -0
  10. package/dist/context/context.d.ts +1 -0
  11. package/dist/core/api_controller.cjs +19 -1
  12. package/dist/core/api_controller.d.cts +3 -0
  13. package/dist/core/api_controller.d.ts +3 -0
  14. package/dist/core/api_controller.js +19 -1
  15. package/dist/core/lens.cjs +36 -1
  16. package/dist/core/lens.d.cts +1 -0
  17. package/dist/core/lens.d.ts +1 -0
  18. package/dist/core/lens.js +36 -1
  19. package/dist/core/watcher.d.cts +1 -0
  20. package/dist/core/watcher.d.ts +1 -0
  21. package/dist/index.cjs +60 -3
  22. package/dist/index.d.cts +3 -1
  23. package/dist/index.d.ts +3 -1
  24. package/dist/index.js +59 -3
  25. package/dist/mixins/queued_store.d.cts +1 -0
  26. package/dist/mixins/queued_store.d.ts +1 -0
  27. package/dist/stores/better_sqlite.cjs +6 -0
  28. package/dist/stores/better_sqlite.d.cts +9 -0
  29. package/dist/stores/better_sqlite.d.ts +9 -0
  30. package/dist/stores/better_sqlite.js +6 -0
  31. package/dist/stores/index.cjs +6 -0
  32. package/dist/stores/index.d.cts +1 -0
  33. package/dist/stores/index.d.ts +1 -0
  34. package/dist/stores/index.js +6 -0
  35. package/dist/stores/queued_sqlite.cjs +6 -0
  36. package/dist/stores/queued_sqlite.d.cts +1 -0
  37. package/dist/stores/queued_sqlite.d.ts +1 -0
  38. package/dist/stores/queued_sqlite.js +6 -0
  39. package/dist/types/index.cjs +1 -0
  40. package/dist/types/index.d.cts +4 -9
  41. package/dist/types/index.d.ts +4 -9
  42. package/dist/types/index.js +1 -0
  43. package/dist/types/mail.cjs +18 -0
  44. package/dist/types/mail.d.cts +235 -0
  45. package/dist/types/mail.d.ts +235 -0
  46. package/dist/types/mail.js +0 -0
  47. package/dist/ui/assets/CacheActionBadge-BjZ4pc-P.js +1 -0
  48. package/dist/ui/assets/CacheEntriesTable-CrVfGRQp.js +1 -0
  49. package/dist/ui/assets/CacheEntryContainer-C3VFggtA.js +2 -0
  50. package/dist/ui/assets/{CacheEntryDetails-BqnO7eQt.js → CacheEntryDetails-DeBbBbPE.js} +1 -1
  51. package/dist/ui/assets/CacheEntryDetailsContainer-C91cW6AU.js +2 -0
  52. package/dist/ui/assets/ExceptionContainer-CfMuOCmH.js +2 -0
  53. package/dist/ui/assets/{ExceptionDetails-pQPj3ONT.js → ExceptionDetails-D2OCJVfz.js} +2 -2
  54. package/dist/ui/assets/ExceptionDetailsContainer-CR-lxRD2.js +2 -0
  55. package/dist/ui/assets/{ExceptionTable-DOeXVqQk.js → ExceptionTable-CpkppRjX.js} +1 -1
  56. package/dist/ui/assets/{JsonViewer-CsEn0XaU.js → JsonViewer-ATo_F1hS.js} +1 -1
  57. package/dist/ui/assets/{LoadMore-DkgyLoiB.js → LoadMore-BN7PRRRi.js} +1 -1
  58. package/dist/ui/assets/MailContainer-CT2lVazH.js +2 -0
  59. package/dist/ui/assets/MailDetails-B653XXBL.js +25 -0
  60. package/dist/ui/assets/MailDetailsContainer-87DOHjt8.js +2 -0
  61. package/dist/ui/assets/MailTable-DKB1K8iz.js +1 -0
  62. package/dist/ui/assets/QueriesContainer-Bk2r-ERW.js +2 -0
  63. package/dist/ui/assets/{QueryDetailsContainer-CEB3hlHs.js → QueryDetailsContainer-SuM5VQhc.js} +7 -7
  64. package/dist/ui/assets/{QueryTable-BE7RpCNw.js → QueryTable-C2io_PkC.js} +1 -1
  65. package/dist/ui/assets/RequestDetails-CpThVPU7.js +1 -0
  66. package/dist/ui/assets/RequestDetailsContainer-BXIDvHw4.js +2 -0
  67. package/dist/ui/assets/RequestsContainer-CrgOytwQ.js +2 -0
  68. package/dist/ui/assets/{RequetsTable-DFm_vdLV.js → RequetsTable-DQwdUFOa.js} +1 -1
  69. package/dist/ui/assets/SearchInput-_Uf26G0_.js +6 -0
  70. package/dist/ui/assets/StatusCode-BmJMJ27T.js +1 -0
  71. package/dist/ui/assets/TabbedDataViewer-CSqO-90o.js +2 -0
  72. package/dist/ui/assets/Table-DHM1Nl4B.js +6 -0
  73. package/dist/ui/assets/columns-2NwKukUf.js +1 -0
  74. package/dist/ui/assets/{columns-5NhbdeuI.js → columns-B3JsHnVe.js} +1 -1
  75. package/dist/ui/assets/{columns-BGeHl5-C.js → columns-D2emfeN1.js} +1 -1
  76. package/dist/ui/assets/{columns-oQrpcTou.js → columns-DbVoTM0z.js} +1 -1
  77. package/dist/ui/assets/{copy-CwmmSmiO.js → copy-DkbKgCsc.js} +1 -1
  78. package/dist/ui/assets/index-DuJe0XlW.js +129 -0
  79. package/dist/ui/assets/index-DyMy6gzm.css +1 -0
  80. package/dist/ui/assets/{useCacheEntries-OjlomqyI.js → useCacheEntries-ClCDpOYz.js} +1 -1
  81. package/dist/ui/assets/{useExceptions-DE7MHRvJ.js → useExceptions-DeHzgA7U.js} +1 -1
  82. package/dist/ui/assets/useLensApi-SUqoFD39.js +1 -0
  83. package/dist/ui/assets/{useLoadMore-BA_-_Tw4.js → useLoadMore-DdSLuDVd.js} +1 -1
  84. package/dist/ui/assets/{useQueries-D29NRLfq.js → useQueries-DeAAkcnt.js} +1 -1
  85. package/dist/ui/assets/useTanstackApi-DiA8BdmO.js +1 -0
  86. package/dist/ui/index.html +2 -2
  87. package/dist/utils/async_context.d.cts +1 -0
  88. package/dist/utils/async_context.d.ts +1 -0
  89. package/dist/utils/compose.d.cts +1 -0
  90. package/dist/utils/compose.d.ts +1 -0
  91. package/dist/utils/event_emitter.d.cts +2 -0
  92. package/dist/utils/event_emitter.d.ts +2 -0
  93. package/dist/utils/exception.d.cts +1 -0
  94. package/dist/utils/exception.d.ts +1 -0
  95. package/dist/utils/index.d.cts +1 -0
  96. package/dist/utils/index.d.ts +1 -0
  97. package/dist/watchers/cache_watcher.d.cts +1 -0
  98. package/dist/watchers/cache_watcher.d.ts +1 -0
  99. package/dist/watchers/exception_watcher.d.cts +1 -0
  100. package/dist/watchers/exception_watcher.d.ts +1 -0
  101. package/dist/watchers/index.cjs +21 -0
  102. package/dist/watchers/index.d.cts +2 -0
  103. package/dist/watchers/index.d.ts +2 -0
  104. package/dist/watchers/index.js +20 -0
  105. package/dist/watchers/mail_watcher.cjs +88 -0
  106. package/dist/watchers/mail_watcher.d.cts +11 -0
  107. package/dist/watchers/mail_watcher.d.ts +11 -0
  108. package/dist/watchers/mail_watcher.js +67 -0
  109. package/dist/watchers/query_watcher.d.cts +1 -0
  110. package/dist/watchers/query_watcher.d.ts +1 -0
  111. package/dist/watchers/request_watcher.d.cts +1 -0
  112. package/dist/watchers/request_watcher.d.ts +1 -0
  113. package/package.json +2 -2
  114. package/dist/ui/assets/CacheActionBadge-B0d8J3l3.js +0 -1
  115. package/dist/ui/assets/CacheEntriesTable-BWcruMt2.js +0 -1
  116. package/dist/ui/assets/CacheEntryContainer-DtJ7sOfS.js +0 -2
  117. package/dist/ui/assets/CacheEntryDetailsContainer-CDSo5J6T.js +0 -2
  118. package/dist/ui/assets/ExceptionContainer-CPGWtjRd.js +0 -2
  119. package/dist/ui/assets/ExceptionDetailsContainer-ClPIK2i9.js +0 -2
  120. package/dist/ui/assets/QueriesContainer-EcqQVDVf.js +0 -2
  121. package/dist/ui/assets/RequestDetails-Gd7Ai7fu.js +0 -1
  122. package/dist/ui/assets/RequestDetailsContainer-CnOSYjOY.js +0 -2
  123. package/dist/ui/assets/RequestsContainer-CEnrqMqW.js +0 -2
  124. package/dist/ui/assets/StatusCode-D5gEbxbO.js +0 -1
  125. package/dist/ui/assets/TabbedDataViewer-CJN6R11V.js +0 -2
  126. package/dist/ui/assets/Table-C3Y9tdtZ.js +0 -6
  127. package/dist/ui/assets/index-Bg3-m46L.js +0 -124
  128. package/dist/ui/assets/index-CsnKQ5Mh.css +0 -1
  129. package/dist/ui/assets/useLensApi-CI65OdmI.js +0 -1
@@ -0,0 +1,235 @@
1
+ /**
2
+ * LensJS — Mail Watcher Contract
3
+ *
4
+ * Driver-agnostic. Works with Nodemailer, Resend, SES, SendGrid, SMTP, etc.
5
+ * Contains everything needed to reconstruct a valid RFC 5322 .eml file
6
+ */
7
+ /**
8
+ * A single email address with an optional display name.
9
+ * Serializes to: "Display Name <user@example.com>" or "user@example.com"
10
+ */
11
+ interface Mailbox {
12
+ address: string;
13
+ name?: string;
14
+ }
15
+ /**
16
+ * A single RFC 5322 header field.
17
+ *
18
+ * Using a structured type (vs Record<string, string>) preserves:
19
+ * - Header ordering (critical for DKIM, Received chains, etc.)
20
+ * - Duplicate headers (e.g. multiple "Received:" lines)
21
+ * - Original casing (RFC 5322 is case-insensitive but real-world parsers vary)
22
+ */
23
+ interface MailHeader {
24
+ name: string;
25
+ value: string;
26
+ raw?: string;
27
+ }
28
+ /**
29
+ * SMTP envelope — separate from message headers.
30
+ * These are the MAIL FROM / RCPT TO values negotiated at the SMTP level,
31
+ * which may differ from the From:/To: headers in the message itself.
32
+ */
33
+ interface MailEnvelope {
34
+ mailFrom?: string;
35
+ rcptTo?: string[];
36
+ }
37
+ /**
38
+ * A single node in the MIME tree.
39
+ *
40
+ * Leaf nodes (text/plain, text/html, image/png, etc.) carry a `body`.
41
+ * Multipart nodes (multipart/mixed, multipart/alternative, etc.) carry `parts`.
42
+ *
43
+ * Typical tree shapes:
44
+ *
45
+ * Plain text only:
46
+ * text/plain
47
+ *
48
+ * HTML + plain fallback:
49
+ * multipart/alternative
50
+ * text/plain
51
+ * text/html
52
+ *
53
+ * HTML + inline images:
54
+ * multipart/related
55
+ * multipart/alternative
56
+ * text/plain
57
+ * text/html
58
+ * image/png (Content-ID: <cid@domain>)
59
+ *
60
+ * With attachments:
61
+ * multipart/mixed
62
+ * multipart/related
63
+ * multipart/alternative
64
+ * text/plain
65
+ * text/html
66
+ * image/png
67
+ * application/pdf (Content-Disposition: attachment)
68
+ */
69
+ interface MimePart {
70
+ /** Full MIME content-type, e.g. "multipart/alternative", "text/html" */
71
+ contentType: string;
72
+ /** Content-Disposition value for this part */
73
+ contentDisposition?: "inline" | "attachment";
74
+ /** Charset parameter, e.g. "UTF-8" (leaf text parts) */
75
+ charset?: string;
76
+ /** Content-Transfer-Encoding, e.g. "base64", "quoted-printable", "7bit" */
77
+ transferEncoding?: string;
78
+ /** Attachment/inline filename (Content-Disposition filename param) */
79
+ filename?: string;
80
+ /**
81
+ * Content-ID for CID-embedded inline content.
82
+ * Format: "<unique-id@domain>"
83
+ * Referenced in HTML as: src="cid:unique-id@domain"
84
+ */
85
+ contentId?: string;
86
+ /**
87
+ * Decoded body for leaf nodes. Undefined on multipart nodes.
88
+ * If transferEncoding is "base64", this string is base64 encoded.
89
+ */
90
+ body?: string;
91
+ /** Size in bytes of the decoded body */
92
+ size?: number;
93
+ /** Headers belonging to this specific MIME part */
94
+ headers: MailHeader[];
95
+ /** Child parts — populated only for multipart/* content types */
96
+ parts?: MimePart[];
97
+ }
98
+ /**
99
+ * Structured content container for the raw EML source.
100
+ */
101
+ interface MailRawSource {
102
+ /** The actual EML content string */
103
+ body: string;
104
+ /** Encoding of the body string (e.g., "base64" if binary, or undefined/empty for plain text) */
105
+ transferEncoding?: string;
106
+ }
107
+ /**
108
+ * LensJS-specific runtime metadata about how and when a message was sent.
109
+ * Entirely separate from RFC headers — never serialized into .eml.
110
+ */
111
+ interface MailMeta {
112
+ /** The driver that sent the message: "nodemailer" | "resend" | "ses" | "sendgrid" | etc. */
113
+ driver: string;
114
+ /**
115
+ * The transport mechanism used by the driver.
116
+ * "smtp" | "api" | "sendmail" | "queue" | "stream"
117
+ */
118
+ transport?: string;
119
+ /** Delivery state */
120
+ status: "pending" | "sent" | "failed";
121
+ /** Failure reason — populated when status is "failed" */
122
+ error?: string;
123
+ /**
124
+ * ISO 8601 timestamp of when the driver accepted/sent the message.
125
+ * Distinct from the RFC 5322 "Date:" header, which is composition time.
126
+ */
127
+ sentAt?: string;
128
+ /**
129
+ * How long the send operation took, in milliseconds.
130
+ * Useful for spotting slow SMTP servers or API latency in the Lens UI.
131
+ */
132
+ durationMs?: number;
133
+ /**
134
+ * Raw response from the driver (shape varies per driver).
135
+ * e.g. Nodemailer's SentMessageInfo, Resend's CreateEmailResponse
136
+ */
137
+ driverResponse?: unknown;
138
+ /**
139
+ * App-defined tags for Lens UI filtering and grouping.
140
+ * e.g. ["transactional", "welcome", "order-confirm"]
141
+ */
142
+ tags?: string[];
143
+ }
144
+ /**
145
+ * The complete, stored mail record in LensJS.
146
+ *
147
+ * Contains everything needed to:
148
+ * - Reconstruct a valid RFC 5322 .eml file
149
+ * - Display a rich mail detail view in the Lens UI
150
+ * - Filter, search, and audit sent mail
151
+ */
152
+ interface MailEntry {
153
+ /** LensJS internal UUID for this requet id */
154
+ requestId: string;
155
+ /** "From:" header — who composed the message */
156
+ from: Mailbox[];
157
+ /**
158
+ * "Sender:" header — the actual submitting agent.
159
+ * Required by RFC 5322 §3.6.2 when `from` contains multiple addresses.
160
+ */
161
+ sender?: Mailbox;
162
+ /** "To:" header — primary recipients */
163
+ to: Mailbox[];
164
+ /** "Cc:" header — carbon copy recipients */
165
+ cc?: Mailbox[];
166
+ /**
167
+ * "Bcc:" header — blind carbon copy recipients.
168
+ *
169
+ * ⚠️ MUST NOT be serialized into the .eml header block.
170
+ * Stored here for LensJS audit/display purposes only.
171
+ */
172
+ bcc?: Mailbox[];
173
+ /** "Reply-To:" header — where replies should be directed */
174
+ replyTo?: Mailbox[];
175
+ /**
176
+ * "Message-ID:" header.
177
+ * Format: "<local-part@domain>"
178
+ * Generated by the driver or LensJS if absent.
179
+ */
180
+ messageId?: string;
181
+ /**
182
+ * "In-Reply-To:" header.
183
+ * Message-ID of the message being replied to.
184
+ */
185
+ inReplyTo?: string;
186
+ /**
187
+ * "References:" header.
188
+ * Ordered list of Message-IDs forming the thread chain.
189
+ * Serializes as a single space-separated string.
190
+ */
191
+ references?: string | string[];
192
+ /** "Subject:" header */
193
+ subject?: string;
194
+ /**
195
+ * "Date:" header — when the message was composed/submitted.
196
+ * ISO 8601 string. Serializes to RFC 2822 format: "Tue, 17 Feb 2026 10:30:00 +0000"
197
+ */
198
+ date?: string;
199
+ /**
200
+ * Message priority.
201
+ * Maps to both "X-Priority" (1=high, 3=normal, 5=low) and "Importance:" headers.
202
+ */
203
+ priority?: "high" | "normal" | "low";
204
+ /**
205
+ * All message-level headers, in order, including duplicates.
206
+ * Preserves casing and ordering — essential for DKIM validation
207
+ * and faithful .eml reconstruction.
208
+ *
209
+ * The typed fields above (subject, date, messageId, etc.) are
210
+ * derived from these for convenience. This array is the source of truth.
211
+ */
212
+ headers: MailHeader[];
213
+ /**
214
+ * The full MIME tree of the message.
215
+ * The root part's contentType drives the overall message structure
216
+ * (text/plain, multipart/alternative, multipart/mixed, etc.).
217
+ */
218
+ mime: MimePart;
219
+ /**
220
+ * SMTP-level envelope (MAIL FROM / RCPT TO).
221
+ * May differ from the From:/To: message headers.
222
+ * Populated by the driver after handoff.
223
+ */
224
+ envelope?: MailEnvelope;
225
+ /**
226
+ * The full RFC 822 raw message source, if available.
227
+ * Having this means you can always serve a byte-perfect .eml download
228
+ * without needing to re-serialize from the parsed fields.
229
+ */
230
+ raw?: MailRawSource;
231
+ /** LensJS watcher metadata — never serialized into .eml */
232
+ meta: MailMeta;
233
+ }
234
+
235
+ export type { MailEntry, MailEnvelope, MailHeader, MailMeta, MailRawSource, Mailbox, MimePart };
@@ -0,0 +1,235 @@
1
+ /**
2
+ * LensJS — Mail Watcher Contract
3
+ *
4
+ * Driver-agnostic. Works with Nodemailer, Resend, SES, SendGrid, SMTP, etc.
5
+ * Contains everything needed to reconstruct a valid RFC 5322 .eml file
6
+ */
7
+ /**
8
+ * A single email address with an optional display name.
9
+ * Serializes to: "Display Name <user@example.com>" or "user@example.com"
10
+ */
11
+ interface Mailbox {
12
+ address: string;
13
+ name?: string;
14
+ }
15
+ /**
16
+ * A single RFC 5322 header field.
17
+ *
18
+ * Using a structured type (vs Record<string, string>) preserves:
19
+ * - Header ordering (critical for DKIM, Received chains, etc.)
20
+ * - Duplicate headers (e.g. multiple "Received:" lines)
21
+ * - Original casing (RFC 5322 is case-insensitive but real-world parsers vary)
22
+ */
23
+ interface MailHeader {
24
+ name: string;
25
+ value: string;
26
+ raw?: string;
27
+ }
28
+ /**
29
+ * SMTP envelope — separate from message headers.
30
+ * These are the MAIL FROM / RCPT TO values negotiated at the SMTP level,
31
+ * which may differ from the From:/To: headers in the message itself.
32
+ */
33
+ interface MailEnvelope {
34
+ mailFrom?: string;
35
+ rcptTo?: string[];
36
+ }
37
+ /**
38
+ * A single node in the MIME tree.
39
+ *
40
+ * Leaf nodes (text/plain, text/html, image/png, etc.) carry a `body`.
41
+ * Multipart nodes (multipart/mixed, multipart/alternative, etc.) carry `parts`.
42
+ *
43
+ * Typical tree shapes:
44
+ *
45
+ * Plain text only:
46
+ * text/plain
47
+ *
48
+ * HTML + plain fallback:
49
+ * multipart/alternative
50
+ * text/plain
51
+ * text/html
52
+ *
53
+ * HTML + inline images:
54
+ * multipart/related
55
+ * multipart/alternative
56
+ * text/plain
57
+ * text/html
58
+ * image/png (Content-ID: <cid@domain>)
59
+ *
60
+ * With attachments:
61
+ * multipart/mixed
62
+ * multipart/related
63
+ * multipart/alternative
64
+ * text/plain
65
+ * text/html
66
+ * image/png
67
+ * application/pdf (Content-Disposition: attachment)
68
+ */
69
+ interface MimePart {
70
+ /** Full MIME content-type, e.g. "multipart/alternative", "text/html" */
71
+ contentType: string;
72
+ /** Content-Disposition value for this part */
73
+ contentDisposition?: "inline" | "attachment";
74
+ /** Charset parameter, e.g. "UTF-8" (leaf text parts) */
75
+ charset?: string;
76
+ /** Content-Transfer-Encoding, e.g. "base64", "quoted-printable", "7bit" */
77
+ transferEncoding?: string;
78
+ /** Attachment/inline filename (Content-Disposition filename param) */
79
+ filename?: string;
80
+ /**
81
+ * Content-ID for CID-embedded inline content.
82
+ * Format: "<unique-id@domain>"
83
+ * Referenced in HTML as: src="cid:unique-id@domain"
84
+ */
85
+ contentId?: string;
86
+ /**
87
+ * Decoded body for leaf nodes. Undefined on multipart nodes.
88
+ * If transferEncoding is "base64", this string is base64 encoded.
89
+ */
90
+ body?: string;
91
+ /** Size in bytes of the decoded body */
92
+ size?: number;
93
+ /** Headers belonging to this specific MIME part */
94
+ headers: MailHeader[];
95
+ /** Child parts — populated only for multipart/* content types */
96
+ parts?: MimePart[];
97
+ }
98
+ /**
99
+ * Structured content container for the raw EML source.
100
+ */
101
+ interface MailRawSource {
102
+ /** The actual EML content string */
103
+ body: string;
104
+ /** Encoding of the body string (e.g., "base64" if binary, or undefined/empty for plain text) */
105
+ transferEncoding?: string;
106
+ }
107
+ /**
108
+ * LensJS-specific runtime metadata about how and when a message was sent.
109
+ * Entirely separate from RFC headers — never serialized into .eml.
110
+ */
111
+ interface MailMeta {
112
+ /** The driver that sent the message: "nodemailer" | "resend" | "ses" | "sendgrid" | etc. */
113
+ driver: string;
114
+ /**
115
+ * The transport mechanism used by the driver.
116
+ * "smtp" | "api" | "sendmail" | "queue" | "stream"
117
+ */
118
+ transport?: string;
119
+ /** Delivery state */
120
+ status: "pending" | "sent" | "failed";
121
+ /** Failure reason — populated when status is "failed" */
122
+ error?: string;
123
+ /**
124
+ * ISO 8601 timestamp of when the driver accepted/sent the message.
125
+ * Distinct from the RFC 5322 "Date:" header, which is composition time.
126
+ */
127
+ sentAt?: string;
128
+ /**
129
+ * How long the send operation took, in milliseconds.
130
+ * Useful for spotting slow SMTP servers or API latency in the Lens UI.
131
+ */
132
+ durationMs?: number;
133
+ /**
134
+ * Raw response from the driver (shape varies per driver).
135
+ * e.g. Nodemailer's SentMessageInfo, Resend's CreateEmailResponse
136
+ */
137
+ driverResponse?: unknown;
138
+ /**
139
+ * App-defined tags for Lens UI filtering and grouping.
140
+ * e.g. ["transactional", "welcome", "order-confirm"]
141
+ */
142
+ tags?: string[];
143
+ }
144
+ /**
145
+ * The complete, stored mail record in LensJS.
146
+ *
147
+ * Contains everything needed to:
148
+ * - Reconstruct a valid RFC 5322 .eml file
149
+ * - Display a rich mail detail view in the Lens UI
150
+ * - Filter, search, and audit sent mail
151
+ */
152
+ interface MailEntry {
153
+ /** LensJS internal UUID for this requet id */
154
+ requestId: string;
155
+ /** "From:" header — who composed the message */
156
+ from: Mailbox[];
157
+ /**
158
+ * "Sender:" header — the actual submitting agent.
159
+ * Required by RFC 5322 §3.6.2 when `from` contains multiple addresses.
160
+ */
161
+ sender?: Mailbox;
162
+ /** "To:" header — primary recipients */
163
+ to: Mailbox[];
164
+ /** "Cc:" header — carbon copy recipients */
165
+ cc?: Mailbox[];
166
+ /**
167
+ * "Bcc:" header — blind carbon copy recipients.
168
+ *
169
+ * ⚠️ MUST NOT be serialized into the .eml header block.
170
+ * Stored here for LensJS audit/display purposes only.
171
+ */
172
+ bcc?: Mailbox[];
173
+ /** "Reply-To:" header — where replies should be directed */
174
+ replyTo?: Mailbox[];
175
+ /**
176
+ * "Message-ID:" header.
177
+ * Format: "<local-part@domain>"
178
+ * Generated by the driver or LensJS if absent.
179
+ */
180
+ messageId?: string;
181
+ /**
182
+ * "In-Reply-To:" header.
183
+ * Message-ID of the message being replied to.
184
+ */
185
+ inReplyTo?: string;
186
+ /**
187
+ * "References:" header.
188
+ * Ordered list of Message-IDs forming the thread chain.
189
+ * Serializes as a single space-separated string.
190
+ */
191
+ references?: string | string[];
192
+ /** "Subject:" header */
193
+ subject?: string;
194
+ /**
195
+ * "Date:" header — when the message was composed/submitted.
196
+ * ISO 8601 string. Serializes to RFC 2822 format: "Tue, 17 Feb 2026 10:30:00 +0000"
197
+ */
198
+ date?: string;
199
+ /**
200
+ * Message priority.
201
+ * Maps to both "X-Priority" (1=high, 3=normal, 5=low) and "Importance:" headers.
202
+ */
203
+ priority?: "high" | "normal" | "low";
204
+ /**
205
+ * All message-level headers, in order, including duplicates.
206
+ * Preserves casing and ordering — essential for DKIM validation
207
+ * and faithful .eml reconstruction.
208
+ *
209
+ * The typed fields above (subject, date, messageId, etc.) are
210
+ * derived from these for convenience. This array is the source of truth.
211
+ */
212
+ headers: MailHeader[];
213
+ /**
214
+ * The full MIME tree of the message.
215
+ * The root part's contentType drives the overall message structure
216
+ * (text/plain, multipart/alternative, multipart/mixed, etc.).
217
+ */
218
+ mime: MimePart;
219
+ /**
220
+ * SMTP-level envelope (MAIL FROM / RCPT TO).
221
+ * May differ from the From:/To: message headers.
222
+ * Populated by the driver after handoff.
223
+ */
224
+ envelope?: MailEnvelope;
225
+ /**
226
+ * The full RFC 822 raw message source, if available.
227
+ * Having this means you can always serve a byte-perfect .eml download
228
+ * without needing to re-serialize from the parsed fields.
229
+ */
230
+ raw?: MailRawSource;
231
+ /** LensJS watcher metadata — never serialized into .eml */
232
+ meta: MailMeta;
233
+ }
234
+
235
+ export type { MailEntry, MailEnvelope, MailHeader, MailMeta, MailRawSource, Mailbox, MimePart };
File without changes
@@ -0,0 +1 @@
1
+ import{j as t}from"./index-DuJe0XlW.js";const o=({action:e})=>{const r={hit:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",miss:"bg-amber-500/10 text-amber-400 border-amber-500/20",write:"bg-sky-500/10 text-sky-400 border-sky-500/20",delete:"bg-rose-500/10 text-rose-400 border-rose-500/20",clear:"bg-slate-500/10 text-slate-400 border-slate-500/20"};return t.jsx("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-bold border uppercase tracking-wider ${r[e]||r.clear}`,children:e})};export{o as C};
@@ -0,0 +1 @@
1
+ import{j as a}from"./index-DuJe0XlW.js";import{L as s}from"./LoadMore-BN7PRRRi.js";import{T as t}from"./Table-DHM1Nl4B.js";import{g as r}from"./columns-DbVoTM0z.js";import"./index-BRRKsoNv.js";import"./CacheActionBadge-BjZ4pc-P.js";const p=({hasMoreObject:o})=>a.jsxs("div",{className:"w-full",children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsx(t,{columns:r(),data:o.data})}),a.jsx(s,{paginatedPage:o})]});export{p as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CacheEntriesTable-CrVfGRQp.js","./index-DuJe0XlW.js","./index-DyMy6gzm.css","./LoadMore-BN7PRRRi.js","./Table-DHM1Nl4B.js","./columns-DbVoTM0z.js","./index-BRRKsoNv.js","./CacheActionBadge-BjZ4pc-P.js"])))=>i.map(i=>d[i]);
2
+ import{r as t,j as a,_ as s}from"./index-DuJe0XlW.js";import{u as i}from"./useLoadMore-DdSLuDVd.js";import{u as m}from"./useCacheEntries-ClCDpOYz.js";import"./useLensApi-SUqoFD39.js";const n=t.lazy(()=>s(()=>import("./CacheEntriesTable-CrVfGRQp.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)),_=()=>{const{loadMoreItems:e,getItems:r}=m(),o=i({paginatedPage:e});return t.useEffect(()=>{r()},[]),a.jsx(n,{hasMoreObject:o})};export{_ as default};
@@ -1 +1 @@
1
- import{j as a,L as s,q as r,k as i}from"./index-Bg3-m46L.js";import{D as o,T as n}from"./TabbedDataViewer-CJN6R11V.js";import{C as u}from"./CacheActionBadge-B0d8J3l3.js";import d from"./JsonViewer-CsEn0XaU.js";import"./copy-CwmmSmiO.js";function b({data:e}){const t=[e.lens_entry_id?{label:"Request",value:a.jsx(s,{to:`${r(i()).REQUESTS}/${e.lens_entry_id}`,className:"text-blue-600 hover:underline font-semibold",children:"View Request"}),className:"text-gray-900 dark:text-gray-100"}:null,{label:"Operation",value:a.jsx(u,{action:e.data.action}),className:"text-gray-900 dark:text-gray-100"},e.data.data.key?{label:"Key",value:e.data.data.key??"__",className:"text-gray-900 dark:text-gray-100"}:null].filter(l=>!!l);return a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsx(o,{title:"Details",items:t}),a.jsx(n,{tabs:[{id:"value",label:"Value",shouldShow:!!e.data.data.value,content:a.jsx(d,{data:e.data.data.value})}],defaultActiveTab:"value"})]})}export{b as default};
1
+ import{j as a,L as s,a as r,b as i}from"./index-DuJe0XlW.js";import{D as o,T as n}from"./TabbedDataViewer-CSqO-90o.js";import{C as u}from"./CacheActionBadge-BjZ4pc-P.js";import d from"./JsonViewer-ATo_F1hS.js";import"./copy-DkbKgCsc.js";function b({data:e}){const t=[e.lens_entry_id?{label:"Request",value:a.jsx(s,{to:`${r(i()).REQUESTS}/${e.lens_entry_id}`,className:"text-blue-600 hover:underline font-semibold",children:"View Request"}),className:"text-gray-900 dark:text-gray-100"}:null,{label:"Operation",value:a.jsx(u,{action:e.data.action}),className:"text-gray-900 dark:text-gray-100"},e.data.data.key?{label:"Key",value:e.data.data.key??"__",className:"text-gray-900 dark:text-gray-100"}:null].filter(l=>!!l);return a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsx(o,{title:"Details",items:t}),a.jsx(n,{tabs:[{id:"value",label:"Value",shouldShow:!!e.data.data.value,content:a.jsx(d,{data:e.data.data.value})}],defaultActiveTab:"value"})]})}export{b as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CacheEntryDetails-DeBbBbPE.js","./index-DuJe0XlW.js","./index-DyMy6gzm.css","./TabbedDataViewer-CSqO-90o.js","./CacheActionBadge-BjZ4pc-P.js","./JsonViewer-ATo_F1hS.js","./copy-DkbKgCsc.js"])))=>i.map(i=>d[i]);
2
+ import{u as o,r as s,j as r,_ as i}from"./index-DuJe0XlW.js";import{u as m}from"./useCacheEntries-ClCDpOYz.js";import"./useLensApi-SUqoFD39.js";const n=s.lazy(()=>i(()=>import("./CacheEntryDetails-DeBbBbPE.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),E=()=>{const{item:e,getItem:a}=m(),{id:t}=o();return s.useEffect(()=>{t&&a(t)},[t]),r.jsx("div",{children:e&&r.jsx(n,{data:e})})};export{E as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ExceptionTable-CpkppRjX.js","./index-DuJe0XlW.js","./index-DyMy6gzm.css","./LoadMore-BN7PRRRi.js","./Table-DHM1Nl4B.js","./columns-B3JsHnVe.js","./index-BRRKsoNv.js"])))=>i.map(i=>d[i]);
2
+ import{r as t,j as s,_ as a}from"./index-DuJe0XlW.js";import{u as i}from"./useLoadMore-DdSLuDVd.js";import{u as m}from"./useExceptions-DeHzgA7U.js";import"./useLensApi-SUqoFD39.js";const n=t.lazy(()=>a(()=>import("./ExceptionTable-CpkppRjX.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),_=()=>{const{loadMoreItems:e,getItems:o}=m(),r=i({paginatedPage:e});return t.useEffect(()=>{o()},[]),s.jsx(n,{hasMoreObject:r})};export{_ as default};
@@ -1,4 +1,4 @@
1
- import{v as g,j as e,L as j,q as N,k as v}from"./index-Bg3-m46L.js";import{D as w,T as S}from"./TabbedDataViewer-CJN6R11V.js";/**
1
+ import{c as g,j as e,L as j,a as N,b as v}from"./index-DuJe0XlW.js";import{D as w,T as S}from"./TabbedDataViewer-CSqO-90o.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -13,4 +13,4 @@ import{v as g,j as e,L as j,q as N,k as v}from"./index-Bg3-m46L.js";import{D as
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */const F=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],u=g("list",F),_=r=>{try{const a=[],s=[{type:"comment",regex:/(\/\/.*$|\/\*[\s\S]*?\*\/)/g},{type:"string",regex:/(["'`])((?:\\.|(?!\1)[^\\])*?)\1/g},{type:"template",regex:/`([^`\\]|\\.)*`/g},{type:"keyword",regex:/\b(const|let|var|function|class|if|else|for|while|return|import|export|from|try|catch|throw|async|await|new|this|super|extends|implements|interface|type|enum|namespace|public|private|protected|static|readonly|abstract|void|null|undefined|true|false)\b/g},{type:"function",regex:/\b([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?=\()/g},{type:"className",regex:/\bclass\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/g},{type:"property",regex:/\.([a-zA-Z_$][a-zA-Z0-9_$]*)/g},{type:"number",regex:/\b\d+(\.\d+)?\b/g},{type:"operator",regex:/[+\-*/%=<>!&|^~?:]/g},{type:"bracket",regex:/[(){}\[\]]/g}],t=[];s.forEach(({type:l,regex:c})=>{try{let n;for(;(n=c.exec(r))!==null;)l==="className"&&n[1]?t.push({start:n.index+n[0].indexOf(n[1]),end:n.index+n[0].indexOf(n[1])+n[1].length,type:"className",text:n[1]}):l==="property"&&n[1]?t.push({start:n.index+1,end:n.index+n[0].length,type:"property",text:n[1]}):t.push({start:n.index,end:n.index+n[0].length,type:l,text:n[0]})}catch(n){console.warn(`Regex error for type ${l}:`,n)}}),t.sort((l,c)=>l.start-c.start);const o=[];let i=0;for(const l of t)l.start>=i&&(o.push(l),i=l.end);let d=0;for(const l of o)l.start>d&&a.push({text:r.slice(d,l.start),type:"text"}),a.push({text:l.text,type:l.type}),d=l.end;return d<r.length&&a.push({text:r.slice(d),type:"text"}),a}catch(a){return console.error("Error highlighting code:",a),[{text:r,type:"text"}]}},M=r=>{switch(r){case"comment":return"text-green-600 dark:text-green-400 italic";case"string":case"template":return"text-orange-600 dark:text-orange-400";case"keyword":return"text-blue-600 dark:text-blue-400 font-semibold";case"function":return"text-yellow-600 dark:text-yellow-400 font-medium";case"className":return"text-teal-600 dark:text-teal-400 font-semibold";case"property":return"text-indigo-600 dark:text-indigo-400";case"number":return"text-purple-600 dark:text-purple-400";case"operator":return"text-pink-600 dark:text-pink-400";case"bracket":return"text-gray-600 dark:text-gray-400 font-semibold";default:return"text-gray-800 dark:text-gray-200"}},f=({message:r})=>e.jsxs("div",{className:"p-4 text-center text-red-500 dark:text-red-400 bg-red-50 dark:bg-red-900/20 rounded-lg border border-red-200 dark:border-red-800",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[e.jsx(y,{className:"w-5 h-5"}),e.jsx("span",{className:"font-semibold",children:"Error Loading Code Frame"})]}),e.jsx("p",{className:"text-sm",children:r})]}),z=({code:r})=>{try{const a=_(r);return e.jsx("code",{className:"font-mono text-sm leading-5 whitespace-pre tracking-normal",children:a.map((s,t)=>e.jsx("span",{className:M(s.type),children:s.text},t))})}catch(a){return console.error("Error rendering syntax highlighter:",a),e.jsx("code",{className:"font-mono text-sm leading-5 whitespace-pre text-gray-800 dark:text-gray-200",children:r})}},L=({file:r,line:a,column:s})=>e.jsx("div",{className:"px-4 py-2 bg-gradient-to-r from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-700 border-b border-gray-200 dark:border-gray-600",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(y,{className:"w-4 h-4 text-red-500 dark:text-red-400"}),e.jsx("span",{className:"font-semibold text-red-600 dark:text-red-400",children:"Error Location"})]}),e.jsx("div",{className:"h-4 w-px bg-gray-300 dark:bg-gray-600"}),e.jsx("div",{className:"font-mono text-gray-700 dark:text-gray-300 bg-gray-200 dark:bg-gray-600 px-2 py-1 rounded text-xs truncate max-w-xs",title:r,children:r||"Unknown file"}),e.jsxs("span",{className:"text-gray-500 dark:text-gray-400 text-xs",children:["Line ",a||"?",":",s||"?"]})]})}),C=({column:r})=>e.jsx("div",{className:"mt-2",children:e.jsx("div",{className:"absolute flex items-center gap-2 z-20",style:{left:`${Math.max(0,(r-1)*.6)}em`},children:e.jsx("span",{className:"text-red-500 -mt-2 dark:text-red-400 font-semibold font-mono",children:"^"})})}),T=({codeLine:r,lineNumber:a,isErrorLine:s,column:t})=>e.jsxs("div",{className:`flex group ${s?"bg-red-50 dark:bg-red-950/30":"hover:bg-gray-50 dark:hover:bg-gray-800/30"}`,children:[e.jsx("div",{className:`flex-shrink-0 w-16 py-1 px-3 text-right select-none text-sm font-mono tabular-nums border-r ${s?"text-red-500 dark:text-red-400 font-bold bg-red-100 dark:bg-red-900/40 border-red-300 dark:border-red-700":"text-gray-500 dark:text-gray-400 bg-gray-50 dark:bg-gray-800 border-gray-200 dark:border-gray-700 group-hover:bg-gray-100 dark:group-hover:bg-gray-700"}`,children:a}),e.jsx("div",{className:"flex-1 py-1 px-3 relative min-h-[1.5rem] flex items-start overflow-hidden",children:e.jsxs("div",{className:"w-full font-mono text-sm",children:[e.jsx(z,{code:r||""}),s&&t&&e.jsx(C,{column:t,codeLine:r||""})]})})]}),I=({totalLines:r})=>e.jsx("div",{className:"px-4 py-2 bg-gray-50 dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 text-xs",children:e.jsx("div",{className:"flex items-center justify-between text-gray-600 dark:text-gray-400",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 bg-red-500 rounded-full animate-pulse"}),"Error line highlighted :",e.jsxs("span",{children:[r," lines of context"]})]})})}),h=({message:r})=>e.jsxs("div",{className:"p-4 text-center text-gray-500 dark:text-gray-400 bg-gray-50 dark:bg-gray-800 rounded-lg",children:[e.jsx(p,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:r})]}),q=({codeFrame:r})=>{if(!r)return e.jsx(h,{message:"No code frame available"});try{const{file:a,line:s,column:t,context:o}=r;if(!o||!o.pre&&!o.error&&!o.post)return e.jsx(h,{message:"No code context available"});const{pre:i,error:d,post:l}=o,c=[...i||[],d||"",...l||[]],n=(i||[]).length;return e.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden bg-white dark:bg-gray-900 shadow-lg",children:[e.jsx(L,{file:a||"",line:s||0,column:t||0}),e.jsx("div",{className:"overflow-auto max-h-80 font-mono",children:e.jsx("div",{className:"relative",children:c.map((b,x)=>{const k=(s||1)-n+x,m=x===n;return e.jsx(T,{codeLine:b,lineNumber:k,isErrorLine:m,column:m?t:void 0},x)})})}),e.jsx(I,{totalLines:c.length})]})}catch(a){return console.error("Error rendering CodeFrameViewer:",a),e.jsx(f,{message:"Unable to display code context. Please check the console for details."})}},A=()=>e.jsxs("div",{className:"p-4 text-center text-gray-500 dark:text-gray-400 bg-gray-50 dark:bg-gray-800 rounded-lg",children:[e.jsx(u,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:"No stack trace available"})]}),H=({frameCount:r})=>e.jsx("div",{className:"px-4 py-2 bg-gradient-to-r from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-700 border-b border-gray-200 dark:border-gray-600",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(u,{className:"w-4 h-4 text-orange-500 dark:text-orange-400"}),e.jsx("span",{className:"font-semibold text-orange-600 dark:text-orange-400",children:"Stack Trace"})]}),e.jsx("div",{className:"h-4 w-px bg-gray-300 dark:bg-gray-600"}),e.jsxs("span",{className:"text-gray-500 dark:text-gray-400 text-xs",children:[r," stack frame",r!==1?"s":""]})]})}),V=({file:r,line:a,column:s})=>e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-600 dark:text-gray-400 mb-1",children:[e.jsx(p,{className:"w-3 h-3"}),e.jsx("span",{className:"font-mono truncate max-w-xs",title:r,children:r}),a&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"•"}),e.jsxs("span",{className:"font-mono",children:[a,s?`:${s}`:""]})]})]}),Z=({index:r,isFirst:a})=>e.jsx("div",{className:`flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center text-xs font-semibold ${a?"bg-orange-500 text-white":"bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400"}`,children:r+1}),D=({functionName:r})=>e.jsx("div",{className:"font-mono text-sm font-medium text-gray-900 dark:text-gray-100 mb-1",children:e.jsx("span",{className:"text-blue-600 dark:text-blue-400",children:r})}),R=r=>{const a=[/at\s+(.+?)\s+\((.+?):(\d+):(\d+)\)/,/at\s+(.+?):(\d+):(\d+)/,/(.+?)@(.+?):(\d+):(\d+)/,/(.+)/];for(const s of a){const t=r.match(s);if(t){if(t.length>=5)return{function:t[1]?.trim(),file:t[2]?.trim(),line:t[3],column:t[4],raw:r};if(t.length>=4)return{function:null,file:t[1]?.trim(),line:t[2],column:t[3],raw:r};if(t.length>=4&&t[0].includes("@"))return{function:t[1]?.trim(),file:t[2]?.trim(),line:t[3],column:t[4],raw:r}}}return{function:null,file:null,line:null,column:null,raw:r}},P=({line:r,index:a,isFirst:s})=>{const t=R(r);return e.jsx("div",{className:`group hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors ${s?"bg-orange-50 dark:bg-orange-950/20":""}`,children:e.jsxs("div",{className:"flex items-start gap-3 p-3",children:[e.jsx(Z,{index:a,isFirst:s}),e.jsxs("div",{className:"flex-1 min-w-0",children:[t.function&&e.jsx(D,{functionName:t.function}),t.file&&e.jsx(V,{file:t.file,line:t.line||void 0,column:t.column||void 0}),!t.function&&!t.file&&e.jsx("div",{className:"font-mono text-sm text-gray-700 dark:text-gray-300 break-all",children:t.raw})]}),s&&e.jsx("div",{className:"flex-shrink-0",children:e.jsx("div",{className:"bg-orange-500 text-white px-2 py-1 rounded text-xs font-medium",children:"Origin"})})]})})},O=({traceDepth:r})=>e.jsx("div",{className:"px-4 py-2 bg-gray-50 dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 text-xs",children:e.jsxs("div",{className:"flex items-center justify-between text-gray-600 dark:text-gray-400",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 bg-orange-500 rounded-full"}),"Call stack from error origin"]}),e.jsxs("span",{children:["Trace depth: ",r]})]}),e.jsx("span",{className:"font-mono",children:"Stack Trace"})]})}),U=({trace:r})=>{if(!r||r.length===0)return e.jsx(A,{});try{return e.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden bg-white dark:bg-gray-900 shadow-lg",children:[e.jsx(H,{frameCount:r.length}),e.jsx("div",{className:"overflow-auto max-h-96",children:e.jsx("div",{className:"divide-y divide-gray-100 dark:divide-gray-800",children:r.map((a,s)=>e.jsx(P,{line:a,index:s,isFirst:s===0},s))})}),e.jsx(O,{traceDepth:r.length})]})}catch(a){return console.error("Error rendering StackTraceViewer:",a),e.jsx(f,{message:"Unable to display stack trace. Please check the console for details."})}},G=({data:r})=>{const a=[r.lens_entry_id?{label:"Request",value:e.jsx(j,{to:`${N(v()).REQUESTS}/${r.lens_entry_id}`,className:"text-blue-600 hover:underline font-semibold",children:"View Request"}),className:"text-gray-900 dark:text-gray-100"}:null,r.data.name?{label:"Name",value:r.data.name,className:"text-gray-900 dark:text-gray-100"}:null,r.data.fileInfo?.file?{label:"File",value:r.data.fileInfo?.file,className:"text-gray-900 dark:text-gray-100"}:null,r.data.fileInfo?.function?{label:"Function",value:r.data.fileInfo?.function,className:"text-gray-900 dark:text-gray-100"}:null].filter(t=>!!t),s=[{id:"message",label:"Message",data:r.data.message,shouldShow:!!r.data.message},{id:"stack-trace",label:"Stacktrace",content:e.jsx(U,{trace:r.data.trace||[]}),shouldShow:!!r.data.trace&&r.data.trace.length>0},{id:"location",label:"Location",content:e.jsx(q,{codeFrame:r.data.codeFrame}),shouldShow:!!r.data.codeFrame},{id:"cause",label:"Cause",data:r.data.cause??"",shouldShow:!!r.data.cause&&r.data.cause.length>0},{id:"original-stack",label:"Original Stack",data:r.data.originalStack??"",shouldShow:!!r.data.originalStack&&r.data.originalStack.length>0}];return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(w,{title:"Exception Details",items:a}),e.jsx(S,{tabs:s})]})};export{G as default};
16
+ */const F=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],u=g("list",F),_=r=>{try{const a=[],s=[{type:"comment",regex:/(\/\/.*$|\/\*[\s\S]*?\*\/)/g},{type:"string",regex:/(["'`])((?:\\.|(?!\1)[^\\])*?)\1/g},{type:"template",regex:/`([^`\\]|\\.)*`/g},{type:"keyword",regex:/\b(const|let|var|function|class|if|else|for|while|return|import|export|from|try|catch|throw|async|await|new|this|super|extends|implements|interface|type|enum|namespace|public|private|protected|static|readonly|abstract|void|null|undefined|true|false)\b/g},{type:"function",regex:/\b([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?=\()/g},{type:"className",regex:/\bclass\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/g},{type:"property",regex:/\.([a-zA-Z_$][a-zA-Z0-9_$]*)/g},{type:"number",regex:/\b\d+(\.\d+)?\b/g},{type:"operator",regex:/[+\-*/%=<>!&|^~?:]/g},{type:"bracket",regex:/[(){}\[\]]/g}],t=[];s.forEach(({type:l,regex:c})=>{try{let n;for(;(n=c.exec(r))!==null;)l==="className"&&n[1]?t.push({start:n.index+n[0].indexOf(n[1]),end:n.index+n[0].indexOf(n[1])+n[1].length,type:"className",text:n[1]}):l==="property"&&n[1]?t.push({start:n.index+1,end:n.index+n[0].length,type:"property",text:n[1]}):t.push({start:n.index,end:n.index+n[0].length,type:l,text:n[0]})}catch(n){console.warn(`Regex error for type ${l}:`,n)}}),t.sort((l,c)=>l.start-c.start);const o=[];let i=0;for(const l of t)l.start>=i&&(o.push(l),i=l.end);let d=0;for(const l of o)l.start>d&&a.push({text:r.slice(d,l.start),type:"text"}),a.push({text:l.text,type:l.type}),d=l.end;return d<r.length&&a.push({text:r.slice(d),type:"text"}),a}catch(a){return console.error("Error highlighting code:",a),[{text:r,type:"text"}]}},M=r=>{switch(r){case"comment":return"text-green-600 dark:text-green-400 italic";case"string":case"template":return"text-orange-600 dark:text-orange-400";case"keyword":return"text-blue-600 dark:text-blue-400 font-semibold";case"function":return"text-yellow-600 dark:text-yellow-400 font-medium";case"className":return"text-teal-600 dark:text-teal-400 font-semibold";case"property":return"text-indigo-600 dark:text-indigo-400";case"number":return"text-purple-600 dark:text-purple-400";case"operator":return"text-pink-600 dark:text-pink-400";case"bracket":return"text-gray-600 dark:text-gray-400 font-semibold";default:return"text-gray-800 dark:text-gray-200"}},f=({message:r})=>e.jsxs("div",{className:"p-4 text-center text-red-500 dark:text-red-400 bg-red-50 dark:bg-red-900/20 rounded-lg border border-red-200 dark:border-red-800",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[e.jsx(y,{className:"w-5 h-5"}),e.jsx("span",{className:"font-semibold",children:"Error Loading Code Frame"})]}),e.jsx("p",{className:"text-sm",children:r})]}),z=({code:r})=>{try{const a=_(r);return e.jsx("code",{className:"font-mono text-sm leading-5 whitespace-pre tracking-normal",children:a.map((s,t)=>e.jsx("span",{className:M(s.type),children:s.text},t))})}catch(a){return console.error("Error rendering syntax highlighter:",a),e.jsx("code",{className:"font-mono text-sm leading-5 whitespace-pre text-gray-800 dark:text-gray-200",children:r})}},L=({file:r,line:a,column:s})=>e.jsx("div",{className:"px-4 py-2 bg-gradient-to-r from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-700 border-b border-gray-200 dark:border-gray-600",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(y,{className:"w-4 h-4 text-red-500 dark:text-red-400"}),e.jsx("span",{className:"font-semibold text-red-600 dark:text-red-400",children:"Error Location"})]}),e.jsx("div",{className:"h-4 w-px bg-gray-300 dark:bg-gray-600"}),e.jsx("div",{className:"font-mono text-gray-700 dark:text-gray-300 bg-gray-200 dark:bg-gray-600 px-2 py-1 rounded text-xs truncate max-w-xs",title:r,children:r||"Unknown file"}),e.jsxs("span",{className:"text-gray-500 dark:text-gray-400 text-xs",children:["Line ",a||"?",":",s||"?"]})]})}),C=({column:r})=>e.jsx("div",{className:"mt-2",children:e.jsx("div",{className:"absolute flex items-center gap-2 z-20",style:{left:`${Math.max(0,(r-1)*.6)}em`},children:e.jsx("span",{className:"text-red-500 -mt-2 dark:text-red-400 font-semibold font-mono",children:"^"})})}),T=({codeLine:r,lineNumber:a,isErrorLine:s,column:t})=>e.jsxs("div",{className:`flex group ${s?"bg-red-50 dark:bg-red-950/30":"hover:bg-gray-50 dark:hover:bg-gray-800/30"}`,children:[e.jsx("div",{className:`flex-shrink-0 w-16 py-1 px-3 text-right select-none text-sm font-mono tabular-nums border-r ${s?"text-red-500 dark:text-red-400 font-bold bg-red-100 dark:bg-red-900/40 border-red-300 dark:border-red-700":"text-gray-500 dark:text-gray-400 bg-gray-50 dark:bg-gray-800 border-gray-200 dark:border-gray-700 group-hover:bg-gray-100 dark:group-hover:bg-gray-700"}`,children:a}),e.jsx("div",{className:"flex-1 py-1 px-3 relative min-h-[1.5rem] flex items-start overflow-hidden",children:e.jsxs("div",{className:"w-full font-mono text-sm",children:[e.jsx(z,{code:r||""}),s&&t&&e.jsx(C,{column:t,codeLine:r||""})]})})]}),I=({totalLines:r})=>e.jsx("div",{className:"px-4 py-2 bg-gray-50 dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 text-xs",children:e.jsx("div",{className:"flex items-center justify-between text-gray-600 dark:text-gray-400",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 bg-red-500 rounded-full animate-pulse"}),"Error line highlighted :",e.jsxs("span",{children:[r," lines of context"]})]})})}),h=({message:r})=>e.jsxs("div",{className:"p-4 text-center text-gray-500 dark:text-gray-400 bg-gray-50 dark:bg-gray-800 rounded-lg",children:[e.jsx(p,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:r})]}),A=({codeFrame:r})=>{if(!r)return e.jsx(h,{message:"No code frame available"});try{const{file:a,line:s,column:t,context:o}=r;if(!o||!o.pre&&!o.error&&!o.post)return e.jsx(h,{message:"No code context available"});const{pre:i,error:d,post:l}=o,c=[...i||[],d||"",...l||[]],n=(i||[]).length;return e.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden bg-white dark:bg-gray-900 shadow-lg",children:[e.jsx(L,{file:a||"",line:s||0,column:t||0}),e.jsx("div",{className:"overflow-auto max-h-80 font-mono",children:e.jsx("div",{className:"relative",children:c.map((b,x)=>{const k=(s||1)-n+x,m=x===n;return e.jsx(T,{codeLine:b,lineNumber:k,isErrorLine:m,column:m?t:void 0},x)})})}),e.jsx(I,{totalLines:c.length})]})}catch(a){return console.error("Error rendering CodeFrameViewer:",a),e.jsx(f,{message:"Unable to display code context. Please check the console for details."})}},H=()=>e.jsxs("div",{className:"p-4 text-center text-gray-500 dark:text-gray-400 bg-gray-50 dark:bg-gray-800 rounded-lg",children:[e.jsx(u,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:"No stack trace available"})]}),V=({frameCount:r})=>e.jsx("div",{className:"px-4 py-2 bg-gradient-to-r from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-700 border-b border-gray-200 dark:border-gray-600",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(u,{className:"w-4 h-4 text-orange-500 dark:text-orange-400"}),e.jsx("span",{className:"font-semibold text-orange-600 dark:text-orange-400",children:"Stack Trace"})]}),e.jsx("div",{className:"h-4 w-px bg-gray-300 dark:bg-gray-600"}),e.jsxs("span",{className:"text-gray-500 dark:text-gray-400 text-xs",children:[r," stack frame",r!==1?"s":""]})]})}),Z=({file:r,line:a,column:s})=>e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-600 dark:text-gray-400 mb-1",children:[e.jsx(p,{className:"w-3 h-3"}),e.jsx("span",{className:"font-mono truncate max-w-xs",title:r,children:r}),a&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"•"}),e.jsxs("span",{className:"font-mono",children:[a,s?`:${s}`:""]})]})]}),q=({index:r,isFirst:a})=>e.jsx("div",{className:`flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center text-xs font-semibold ${a?"bg-orange-500 text-white":"bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400"}`,children:r+1}),D=({functionName:r})=>e.jsx("div",{className:"font-mono text-sm font-medium text-gray-900 dark:text-gray-100 mb-1",children:e.jsx("span",{className:"text-blue-600 dark:text-blue-400",children:r})}),R=r=>{const a=[/at\s+(.+?)\s+\((.+?):(\d+):(\d+)\)/,/at\s+(.+?):(\d+):(\d+)/,/(.+?)@(.+?):(\d+):(\d+)/,/(.+)/];for(const s of a){const t=r.match(s);if(t){if(t.length>=5)return{function:t[1]?.trim(),file:t[2]?.trim(),line:t[3],column:t[4],raw:r};if(t.length>=4)return{function:null,file:t[1]?.trim(),line:t[2],column:t[3],raw:r};if(t.length>=4&&t[0].includes("@"))return{function:t[1]?.trim(),file:t[2]?.trim(),line:t[3],column:t[4],raw:r}}}return{function:null,file:null,line:null,column:null,raw:r}},P=({line:r,index:a,isFirst:s})=>{const t=R(r);return e.jsx("div",{className:`group hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors ${s?"bg-orange-50 dark:bg-orange-950/20":""}`,children:e.jsxs("div",{className:"flex items-start gap-3 p-3",children:[e.jsx(q,{index:a,isFirst:s}),e.jsxs("div",{className:"flex-1 min-w-0",children:[t.function&&e.jsx(D,{functionName:t.function}),t.file&&e.jsx(Z,{file:t.file,line:t.line||void 0,column:t.column||void 0}),!t.function&&!t.file&&e.jsx("div",{className:"font-mono text-sm text-gray-700 dark:text-gray-300 break-all",children:t.raw})]}),s&&e.jsx("div",{className:"flex-shrink-0",children:e.jsx("div",{className:"bg-orange-500 text-white px-2 py-1 rounded text-xs font-medium",children:"Origin"})})]})})},O=({traceDepth:r})=>e.jsx("div",{className:"px-4 py-2 bg-gray-50 dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 text-xs",children:e.jsxs("div",{className:"flex items-center justify-between text-gray-600 dark:text-gray-400",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 bg-orange-500 rounded-full"}),"Call stack from error origin"]}),e.jsxs("span",{children:["Trace depth: ",r]})]}),e.jsx("span",{className:"font-mono",children:"Stack Trace"})]})}),U=({trace:r})=>{if(!r||r.length===0)return e.jsx(H,{});try{return e.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden bg-white dark:bg-gray-900 shadow-lg",children:[e.jsx(V,{frameCount:r.length}),e.jsx("div",{className:"overflow-auto max-h-96",children:e.jsx("div",{className:"divide-y divide-gray-100 dark:divide-gray-800",children:r.map((a,s)=>e.jsx(P,{line:a,index:s,isFirst:s===0},s))})}),e.jsx(O,{traceDepth:r.length})]})}catch(a){return console.error("Error rendering StackTraceViewer:",a),e.jsx(f,{message:"Unable to display stack trace. Please check the console for details."})}},G=({data:r})=>{const a=[r.lens_entry_id?{label:"Request",value:e.jsx(j,{to:`${N(v()).REQUESTS}/${r.lens_entry_id}`,className:"text-blue-600 hover:underline font-semibold",children:"View Request"}),className:"text-gray-900 dark:text-gray-100"}:null,r.data.name?{label:"Name",value:r.data.name,className:"text-gray-900 dark:text-gray-100"}:null,r.data.fileInfo?.file?{label:"File",value:r.data.fileInfo?.file,className:"text-gray-900 dark:text-gray-100"}:null,r.data.fileInfo?.function?{label:"Function",value:r.data.fileInfo?.function,className:"text-gray-900 dark:text-gray-100"}:null].filter(t=>!!t),s=[{id:"message",label:"Message",data:r.data.message,shouldShow:!!r.data.message},{id:"stack-trace",label:"Stacktrace",content:e.jsx(U,{trace:r.data.trace||[]}),shouldShow:!!r.data.trace&&r.data.trace.length>0},{id:"location",label:"Location",content:e.jsx(A,{codeFrame:r.data.codeFrame}),shouldShow:!!r.data.codeFrame},{id:"cause",label:"Cause",data:r.data.cause??"",shouldShow:!!r.data.cause&&r.data.cause.length>0},{id:"original-stack",label:"Original Stack",data:r.data.originalStack??"",shouldShow:!!r.data.originalStack&&r.data.originalStack.length>0}];return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(w,{title:"Exception Details",items:a}),e.jsx(S,{tabs:s})]})};export{G as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ExceptionDetails-D2OCJVfz.js","./index-DuJe0XlW.js","./index-DyMy6gzm.css","./TabbedDataViewer-CSqO-90o.js"])))=>i.map(i=>d[i]);
2
+ import{u as a,r as s,j as r,_ as i}from"./index-DuJe0XlW.js";import{u as m}from"./useExceptions-DeHzgA7U.js";import"./useLensApi-SUqoFD39.js";const n=s.lazy(()=>i(()=>import("./ExceptionDetails-D2OCJVfz.js"),__vite__mapDeps([0,1,2,3]),import.meta.url)),x=()=>{const{item:e,getItem:o}=m(),{id:t}=a();return s.useEffect(()=>{t&&o(t)},[t]),r.jsx("div",{children:e&&r.jsx(n,{data:e})})};export{x as default};
@@ -1 +1 @@
1
- import{j as a}from"./index-Bg3-m46L.js";import{L as s}from"./LoadMore-DkgyLoiB.js";import{T as t}from"./Table-C3Y9tdtZ.js";import{g as r}from"./columns-5NhbdeuI.js";import"./index-BRRKsoNv.js";const d=({hasMoreObject:o})=>a.jsxs("div",{className:"w-full",children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsx(t,{columns:r(),data:o.data})}),a.jsx(s,{paginatedPage:o})]});export{d as default};
1
+ import{j as a}from"./index-DuJe0XlW.js";import{L as s}from"./LoadMore-BN7PRRRi.js";import{T as t}from"./Table-DHM1Nl4B.js";import{g as r}from"./columns-B3JsHnVe.js";import"./index-BRRKsoNv.js";const d=({hasMoreObject:o})=>a.jsxs("div",{className:"w-full",children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsx(t,{columns:r(),data:o.data})}),a.jsx(s,{paginatedPage:o})]});export{d as default};