@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,4289 @@
1
+ import { SupabaseClient } from '@supabase/supabase-js';
2
+
3
+ type Json = string | number | boolean | null | {
4
+ [key: string]: Json | undefined;
5
+ } | Json[];
6
+ type Database = {
7
+ __InternalSupabase: {
8
+ PostgrestVersion: "12.2.3 (519615d)";
9
+ };
10
+ public: {
11
+ Tables: {
12
+ acq_companies: {
13
+ Row: {
14
+ attio_company_id: string | null;
15
+ batch_id: string | null;
16
+ category: string | null;
17
+ category_pain: string | null;
18
+ created_at: string;
19
+ domain: string | null;
20
+ enrichment_data: Json | null;
21
+ filter_reason: string | null;
22
+ founded_year: number | null;
23
+ id: string;
24
+ linkedin_url: string | null;
25
+ location_city: string | null;
26
+ location_state: string | null;
27
+ name: string;
28
+ num_employees: number | null;
29
+ organization_id: string;
30
+ pipeline_status: Json;
31
+ segment: string | null;
32
+ source: string | null;
33
+ status: string;
34
+ updated_at: string;
35
+ website: string | null;
36
+ };
37
+ Insert: {
38
+ attio_company_id?: string | null;
39
+ batch_id?: string | null;
40
+ category?: string | null;
41
+ category_pain?: string | null;
42
+ created_at?: string;
43
+ domain?: string | null;
44
+ enrichment_data?: Json | null;
45
+ filter_reason?: string | null;
46
+ founded_year?: number | null;
47
+ id?: string;
48
+ linkedin_url?: string | null;
49
+ location_city?: string | null;
50
+ location_state?: string | null;
51
+ name: string;
52
+ num_employees?: number | null;
53
+ organization_id: string;
54
+ pipeline_status?: Json;
55
+ segment?: string | null;
56
+ source?: string | null;
57
+ status?: string;
58
+ updated_at?: string;
59
+ website?: string | null;
60
+ };
61
+ Update: {
62
+ attio_company_id?: string | null;
63
+ batch_id?: string | null;
64
+ category?: string | null;
65
+ category_pain?: string | null;
66
+ created_at?: string;
67
+ domain?: string | null;
68
+ enrichment_data?: Json | null;
69
+ filter_reason?: string | null;
70
+ founded_year?: number | null;
71
+ id?: string;
72
+ linkedin_url?: string | null;
73
+ location_city?: string | null;
74
+ location_state?: string | null;
75
+ name?: string;
76
+ num_employees?: number | null;
77
+ organization_id?: string;
78
+ pipeline_status?: Json;
79
+ segment?: string | null;
80
+ source?: string | null;
81
+ status?: string;
82
+ updated_at?: string;
83
+ website?: string | null;
84
+ };
85
+ Relationships: [
86
+ {
87
+ foreignKeyName: "acq_companies_organization_id_fkey";
88
+ columns: ["organization_id"];
89
+ isOneToOne: false;
90
+ referencedRelation: "organizations";
91
+ referencedColumns: ["id"];
92
+ }
93
+ ];
94
+ };
95
+ acq_contacts: {
96
+ Row: {
97
+ attio_person_id: string | null;
98
+ batch_id: string | null;
99
+ brochure_first_viewed_at: string | null;
100
+ brochure_view_count: number;
101
+ company_id: string | null;
102
+ created_at: string;
103
+ email: string;
104
+ email_valid: string | null;
105
+ enrichment_data: Json;
106
+ filter_reason: string | null;
107
+ first_name: string | null;
108
+ headline: string | null;
109
+ id: string;
110
+ last_name: string | null;
111
+ linkedin_url: string | null;
112
+ nurture: boolean;
113
+ opening_line: string | null;
114
+ organization_id: string;
115
+ pipeline_status: Json;
116
+ source: string | null;
117
+ source_id: string | null;
118
+ status: string;
119
+ title: string | null;
120
+ updated_at: string;
121
+ };
122
+ Insert: {
123
+ attio_person_id?: string | null;
124
+ batch_id?: string | null;
125
+ brochure_first_viewed_at?: string | null;
126
+ brochure_view_count?: number;
127
+ company_id?: string | null;
128
+ created_at?: string;
129
+ email: string;
130
+ email_valid?: string | null;
131
+ enrichment_data?: Json;
132
+ filter_reason?: string | null;
133
+ first_name?: string | null;
134
+ headline?: string | null;
135
+ id?: string;
136
+ last_name?: string | null;
137
+ linkedin_url?: string | null;
138
+ nurture?: boolean;
139
+ opening_line?: string | null;
140
+ organization_id: string;
141
+ pipeline_status?: Json;
142
+ source?: string | null;
143
+ source_id?: string | null;
144
+ status?: string;
145
+ title?: string | null;
146
+ updated_at?: string;
147
+ };
148
+ Update: {
149
+ attio_person_id?: string | null;
150
+ batch_id?: string | null;
151
+ brochure_first_viewed_at?: string | null;
152
+ brochure_view_count?: number;
153
+ company_id?: string | null;
154
+ created_at?: string;
155
+ email?: string;
156
+ email_valid?: string | null;
157
+ enrichment_data?: Json;
158
+ filter_reason?: string | null;
159
+ first_name?: string | null;
160
+ headline?: string | null;
161
+ id?: string;
162
+ last_name?: string | null;
163
+ linkedin_url?: string | null;
164
+ nurture?: boolean;
165
+ opening_line?: string | null;
166
+ organization_id?: string;
167
+ pipeline_status?: Json;
168
+ source?: string | null;
169
+ source_id?: string | null;
170
+ status?: string;
171
+ title?: string | null;
172
+ updated_at?: string;
173
+ };
174
+ Relationships: [
175
+ {
176
+ foreignKeyName: "acq_contacts_company_id_fkey";
177
+ columns: ["company_id"];
178
+ isOneToOne: false;
179
+ referencedRelation: "acq_companies";
180
+ referencedColumns: ["id"];
181
+ },
182
+ {
183
+ foreignKeyName: "acq_contacts_organization_id_fkey";
184
+ columns: ["organization_id"];
185
+ isOneToOne: false;
186
+ referencedRelation: "organizations";
187
+ referencedColumns: ["id"];
188
+ }
189
+ ];
190
+ };
191
+ acq_content: {
192
+ Row: {
193
+ body: string | null;
194
+ created_at: string;
195
+ id: string;
196
+ organization_id: string;
197
+ pillar: string;
198
+ status: string;
199
+ title: string;
200
+ updated_at: string;
201
+ };
202
+ Insert: {
203
+ body?: string | null;
204
+ created_at?: string;
205
+ id?: string;
206
+ organization_id: string;
207
+ pillar: string;
208
+ status?: string;
209
+ title: string;
210
+ updated_at?: string;
211
+ };
212
+ Update: {
213
+ body?: string | null;
214
+ created_at?: string;
215
+ id?: string;
216
+ organization_id?: string;
217
+ pillar?: string;
218
+ status?: string;
219
+ title?: string;
220
+ updated_at?: string;
221
+ };
222
+ Relationships: [
223
+ {
224
+ foreignKeyName: "acq_content_organization_id_fkey";
225
+ columns: ["organization_id"];
226
+ isOneToOne: false;
227
+ referencedRelation: "organizations";
228
+ referencedColumns: ["id"];
229
+ }
230
+ ];
231
+ };
232
+ acq_content_distributions: {
233
+ Row: {
234
+ adapted_body: string | null;
235
+ checklist: Json | null;
236
+ content_id: string;
237
+ created_at: string;
238
+ format: string;
239
+ id: string;
240
+ media_urls: Json;
241
+ metrics: Json;
242
+ metrics_updated_at: string | null;
243
+ organization_id: string;
244
+ platform: string;
245
+ platform_content: Json | null;
246
+ platform_post_id: string | null;
247
+ platform_url: string | null;
248
+ published_at: string | null;
249
+ status: string;
250
+ updated_at: string;
251
+ };
252
+ Insert: {
253
+ adapted_body?: string | null;
254
+ checklist?: Json | null;
255
+ content_id: string;
256
+ created_at?: string;
257
+ format: string;
258
+ id?: string;
259
+ media_urls?: Json;
260
+ metrics?: Json;
261
+ metrics_updated_at?: string | null;
262
+ organization_id: string;
263
+ platform: string;
264
+ platform_content?: Json | null;
265
+ platform_post_id?: string | null;
266
+ platform_url?: string | null;
267
+ published_at?: string | null;
268
+ status?: string;
269
+ updated_at?: string;
270
+ };
271
+ Update: {
272
+ adapted_body?: string | null;
273
+ checklist?: Json | null;
274
+ content_id?: string;
275
+ created_at?: string;
276
+ format?: string;
277
+ id?: string;
278
+ media_urls?: Json;
279
+ metrics?: Json;
280
+ metrics_updated_at?: string | null;
281
+ organization_id?: string;
282
+ platform?: string;
283
+ platform_content?: Json | null;
284
+ platform_post_id?: string | null;
285
+ platform_url?: string | null;
286
+ published_at?: string | null;
287
+ status?: string;
288
+ updated_at?: string;
289
+ };
290
+ Relationships: [
291
+ {
292
+ foreignKeyName: "acq_content_distributions_content_id_fkey";
293
+ columns: ["content_id"];
294
+ isOneToOne: false;
295
+ referencedRelation: "acq_content";
296
+ referencedColumns: ["id"];
297
+ },
298
+ {
299
+ foreignKeyName: "acq_content_distributions_organization_id_fkey";
300
+ columns: ["organization_id"];
301
+ isOneToOne: false;
302
+ referencedRelation: "organizations";
303
+ referencedColumns: ["id"];
304
+ }
305
+ ];
306
+ };
307
+ acq_deals: {
308
+ Row: {
309
+ activity_log: Json;
310
+ attio_deal_id: string;
311
+ cached_stage: string | null;
312
+ closed_lost_at: string | null;
313
+ closed_lost_reason: string | null;
314
+ contact_email: string;
315
+ contact_id: string | null;
316
+ created_at: string;
317
+ discovery_data: Json | null;
318
+ discovery_submitted_at: string | null;
319
+ discovery_submitted_by: string | null;
320
+ id: string;
321
+ initial_fee: number | null;
322
+ monthly_fee: number | null;
323
+ organization_id: string;
324
+ payment_link_sent_at: string | null;
325
+ payment_received_at: string | null;
326
+ proposal_data: Json | null;
327
+ proposal_generated_at: string | null;
328
+ proposal_pdf_url: string | null;
329
+ proposal_reviewed_at: string | null;
330
+ proposal_reviewed_by: string | null;
331
+ proposal_sent_at: string | null;
332
+ proposal_signed_at: string | null;
333
+ proposal_status: string | null;
334
+ signature_envelope_id: string | null;
335
+ source_list_id: string | null;
336
+ source_type: string | null;
337
+ stripe_payment_id: string | null;
338
+ stripe_payment_link: string | null;
339
+ stripe_payment_link_id: string | null;
340
+ stripe_subscription_id: string | null;
341
+ updated_at: string;
342
+ };
343
+ Insert: {
344
+ activity_log?: Json;
345
+ attio_deal_id: string;
346
+ cached_stage?: string | null;
347
+ closed_lost_at?: string | null;
348
+ closed_lost_reason?: string | null;
349
+ contact_email: string;
350
+ contact_id?: string | null;
351
+ created_at?: string;
352
+ discovery_data?: Json | null;
353
+ discovery_submitted_at?: string | null;
354
+ discovery_submitted_by?: string | null;
355
+ id?: string;
356
+ initial_fee?: number | null;
357
+ monthly_fee?: number | null;
358
+ organization_id: string;
359
+ payment_link_sent_at?: string | null;
360
+ payment_received_at?: string | null;
361
+ proposal_data?: Json | null;
362
+ proposal_generated_at?: string | null;
363
+ proposal_pdf_url?: string | null;
364
+ proposal_reviewed_at?: string | null;
365
+ proposal_reviewed_by?: string | null;
366
+ proposal_sent_at?: string | null;
367
+ proposal_signed_at?: string | null;
368
+ proposal_status?: string | null;
369
+ signature_envelope_id?: string | null;
370
+ source_list_id?: string | null;
371
+ source_type?: string | null;
372
+ stripe_payment_id?: string | null;
373
+ stripe_payment_link?: string | null;
374
+ stripe_payment_link_id?: string | null;
375
+ stripe_subscription_id?: string | null;
376
+ updated_at?: string;
377
+ };
378
+ Update: {
379
+ activity_log?: Json;
380
+ attio_deal_id?: string;
381
+ cached_stage?: string | null;
382
+ closed_lost_at?: string | null;
383
+ closed_lost_reason?: string | null;
384
+ contact_email?: string;
385
+ contact_id?: string | null;
386
+ created_at?: string;
387
+ discovery_data?: Json | null;
388
+ discovery_submitted_at?: string | null;
389
+ discovery_submitted_by?: string | null;
390
+ id?: string;
391
+ initial_fee?: number | null;
392
+ monthly_fee?: number | null;
393
+ organization_id?: string;
394
+ payment_link_sent_at?: string | null;
395
+ payment_received_at?: string | null;
396
+ proposal_data?: Json | null;
397
+ proposal_generated_at?: string | null;
398
+ proposal_pdf_url?: string | null;
399
+ proposal_reviewed_at?: string | null;
400
+ proposal_reviewed_by?: string | null;
401
+ proposal_sent_at?: string | null;
402
+ proposal_signed_at?: string | null;
403
+ proposal_status?: string | null;
404
+ signature_envelope_id?: string | null;
405
+ source_list_id?: string | null;
406
+ source_type?: string | null;
407
+ stripe_payment_id?: string | null;
408
+ stripe_payment_link?: string | null;
409
+ stripe_payment_link_id?: string | null;
410
+ stripe_subscription_id?: string | null;
411
+ updated_at?: string;
412
+ };
413
+ Relationships: [
414
+ {
415
+ foreignKeyName: "acq_deals_contact_id_fkey";
416
+ columns: ["contact_id"];
417
+ isOneToOne: false;
418
+ referencedRelation: "acq_contacts";
419
+ referencedColumns: ["id"];
420
+ },
421
+ {
422
+ foreignKeyName: "acq_deals_organization_id_fkey";
423
+ columns: ["organization_id"];
424
+ isOneToOne: false;
425
+ referencedRelation: "organizations";
426
+ referencedColumns: ["id"];
427
+ },
428
+ {
429
+ foreignKeyName: "acq_deals_source_list_id_fkey";
430
+ columns: ["source_list_id"];
431
+ isOneToOne: false;
432
+ referencedRelation: "acq_lists";
433
+ referencedColumns: ["id"];
434
+ }
435
+ ];
436
+ };
437
+ acq_list_members: {
438
+ Row: {
439
+ added_at: string;
440
+ added_by: string | null;
441
+ contact_id: string;
442
+ id: string;
443
+ list_id: string;
444
+ };
445
+ Insert: {
446
+ added_at?: string;
447
+ added_by?: string | null;
448
+ contact_id: string;
449
+ id?: string;
450
+ list_id: string;
451
+ };
452
+ Update: {
453
+ added_at?: string;
454
+ added_by?: string | null;
455
+ contact_id?: string;
456
+ id?: string;
457
+ list_id?: string;
458
+ };
459
+ Relationships: [
460
+ {
461
+ foreignKeyName: "acq_list_members_contact_id_fkey";
462
+ columns: ["contact_id"];
463
+ isOneToOne: false;
464
+ referencedRelation: "acq_contacts";
465
+ referencedColumns: ["id"];
466
+ },
467
+ {
468
+ foreignKeyName: "acq_list_members_list_id_fkey";
469
+ columns: ["list_id"];
470
+ isOneToOne: false;
471
+ referencedRelation: "acq_lists";
472
+ referencedColumns: ["id"];
473
+ }
474
+ ];
475
+ };
476
+ acq_lists: {
477
+ Row: {
478
+ batch_ids: string[];
479
+ completed_at: string | null;
480
+ created_at: string;
481
+ description: string | null;
482
+ id: string;
483
+ instantly_campaign_id: string | null;
484
+ launched_at: string | null;
485
+ metadata: Json;
486
+ name: string;
487
+ organization_id: string;
488
+ status: string;
489
+ type: string;
490
+ };
491
+ Insert: {
492
+ batch_ids?: string[];
493
+ completed_at?: string | null;
494
+ created_at?: string;
495
+ description?: string | null;
496
+ id?: string;
497
+ instantly_campaign_id?: string | null;
498
+ launched_at?: string | null;
499
+ metadata?: Json;
500
+ name: string;
501
+ organization_id: string;
502
+ status?: string;
503
+ type?: string;
504
+ };
505
+ Update: {
506
+ batch_ids?: string[];
507
+ completed_at?: string | null;
508
+ created_at?: string;
509
+ description?: string | null;
510
+ id?: string;
511
+ instantly_campaign_id?: string | null;
512
+ launched_at?: string | null;
513
+ metadata?: Json;
514
+ name?: string;
515
+ organization_id?: string;
516
+ status?: string;
517
+ type?: string;
518
+ };
519
+ Relationships: [
520
+ {
521
+ foreignKeyName: "acq_lists_organization_id_fkey";
522
+ columns: ["organization_id"];
523
+ isOneToOne: false;
524
+ referencedRelation: "organizations";
525
+ referencedColumns: ["id"];
526
+ }
527
+ ];
528
+ };
529
+ acq_seo_metrics: {
530
+ Row: {
531
+ ai_citations: Json | null;
532
+ avg_position: number | null;
533
+ clicks: number | null;
534
+ created_at: string;
535
+ cta_clicks: number | null;
536
+ ctr: number | null;
537
+ data_point_count: number | null;
538
+ faq_count: number | null;
539
+ form_submissions: number | null;
540
+ id: string;
541
+ impressions: number | null;
542
+ organization_id: string;
543
+ period: string;
544
+ quality_score: number | null;
545
+ readability: number | null;
546
+ scroll_100: number | null;
547
+ scroll_25: number | null;
548
+ scroll_50: number | null;
549
+ scroll_75: number | null;
550
+ seo_page_id: string;
551
+ word_count: number | null;
552
+ };
553
+ Insert: {
554
+ ai_citations?: Json | null;
555
+ avg_position?: number | null;
556
+ clicks?: number | null;
557
+ created_at?: string;
558
+ cta_clicks?: number | null;
559
+ ctr?: number | null;
560
+ data_point_count?: number | null;
561
+ faq_count?: number | null;
562
+ form_submissions?: number | null;
563
+ id?: string;
564
+ impressions?: number | null;
565
+ organization_id: string;
566
+ period: string;
567
+ quality_score?: number | null;
568
+ readability?: number | null;
569
+ scroll_100?: number | null;
570
+ scroll_25?: number | null;
571
+ scroll_50?: number | null;
572
+ scroll_75?: number | null;
573
+ seo_page_id: string;
574
+ word_count?: number | null;
575
+ };
576
+ Update: {
577
+ ai_citations?: Json | null;
578
+ avg_position?: number | null;
579
+ clicks?: number | null;
580
+ created_at?: string;
581
+ cta_clicks?: number | null;
582
+ ctr?: number | null;
583
+ data_point_count?: number | null;
584
+ faq_count?: number | null;
585
+ form_submissions?: number | null;
586
+ id?: string;
587
+ impressions?: number | null;
588
+ organization_id?: string;
589
+ period?: string;
590
+ quality_score?: number | null;
591
+ readability?: number | null;
592
+ scroll_100?: number | null;
593
+ scroll_25?: number | null;
594
+ scroll_50?: number | null;
595
+ scroll_75?: number | null;
596
+ seo_page_id?: string;
597
+ word_count?: number | null;
598
+ };
599
+ Relationships: [
600
+ {
601
+ foreignKeyName: "acq_seo_metrics_organization_id_fkey";
602
+ columns: ["organization_id"];
603
+ isOneToOne: false;
604
+ referencedRelation: "organizations";
605
+ referencedColumns: ["id"];
606
+ },
607
+ {
608
+ foreignKeyName: "acq_seo_metrics_seo_page_id_fkey";
609
+ columns: ["seo_page_id"];
610
+ isOneToOne: false;
611
+ referencedRelation: "acq_seo_pages";
612
+ referencedColumns: ["id"];
613
+ }
614
+ ];
615
+ };
616
+ acq_seo_pages: {
617
+ Row: {
618
+ city: string | null;
619
+ content: Json | null;
620
+ created_at: string;
621
+ faq_items: Json | null;
622
+ hero_image_url: string | null;
623
+ id: string;
624
+ internal_links: Json | null;
625
+ local_data: Json | null;
626
+ meta_description: string | null;
627
+ organization_id: string;
628
+ page_type: string;
629
+ published_at: string | null;
630
+ refreshed_at: string | null;
631
+ schema_markup: Json | null;
632
+ slug: string;
633
+ state: string | null;
634
+ status: string;
635
+ title: string;
636
+ updated_at: string;
637
+ use_case: string | null;
638
+ vertical: string;
639
+ };
640
+ Insert: {
641
+ city?: string | null;
642
+ content?: Json | null;
643
+ created_at?: string;
644
+ faq_items?: Json | null;
645
+ hero_image_url?: string | null;
646
+ id?: string;
647
+ internal_links?: Json | null;
648
+ local_data?: Json | null;
649
+ meta_description?: string | null;
650
+ organization_id: string;
651
+ page_type: string;
652
+ published_at?: string | null;
653
+ refreshed_at?: string | null;
654
+ schema_markup?: Json | null;
655
+ slug: string;
656
+ state?: string | null;
657
+ status?: string;
658
+ title: string;
659
+ updated_at?: string;
660
+ use_case?: string | null;
661
+ vertical: string;
662
+ };
663
+ Update: {
664
+ city?: string | null;
665
+ content?: Json | null;
666
+ created_at?: string;
667
+ faq_items?: Json | null;
668
+ hero_image_url?: string | null;
669
+ id?: string;
670
+ internal_links?: Json | null;
671
+ local_data?: Json | null;
672
+ meta_description?: string | null;
673
+ organization_id?: string;
674
+ page_type?: string;
675
+ published_at?: string | null;
676
+ refreshed_at?: string | null;
677
+ schema_markup?: Json | null;
678
+ slug?: string;
679
+ state?: string | null;
680
+ status?: string;
681
+ title?: string;
682
+ updated_at?: string;
683
+ use_case?: string | null;
684
+ vertical?: string;
685
+ };
686
+ Relationships: [
687
+ {
688
+ foreignKeyName: "acq_seo_pages_organization_id_fkey";
689
+ columns: ["organization_id"];
690
+ isOneToOne: false;
691
+ referencedRelation: "organizations";
692
+ referencedColumns: ["id"];
693
+ }
694
+ ];
695
+ };
696
+ acq_social_posts: {
697
+ Row: {
698
+ author_name: string;
699
+ author_url: string | null;
700
+ comments_count: number;
701
+ created_at: string;
702
+ discovered_at: string;
703
+ engagement_count: number;
704
+ feedback: string | null;
705
+ final_response: string | null;
706
+ fully_reviewed: boolean;
707
+ id: string;
708
+ initial_draft: string | null;
709
+ matched_keywords: string[];
710
+ matched_query: string | null;
711
+ metadata: Json;
712
+ organization_id: string;
713
+ platform: string;
714
+ platform_post_id: string;
715
+ post_text: string;
716
+ post_title: string;
717
+ post_url: string;
718
+ posted_at: string;
719
+ relevance_score: number;
720
+ responded_at: string | null;
721
+ reviewed_at: string | null;
722
+ skip_reason: string | null;
723
+ source_category: string | null;
724
+ status: string;
725
+ updated_at: string;
726
+ };
727
+ Insert: {
728
+ author_name: string;
729
+ author_url?: string | null;
730
+ comments_count?: number;
731
+ created_at?: string;
732
+ discovered_at?: string;
733
+ engagement_count?: number;
734
+ feedback?: string | null;
735
+ final_response?: string | null;
736
+ fully_reviewed?: boolean;
737
+ id?: string;
738
+ initial_draft?: string | null;
739
+ matched_keywords?: string[];
740
+ matched_query?: string | null;
741
+ metadata?: Json;
742
+ organization_id: string;
743
+ platform: string;
744
+ platform_post_id: string;
745
+ post_text: string;
746
+ post_title: string;
747
+ post_url: string;
748
+ posted_at: string;
749
+ relevance_score?: number;
750
+ responded_at?: string | null;
751
+ reviewed_at?: string | null;
752
+ skip_reason?: string | null;
753
+ source_category?: string | null;
754
+ status?: string;
755
+ updated_at?: string;
756
+ };
757
+ Update: {
758
+ author_name?: string;
759
+ author_url?: string | null;
760
+ comments_count?: number;
761
+ created_at?: string;
762
+ discovered_at?: string;
763
+ engagement_count?: number;
764
+ feedback?: string | null;
765
+ final_response?: string | null;
766
+ fully_reviewed?: boolean;
767
+ id?: string;
768
+ initial_draft?: string | null;
769
+ matched_keywords?: string[];
770
+ matched_query?: string | null;
771
+ metadata?: Json;
772
+ organization_id?: string;
773
+ platform?: string;
774
+ platform_post_id?: string;
775
+ post_text?: string;
776
+ post_title?: string;
777
+ post_url?: string;
778
+ posted_at?: string;
779
+ relevance_score?: number;
780
+ responded_at?: string | null;
781
+ reviewed_at?: string | null;
782
+ skip_reason?: string | null;
783
+ source_category?: string | null;
784
+ status?: string;
785
+ updated_at?: string;
786
+ };
787
+ Relationships: [
788
+ {
789
+ foreignKeyName: "acq_social_posts_organization_id_fkey";
790
+ columns: ["organization_id"];
791
+ isOneToOne: false;
792
+ referencedRelation: "organizations";
793
+ referencedColumns: ["id"];
794
+ }
795
+ ];
796
+ };
797
+ activities: {
798
+ Row: {
799
+ activity_type: string;
800
+ actor_id: string | null;
801
+ actor_type: string | null;
802
+ created_at: string;
803
+ description: string | null;
804
+ entity_id: string;
805
+ entity_name: string | null;
806
+ entity_type: string;
807
+ id: string;
808
+ metadata: Json | null;
809
+ occurred_at: string;
810
+ organization_id: string;
811
+ status: string;
812
+ title: string;
813
+ };
814
+ Insert: {
815
+ activity_type: string;
816
+ actor_id?: string | null;
817
+ actor_type?: string | null;
818
+ created_at?: string;
819
+ description?: string | null;
820
+ entity_id: string;
821
+ entity_name?: string | null;
822
+ entity_type: string;
823
+ id?: string;
824
+ metadata?: Json | null;
825
+ occurred_at?: string;
826
+ organization_id: string;
827
+ status: string;
828
+ title: string;
829
+ };
830
+ Update: {
831
+ activity_type?: string;
832
+ actor_id?: string | null;
833
+ actor_type?: string | null;
834
+ created_at?: string;
835
+ description?: string | null;
836
+ entity_id?: string;
837
+ entity_name?: string | null;
838
+ entity_type?: string;
839
+ id?: string;
840
+ metadata?: Json | null;
841
+ occurred_at?: string;
842
+ organization_id?: string;
843
+ status?: string;
844
+ title?: string;
845
+ };
846
+ Relationships: [
847
+ {
848
+ foreignKeyName: "activities_organization_id_fkey";
849
+ columns: ["organization_id"];
850
+ isOneToOne: false;
851
+ referencedRelation: "organizations";
852
+ referencedColumns: ["id"];
853
+ }
854
+ ];
855
+ };
856
+ api_keys: {
857
+ Row: {
858
+ created_at: string | null;
859
+ id: string;
860
+ key_hash: string;
861
+ last_used_at: string | null;
862
+ name: string;
863
+ organization_id: string;
864
+ };
865
+ Insert: {
866
+ created_at?: string | null;
867
+ id?: string;
868
+ key_hash: string;
869
+ last_used_at?: string | null;
870
+ name: string;
871
+ organization_id: string;
872
+ };
873
+ Update: {
874
+ created_at?: string | null;
875
+ id?: string;
876
+ key_hash?: string;
877
+ last_used_at?: string | null;
878
+ name?: string;
879
+ organization_id?: string;
880
+ };
881
+ Relationships: [
882
+ {
883
+ foreignKeyName: "api_keys_organization_id_fkey";
884
+ columns: ["organization_id"];
885
+ isOneToOne: false;
886
+ referencedRelation: "organizations";
887
+ referencedColumns: ["id"];
888
+ }
889
+ ];
890
+ };
891
+ calibration_projects: {
892
+ Row: {
893
+ created_at: string | null;
894
+ description: string | null;
895
+ id: string;
896
+ name: string;
897
+ organization_id: string;
898
+ resource_id: string;
899
+ resource_type: string;
900
+ updated_at: string | null;
901
+ };
902
+ Insert: {
903
+ created_at?: string | null;
904
+ description?: string | null;
905
+ id?: string;
906
+ name: string;
907
+ organization_id: string;
908
+ resource_id: string;
909
+ resource_type: string;
910
+ updated_at?: string | null;
911
+ };
912
+ Update: {
913
+ created_at?: string | null;
914
+ description?: string | null;
915
+ id?: string;
916
+ name?: string;
917
+ organization_id?: string;
918
+ resource_id?: string;
919
+ resource_type?: string;
920
+ updated_at?: string | null;
921
+ };
922
+ Relationships: [
923
+ {
924
+ foreignKeyName: "calibration_projects_organization_id_fkey";
925
+ columns: ["organization_id"];
926
+ isOneToOne: false;
927
+ referencedRelation: "organizations";
928
+ referencedColumns: ["id"];
929
+ }
930
+ ];
931
+ };
932
+ calibration_runs: {
933
+ Row: {
934
+ completed_at: string | null;
935
+ config_variants: Json;
936
+ created_at: string | null;
937
+ description: string | null;
938
+ execution_mode: string;
939
+ grader_model: string | null;
940
+ grading_rubric: Json | null;
941
+ id: string;
942
+ name: string;
943
+ organization_id: string;
944
+ project_id: string;
945
+ results: Json;
946
+ status: string;
947
+ test_inputs: Json;
948
+ };
949
+ Insert: {
950
+ completed_at?: string | null;
951
+ config_variants: Json;
952
+ created_at?: string | null;
953
+ description?: string | null;
954
+ execution_mode?: string;
955
+ grader_model?: string | null;
956
+ grading_rubric?: Json | null;
957
+ id?: string;
958
+ name: string;
959
+ organization_id: string;
960
+ project_id: string;
961
+ results?: Json;
962
+ status?: string;
963
+ test_inputs: Json;
964
+ };
965
+ Update: {
966
+ completed_at?: string | null;
967
+ config_variants?: Json;
968
+ created_at?: string | null;
969
+ description?: string | null;
970
+ execution_mode?: string;
971
+ grader_model?: string | null;
972
+ grading_rubric?: Json | null;
973
+ id?: string;
974
+ name?: string;
975
+ organization_id?: string;
976
+ project_id?: string;
977
+ results?: Json;
978
+ status?: string;
979
+ test_inputs?: Json;
980
+ };
981
+ Relationships: [
982
+ {
983
+ foreignKeyName: "calibration_runs_organization_id_fkey";
984
+ columns: ["organization_id"];
985
+ isOneToOne: false;
986
+ referencedRelation: "organizations";
987
+ referencedColumns: ["id"];
988
+ },
989
+ {
990
+ foreignKeyName: "calibration_runs_project_id_fkey";
991
+ columns: ["project_id"];
992
+ isOneToOne: false;
993
+ referencedRelation: "calibration_projects";
994
+ referencedColumns: ["id"];
995
+ }
996
+ ];
997
+ };
998
+ command_queue: {
999
+ Row: {
1000
+ action_payload: Json | null;
1001
+ actions: Json;
1002
+ completed_at: string | null;
1003
+ completed_by: string | null;
1004
+ context: Json;
1005
+ created_at: string;
1006
+ description: string | null;
1007
+ expires_at: string | null;
1008
+ human_checkpoint: string | null;
1009
+ id: string;
1010
+ idempotency_key: string | null;
1011
+ metadata: Json | null;
1012
+ organization_id: string;
1013
+ origin_execution_id: string;
1014
+ origin_resource_id: string;
1015
+ origin_resource_type: string;
1016
+ priority: number;
1017
+ selected_action: string | null;
1018
+ status: string;
1019
+ target_execution_id: string | null;
1020
+ target_resource_id: string | null;
1021
+ target_resource_type: string | null;
1022
+ };
1023
+ Insert: {
1024
+ action_payload?: Json | null;
1025
+ actions: Json;
1026
+ completed_at?: string | null;
1027
+ completed_by?: string | null;
1028
+ context: Json;
1029
+ created_at?: string;
1030
+ description?: string | null;
1031
+ expires_at?: string | null;
1032
+ human_checkpoint?: string | null;
1033
+ id?: string;
1034
+ idempotency_key?: string | null;
1035
+ metadata?: Json | null;
1036
+ organization_id: string;
1037
+ origin_execution_id: string;
1038
+ origin_resource_id: string;
1039
+ origin_resource_type: string;
1040
+ priority?: number;
1041
+ selected_action?: string | null;
1042
+ status?: string;
1043
+ target_execution_id?: string | null;
1044
+ target_resource_id?: string | null;
1045
+ target_resource_type?: string | null;
1046
+ };
1047
+ Update: {
1048
+ action_payload?: Json | null;
1049
+ actions?: Json;
1050
+ completed_at?: string | null;
1051
+ completed_by?: string | null;
1052
+ context?: Json;
1053
+ created_at?: string;
1054
+ description?: string | null;
1055
+ expires_at?: string | null;
1056
+ human_checkpoint?: string | null;
1057
+ id?: string;
1058
+ idempotency_key?: string | null;
1059
+ metadata?: Json | null;
1060
+ organization_id?: string;
1061
+ origin_execution_id?: string;
1062
+ origin_resource_id?: string;
1063
+ origin_resource_type?: string;
1064
+ priority?: number;
1065
+ selected_action?: string | null;
1066
+ status?: string;
1067
+ target_execution_id?: string | null;
1068
+ target_resource_id?: string | null;
1069
+ target_resource_type?: string | null;
1070
+ };
1071
+ Relationships: [
1072
+ {
1073
+ foreignKeyName: "command_queue_completed_by_fkey";
1074
+ columns: ["completed_by"];
1075
+ isOneToOne: false;
1076
+ referencedRelation: "users";
1077
+ referencedColumns: ["id"];
1078
+ },
1079
+ {
1080
+ foreignKeyName: "command_queue_organization_id_fkey";
1081
+ columns: ["organization_id"];
1082
+ isOneToOne: false;
1083
+ referencedRelation: "organizations";
1084
+ referencedColumns: ["id"];
1085
+ },
1086
+ {
1087
+ foreignKeyName: "command_queue_target_execution_id_fkey";
1088
+ columns: ["target_execution_id"];
1089
+ isOneToOne: false;
1090
+ referencedRelation: "execution_logs";
1091
+ referencedColumns: ["execution_id"];
1092
+ }
1093
+ ];
1094
+ };
1095
+ credentials: {
1096
+ Row: {
1097
+ created_at: string;
1098
+ created_by: string | null;
1099
+ encrypted_value: string;
1100
+ id: string;
1101
+ name: string;
1102
+ organization_id: string;
1103
+ provider: string | null;
1104
+ type: string;
1105
+ updated_at: string;
1106
+ };
1107
+ Insert: {
1108
+ created_at?: string;
1109
+ created_by?: string | null;
1110
+ encrypted_value: string;
1111
+ id?: string;
1112
+ name: string;
1113
+ organization_id: string;
1114
+ provider?: string | null;
1115
+ type?: string;
1116
+ updated_at?: string;
1117
+ };
1118
+ Update: {
1119
+ created_at?: string;
1120
+ created_by?: string | null;
1121
+ encrypted_value?: string;
1122
+ id?: string;
1123
+ name?: string;
1124
+ organization_id?: string;
1125
+ provider?: string | null;
1126
+ type?: string;
1127
+ updated_at?: string;
1128
+ };
1129
+ Relationships: [
1130
+ {
1131
+ foreignKeyName: "credentials_created_by_fkey";
1132
+ columns: ["created_by"];
1133
+ isOneToOne: false;
1134
+ referencedRelation: "users";
1135
+ referencedColumns: ["id"];
1136
+ },
1137
+ {
1138
+ foreignKeyName: "credentials_organization_id_fkey";
1139
+ columns: ["organization_id"];
1140
+ isOneToOne: false;
1141
+ referencedRelation: "organizations";
1142
+ referencedColumns: ["id"];
1143
+ }
1144
+ ];
1145
+ };
1146
+ deployments: {
1147
+ Row: {
1148
+ compiled_docs: Json | null;
1149
+ created_at: string;
1150
+ deployment_version: string | null;
1151
+ documentation: Json | null;
1152
+ error_message: string | null;
1153
+ id: string;
1154
+ organization_id: string;
1155
+ pid: number | null;
1156
+ port: number | null;
1157
+ sdk_version: string;
1158
+ status: string;
1159
+ tarball_path: string | null;
1160
+ updated_at: string;
1161
+ };
1162
+ Insert: {
1163
+ compiled_docs?: Json | null;
1164
+ created_at?: string;
1165
+ deployment_version?: string | null;
1166
+ documentation?: Json | null;
1167
+ error_message?: string | null;
1168
+ id?: string;
1169
+ organization_id: string;
1170
+ pid?: number | null;
1171
+ port?: number | null;
1172
+ sdk_version: string;
1173
+ status?: string;
1174
+ tarball_path?: string | null;
1175
+ updated_at?: string;
1176
+ };
1177
+ Update: {
1178
+ compiled_docs?: Json | null;
1179
+ created_at?: string;
1180
+ deployment_version?: string | null;
1181
+ documentation?: Json | null;
1182
+ error_message?: string | null;
1183
+ id?: string;
1184
+ organization_id?: string;
1185
+ pid?: number | null;
1186
+ port?: number | null;
1187
+ sdk_version?: string;
1188
+ status?: string;
1189
+ tarball_path?: string | null;
1190
+ updated_at?: string;
1191
+ };
1192
+ Relationships: [
1193
+ {
1194
+ foreignKeyName: "deployments_organization_id_fkey";
1195
+ columns: ["organization_id"];
1196
+ isOneToOne: false;
1197
+ referencedRelation: "organizations";
1198
+ referencedColumns: ["id"];
1199
+ }
1200
+ ];
1201
+ };
1202
+ execution_errors: {
1203
+ Row: {
1204
+ created_at: string | null;
1205
+ error_category: string;
1206
+ error_message: string;
1207
+ error_severity: string;
1208
+ error_stack_trace: string | null;
1209
+ error_type: string;
1210
+ execution_id: string;
1211
+ id: string;
1212
+ metadata: Json | null;
1213
+ occurred_at: string;
1214
+ organization_id: string;
1215
+ resolved: boolean;
1216
+ resolved_at: string | null;
1217
+ resolved_by: string | null;
1218
+ };
1219
+ Insert: {
1220
+ created_at?: string | null;
1221
+ error_category: string;
1222
+ error_message: string;
1223
+ error_severity: string;
1224
+ error_stack_trace?: string | null;
1225
+ error_type: string;
1226
+ execution_id: string;
1227
+ id?: string;
1228
+ metadata?: Json | null;
1229
+ occurred_at?: string;
1230
+ organization_id: string;
1231
+ resolved?: boolean;
1232
+ resolved_at?: string | null;
1233
+ resolved_by?: string | null;
1234
+ };
1235
+ Update: {
1236
+ created_at?: string | null;
1237
+ error_category?: string;
1238
+ error_message?: string;
1239
+ error_severity?: string;
1240
+ error_stack_trace?: string | null;
1241
+ error_type?: string;
1242
+ execution_id?: string;
1243
+ id?: string;
1244
+ metadata?: Json | null;
1245
+ occurred_at?: string;
1246
+ organization_id?: string;
1247
+ resolved?: boolean;
1248
+ resolved_at?: string | null;
1249
+ resolved_by?: string | null;
1250
+ };
1251
+ Relationships: [
1252
+ {
1253
+ foreignKeyName: "execution_errors_execution_id_fkey";
1254
+ columns: ["execution_id"];
1255
+ isOneToOne: false;
1256
+ referencedRelation: "execution_logs";
1257
+ referencedColumns: ["execution_id"];
1258
+ },
1259
+ {
1260
+ foreignKeyName: "execution_errors_organization_id_fkey";
1261
+ columns: ["organization_id"];
1262
+ isOneToOne: false;
1263
+ referencedRelation: "organizations";
1264
+ referencedColumns: ["id"];
1265
+ },
1266
+ {
1267
+ foreignKeyName: "execution_errors_resolved_by_fkey";
1268
+ columns: ["resolved_by"];
1269
+ isOneToOne: false;
1270
+ referencedRelation: "users";
1271
+ referencedColumns: ["id"];
1272
+ }
1273
+ ];
1274
+ };
1275
+ execution_logs: {
1276
+ Row: {
1277
+ api_version: string | null;
1278
+ completed_at: string | null;
1279
+ created_at: string | null;
1280
+ error: string | null;
1281
+ execution_id: string;
1282
+ input: Json | null;
1283
+ last_heartbeat_at: string | null;
1284
+ logs: Json | null;
1285
+ organization_id: string;
1286
+ origin_execution_id: string | null;
1287
+ output: Json | null;
1288
+ resource_id: string;
1289
+ resource_status: string;
1290
+ resource_type: string;
1291
+ resource_version: string | null;
1292
+ sdk_version: string | null;
1293
+ session_id: string | null;
1294
+ session_turn_number: number | null;
1295
+ started_at: string;
1296
+ status: string;
1297
+ trigger_type: string | null;
1298
+ updated_at: string | null;
1299
+ user_id: string | null;
1300
+ };
1301
+ Insert: {
1302
+ api_version?: string | null;
1303
+ completed_at?: string | null;
1304
+ created_at?: string | null;
1305
+ error?: string | null;
1306
+ execution_id?: string;
1307
+ input?: Json | null;
1308
+ last_heartbeat_at?: string | null;
1309
+ logs?: Json | null;
1310
+ organization_id: string;
1311
+ origin_execution_id?: string | null;
1312
+ output?: Json | null;
1313
+ resource_id: string;
1314
+ resource_status?: string;
1315
+ resource_type?: string;
1316
+ resource_version?: string | null;
1317
+ sdk_version?: string | null;
1318
+ session_id?: string | null;
1319
+ session_turn_number?: number | null;
1320
+ started_at?: string;
1321
+ status: string;
1322
+ trigger_type?: string | null;
1323
+ updated_at?: string | null;
1324
+ user_id?: string | null;
1325
+ };
1326
+ Update: {
1327
+ api_version?: string | null;
1328
+ completed_at?: string | null;
1329
+ created_at?: string | null;
1330
+ error?: string | null;
1331
+ execution_id?: string;
1332
+ input?: Json | null;
1333
+ last_heartbeat_at?: string | null;
1334
+ logs?: Json | null;
1335
+ organization_id?: string;
1336
+ origin_execution_id?: string | null;
1337
+ output?: Json | null;
1338
+ resource_id?: string;
1339
+ resource_status?: string;
1340
+ resource_type?: string;
1341
+ resource_version?: string | null;
1342
+ sdk_version?: string | null;
1343
+ session_id?: string | null;
1344
+ session_turn_number?: number | null;
1345
+ started_at?: string;
1346
+ status?: string;
1347
+ trigger_type?: string | null;
1348
+ updated_at?: string | null;
1349
+ user_id?: string | null;
1350
+ };
1351
+ Relationships: [
1352
+ {
1353
+ foreignKeyName: "execution_history_organization_id_fkey";
1354
+ columns: ["organization_id"];
1355
+ isOneToOne: false;
1356
+ referencedRelation: "organizations";
1357
+ referencedColumns: ["id"];
1358
+ },
1359
+ {
1360
+ foreignKeyName: "execution_logs_origin_execution_id_fkey";
1361
+ columns: ["origin_execution_id"];
1362
+ isOneToOne: false;
1363
+ referencedRelation: "execution_logs";
1364
+ referencedColumns: ["execution_id"];
1365
+ },
1366
+ {
1367
+ foreignKeyName: "execution_logs_session_id_fkey";
1368
+ columns: ["session_id"];
1369
+ isOneToOne: false;
1370
+ referencedRelation: "sessions";
1371
+ referencedColumns: ["session_id"];
1372
+ },
1373
+ {
1374
+ foreignKeyName: "execution_logs_user_id_fkey";
1375
+ columns: ["user_id"];
1376
+ isOneToOne: false;
1377
+ referencedRelation: "users";
1378
+ referencedColumns: ["id"];
1379
+ }
1380
+ ];
1381
+ };
1382
+ execution_metrics: {
1383
+ Row: {
1384
+ ai_call_count: number;
1385
+ ai_calls: Json | null;
1386
+ automation_savings_usd: number | null;
1387
+ created_at: string | null;
1388
+ duration_ms: number | null;
1389
+ execution_id: string;
1390
+ organization_id: string;
1391
+ resource_id: string;
1392
+ total_cost_usd: number;
1393
+ total_input_tokens: number;
1394
+ total_output_tokens: number;
1395
+ };
1396
+ Insert: {
1397
+ ai_call_count: number;
1398
+ ai_calls?: Json | null;
1399
+ automation_savings_usd?: number | null;
1400
+ created_at?: string | null;
1401
+ duration_ms?: number | null;
1402
+ execution_id: string;
1403
+ organization_id: string;
1404
+ resource_id: string;
1405
+ total_cost_usd: number;
1406
+ total_input_tokens: number;
1407
+ total_output_tokens: number;
1408
+ };
1409
+ Update: {
1410
+ ai_call_count?: number;
1411
+ ai_calls?: Json | null;
1412
+ automation_savings_usd?: number | null;
1413
+ created_at?: string | null;
1414
+ duration_ms?: number | null;
1415
+ execution_id?: string;
1416
+ organization_id?: string;
1417
+ resource_id?: string;
1418
+ total_cost_usd?: number;
1419
+ total_input_tokens?: number;
1420
+ total_output_tokens?: number;
1421
+ };
1422
+ Relationships: [
1423
+ {
1424
+ foreignKeyName: "execution_metrics_execution_id_fkey";
1425
+ columns: ["execution_id"];
1426
+ isOneToOne: true;
1427
+ referencedRelation: "execution_logs";
1428
+ referencedColumns: ["execution_id"];
1429
+ },
1430
+ {
1431
+ foreignKeyName: "execution_metrics_organization_id_fkey";
1432
+ columns: ["organization_id"];
1433
+ isOneToOne: false;
1434
+ referencedRelation: "organizations";
1435
+ referencedColumns: ["id"];
1436
+ }
1437
+ ];
1438
+ };
1439
+ notifications: {
1440
+ Row: {
1441
+ action_url: string | null;
1442
+ category: string;
1443
+ created_at: string | null;
1444
+ id: string;
1445
+ message: string;
1446
+ organization_id: string;
1447
+ read: boolean | null;
1448
+ read_at: string | null;
1449
+ title: string;
1450
+ user_id: string;
1451
+ };
1452
+ Insert: {
1453
+ action_url?: string | null;
1454
+ category: string;
1455
+ created_at?: string | null;
1456
+ id?: string;
1457
+ message: string;
1458
+ organization_id: string;
1459
+ read?: boolean | null;
1460
+ read_at?: string | null;
1461
+ title: string;
1462
+ user_id: string;
1463
+ };
1464
+ Update: {
1465
+ action_url?: string | null;
1466
+ category?: string;
1467
+ created_at?: string | null;
1468
+ id?: string;
1469
+ message?: string;
1470
+ organization_id?: string;
1471
+ read?: boolean | null;
1472
+ read_at?: string | null;
1473
+ title?: string;
1474
+ user_id?: string;
1475
+ };
1476
+ Relationships: [
1477
+ {
1478
+ foreignKeyName: "notifications_organization_id_fkey";
1479
+ columns: ["organization_id"];
1480
+ isOneToOne: false;
1481
+ referencedRelation: "organizations";
1482
+ referencedColumns: ["id"];
1483
+ },
1484
+ {
1485
+ foreignKeyName: "notifications_user_id_fkey";
1486
+ columns: ["user_id"];
1487
+ isOneToOne: false;
1488
+ referencedRelation: "users";
1489
+ referencedColumns: ["id"];
1490
+ }
1491
+ ];
1492
+ };
1493
+ org_invitations: {
1494
+ Row: {
1495
+ accept_invitation_url: string | null;
1496
+ accepted_at: string | null;
1497
+ created_at: string | null;
1498
+ email: string;
1499
+ expires_at: string;
1500
+ id: string;
1501
+ invitation_state: string | null;
1502
+ invitation_token: string | null;
1503
+ inviter_user_id: string | null;
1504
+ organization_id: string | null;
1505
+ revoked_at: string | null;
1506
+ role_slug: string | null;
1507
+ updated_at: string | null;
1508
+ workos_invitation_id: string;
1509
+ };
1510
+ Insert: {
1511
+ accept_invitation_url?: string | null;
1512
+ accepted_at?: string | null;
1513
+ created_at?: string | null;
1514
+ email: string;
1515
+ expires_at: string;
1516
+ id?: string;
1517
+ invitation_state?: string | null;
1518
+ invitation_token?: string | null;
1519
+ inviter_user_id?: string | null;
1520
+ organization_id?: string | null;
1521
+ revoked_at?: string | null;
1522
+ role_slug?: string | null;
1523
+ updated_at?: string | null;
1524
+ workos_invitation_id: string;
1525
+ };
1526
+ Update: {
1527
+ accept_invitation_url?: string | null;
1528
+ accepted_at?: string | null;
1529
+ created_at?: string | null;
1530
+ email?: string;
1531
+ expires_at?: string;
1532
+ id?: string;
1533
+ invitation_state?: string | null;
1534
+ invitation_token?: string | null;
1535
+ inviter_user_id?: string | null;
1536
+ organization_id?: string | null;
1537
+ revoked_at?: string | null;
1538
+ role_slug?: string | null;
1539
+ updated_at?: string | null;
1540
+ workos_invitation_id?: string;
1541
+ };
1542
+ Relationships: [
1543
+ {
1544
+ foreignKeyName: "org_invitations_inviter_user_id_fkey";
1545
+ columns: ["inviter_user_id"];
1546
+ isOneToOne: false;
1547
+ referencedRelation: "users";
1548
+ referencedColumns: ["id"];
1549
+ },
1550
+ {
1551
+ foreignKeyName: "org_invitations_organization_id_fkey";
1552
+ columns: ["organization_id"];
1553
+ isOneToOne: false;
1554
+ referencedRelation: "organizations";
1555
+ referencedColumns: ["id"];
1556
+ }
1557
+ ];
1558
+ };
1559
+ org_memberships: {
1560
+ Row: {
1561
+ config: Json;
1562
+ created_at: string | null;
1563
+ id: string;
1564
+ membership_status: string | null;
1565
+ organization_id: string;
1566
+ role_slug: string | null;
1567
+ updated_at: string | null;
1568
+ user_id: string;
1569
+ workos_membership_id: string | null;
1570
+ };
1571
+ Insert: {
1572
+ config?: Json;
1573
+ created_at?: string | null;
1574
+ id?: string;
1575
+ membership_status?: string | null;
1576
+ organization_id: string;
1577
+ role_slug?: string | null;
1578
+ updated_at?: string | null;
1579
+ user_id: string;
1580
+ workos_membership_id?: string | null;
1581
+ };
1582
+ Update: {
1583
+ config?: Json;
1584
+ created_at?: string | null;
1585
+ id?: string;
1586
+ membership_status?: string | null;
1587
+ organization_id?: string;
1588
+ role_slug?: string | null;
1589
+ updated_at?: string | null;
1590
+ user_id?: string;
1591
+ workos_membership_id?: string | null;
1592
+ };
1593
+ Relationships: [
1594
+ {
1595
+ foreignKeyName: "org_memberships_organization_id_fkey";
1596
+ columns: ["organization_id"];
1597
+ isOneToOne: false;
1598
+ referencedRelation: "organizations";
1599
+ referencedColumns: ["id"];
1600
+ },
1601
+ {
1602
+ foreignKeyName: "org_memberships_user_id_fkey";
1603
+ columns: ["user_id"];
1604
+ isOneToOne: false;
1605
+ referencedRelation: "users";
1606
+ referencedColumns: ["id"];
1607
+ }
1608
+ ];
1609
+ };
1610
+ organizations: {
1611
+ Row: {
1612
+ config: Json;
1613
+ created_at: string;
1614
+ id: string;
1615
+ is_test: boolean;
1616
+ metadata: Json;
1617
+ name: string;
1618
+ status: string;
1619
+ updated_at: string;
1620
+ workos_org_id: string;
1621
+ };
1622
+ Insert: {
1623
+ config?: Json;
1624
+ created_at?: string;
1625
+ id?: string;
1626
+ is_test?: boolean;
1627
+ metadata?: Json;
1628
+ name: string;
1629
+ status?: string;
1630
+ updated_at?: string;
1631
+ workos_org_id: string;
1632
+ };
1633
+ Update: {
1634
+ config?: Json;
1635
+ created_at?: string;
1636
+ id?: string;
1637
+ is_test?: boolean;
1638
+ metadata?: Json;
1639
+ name?: string;
1640
+ status?: string;
1641
+ updated_at?: string;
1642
+ workos_org_id?: string;
1643
+ };
1644
+ Relationships: [];
1645
+ };
1646
+ session_messages: {
1647
+ Row: {
1648
+ created_at: string | null;
1649
+ id: string;
1650
+ message: string;
1651
+ message_index: number | null;
1652
+ message_type: string | null;
1653
+ metadata: Json | null;
1654
+ role: string;
1655
+ session_id: string;
1656
+ session_turn_number: number;
1657
+ };
1658
+ Insert: {
1659
+ created_at?: string | null;
1660
+ id: string;
1661
+ message: string;
1662
+ message_index?: number | null;
1663
+ message_type?: string | null;
1664
+ metadata?: Json | null;
1665
+ role: string;
1666
+ session_id: string;
1667
+ session_turn_number: number;
1668
+ };
1669
+ Update: {
1670
+ created_at?: string | null;
1671
+ id?: string;
1672
+ message?: string;
1673
+ message_index?: number | null;
1674
+ message_type?: string | null;
1675
+ metadata?: Json | null;
1676
+ role?: string;
1677
+ session_id?: string;
1678
+ session_turn_number?: number;
1679
+ };
1680
+ Relationships: [
1681
+ {
1682
+ foreignKeyName: "session_messages_session_id_fkey";
1683
+ columns: ["session_id"];
1684
+ isOneToOne: false;
1685
+ referencedRelation: "sessions";
1686
+ referencedColumns: ["session_id"];
1687
+ }
1688
+ ];
1689
+ };
1690
+ sessions: {
1691
+ Row: {
1692
+ context_window_size: number;
1693
+ created_at: string | null;
1694
+ cumulative_input_tokens: number;
1695
+ cumulative_output_tokens: number;
1696
+ deleted_at: string | null;
1697
+ ended_at: string | null;
1698
+ memory_snapshot: Json;
1699
+ metadata: Json | null;
1700
+ organization_id: string;
1701
+ resource_id: string;
1702
+ session_id: string;
1703
+ session_total_turns: number | null;
1704
+ updated_at: string | null;
1705
+ user_id: string | null;
1706
+ };
1707
+ Insert: {
1708
+ context_window_size?: number;
1709
+ created_at?: string | null;
1710
+ cumulative_input_tokens?: number;
1711
+ cumulative_output_tokens?: number;
1712
+ deleted_at?: string | null;
1713
+ ended_at?: string | null;
1714
+ memory_snapshot: Json;
1715
+ metadata?: Json | null;
1716
+ organization_id: string;
1717
+ resource_id: string;
1718
+ session_id?: string;
1719
+ session_total_turns?: number | null;
1720
+ updated_at?: string | null;
1721
+ user_id?: string | null;
1722
+ };
1723
+ Update: {
1724
+ context_window_size?: number;
1725
+ created_at?: string | null;
1726
+ cumulative_input_tokens?: number;
1727
+ cumulative_output_tokens?: number;
1728
+ deleted_at?: string | null;
1729
+ ended_at?: string | null;
1730
+ memory_snapshot?: Json;
1731
+ metadata?: Json | null;
1732
+ organization_id?: string;
1733
+ resource_id?: string;
1734
+ session_id?: string;
1735
+ session_total_turns?: number | null;
1736
+ updated_at?: string | null;
1737
+ user_id?: string | null;
1738
+ };
1739
+ Relationships: [
1740
+ {
1741
+ foreignKeyName: "fk_organization";
1742
+ columns: ["organization_id"];
1743
+ isOneToOne: false;
1744
+ referencedRelation: "organizations";
1745
+ referencedColumns: ["id"];
1746
+ },
1747
+ {
1748
+ foreignKeyName: "fk_user";
1749
+ columns: ["user_id"];
1750
+ isOneToOne: false;
1751
+ referencedRelation: "users";
1752
+ referencedColumns: ["id"];
1753
+ }
1754
+ ];
1755
+ };
1756
+ task_schedules: {
1757
+ Row: {
1758
+ created_at: string;
1759
+ current_step: number;
1760
+ description: string | null;
1761
+ id: string;
1762
+ idempotency_key: string | null;
1763
+ last_execution_id: string | null;
1764
+ last_run_at: string | null;
1765
+ max_retries: number;
1766
+ metadata: Json | null;
1767
+ name: string;
1768
+ next_run_at: string | null;
1769
+ organization_id: string;
1770
+ origin_execution_id: string | null;
1771
+ origin_resource_id: string | null;
1772
+ origin_resource_type: string | null;
1773
+ retry_count: number;
1774
+ schedule_config: Json;
1775
+ status: string;
1776
+ target_resource_id: string;
1777
+ target_resource_type: string;
1778
+ updated_at: string;
1779
+ };
1780
+ Insert: {
1781
+ created_at?: string;
1782
+ current_step?: number;
1783
+ description?: string | null;
1784
+ id?: string;
1785
+ idempotency_key?: string | null;
1786
+ last_execution_id?: string | null;
1787
+ last_run_at?: string | null;
1788
+ max_retries?: number;
1789
+ metadata?: Json | null;
1790
+ name: string;
1791
+ next_run_at?: string | null;
1792
+ organization_id: string;
1793
+ origin_execution_id?: string | null;
1794
+ origin_resource_id?: string | null;
1795
+ origin_resource_type?: string | null;
1796
+ retry_count?: number;
1797
+ schedule_config: Json;
1798
+ status?: string;
1799
+ target_resource_id: string;
1800
+ target_resource_type: string;
1801
+ updated_at?: string;
1802
+ };
1803
+ Update: {
1804
+ created_at?: string;
1805
+ current_step?: number;
1806
+ description?: string | null;
1807
+ id?: string;
1808
+ idempotency_key?: string | null;
1809
+ last_execution_id?: string | null;
1810
+ last_run_at?: string | null;
1811
+ max_retries?: number;
1812
+ metadata?: Json | null;
1813
+ name?: string;
1814
+ next_run_at?: string | null;
1815
+ organization_id?: string;
1816
+ origin_execution_id?: string | null;
1817
+ origin_resource_id?: string | null;
1818
+ origin_resource_type?: string | null;
1819
+ retry_count?: number;
1820
+ schedule_config?: Json;
1821
+ status?: string;
1822
+ target_resource_id?: string;
1823
+ target_resource_type?: string;
1824
+ updated_at?: string;
1825
+ };
1826
+ Relationships: [
1827
+ {
1828
+ foreignKeyName: "task_schedules_organization_id_fkey";
1829
+ columns: ["organization_id"];
1830
+ isOneToOne: false;
1831
+ referencedRelation: "organizations";
1832
+ referencedColumns: ["id"];
1833
+ }
1834
+ ];
1835
+ };
1836
+ training_assessments: {
1837
+ Row: {
1838
+ answers: Json | null;
1839
+ assessment_slug: string;
1840
+ attempted_at: string;
1841
+ course_slug: string;
1842
+ id: string;
1843
+ organization_id: string;
1844
+ passed: boolean;
1845
+ score: number;
1846
+ user_id: string;
1847
+ };
1848
+ Insert: {
1849
+ answers?: Json | null;
1850
+ assessment_slug: string;
1851
+ attempted_at?: string;
1852
+ course_slug: string;
1853
+ id?: string;
1854
+ organization_id: string;
1855
+ passed: boolean;
1856
+ score: number;
1857
+ user_id: string;
1858
+ };
1859
+ Update: {
1860
+ answers?: Json | null;
1861
+ assessment_slug?: string;
1862
+ attempted_at?: string;
1863
+ course_slug?: string;
1864
+ id?: string;
1865
+ organization_id?: string;
1866
+ passed?: boolean;
1867
+ score?: number;
1868
+ user_id?: string;
1869
+ };
1870
+ Relationships: [
1871
+ {
1872
+ foreignKeyName: "training_assessments_organization_id_fkey";
1873
+ columns: ["organization_id"];
1874
+ isOneToOne: false;
1875
+ referencedRelation: "organizations";
1876
+ referencedColumns: ["id"];
1877
+ },
1878
+ {
1879
+ foreignKeyName: "training_assessments_user_id_fkey";
1880
+ columns: ["user_id"];
1881
+ isOneToOne: false;
1882
+ referencedRelation: "users";
1883
+ referencedColumns: ["id"];
1884
+ }
1885
+ ];
1886
+ };
1887
+ training_certifications: {
1888
+ Row: {
1889
+ awarded_at: string;
1890
+ certification_slug: string;
1891
+ id: string;
1892
+ organization_id: string;
1893
+ user_id: string;
1894
+ };
1895
+ Insert: {
1896
+ awarded_at?: string;
1897
+ certification_slug: string;
1898
+ id?: string;
1899
+ organization_id: string;
1900
+ user_id: string;
1901
+ };
1902
+ Update: {
1903
+ awarded_at?: string;
1904
+ certification_slug?: string;
1905
+ id?: string;
1906
+ organization_id?: string;
1907
+ user_id?: string;
1908
+ };
1909
+ Relationships: [
1910
+ {
1911
+ foreignKeyName: "training_certifications_organization_id_fkey";
1912
+ columns: ["organization_id"];
1913
+ isOneToOne: false;
1914
+ referencedRelation: "organizations";
1915
+ referencedColumns: ["id"];
1916
+ },
1917
+ {
1918
+ foreignKeyName: "training_certifications_user_id_fkey";
1919
+ columns: ["user_id"];
1920
+ isOneToOne: false;
1921
+ referencedRelation: "users";
1922
+ referencedColumns: ["id"];
1923
+ }
1924
+ ];
1925
+ };
1926
+ training_progress: {
1927
+ Row: {
1928
+ completed_at: string;
1929
+ course_slug: string;
1930
+ id: string;
1931
+ lesson_slug: string;
1932
+ organization_id: string;
1933
+ user_id: string;
1934
+ };
1935
+ Insert: {
1936
+ completed_at?: string;
1937
+ course_slug: string;
1938
+ id?: string;
1939
+ lesson_slug: string;
1940
+ organization_id: string;
1941
+ user_id: string;
1942
+ };
1943
+ Update: {
1944
+ completed_at?: string;
1945
+ course_slug?: string;
1946
+ id?: string;
1947
+ lesson_slug?: string;
1948
+ organization_id?: string;
1949
+ user_id?: string;
1950
+ };
1951
+ Relationships: [
1952
+ {
1953
+ foreignKeyName: "training_progress_organization_id_fkey";
1954
+ columns: ["organization_id"];
1955
+ isOneToOne: false;
1956
+ referencedRelation: "organizations";
1957
+ referencedColumns: ["id"];
1958
+ },
1959
+ {
1960
+ foreignKeyName: "training_progress_user_id_fkey";
1961
+ columns: ["user_id"];
1962
+ isOneToOne: false;
1963
+ referencedRelation: "users";
1964
+ referencedColumns: ["id"];
1965
+ }
1966
+ ];
1967
+ };
1968
+ users: {
1969
+ Row: {
1970
+ config: Json;
1971
+ created_at: string;
1972
+ display_name: string | null;
1973
+ email: string;
1974
+ first_name: string | null;
1975
+ id: string;
1976
+ is_active: boolean;
1977
+ is_platform_admin: boolean | null;
1978
+ last_login_at: string | null;
1979
+ last_name: string | null;
1980
+ last_visited_org: string | null;
1981
+ profile_picture_url: string | null;
1982
+ updated_at: string;
1983
+ workos_user_id: string | null;
1984
+ };
1985
+ Insert: {
1986
+ config?: Json;
1987
+ created_at?: string;
1988
+ display_name?: string | null;
1989
+ email: string;
1990
+ first_name?: string | null;
1991
+ id?: string;
1992
+ is_active?: boolean;
1993
+ is_platform_admin?: boolean | null;
1994
+ last_login_at?: string | null;
1995
+ last_name?: string | null;
1996
+ last_visited_org?: string | null;
1997
+ profile_picture_url?: string | null;
1998
+ updated_at?: string;
1999
+ workos_user_id?: string | null;
2000
+ };
2001
+ Update: {
2002
+ config?: Json;
2003
+ created_at?: string;
2004
+ display_name?: string | null;
2005
+ email?: string;
2006
+ first_name?: string | null;
2007
+ id?: string;
2008
+ is_active?: boolean;
2009
+ is_platform_admin?: boolean | null;
2010
+ last_login_at?: string | null;
2011
+ last_name?: string | null;
2012
+ last_visited_org?: string | null;
2013
+ profile_picture_url?: string | null;
2014
+ updated_at?: string;
2015
+ workos_user_id?: string | null;
2016
+ };
2017
+ Relationships: [
2018
+ {
2019
+ foreignKeyName: "user_profiles_last_visited_org_fkey";
2020
+ columns: ["last_visited_org"];
2021
+ isOneToOne: false;
2022
+ referencedRelation: "organizations";
2023
+ referencedColumns: ["id"];
2024
+ }
2025
+ ];
2026
+ };
2027
+ webhook_endpoints: {
2028
+ Row: {
2029
+ created_at: string;
2030
+ description: string | null;
2031
+ id: string;
2032
+ key: string;
2033
+ last_triggered_at: string | null;
2034
+ name: string;
2035
+ organization_id: string;
2036
+ request_count: number;
2037
+ resource_id: string | null;
2038
+ status: string;
2039
+ updated_at: string;
2040
+ };
2041
+ Insert: {
2042
+ created_at?: string;
2043
+ description?: string | null;
2044
+ id?: string;
2045
+ key: string;
2046
+ last_triggered_at?: string | null;
2047
+ name: string;
2048
+ organization_id: string;
2049
+ request_count?: number;
2050
+ resource_id?: string | null;
2051
+ status?: string;
2052
+ updated_at?: string;
2053
+ };
2054
+ Update: {
2055
+ created_at?: string;
2056
+ description?: string | null;
2057
+ id?: string;
2058
+ key?: string;
2059
+ last_triggered_at?: string | null;
2060
+ name?: string;
2061
+ organization_id?: string;
2062
+ request_count?: number;
2063
+ resource_id?: string | null;
2064
+ status?: string;
2065
+ updated_at?: string;
2066
+ };
2067
+ Relationships: [
2068
+ {
2069
+ foreignKeyName: "webhook_endpoints_organization_id_fkey";
2070
+ columns: ["organization_id"];
2071
+ isOneToOne: false;
2072
+ referencedRelation: "organizations";
2073
+ referencedColumns: ["id"];
2074
+ }
2075
+ ];
2076
+ };
2077
+ };
2078
+ Views: {
2079
+ [_ in never]: never;
2080
+ };
2081
+ Functions: {
2082
+ acq_default_checklist: {
2083
+ Args: {
2084
+ p_platform: string;
2085
+ };
2086
+ Returns: Json;
2087
+ };
2088
+ append_deal_activity: {
2089
+ Args: {
2090
+ p_activity: Json;
2091
+ p_deal_id: string;
2092
+ p_organization_id: string;
2093
+ };
2094
+ Returns: undefined;
2095
+ };
2096
+ auth_jwt_claims: {
2097
+ Args: never;
2098
+ Returns: Json;
2099
+ };
2100
+ auth_uid_safe: {
2101
+ Args: never;
2102
+ Returns: string;
2103
+ };
2104
+ current_user_is_platform_admin: {
2105
+ Args: never;
2106
+ Returns: boolean;
2107
+ };
2108
+ current_user_supabase_id: {
2109
+ Args: never;
2110
+ Returns: string;
2111
+ };
2112
+ detect_stalled_executions: {
2113
+ Args: never;
2114
+ Returns: undefined;
2115
+ };
2116
+ execute_session_turn: {
2117
+ Args: {
2118
+ p_session_id: string;
2119
+ };
2120
+ Returns: {
2121
+ created_at: string;
2122
+ ended_at: string;
2123
+ memory_snapshot: Json;
2124
+ metadata: Json;
2125
+ organization_id: string;
2126
+ resource_id: string;
2127
+ session_id: string;
2128
+ session_total_turns: number;
2129
+ updated_at: string;
2130
+ user_id: string;
2131
+ }[];
2132
+ };
2133
+ get_storage_org_id: {
2134
+ Args: {
2135
+ file_path: string;
2136
+ };
2137
+ Returns: string;
2138
+ };
2139
+ get_workos_user_id: {
2140
+ Args: never;
2141
+ Returns: string;
2142
+ };
2143
+ is_org_admin: {
2144
+ Args: {
2145
+ org_id: string;
2146
+ };
2147
+ Returns: boolean;
2148
+ };
2149
+ is_org_member: {
2150
+ Args: {
2151
+ org_id: string;
2152
+ };
2153
+ Returns: boolean;
2154
+ };
2155
+ link_workos_membership_on_accept: {
2156
+ Args: {
2157
+ p_email: string;
2158
+ p_organization_id: string;
2159
+ p_workos_membership_id: string;
2160
+ };
2161
+ Returns: boolean;
2162
+ };
2163
+ pre_provision_invited_user: {
2164
+ Args: {
2165
+ p_email: string;
2166
+ p_organization_id: string;
2167
+ p_role_slug?: string;
2168
+ };
2169
+ Returns: Json;
2170
+ };
2171
+ process_due_schedules: {
2172
+ Args: never;
2173
+ Returns: Json;
2174
+ };
2175
+ upsert_user_profile: {
2176
+ Args: never;
2177
+ Returns: {
2178
+ profile_display_name: string;
2179
+ profile_email: string;
2180
+ profile_id: string;
2181
+ profile_workos_user_id: string;
2182
+ }[];
2183
+ };
2184
+ };
2185
+ Enums: {
2186
+ [_ in never]: never;
2187
+ };
2188
+ CompositeTypes: {
2189
+ [_ in never]: never;
2190
+ };
2191
+ };
2192
+ };
2193
+
2194
+ declare function getSupabaseClient(): SupabaseClient<Database>;
2195
+ declare const useSupabase: () => SupabaseClient<Database, "public", "public", {
2196
+ Tables: {
2197
+ acq_companies: {
2198
+ Row: {
2199
+ attio_company_id: string | null;
2200
+ batch_id: string | null;
2201
+ category: string | null;
2202
+ category_pain: string | null;
2203
+ created_at: string;
2204
+ domain: string | null;
2205
+ enrichment_data: Json | null;
2206
+ filter_reason: string | null;
2207
+ founded_year: number | null;
2208
+ id: string;
2209
+ linkedin_url: string | null;
2210
+ location_city: string | null;
2211
+ location_state: string | null;
2212
+ name: string;
2213
+ num_employees: number | null;
2214
+ organization_id: string;
2215
+ pipeline_status: Json;
2216
+ segment: string | null;
2217
+ source: string | null;
2218
+ status: string;
2219
+ updated_at: string;
2220
+ website: string | null;
2221
+ };
2222
+ Insert: {
2223
+ attio_company_id?: string | null;
2224
+ batch_id?: string | null;
2225
+ category?: string | null;
2226
+ category_pain?: string | null;
2227
+ created_at?: string;
2228
+ domain?: string | null;
2229
+ enrichment_data?: Json | null;
2230
+ filter_reason?: string | null;
2231
+ founded_year?: number | null;
2232
+ id?: string;
2233
+ linkedin_url?: string | null;
2234
+ location_city?: string | null;
2235
+ location_state?: string | null;
2236
+ name: string;
2237
+ num_employees?: number | null;
2238
+ organization_id: string;
2239
+ pipeline_status?: Json;
2240
+ segment?: string | null;
2241
+ source?: string | null;
2242
+ status?: string;
2243
+ updated_at?: string;
2244
+ website?: string | null;
2245
+ };
2246
+ Update: {
2247
+ attio_company_id?: string | null;
2248
+ batch_id?: string | null;
2249
+ category?: string | null;
2250
+ category_pain?: string | null;
2251
+ created_at?: string;
2252
+ domain?: string | null;
2253
+ enrichment_data?: Json | null;
2254
+ filter_reason?: string | null;
2255
+ founded_year?: number | null;
2256
+ id?: string;
2257
+ linkedin_url?: string | null;
2258
+ location_city?: string | null;
2259
+ location_state?: string | null;
2260
+ name?: string;
2261
+ num_employees?: number | null;
2262
+ organization_id?: string;
2263
+ pipeline_status?: Json;
2264
+ segment?: string | null;
2265
+ source?: string | null;
2266
+ status?: string;
2267
+ updated_at?: string;
2268
+ website?: string | null;
2269
+ };
2270
+ Relationships: [{
2271
+ foreignKeyName: "acq_companies_organization_id_fkey";
2272
+ columns: ["organization_id"];
2273
+ isOneToOne: false;
2274
+ referencedRelation: "organizations";
2275
+ referencedColumns: ["id"];
2276
+ }];
2277
+ };
2278
+ acq_contacts: {
2279
+ Row: {
2280
+ attio_person_id: string | null;
2281
+ batch_id: string | null;
2282
+ brochure_first_viewed_at: string | null;
2283
+ brochure_view_count: number;
2284
+ company_id: string | null;
2285
+ created_at: string;
2286
+ email: string;
2287
+ email_valid: string | null;
2288
+ enrichment_data: Json;
2289
+ filter_reason: string | null;
2290
+ first_name: string | null;
2291
+ headline: string | null;
2292
+ id: string;
2293
+ last_name: string | null;
2294
+ linkedin_url: string | null;
2295
+ nurture: boolean;
2296
+ opening_line: string | null;
2297
+ organization_id: string;
2298
+ pipeline_status: Json;
2299
+ source: string | null;
2300
+ source_id: string | null;
2301
+ status: string;
2302
+ title: string | null;
2303
+ updated_at: string;
2304
+ };
2305
+ Insert: {
2306
+ attio_person_id?: string | null;
2307
+ batch_id?: string | null;
2308
+ brochure_first_viewed_at?: string | null;
2309
+ brochure_view_count?: number;
2310
+ company_id?: string | null;
2311
+ created_at?: string;
2312
+ email: string;
2313
+ email_valid?: string | null;
2314
+ enrichment_data?: Json;
2315
+ filter_reason?: string | null;
2316
+ first_name?: string | null;
2317
+ headline?: string | null;
2318
+ id?: string;
2319
+ last_name?: string | null;
2320
+ linkedin_url?: string | null;
2321
+ nurture?: boolean;
2322
+ opening_line?: string | null;
2323
+ organization_id: string;
2324
+ pipeline_status?: Json;
2325
+ source?: string | null;
2326
+ source_id?: string | null;
2327
+ status?: string;
2328
+ title?: string | null;
2329
+ updated_at?: string;
2330
+ };
2331
+ Update: {
2332
+ attio_person_id?: string | null;
2333
+ batch_id?: string | null;
2334
+ brochure_first_viewed_at?: string | null;
2335
+ brochure_view_count?: number;
2336
+ company_id?: string | null;
2337
+ created_at?: string;
2338
+ email?: string;
2339
+ email_valid?: string | null;
2340
+ enrichment_data?: Json;
2341
+ filter_reason?: string | null;
2342
+ first_name?: string | null;
2343
+ headline?: string | null;
2344
+ id?: string;
2345
+ last_name?: string | null;
2346
+ linkedin_url?: string | null;
2347
+ nurture?: boolean;
2348
+ opening_line?: string | null;
2349
+ organization_id?: string;
2350
+ pipeline_status?: Json;
2351
+ source?: string | null;
2352
+ source_id?: string | null;
2353
+ status?: string;
2354
+ title?: string | null;
2355
+ updated_at?: string;
2356
+ };
2357
+ Relationships: [{
2358
+ foreignKeyName: "acq_contacts_company_id_fkey";
2359
+ columns: ["company_id"];
2360
+ isOneToOne: false;
2361
+ referencedRelation: "acq_companies";
2362
+ referencedColumns: ["id"];
2363
+ }, {
2364
+ foreignKeyName: "acq_contacts_organization_id_fkey";
2365
+ columns: ["organization_id"];
2366
+ isOneToOne: false;
2367
+ referencedRelation: "organizations";
2368
+ referencedColumns: ["id"];
2369
+ }];
2370
+ };
2371
+ acq_content: {
2372
+ Row: {
2373
+ body: string | null;
2374
+ created_at: string;
2375
+ id: string;
2376
+ organization_id: string;
2377
+ pillar: string;
2378
+ status: string;
2379
+ title: string;
2380
+ updated_at: string;
2381
+ };
2382
+ Insert: {
2383
+ body?: string | null;
2384
+ created_at?: string;
2385
+ id?: string;
2386
+ organization_id: string;
2387
+ pillar: string;
2388
+ status?: string;
2389
+ title: string;
2390
+ updated_at?: string;
2391
+ };
2392
+ Update: {
2393
+ body?: string | null;
2394
+ created_at?: string;
2395
+ id?: string;
2396
+ organization_id?: string;
2397
+ pillar?: string;
2398
+ status?: string;
2399
+ title?: string;
2400
+ updated_at?: string;
2401
+ };
2402
+ Relationships: [{
2403
+ foreignKeyName: "acq_content_organization_id_fkey";
2404
+ columns: ["organization_id"];
2405
+ isOneToOne: false;
2406
+ referencedRelation: "organizations";
2407
+ referencedColumns: ["id"];
2408
+ }];
2409
+ };
2410
+ acq_content_distributions: {
2411
+ Row: {
2412
+ adapted_body: string | null;
2413
+ checklist: Json | null;
2414
+ content_id: string;
2415
+ created_at: string;
2416
+ format: string;
2417
+ id: string;
2418
+ media_urls: Json;
2419
+ metrics: Json;
2420
+ metrics_updated_at: string | null;
2421
+ organization_id: string;
2422
+ platform: string;
2423
+ platform_content: Json | null;
2424
+ platform_post_id: string | null;
2425
+ platform_url: string | null;
2426
+ published_at: string | null;
2427
+ status: string;
2428
+ updated_at: string;
2429
+ };
2430
+ Insert: {
2431
+ adapted_body?: string | null;
2432
+ checklist?: Json | null;
2433
+ content_id: string;
2434
+ created_at?: string;
2435
+ format: string;
2436
+ id?: string;
2437
+ media_urls?: Json;
2438
+ metrics?: Json;
2439
+ metrics_updated_at?: string | null;
2440
+ organization_id: string;
2441
+ platform: string;
2442
+ platform_content?: Json | null;
2443
+ platform_post_id?: string | null;
2444
+ platform_url?: string | null;
2445
+ published_at?: string | null;
2446
+ status?: string;
2447
+ updated_at?: string;
2448
+ };
2449
+ Update: {
2450
+ adapted_body?: string | null;
2451
+ checklist?: Json | null;
2452
+ content_id?: string;
2453
+ created_at?: string;
2454
+ format?: string;
2455
+ id?: string;
2456
+ media_urls?: Json;
2457
+ metrics?: Json;
2458
+ metrics_updated_at?: string | null;
2459
+ organization_id?: string;
2460
+ platform?: string;
2461
+ platform_content?: Json | null;
2462
+ platform_post_id?: string | null;
2463
+ platform_url?: string | null;
2464
+ published_at?: string | null;
2465
+ status?: string;
2466
+ updated_at?: string;
2467
+ };
2468
+ Relationships: [{
2469
+ foreignKeyName: "acq_content_distributions_content_id_fkey";
2470
+ columns: ["content_id"];
2471
+ isOneToOne: false;
2472
+ referencedRelation: "acq_content";
2473
+ referencedColumns: ["id"];
2474
+ }, {
2475
+ foreignKeyName: "acq_content_distributions_organization_id_fkey";
2476
+ columns: ["organization_id"];
2477
+ isOneToOne: false;
2478
+ referencedRelation: "organizations";
2479
+ referencedColumns: ["id"];
2480
+ }];
2481
+ };
2482
+ acq_deals: {
2483
+ Row: {
2484
+ activity_log: Json;
2485
+ attio_deal_id: string;
2486
+ cached_stage: string | null;
2487
+ closed_lost_at: string | null;
2488
+ closed_lost_reason: string | null;
2489
+ contact_email: string;
2490
+ contact_id: string | null;
2491
+ created_at: string;
2492
+ discovery_data: Json | null;
2493
+ discovery_submitted_at: string | null;
2494
+ discovery_submitted_by: string | null;
2495
+ id: string;
2496
+ initial_fee: number | null;
2497
+ monthly_fee: number | null;
2498
+ organization_id: string;
2499
+ payment_link_sent_at: string | null;
2500
+ payment_received_at: string | null;
2501
+ proposal_data: Json | null;
2502
+ proposal_generated_at: string | null;
2503
+ proposal_pdf_url: string | null;
2504
+ proposal_reviewed_at: string | null;
2505
+ proposal_reviewed_by: string | null;
2506
+ proposal_sent_at: string | null;
2507
+ proposal_signed_at: string | null;
2508
+ proposal_status: string | null;
2509
+ signature_envelope_id: string | null;
2510
+ source_list_id: string | null;
2511
+ source_type: string | null;
2512
+ stripe_payment_id: string | null;
2513
+ stripe_payment_link: string | null;
2514
+ stripe_payment_link_id: string | null;
2515
+ stripe_subscription_id: string | null;
2516
+ updated_at: string;
2517
+ };
2518
+ Insert: {
2519
+ activity_log?: Json;
2520
+ attio_deal_id: string;
2521
+ cached_stage?: string | null;
2522
+ closed_lost_at?: string | null;
2523
+ closed_lost_reason?: string | null;
2524
+ contact_email: string;
2525
+ contact_id?: string | null;
2526
+ created_at?: string;
2527
+ discovery_data?: Json | null;
2528
+ discovery_submitted_at?: string | null;
2529
+ discovery_submitted_by?: string | null;
2530
+ id?: string;
2531
+ initial_fee?: number | null;
2532
+ monthly_fee?: number | null;
2533
+ organization_id: string;
2534
+ payment_link_sent_at?: string | null;
2535
+ payment_received_at?: string | null;
2536
+ proposal_data?: Json | null;
2537
+ proposal_generated_at?: string | null;
2538
+ proposal_pdf_url?: string | null;
2539
+ proposal_reviewed_at?: string | null;
2540
+ proposal_reviewed_by?: string | null;
2541
+ proposal_sent_at?: string | null;
2542
+ proposal_signed_at?: string | null;
2543
+ proposal_status?: string | null;
2544
+ signature_envelope_id?: string | null;
2545
+ source_list_id?: string | null;
2546
+ source_type?: string | null;
2547
+ stripe_payment_id?: string | null;
2548
+ stripe_payment_link?: string | null;
2549
+ stripe_payment_link_id?: string | null;
2550
+ stripe_subscription_id?: string | null;
2551
+ updated_at?: string;
2552
+ };
2553
+ Update: {
2554
+ activity_log?: Json;
2555
+ attio_deal_id?: string;
2556
+ cached_stage?: string | null;
2557
+ closed_lost_at?: string | null;
2558
+ closed_lost_reason?: string | null;
2559
+ contact_email?: string;
2560
+ contact_id?: string | null;
2561
+ created_at?: string;
2562
+ discovery_data?: Json | null;
2563
+ discovery_submitted_at?: string | null;
2564
+ discovery_submitted_by?: string | null;
2565
+ id?: string;
2566
+ initial_fee?: number | null;
2567
+ monthly_fee?: number | null;
2568
+ organization_id?: string;
2569
+ payment_link_sent_at?: string | null;
2570
+ payment_received_at?: string | null;
2571
+ proposal_data?: Json | null;
2572
+ proposal_generated_at?: string | null;
2573
+ proposal_pdf_url?: string | null;
2574
+ proposal_reviewed_at?: string | null;
2575
+ proposal_reviewed_by?: string | null;
2576
+ proposal_sent_at?: string | null;
2577
+ proposal_signed_at?: string | null;
2578
+ proposal_status?: string | null;
2579
+ signature_envelope_id?: string | null;
2580
+ source_list_id?: string | null;
2581
+ source_type?: string | null;
2582
+ stripe_payment_id?: string | null;
2583
+ stripe_payment_link?: string | null;
2584
+ stripe_payment_link_id?: string | null;
2585
+ stripe_subscription_id?: string | null;
2586
+ updated_at?: string;
2587
+ };
2588
+ Relationships: [{
2589
+ foreignKeyName: "acq_deals_contact_id_fkey";
2590
+ columns: ["contact_id"];
2591
+ isOneToOne: false;
2592
+ referencedRelation: "acq_contacts";
2593
+ referencedColumns: ["id"];
2594
+ }, {
2595
+ foreignKeyName: "acq_deals_organization_id_fkey";
2596
+ columns: ["organization_id"];
2597
+ isOneToOne: false;
2598
+ referencedRelation: "organizations";
2599
+ referencedColumns: ["id"];
2600
+ }, {
2601
+ foreignKeyName: "acq_deals_source_list_id_fkey";
2602
+ columns: ["source_list_id"];
2603
+ isOneToOne: false;
2604
+ referencedRelation: "acq_lists";
2605
+ referencedColumns: ["id"];
2606
+ }];
2607
+ };
2608
+ acq_list_members: {
2609
+ Row: {
2610
+ added_at: string;
2611
+ added_by: string | null;
2612
+ contact_id: string;
2613
+ id: string;
2614
+ list_id: string;
2615
+ };
2616
+ Insert: {
2617
+ added_at?: string;
2618
+ added_by?: string | null;
2619
+ contact_id: string;
2620
+ id?: string;
2621
+ list_id: string;
2622
+ };
2623
+ Update: {
2624
+ added_at?: string;
2625
+ added_by?: string | null;
2626
+ contact_id?: string;
2627
+ id?: string;
2628
+ list_id?: string;
2629
+ };
2630
+ Relationships: [{
2631
+ foreignKeyName: "acq_list_members_contact_id_fkey";
2632
+ columns: ["contact_id"];
2633
+ isOneToOne: false;
2634
+ referencedRelation: "acq_contacts";
2635
+ referencedColumns: ["id"];
2636
+ }, {
2637
+ foreignKeyName: "acq_list_members_list_id_fkey";
2638
+ columns: ["list_id"];
2639
+ isOneToOne: false;
2640
+ referencedRelation: "acq_lists";
2641
+ referencedColumns: ["id"];
2642
+ }];
2643
+ };
2644
+ acq_lists: {
2645
+ Row: {
2646
+ batch_ids: string[];
2647
+ completed_at: string | null;
2648
+ created_at: string;
2649
+ description: string | null;
2650
+ id: string;
2651
+ instantly_campaign_id: string | null;
2652
+ launched_at: string | null;
2653
+ metadata: Json;
2654
+ name: string;
2655
+ organization_id: string;
2656
+ status: string;
2657
+ type: string;
2658
+ };
2659
+ Insert: {
2660
+ batch_ids?: string[];
2661
+ completed_at?: string | null;
2662
+ created_at?: string;
2663
+ description?: string | null;
2664
+ id?: string;
2665
+ instantly_campaign_id?: string | null;
2666
+ launched_at?: string | null;
2667
+ metadata?: Json;
2668
+ name: string;
2669
+ organization_id: string;
2670
+ status?: string;
2671
+ type?: string;
2672
+ };
2673
+ Update: {
2674
+ batch_ids?: string[];
2675
+ completed_at?: string | null;
2676
+ created_at?: string;
2677
+ description?: string | null;
2678
+ id?: string;
2679
+ instantly_campaign_id?: string | null;
2680
+ launched_at?: string | null;
2681
+ metadata?: Json;
2682
+ name?: string;
2683
+ organization_id?: string;
2684
+ status?: string;
2685
+ type?: string;
2686
+ };
2687
+ Relationships: [{
2688
+ foreignKeyName: "acq_lists_organization_id_fkey";
2689
+ columns: ["organization_id"];
2690
+ isOneToOne: false;
2691
+ referencedRelation: "organizations";
2692
+ referencedColumns: ["id"];
2693
+ }];
2694
+ };
2695
+ acq_seo_metrics: {
2696
+ Row: {
2697
+ ai_citations: Json | null;
2698
+ avg_position: number | null;
2699
+ clicks: number | null;
2700
+ created_at: string;
2701
+ cta_clicks: number | null;
2702
+ ctr: number | null;
2703
+ data_point_count: number | null;
2704
+ faq_count: number | null;
2705
+ form_submissions: number | null;
2706
+ id: string;
2707
+ impressions: number | null;
2708
+ organization_id: string;
2709
+ period: string;
2710
+ quality_score: number | null;
2711
+ readability: number | null;
2712
+ scroll_100: number | null;
2713
+ scroll_25: number | null;
2714
+ scroll_50: number | null;
2715
+ scroll_75: number | null;
2716
+ seo_page_id: string;
2717
+ word_count: number | null;
2718
+ };
2719
+ Insert: {
2720
+ ai_citations?: Json | null;
2721
+ avg_position?: number | null;
2722
+ clicks?: number | null;
2723
+ created_at?: string;
2724
+ cta_clicks?: number | null;
2725
+ ctr?: number | null;
2726
+ data_point_count?: number | null;
2727
+ faq_count?: number | null;
2728
+ form_submissions?: number | null;
2729
+ id?: string;
2730
+ impressions?: number | null;
2731
+ organization_id: string;
2732
+ period: string;
2733
+ quality_score?: number | null;
2734
+ readability?: number | null;
2735
+ scroll_100?: number | null;
2736
+ scroll_25?: number | null;
2737
+ scroll_50?: number | null;
2738
+ scroll_75?: number | null;
2739
+ seo_page_id: string;
2740
+ word_count?: number | null;
2741
+ };
2742
+ Update: {
2743
+ ai_citations?: Json | null;
2744
+ avg_position?: number | null;
2745
+ clicks?: number | null;
2746
+ created_at?: string;
2747
+ cta_clicks?: number | null;
2748
+ ctr?: number | null;
2749
+ data_point_count?: number | null;
2750
+ faq_count?: number | null;
2751
+ form_submissions?: number | null;
2752
+ id?: string;
2753
+ impressions?: number | null;
2754
+ organization_id?: string;
2755
+ period?: string;
2756
+ quality_score?: number | null;
2757
+ readability?: number | null;
2758
+ scroll_100?: number | null;
2759
+ scroll_25?: number | null;
2760
+ scroll_50?: number | null;
2761
+ scroll_75?: number | null;
2762
+ seo_page_id?: string;
2763
+ word_count?: number | null;
2764
+ };
2765
+ Relationships: [{
2766
+ foreignKeyName: "acq_seo_metrics_organization_id_fkey";
2767
+ columns: ["organization_id"];
2768
+ isOneToOne: false;
2769
+ referencedRelation: "organizations";
2770
+ referencedColumns: ["id"];
2771
+ }, {
2772
+ foreignKeyName: "acq_seo_metrics_seo_page_id_fkey";
2773
+ columns: ["seo_page_id"];
2774
+ isOneToOne: false;
2775
+ referencedRelation: "acq_seo_pages";
2776
+ referencedColumns: ["id"];
2777
+ }];
2778
+ };
2779
+ acq_seo_pages: {
2780
+ Row: {
2781
+ city: string | null;
2782
+ content: Json | null;
2783
+ created_at: string;
2784
+ faq_items: Json | null;
2785
+ hero_image_url: string | null;
2786
+ id: string;
2787
+ internal_links: Json | null;
2788
+ local_data: Json | null;
2789
+ meta_description: string | null;
2790
+ organization_id: string;
2791
+ page_type: string;
2792
+ published_at: string | null;
2793
+ refreshed_at: string | null;
2794
+ schema_markup: Json | null;
2795
+ slug: string;
2796
+ state: string | null;
2797
+ status: string;
2798
+ title: string;
2799
+ updated_at: string;
2800
+ use_case: string | null;
2801
+ vertical: string;
2802
+ };
2803
+ Insert: {
2804
+ city?: string | null;
2805
+ content?: Json | null;
2806
+ created_at?: string;
2807
+ faq_items?: Json | null;
2808
+ hero_image_url?: string | null;
2809
+ id?: string;
2810
+ internal_links?: Json | null;
2811
+ local_data?: Json | null;
2812
+ meta_description?: string | null;
2813
+ organization_id: string;
2814
+ page_type: string;
2815
+ published_at?: string | null;
2816
+ refreshed_at?: string | null;
2817
+ schema_markup?: Json | null;
2818
+ slug: string;
2819
+ state?: string | null;
2820
+ status?: string;
2821
+ title: string;
2822
+ updated_at?: string;
2823
+ use_case?: string | null;
2824
+ vertical: string;
2825
+ };
2826
+ Update: {
2827
+ city?: string | null;
2828
+ content?: Json | null;
2829
+ created_at?: string;
2830
+ faq_items?: Json | null;
2831
+ hero_image_url?: string | null;
2832
+ id?: string;
2833
+ internal_links?: Json | null;
2834
+ local_data?: Json | null;
2835
+ meta_description?: string | null;
2836
+ organization_id?: string;
2837
+ page_type?: string;
2838
+ published_at?: string | null;
2839
+ refreshed_at?: string | null;
2840
+ schema_markup?: Json | null;
2841
+ slug?: string;
2842
+ state?: string | null;
2843
+ status?: string;
2844
+ title?: string;
2845
+ updated_at?: string;
2846
+ use_case?: string | null;
2847
+ vertical?: string;
2848
+ };
2849
+ Relationships: [{
2850
+ foreignKeyName: "acq_seo_pages_organization_id_fkey";
2851
+ columns: ["organization_id"];
2852
+ isOneToOne: false;
2853
+ referencedRelation: "organizations";
2854
+ referencedColumns: ["id"];
2855
+ }];
2856
+ };
2857
+ acq_social_posts: {
2858
+ Row: {
2859
+ author_name: string;
2860
+ author_url: string | null;
2861
+ comments_count: number;
2862
+ created_at: string;
2863
+ discovered_at: string;
2864
+ engagement_count: number;
2865
+ feedback: string | null;
2866
+ final_response: string | null;
2867
+ fully_reviewed: boolean;
2868
+ id: string;
2869
+ initial_draft: string | null;
2870
+ matched_keywords: string[];
2871
+ matched_query: string | null;
2872
+ metadata: Json;
2873
+ organization_id: string;
2874
+ platform: string;
2875
+ platform_post_id: string;
2876
+ post_text: string;
2877
+ post_title: string;
2878
+ post_url: string;
2879
+ posted_at: string;
2880
+ relevance_score: number;
2881
+ responded_at: string | null;
2882
+ reviewed_at: string | null;
2883
+ skip_reason: string | null;
2884
+ source_category: string | null;
2885
+ status: string;
2886
+ updated_at: string;
2887
+ };
2888
+ Insert: {
2889
+ author_name: string;
2890
+ author_url?: string | null;
2891
+ comments_count?: number;
2892
+ created_at?: string;
2893
+ discovered_at?: string;
2894
+ engagement_count?: number;
2895
+ feedback?: string | null;
2896
+ final_response?: string | null;
2897
+ fully_reviewed?: boolean;
2898
+ id?: string;
2899
+ initial_draft?: string | null;
2900
+ matched_keywords?: string[];
2901
+ matched_query?: string | null;
2902
+ metadata?: Json;
2903
+ organization_id: string;
2904
+ platform: string;
2905
+ platform_post_id: string;
2906
+ post_text: string;
2907
+ post_title: string;
2908
+ post_url: string;
2909
+ posted_at: string;
2910
+ relevance_score?: number;
2911
+ responded_at?: string | null;
2912
+ reviewed_at?: string | null;
2913
+ skip_reason?: string | null;
2914
+ source_category?: string | null;
2915
+ status?: string;
2916
+ updated_at?: string;
2917
+ };
2918
+ Update: {
2919
+ author_name?: string;
2920
+ author_url?: string | null;
2921
+ comments_count?: number;
2922
+ created_at?: string;
2923
+ discovered_at?: string;
2924
+ engagement_count?: number;
2925
+ feedback?: string | null;
2926
+ final_response?: string | null;
2927
+ fully_reviewed?: boolean;
2928
+ id?: string;
2929
+ initial_draft?: string | null;
2930
+ matched_keywords?: string[];
2931
+ matched_query?: string | null;
2932
+ metadata?: Json;
2933
+ organization_id?: string;
2934
+ platform?: string;
2935
+ platform_post_id?: string;
2936
+ post_text?: string;
2937
+ post_title?: string;
2938
+ post_url?: string;
2939
+ posted_at?: string;
2940
+ relevance_score?: number;
2941
+ responded_at?: string | null;
2942
+ reviewed_at?: string | null;
2943
+ skip_reason?: string | null;
2944
+ source_category?: string | null;
2945
+ status?: string;
2946
+ updated_at?: string;
2947
+ };
2948
+ Relationships: [{
2949
+ foreignKeyName: "acq_social_posts_organization_id_fkey";
2950
+ columns: ["organization_id"];
2951
+ isOneToOne: false;
2952
+ referencedRelation: "organizations";
2953
+ referencedColumns: ["id"];
2954
+ }];
2955
+ };
2956
+ activities: {
2957
+ Row: {
2958
+ activity_type: string;
2959
+ actor_id: string | null;
2960
+ actor_type: string | null;
2961
+ created_at: string;
2962
+ description: string | null;
2963
+ entity_id: string;
2964
+ entity_name: string | null;
2965
+ entity_type: string;
2966
+ id: string;
2967
+ metadata: Json | null;
2968
+ occurred_at: string;
2969
+ organization_id: string;
2970
+ status: string;
2971
+ title: string;
2972
+ };
2973
+ Insert: {
2974
+ activity_type: string;
2975
+ actor_id?: string | null;
2976
+ actor_type?: string | null;
2977
+ created_at?: string;
2978
+ description?: string | null;
2979
+ entity_id: string;
2980
+ entity_name?: string | null;
2981
+ entity_type: string;
2982
+ id?: string;
2983
+ metadata?: Json | null;
2984
+ occurred_at?: string;
2985
+ organization_id: string;
2986
+ status: string;
2987
+ title: string;
2988
+ };
2989
+ Update: {
2990
+ activity_type?: string;
2991
+ actor_id?: string | null;
2992
+ actor_type?: string | null;
2993
+ created_at?: string;
2994
+ description?: string | null;
2995
+ entity_id?: string;
2996
+ entity_name?: string | null;
2997
+ entity_type?: string;
2998
+ id?: string;
2999
+ metadata?: Json | null;
3000
+ occurred_at?: string;
3001
+ organization_id?: string;
3002
+ status?: string;
3003
+ title?: string;
3004
+ };
3005
+ Relationships: [{
3006
+ foreignKeyName: "activities_organization_id_fkey";
3007
+ columns: ["organization_id"];
3008
+ isOneToOne: false;
3009
+ referencedRelation: "organizations";
3010
+ referencedColumns: ["id"];
3011
+ }];
3012
+ };
3013
+ api_keys: {
3014
+ Row: {
3015
+ created_at: string | null;
3016
+ id: string;
3017
+ key_hash: string;
3018
+ last_used_at: string | null;
3019
+ name: string;
3020
+ organization_id: string;
3021
+ };
3022
+ Insert: {
3023
+ created_at?: string | null;
3024
+ id?: string;
3025
+ key_hash: string;
3026
+ last_used_at?: string | null;
3027
+ name: string;
3028
+ organization_id: string;
3029
+ };
3030
+ Update: {
3031
+ created_at?: string | null;
3032
+ id?: string;
3033
+ key_hash?: string;
3034
+ last_used_at?: string | null;
3035
+ name?: string;
3036
+ organization_id?: string;
3037
+ };
3038
+ Relationships: [{
3039
+ foreignKeyName: "api_keys_organization_id_fkey";
3040
+ columns: ["organization_id"];
3041
+ isOneToOne: false;
3042
+ referencedRelation: "organizations";
3043
+ referencedColumns: ["id"];
3044
+ }];
3045
+ };
3046
+ calibration_projects: {
3047
+ Row: {
3048
+ created_at: string | null;
3049
+ description: string | null;
3050
+ id: string;
3051
+ name: string;
3052
+ organization_id: string;
3053
+ resource_id: string;
3054
+ resource_type: string;
3055
+ updated_at: string | null;
3056
+ };
3057
+ Insert: {
3058
+ created_at?: string | null;
3059
+ description?: string | null;
3060
+ id?: string;
3061
+ name: string;
3062
+ organization_id: string;
3063
+ resource_id: string;
3064
+ resource_type: string;
3065
+ updated_at?: string | null;
3066
+ };
3067
+ Update: {
3068
+ created_at?: string | null;
3069
+ description?: string | null;
3070
+ id?: string;
3071
+ name?: string;
3072
+ organization_id?: string;
3073
+ resource_id?: string;
3074
+ resource_type?: string;
3075
+ updated_at?: string | null;
3076
+ };
3077
+ Relationships: [{
3078
+ foreignKeyName: "calibration_projects_organization_id_fkey";
3079
+ columns: ["organization_id"];
3080
+ isOneToOne: false;
3081
+ referencedRelation: "organizations";
3082
+ referencedColumns: ["id"];
3083
+ }];
3084
+ };
3085
+ calibration_runs: {
3086
+ Row: {
3087
+ completed_at: string | null;
3088
+ config_variants: Json;
3089
+ created_at: string | null;
3090
+ description: string | null;
3091
+ execution_mode: string;
3092
+ grader_model: string | null;
3093
+ grading_rubric: Json | null;
3094
+ id: string;
3095
+ name: string;
3096
+ organization_id: string;
3097
+ project_id: string;
3098
+ results: Json;
3099
+ status: string;
3100
+ test_inputs: Json;
3101
+ };
3102
+ Insert: {
3103
+ completed_at?: string | null;
3104
+ config_variants: Json;
3105
+ created_at?: string | null;
3106
+ description?: string | null;
3107
+ execution_mode?: string;
3108
+ grader_model?: string | null;
3109
+ grading_rubric?: Json | null;
3110
+ id?: string;
3111
+ name: string;
3112
+ organization_id: string;
3113
+ project_id: string;
3114
+ results?: Json;
3115
+ status?: string;
3116
+ test_inputs: Json;
3117
+ };
3118
+ Update: {
3119
+ completed_at?: string | null;
3120
+ config_variants?: Json;
3121
+ created_at?: string | null;
3122
+ description?: string | null;
3123
+ execution_mode?: string;
3124
+ grader_model?: string | null;
3125
+ grading_rubric?: Json | null;
3126
+ id?: string;
3127
+ name?: string;
3128
+ organization_id?: string;
3129
+ project_id?: string;
3130
+ results?: Json;
3131
+ status?: string;
3132
+ test_inputs?: Json;
3133
+ };
3134
+ Relationships: [{
3135
+ foreignKeyName: "calibration_runs_organization_id_fkey";
3136
+ columns: ["organization_id"];
3137
+ isOneToOne: false;
3138
+ referencedRelation: "organizations";
3139
+ referencedColumns: ["id"];
3140
+ }, {
3141
+ foreignKeyName: "calibration_runs_project_id_fkey";
3142
+ columns: ["project_id"];
3143
+ isOneToOne: false;
3144
+ referencedRelation: "calibration_projects";
3145
+ referencedColumns: ["id"];
3146
+ }];
3147
+ };
3148
+ command_queue: {
3149
+ Row: {
3150
+ action_payload: Json | null;
3151
+ actions: Json;
3152
+ completed_at: string | null;
3153
+ completed_by: string | null;
3154
+ context: Json;
3155
+ created_at: string;
3156
+ description: string | null;
3157
+ expires_at: string | null;
3158
+ human_checkpoint: string | null;
3159
+ id: string;
3160
+ idempotency_key: string | null;
3161
+ metadata: Json | null;
3162
+ organization_id: string;
3163
+ origin_execution_id: string;
3164
+ origin_resource_id: string;
3165
+ origin_resource_type: string;
3166
+ priority: number;
3167
+ selected_action: string | null;
3168
+ status: string;
3169
+ target_execution_id: string | null;
3170
+ target_resource_id: string | null;
3171
+ target_resource_type: string | null;
3172
+ };
3173
+ Insert: {
3174
+ action_payload?: Json | null;
3175
+ actions: Json;
3176
+ completed_at?: string | null;
3177
+ completed_by?: string | null;
3178
+ context: Json;
3179
+ created_at?: string;
3180
+ description?: string | null;
3181
+ expires_at?: string | null;
3182
+ human_checkpoint?: string | null;
3183
+ id?: string;
3184
+ idempotency_key?: string | null;
3185
+ metadata?: Json | null;
3186
+ organization_id: string;
3187
+ origin_execution_id: string;
3188
+ origin_resource_id: string;
3189
+ origin_resource_type: string;
3190
+ priority?: number;
3191
+ selected_action?: string | null;
3192
+ status?: string;
3193
+ target_execution_id?: string | null;
3194
+ target_resource_id?: string | null;
3195
+ target_resource_type?: string | null;
3196
+ };
3197
+ Update: {
3198
+ action_payload?: Json | null;
3199
+ actions?: Json;
3200
+ completed_at?: string | null;
3201
+ completed_by?: string | null;
3202
+ context?: Json;
3203
+ created_at?: string;
3204
+ description?: string | null;
3205
+ expires_at?: string | null;
3206
+ human_checkpoint?: string | null;
3207
+ id?: string;
3208
+ idempotency_key?: string | null;
3209
+ metadata?: Json | null;
3210
+ organization_id?: string;
3211
+ origin_execution_id?: string;
3212
+ origin_resource_id?: string;
3213
+ origin_resource_type?: string;
3214
+ priority?: number;
3215
+ selected_action?: string | null;
3216
+ status?: string;
3217
+ target_execution_id?: string | null;
3218
+ target_resource_id?: string | null;
3219
+ target_resource_type?: string | null;
3220
+ };
3221
+ Relationships: [{
3222
+ foreignKeyName: "command_queue_completed_by_fkey";
3223
+ columns: ["completed_by"];
3224
+ isOneToOne: false;
3225
+ referencedRelation: "users";
3226
+ referencedColumns: ["id"];
3227
+ }, {
3228
+ foreignKeyName: "command_queue_organization_id_fkey";
3229
+ columns: ["organization_id"];
3230
+ isOneToOne: false;
3231
+ referencedRelation: "organizations";
3232
+ referencedColumns: ["id"];
3233
+ }, {
3234
+ foreignKeyName: "command_queue_target_execution_id_fkey";
3235
+ columns: ["target_execution_id"];
3236
+ isOneToOne: false;
3237
+ referencedRelation: "execution_logs";
3238
+ referencedColumns: ["execution_id"];
3239
+ }];
3240
+ };
3241
+ credentials: {
3242
+ Row: {
3243
+ created_at: string;
3244
+ created_by: string | null;
3245
+ encrypted_value: string;
3246
+ id: string;
3247
+ name: string;
3248
+ organization_id: string;
3249
+ provider: string | null;
3250
+ type: string;
3251
+ updated_at: string;
3252
+ };
3253
+ Insert: {
3254
+ created_at?: string;
3255
+ created_by?: string | null;
3256
+ encrypted_value: string;
3257
+ id?: string;
3258
+ name: string;
3259
+ organization_id: string;
3260
+ provider?: string | null;
3261
+ type?: string;
3262
+ updated_at?: string;
3263
+ };
3264
+ Update: {
3265
+ created_at?: string;
3266
+ created_by?: string | null;
3267
+ encrypted_value?: string;
3268
+ id?: string;
3269
+ name?: string;
3270
+ organization_id?: string;
3271
+ provider?: string | null;
3272
+ type?: string;
3273
+ updated_at?: string;
3274
+ };
3275
+ Relationships: [{
3276
+ foreignKeyName: "credentials_created_by_fkey";
3277
+ columns: ["created_by"];
3278
+ isOneToOne: false;
3279
+ referencedRelation: "users";
3280
+ referencedColumns: ["id"];
3281
+ }, {
3282
+ foreignKeyName: "credentials_organization_id_fkey";
3283
+ columns: ["organization_id"];
3284
+ isOneToOne: false;
3285
+ referencedRelation: "organizations";
3286
+ referencedColumns: ["id"];
3287
+ }];
3288
+ };
3289
+ deployments: {
3290
+ Row: {
3291
+ compiled_docs: Json | null;
3292
+ created_at: string;
3293
+ deployment_version: string | null;
3294
+ documentation: Json | null;
3295
+ error_message: string | null;
3296
+ id: string;
3297
+ organization_id: string;
3298
+ pid: number | null;
3299
+ port: number | null;
3300
+ sdk_version: string;
3301
+ status: string;
3302
+ tarball_path: string | null;
3303
+ updated_at: string;
3304
+ };
3305
+ Insert: {
3306
+ compiled_docs?: Json | null;
3307
+ created_at?: string;
3308
+ deployment_version?: string | null;
3309
+ documentation?: Json | null;
3310
+ error_message?: string | null;
3311
+ id?: string;
3312
+ organization_id: string;
3313
+ pid?: number | null;
3314
+ port?: number | null;
3315
+ sdk_version: string;
3316
+ status?: string;
3317
+ tarball_path?: string | null;
3318
+ updated_at?: string;
3319
+ };
3320
+ Update: {
3321
+ compiled_docs?: Json | null;
3322
+ created_at?: string;
3323
+ deployment_version?: string | null;
3324
+ documentation?: Json | null;
3325
+ error_message?: string | null;
3326
+ id?: string;
3327
+ organization_id?: string;
3328
+ pid?: number | null;
3329
+ port?: number | null;
3330
+ sdk_version?: string;
3331
+ status?: string;
3332
+ tarball_path?: string | null;
3333
+ updated_at?: string;
3334
+ };
3335
+ Relationships: [{
3336
+ foreignKeyName: "deployments_organization_id_fkey";
3337
+ columns: ["organization_id"];
3338
+ isOneToOne: false;
3339
+ referencedRelation: "organizations";
3340
+ referencedColumns: ["id"];
3341
+ }];
3342
+ };
3343
+ execution_errors: {
3344
+ Row: {
3345
+ created_at: string | null;
3346
+ error_category: string;
3347
+ error_message: string;
3348
+ error_severity: string;
3349
+ error_stack_trace: string | null;
3350
+ error_type: string;
3351
+ execution_id: string;
3352
+ id: string;
3353
+ metadata: Json | null;
3354
+ occurred_at: string;
3355
+ organization_id: string;
3356
+ resolved: boolean;
3357
+ resolved_at: string | null;
3358
+ resolved_by: string | null;
3359
+ };
3360
+ Insert: {
3361
+ created_at?: string | null;
3362
+ error_category: string;
3363
+ error_message: string;
3364
+ error_severity: string;
3365
+ error_stack_trace?: string | null;
3366
+ error_type: string;
3367
+ execution_id: string;
3368
+ id?: string;
3369
+ metadata?: Json | null;
3370
+ occurred_at?: string;
3371
+ organization_id: string;
3372
+ resolved?: boolean;
3373
+ resolved_at?: string | null;
3374
+ resolved_by?: string | null;
3375
+ };
3376
+ Update: {
3377
+ created_at?: string | null;
3378
+ error_category?: string;
3379
+ error_message?: string;
3380
+ error_severity?: string;
3381
+ error_stack_trace?: string | null;
3382
+ error_type?: string;
3383
+ execution_id?: string;
3384
+ id?: string;
3385
+ metadata?: Json | null;
3386
+ occurred_at?: string;
3387
+ organization_id?: string;
3388
+ resolved?: boolean;
3389
+ resolved_at?: string | null;
3390
+ resolved_by?: string | null;
3391
+ };
3392
+ Relationships: [{
3393
+ foreignKeyName: "execution_errors_execution_id_fkey";
3394
+ columns: ["execution_id"];
3395
+ isOneToOne: false;
3396
+ referencedRelation: "execution_logs";
3397
+ referencedColumns: ["execution_id"];
3398
+ }, {
3399
+ foreignKeyName: "execution_errors_organization_id_fkey";
3400
+ columns: ["organization_id"];
3401
+ isOneToOne: false;
3402
+ referencedRelation: "organizations";
3403
+ referencedColumns: ["id"];
3404
+ }, {
3405
+ foreignKeyName: "execution_errors_resolved_by_fkey";
3406
+ columns: ["resolved_by"];
3407
+ isOneToOne: false;
3408
+ referencedRelation: "users";
3409
+ referencedColumns: ["id"];
3410
+ }];
3411
+ };
3412
+ execution_logs: {
3413
+ Row: {
3414
+ api_version: string | null;
3415
+ completed_at: string | null;
3416
+ created_at: string | null;
3417
+ error: string | null;
3418
+ execution_id: string;
3419
+ input: Json | null;
3420
+ last_heartbeat_at: string | null;
3421
+ logs: Json | null;
3422
+ organization_id: string;
3423
+ origin_execution_id: string | null;
3424
+ output: Json | null;
3425
+ resource_id: string;
3426
+ resource_status: string;
3427
+ resource_type: string;
3428
+ resource_version: string | null;
3429
+ sdk_version: string | null;
3430
+ session_id: string | null;
3431
+ session_turn_number: number | null;
3432
+ started_at: string;
3433
+ status: string;
3434
+ trigger_type: string | null;
3435
+ updated_at: string | null;
3436
+ user_id: string | null;
3437
+ };
3438
+ Insert: {
3439
+ api_version?: string | null;
3440
+ completed_at?: string | null;
3441
+ created_at?: string | null;
3442
+ error?: string | null;
3443
+ execution_id?: string;
3444
+ input?: Json | null;
3445
+ last_heartbeat_at?: string | null;
3446
+ logs?: Json | null;
3447
+ organization_id: string;
3448
+ origin_execution_id?: string | null;
3449
+ output?: Json | null;
3450
+ resource_id: string;
3451
+ resource_status?: string;
3452
+ resource_type?: string;
3453
+ resource_version?: string | null;
3454
+ sdk_version?: string | null;
3455
+ session_id?: string | null;
3456
+ session_turn_number?: number | null;
3457
+ started_at?: string;
3458
+ status: string;
3459
+ trigger_type?: string | null;
3460
+ updated_at?: string | null;
3461
+ user_id?: string | null;
3462
+ };
3463
+ Update: {
3464
+ api_version?: string | null;
3465
+ completed_at?: string | null;
3466
+ created_at?: string | null;
3467
+ error?: string | null;
3468
+ execution_id?: string;
3469
+ input?: Json | null;
3470
+ last_heartbeat_at?: string | null;
3471
+ logs?: Json | null;
3472
+ organization_id?: string;
3473
+ origin_execution_id?: string | null;
3474
+ output?: Json | null;
3475
+ resource_id?: string;
3476
+ resource_status?: string;
3477
+ resource_type?: string;
3478
+ resource_version?: string | null;
3479
+ sdk_version?: string | null;
3480
+ session_id?: string | null;
3481
+ session_turn_number?: number | null;
3482
+ started_at?: string;
3483
+ status?: string;
3484
+ trigger_type?: string | null;
3485
+ updated_at?: string | null;
3486
+ user_id?: string | null;
3487
+ };
3488
+ Relationships: [{
3489
+ foreignKeyName: "execution_history_organization_id_fkey";
3490
+ columns: ["organization_id"];
3491
+ isOneToOne: false;
3492
+ referencedRelation: "organizations";
3493
+ referencedColumns: ["id"];
3494
+ }, {
3495
+ foreignKeyName: "execution_logs_origin_execution_id_fkey";
3496
+ columns: ["origin_execution_id"];
3497
+ isOneToOne: false;
3498
+ referencedRelation: "execution_logs";
3499
+ referencedColumns: ["execution_id"];
3500
+ }, {
3501
+ foreignKeyName: "execution_logs_session_id_fkey";
3502
+ columns: ["session_id"];
3503
+ isOneToOne: false;
3504
+ referencedRelation: "sessions";
3505
+ referencedColumns: ["session_id"];
3506
+ }, {
3507
+ foreignKeyName: "execution_logs_user_id_fkey";
3508
+ columns: ["user_id"];
3509
+ isOneToOne: false;
3510
+ referencedRelation: "users";
3511
+ referencedColumns: ["id"];
3512
+ }];
3513
+ };
3514
+ execution_metrics: {
3515
+ Row: {
3516
+ ai_call_count: number;
3517
+ ai_calls: Json | null;
3518
+ automation_savings_usd: number | null;
3519
+ created_at: string | null;
3520
+ duration_ms: number | null;
3521
+ execution_id: string;
3522
+ organization_id: string;
3523
+ resource_id: string;
3524
+ total_cost_usd: number;
3525
+ total_input_tokens: number;
3526
+ total_output_tokens: number;
3527
+ };
3528
+ Insert: {
3529
+ ai_call_count: number;
3530
+ ai_calls?: Json | null;
3531
+ automation_savings_usd?: number | null;
3532
+ created_at?: string | null;
3533
+ duration_ms?: number | null;
3534
+ execution_id: string;
3535
+ organization_id: string;
3536
+ resource_id: string;
3537
+ total_cost_usd: number;
3538
+ total_input_tokens: number;
3539
+ total_output_tokens: number;
3540
+ };
3541
+ Update: {
3542
+ ai_call_count?: number;
3543
+ ai_calls?: Json | null;
3544
+ automation_savings_usd?: number | null;
3545
+ created_at?: string | null;
3546
+ duration_ms?: number | null;
3547
+ execution_id?: string;
3548
+ organization_id?: string;
3549
+ resource_id?: string;
3550
+ total_cost_usd?: number;
3551
+ total_input_tokens?: number;
3552
+ total_output_tokens?: number;
3553
+ };
3554
+ Relationships: [{
3555
+ foreignKeyName: "execution_metrics_execution_id_fkey";
3556
+ columns: ["execution_id"];
3557
+ isOneToOne: true;
3558
+ referencedRelation: "execution_logs";
3559
+ referencedColumns: ["execution_id"];
3560
+ }, {
3561
+ foreignKeyName: "execution_metrics_organization_id_fkey";
3562
+ columns: ["organization_id"];
3563
+ isOneToOne: false;
3564
+ referencedRelation: "organizations";
3565
+ referencedColumns: ["id"];
3566
+ }];
3567
+ };
3568
+ notifications: {
3569
+ Row: {
3570
+ action_url: string | null;
3571
+ category: string;
3572
+ created_at: string | null;
3573
+ id: string;
3574
+ message: string;
3575
+ organization_id: string;
3576
+ read: boolean | null;
3577
+ read_at: string | null;
3578
+ title: string;
3579
+ user_id: string;
3580
+ };
3581
+ Insert: {
3582
+ action_url?: string | null;
3583
+ category: string;
3584
+ created_at?: string | null;
3585
+ id?: string;
3586
+ message: string;
3587
+ organization_id: string;
3588
+ read?: boolean | null;
3589
+ read_at?: string | null;
3590
+ title: string;
3591
+ user_id: string;
3592
+ };
3593
+ Update: {
3594
+ action_url?: string | null;
3595
+ category?: string;
3596
+ created_at?: string | null;
3597
+ id?: string;
3598
+ message?: string;
3599
+ organization_id?: string;
3600
+ read?: boolean | null;
3601
+ read_at?: string | null;
3602
+ title?: string;
3603
+ user_id?: string;
3604
+ };
3605
+ Relationships: [{
3606
+ foreignKeyName: "notifications_organization_id_fkey";
3607
+ columns: ["organization_id"];
3608
+ isOneToOne: false;
3609
+ referencedRelation: "organizations";
3610
+ referencedColumns: ["id"];
3611
+ }, {
3612
+ foreignKeyName: "notifications_user_id_fkey";
3613
+ columns: ["user_id"];
3614
+ isOneToOne: false;
3615
+ referencedRelation: "users";
3616
+ referencedColumns: ["id"];
3617
+ }];
3618
+ };
3619
+ org_invitations: {
3620
+ Row: {
3621
+ accept_invitation_url: string | null;
3622
+ accepted_at: string | null;
3623
+ created_at: string | null;
3624
+ email: string;
3625
+ expires_at: string;
3626
+ id: string;
3627
+ invitation_state: string | null;
3628
+ invitation_token: string | null;
3629
+ inviter_user_id: string | null;
3630
+ organization_id: string | null;
3631
+ revoked_at: string | null;
3632
+ role_slug: string | null;
3633
+ updated_at: string | null;
3634
+ workos_invitation_id: string;
3635
+ };
3636
+ Insert: {
3637
+ accept_invitation_url?: string | null;
3638
+ accepted_at?: string | null;
3639
+ created_at?: string | null;
3640
+ email: string;
3641
+ expires_at: string;
3642
+ id?: string;
3643
+ invitation_state?: string | null;
3644
+ invitation_token?: string | null;
3645
+ inviter_user_id?: string | null;
3646
+ organization_id?: string | null;
3647
+ revoked_at?: string | null;
3648
+ role_slug?: string | null;
3649
+ updated_at?: string | null;
3650
+ workos_invitation_id: string;
3651
+ };
3652
+ Update: {
3653
+ accept_invitation_url?: string | null;
3654
+ accepted_at?: string | null;
3655
+ created_at?: string | null;
3656
+ email?: string;
3657
+ expires_at?: string;
3658
+ id?: string;
3659
+ invitation_state?: string | null;
3660
+ invitation_token?: string | null;
3661
+ inviter_user_id?: string | null;
3662
+ organization_id?: string | null;
3663
+ revoked_at?: string | null;
3664
+ role_slug?: string | null;
3665
+ updated_at?: string | null;
3666
+ workos_invitation_id?: string;
3667
+ };
3668
+ Relationships: [{
3669
+ foreignKeyName: "org_invitations_inviter_user_id_fkey";
3670
+ columns: ["inviter_user_id"];
3671
+ isOneToOne: false;
3672
+ referencedRelation: "users";
3673
+ referencedColumns: ["id"];
3674
+ }, {
3675
+ foreignKeyName: "org_invitations_organization_id_fkey";
3676
+ columns: ["organization_id"];
3677
+ isOneToOne: false;
3678
+ referencedRelation: "organizations";
3679
+ referencedColumns: ["id"];
3680
+ }];
3681
+ };
3682
+ org_memberships: {
3683
+ Row: {
3684
+ config: Json;
3685
+ created_at: string | null;
3686
+ id: string;
3687
+ membership_status: string | null;
3688
+ organization_id: string;
3689
+ role_slug: string | null;
3690
+ updated_at: string | null;
3691
+ user_id: string;
3692
+ workos_membership_id: string | null;
3693
+ };
3694
+ Insert: {
3695
+ config?: Json;
3696
+ created_at?: string | null;
3697
+ id?: string;
3698
+ membership_status?: string | null;
3699
+ organization_id: string;
3700
+ role_slug?: string | null;
3701
+ updated_at?: string | null;
3702
+ user_id: string;
3703
+ workos_membership_id?: string | null;
3704
+ };
3705
+ Update: {
3706
+ config?: Json;
3707
+ created_at?: string | null;
3708
+ id?: string;
3709
+ membership_status?: string | null;
3710
+ organization_id?: string;
3711
+ role_slug?: string | null;
3712
+ updated_at?: string | null;
3713
+ user_id?: string;
3714
+ workos_membership_id?: string | null;
3715
+ };
3716
+ Relationships: [{
3717
+ foreignKeyName: "org_memberships_organization_id_fkey";
3718
+ columns: ["organization_id"];
3719
+ isOneToOne: false;
3720
+ referencedRelation: "organizations";
3721
+ referencedColumns: ["id"];
3722
+ }, {
3723
+ foreignKeyName: "org_memberships_user_id_fkey";
3724
+ columns: ["user_id"];
3725
+ isOneToOne: false;
3726
+ referencedRelation: "users";
3727
+ referencedColumns: ["id"];
3728
+ }];
3729
+ };
3730
+ organizations: {
3731
+ Row: {
3732
+ config: Json;
3733
+ created_at: string;
3734
+ id: string;
3735
+ is_test: boolean;
3736
+ metadata: Json;
3737
+ name: string;
3738
+ status: string;
3739
+ updated_at: string;
3740
+ workos_org_id: string;
3741
+ };
3742
+ Insert: {
3743
+ config?: Json;
3744
+ created_at?: string;
3745
+ id?: string;
3746
+ is_test?: boolean;
3747
+ metadata?: Json;
3748
+ name: string;
3749
+ status?: string;
3750
+ updated_at?: string;
3751
+ workos_org_id: string;
3752
+ };
3753
+ Update: {
3754
+ config?: Json;
3755
+ created_at?: string;
3756
+ id?: string;
3757
+ is_test?: boolean;
3758
+ metadata?: Json;
3759
+ name?: string;
3760
+ status?: string;
3761
+ updated_at?: string;
3762
+ workos_org_id?: string;
3763
+ };
3764
+ Relationships: [];
3765
+ };
3766
+ session_messages: {
3767
+ Row: {
3768
+ created_at: string | null;
3769
+ id: string;
3770
+ message: string;
3771
+ message_index: number | null;
3772
+ message_type: string | null;
3773
+ metadata: Json | null;
3774
+ role: string;
3775
+ session_id: string;
3776
+ session_turn_number: number;
3777
+ };
3778
+ Insert: {
3779
+ created_at?: string | null;
3780
+ id: string;
3781
+ message: string;
3782
+ message_index?: number | null;
3783
+ message_type?: string | null;
3784
+ metadata?: Json | null;
3785
+ role: string;
3786
+ session_id: string;
3787
+ session_turn_number: number;
3788
+ };
3789
+ Update: {
3790
+ created_at?: string | null;
3791
+ id?: string;
3792
+ message?: string;
3793
+ message_index?: number | null;
3794
+ message_type?: string | null;
3795
+ metadata?: Json | null;
3796
+ role?: string;
3797
+ session_id?: string;
3798
+ session_turn_number?: number;
3799
+ };
3800
+ Relationships: [{
3801
+ foreignKeyName: "session_messages_session_id_fkey";
3802
+ columns: ["session_id"];
3803
+ isOneToOne: false;
3804
+ referencedRelation: "sessions";
3805
+ referencedColumns: ["session_id"];
3806
+ }];
3807
+ };
3808
+ sessions: {
3809
+ Row: {
3810
+ context_window_size: number;
3811
+ created_at: string | null;
3812
+ cumulative_input_tokens: number;
3813
+ cumulative_output_tokens: number;
3814
+ deleted_at: string | null;
3815
+ ended_at: string | null;
3816
+ memory_snapshot: Json;
3817
+ metadata: Json | null;
3818
+ organization_id: string;
3819
+ resource_id: string;
3820
+ session_id: string;
3821
+ session_total_turns: number | null;
3822
+ updated_at: string | null;
3823
+ user_id: string | null;
3824
+ };
3825
+ Insert: {
3826
+ context_window_size?: number;
3827
+ created_at?: string | null;
3828
+ cumulative_input_tokens?: number;
3829
+ cumulative_output_tokens?: number;
3830
+ deleted_at?: string | null;
3831
+ ended_at?: string | null;
3832
+ memory_snapshot: Json;
3833
+ metadata?: Json | null;
3834
+ organization_id: string;
3835
+ resource_id: string;
3836
+ session_id?: string;
3837
+ session_total_turns?: number | null;
3838
+ updated_at?: string | null;
3839
+ user_id?: string | null;
3840
+ };
3841
+ Update: {
3842
+ context_window_size?: number;
3843
+ created_at?: string | null;
3844
+ cumulative_input_tokens?: number;
3845
+ cumulative_output_tokens?: number;
3846
+ deleted_at?: string | null;
3847
+ ended_at?: string | null;
3848
+ memory_snapshot?: Json;
3849
+ metadata?: Json | null;
3850
+ organization_id?: string;
3851
+ resource_id?: string;
3852
+ session_id?: string;
3853
+ session_total_turns?: number | null;
3854
+ updated_at?: string | null;
3855
+ user_id?: string | null;
3856
+ };
3857
+ Relationships: [{
3858
+ foreignKeyName: "fk_organization";
3859
+ columns: ["organization_id"];
3860
+ isOneToOne: false;
3861
+ referencedRelation: "organizations";
3862
+ referencedColumns: ["id"];
3863
+ }, {
3864
+ foreignKeyName: "fk_user";
3865
+ columns: ["user_id"];
3866
+ isOneToOne: false;
3867
+ referencedRelation: "users";
3868
+ referencedColumns: ["id"];
3869
+ }];
3870
+ };
3871
+ task_schedules: {
3872
+ Row: {
3873
+ created_at: string;
3874
+ current_step: number;
3875
+ description: string | null;
3876
+ id: string;
3877
+ idempotency_key: string | null;
3878
+ last_execution_id: string | null;
3879
+ last_run_at: string | null;
3880
+ max_retries: number;
3881
+ metadata: Json | null;
3882
+ name: string;
3883
+ next_run_at: string | null;
3884
+ organization_id: string;
3885
+ origin_execution_id: string | null;
3886
+ origin_resource_id: string | null;
3887
+ origin_resource_type: string | null;
3888
+ retry_count: number;
3889
+ schedule_config: Json;
3890
+ status: string;
3891
+ target_resource_id: string;
3892
+ target_resource_type: string;
3893
+ updated_at: string;
3894
+ };
3895
+ Insert: {
3896
+ created_at?: string;
3897
+ current_step?: number;
3898
+ description?: string | null;
3899
+ id?: string;
3900
+ idempotency_key?: string | null;
3901
+ last_execution_id?: string | null;
3902
+ last_run_at?: string | null;
3903
+ max_retries?: number;
3904
+ metadata?: Json | null;
3905
+ name: string;
3906
+ next_run_at?: string | null;
3907
+ organization_id: string;
3908
+ origin_execution_id?: string | null;
3909
+ origin_resource_id?: string | null;
3910
+ origin_resource_type?: string | null;
3911
+ retry_count?: number;
3912
+ schedule_config: Json;
3913
+ status?: string;
3914
+ target_resource_id: string;
3915
+ target_resource_type: string;
3916
+ updated_at?: string;
3917
+ };
3918
+ Update: {
3919
+ created_at?: string;
3920
+ current_step?: number;
3921
+ description?: string | null;
3922
+ id?: string;
3923
+ idempotency_key?: string | null;
3924
+ last_execution_id?: string | null;
3925
+ last_run_at?: string | null;
3926
+ max_retries?: number;
3927
+ metadata?: Json | null;
3928
+ name?: string;
3929
+ next_run_at?: string | null;
3930
+ organization_id?: string;
3931
+ origin_execution_id?: string | null;
3932
+ origin_resource_id?: string | null;
3933
+ origin_resource_type?: string | null;
3934
+ retry_count?: number;
3935
+ schedule_config?: Json;
3936
+ status?: string;
3937
+ target_resource_id?: string;
3938
+ target_resource_type?: string;
3939
+ updated_at?: string;
3940
+ };
3941
+ Relationships: [{
3942
+ foreignKeyName: "task_schedules_organization_id_fkey";
3943
+ columns: ["organization_id"];
3944
+ isOneToOne: false;
3945
+ referencedRelation: "organizations";
3946
+ referencedColumns: ["id"];
3947
+ }];
3948
+ };
3949
+ training_assessments: {
3950
+ Row: {
3951
+ answers: Json | null;
3952
+ assessment_slug: string;
3953
+ attempted_at: string;
3954
+ course_slug: string;
3955
+ id: string;
3956
+ organization_id: string;
3957
+ passed: boolean;
3958
+ score: number;
3959
+ user_id: string;
3960
+ };
3961
+ Insert: {
3962
+ answers?: Json | null;
3963
+ assessment_slug: string;
3964
+ attempted_at?: string;
3965
+ course_slug: string;
3966
+ id?: string;
3967
+ organization_id: string;
3968
+ passed: boolean;
3969
+ score: number;
3970
+ user_id: string;
3971
+ };
3972
+ Update: {
3973
+ answers?: Json | null;
3974
+ assessment_slug?: string;
3975
+ attempted_at?: string;
3976
+ course_slug?: string;
3977
+ id?: string;
3978
+ organization_id?: string;
3979
+ passed?: boolean;
3980
+ score?: number;
3981
+ user_id?: string;
3982
+ };
3983
+ Relationships: [{
3984
+ foreignKeyName: "training_assessments_organization_id_fkey";
3985
+ columns: ["organization_id"];
3986
+ isOneToOne: false;
3987
+ referencedRelation: "organizations";
3988
+ referencedColumns: ["id"];
3989
+ }, {
3990
+ foreignKeyName: "training_assessments_user_id_fkey";
3991
+ columns: ["user_id"];
3992
+ isOneToOne: false;
3993
+ referencedRelation: "users";
3994
+ referencedColumns: ["id"];
3995
+ }];
3996
+ };
3997
+ training_certifications: {
3998
+ Row: {
3999
+ awarded_at: string;
4000
+ certification_slug: string;
4001
+ id: string;
4002
+ organization_id: string;
4003
+ user_id: string;
4004
+ };
4005
+ Insert: {
4006
+ awarded_at?: string;
4007
+ certification_slug: string;
4008
+ id?: string;
4009
+ organization_id: string;
4010
+ user_id: string;
4011
+ };
4012
+ Update: {
4013
+ awarded_at?: string;
4014
+ certification_slug?: string;
4015
+ id?: string;
4016
+ organization_id?: string;
4017
+ user_id?: string;
4018
+ };
4019
+ Relationships: [{
4020
+ foreignKeyName: "training_certifications_organization_id_fkey";
4021
+ columns: ["organization_id"];
4022
+ isOneToOne: false;
4023
+ referencedRelation: "organizations";
4024
+ referencedColumns: ["id"];
4025
+ }, {
4026
+ foreignKeyName: "training_certifications_user_id_fkey";
4027
+ columns: ["user_id"];
4028
+ isOneToOne: false;
4029
+ referencedRelation: "users";
4030
+ referencedColumns: ["id"];
4031
+ }];
4032
+ };
4033
+ training_progress: {
4034
+ Row: {
4035
+ completed_at: string;
4036
+ course_slug: string;
4037
+ id: string;
4038
+ lesson_slug: string;
4039
+ organization_id: string;
4040
+ user_id: string;
4041
+ };
4042
+ Insert: {
4043
+ completed_at?: string;
4044
+ course_slug: string;
4045
+ id?: string;
4046
+ lesson_slug: string;
4047
+ organization_id: string;
4048
+ user_id: string;
4049
+ };
4050
+ Update: {
4051
+ completed_at?: string;
4052
+ course_slug?: string;
4053
+ id?: string;
4054
+ lesson_slug?: string;
4055
+ organization_id?: string;
4056
+ user_id?: string;
4057
+ };
4058
+ Relationships: [{
4059
+ foreignKeyName: "training_progress_organization_id_fkey";
4060
+ columns: ["organization_id"];
4061
+ isOneToOne: false;
4062
+ referencedRelation: "organizations";
4063
+ referencedColumns: ["id"];
4064
+ }, {
4065
+ foreignKeyName: "training_progress_user_id_fkey";
4066
+ columns: ["user_id"];
4067
+ isOneToOne: false;
4068
+ referencedRelation: "users";
4069
+ referencedColumns: ["id"];
4070
+ }];
4071
+ };
4072
+ users: {
4073
+ Row: {
4074
+ config: Json;
4075
+ created_at: string;
4076
+ display_name: string | null;
4077
+ email: string;
4078
+ first_name: string | null;
4079
+ id: string;
4080
+ is_active: boolean;
4081
+ is_platform_admin: boolean | null;
4082
+ last_login_at: string | null;
4083
+ last_name: string | null;
4084
+ last_visited_org: string | null;
4085
+ profile_picture_url: string | null;
4086
+ updated_at: string;
4087
+ workos_user_id: string | null;
4088
+ };
4089
+ Insert: {
4090
+ config?: Json;
4091
+ created_at?: string;
4092
+ display_name?: string | null;
4093
+ email: string;
4094
+ first_name?: string | null;
4095
+ id?: string;
4096
+ is_active?: boolean;
4097
+ is_platform_admin?: boolean | null;
4098
+ last_login_at?: string | null;
4099
+ last_name?: string | null;
4100
+ last_visited_org?: string | null;
4101
+ profile_picture_url?: string | null;
4102
+ updated_at?: string;
4103
+ workos_user_id?: string | null;
4104
+ };
4105
+ Update: {
4106
+ config?: Json;
4107
+ created_at?: string;
4108
+ display_name?: string | null;
4109
+ email?: string;
4110
+ first_name?: string | null;
4111
+ id?: string;
4112
+ is_active?: boolean;
4113
+ is_platform_admin?: boolean | null;
4114
+ last_login_at?: string | null;
4115
+ last_name?: string | null;
4116
+ last_visited_org?: string | null;
4117
+ profile_picture_url?: string | null;
4118
+ updated_at?: string;
4119
+ workos_user_id?: string | null;
4120
+ };
4121
+ Relationships: [{
4122
+ foreignKeyName: "user_profiles_last_visited_org_fkey";
4123
+ columns: ["last_visited_org"];
4124
+ isOneToOne: false;
4125
+ referencedRelation: "organizations";
4126
+ referencedColumns: ["id"];
4127
+ }];
4128
+ };
4129
+ webhook_endpoints: {
4130
+ Row: {
4131
+ created_at: string;
4132
+ description: string | null;
4133
+ id: string;
4134
+ key: string;
4135
+ last_triggered_at: string | null;
4136
+ name: string;
4137
+ organization_id: string;
4138
+ request_count: number;
4139
+ resource_id: string | null;
4140
+ status: string;
4141
+ updated_at: string;
4142
+ };
4143
+ Insert: {
4144
+ created_at?: string;
4145
+ description?: string | null;
4146
+ id?: string;
4147
+ key: string;
4148
+ last_triggered_at?: string | null;
4149
+ name: string;
4150
+ organization_id: string;
4151
+ request_count?: number;
4152
+ resource_id?: string | null;
4153
+ status?: string;
4154
+ updated_at?: string;
4155
+ };
4156
+ Update: {
4157
+ created_at?: string;
4158
+ description?: string | null;
4159
+ id?: string;
4160
+ key?: string;
4161
+ last_triggered_at?: string | null;
4162
+ name?: string;
4163
+ organization_id?: string;
4164
+ request_count?: number;
4165
+ resource_id?: string | null;
4166
+ status?: string;
4167
+ updated_at?: string;
4168
+ };
4169
+ Relationships: [{
4170
+ foreignKeyName: "webhook_endpoints_organization_id_fkey";
4171
+ columns: ["organization_id"];
4172
+ isOneToOne: false;
4173
+ referencedRelation: "organizations";
4174
+ referencedColumns: ["id"];
4175
+ }];
4176
+ };
4177
+ };
4178
+ Views: { [_ in never]: never; };
4179
+ Functions: {
4180
+ acq_default_checklist: {
4181
+ Args: {
4182
+ p_platform: string;
4183
+ };
4184
+ Returns: Json;
4185
+ };
4186
+ append_deal_activity: {
4187
+ Args: {
4188
+ p_activity: Json;
4189
+ p_deal_id: string;
4190
+ p_organization_id: string;
4191
+ };
4192
+ Returns: undefined;
4193
+ };
4194
+ auth_jwt_claims: {
4195
+ Args: never;
4196
+ Returns: Json;
4197
+ };
4198
+ auth_uid_safe: {
4199
+ Args: never;
4200
+ Returns: string;
4201
+ };
4202
+ current_user_is_platform_admin: {
4203
+ Args: never;
4204
+ Returns: boolean;
4205
+ };
4206
+ current_user_supabase_id: {
4207
+ Args: never;
4208
+ Returns: string;
4209
+ };
4210
+ detect_stalled_executions: {
4211
+ Args: never;
4212
+ Returns: undefined;
4213
+ };
4214
+ execute_session_turn: {
4215
+ Args: {
4216
+ p_session_id: string;
4217
+ };
4218
+ Returns: {
4219
+ created_at: string;
4220
+ ended_at: string;
4221
+ memory_snapshot: Json;
4222
+ metadata: Json;
4223
+ organization_id: string;
4224
+ resource_id: string;
4225
+ session_id: string;
4226
+ session_total_turns: number;
4227
+ updated_at: string;
4228
+ user_id: string;
4229
+ }[];
4230
+ };
4231
+ get_storage_org_id: {
4232
+ Args: {
4233
+ file_path: string;
4234
+ };
4235
+ Returns: string;
4236
+ };
4237
+ get_workos_user_id: {
4238
+ Args: never;
4239
+ Returns: string;
4240
+ };
4241
+ is_org_admin: {
4242
+ Args: {
4243
+ org_id: string;
4244
+ };
4245
+ Returns: boolean;
4246
+ };
4247
+ is_org_member: {
4248
+ Args: {
4249
+ org_id: string;
4250
+ };
4251
+ Returns: boolean;
4252
+ };
4253
+ link_workos_membership_on_accept: {
4254
+ Args: {
4255
+ p_email: string;
4256
+ p_organization_id: string;
4257
+ p_workos_membership_id: string;
4258
+ };
4259
+ Returns: boolean;
4260
+ };
4261
+ pre_provision_invited_user: {
4262
+ Args: {
4263
+ p_email: string;
4264
+ p_organization_id: string;
4265
+ p_role_slug?: string;
4266
+ };
4267
+ Returns: Json;
4268
+ };
4269
+ process_due_schedules: {
4270
+ Args: never;
4271
+ Returns: Json;
4272
+ };
4273
+ upsert_user_profile: {
4274
+ Args: never;
4275
+ Returns: {
4276
+ profile_display_name: string;
4277
+ profile_email: string;
4278
+ profile_id: string;
4279
+ profile_workos_user_id: string;
4280
+ }[];
4281
+ };
4282
+ };
4283
+ Enums: { [_ in never]: never; };
4284
+ CompositeTypes: { [_ in never]: never; };
4285
+ }, {
4286
+ PostgrestVersion: "12.2.3 (519615d)";
4287
+ }>;
4288
+
4289
+ export { getSupabaseClient, useSupabase };