@elevasis/ui 1.0.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 (97) hide show
  1. package/dist/api/index.d.ts +87 -0
  2. package/dist/api/index.js +3 -0
  3. package/dist/auth/context.d.ts +19 -0
  4. package/dist/auth/context.js +1 -0
  5. package/dist/auth/index.d.ts +85 -0
  6. package/dist/auth/index.js +3 -0
  7. package/dist/chunk-3KMDHCAR.js +52 -0
  8. package/dist/chunk-5UWFGBFM.js +129 -0
  9. package/dist/chunk-6BJOYF6E.js +8 -0
  10. package/dist/chunk-6M6OLGQY.js +36 -0
  11. package/dist/chunk-7AI5ZYJ4.js +202 -0
  12. package/dist/chunk-7PLEQFHO.js +18 -0
  13. package/dist/chunk-GDV44UWF.js +138 -0
  14. package/dist/chunk-GEFB5YIR.js +338 -0
  15. package/dist/chunk-HBRMWW6V.js +43 -0
  16. package/dist/chunk-HUWJXLLF.js +681 -0
  17. package/dist/chunk-J3FALDQE.js +176 -0
  18. package/dist/chunk-JKERRYVS.js +109 -0
  19. package/dist/chunk-KA7LO7U5.js +28 -0
  20. package/dist/chunk-LHQTTUL2.js +27 -0
  21. package/dist/chunk-MAAS6CGR.js +1299 -0
  22. package/dist/chunk-NE36BUGQ.js +146 -0
  23. package/dist/chunk-NGXCFBCS.js +398 -0
  24. package/dist/chunk-OEYU5O27.js +235 -0
  25. package/dist/chunk-OUHGHTE7.js +748 -0
  26. package/dist/chunk-OXVOHOP3.js +661 -0
  27. package/dist/chunk-PSLKGOBZ.js +58 -0
  28. package/dist/chunk-PYL4XW6H.js +107 -0
  29. package/dist/chunk-Q47SPRY7.js +1 -0
  30. package/dist/chunk-Q7DJKLEN.js +18 -0
  31. package/dist/chunk-RJCA5672.js +1664 -0
  32. package/dist/chunk-S66I2PYB.js +748 -0
  33. package/dist/chunk-W7ZBF5AA.js +1 -0
  34. package/dist/chunk-WNWKOCGJ.js +1067 -0
  35. package/dist/chunk-XCYKC6OZ.js +1 -0
  36. package/dist/chunk-YULUKCS6.js +56 -0
  37. package/dist/chunk-YZ6GTZXL.js +48 -0
  38. package/dist/chunk-ZGHDPDTF.js +379 -0
  39. package/dist/components/command-queue/index.css +53 -0
  40. package/dist/components/command-queue/index.d.ts +204 -0
  41. package/dist/components/command-queue/index.js +10 -0
  42. package/dist/components/forms/index.d.ts +56 -0
  43. package/dist/components/forms/index.js +2 -0
  44. package/dist/components/index.css +443 -0
  45. package/dist/components/index.d.ts +1354 -0
  46. package/dist/components/index.js +18 -0
  47. package/dist/components/monitoring/index.d.ts +66 -0
  48. package/dist/components/monitoring/index.js +2 -0
  49. package/dist/components/navigation/index.d.ts +54 -0
  50. package/dist/components/navigation/index.js +91 -0
  51. package/dist/components/notifications/index.d.ts +52 -0
  52. package/dist/components/notifications/index.js +4 -0
  53. package/dist/components/resource-definition/index.css +388 -0
  54. package/dist/components/resource-definition/index.d.ts +301 -0
  55. package/dist/components/resource-definition/index.js +3 -0
  56. package/dist/display/index.css +53 -0
  57. package/dist/display/index.d.ts +606 -0
  58. package/dist/display/index.js +6 -0
  59. package/dist/execution/index.css +388 -0
  60. package/dist/execution/index.d.ts +1090 -0
  61. package/dist/execution/index.js +4 -0
  62. package/dist/graph/index.css +388 -0
  63. package/dist/graph/index.d.ts +429 -0
  64. package/dist/graph/index.js +1 -0
  65. package/dist/hooks/index.d.ts +1927 -0
  66. package/dist/hooks/index.js +6 -0
  67. package/dist/hooks/published.d.ts +1653 -0
  68. package/dist/hooks/published.js +4 -0
  69. package/dist/index.css +505 -0
  70. package/dist/index.d.ts +7284 -0
  71. package/dist/index.js +31 -0
  72. package/dist/initialization/index.d.ts +2325 -0
  73. package/dist/initialization/index.js +4 -0
  74. package/dist/organization/index.d.ts +225 -0
  75. package/dist/organization/index.js +4 -0
  76. package/dist/profile/index.d.ts +2265 -0
  77. package/dist/profile/index.js +3 -0
  78. package/dist/provider/index.css +61 -0
  79. package/dist/provider/index.d.ts +291 -0
  80. package/dist/provider/index.js +7 -0
  81. package/dist/provider/published.d.ts +198 -0
  82. package/dist/provider/published.js +6 -0
  83. package/dist/router/context.d.ts +19 -0
  84. package/dist/router/context.js +1 -0
  85. package/dist/router/index.d.ts +31 -0
  86. package/dist/router/index.js +2 -0
  87. package/dist/sse/index.d.ts +83 -0
  88. package/dist/sse/index.js +185 -0
  89. package/dist/supabase/index.d.ts +4289 -0
  90. package/dist/supabase/index.js +47 -0
  91. package/dist/typeform/index.d.ts +458 -0
  92. package/dist/typeform/index.js +1976 -0
  93. package/dist/typeform/schemas.d.ts +67 -0
  94. package/dist/typeform/schemas.js +1 -0
  95. package/dist/utils/index.d.ts +177 -0
  96. package/dist/utils/index.js +1 -0
  97. package/package.json +88 -0
