@consilioweb/payload-support 0.6.1 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/views/BillingView/client.cjs +209 -0
  2. package/dist/views/BillingView/client.js +204 -0
  3. package/dist/views/BillingView/index.cjs +34 -0
  4. package/dist/views/BillingView/index.js +29 -0
  5. package/dist/views/ChatView/client.cjs +253 -0
  6. package/dist/views/ChatView/client.js +252 -0
  7. package/dist/views/ChatView/index.cjs +34 -0
  8. package/dist/views/ChatView/index.js +29 -0
  9. package/dist/views/CrmView/client.cjs +233 -0
  10. package/dist/views/CrmView/client.js +232 -0
  11. package/dist/views/CrmView/index.cjs +34 -0
  12. package/dist/views/CrmView/index.js +29 -0
  13. package/dist/views/EmailTrackingView/client.cjs +159 -0
  14. package/dist/views/EmailTrackingView/client.js +154 -0
  15. package/dist/views/EmailTrackingView/index.cjs +34 -0
  16. package/dist/views/EmailTrackingView/index.js +29 -0
  17. package/dist/views/ImportConversationView/client.cjs +205 -0
  18. package/dist/views/ImportConversationView/client.js +204 -0
  19. package/dist/views/ImportConversationView/index.cjs +34 -0
  20. package/dist/views/ImportConversationView/index.js +29 -0
  21. package/dist/views/LogsView/client.cjs +149 -0
  22. package/dist/views/LogsView/client.js +148 -0
  23. package/dist/views/LogsView/index.cjs +32 -0
  24. package/dist/views/LogsView/index.js +27 -0
  25. package/dist/views/NewTicketView/client.cjs +229 -0
  26. package/dist/views/NewTicketView/client.js +224 -0
  27. package/dist/views/NewTicketView/index.cjs +32 -0
  28. package/dist/views/NewTicketView/index.js +27 -0
  29. package/dist/views/PendingEmailsView/client.cjs +173 -0
  30. package/dist/views/PendingEmailsView/client.js +172 -0
  31. package/dist/views/PendingEmailsView/index.cjs +34 -0
  32. package/dist/views/PendingEmailsView/index.js +29 -0
  33. package/dist/views/SupportDashboardView/client.cjs +301 -0
  34. package/dist/views/SupportDashboardView/client.js +296 -0
  35. package/dist/views/SupportDashboardView/index.cjs +34 -0
  36. package/dist/views/SupportDashboardView/index.js +29 -0
  37. package/dist/views/TicketDetailView/client.cjs +850 -0
  38. package/dist/views/TicketDetailView/client.js +844 -0
  39. package/dist/views/TicketDetailView/index.cjs +34 -0
  40. package/dist/views/TicketDetailView/index.js +29 -0
  41. package/dist/views/TicketInboxView/client.cjs +299 -0
  42. package/dist/views/TicketInboxView/client.js +294 -0
  43. package/dist/views/TicketInboxView/index.cjs +32 -0
  44. package/dist/views/TicketInboxView/index.js +27 -0
  45. package/dist/{views.css → views/TicketingSettingsView/TicketingSettings.module.scss} +138 -66
  46. package/dist/views/TicketingSettingsView/client.cjs +733 -0
  47. package/dist/views/TicketingSettingsView/client.js +728 -0
  48. package/dist/views/TicketingSettingsView/index.cjs +34 -0
  49. package/dist/views/TicketingSettingsView/index.js +29 -0
  50. package/dist/views/TimeDashboardView/client.cjs +169 -0
  51. package/dist/views/TimeDashboardView/client.js +164 -0
  52. package/dist/views/TimeDashboardView/index.cjs +34 -0
  53. package/dist/views/TimeDashboardView/index.js +29 -0
  54. package/dist/views/shared/AdminViewHeader.cjs +68 -0
  55. package/dist/views/shared/AdminViewHeader.js +67 -0
  56. package/dist/views/shared/ErrorBoundary.cjs +55 -0
  57. package/dist/views/shared/ErrorBoundary.js +50 -0
  58. package/dist/views/shared/Skeleton.cjs +77 -0
  59. package/dist/views/shared/Skeleton.js +72 -0
  60. package/dist/views/shared/adminTokens.cjs +34 -0
  61. package/dist/views/shared/adminTokens.js +31 -0
  62. package/dist/views/shared/config.cjs +44 -0
  63. package/dist/views/shared/config.js +40 -0
  64. package/dist/views/shared/index.cjs +58 -0
  65. package/dist/views/shared/index.js +5 -0
  66. package/dist/views.cjs +77 -6175
  67. package/dist/views.d.cts +13 -30
  68. package/dist/views.d.ts +13 -30
  69. package/dist/views.js +13 -6165
  70. package/package.json +1 -1
