create-nextblock 0.15.8 → 0.15.9

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 (71) hide show
  1. package/package.json +1 -1
  2. package/templates/nextblock-template/app/ToasterProvider.tsx +26 -17
  3. package/templates/nextblock-template/app/actions/contactSellerActions.test.ts +280 -0
  4. package/templates/nextblock-template/app/actions/contactSellerActions.ts +222 -0
  5. package/templates/nextblock-template/app/actions/email-retry.test.ts +62 -0
  6. package/templates/nextblock-template/app/actions/email.ts +241 -110
  7. package/templates/nextblock-template/app/actions/formActions.ts +245 -116
  8. package/templates/nextblock-template/app/actions/interactions.ts +489 -396
  9. package/templates/nextblock-template/app/actions/threadActions.ts +166 -0
  10. package/templates/nextblock-template/app/api/checkout/route.ts +162 -146
  11. package/templates/nextblock-template/app/api/cron/reset-sandbox/sandboxResetSql.ts +664 -1
  12. package/templates/nextblock-template/app/checkout/page.tsx +57 -52
  13. package/templates/nextblock-template/app/cms/CmsClientLayout.tsx +552 -529
  14. package/templates/nextblock-template/app/cms/blocks/editors/FormBlockEditor.tsx +304 -181
  15. package/templates/nextblock-template/app/cms/components/ContactReminderBanner.tsx +75 -0
  16. package/templates/nextblock-template/app/cms/components/PaymentsReminderBanner.tsx +58 -0
  17. package/templates/nextblock-template/app/cms/components/VisibilityControl.tsx +542 -528
  18. package/templates/nextblock-template/app/cms/inquiries/actions.ts +66 -0
  19. package/templates/nextblock-template/app/cms/inquiries/page.tsx +12 -0
  20. package/templates/nextblock-template/app/cms/interactions/page.tsx +12 -51
  21. package/templates/nextblock-template/app/cms/layout.tsx +101 -73
  22. package/templates/nextblock-template/app/cms/messages/MessagesClient.tsx +661 -0
  23. package/templates/nextblock-template/app/cms/messages/actions.ts +404 -0
  24. package/templates/nextblock-template/app/cms/messages/loadInbox.ts +333 -0
  25. package/templates/nextblock-template/app/cms/messages/page.tsx +87 -0
  26. package/templates/nextblock-template/app/cms/messages/require-admin.ts +37 -0
  27. package/templates/nextblock-template/app/cms/products/[id]/edit/page.tsx +370 -362
  28. package/templates/nextblock-template/app/cms/revisions/service.ts +20 -0
  29. package/templates/nextblock-template/app/cms/settings/email/components/EmailForm.tsx +227 -185
  30. package/templates/nextblock-template/app/layout.tsx +671 -671
  31. package/templates/nextblock-template/app/product/[slug]/page.tsx +502 -482
  32. package/templates/nextblock-template/app/providers.tsx +96 -96
  33. package/templates/nextblock-template/app/thread/ThreadView.tsx +164 -0
  34. package/templates/nextblock-template/app/thread/[token]/route.ts +57 -0
  35. package/templates/nextblock-template/app/thread/layout.tsx +15 -0
  36. package/templates/nextblock-template/app/thread/page.tsx +98 -0
  37. package/templates/nextblock-template/components/BlockRenderer.tsx +312 -296
  38. package/templates/nextblock-template/components/ContactSellerSection.tsx +188 -0
  39. package/templates/nextblock-template/components/PostCommentsSection.tsx +378 -369
  40. package/templates/nextblock-template/components/ProductReviewsSection.tsx +426 -419
  41. package/templates/nextblock-template/components/StaffReplies.tsx +102 -0
  42. package/templates/nextblock-template/components/blocks/renderers/CartBlockRenderer.tsx +18 -17
  43. package/templates/nextblock-template/components/blocks/renderers/CheckoutBlockRenderer.tsx +20 -19
  44. package/templates/nextblock-template/components/blocks/renderers/FeaturedProductBlockRenderer.tsx +25 -22
  45. package/templates/nextblock-template/components/blocks/renderers/FormBlockRenderer.tsx +385 -381
  46. package/templates/nextblock-template/components/blocks/renderers/ProductDetailsBlockRenderer.tsx +157 -92
  47. package/templates/nextblock-template/components/blocks/renderers/ProductGridBlockRenderer.tsx +34 -31
  48. package/templates/nextblock-template/components/blocks/renderers/SectionBlockRenderer.tsx +612 -600
  49. package/templates/nextblock-template/components/commerce/PaymentReadinessBoundary.tsx +32 -0
  50. package/templates/nextblock-template/docs/14-MESSAGES-INBOX.md +309 -0
  51. package/templates/nextblock-template/docs/README.md +42 -41
  52. package/templates/nextblock-template/docs/assets/lighthouse-scores.png +0 -0
  53. package/templates/nextblock-template/lib/blocks/blockColors.test.ts +22 -2
  54. package/templates/nextblock-template/lib/blocks/blockColors.ts +44 -1
  55. package/templates/nextblock-template/lib/blocks/blockRegistry.ts +761 -753
  56. package/templates/nextblock-template/lib/cms/contact-reminder.ts +64 -0
  57. package/templates/nextblock-template/lib/cms/payments-reminder.ts +98 -0
  58. package/templates/nextblock-template/lib/cms/unread-messages.ts +42 -0
  59. package/templates/nextblock-template/lib/commerce/seller-contact.ts +162 -0
  60. package/templates/nextblock-template/lib/config/email-settings.ts +323 -254
  61. package/templates/nextblock-template/lib/config/email-tls.test.ts +57 -0
  62. package/templates/nextblock-template/lib/email/placeholder-address.test.ts +59 -0
  63. package/templates/nextblock-template/lib/email/placeholder-address.ts +39 -0
  64. package/templates/nextblock-template/lib/messages/thread-reference.test.ts +70 -0
  65. package/templates/nextblock-template/lib/messages/thread-token.test.ts +93 -0
  66. package/templates/nextblock-template/lib/messages/thread-token.ts +157 -0
  67. package/templates/nextblock-template/lib/messages/threads.ts +579 -0
  68. package/templates/nextblock-template/lib/setup/migrations-bundle.ts +20 -0
  69. package/templates/nextblock-template/lib/site-url.test.ts +89 -0
  70. package/templates/nextblock-template/lib/site-url.ts +102 -48
  71. package/templates/nextblock-template/package.json +1 -1