@@ -0,0 +1,2265 @@
1
+ type Json = string | number | boolean | null | {
2
+ [key: string]: Json | undefined;
3
+ } | Json[];
4
+ type Database = {
5
+ __InternalSupabase: {
6
+ PostgrestVersion: "12.2.3 (519615d)";
7
+ };
8
+ public: {
9
+ Tables: {
10
+ acq_companies: {
11
+ Row: {
12
+ attio_company_id: string | null;
13
+ batch_id: string | null;
14
+ category: string | null;
15
+ category_pain: string | null;
16
+ created_at: string;
17
+ domain: string | null;
18
+ enrichment_data: Json | null;
19
+ filter_reason: string | null;
20
+ founded_year: number | null;
21
+ id: string;
22
+ linkedin_url: string | null;
23
+ location_city: string | null;
24
+ location_state: string | null;
25
+ name: string;
26
+ num_employees: number | null;
27
+ organization_id: string;
28
+ pipeline_status: Json;
29
+ segment: string | null;
30
+ source: string | null;
31
+ status: string;
32
+ updated_at: string;
33
+ website: string | null;
34
+ };
35
+ Insert: {
36
+ attio_company_id?: string | null;
37
+ batch_id?: string | null;
38
+ category?: string | null;
39
+ category_pain?: string | null;
40
+ created_at?: string;
41
+ domain?: string | null;
42
+ enrichment_data?: Json | null;
43
+ filter_reason?: string | null;
44
+ founded_year?: number | null;
45
+ id?: string;
46
+ linkedin_url?: string | null;
47
+ location_city?: string | null;
48
+ location_state?: string | null;
49
+ name: string;
50
+ num_employees?: number | null;
51
+ organization_id: string;
52
+ pipeline_status?: Json;
53
+ segment?: string | null;
54
+ source?: string | null;
55
+ status?: string;
56
+ updated_at?: string;
57
+ website?: string | null;
58
+ };
59
+ Update: {
60
+ attio_company_id?: string | null;
61
+ batch_id?: string | null;
62
+ category?: string | null;
63
+ category_pain?: string | null;
64
+ created_at?: string;
65
+ domain?: string | null;
66
+ enrichment_data?: Json | null;
67
+ filter_reason?: string | null;
68
+ founded_year?: number | null;
69
+ id?: string;
70
+ linkedin_url?: string | null;
71
+ location_city?: string | null;
72
+ location_state?: string | null;
73
+ name?: string;
74
+ num_employees?: number | null;
75
+ organization_id?: string;
76
+ pipeline_status?: Json;
77
+ segment?: string | null;
78
+ source?: string | null;
79
+ status?: string;
80
+ updated_at?: string;
81
+ website?: string | null;
82
+ };
83
+ Relationships: [
84
+ {
85
+ foreignKeyName: "acq_companies_organization_id_fkey";
86
+ columns: ["organization_id"];
87
+ isOneToOne: false;
88
+ referencedRelation: "organizations";
89
+ referencedColumns: ["id"];
90
+ }
91
+ ];
92
+ };
93
+ acq_contacts: {
94
+ Row: {
95
+ attio_person_id: string | null;
96
+ batch_id: string | null;
97
+ brochure_first_viewed_at: string | null;
98
+ brochure_view_count: number;
99
+ company_id: string | null;
100
+ created_at: string;
101
+ email: string;
102
+ email_valid: string | null;
103
+ enrichment_data: Json;
104
+ filter_reason: string | null;
105
+ first_name: string | null;
106
+ headline: string | null;
107
+ id: string;
108
+ last_name: string | null;
109
+ linkedin_url: string | null;
110
+ nurture: boolean;
111
+ opening_line: string | null;
112
+ organization_id: string;
113
+ pipeline_status: Json;
114
+ source: string | null;
115
+ source_id: string | null;
116
+ status: string;
117
+ title: string | null;
118
+ updated_at: string;
119
+ };
120
+ Insert: {
121
+ attio_person_id?: string | null;
122
+ batch_id?: string | null;
123
+ brochure_first_viewed_at?: string | null;
124
+ brochure_view_count?: number;
125
+ company_id?: string | null;
126
+ created_at?: string;
127
+ email: string;
128
+ email_valid?: string | null;
129
+ enrichment_data?: Json;
130
+ filter_reason?: string | null;
131
+ first_name?: string | null;
132
+ headline?: string | null;
133
+ id?: string;
134
+ last_name?: string | null;
135
+ linkedin_url?: string | null;
136
+ nurture?: boolean;
137
+ opening_line?: string | null;
138
+ organization_id: string;
139
+ pipeline_status?: Json;
140
+ source?: string | null;
141
+ source_id?: string | null;
142
+ status?: string;
143
+ title?: string | null;
144
+ updated_at?: string;
145
+ };
146
+ Update: {
147
+ attio_person_id?: string | null;
148
+ batch_id?: string | null;
149
+ brochure_first_viewed_at?: string | null;
150
+ brochure_view_count?: number;
151
+ company_id?: string | null;
152
+ created_at?: string;
153
+ email?: string;
154
+ email_valid?: string | null;
155
+ enrichment_data?: Json;
156
+ filter_reason?: string | null;
157
+ first_name?: string | null;
158
+ headline?: string | null;
159
+ id?: string;
160
+ last_name?: string | null;
161
+ linkedin_url?: string | null;
162
+ nurture?: boolean;
163
+ opening_line?: string | null;
164
+ organization_id?: string;
165
+ pipeline_status?: Json;
166
+ source?: string | null;
167
+ source_id?: string | null;
168
+ status?: string;
169
+ title?: string | null;
170
+ updated_at?: string;
171
+ };
172
+ Relationships: [
173
+ {
174
+ foreignKeyName: "acq_contacts_company_id_fkey";
175
+ columns: ["company_id"];
176
+ isOneToOne: false;
177
+ referencedRelation: "acq_companies";
178
+ referencedColumns: ["id"];
179
+ },
180
+ {
181
+ foreignKeyName: "acq_contacts_organization_id_fkey";
182
+ columns: ["organization_id"];
183
+ isOneToOne: false;
184
+ referencedRelation: "organizations";
185
+ referencedColumns: ["id"];
186
+ }
187
+ ];
188
+ };
189
+ acq_content: {
190
+ Row: {
191
+ body: string | null;
192
+ created_at: string;
193
+ id: string;
194
+ organization_id: string;
195
+ pillar: string;
196
+ status: string;
197
+ title: string;
198
+ updated_at: string;
199
+ };
200
+ Insert: {
201
+ body?: string | null;
202
+ created_at?: string;
203
+ id?: string;
204
+ organization_id: string;
205
+ pillar: string;
206
+ status?: string;
207
+ title: string;
208
+ updated_at?: string;
209
+ };
210
+ Update: {
211
+ body?: string | null;
212
+ created_at?: string;
213
+ id?: string;
214
+ organization_id?: string;
215
+ pillar?: string;
216
+ status?: string;
217
+ title?: string;
218
+ updated_at?: string;
219
+ };
220
+ Relationships: [
221
+ {
222
+ foreignKeyName: "acq_content_organization_id_fkey";
223
+ columns: ["organization_id"];
224
+ isOneToOne: false;
225
+ referencedRelation: "organizations";
226
+ referencedColumns: ["id"];
227
+ }
228
+ ];
229
+ };
230
+ acq_content_distributions: {
231
+ Row: {
232
+ adapted_body: string | null;
233
+ checklist: Json | null;
234
+ content_id: string;
235
+ created_at: string;
236
+ format: string;
237
+ id: string;
238
+ media_urls: Json;
239
+ metrics: Json;
240
+ metrics_updated_at: string | null;
241
+ organization_id: string;
242
+ platform: string;
243
+ platform_content: Json | null;
244
+ platform_post_id: string | null;
245
+ platform_url: string | null;
246
+ published_at: string | null;
247
+ status: string;
248
+ updated_at: string;
249
+ };
250
+ Insert: {
251
+ adapted_body?: string | null;
252
+ checklist?: Json | null;
253
+ content_id: string;
254
+ created_at?: string;
255
+ format: string;
256
+ id?: string;
257
+ media_urls?: Json;
258
+ metrics?: Json;
259
+ metrics_updated_at?: string | null;
260
+ organization_id: string;
261
+ platform: string;
262
+ platform_content?: Json | null;
263
+ platform_post_id?: string | null;
264
+ platform_url?: string | null;
265
+ published_at?: string | null;
266
+ status?: string;
267
+ updated_at?: string;
268
+ };
269
+ Update: {
270
+ adapted_body?: string | null;
271
+ checklist?: Json | null;
272
+ content_id?: string;
273
+ created_at?: string;
274
+ format?: string;
275
+ id?: string;
276
+ media_urls?: Json;
277
+ metrics?: Json;
278
+ metrics_updated_at?: string | null;
279
+ organization_id?: string;
280
+ platform?: string;
281
+ platform_content?: Json | null;
282
+ platform_post_id?: string | null;
283
+ platform_url?: string | null;
284
+ published_at?: string | null;
285
+ status?: string;
286
+ updated_at?: string;
287
+ };
288
+ Relationships: [
289
+ {
290
+ foreignKeyName: "acq_content_distributions_content_id_fkey";
291
+ columns: ["content_id"];
292
+ isOneToOne: false;
293
+ referencedRelation: "acq_content";
294
+ referencedColumns: ["id"];
295
+ },
296
+ {
297
+ foreignKeyName: "acq_content_distributions_organization_id_fkey";
298
+ columns: ["organization_id"];
299
+ isOneToOne: false;
300
+ referencedRelation: "organizations";
301
+ referencedColumns: ["id"];
302
+ }
303
+ ];
304
+ };
305
+ acq_deals: {
306
+ Row: {
307
+ activity_log: Json;
308
+ attio_deal_id: string;
309
+ cached_stage: string | null;
310
+ closed_lost_at: string | null;
311
+ closed_lost_reason: string | null;
312
+ contact_email: string;
313
+ contact_id: string | null;
314
+ created_at: string;
315
+ discovery_data: Json | null;
316
+ discovery_submitted_at: string | null;
317
+ discovery_submitted_by: string | null;
318
+ id: string;
319
+ initial_fee: number | null;
320
+ monthly_fee: number | null;
321
+ organization_id: string;
322
+ payment_link_sent_at: string | null;
323
+ payment_received_at: string | null;
324
+ proposal_data: Json | null;
325
+ proposal_generated_at: string | null;
326
+ proposal_pdf_url: string | null;
327
+ proposal_reviewed_at: string | null;
328
+ proposal_reviewed_by: string | null;
329
+ proposal_sent_at: string | null;
330
+ proposal_signed_at: string | null;
331
+ proposal_status: string | null;
332
+ signature_envelope_id: string | null;
333
+ source_list_id: string | null;
334
+ source_type: string | null;
335
+ stripe_payment_id: string | null;
336
+ stripe_payment_link: string | null;
337
+ stripe_payment_link_id: string | null;
338
+ stripe_subscription_id: string | null;
339
+ updated_at: string;
340
+ };
341
+ Insert: {
342
+ activity_log?: Json;
343
+ attio_deal_id: string;
344
+ cached_stage?: string | null;
345
+ closed_lost_at?: string | null;
346
+ closed_lost_reason?: string | null;
347
+ contact_email: string;
348
+ contact_id?: string | null;
349
+ created_at?: string;
350
+ discovery_data?: Json | null;
351
+ discovery_submitted_at?: string | null;
352
+ discovery_submitted_by?: string | null;
353
+ id?: string;
354
+ initial_fee?: number | null;
355
+ monthly_fee?: number | null;
356
+ organization_id: string;
357
+ payment_link_sent_at?: string | null;
358
+ payment_received_at?: string | null;
359
+ proposal_data?: Json | null;
360
+ proposal_generated_at?: string | null;
361
+ proposal_pdf_url?: string | null;
362
+ proposal_reviewed_at?: string | null;
363
+ proposal_reviewed_by?: string | null;
364
+ proposal_sent_at?: string | null;
365
+ proposal_signed_at?: string | null;
366
+ proposal_status?: string | null;
367
+ signature_envelope_id?: string | null;
368
+ source_list_id?: string | null;
369
+ source_type?: string | null;
370
+ stripe_payment_id?: string | null;
371
+ stripe_payment_link?: string | null;
372
+ stripe_payment_link_id?: string | null;
373
+ stripe_subscription_id?: string | null;
374
+ updated_at?: string;
375
+ };
376
+ Update: {
377
+ activity_log?: Json;
378
+ attio_deal_id?: string;
379
+ cached_stage?: string | null;
380
+ closed_lost_at?: string | null;
381
+ closed_lost_reason?: string | null;
382
+ contact_email?: string;
383
+ contact_id?: string | null;
384
+ created_at?: string;
385
+ discovery_data?: Json | null;
386
+ discovery_submitted_at?: string | null;
387
+ discovery_submitted_by?: string | null;
388
+ id?: string;
389
+ initial_fee?: number | null;
390
+ monthly_fee?: number | null;
391
+ organization_id?: string;
392
+ payment_link_sent_at?: string | null;
393
+ payment_received_at?: string | null;
394
+ proposal_data?: Json | null;
395
+ proposal_generated_at?: string | null;
396
+ proposal_pdf_url?: string | null;
397
+ proposal_reviewed_at?: string | null;
398
+ proposal_reviewed_by?: string | null;
399
+ proposal_sent_at?: string | null;
400
+ proposal_signed_at?: string | null;
401
+ proposal_status?: string | null;
402
+ signature_envelope_id?: string | null;
403
+ source_list_id?: string | null;
404
+ source_type?: string | null;
405
+ stripe_payment_id?: string | null;
406
+ stripe_payment_link?: string | null;
407
+ stripe_payment_link_id?: string | null;
408
+ stripe_subscription_id?: string | null;
409
+ updated_at?: string;
410
+ };
411
+ Relationships: [
412
+ {
413
+ foreignKeyName: "acq_deals_contact_id_fkey";
414
+ columns: ["contact_id"];
415
+ isOneToOne: false;
416
+ referencedRelation: "acq_contacts";
417
+ referencedColumns: ["id"];
418
+ },
419
+ {
420
+ foreignKeyName: "acq_deals_organization_id_fkey";
421
+ columns: ["organization_id"];
422
+ isOneToOne: false;
423
+ referencedRelation: "organizations";
424
+ referencedColumns: ["id"];
425
+ },
426
+ {
427
+ foreignKeyName: "acq_deals_source_list_id_fkey";
428
+ columns: ["source_list_id"];
429
+ isOneToOne: false;
430
+ referencedRelation: "acq_lists";
431
+ referencedColumns: ["id"];
432
+ }
433
+ ];
434
+ };
435
+ acq_list_members: {
436
+ Row: {
437
+ added_at: string;
438
+ added_by: string | null;
439
+ contact_id: string;
440
+ id: string;
441
+ list_id: string;
442
+ };
443
+ Insert: {
444
+ added_at?: string;
445
+ added_by?: string | null;
446
+ contact_id: string;
447
+ id?: string;
448
+ list_id: string;
449
+ };
450
+ Update: {
451
+ added_at?: string;
452
+ added_by?: string | null;
453
+ contact_id?: string;
454
+ id?: string;
455
+ list_id?: string;
456
+ };
457
+ Relationships: [
458
+ {
459
+ foreignKeyName: "acq_list_members_contact_id_fkey";
460
+ columns: ["contact_id"];
461
+ isOneToOne: false;
462
+ referencedRelation: "acq_contacts";
463
+ referencedColumns: ["id"];
464
+ },
465
+ {
466
+ foreignKeyName: "acq_list_members_list_id_fkey";
467
+ columns: ["list_id"];
468
+ isOneToOne: false;
469
+ referencedRelation: "acq_lists";
470
+ referencedColumns: ["id"];
471
+ }
472
+ ];
473
+ };
474
+ acq_lists: {
475
+ Row: {
476
+ batch_ids: string[];
477
+ completed_at: string | null;
478
+ created_at: string;
479
+ description: string | null;
480
+ id: string;
481
+ instantly_campaign_id: string | null;
482
+ launched_at: string | null;
483
+ metadata: Json;
484
+ name: string;
485
+ organization_id: string;
486
+ status: string;
487
+ type: string;
488
+ };
489
+ Insert: {
490
+ batch_ids?: string[];
491
+ completed_at?: string | null;
492
+ created_at?: string;
493
+ description?: string | null;
494
+ id?: string;
495
+ instantly_campaign_id?: string | null;
496
+ launched_at?: string | null;
497
+ metadata?: Json;
498
+ name: string;
499
+ organization_id: string;
500
+ status?: string;
501
+ type?: string;
502
+ };
503
+ Update: {
504
+ batch_ids?: string[];
505
+ completed_at?: string | null;
506
+ created_at?: string;
507
+ description?: string | null;
508
+ id?: string;
509
+ instantly_campaign_id?: string | null;
510
+ launched_at?: string | null;
511
+ metadata?: Json;
512
+ name?: string;
513
+ organization_id?: string;
514
+ status?: string;
515
+ type?: string;
516
+ };
517
+ Relationships: [
518
+ {
519
+ foreignKeyName: "acq_lists_organization_id_fkey";
520
+ columns: ["organization_id"];
521
+ isOneToOne: false;
522
+ referencedRelation: "organizations";
523
+ referencedColumns: ["id"];
524
+ }
525
+ ];
526
+ };
527
+ acq_seo_metrics: {
528
+ Row: {
529
+ ai_citations: Json | null;
530
+ avg_position: number | null;
531
+ clicks: number | null;
532
+ created_at: string;
533
+ cta_clicks: number | null;
534
+ ctr: number | null;
535
+ data_point_count: number | null;
536
+ faq_count: number | null;
537
+ form_submissions: number | null;
538
+ id: string;
539
+ impressions: number | null;
540
+ organization_id: string;
541
+ period: string;
542
+ quality_score: number | null;
543
+ readability: number | null;
544
+ scroll_100: number | null;
545
+ scroll_25: number | null;
546
+ scroll_50: number | null;
547
+ scroll_75: number | null;
548
+ seo_page_id: string;
549
+ word_count: number | null;
550
+ };
551
+ Insert: {
552
+ ai_citations?: Json | null;
553
+ avg_position?: number | null;
554
+ clicks?: number | null;
555
+ created_at?: string;
556
+ cta_clicks?: number | null;
557
+ ctr?: number | null;
558
+ data_point_count?: number | null;
559
+ faq_count?: number | null;
560
+ form_submissions?: number | null;
561
+ id?: string;
562
+ impressions?: number | null;
563
+ organization_id: string;
564
+ period: string;
565
+ quality_score?: number | null;
566
+ readability?: number | null;
567
+ scroll_100?: number | null;
568
+ scroll_25?: number | null;
569
+ scroll_50?: number | null;
570
+ scroll_75?: number | null;
571
+ seo_page_id: string;
572
+ word_count?: number | null;
573
+ };
574
+ Update: {
575
+ ai_citations?: Json | null;
576
+ avg_position?: number | null;
577
+ clicks?: number | null;
578
+ created_at?: string;
579
+ cta_clicks?: number | null;
580
+ ctr?: number | null;
581
+ data_point_count?: number | null;
582
+ faq_count?: number | null;
583
+ form_submissions?: number | null;
584
+ id?: string;
585
+ impressions?: number | null;
586
+ organization_id?: string;
587
+ period?: string;
588
+ quality_score?: number | null;
589
+ readability?: number | null;
590
+ scroll_100?: number | null;
591
+ scroll_25?: number | null;
592
+ scroll_50?: number | null;
593
+ scroll_75?: number | null;
594
+ seo_page_id?: string;
595
+ word_count?: number | null;
596
+ };
597
+ Relationships: [
598
+ {
599
+ foreignKeyName: "acq_seo_metrics_organization_id_fkey";
600
+ columns: ["organization_id"];
601
+ isOneToOne: false;
602
+ referencedRelation: "organizations";
603
+ referencedColumns: ["id"];
604
+ },
605
+ {
606
+ foreignKeyName: "acq_seo_metrics_seo_page_id_fkey";
607
+ columns: ["seo_page_id"];
608
+ isOneToOne: false;
609
+ referencedRelation: "acq_seo_pages";
610
+ referencedColumns: ["id"];
611
+ }
612
+ ];
613
+ };
614
+ acq_seo_pages: {
615
+ Row: {
616
+ city: string | null;
617
+ content: Json | null;
618
+ created_at: string;
619
+ faq_items: Json | null;
620
+ hero_image_url: string | null;
621
+ id: string;
622
+ internal_links: Json | null;
623
+ local_data: Json | null;
624
+ meta_description: string | null;
625
+ organization_id: string;
626
+ page_type: string;
627
+ published_at: string | null;
628
+ refreshed_at: string | null;
629
+ schema_markup: Json | null;
630
+ slug: string;
631
+ state: string | null;
632
+ status: string;
633
+ title: string;
634
+ updated_at: string;
635
+ use_case: string | null;
636
+ vertical: string;
637
+ };
638
+ Insert: {
639
+ city?: string | null;
640
+ content?: Json | null;
641
+ created_at?: string;
642
+ faq_items?: Json | null;
643
+ hero_image_url?: string | null;
644
+ id?: string;
645
+ internal_links?: Json | null;
646
+ local_data?: Json | null;
647
+ meta_description?: string | null;
648
+ organization_id: string;
649
+ page_type: string;
650
+ published_at?: string | null;
651
+ refreshed_at?: string | null;
652
+ schema_markup?: Json | null;
653
+ slug: string;
654
+ state?: string | null;
655
+ status?: string;
656
+ title: string;
657
+ updated_at?: string;
658
+ use_case?: string | null;
659
+ vertical: string;
660
+ };
661
+ Update: {
662
+ city?: string | null;
663
+ content?: Json | null;
664
+ created_at?: string;
665
+ faq_items?: Json | null;
666
+ hero_image_url?: string | null;
667
+ id?: string;
668
+ internal_links?: Json | null;
669
+ local_data?: Json | null;
670
+ meta_description?: string | null;
671
+ organization_id?: string;
672
+ page_type?: string;
673
+ published_at?: string | null;
674
+ refreshed_at?: string | null;
675
+ schema_markup?: Json | null;
676
+ slug?: string;
677
+ state?: string | null;
678
+ status?: string;
679
+ title?: string;
680
+ updated_at?: string;
681
+ use_case?: string | null;
682
+ vertical?: string;
683
+ };
684
+ Relationships: [
685
+ {
686
+ foreignKeyName: "acq_seo_pages_organization_id_fkey";
687
+ columns: ["organization_id"];
688
+ isOneToOne: false;
689
+ referencedRelation: "organizations";
690
+ referencedColumns: ["id"];
691
+ }
692
+ ];
693
+ };
694
+ acq_social_posts: {
695
+ Row: {
696
+ author_name: string;
697
+ author_url: string | null;
698
+ comments_count: number;
699
+ created_at: string;
700
+ discovered_at: string;
701
+ engagement_count: number;
702
+ feedback: string | null;
703
+ final_response: string | null;
704
+ fully_reviewed: boolean;
705
+ id: string;
706
+ initial_draft: string | null;
707
+ matched_keywords: string[];
708
+ matched_query: string | null;
709
+ metadata: Json;
710
+ organization_id: string;
711
+ platform: string;
712
+ platform_post_id: string;
713
+ post_text: string;
714
+ post_title: string;
715
+ post_url: string;
716
+ posted_at: string;
717
+ relevance_score: number;
718
+ responded_at: string | null;
719
+ reviewed_at: string | null;
720
+ skip_reason: string | null;
721
+ source_category: string | null;
722
+ status: string;
723
+ updated_at: string;
724
+ };
725
+ Insert: {
726
+ author_name: string;
727
+ author_url?: string | null;
728
+ comments_count?: number;
729
+ created_at?: string;
730
+ discovered_at?: string;
731
+ engagement_count?: number;
732
+ feedback?: string | null;
733
+ final_response?: string | null;
734
+ fully_reviewed?: boolean;
735
+ id?: string;
736
+ initial_draft?: string | null;
737
+ matched_keywords?: string[];
738
+ matched_query?: string | null;
739
+ metadata?: Json;
740
+ organization_id: string;
741
+ platform: string;
742
+ platform_post_id: string;
743
+ post_text: string;
744
+ post_title: string;
745
+ post_url: string;
746
+ posted_at: string;
747
+ relevance_score?: number;
748
+ responded_at?: string | null;
749
+ reviewed_at?: string | null;
750
+ skip_reason?: string | null;
751
+ source_category?: string | null;
752
+ status?: string;
753
+ updated_at?: string;
754
+ };
755
+ Update: {
756
+ author_name?: string;
757
+ author_url?: string | null;
758
+ comments_count?: number;
759
+ created_at?: string;
760
+ discovered_at?: string;
761
+ engagement_count?: number;
762
+ feedback?: string | null;
763
+ final_response?: string | null;
764
+ fully_reviewed?: boolean;
765
+ id?: string;
766
+ initial_draft?: string | null;
767
+ matched_keywords?: string[];
768
+ matched_query?: string | null;
769
+ metadata?: Json;
770
+ organization_id?: string;
771
+ platform?: string;
772
+ platform_post_id?: string;
773
+ post_text?: string;
774
+ post_title?: string;
775
+ post_url?: string;
776
+ posted_at?: string;
777
+ relevance_score?: number;
778
+ responded_at?: string | null;
779
+ reviewed_at?: string | null;
780
+ skip_reason?: string | null;
781
+ source_category?: string | null;
782
+ status?: string;
783
+ updated_at?: string;
784
+ };
785
+ Relationships: [
786
+ {
787
+ foreignKeyName: "acq_social_posts_organization_id_fkey";
788
+ columns: ["organization_id"];
789
+ isOneToOne: false;
790
+ referencedRelation: "organizations";
791
+ referencedColumns: ["id"];
792
+ }
793
+ ];
794
+ };
795
+ activities: {
796
+ Row: {
797
+ activity_type: string;
798
+ actor_id: string | null;
799
+ actor_type: string | null;
800
+ created_at: string;
801
+ description: string | null;
802
+ entity_id: string;
803
+ entity_name: string | null;
804
+ entity_type: string;
805
+ id: string;
806
+ metadata: Json | null;
807
+ occurred_at: string;
808
+ organization_id: string;
809
+ status: string;
810
+ title: string;
811
+ };
812
+ Insert: {
813
+ activity_type: string;
814
+ actor_id?: string | null;
815
+ actor_type?: string | null;
816
+ created_at?: string;
817
+ description?: string | null;
818
+ entity_id: string;
819
+ entity_name?: string | null;
820
+ entity_type: string;
821
+ id?: string;
822
+ metadata?: Json | null;
823
+ occurred_at?: string;
824
+ organization_id: string;
825
+ status: string;
826
+ title: string;
827
+ };
828
+ Update: {
829
+ activity_type?: string;
830
+ actor_id?: string | null;
831
+ actor_type?: string | null;
832
+ created_at?: string;
833
+ description?: string | null;
834
+ entity_id?: string;
835
+ entity_name?: string | null;
836
+ entity_type?: string;
837
+ id?: string;
838
+ metadata?: Json | null;
839
+ occurred_at?: string;
840
+ organization_id?: string;
841
+ status?: string;
842
+ title?: string;
843
+ };
844
+ Relationships: [
845
+ {
846
+ foreignKeyName: "activities_organization_id_fkey";
847
+ columns: ["organization_id"];
848
+ isOneToOne: false;
849
+ referencedRelation: "organizations";
850
+ referencedColumns: ["id"];
851
+ }
852
+ ];
853
+ };
854
+ api_keys: {
855
+ Row: {
856
+ created_at: string | null;
857
+ id: string;
858
+ key_hash: string;
859
+ last_used_at: string | null;
860
+ name: string;
861
+ organization_id: string;
862
+ };
863
+ Insert: {
864
+ created_at?: string | null;
865
+ id?: string;
866
+ key_hash: string;
867
+ last_used_at?: string | null;
868
+ name: string;
869
+ organization_id: string;
870
+ };
871
+ Update: {
872
+ created_at?: string | null;
873
+ id?: string;
874
+ key_hash?: string;
875
+ last_used_at?: string | null;
876
+ name?: string;
877
+ organization_id?: string;
878
+ };
879
+ Relationships: [
880
+ {
881
+ foreignKeyName: "api_keys_organization_id_fkey";
882
+ columns: ["organization_id"];
883
+ isOneToOne: false;
884
+ referencedRelation: "organizations";
885
+ referencedColumns: ["id"];
886
+ }
887
+ ];
888
+ };
889
+ calibration_projects: {
890
+ Row: {
891
+ created_at: string | null;
892
+ description: string | null;
893
+ id: string;
894
+ name: string;
895
+ organization_id: string;
896
+ resource_id: string;
897
+ resource_type: string;
898
+ updated_at: string | null;
899
+ };
900
+ Insert: {
901
+ created_at?: string | null;
902
+ description?: string | null;
903
+ id?: string;
904
+ name: string;
905
+ organization_id: string;
906
+ resource_id: string;
907
+ resource_type: string;
908
+ updated_at?: string | null;
909
+ };
910
+ Update: {
911
+ created_at?: string | null;
912
+ description?: string | null;
913
+ id?: string;
914
+ name?: string;
915
+ organization_id?: string;
916
+ resource_id?: string;
917
+ resource_type?: string;
918
+ updated_at?: string | null;
919
+ };
920
+ Relationships: [
921
+ {
922
+ foreignKeyName: "calibration_projects_organization_id_fkey";
923
+ columns: ["organization_id"];
924
+ isOneToOne: false;
925
+ referencedRelation: "organizations";
926
+ referencedColumns: ["id"];
927
+ }
928
+ ];
929
+ };
930
+ calibration_runs: {
931
+ Row: {
932
+ completed_at: string | null;
933
+ config_variants: Json;
934
+ created_at: string | null;
935
+ description: string | null;
936
+ execution_mode: string;
937
+ grader_model: string | null;
938
+ grading_rubric: Json | null;
939
+ id: string;
940
+ name: string;
941
+ organization_id: string;
942
+ project_id: string;
943
+ results: Json;
944
+ status: string;
945
+ test_inputs: Json;
946
+ };
947
+ Insert: {
948
+ completed_at?: string | null;
949
+ config_variants: Json;
950
+ created_at?: string | null;
951
+ description?: string | null;
952
+ execution_mode?: string;
953
+ grader_model?: string | null;
954
+ grading_rubric?: Json | null;
955
+ id?: string;
956
+ name: string;
957
+ organization_id: string;
958
+ project_id: string;
959
+ results?: Json;
960
+ status?: string;
961
+ test_inputs: Json;
962
+ };
963
+ Update: {
964
+ completed_at?: string | null;
965
+ config_variants?: Json;
966
+ created_at?: string | null;
967
+ description?: string | null;
968
+ execution_mode?: string;
969
+ grader_model?: string | null;
970
+ grading_rubric?: Json | null;
971
+ id?: string;
972
+ name?: string;
973
+ organization_id?: string;
974
+ project_id?: string;
975
+ results?: Json;
976
+ status?: string;
977
+ test_inputs?: Json;
978
+ };
979
+ Relationships: [
980
+ {
981
+ foreignKeyName: "calibration_runs_organization_id_fkey";
982
+ columns: ["organization_id"];
983
+ isOneToOne: false;
984
+ referencedRelation: "organizations";
985
+ referencedColumns: ["id"];
986
+ },
987
+ {
988
+ foreignKeyName: "calibration_runs_project_id_fkey";
989
+ columns: ["project_id"];
990
+ isOneToOne: false;
991
+ referencedRelation: "calibration_projects";
992
+ referencedColumns: ["id"];
993
+ }
994
+ ];
995
+ };
996
+ command_queue: {
997
+ Row: {
998
+ action_payload: Json | null;
999
+ actions: Json;
1000
+ completed_at: string | null;
1001
+ completed_by: string | null;
1002
+ context: Json;
1003
+ created_at: string;
1004
+ description: string | null;
1005
+ expires_at: string | null;
1006
+ human_checkpoint: string | null;
1007
+ id: string;
1008
+ idempotency_key: string | null;
1009
+ metadata: Json | null;
1010
+ organization_id: string;
1011
+ origin_execution_id: string;
1012
+ origin_resource_id: string;
1013
+ origin_resource_type: string;
1014
+ priority: number;
1015
+ selected_action: string | null;
1016
+ status: string;
1017
+ target_execution_id: string | null;
1018
+ target_resource_id: string | null;
1019
+ target_resource_type: string | null;
1020
+ };
1021
+ Insert: {
1022
+ action_payload?: Json | null;
1023
+ actions: Json;
1024
+ completed_at?: string | null;
1025
+ completed_by?: string | null;
1026
+ context: Json;
1027
+ created_at?: string;
1028
+ description?: string | null;
1029
+ expires_at?: string | null;
1030
+ human_checkpoint?: string | null;
1031
+ id?: string;
1032
+ idempotency_key?: string | null;
1033
+ metadata?: Json | null;
1034
+ organization_id: string;
1035
+ origin_execution_id: string;
1036
+ origin_resource_id: string;
1037
+ origin_resource_type: string;
1038
+ priority?: number;
1039
+ selected_action?: string | null;
1040
+ status?: string;
1041
+ target_execution_id?: string | null;
1042
+ target_resource_id?: string | null;
1043
+ target_resource_type?: string | null;
1044
+ };
1045
+ Update: {
1046
+ action_payload?: Json | null;
1047
+ actions?: Json;
1048
+ completed_at?: string | null;
1049
+ completed_by?: string | null;
1050
+ context?: Json;
1051
+ created_at?: string;
1052
+ description?: string | null;
1053
+ expires_at?: string | null;
1054
+ human_checkpoint?: string | null;
1055
+ id?: string;
1056
+ idempotency_key?: string | null;
1057
+ metadata?: Json | null;
1058
+ organization_id?: string;
1059
+ origin_execution_id?: string;
1060
+ origin_resource_id?: string;
1061
+ origin_resource_type?: string;
1062
+ priority?: number;
1063
+ selected_action?: string | null;
1064
+ status?: string;
1065
+ target_execution_id?: string | null;
1066
+ target_resource_id?: string | null;
1067
+ target_resource_type?: string | null;
1068
+ };
1069
+ Relationships: [
1070
+ {
1071
+ foreignKeyName: "command_queue_completed_by_fkey";
1072
+ columns: ["completed_by"];
1073
+ isOneToOne: false;
1074
+ referencedRelation: "users";
1075
+ referencedColumns: ["id"];
1076
+ },
1077
+ {
1078
+ foreignKeyName: "command_queue_organization_id_fkey";
1079
+ columns: ["organization_id"];
1080
+ isOneToOne: false;
1081
+ referencedRelation: "organizations";
1082
+ referencedColumns: ["id"];
1083
+ },
1084
+ {
1085
+ foreignKeyName: "command_queue_target_execution_id_fkey";
1086
+ columns: ["target_execution_id"];
1087
+ isOneToOne: false;
1088
+ referencedRelation: "execution_logs";
1089
+ referencedColumns: ["execution_id"];
1090
+ }
1091
+ ];
1092
+ };
1093
+ credentials: {
1094
+ Row: {
1095
+ created_at: string;
1096
+ created_by: string | null;
1097
+ encrypted_value: string;
1098
+ id: string;
1099
+ name: string;
1100
+ organization_id: string;
1101
+ provider: string | null;
1102
+ type: string;
1103
+ updated_at: string;
1104
+ };
1105
+ Insert: {
1106
+ created_at?: string;
1107
+ created_by?: string | null;
1108
+ encrypted_value: string;
1109
+ id?: string;
1110
+ name: string;
1111
+ organization_id: string;
1112
+ provider?: string | null;
1113
+ type?: string;
1114
+ updated_at?: string;
1115
+ };
1116
+ Update: {
1117
+ created_at?: string;
1118
+ created_by?: string | null;
1119
+ encrypted_value?: string;
1120
+ id?: string;
1121
+ name?: string;
1122
+ organization_id?: string;
1123
+ provider?: string | null;
1124
+ type?: string;
1125
+ updated_at?: string;
1126
+ };
1127
+ Relationships: [
1128
+ {
1129
+ foreignKeyName: "credentials_created_by_fkey";
1130
+ columns: ["created_by"];
1131
+ isOneToOne: false;
1132
+ referencedRelation: "users";
1133
+ referencedColumns: ["id"];
1134
+ },
1135
+ {
1136
+ foreignKeyName: "credentials_organization_id_fkey";
1137
+ columns: ["organization_id"];
1138
+ isOneToOne: false;
1139
+ referencedRelation: "organizations";
1140
+ referencedColumns: ["id"];
1141
+ }
1142
+ ];
1143
+ };
1144
+ deployments: {
1145
+ Row: {
1146
+ compiled_docs: Json | null;
1147
+ created_at: string;
1148
+ deployment_version: string | null;
1149
+ documentation: Json | null;
1150
+ error_message: string | null;
1151
+ id: string;
1152
+ organization_id: string;
1153
+ pid: number | null;
1154
+ port: number | null;
1155
+ sdk_version: string;
1156
+ status: string;
1157
+ tarball_path: string | null;
1158
+ updated_at: string;
1159
+ };
1160
+ Insert: {
1161
+ compiled_docs?: Json | null;
1162
+ created_at?: string;
1163
+ deployment_version?: string | null;
1164
+ documentation?: Json | null;
1165
+ error_message?: string | null;
1166
+ id?: string;
1167
+ organization_id: string;
1168
+ pid?: number | null;
1169
+ port?: number | null;
1170
+ sdk_version: string;
1171
+ status?: string;
1172
+ tarball_path?: string | null;
1173
+ updated_at?: string;
1174
+ };
1175
+ Update: {
1176
+ compiled_docs?: Json | null;
1177
+ created_at?: string;
1178
+ deployment_version?: string | null;
1179
+ documentation?: Json | null;
1180
+ error_message?: string | null;
1181
+ id?: string;
1182
+ organization_id?: string;
1183
+ pid?: number | null;
1184
+ port?: number | null;
1185
+ sdk_version?: string;
1186
+ status?: string;
1187
+ tarball_path?: string | null;
1188
+ updated_at?: string;
1189
+ };
1190
+ Relationships: [
1191
+ {
1192
+ foreignKeyName: "deployments_organization_id_fkey";
1193
+ columns: ["organization_id"];
1194
+ isOneToOne: false;
1195
+ referencedRelation: "organizations";
1196
+ referencedColumns: ["id"];
1197
+ }
1198
+ ];
1199
+ };
1200
+ execution_errors: {
1201
+ Row: {
1202
+ created_at: string | null;
1203
+ error_category: string;
1204
+ error_message: string;
1205
+ error_severity: string;
1206
+ error_stack_trace: string | null;
1207
+ error_type: string;
1208
+ execution_id: string;
1209
+ id: string;
1210
+ metadata: Json | null;
1211
+ occurred_at: string;
1212
+ organization_id: string;
1213
+ resolved: boolean;
1214
+ resolved_at: string | null;
1215
+ resolved_by: string | null;
1216
+ };
1217
+ Insert: {
1218
+ created_at?: string | null;
1219
+ error_category: string;
1220
+ error_message: string;
1221
+ error_severity: string;
1222
+ error_stack_trace?: string | null;
1223
+ error_type: string;
1224
+ execution_id: string;
1225
+ id?: string;
1226
+ metadata?: Json | null;
1227
+ occurred_at?: string;
1228
+ organization_id: string;
1229
+ resolved?: boolean;
1230
+ resolved_at?: string | null;
1231
+ resolved_by?: string | null;
1232
+ };
1233
+ Update: {
1234
+ created_at?: string | null;
1235
+ error_category?: string;
1236
+ error_message?: string;
1237
+ error_severity?: string;
1238
+ error_stack_trace?: string | null;
1239
+ error_type?: string;
1240
+ execution_id?: string;
1241
+ id?: string;
1242
+ metadata?: Json | null;
1243
+ occurred_at?: string;
1244
+ organization_id?: string;
1245
+ resolved?: boolean;
1246
+ resolved_at?: string | null;
1247
+ resolved_by?: string | null;
1248
+ };
1249
+ Relationships: [
1250
+ {
1251
+ foreignKeyName: "execution_errors_execution_id_fkey";
1252
+ columns: ["execution_id"];
1253
+ isOneToOne: false;
1254
+ referencedRelation: "execution_logs";
1255
+ referencedColumns: ["execution_id"];
1256
+ },
1257
+ {
1258
+ foreignKeyName: "execution_errors_organization_id_fkey";
1259
+ columns: ["organization_id"];
1260
+ isOneToOne: false;
1261
+ referencedRelation: "organizations";
1262
+ referencedColumns: ["id"];
1263
+ },
1264
+ {
1265
+ foreignKeyName: "execution_errors_resolved_by_fkey";
1266
+ columns: ["resolved_by"];
1267
+ isOneToOne: false;
1268
+ referencedRelation: "users";
1269
+ referencedColumns: ["id"];
1270
+ }
1271
+ ];
1272
+ };
1273
+ execution_logs: {
1274
+ Row: {
1275
+ api_version: string | null;
1276
+ completed_at: string | null;
1277
+ created_at: string | null;
1278
+ error: string | null;
1279
+ execution_id: string;
1280
+ input: Json | null;
1281
+ last_heartbeat_at: string | null;
1282
+ logs: Json | null;
1283
+ organization_id: string;
1284
+ origin_execution_id: string | null;
1285
+ output: Json | null;
1286
+ resource_id: string;
1287
+ resource_status: string;
1288
+ resource_type: string;
1289
+ resource_version: string | null;
1290
+ sdk_version: string | null;
1291
+ session_id: string | null;
1292
+ session_turn_number: number | null;
1293
+ started_at: string;
1294
+ status: string;
1295
+ trigger_type: string | null;
1296
+ updated_at: string | null;
1297
+ user_id: string | null;
1298
+ };
1299
+ Insert: {
1300
+ api_version?: string | null;
1301
+ completed_at?: string | null;
1302
+ created_at?: string | null;
1303
+ error?: string | null;
1304
+ execution_id?: string;
1305
+ input?: Json | null;
1306
+ last_heartbeat_at?: string | null;
1307
+ logs?: Json | null;
1308
+ organization_id: string;
1309
+ origin_execution_id?: string | null;
1310
+ output?: Json | null;
1311
+ resource_id: string;
1312
+ resource_status?: string;
1313
+ resource_type?: string;
1314
+ resource_version?: string | null;
1315
+ sdk_version?: string | null;
1316
+ session_id?: string | null;
1317
+ session_turn_number?: number | null;
1318
+ started_at?: string;
1319
+ status: string;
1320
+ trigger_type?: string | null;
1321
+ updated_at?: string | null;
1322
+ user_id?: string | null;
1323
+ };
1324
+ Update: {
1325
+ api_version?: string | null;
1326
+ completed_at?: string | null;
1327
+ created_at?: string | null;
1328
+ error?: string | null;
1329
+ execution_id?: string;
1330
+ input?: Json | null;
1331
+ last_heartbeat_at?: string | null;
1332
+ logs?: Json | null;
1333
+ organization_id?: string;
1334
+ origin_execution_id?: string | null;
1335
+ output?: Json | null;
1336
+ resource_id?: string;
1337
+ resource_status?: string;
1338
+ resource_type?: string;
1339
+ resource_version?: string | null;
1340
+ sdk_version?: string | null;
1341
+ session_id?: string | null;
1342
+ session_turn_number?: number | null;
1343
+ started_at?: string;
1344
+ status?: string;
1345
+ trigger_type?: string | null;
1346
+ updated_at?: string | null;
1347
+ user_id?: string | null;
1348
+ };
1349
+ Relationships: [
1350
+ {
1351
+ foreignKeyName: "execution_history_organization_id_fkey";
1352
+ columns: ["organization_id"];
1353
+ isOneToOne: false;
1354
+ referencedRelation: "organizations";
1355
+ referencedColumns: ["id"];
1356
+ },
1357
+ {
1358
+ foreignKeyName: "execution_logs_origin_execution_id_fkey";
1359
+ columns: ["origin_execution_id"];
1360
+ isOneToOne: false;
1361
+ referencedRelation: "execution_logs";
1362
+ referencedColumns: ["execution_id"];
1363
+ },
1364
+ {
1365
+ foreignKeyName: "execution_logs_session_id_fkey";
1366
+ columns: ["session_id"];
1367
+ isOneToOne: false;
1368
+ referencedRelation: "sessions";
1369
+ referencedColumns: ["session_id"];
1370
+ },
1371
+ {
1372
+ foreignKeyName: "execution_logs_user_id_fkey";
1373
+ columns: ["user_id"];
1374
+ isOneToOne: false;
1375
+ referencedRelation: "users";
1376
+ referencedColumns: ["id"];
1377
+ }
1378
+ ];
1379
+ };
1380
+ execution_metrics: {
1381
+ Row: {
1382
+ ai_call_count: number;
1383
+ ai_calls: Json | null;
1384
+ automation_savings_usd: number | null;
1385
+ created_at: string | null;
1386
+ duration_ms: number | null;
1387
+ execution_id: string;
1388
+ organization_id: string;
1389
+ resource_id: string;
1390
+ total_cost_usd: number;
1391
+ total_input_tokens: number;
1392
+ total_output_tokens: number;
1393
+ };
1394
+ Insert: {
1395
+ ai_call_count: number;
1396
+ ai_calls?: Json | null;
1397
+ automation_savings_usd?: number | null;
1398
+ created_at?: string | null;
1399
+ duration_ms?: number | null;
1400
+ execution_id: string;
1401
+ organization_id: string;
1402
+ resource_id: string;
1403
+ total_cost_usd: number;
1404
+ total_input_tokens: number;
1405
+ total_output_tokens: number;
1406
+ };
1407
+ Update: {
1408
+ ai_call_count?: number;
1409
+ ai_calls?: Json | null;
1410
+ automation_savings_usd?: number | null;
1411
+ created_at?: string | null;
1412
+ duration_ms?: number | null;
1413
+ execution_id?: string;
1414
+ organization_id?: string;
1415
+ resource_id?: string;
1416
+ total_cost_usd?: number;
1417
+ total_input_tokens?: number;
1418
+ total_output_tokens?: number;
1419
+ };
1420
+ Relationships: [
1421
+ {
1422
+ foreignKeyName: "execution_metrics_execution_id_fkey";
1423
+ columns: ["execution_id"];
1424
+ isOneToOne: true;
1425
+ referencedRelation: "execution_logs";
1426
+ referencedColumns: ["execution_id"];
1427
+ },
1428
+ {
1429
+ foreignKeyName: "execution_metrics_organization_id_fkey";
1430
+ columns: ["organization_id"];
1431
+ isOneToOne: false;
1432
+ referencedRelation: "organizations";
1433
+ referencedColumns: ["id"];
1434
+ }
1435
+ ];
1436
+ };
1437
+ notifications: {
1438
+ Row: {
1439
+ action_url: string | null;
1440
+ category: string;
1441
+ created_at: string | null;
1442
+ id: string;
1443
+ message: string;
1444
+ organization_id: string;
1445
+ read: boolean | null;
1446
+ read_at: string | null;
1447
+ title: string;
1448
+ user_id: string;
1449
+ };
1450
+ Insert: {
1451
+ action_url?: string | null;
1452
+ category: string;
1453
+ created_at?: string | null;
1454
+ id?: string;
1455
+ message: string;
1456
+ organization_id: string;
1457
+ read?: boolean | null;
1458
+ read_at?: string | null;
1459
+ title: string;
1460
+ user_id: string;
1461
+ };
1462
+ Update: {
1463
+ action_url?: string | null;
1464
+ category?: string;
1465
+ created_at?: string | null;
1466
+ id?: string;
1467
+ message?: string;
1468
+ organization_id?: string;
1469
+ read?: boolean | null;
1470
+ read_at?: string | null;
1471
+ title?: string;
1472
+ user_id?: string;
1473
+ };
1474
+ Relationships: [
1475
+ {
1476
+ foreignKeyName: "notifications_organization_id_fkey";
1477
+ columns: ["organization_id"];
1478
+ isOneToOne: false;
1479
+ referencedRelation: "organizations";
1480
+ referencedColumns: ["id"];
1481
+ },
1482
+ {
1483
+ foreignKeyName: "notifications_user_id_fkey";
1484
+ columns: ["user_id"];
1485
+ isOneToOne: false;
1486
+ referencedRelation: "users";
1487
+ referencedColumns: ["id"];
1488
+ }
1489
+ ];
1490
+ };
1491
+ org_invitations: {
1492
+ Row: {
1493
+ accept_invitation_url: string | null;
1494
+ accepted_at: string | null;
1495
+ created_at: string | null;
1496
+ email: string;
1497
+ expires_at: string;
1498
+ id: string;
1499
+ invitation_state: string | null;
1500
+ invitation_token: string | null;
1501
+ inviter_user_id: string | null;
1502
+ organization_id: string | null;
1503
+ revoked_at: string | null;
1504
+ role_slug: string | null;
1505
+ updated_at: string | null;
1506
+ workos_invitation_id: string;
1507
+ };
1508
+ Insert: {
1509
+ accept_invitation_url?: string | null;
1510
+ accepted_at?: string | null;
1511
+ created_at?: string | null;
1512
+ email: string;
1513
+ expires_at: string;
1514
+ id?: string;
1515
+ invitation_state?: string | null;
1516
+ invitation_token?: string | null;
1517
+ inviter_user_id?: string | null;
1518
+ organization_id?: string | null;
1519
+ revoked_at?: string | null;
1520
+ role_slug?: string | null;
1521
+ updated_at?: string | null;
1522
+ workos_invitation_id: string;
1523
+ };
1524
+ Update: {
1525
+ accept_invitation_url?: string | null;
1526
+ accepted_at?: string | null;
1527
+ created_at?: string | null;
1528
+ email?: string;
1529
+ expires_at?: string;
1530
+ id?: string;
1531
+ invitation_state?: string | null;
1532
+ invitation_token?: string | null;
1533
+ inviter_user_id?: string | null;
1534
+ organization_id?: string | null;
1535
+ revoked_at?: string | null;
1536
+ role_slug?: string | null;
1537
+ updated_at?: string | null;
1538
+ workos_invitation_id?: string;
1539
+ };
1540
+ Relationships: [
1541
+ {
1542
+ foreignKeyName: "org_invitations_inviter_user_id_fkey";
1543
+ columns: ["inviter_user_id"];
1544
+ isOneToOne: false;
1545
+ referencedRelation: "users";
1546
+ referencedColumns: ["id"];
1547
+ },
1548
+ {
1549
+ foreignKeyName: "org_invitations_organization_id_fkey";
1550
+ columns: ["organization_id"];
1551
+ isOneToOne: false;
1552
+ referencedRelation: "organizations";
1553
+ referencedColumns: ["id"];
1554
+ }
1555
+ ];
1556
+ };
1557
+ org_memberships: {
1558
+ Row: {
1559
+ config: Json;
1560
+ created_at: string | null;
1561
+ id: string;
1562
+ membership_status: string | null;
1563
+ organization_id: string;
1564
+ role_slug: string | null;
1565
+ updated_at: string | null;
1566
+ user_id: string;
1567
+ workos_membership_id: string | null;
1568
+ };
1569
+ Insert: {
1570
+ config?: Json;
1571
+ created_at?: string | null;
1572
+ id?: string;
1573
+ membership_status?: string | null;
1574
+ organization_id: string;
1575
+ role_slug?: string | null;
1576
+ updated_at?: string | null;
1577
+ user_id: string;
1578
+ workos_membership_id?: string | null;
1579
+ };
1580
+ Update: {
1581
+ config?: Json;
1582
+ created_at?: string | null;
1583
+ id?: string;
1584
+ membership_status?: string | null;
1585
+ organization_id?: string;
1586
+ role_slug?: string | null;
1587
+ updated_at?: string | null;
1588
+ user_id?: string;
1589
+ workos_membership_id?: string | null;
1590
+ };
1591
+ Relationships: [
1592
+ {
1593
+ foreignKeyName: "org_memberships_organization_id_fkey";
1594
+ columns: ["organization_id"];
1595
+ isOneToOne: false;
1596
+ referencedRelation: "organizations";
1597
+ referencedColumns: ["id"];
1598
+ },
1599
+ {
1600
+ foreignKeyName: "org_memberships_user_id_fkey";
1601
+ columns: ["user_id"];
1602
+ isOneToOne: false;
1603
+ referencedRelation: "users";
1604
+ referencedColumns: ["id"];
1605
+ }
1606
+ ];
1607
+ };
1608
+ organizations: {
1609
+ Row: {
1610
+ config: Json;
1611
+ created_at: string;
1612
+ id: string;
1613
+ is_test: boolean;
1614
+ metadata: Json;
1615
+ name: string;
1616
+ status: string;
1617
+ updated_at: string;
1618
+ workos_org_id: string;
1619
+ };
1620
+ Insert: {
1621
+ config?: Json;
1622
+ created_at?: string;
1623
+ id?: string;
1624
+ is_test?: boolean;
1625
+ metadata?: Json;
1626
+ name: string;
1627
+ status?: string;
1628
+ updated_at?: string;
1629
+ workos_org_id: string;
1630
+ };
1631
+ Update: {
1632
+ config?: Json;
1633
+ created_at?: string;
1634
+ id?: string;
1635
+ is_test?: boolean;
1636
+ metadata?: Json;
1637
+ name?: string;
1638
+ status?: string;
1639
+ updated_at?: string;
1640
+ workos_org_id?: string;
1641
+ };
1642
+ Relationships: [];
1643
+ };
1644
+ session_messages: {
1645
+ Row: {
1646
+ created_at: string | null;
1647
+ id: string;
1648
+ message: string;
1649
+ message_index: number | null;
1650
+ message_type: string | null;
1651
+ metadata: Json | null;
1652
+ role: string;
1653
+ session_id: string;
1654
+ session_turn_number: number;
1655
+ };
1656
+ Insert: {
1657
+ created_at?: string | null;
1658
+ id: string;
1659
+ message: string;
1660
+ message_index?: number | null;
1661
+ message_type?: string | null;
1662
+ metadata?: Json | null;
1663
+ role: string;
1664
+ session_id: string;
1665
+ session_turn_number: number;
1666
+ };
1667
+ Update: {
1668
+ created_at?: string | null;
1669
+ id?: string;
1670
+ message?: string;
1671
+ message_index?: number | null;
1672
+ message_type?: string | null;
1673
+ metadata?: Json | null;
1674
+ role?: string;
1675
+ session_id?: string;
1676
+ session_turn_number?: number;
1677
+ };
1678
+ Relationships: [
1679
+ {
1680
+ foreignKeyName: "session_messages_session_id_fkey";
1681
+ columns: ["session_id"];
1682
+ isOneToOne: false;
1683
+ referencedRelation: "sessions";
1684
+ referencedColumns: ["session_id"];
1685
+ }
1686
+ ];
1687
+ };
1688
+ sessions: {
1689
+ Row: {
1690
+ context_window_size: number;
1691
+ created_at: string | null;
1692
+ cumulative_input_tokens: number;
1693
+ cumulative_output_tokens: number;
1694
+ deleted_at: string | null;
1695
+ ended_at: string | null;
1696
+ memory_snapshot: Json;
1697
+ metadata: Json | null;
1698
+ organization_id: string;
1699
+ resource_id: string;
1700
+ session_id: string;
1701
+ session_total_turns: number | null;
1702
+ updated_at: string | null;
1703
+ user_id: string | null;
1704
+ };
1705
+ Insert: {
1706
+ context_window_size?: number;
1707
+ created_at?: string | null;
1708
+ cumulative_input_tokens?: number;
1709
+ cumulative_output_tokens?: number;
1710
+ deleted_at?: string | null;
1711
+ ended_at?: string | null;
1712
+ memory_snapshot: Json;
1713
+ metadata?: Json | null;
1714
+ organization_id: string;
1715
+ resource_id: string;
1716
+ session_id?: string;
1717
+ session_total_turns?: number | null;
1718
+ updated_at?: string | null;
1719
+ user_id?: string | null;
1720
+ };
1721
+ Update: {
1722
+ context_window_size?: number;
1723
+ created_at?: string | null;
1724
+ cumulative_input_tokens?: number;
1725
+ cumulative_output_tokens?: number;
1726
+ deleted_at?: string | null;
1727
+ ended_at?: string | null;
1728
+ memory_snapshot?: Json;
1729
+ metadata?: Json | null;
1730
+ organization_id?: string;
1731
+ resource_id?: string;
1732
+ session_id?: string;
1733
+ session_total_turns?: number | null;
1734
+ updated_at?: string | null;
1735
+ user_id?: string | null;
1736
+ };
1737
+ Relationships: [
1738
+ {
1739
+ foreignKeyName: "fk_organization";
1740
+ columns: ["organization_id"];
1741
+ isOneToOne: false;
1742
+ referencedRelation: "organizations";
1743
+ referencedColumns: ["id"];
1744
+ },
1745
+ {
1746
+ foreignKeyName: "fk_user";
1747
+ columns: ["user_id"];
1748
+ isOneToOne: false;
1749
+ referencedRelation: "users";
1750
+ referencedColumns: ["id"];
1751
+ }
1752
+ ];
1753
+ };
1754
+ task_schedules: {
1755
+ Row: {
1756
+ created_at: string;
1757
+ current_step: number;
1758
+ description: string | null;
1759
+ id: string;
1760
+ idempotency_key: string | null;
1761
+ last_execution_id: string | null;
1762
+ last_run_at: string | null;
1763
+ max_retries: number;
1764
+ metadata: Json | null;
1765
+ name: string;
1766
+ next_run_at: string | null;
1767
+ organization_id: string;
1768
+ origin_execution_id: string | null;
1769
+ origin_resource_id: string | null;
1770
+ origin_resource_type: string | null;
1771
+ retry_count: number;
1772
+ schedule_config: Json;
1773
+ status: string;
1774
+ target_resource_id: string;
1775
+ target_resource_type: string;
1776
+ updated_at: string;
1777
+ };
1778
+ Insert: {
1779
+ created_at?: string;
1780
+ current_step?: number;
1781
+ description?: string | null;
1782
+ id?: string;
1783
+ idempotency_key?: string | null;
1784
+ last_execution_id?: string | null;
1785
+ last_run_at?: string | null;
1786
+ max_retries?: number;
1787
+ metadata?: Json | null;
1788
+ name: string;
1789
+ next_run_at?: string | null;
1790
+ organization_id: string;
1791
+ origin_execution_id?: string | null;
1792
+ origin_resource_id?: string | null;
1793
+ origin_resource_type?: string | null;
1794
+ retry_count?: number;
1795
+ schedule_config: Json;
1796
+ status?: string;
1797
+ target_resource_id: string;
1798
+ target_resource_type: string;
1799
+ updated_at?: string;
1800
+ };
1801
+ Update: {
1802
+ created_at?: string;
1803
+ current_step?: number;
1804
+ description?: string | null;
1805
+ id?: string;
1806
+ idempotency_key?: string | null;
1807
+ last_execution_id?: string | null;
1808
+ last_run_at?: string | null;
1809
+ max_retries?: number;
1810
+ metadata?: Json | null;
1811
+ name?: string;
1812
+ next_run_at?: string | null;
1813
+ organization_id?: string;
1814
+ origin_execution_id?: string | null;
1815
+ origin_resource_id?: string | null;
1816
+ origin_resource_type?: string | null;
1817
+ retry_count?: number;
1818
+ schedule_config?: Json;
1819
+ status?: string;
1820
+ target_resource_id?: string;
1821
+ target_resource_type?: string;
1822
+ updated_at?: string;
1823
+ };
1824
+ Relationships: [
1825
+ {
1826
+ foreignKeyName: "task_schedules_organization_id_fkey";
1827
+ columns: ["organization_id"];
1828
+ isOneToOne: false;
1829
+ referencedRelation: "organizations";
1830
+ referencedColumns: ["id"];
1831
+ }
1832
+ ];
1833
+ };
1834
+ training_assessments: {
1835
+ Row: {
1836
+ answers: Json | null;
1837
+ assessment_slug: string;
1838
+ attempted_at: string;
1839
+ course_slug: string;
1840
+ id: string;
1841
+ organization_id: string;
1842
+ passed: boolean;
1843
+ score: number;
1844
+ user_id: string;
1845
+ };
1846
+ Insert: {
1847
+ answers?: Json | null;
1848
+ assessment_slug: string;
1849
+ attempted_at?: string;
1850
+ course_slug: string;
1851
+ id?: string;
1852
+ organization_id: string;
1853
+ passed: boolean;
1854
+ score: number;
1855
+ user_id: string;
1856
+ };
1857
+ Update: {
1858
+ answers?: Json | null;
1859
+ assessment_slug?: string;
1860
+ attempted_at?: string;
1861
+ course_slug?: string;
1862
+ id?: string;
1863
+ organization_id?: string;
1864
+ passed?: boolean;
1865
+ score?: number;
1866
+ user_id?: string;
1867
+ };
1868
+ Relationships: [
1869
+ {
1870
+ foreignKeyName: "training_assessments_organization_id_fkey";
1871
+ columns: ["organization_id"];
1872
+ isOneToOne: false;
1873
+ referencedRelation: "organizations";
1874
+ referencedColumns: ["id"];
1875
+ },
1876
+ {
1877
+ foreignKeyName: "training_assessments_user_id_fkey";
1878
+ columns: ["user_id"];
1879
+ isOneToOne: false;
1880
+ referencedRelation: "users";
1881
+ referencedColumns: ["id"];
1882
+ }
1883
+ ];
1884
+ };
1885
+ training_certifications: {
1886
+ Row: {
1887
+ awarded_at: string;
1888
+ certification_slug: string;
1889
+ id: string;
1890
+ organization_id: string;
1891
+ user_id: string;
1892
+ };
1893
+ Insert: {
1894
+ awarded_at?: string;
1895
+ certification_slug: string;
1896
+ id?: string;
1897
+ organization_id: string;
1898
+ user_id: string;
1899
+ };
1900
+ Update: {
1901
+ awarded_at?: string;
1902
+ certification_slug?: string;
1903
+ id?: string;
1904
+ organization_id?: string;
1905
+ user_id?: string;
1906
+ };
1907
+ Relationships: [
1908
+ {
1909
+ foreignKeyName: "training_certifications_organization_id_fkey";
1910
+ columns: ["organization_id"];
1911
+ isOneToOne: false;
1912
+ referencedRelation: "organizations";
1913
+ referencedColumns: ["id"];
1914
+ },
1915
+ {
1916
+ foreignKeyName: "training_certifications_user_id_fkey";
1917
+ columns: ["user_id"];
1918
+ isOneToOne: false;
1919
+ referencedRelation: "users";
1920
+ referencedColumns: ["id"];
1921
+ }
1922
+ ];
1923
+ };
1924
+ training_progress: {
1925
+ Row: {
1926
+ completed_at: string;
1927
+ course_slug: string;
1928
+ id: string;
1929
+ lesson_slug: string;
1930
+ organization_id: string;
1931
+ user_id: string;
1932
+ };
1933
+ Insert: {
1934
+ completed_at?: string;
1935
+ course_slug: string;
1936
+ id?: string;
1937
+ lesson_slug: string;
1938
+ organization_id: string;
1939
+ user_id: string;
1940
+ };
1941
+ Update: {
1942
+ completed_at?: string;
1943
+ course_slug?: string;
1944
+ id?: string;
1945
+ lesson_slug?: string;
1946
+ organization_id?: string;
1947
+ user_id?: string;
1948
+ };
1949
+ Relationships: [
1950
+ {
1951
+ foreignKeyName: "training_progress_organization_id_fkey";
1952
+ columns: ["organization_id"];
1953
+ isOneToOne: false;
1954
+ referencedRelation: "organizations";
1955
+ referencedColumns: ["id"];
1956
+ },
1957
+ {
1958
+ foreignKeyName: "training_progress_user_id_fkey";
1959
+ columns: ["user_id"];
1960
+ isOneToOne: false;
1961
+ referencedRelation: "users";
1962
+ referencedColumns: ["id"];
1963
+ }
1964
+ ];
1965
+ };
1966
+ users: {
1967
+ Row: {
1968
+ config: Json;
1969
+ created_at: string;
1970
+ display_name: string | null;
1971
+ email: string;
1972
+ first_name: string | null;
1973
+ id: string;
1974
+ is_active: boolean;
1975
+ is_platform_admin: boolean | null;
1976
+ last_login_at: string | null;
1977
+ last_name: string | null;
1978
+ last_visited_org: string | null;
1979
+ profile_picture_url: string | null;
1980
+ updated_at: string;
1981
+ workos_user_id: string | null;
1982
+ };
1983
+ Insert: {
1984
+ config?: Json;
1985
+ created_at?: string;
1986
+ display_name?: string | null;
1987
+ email: string;
1988
+ first_name?: string | null;
1989
+ id?: string;
1990
+ is_active?: boolean;
1991
+ is_platform_admin?: boolean | null;
1992
+ last_login_at?: string | null;
1993
+ last_name?: string | null;
1994
+ last_visited_org?: string | null;
1995
+ profile_picture_url?: string | null;
1996
+ updated_at?: string;
1997
+ workos_user_id?: string | null;
1998
+ };
1999
+ Update: {
2000
+ config?: Json;
2001
+ created_at?: string;
2002
+ display_name?: string | null;
2003
+ email?: string;
2004
+ first_name?: string | null;
2005
+ id?: string;
2006
+ is_active?: boolean;
2007
+ is_platform_admin?: boolean | null;
2008
+ last_login_at?: string | null;
2009
+ last_name?: string | null;
2010
+ last_visited_org?: string | null;
2011
+ profile_picture_url?: string | null;
2012
+ updated_at?: string;
2013
+ workos_user_id?: string | null;
2014
+ };
2015
+ Relationships: [
2016
+ {
2017
+ foreignKeyName: "user_profiles_last_visited_org_fkey";
2018
+ columns: ["last_visited_org"];
2019
+ isOneToOne: false;
2020
+ referencedRelation: "organizations";
2021
+ referencedColumns: ["id"];
2022
+ }
2023
+ ];
2024
+ };
2025
+ webhook_endpoints: {
2026
+ Row: {
2027
+ created_at: string;
2028
+ description: string | null;
2029
+ id: string;
2030
+ key: string;
2031
+ last_triggered_at: string | null;
2032
+ name: string;
2033
+ organization_id: string;
2034
+ request_count: number;
2035
+ resource_id: string | null;
2036
+ status: string;
2037
+ updated_at: string;
2038
+ };
2039
+ Insert: {
2040
+ created_at?: string;
2041
+ description?: string | null;
2042
+ id?: string;
2043
+ key: string;
2044
+ last_triggered_at?: string | null;
2045
+ name: string;
2046
+ organization_id: string;
2047
+ request_count?: number;
2048
+ resource_id?: string | null;
2049
+ status?: string;
2050
+ updated_at?: string;
2051
+ };
2052
+ Update: {
2053
+ created_at?: string;
2054
+ description?: string | null;
2055
+ id?: string;
2056
+ key?: string;
2057
+ last_triggered_at?: string | null;
2058
+ name?: string;
2059
+ organization_id?: string;
2060
+ request_count?: number;
2061
+ resource_id?: string | null;
2062
+ status?: string;
2063
+ updated_at?: string;
2064
+ };
2065
+ Relationships: [
2066
+ {
2067
+ foreignKeyName: "webhook_endpoints_organization_id_fkey";
2068
+ columns: ["organization_id"];
2069
+ isOneToOne: false;
2070
+ referencedRelation: "organizations";
2071
+ referencedColumns: ["id"];
2072
+ }
2073
+ ];
2074
+ };
2075
+ };
2076
+ Views: {
2077
+ [_ in never]: never;
2078
+ };
2079
+ Functions: {
2080
+ acq_default_checklist: {
2081
+ Args: {
2082
+ p_platform: string;
2083
+ };
2084
+ Returns: Json;
2085
+ };
2086
+ append_deal_activity: {
2087
+ Args: {
2088
+ p_activity: Json;
2089
+ p_deal_id: string;
2090
+ p_organization_id: string;
2091
+ };
2092
+ Returns: undefined;
2093
+ };
2094
+ auth_jwt_claims: {
2095
+ Args: never;
2096
+ Returns: Json;
2097
+ };
2098
+ auth_uid_safe: {
2099
+ Args: never;
2100
+ Returns: string;
2101
+ };
2102
+ current_user_is_platform_admin: {
2103
+ Args: never;
2104
+ Returns: boolean;
2105
+ };
2106
+ current_user_supabase_id: {
2107
+ Args: never;
2108
+ Returns: string;
2109
+ };
2110
+ detect_stalled_executions: {
2111
+ Args: never;
2112
+ Returns: undefined;
2113
+ };
2114
+ execute_session_turn: {
2115
+ Args: {
2116
+ p_session_id: string;
2117
+ };
2118
+ Returns: {
2119
+ created_at: string;
2120
+ ended_at: string;
2121
+ memory_snapshot: Json;
2122
+ metadata: Json;
2123
+ organization_id: string;
2124
+ resource_id: string;
2125
+ session_id: string;
2126
+ session_total_turns: number;
2127
+ updated_at: string;
2128
+ user_id: string;
2129
+ }[];
2130
+ };
2131
+ get_storage_org_id: {
2132
+ Args: {
2133
+ file_path: string;
2134
+ };
2135
+ Returns: string;
2136
+ };
2137
+ get_workos_user_id: {
2138
+ Args: never;
2139
+ Returns: string;
2140
+ };
2141
+ is_org_admin: {
2142
+ Args: {
2143
+ org_id: string;
2144
+ };
2145
+ Returns: boolean;
2146
+ };
2147
+ is_org_member: {
2148
+ Args: {
2149
+ org_id: string;
2150
+ };
2151
+ Returns: boolean;
2152
+ };
2153
+ link_workos_membership_on_accept: {
2154
+ Args: {
2155
+ p_email: string;
2156
+ p_organization_id: string;
2157
+ p_workos_membership_id: string;
2158
+ };
2159
+ Returns: boolean;
2160
+ };
2161
+ pre_provision_invited_user: {
2162
+ Args: {
2163
+ p_email: string;
2164
+ p_organization_id: string;
2165
+ p_role_slug?: string;
2166
+ };
2167
+ Returns: Json;
2168
+ };
2169
+ process_due_schedules: {
2170
+ Args: never;
2171
+ Returns: Json;
2172
+ };
2173
+ upsert_user_profile: {
2174
+ Args: never;
2175
+ Returns: {
2176
+ profile_display_name: string;
2177
+ profile_email: string;
2178
+ profile_id: string;
2179
+ profile_workos_user_id: string;
2180
+ }[];
2181
+ };
2182
+ };
2183
+ Enums: {
2184
+ [_ in never]: never;
2185
+ };
2186
+ CompositeTypes: {
2187
+ [_ in never]: never;
2188
+ };
2189
+ };
2190
+ };
2191
+ type DatabaseWithoutInternals = Omit<Database, "__InternalSupabase">;
2192
+ type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">];
2193
+ type Tables<DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) | {
2194
+ schema: keyof DatabaseWithoutInternals;
2195
+ }, TableName extends DefaultSchemaTableNameOrOptions extends {
2196
+ schema: keyof DatabaseWithoutInternals;
2197
+ } ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"]) : never = never> = DefaultSchemaTableNameOrOptions extends {
2198
+ schema: keyof DatabaseWithoutInternals;
2199
+ } ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends {
2200
+ Row: infer R;
2201
+ } ? R : never : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) ? (DefaultSchema["Tables"] & DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends {
2202
+ Row: infer R;
2203
+ } ? R : never : never;
2204
+
2205
+ type SupabaseUserProfile = Tables<'users'>;
2206
+
2207
+ interface UseUserProfileOptions {
2208
+ /**
2209
+ * Optional error handler for profile sync failures
2210
+ * If not provided, errors are logged to console
2211
+ */
2212
+ onError?: (context: {
2213
+ phase: 'profile-sync';
2214
+ userId?: string;
2215
+ }, error: Error) => void;
2216
+ }
2217
+ interface UseUserProfileReturn {
2218
+ profile: SupabaseUserProfile | null;
2219
+ loading: boolean;
2220
+ error: Error | null;
2221
+ refetch: () => Promise<void>;
2222
+ }
2223
+ /**
2224
+ * Hook for managing user profile data with automatic WorkOS -> Supabase sync
2225
+ *
2226
+ * This hook:
2227
+ * 1. Automatically syncs WorkOS user data to Supabase on authentication
2228
+ * 2. Provides access to the user's Supabase profile data
2229
+ * 3. Handles loading states and errors
2230
+ * 4. Includes a refetch function for manual updates
2231
+ *
2232
+ * @param options - Optional configuration including error handler
2233
+ */
2234
+ declare const useUserProfile: (options?: UseUserProfileOptions) => UseUserProfileReturn;
2235
+
2236
+ declare class UserProfileService {
2237
+ private apiRequest;
2238
+ constructor(apiRequest: <T>(endpoint: string, options?: RequestInit) => Promise<T>);
2239
+ /**
2240
+ * Sync WorkOS user data to Supabase users table
2241
+ * This creates or updates the user profile with latest WorkOS data
2242
+ */
2243
+ syncUserProfile(): Promise<SupabaseUserProfile | null>;
2244
+ /**
2245
+ * Get user profile from API
2246
+ * Server identifies user from JWT (no user ID needed)
2247
+ */
2248
+ getUserProfile(): Promise<SupabaseUserProfile | null>;
2249
+ /**
2250
+ * Update last visited organization for the user
2251
+ * @param organizationId - The Supabase organization ID
2252
+ */
2253
+ updateLastVisitedOrg(organizationId: string): Promise<void>;
2254
+ /**
2255
+ * Update user profile data
2256
+ */
2257
+ updateUserProfile(updates: Partial<{
2258
+ firstName: string;
2259
+ lastName: string;
2260
+ profilePictureUrl: string;
2261
+ }>): Promise<SupabaseUserProfile | null>;
2262
+ }
2263
+
2264
+ export { UserProfileService, useUserProfile };
2265
+ export type { UseUserProfileReturn };