@@ -0,0 +1,204 @@
1
+ "use client";
2
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
+ import { useState, useRef, useCallback } from 'react';
4
+ import { useTranslation } from '../../components/TicketConversation/hooks/useTranslation';
5
+
6
+ function ImportConversationClient() {
7
+ const { t } = useTranslation();
8
+ const [markdown, setMarkdown] = useState("");
9
+ const [fileName, setFileName] = useState("");
10
+ const [isDragOver, setIsDragOver] = useState(false);
11
+ const [preview, setPreview] = useState(null);
12
+ const [result, setResult] = useState(null);
13
+ const [error, setError] = useState("");
14
+ const [loading, setLoading] = useState(false);
15
+ const fileRef = useRef(null);
16
+ const handleFile = useCallback((file) => {
17
+ if (!file.name.endsWith(".md") && !file.name.endsWith(".txt")) {
18
+ setError(t("import.formatError"));
19
+ return;
20
+ }
21
+ if (file.size > 512e3) {
22
+ setError(t("import.sizeError"));
23
+ return;
24
+ }
25
+ setError("");
26
+ setFileName(file.name);
27
+ setResult(null);
28
+ setPreview(null);
29
+ const reader = new FileReader();
30
+ reader.onload = (e) => {
31
+ setMarkdown(e.target?.result);
32
+ };
33
+ reader.readAsText(file);
34
+ }, []);
35
+ const onDrop = useCallback((e) => {
36
+ e.preventDefault();
37
+ setIsDragOver(false);
38
+ const file = e.dataTransfer.files[0];
39
+ if (file) handleFile(file);
40
+ }, [handleFile]);
41
+ const onFileChange = useCallback((e) => {
42
+ const file = e.target.files?.[0];
43
+ if (file) handleFile(file);
44
+ }, [handleFile]);
45
+ const doPreview = useCallback(async () => {
46
+ if (!markdown) return;
47
+ setLoading(true);
48
+ setError("");
49
+ setPreview(null);
50
+ try {
51
+ const res = await fetch("/api/support/import-conversation", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ markdown, previewOnly: true }) });
52
+ const data = await res.json();
53
+ if (!res.ok) {
54
+ setError(data.error || "Erreur");
55
+ return;
56
+ }
57
+ ;
58
+ setPreview(data);
59
+ } catch {
60
+ setError("Erreur reseau");
61
+ } finally {
62
+ setLoading(false);
63
+ }
64
+ }, [markdown]);
65
+ const doImport = useCallback(async () => {
66
+ if (!markdown) return;
67
+ setLoading(true);
68
+ setError("");
69
+ try {
70
+ const res = await fetch("/api/support/import-conversation", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ markdown }) });
71
+ const data = await res.json();
72
+ if (!res.ok) {
73
+ setError(data.error || "Erreur");
74
+ return;
75
+ }
76
+ ;
77
+ setResult(data);
78
+ setPreview(null);
79
+ } catch {
80
+ setError("Erreur reseau");
81
+ } finally {
82
+ setLoading(false);
83
+ }
84
+ }, [markdown]);
85
+ const reset = useCallback(() => {
86
+ setMarkdown("");
87
+ setFileName("");
88
+ setPreview(null);
89
+ setResult(null);
90
+ setError("");
91
+ if (fileRef.current) fileRef.current.value = "";
92
+ }, []);
93
+ const S = {
94
+ page: { padding: "20px 30px", maxWidth: 720, margin: "0 auto" },
95
+ dropzone: { border: "2px dashed var(--theme-elevation-300)", borderRadius: 12, padding: 40, textAlign: "center", cursor: "pointer", transition: "all 150ms" },
96
+ dropzoneDragOver: { border: "2px dashed #2563eb", borderRadius: 12, padding: 40, textAlign: "center", cursor: "pointer", background: "#eff6ff" },
97
+ dropzoneHasFile: { border: "2px solid #22c55e", borderRadius: 12, padding: 40, textAlign: "center", cursor: "pointer", background: "#f0fdf4" },
98
+ btn: { padding: "8px 16px", borderRadius: 8, border: "1px solid var(--theme-elevation-200)", fontSize: 13, cursor: "pointer", background: "var(--theme-elevation-0)", color: "var(--theme-text)", fontWeight: 600 },
99
+ btnPrimary: { padding: "8px 16px", borderRadius: 8, border: "none", fontSize: 13, cursor: "pointer", background: "#2563eb", color: "#fff", fontWeight: 600 },
100
+ btnGreen: { padding: "8px 16px", borderRadius: 8, border: "none", fontSize: 13, cursor: "pointer", background: "#16a34a", color: "#fff", fontWeight: 600 },
101
+ btnAmber: { padding: "8px 16px", borderRadius: 8, border: "none", fontSize: 13, cursor: "pointer", background: "#d97706", color: "#fff", fontWeight: 600 },
102
+ section: { padding: 16, borderRadius: 10, border: "1px solid var(--theme-elevation-150)", marginBottom: 12 },
103
+ infoRow: { display: "flex", justifyContent: "space-between", padding: "4px 0", fontSize: 13 },
104
+ infoLabel: { color: "var(--theme-elevation-500)" },
105
+ infoValue: { fontWeight: 600, color: "var(--theme-text)" },
106
+ msgAdmin: { padding: "8px 12px", borderRadius: 8, background: "#dbeafe", marginBottom: 6 },
107
+ msgClient: { padding: "8px 12px", borderRadius: 8, background: "var(--theme-elevation-50)", marginBottom: 6 },
108
+ resultSuccess: { padding: 20, borderRadius: 10, border: "2px solid #22c55e", background: "#f0fdf4" },
109
+ resultError: { padding: 16, borderRadius: 10, border: "1px solid #fecaca", background: "#fef2f2", color: "#dc2626", marginBottom: 12 }
110
+ };
111
+ return /* @__PURE__ */ jsxs("div", { style: S.page, children: [
112
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 20 }, children: [
113
+ /* @__PURE__ */ jsx("h1", { style: { fontSize: 22, fontWeight: 700, margin: 0 }, children: t("import.title") }),
114
+ result && /* @__PURE__ */ jsx("button", { onClick: reset, style: S.btnPrimary, children: t("import.newImport") })
115
+ ] }),
116
+ !result && /* @__PURE__ */ jsxs("div", { style: isDragOver ? S.dropzoneDragOver : markdown ? S.dropzoneHasFile : S.dropzone, onDragOver: (e) => {
117
+ e.preventDefault();
118
+ setIsDragOver(true);
119
+ }, onDragLeave: () => setIsDragOver(false), onDrop, onClick: () => fileRef.current?.click(), children: [
120
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 24, marginBottom: 8 }, children: "\u2191" }),
121
+ /* @__PURE__ */ jsx("p", { style: { fontSize: 14, color: "var(--theme-text)" }, children: markdown ? t("import.dropzoneLoaded") : t("import.dropzoneText") }),
122
+ !markdown && /* @__PURE__ */ jsx("p", { style: { fontSize: 12, color: "var(--theme-elevation-400)", marginTop: 8 }, children: t("import.acceptedFormats") }),
123
+ fileName && /* @__PURE__ */ jsx("p", { style: { fontSize: 12, fontWeight: 600, marginTop: 8 }, children: fileName }),
124
+ /* @__PURE__ */ jsx("input", { ref: fileRef, type: "file", accept: ".md,.txt", onChange: onFileChange, style: { display: "none" } })
125
+ ] }),
126
+ error && /* @__PURE__ */ jsxs("div", { style: S.resultError, children: [
127
+ /* @__PURE__ */ jsx("strong", { children: t("common.error") }),
128
+ /* @__PURE__ */ jsx("p", { style: { margin: "4px 0 0" }, children: error })
129
+ ] }),
130
+ markdown && !preview && !result && /* @__PURE__ */ jsx("div", { style: { display: "flex", justifyContent: "center", marginTop: 16 }, children: /* @__PURE__ */ jsx("button", { onClick: doPreview, disabled: loading, style: S.btnAmber, children: loading ? t("import.analyzing") : t("import.preview") }) }),
131
+ preview && /* @__PURE__ */ jsxs(Fragment, { children: [
132
+ /* @__PURE__ */ jsxs("div", { style: S.section, children: [
133
+ /* @__PURE__ */ jsx("div", { style: { fontWeight: 700, marginBottom: 8 }, children: t("import.client") }),
134
+ /* @__PURE__ */ jsxs("div", { style: S.infoRow, children: [
135
+ /* @__PURE__ */ jsx("span", { style: S.infoLabel, children: t("import.name") }),
136
+ /* @__PURE__ */ jsx("span", { style: S.infoValue, children: preview.client.name })
137
+ ] }),
138
+ /* @__PURE__ */ jsxs("div", { style: S.infoRow, children: [
139
+ /* @__PURE__ */ jsx("span", { style: S.infoLabel, children: t("import.email") }),
140
+ /* @__PURE__ */ jsx("span", { style: S.infoValue, children: preview.client.email })
141
+ ] }),
142
+ /* @__PURE__ */ jsxs("div", { style: S.infoRow, children: [
143
+ /* @__PURE__ */ jsx("span", { style: S.infoLabel, children: t("import.company") }),
144
+ /* @__PURE__ */ jsx("span", { style: S.infoValue, children: preview.client.company })
145
+ ] }),
146
+ /* @__PURE__ */ jsxs("div", { style: S.infoRow, children: [
147
+ /* @__PURE__ */ jsx("span", { style: S.infoLabel, children: t("import.parsing") }),
148
+ /* @__PURE__ */ jsx("span", { style: S.infoValue, children: preview.parseMethod === "structured" ? t("import.parsingRegex") : t("import.parsingAi") })
149
+ ] })
150
+ ] }),
151
+ /* @__PURE__ */ jsxs("div", { style: S.section, children: [
152
+ /* @__PURE__ */ jsxs("div", { style: { fontWeight: 700, marginBottom: 8, display: "flex", justifyContent: "space-between" }, children: [
153
+ /* @__PURE__ */ jsx("span", { children: preview.subject }),
154
+ /* @__PURE__ */ jsxs("span", { style: { color: "var(--theme-elevation-500)", fontSize: 12 }, children: [
155
+ preview.messageCount,
156
+ " ",
157
+ t("import.messages")
158
+ ] })
159
+ ] }),
160
+ preview.messages.map((msg, i) => /* @__PURE__ */ jsxs("div", { style: msg.from === "admin" ? S.msgAdmin : S.msgClient, children: [
161
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "space-between", fontSize: 12, marginBottom: 4 }, children: [
162
+ /* @__PURE__ */ jsxs("span", { style: { fontWeight: 600 }, children: [
163
+ msg.from === "admin" ? ">> " : "<< ",
164
+ msg.name
165
+ ] }),
166
+ /* @__PURE__ */ jsx("span", { style: { color: "var(--theme-elevation-400)" }, children: msg.date })
167
+ ] }),
168
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 13 }, children: msg.preview })
169
+ ] }, i))
170
+ ] }),
171
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 8, justifyContent: "flex-end", marginTop: 12 }, children: [
172
+ /* @__PURE__ */ jsx("button", { onClick: () => setPreview(null), style: S.btn, children: t("common.cancel") }),
173
+ /* @__PURE__ */ jsx("button", { onClick: doImport, disabled: loading, style: S.btnGreen, children: loading ? t("import.importing") : t("import.importButton", { count: String(preview.messageCount) }) })
174
+ ] })
175
+ ] }),
176
+ result && /* @__PURE__ */ jsxs("div", { style: S.resultSuccess, children: [
177
+ /* @__PURE__ */ jsx("div", { style: { fontWeight: 700, fontSize: 16, marginBottom: 12, color: "#166534" }, children: t("import.resultTitle") }),
178
+ /* @__PURE__ */ jsxs("div", { style: S.infoRow, children: [
179
+ /* @__PURE__ */ jsx("span", { style: S.infoLabel, children: t("import.resultTicket") }),
180
+ /* @__PURE__ */ jsx("span", { style: S.infoValue, children: /* @__PURE__ */ jsx("a", { href: `/admin/support/ticket?id=${result.ticketId}`, style: { color: "#2563eb" }, children: result.ticketNumber }) })
181
+ ] }),
182
+ /* @__PURE__ */ jsxs("div", { style: S.infoRow, children: [
183
+ /* @__PURE__ */ jsx("span", { style: S.infoLabel, children: t("import.resultClient") }),
184
+ /* @__PURE__ */ jsxs("span", { style: S.infoValue, children: [
185
+ result.clientName,
186
+ " (",
187
+ result.clientEmail,
188
+ ")",
189
+ result.isNewClient && /* @__PURE__ */ jsx("span", { style: { marginLeft: 8, padding: "1px 6px", borderRadius: 4, background: "#dbeafe", color: "#1e40af", fontSize: 10 }, children: t("import.resultNew") })
190
+ ] })
191
+ ] }),
192
+ /* @__PURE__ */ jsxs("div", { style: S.infoRow, children: [
193
+ /* @__PURE__ */ jsx("span", { style: S.infoLabel, children: t("import.resultCompany") }),
194
+ /* @__PURE__ */ jsx("span", { style: S.infoValue, children: result.clientCompany })
195
+ ] }),
196
+ /* @__PURE__ */ jsxs("div", { style: S.infoRow, children: [
197
+ /* @__PURE__ */ jsx("span", { style: S.infoLabel, children: t("import.resultMessages") }),
198
+ /* @__PURE__ */ jsx("span", { style: S.infoValue, children: t("import.resultImported", { count: String(result.messagesImported) }) })
199
+ ] })
200
+ ] })
201
+ ] });
202
+ }
203
+
204
+ export { ImportConversationClient };
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var templates = require('@payloadcms/next/templates');
7
+ var navigation = require('next/navigation');
8
+ var ErrorBoundary = require('../shared/ErrorBoundary');
9
+ var client = require('./client');
10
+
11
+ const ImportConversationView = ({ initPageResult }) => {
12
+ const { req, visibleEntities } = initPageResult;
13
+ if (!req.user) {
14
+ navigation.redirect("/admin/login");
15
+ }
16
+ return /* @__PURE__ */ jsxRuntime.jsx(
17
+ templates.DefaultTemplate,
18
+ {
19
+ i18n: req.i18n,
20
+ locale: initPageResult.locale,
21
+ params: {},
22
+ payload: req.payload,
23
+ permissions: initPageResult.permissions,
24
+ searchParams: {},
25
+ user: req.user,
26
+ visibleEntities,
27
+ children: /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary.AdminErrorBoundary, { viewName: "ImportConversationView", children: /* @__PURE__ */ jsxRuntime.jsx(client.ImportConversationClient, {}) })
28
+ }
29
+ );
30
+ };
31
+ var ImportConversationView_default = ImportConversationView;
32
+
33
+ exports.ImportConversationView = ImportConversationView;
34
+ exports.default = ImportConversationView_default;
@@ -0,0 +1,29 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { DefaultTemplate } from '@payloadcms/next/templates';
3
+ import { redirect } from 'next/navigation';
4
+ import { AdminErrorBoundary } from '../shared/ErrorBoundary';
5
+ import { ImportConversationClient } from './client';
6
+
7
+ const ImportConversationView = ({ initPageResult }) => {
8
+ const { req, visibleEntities } = initPageResult;
9
+ if (!req.user) {
10
+ redirect("/admin/login");
11
+ }
12
+ return /* @__PURE__ */ jsx(
13
+ DefaultTemplate,
14
+ {
15
+ i18n: req.i18n,
16
+ locale: initPageResult.locale,
17
+ params: {},
18
+ payload: req.payload,
19
+ permissions: initPageResult.permissions,
20
+ searchParams: {},
21
+ user: req.user,
22
+ visibleEntities,
23
+ children: /* @__PURE__ */ jsx(AdminErrorBoundary, { viewName: "ImportConversationView", children: /* @__PURE__ */ jsx(ImportConversationClient, {}) })
24
+ }
25
+ );
26
+ };
27
+ var ImportConversationView_default = ImportConversationView;
28
+
29
+ export { ImportConversationView, ImportConversationView_default as default };
@@ -0,0 +1,149 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var react = require('react');
5
+ var navigation = require('next/navigation');
6
+ var useTranslation = require('../../components/TicketConversation/hooks/useTranslation');
7
+
8
+ function fmtDate(d) {
9
+ return new Date(d).toLocaleDateString("fr-FR", { day: "2-digit", month: "2-digit", year: "2-digit", hour: "2-digit", minute: "2-digit" });
10
+ }
11
+ const LogsClient = () => {
12
+ const { t } = useTranslation.useTranslation();
13
+ const searchParams = navigation.useSearchParams();
14
+ const [logType, setLogType] = react.useState(() => {
15
+ const t2 = searchParams.get("type");
16
+ return t2 === "auth" ? "auth" : "email";
17
+ });
18
+ const [logs, setLogs] = react.useState([]);
19
+ const [loading, setLoading] = react.useState(true);
20
+ const [page, setPage] = react.useState(1);
21
+ const [hasMore, setHasMore] = react.useState(false);
22
+ const [totalDocs, setTotalDocs] = react.useState(0);
23
+ const [purgeResult, setPurgeResult] = react.useState(null);
24
+ const collection = logType === "email" ? "email-logs" : "auth-logs";
25
+ const fetchLogs = react.useCallback(async () => {
26
+ try {
27
+ const res = await fetch(`/api/${collection}?sort=-createdAt&limit=30&page=${page}&depth=0`, { credentials: "include" });
28
+ if (res.ok) {
29
+ const d = await res.json();
30
+ setLogs(d.docs || []);
31
+ setHasMore(d.hasNextPage);
32
+ setTotalDocs(d.totalDocs);
33
+ }
34
+ } catch {
35
+ }
36
+ setLoading(false);
37
+ }, [collection, page]);
38
+ react.useEffect(() => {
39
+ setLoading(true);
40
+ setPage(1);
41
+ }, [logType]);
42
+ react.useEffect(() => {
43
+ fetchLogs();
44
+ }, [fetchLogs]);
45
+ const handlePurge = async (days) => {
46
+ const label = days === 0 ? "TOUS les logs" : `les logs de plus de ${days} jours`;
47
+ if (!window.confirm(`Supprimer ${label} (${collection}) ? Cette action est irreversible.`)) return;
48
+ try {
49
+ const res = await fetch(`/api/support/purge-logs?collection=${collection}&days=${days}`, { method: "DELETE", credentials: "include" });
50
+ if (res.ok) {
51
+ const d = await res.json();
52
+ setPurgeResult(`${d.purged} log(s) supprime(s)`);
53
+ setTimeout(() => setPurgeResult(null), 5e3);
54
+ fetchLogs();
55
+ }
56
+ } catch {
57
+ }
58
+ };
59
+ const S = {
60
+ page: { padding: "20px 30px", maxWidth: 1100, margin: "0 auto" },
61
+ header: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 16 },
62
+ title: { fontSize: 22, fontWeight: 700, margin: 0, color: "var(--theme-text)" },
63
+ tabsRow: { display: "flex", gap: 4, marginBottom: 12 },
64
+ tab: { padding: "6px 12px", borderRadius: 6, border: "none", background: "none", cursor: "pointer", fontSize: 13, color: "var(--theme-elevation-500)", fontWeight: 500 },
65
+ tabActive: { background: "var(--theme-elevation-100)", color: "var(--theme-text)", fontWeight: 700 },
66
+ purgeBtn: { padding: "4px 10px", borderRadius: 6, border: "1px solid var(--theme-elevation-200)", fontSize: 11, background: "var(--theme-elevation-0)", cursor: "pointer", color: "var(--theme-text)" },
67
+ table: { width: "100%", borderCollapse: "collapse", fontSize: 13 },
68
+ th: { textAlign: "left", padding: "8px", borderBottom: "1px solid var(--theme-elevation-200)", fontSize: 11, color: "var(--theme-elevation-500)" },
69
+ td: { padding: "8px", borderBottom: "1px solid var(--theme-elevation-100)" },
70
+ badge: { padding: "2px 8px", borderRadius: 4, fontSize: 11, fontWeight: 600 },
71
+ mono: { fontFamily: "monospace", fontSize: 12 }
72
+ };
73
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.page, children: [
74
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.header, children: [
75
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { style: S.title, children: logType === "email" ? t("logs.title") : t("logs.titleAuth") }),
76
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: 6 }, children: [
77
+ /* @__PURE__ */ jsxRuntime.jsx("button", { style: S.purgeBtn, onClick: () => handlePurge(7), children: t("logs.purge7") }),
78
+ /* @__PURE__ */ jsxRuntime.jsx("button", { style: S.purgeBtn, onClick: () => handlePurge(30), children: t("logs.purge30") }),
79
+ /* @__PURE__ */ jsxRuntime.jsx("button", { style: { ...S.purgeBtn, color: "#dc2626", borderColor: "#dc2626" }, onClick: () => handlePurge(0), children: t("logs.purgeAll") })
80
+ ] })
81
+ ] }),
82
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.tabsRow, children: [
83
+ /* @__PURE__ */ jsxRuntime.jsxs("button", { style: { ...S.tab, ...logType === "email" ? S.tabActive : {} }, onClick: () => setLogType("email"), children: [
84
+ t("logs.tabs.email"),
85
+ " (",
86
+ logType === "email" ? totalDocs : "...",
87
+ ")"
88
+ ] }),
89
+ /* @__PURE__ */ jsxRuntime.jsxs("button", { style: { ...S.tab, ...logType === "auth" ? S.tabActive : {} }, onClick: () => setLogType("auth"), children: [
90
+ t("logs.tabs.auth"),
91
+ " (",
92
+ logType === "auth" ? totalDocs : "...",
93
+ ")"
94
+ ] })
95
+ ] }),
96
+ purgeResult && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "8px 14px", borderRadius: 6, background: "#dcfce7", color: "#166534", fontSize: 13, marginBottom: 12 }, children: purgeResult }),
97
+ loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: 40, textAlign: "center", color: "#94a3b8" }, children: t("common.loading") }) : logs.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: 40, textAlign: "center", color: "#94a3b8" }, children: t("logs.noLogs") }) : logType === "email" ? /* @__PURE__ */ jsxRuntime.jsxs("table", { style: S.table, children: [
98
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
99
+ /* @__PURE__ */ jsxRuntime.jsx("th", { style: S.th, children: t("logs.tableHeaders.date") }),
100
+ /* @__PURE__ */ jsxRuntime.jsx("th", { style: S.th, children: t("logs.tableHeaders.status") }),
101
+ /* @__PURE__ */ jsxRuntime.jsx("th", { style: S.th, children: t("logs.tableHeaders.recipient") }),
102
+ /* @__PURE__ */ jsxRuntime.jsx("th", { style: S.th, children: t("logs.tableHeaders.subject") }),
103
+ /* @__PURE__ */ jsxRuntime.jsx("th", { style: S.th, children: t("logs.tableHeaders.action") }),
104
+ /* @__PURE__ */ jsxRuntime.jsx("th", { style: { ...S.th, textAlign: "right" }, children: t("logs.tableHeaders.time") })
105
+ ] }) }),
106
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: logs.map((log) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
107
+ /* @__PURE__ */ jsxRuntime.jsx("td", { style: { ...S.td, ...S.mono }, children: fmtDate(log.createdAt) }),
108
+ /* @__PURE__ */ jsxRuntime.jsx("td", { style: S.td, children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { ...S.badge, background: log.status === "success" ? "#dcfce7" : log.status === "error" ? "#fef2f2" : "#f3f4f6", color: log.status === "success" ? "#16a34a" : log.status === "error" ? "#dc2626" : "#6b7280" }, children: log.status === "success" ? t("logs.statusSuccess") : log.status === "error" ? t("logs.statusError") : t("logs.statusIgnored") }) }),
109
+ /* @__PURE__ */ jsxRuntime.jsx("td", { style: { ...S.td, maxWidth: 200, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, title: log.recipientEmail, children: log.recipientEmail || "--" }),
110
+ /* @__PURE__ */ jsxRuntime.jsx("td", { style: { ...S.td, maxWidth: 200, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, title: log.subject, children: log.subject || "--" }),
111
+ /* @__PURE__ */ jsxRuntime.jsx("td", { style: { ...S.td, fontSize: 12, color: "var(--theme-elevation-500)" }, children: log.action || "--" }),
112
+ /* @__PURE__ */ jsxRuntime.jsx("td", { style: { ...S.td, textAlign: "right" }, children: log.processingTimeMs != null ? /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { ...S.mono, color: log.processingTimeMs > 2e3 ? "#dc2626" : "#16a34a" }, children: [
113
+ log.processingTimeMs,
114
+ "ms"
115
+ ] }) : "--" })
116
+ ] }, log.id)) })
117
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs("table", { style: S.table, children: [
118
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
119
+ /* @__PURE__ */ jsxRuntime.jsx("th", { style: S.th, children: t("logs.tableHeaders.date") }),
120
+ /* @__PURE__ */ jsxRuntime.jsx("th", { style: S.th, children: t("logs.tableHeaders.status") }),
121
+ /* @__PURE__ */ jsxRuntime.jsx("th", { style: S.th, children: t("logs.tableHeaders.email") }),
122
+ /* @__PURE__ */ jsxRuntime.jsx("th", { style: S.th, children: t("logs.tableHeaders.ip") }),
123
+ /* @__PURE__ */ jsxRuntime.jsx("th", { style: S.th, children: t("logs.tableHeaders.userAgent") })
124
+ ] }) }),
125
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: logs.map((log) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
126
+ /* @__PURE__ */ jsxRuntime.jsx("td", { style: { ...S.td, ...S.mono }, children: fmtDate(log.createdAt) }),
127
+ /* @__PURE__ */ jsxRuntime.jsx("td", { style: S.td, children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { ...S.badge, background: log.success ? "#dcfce7" : "#fef2f2", color: log.success ? "#16a34a" : "#dc2626" }, children: log.success ? t("logs.statusSuccess") : t("logs.statusFailed") }) }),
128
+ /* @__PURE__ */ jsxRuntime.jsx("td", { style: { ...S.td, ...S.mono }, children: log.email || "--" }),
129
+ /* @__PURE__ */ jsxRuntime.jsx("td", { style: { ...S.td, ...S.mono }, children: log.ip || "--" }),
130
+ /* @__PURE__ */ jsxRuntime.jsx("td", { style: { ...S.td, fontSize: 11, maxWidth: 200, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: log.userAgent || "--" })
131
+ ] }, log.id)) })
132
+ ] }),
133
+ totalDocs > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "center", gap: 12, marginTop: 16, alignItems: "center" }, children: [
134
+ /* @__PURE__ */ jsxRuntime.jsx("button", { style: S.purgeBtn, onClick: () => setPage((p) => Math.max(1, p - 1)), disabled: page <= 1, children: t("common.previous") }),
135
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontSize: 12, color: "var(--theme-elevation-500)" }, children: [
136
+ t("common.page"),
137
+ " ",
138
+ page,
139
+ " -- ",
140
+ totalDocs,
141
+ " ",
142
+ t("common.results")
143
+ ] }),
144
+ /* @__PURE__ */ jsxRuntime.jsx("button", { style: S.purgeBtn, onClick: () => setPage((p) => p + 1), disabled: !hasMore, children: t("common.next") })
145
+ ] })
146
+ ] });
147
+ };
148
+
149
+ exports.LogsClient = LogsClient;
@@ -0,0 +1,148 @@
1
+ "use client";
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { useState, useCallback, useEffect } from 'react';
4
+ import { useSearchParams } from 'next/navigation';
5
+ import { useTranslation } from '../../components/TicketConversation/hooks/useTranslation';
6
+
7
+ function fmtDate(d) {
8
+ return new Date(d).toLocaleDateString("fr-FR", { day: "2-digit", month: "2-digit", year: "2-digit", hour: "2-digit", minute: "2-digit" });
9
+ }
10
+ const LogsClient = () => {
11
+ const { t } = useTranslation();
12
+ const searchParams = useSearchParams();
13
+ const [logType, setLogType] = useState(() => {
14
+ const t2 = searchParams.get("type");
15
+ return t2 === "auth" ? "auth" : "email";
16
+ });
17
+ const [logs, setLogs] = useState([]);
18
+ const [loading, setLoading] = useState(true);
19
+ const [page, setPage] = useState(1);
20
+ const [hasMore, setHasMore] = useState(false);
21
+ const [totalDocs, setTotalDocs] = useState(0);
22
+ const [purgeResult, setPurgeResult] = useState(null);
23
+ const collection = logType === "email" ? "email-logs" : "auth-logs";
24
+ const fetchLogs = useCallback(async () => {
25
+ try {
26
+ const res = await fetch(`/api/${collection}?sort=-createdAt&limit=30&page=${page}&depth=0`, { credentials: "include" });
27
+ if (res.ok) {
28
+ const d = await res.json();
29
+ setLogs(d.docs || []);
30
+ setHasMore(d.hasNextPage);
31
+ setTotalDocs(d.totalDocs);
32
+ }
33
+ } catch {
34
+ }
35
+ setLoading(false);
36
+ }, [collection, page]);
37
+ useEffect(() => {
38
+ setLoading(true);
39
+ setPage(1);
40
+ }, [logType]);
41
+ useEffect(() => {
42
+ fetchLogs();
43
+ }, [fetchLogs]);
44
+ const handlePurge = async (days) => {
45
+ const label = days === 0 ? "TOUS les logs" : `les logs de plus de ${days} jours`;
46
+ if (!window.confirm(`Supprimer ${label} (${collection}) ? Cette action est irreversible.`)) return;
47
+ try {
48
+ const res = await fetch(`/api/support/purge-logs?collection=${collection}&days=${days}`, { method: "DELETE", credentials: "include" });
49
+ if (res.ok) {
50
+ const d = await res.json();
51
+ setPurgeResult(`${d.purged} log(s) supprime(s)`);
52
+ setTimeout(() => setPurgeResult(null), 5e3);
53
+ fetchLogs();
54
+ }
55
+ } catch {
56
+ }
57
+ };
58
+ const S = {
59
+ page: { padding: "20px 30px", maxWidth: 1100, margin: "0 auto" },
60
+ header: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 16 },
61
+ title: { fontSize: 22, fontWeight: 700, margin: 0, color: "var(--theme-text)" },
62
+ tabsRow: { display: "flex", gap: 4, marginBottom: 12 },
63
+ tab: { padding: "6px 12px", borderRadius: 6, border: "none", background: "none", cursor: "pointer", fontSize: 13, color: "var(--theme-elevation-500)", fontWeight: 500 },
64
+ tabActive: { background: "var(--theme-elevation-100)", color: "var(--theme-text)", fontWeight: 700 },
65
+ purgeBtn: { padding: "4px 10px", borderRadius: 6, border: "1px solid var(--theme-elevation-200)", fontSize: 11, background: "var(--theme-elevation-0)", cursor: "pointer", color: "var(--theme-text)" },
66
+ table: { width: "100%", borderCollapse: "collapse", fontSize: 13 },
67
+ th: { textAlign: "left", padding: "8px", borderBottom: "1px solid var(--theme-elevation-200)", fontSize: 11, color: "var(--theme-elevation-500)" },
68
+ td: { padding: "8px", borderBottom: "1px solid var(--theme-elevation-100)" },
69
+ badge: { padding: "2px 8px", borderRadius: 4, fontSize: 11, fontWeight: 600 },
70
+ mono: { fontFamily: "monospace", fontSize: 12 }
71
+ };
72
+ return /* @__PURE__ */ jsxs("div", { style: S.page, children: [
73
+ /* @__PURE__ */ jsxs("div", { style: S.header, children: [
74
+ /* @__PURE__ */ jsx("h1", { style: S.title, children: logType === "email" ? t("logs.title") : t("logs.titleAuth") }),
75
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 6 }, children: [
76
+ /* @__PURE__ */ jsx("button", { style: S.purgeBtn, onClick: () => handlePurge(7), children: t("logs.purge7") }),
77
+ /* @__PURE__ */ jsx("button", { style: S.purgeBtn, onClick: () => handlePurge(30), children: t("logs.purge30") }),
78
+ /* @__PURE__ */ jsx("button", { style: { ...S.purgeBtn, color: "#dc2626", borderColor: "#dc2626" }, onClick: () => handlePurge(0), children: t("logs.purgeAll") })
79
+ ] })
80
+ ] }),
81
+ /* @__PURE__ */ jsxs("div", { style: S.tabsRow, children: [
82
+ /* @__PURE__ */ jsxs("button", { style: { ...S.tab, ...logType === "email" ? S.tabActive : {} }, onClick: () => setLogType("email"), children: [
83
+ t("logs.tabs.email"),
84
+ " (",
85
+ logType === "email" ? totalDocs : "...",
86
+ ")"
87
+ ] }),
88
+ /* @__PURE__ */ jsxs("button", { style: { ...S.tab, ...logType === "auth" ? S.tabActive : {} }, onClick: () => setLogType("auth"), children: [
89
+ t("logs.tabs.auth"),
90
+ " (",
91
+ logType === "auth" ? totalDocs : "...",
92
+ ")"
93
+ ] })
94
+ ] }),
95
+ purgeResult && /* @__PURE__ */ jsx("div", { style: { padding: "8px 14px", borderRadius: 6, background: "#dcfce7", color: "#166534", fontSize: 13, marginBottom: 12 }, children: purgeResult }),
96
+ loading ? /* @__PURE__ */ jsx("div", { style: { padding: 40, textAlign: "center", color: "#94a3b8" }, children: t("common.loading") }) : logs.length === 0 ? /* @__PURE__ */ jsx("div", { style: { padding: 40, textAlign: "center", color: "#94a3b8" }, children: t("logs.noLogs") }) : logType === "email" ? /* @__PURE__ */ jsxs("table", { style: S.table, children: [
97
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
98
+ /* @__PURE__ */ jsx("th", { style: S.th, children: t("logs.tableHeaders.date") }),
99
+ /* @__PURE__ */ jsx("th", { style: S.th, children: t("logs.tableHeaders.status") }),
100
+ /* @__PURE__ */ jsx("th", { style: S.th, children: t("logs.tableHeaders.recipient") }),
101
+ /* @__PURE__ */ jsx("th", { style: S.th, children: t("logs.tableHeaders.subject") }),
102
+ /* @__PURE__ */ jsx("th", { style: S.th, children: t("logs.tableHeaders.action") }),
103
+ /* @__PURE__ */ jsx("th", { style: { ...S.th, textAlign: "right" }, children: t("logs.tableHeaders.time") })
104
+ ] }) }),
105
+ /* @__PURE__ */ jsx("tbody", { children: logs.map((log) => /* @__PURE__ */ jsxs("tr", { children: [
106
+ /* @__PURE__ */ jsx("td", { style: { ...S.td, ...S.mono }, children: fmtDate(log.createdAt) }),
107
+ /* @__PURE__ */ jsx("td", { style: S.td, children: /* @__PURE__ */ jsx("span", { style: { ...S.badge, background: log.status === "success" ? "#dcfce7" : log.status === "error" ? "#fef2f2" : "#f3f4f6", color: log.status === "success" ? "#16a34a" : log.status === "error" ? "#dc2626" : "#6b7280" }, children: log.status === "success" ? t("logs.statusSuccess") : log.status === "error" ? t("logs.statusError") : t("logs.statusIgnored") }) }),
108
+ /* @__PURE__ */ jsx("td", { style: { ...S.td, maxWidth: 200, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, title: log.recipientEmail, children: log.recipientEmail || "--" }),
109
+ /* @__PURE__ */ jsx("td", { style: { ...S.td, maxWidth: 200, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, title: log.subject, children: log.subject || "--" }),
110
+ /* @__PURE__ */ jsx("td", { style: { ...S.td, fontSize: 12, color: "var(--theme-elevation-500)" }, children: log.action || "--" }),
111
+ /* @__PURE__ */ jsx("td", { style: { ...S.td, textAlign: "right" }, children: log.processingTimeMs != null ? /* @__PURE__ */ jsxs("span", { style: { ...S.mono, color: log.processingTimeMs > 2e3 ? "#dc2626" : "#16a34a" }, children: [
112
+ log.processingTimeMs,
113
+ "ms"
114
+ ] }) : "--" })
115
+ ] }, log.id)) })
116
+ ] }) : /* @__PURE__ */ jsxs("table", { style: S.table, children: [
117
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
118
+ /* @__PURE__ */ jsx("th", { style: S.th, children: t("logs.tableHeaders.date") }),
119
+ /* @__PURE__ */ jsx("th", { style: S.th, children: t("logs.tableHeaders.status") }),
120
+ /* @__PURE__ */ jsx("th", { style: S.th, children: t("logs.tableHeaders.email") }),
121
+ /* @__PURE__ */ jsx("th", { style: S.th, children: t("logs.tableHeaders.ip") }),
122
+ /* @__PURE__ */ jsx("th", { style: S.th, children: t("logs.tableHeaders.userAgent") })
123
+ ] }) }),
124
+ /* @__PURE__ */ jsx("tbody", { children: logs.map((log) => /* @__PURE__ */ jsxs("tr", { children: [
125
+ /* @__PURE__ */ jsx("td", { style: { ...S.td, ...S.mono }, children: fmtDate(log.createdAt) }),
126
+ /* @__PURE__ */ jsx("td", { style: S.td, children: /* @__PURE__ */ jsx("span", { style: { ...S.badge, background: log.success ? "#dcfce7" : "#fef2f2", color: log.success ? "#16a34a" : "#dc2626" }, children: log.success ? t("logs.statusSuccess") : t("logs.statusFailed") }) }),
127
+ /* @__PURE__ */ jsx("td", { style: { ...S.td, ...S.mono }, children: log.email || "--" }),
128
+ /* @__PURE__ */ jsx("td", { style: { ...S.td, ...S.mono }, children: log.ip || "--" }),
129
+ /* @__PURE__ */ jsx("td", { style: { ...S.td, fontSize: 11, maxWidth: 200, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: log.userAgent || "--" })
130
+ ] }, log.id)) })
131
+ ] }),
132
+ totalDocs > 0 && /* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "center", gap: 12, marginTop: 16, alignItems: "center" }, children: [
133
+ /* @__PURE__ */ jsx("button", { style: S.purgeBtn, onClick: () => setPage((p) => Math.max(1, p - 1)), disabled: page <= 1, children: t("common.previous") }),
134
+ /* @__PURE__ */ jsxs("span", { style: { fontSize: 12, color: "var(--theme-elevation-500)" }, children: [
135
+ t("common.page"),
136
+ " ",
137
+ page,
138
+ " -- ",
139
+ totalDocs,
140
+ " ",
141
+ t("common.results")
142
+ ] }),
143
+ /* @__PURE__ */ jsx("button", { style: S.purgeBtn, onClick: () => setPage((p) => p + 1), disabled: !hasMore, children: t("common.next") })
144
+ ] })
145
+ ] });
146
+ };
147
+
148
+ export { LogsClient };
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var templates = require('@payloadcms/next/templates');
7
+ var navigation = require('next/navigation');
8
+ var ErrorBoundary = require('../shared/ErrorBoundary');
9
+ var client = require('./client');
10
+
11
+ const LogsView = ({ initPageResult }) => {
12
+ const { req, visibleEntities } = initPageResult;
13
+ if (!req.user) navigation.redirect("/admin/login");
14
+ return /* @__PURE__ */ jsxRuntime.jsx(
15
+ templates.DefaultTemplate,
16
+ {
17
+ i18n: req.i18n,
18
+ locale: initPageResult.locale,
19
+ params: {},
20
+ payload: req.payload,
21
+ permissions: initPageResult.permissions,
22
+ searchParams: {},
23
+ user: req.user,
24
+ visibleEntities,
25
+ children: /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary.AdminErrorBoundary, { viewName: "LogsView", children: /* @__PURE__ */ jsxRuntime.jsx(client.LogsClient, {}) })
26
+ }
27
+ );
28
+ };
29
+ var LogsView_default = LogsView;
30
+
31
+ exports.LogsView = LogsView;
32
+ exports.default = LogsView_default;
@@ -0,0 +1,27 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { DefaultTemplate } from '@payloadcms/next/templates';
3
+ import { redirect } from 'next/navigation';
4
+ import { AdminErrorBoundary } from '../shared/ErrorBoundary';
5
+ import { LogsClient } from './client';
6
+
7
+ const LogsView = ({ initPageResult }) => {
8
+ const { req, visibleEntities } = initPageResult;
9
+ if (!req.user) redirect("/admin/login");
10
+ return /* @__PURE__ */ jsx(
11
+ DefaultTemplate,
12
+ {
13
+ i18n: req.i18n,
14
+ locale: initPageResult.locale,
15
+ params: {},
16
+ payload: req.payload,
17
+ permissions: initPageResult.permissions,
18
+ searchParams: {},
19
+ user: req.user,
20
+ visibleEntities,
21
+ children: /* @__PURE__ */ jsx(AdminErrorBoundary, { viewName: "LogsView", children: /* @__PURE__ */ jsx(LogsClient, {}) })
22
+ }
23
+ );
24
+ };
25
+ var LogsView_default = LogsView;
26
+
27
+ export { LogsView, LogsView_default as default };