@@ -0,0 +1,333 @@
1
+ import 'server-only';
2
+
3
+ import { createClient, getServiceRoleSupabaseClient } from '@nextblock-cms/db/server';
4
+
5
+ /**
6
+ * One inbox over two storage models.
7
+ *
8
+ * Private conversations (product enquiries, contact forms) live in `message_threads`;
9
+ * public reviews and post comments live in `cms_interactions`. They are not merged into
10
+ * one table because they are genuinely different: an enquiry is anonymous, targets
11
+ * nothing in particular and is never published, while a review belongs to a registered
12
+ * account, must target exactly one product or post, and is already on the site. Forcing
13
+ * either into the other's shape would break something real — the ratings trigger, or the
14
+ * account foreign key.
15
+ *
16
+ * So the merge happens here, in the read path, where it costs nothing but a sort.
17
+ */
18
+
19
+ export const PAGE_SIZE = 25;
20
+
21
+ export type InboxSource = 'product_inquiry' | 'contact_form' | 'review' | 'comment';
22
+
23
+ export interface InboxItem {
24
+ /** Which storage model this came from — the detail pane branches on it. */
25
+ kind: 'thread' | 'interaction';
26
+ id: string;
27
+ source: InboxSource;
28
+ subjectLabel: string;
29
+ senderName: string | null;
30
+ senderEmail: string | null;
31
+ preview: string;
32
+ rating: number | null;
33
+ /** 'open' | 'closed' for threads; the approval status for interactions. */
34
+ status: string;
35
+ unread: boolean;
36
+ emailDelivered: boolean | null;
37
+ targetHref: string | null;
38
+ lastActivityAt: string;
39
+ }
40
+
41
+ export interface InboxCounts {
42
+ product_inquiry: number;
43
+ contact_form: number;
44
+ review: number;
45
+ comment: number;
46
+ }
47
+
48
+ export interface InboxPage {
49
+ items: InboxItem[];
50
+ counts: InboxCounts;
51
+ hasMore: boolean;
52
+ /** How many handled items the default view is hiding. */
53
+ handledCount: number;
54
+ /** True when the viewer cannot see private threads, so the UI can explain the gap. */
55
+ privateHidden: boolean;
56
+ }
57
+
58
+ function preview(text: string, max = 220): string {
59
+ const clean = text.replace(/\s+/g, ' ').trim();
60
+ return clean.length > max ? `${clean.slice(0, max)}…` : clean;
61
+ }
62
+
63
+ export async function loadInbox(options: {
64
+ source?: string;
65
+ page?: number;
66
+ isAdmin: boolean;
67
+ /** Include conversations already dealt with. Off by default: the inbox is a to-do
68
+ * list, and a closed thread has nothing left to do. */
69
+ showHandled?: boolean;
70
+ }): Promise<InboxPage> {
71
+ const page = Math.max(0, options.page ?? 0);
72
+ const wanted = PAGE_SIZE * (page + 1);
73
+ const source = options.source;
74
+
75
+ const showHandled = options.showHandled === true;
76
+ const items: InboxItem[] = [];
77
+ let handledCount = 0;
78
+ const counts: InboxCounts = { product_inquiry: 0, contact_form: 0, review: 0, comment: 0 };
79
+ // Tracks whether either lane came back full. Slicing a merged list cannot tell the
80
+ // difference between "that is everything" and "that is all I asked for".
81
+ let laneFilled = false;
82
+
83
+ // Private threads are ADMIN-only, by RLS and by this check. A WRITER gets the public
84
+ // half of the inbox and is told the rest exists rather than shown an empty tab.
85
+ const canSeeThreads = options.isAdmin;
86
+ const wantsThreads = !source || source === 'product_inquiry' || source === 'contact_form';
87
+ const wantsInteractions = !source || source === 'review' || source === 'comment';
88
+
89
+ // Counted for EVERY tab, not just the active one. Computing them inside the fetch
90
+ // branches made a badge vanish the moment you clicked the tab it belonged to.
91
+ const countUnreadThreads = async (threadSource: 'product_inquiry' | 'contact_form') => {
92
+ if (!canSeeThreads) return 0;
93
+ const { count } = await getServiceRoleSupabaseClient()
94
+ .from('message_threads')
95
+ .select('id', { count: 'exact', head: true })
96
+ .eq('source', threadSource)
97
+ .eq('unread_for_admin', true);
98
+ return count ?? 0;
99
+ };
100
+ const countPendingInteractions = async (type: 'review' | 'comment') => {
101
+ const { count } = await createClient()
102
+ .from('cms_interactions')
103
+ .select('id', { count: 'exact', head: true })
104
+ .eq('type', type)
105
+ .eq('status', 'pending')
106
+ .is('parent_id', null);
107
+ return count ?? 0;
108
+ };
109
+
110
+ const countHandled = async (): Promise<number> => {
111
+ const [threads, interactions] = await Promise.all([
112
+ canSeeThreads
113
+ ? getServiceRoleSupabaseClient()
114
+ .from('message_threads')
115
+ .select('id', { count: 'exact', head: true })
116
+ .eq('status', 'closed')
117
+ .then(({ count }) => count ?? 0)
118
+ : Promise.resolve(0),
119
+ createClient()
120
+ .from('cms_interactions')
121
+ .select('id', { count: 'exact', head: true })
122
+ .neq('status', 'pending')
123
+ .is('parent_id', null)
124
+ .then(({ count }) => count ?? 0),
125
+ ]);
126
+ return threads + interactions;
127
+ };
128
+
129
+ const [inquiryCount, formCount, reviewCount, commentCount, hiddenCount] = await Promise.all([
130
+ countUnreadThreads('product_inquiry').catch(() => 0),
131
+ countUnreadThreads('contact_form').catch(() => 0),
132
+ countPendingInteractions('review').catch(() => 0),
133
+ countPendingInteractions('comment').catch(() => 0),
134
+ countHandled().catch(() => 0),
135
+ ]);
136
+ handledCount = hiddenCount;
137
+ counts.product_inquiry = inquiryCount;
138
+ counts.contact_form = formCount;
139
+ counts.review = reviewCount;
140
+ counts.comment = commentCount;
141
+
142
+ if (canSeeThreads && wantsThreads) {
143
+ const service = getServiceRoleSupabaseClient();
144
+ let query = service
145
+ .from('message_threads')
146
+ .select(
147
+ 'id, source, subject_label, sender_name, sender_email, status, unread_for_admin, last_message_at'
148
+ )
149
+ .order('last_message_at', { ascending: false })
150
+ .limit(wanted);
151
+ if (source) query = query.eq('source', source);
152
+ if (!showHandled) query = query.eq('status', 'open');
153
+
154
+ const { data: threads } = await query;
155
+ if ((threads?.length ?? 0) >= wanted) laneFilled = true;
156
+
157
+ // One extra probe for the latest line of each thread, rather than N.
158
+ const threadIds = (threads ?? []).map((thread) => thread.id);
159
+ const latestByThread = new Map<
160
+ string,
161
+ { body: string; email_delivered: boolean; email_error: string | null }
162
+ >();
163
+ if (threadIds.length > 0) {
164
+ // Newest first, and keep the FIRST row seen per thread. Ascending order plus
165
+ // overwrite looks equivalent but degrades catastrophically: PostgREST caps a
166
+ // result at max_rows (1000), which under an ascending sort truncates exactly the
167
+ // newest messages — so a busy inbox would quietly show every thread's opening
168
+ // line forever, with a delivery badge to match.
169
+ const { data: messages } = await service
170
+ .from('thread_messages')
171
+ .select('thread_id, body, email_delivered, email_error, created_at')
172
+ .in('thread_id', threadIds)
173
+ .order('created_at', { ascending: false })
174
+ .limit(threadIds.length * 8);
175
+ for (const message of messages ?? []) {
176
+ if (latestByThread.has(message.thread_id)) continue;
177
+ latestByThread.set(message.thread_id, {
178
+ body: message.body,
179
+ email_delivered: message.email_delivered,
180
+ email_error: message.email_error,
181
+ });
182
+ }
183
+ }
184
+
185
+ for (const thread of threads ?? []) {
186
+ const latest = latestByThread.get(thread.id);
187
+ items.push({
188
+ kind: 'thread',
189
+ id: thread.id,
190
+ source: thread.source as InboxSource,
191
+ subjectLabel: thread.subject_label,
192
+ senderName: thread.sender_name,
193
+ senderEmail: thread.sender_email,
194
+ preview: preview(latest?.body ?? ''),
195
+ rating: null,
196
+ status: thread.status,
197
+ unread: thread.unread_for_admin,
198
+ // null means "nothing to report" — either delivered, or not yet attempted.
199
+ // Only a recorded error is worth flagging to the admin as a problem.
200
+ emailDelivered: latest ? (latest.email_error ? false : latest.email_delivered || null) : null,
201
+ targetHref: null,
202
+ lastActivityAt: thread.last_message_at,
203
+ });
204
+ }
205
+ }
206
+
207
+ if (wantsInteractions) {
208
+ // Request-scoped client: RLS is what lets an ADMIN/WRITER see pending rows.
209
+ const supabase = createClient();
210
+ let query = supabase
211
+ .from('cms_interactions')
212
+ .select(
213
+ 'id, type, status, content, rating, created_at, product_id, post_id, profiles(full_name), products(title, slug), posts(title, slug)'
214
+ )
215
+ // Staff replies are themselves rows here; the inbox lists what was answered.
216
+ .is('parent_id', null)
217
+ .order('created_at', { ascending: false })
218
+ .limit(wanted);
219
+ if (source === 'review' || source === 'comment') query = query.eq('type', source);
220
+ // "Handled" for a review or comment means it has been moderated either way.
221
+ if (!showHandled) query = query.eq('status', 'pending');
222
+
223
+ const { data: interactions } = await query;
224
+ if ((interactions?.length ?? 0) >= wanted) laneFilled = true;
225
+
226
+ for (const row of interactions ?? []) {
227
+ const product = row.products as { title?: string; slug?: string } | null;
228
+ const post = row.posts as { title?: string; slug?: string } | null;
229
+ const author = row.profiles as { full_name?: string } | null;
230
+ items.push({
231
+ kind: 'interaction',
232
+ id: row.id,
233
+ source: row.type as InboxSource,
234
+ subjectLabel: product?.title || post?.title || 'Content',
235
+ senderName: author?.full_name ?? null,
236
+ senderEmail: null,
237
+ preview: preview(row.content),
238
+ rating: row.rating,
239
+ status: row.status,
240
+ // Pending is a moderation state, not a per-user read marker — there is no read
241
+ // marker for interactions anywhere in the schema. Treated as "needs attention".
242
+ unread: row.status === 'pending',
243
+ emailDelivered: null,
244
+ targetHref: product?.slug
245
+ ? `/product/${product.slug}`
246
+ : post?.slug
247
+ ? `/article/${post.slug}`
248
+ : null,
249
+ lastActivityAt: row.created_at,
250
+ });
251
+ }
252
+ }
253
+
254
+ items.sort(
255
+ (a, b) => new Date(b.lastActivityAt).getTime() - new Date(a.lastActivityAt).getTime()
256
+ );
257
+
258
+ const start = page * PAGE_SIZE;
259
+ return {
260
+ items: items.slice(start, start + PAGE_SIZE),
261
+ counts,
262
+ // Either the merged list overflows the page, or a lane hit its own ceiling and is
263
+ // still holding rows back.
264
+ hasMore: items.length > start + PAGE_SIZE || laneFilled,
265
+ handledCount,
266
+ privateHidden: !canSeeThreads,
267
+ };
268
+ }
269
+
270
+ export interface ThreadDetail {
271
+ id: string;
272
+ subjectLabel: string;
273
+ senderName: string | null;
274
+ senderEmail: string | null;
275
+ status: string;
276
+ hasLiveLink: boolean;
277
+ /** Every answer a contact form collected, so none is unreachable in the CMS. */
278
+ fields: Array<{ label: string; value: string }>;
279
+ messages: Array<{
280
+ id: string;
281
+ direction: string;
282
+ body: string;
283
+ author_name: string | null;
284
+ email_delivered: boolean;
285
+ email_error: string | null;
286
+ created_at: string;
287
+ }>;
288
+ }
289
+
290
+ /** Full history for one private conversation. ADMIN only. */
291
+ export async function loadThreadDetail(threadId: string): Promise<ThreadDetail | null> {
292
+ const service = getServiceRoleSupabaseClient();
293
+
294
+ const { data: thread } = await service
295
+ .from('message_threads')
296
+ .select(
297
+ 'id, subject_label, sender_name, sender_email, status, fields, token_hash, token_revoked_at, token_expires_at'
298
+ )
299
+ .eq('id', threadId)
300
+ .maybeSingle();
301
+
302
+ if (!thread) return null;
303
+
304
+ const { data: messages } = await service
305
+ .from('thread_messages')
306
+ .select('id, direction, body, author_name, email_delivered, email_error, created_at')
307
+ .eq('thread_id', threadId)
308
+ .order('created_at', { ascending: true });
309
+
310
+ const hasLiveLink = Boolean(
311
+ thread.token_hash &&
312
+ !thread.token_revoked_at &&
313
+ thread.token_expires_at &&
314
+ new Date(thread.token_expires_at).getTime() > Date.now()
315
+ );
316
+
317
+ return {
318
+ id: thread.id,
319
+ subjectLabel: thread.subject_label,
320
+ senderName: thread.sender_name,
321
+ senderEmail: thread.sender_email,
322
+ status: thread.status,
323
+ hasLiveLink,
324
+ fields:
325
+ thread.fields && typeof thread.fields === 'object' && !Array.isArray(thread.fields)
326
+ ? Object.entries(thread.fields as Record<string, unknown>).map(([label, value]) => ({
327
+ label,
328
+ value: String(value ?? ''),
329
+ }))
330
+ : [],
331
+ messages: messages ?? [],
332
+ };
333
+ }
@@ -0,0 +1,87 @@
1
+ import { redirect } from 'next/navigation';
2
+ import { createClient } from '@nextblock-cms/db/server';
3
+
4
+ import { isEmailConfigured } from '../../../lib/config/email-settings';
5
+ import {
6
+ getStoreContactEmail,
7
+ resolveSellerContactEmail,
8
+ } from '../../../lib/commerce/seller-contact';
9
+ import { loadInbox, loadThreadDetail, type ThreadDetail } from './loadInbox';
10
+ import MessagesClient from './MessagesClient';
11
+
12
+ export const metadata = {
13
+ title: 'Messages | NextBlock™ CMS',
14
+ };
15
+
16
+ // Messages arrive from the public site at any moment; a cached page would show an admin
17
+ // an empty inbox that is not.
18
+ export const dynamic = 'force-dynamic';
19
+
20
+ export default async function MessagesPage({
21
+ searchParams,
22
+ }: {
23
+ searchParams: Promise<{ source?: string; page?: string; thread?: string; handled?: string }>;
24
+ }) {
25
+ const params = await searchParams;
26
+
27
+ const supabase = createClient();
28
+ const {
29
+ data: { user },
30
+ } = await supabase.auth.getUser();
31
+ if (!user) redirect('/sign-in');
32
+
33
+ const { data: profile } = await supabase
34
+ .from('profiles')
35
+ .select('role')
36
+ .eq('id', user.id)
37
+ .maybeSingle();
38
+
39
+ if (profile?.role !== 'ADMIN' && profile?.role !== 'WRITER') {
40
+ redirect('/unauthorized');
41
+ }
42
+
43
+ const isAdmin = profile?.role === 'ADMIN';
44
+
45
+ const [inbox, storeContactEmail, resolvedFallback, smtpConfigured] = await Promise.all([
46
+ loadInbox({
47
+ source: params.source,
48
+ page: params.page ? Number(params.page) : 0,
49
+ isAdmin,
50
+ showHandled: params.handled === '1',
51
+ }),
52
+ isAdmin ? getStoreContactEmail() : Promise.resolve(''),
53
+ isAdmin
54
+ ? resolveSellerContactEmail()
55
+ : Promise.resolve({ email: null, source: 'none' as const }),
56
+ isEmailConfigured().catch(() => false),
57
+ ]);
58
+
59
+ // Only the open conversation's history is loaded, not every thread's.
60
+ let openThread: ThreadDetail | null = null;
61
+ if (isAdmin && params.thread) {
62
+ openThread = await loadThreadDetail(params.thread);
63
+ }
64
+
65
+ return (
66
+ <div className="space-y-6">
67
+ <div>
68
+ <h1 className="text-2xl font-bold">Messages</h1>
69
+ <p className="text-sm text-muted-foreground">
70
+ Everything people send you — product enquiries, contact forms, reviews and
71
+ comments — in one place.
72
+ </p>
73
+ </div>
74
+
75
+ <MessagesClient
76
+ inbox={inbox}
77
+ openThread={openThread}
78
+ isAdmin={isAdmin}
79
+ activeSource={params.source ?? ''}
80
+ showHandled={params.handled === '1'}
81
+ storeContactEmail={storeContactEmail}
82
+ resolvedFallback={{ email: resolvedFallback.email, source: resolvedFallback.source }}
83
+ smtpConfigured={smtpConfigured}
84
+ />
85
+ </div>
86
+ );
87
+ }
@@ -0,0 +1,37 @@
1
+ import { createClient } from '@nextblock-cms/db/server';
2
+
3
+ /**
4
+ * Admin gate shared by the Messages server actions.
5
+ *
6
+ * Lives outside `actions.ts` because that file is `'use server'`, where every export
7
+ * must itself be a valid server action — a helper returning a Supabase client cannot be
8
+ * exported from there.
9
+ *
10
+ * This is the check standing between a WRITER and every private conversation on the
11
+ * site: visitor names, addresses, and free text. RLS enforces the same rule
12
+ * independently, so a bug here fails closed rather than open, but the redundancy is the
13
+ * point.
14
+ */
15
+ export async function requireAdminSupabaseClient() {
16
+ const supabase = createClient();
17
+ const {
18
+ data: { user },
19
+ error: userError,
20
+ } = await supabase.auth.getUser();
21
+
22
+ if (userError || !user) {
23
+ throw new Error('You must be logged in to manage messages.');
24
+ }
25
+
26
+ const { data: profile, error: profileError } = await supabase
27
+ .from('profiles')
28
+ .select('role, full_name')
29
+ .eq('id', user.id)
30
+ .single();
31
+
32
+ if (profileError || !profile || profile.role !== 'ADMIN') {
33
+ throw new Error('You do not have permission to manage messages.');
34
+ }
35
+
36
+ return { supabase, userId: user.id, fullName: profile.full_name as string | null };
37
+ }