@elevasis/ui 2.23.0 → 2.24.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 (57) hide show
  1. package/dist/app/index.d.ts +2915 -0
  2. package/dist/app/index.js +5 -4
  3. package/dist/{chunk-3HEUGBOT.js → chunk-2WZ635SS.js} +2 -2
  4. package/dist/{chunk-D3KQAABP.js → chunk-4NWNS7TX.js} +1 -1
  5. package/dist/{chunk-7PGEGSUM.js → chunk-FUEXGRFR.js} +2 -2
  6. package/dist/{chunk-6IA2OMAE.js → chunk-HC2KV6BU.js} +9 -0
  7. package/dist/{chunk-YU6MBDVO.js → chunk-KCJ6VATY.js} +4 -68
  8. package/dist/{chunk-FXWETLEB.js → chunk-KLFIJDTD.js} +1 -1
  9. package/dist/{chunk-PXGSJNBH.js → chunk-M2HWJY6O.js} +704 -375
  10. package/dist/{chunk-N6WLOWOD.js → chunk-MTR6AN2C.js} +3 -12
  11. package/dist/chunk-OWHQ65EQ.js +211 -0
  12. package/dist/{chunk-XOTJNW4Q.js → chunk-QIW6OCEI.js} +18 -1
  13. package/dist/{chunk-GUJUK6EH.js → chunk-QULLZ5PE.js} +172 -2
  14. package/dist/{chunk-QZJM3RYI.js → chunk-SNHGSCKH.js} +1 -1
  15. package/dist/{chunk-LVUCBY7X.js → chunk-UDJE54WN.js} +85 -3
  16. package/dist/{chunk-EPV7NU2E.js → chunk-VGNAV3TH.js} +385 -188
  17. package/dist/{chunk-PTUOINQ2.js → chunk-YBZT7MJR.js} +3 -3
  18. package/dist/{chunk-SQ5JGELM.js → chunk-ZDKQNQ4X.js} +19 -1
  19. package/dist/components/index.d.ts +488 -452
  20. package/dist/components/index.js +58 -22
  21. package/dist/components/navigation/index.js +2 -2
  22. package/dist/features/auth/index.d.ts +463 -377
  23. package/dist/features/crm/index.d.ts +459 -379
  24. package/dist/features/crm/index.js +8 -8
  25. package/dist/features/dashboard/index.js +8 -8
  26. package/dist/features/delivery/index.d.ts +457 -371
  27. package/dist/features/delivery/index.js +8 -8
  28. package/dist/features/lead-gen/index.d.ts +213 -65
  29. package/dist/features/lead-gen/index.js +9 -8
  30. package/dist/features/monitoring/index.js +9 -9
  31. package/dist/features/monitoring/requests/index.js +7 -7
  32. package/dist/features/operations/index.js +11 -10
  33. package/dist/features/settings/index.d.ts +463 -377
  34. package/dist/features/settings/index.js +9 -9
  35. package/dist/hooks/delivery/index.d.ts +457 -371
  36. package/dist/hooks/index.d.ts +936 -718
  37. package/dist/hooks/index.js +7 -7
  38. package/dist/hooks/published.d.ts +936 -718
  39. package/dist/hooks/published.js +7 -7
  40. package/dist/index.d.ts +1313 -1027
  41. package/dist/index.js +8 -8
  42. package/dist/initialization/index.d.ts +463 -377
  43. package/dist/organization/index.d.ts +11 -1
  44. package/dist/organization/index.js +2 -2
  45. package/dist/profile/index.d.ts +463 -377
  46. package/dist/provider/index.d.ts +3132 -169
  47. package/dist/provider/index.js +6 -6
  48. package/dist/provider/published.d.ts +3098 -168
  49. package/dist/provider/published.js +3 -3
  50. package/dist/supabase/index.d.ts +559 -389
  51. package/dist/test-utils/index.d.ts +21 -1
  52. package/dist/test-utils/index.js +13 -4
  53. package/dist/theme/index.js +2 -2
  54. package/dist/types/index.d.ts +463 -377
  55. package/package.json +4 -4
  56. package/src/test-utils/README.md +2 -0
  57. /package/dist/{chunk-ZBCTB5CA.js → chunk-EIOJNUPL.js} +0 -0
@@ -1,8 +1,2921 @@
1
1
  import { ReactNode, ComponentType } from 'react';
2
2
  import { AnyRouter } from '@tanstack/react-router';
3
3
  import { QueryClient } from '@tanstack/react-query';
4
+ import { z } from 'zod';
4
5
  import { MantineThemeOverride } from '@mantine/core';
5
6
 
7
+ type Json = string | number | boolean | null | {
8
+ [key: string]: Json | undefined;
9
+ } | Json[];
10
+ type Database = {
11
+ __InternalSupabase: {
12
+ PostgrestVersion: '12.2.3 (519615d)';
13
+ };
14
+ public: {
15
+ Tables: {
16
+ acq_artifacts: {
17
+ Row: {
18
+ content: Json;
19
+ created_at: string;
20
+ created_by: string | null;
21
+ id: string;
22
+ kind: string;
23
+ organization_id: string;
24
+ owner_id: string;
25
+ owner_kind: string;
26
+ source_execution_id: string | null;
27
+ version: number;
28
+ };
29
+ Insert: {
30
+ content: Json;
31
+ created_at?: string;
32
+ created_by?: string | null;
33
+ id?: string;
34
+ kind: string;
35
+ organization_id: string;
36
+ owner_id: string;
37
+ owner_kind: string;
38
+ source_execution_id?: string | null;
39
+ version?: number;
40
+ };
41
+ Update: {
42
+ content?: Json;
43
+ created_at?: string;
44
+ created_by?: string | null;
45
+ id?: string;
46
+ kind?: string;
47
+ organization_id?: string;
48
+ owner_id?: string;
49
+ owner_kind?: string;
50
+ source_execution_id?: string | null;
51
+ version?: number;
52
+ };
53
+ Relationships: [
54
+ {
55
+ foreignKeyName: 'acq_artifacts_organization_id_fkey';
56
+ columns: ['organization_id'];
57
+ isOneToOne: false;
58
+ referencedRelation: 'organizations';
59
+ referencedColumns: ['id'];
60
+ }
61
+ ];
62
+ };
63
+ acq_companies: {
64
+ Row: {
65
+ batch_id: string | null;
66
+ category: string | null;
67
+ category_pain: string | null;
68
+ created_at: string;
69
+ domain: string | null;
70
+ enrichment_data: Json | null;
71
+ filter_reason: string | null;
72
+ founded_year: number | null;
73
+ id: string;
74
+ linkedin_url: string | null;
75
+ location_city: string | null;
76
+ location_state: string | null;
77
+ name: string;
78
+ num_employees: number | null;
79
+ organization_id: string;
80
+ pipeline_status: Json;
81
+ qualification_rubric_key: string | null;
82
+ qualification_score: number | null;
83
+ qualification_signals: Json | null;
84
+ segment: string | null;
85
+ source: string | null;
86
+ status: string;
87
+ updated_at: string;
88
+ website: string | null;
89
+ };
90
+ Insert: {
91
+ batch_id?: string | null;
92
+ category?: string | null;
93
+ category_pain?: string | null;
94
+ created_at?: string;
95
+ domain?: string | null;
96
+ enrichment_data?: Json | null;
97
+ filter_reason?: string | null;
98
+ founded_year?: number | null;
99
+ id?: string;
100
+ linkedin_url?: string | null;
101
+ location_city?: string | null;
102
+ location_state?: string | null;
103
+ name: string;
104
+ num_employees?: number | null;
105
+ organization_id: string;
106
+ pipeline_status?: Json;
107
+ qualification_rubric_key?: string | null;
108
+ qualification_score?: number | null;
109
+ qualification_signals?: Json | null;
110
+ segment?: string | null;
111
+ source?: string | null;
112
+ status?: string;
113
+ updated_at?: string;
114
+ website?: string | null;
115
+ };
116
+ Update: {
117
+ batch_id?: string | null;
118
+ category?: string | null;
119
+ category_pain?: string | null;
120
+ created_at?: string;
121
+ domain?: string | null;
122
+ enrichment_data?: Json | null;
123
+ filter_reason?: string | null;
124
+ founded_year?: number | null;
125
+ id?: string;
126
+ linkedin_url?: string | null;
127
+ location_city?: string | null;
128
+ location_state?: string | null;
129
+ name?: string;
130
+ num_employees?: number | null;
131
+ organization_id?: string;
132
+ pipeline_status?: Json;
133
+ qualification_rubric_key?: string | null;
134
+ qualification_score?: number | null;
135
+ qualification_signals?: Json | null;
136
+ segment?: string | null;
137
+ source?: string | null;
138
+ status?: string;
139
+ updated_at?: string;
140
+ website?: string | null;
141
+ };
142
+ Relationships: [
143
+ {
144
+ foreignKeyName: 'acq_companies_organization_id_fkey';
145
+ columns: ['organization_id'];
146
+ isOneToOne: false;
147
+ referencedRelation: 'organizations';
148
+ referencedColumns: ['id'];
149
+ }
150
+ ];
151
+ };
152
+ acq_contacts: {
153
+ Row: {
154
+ batch_id: string | null;
155
+ brochure_first_viewed_at: string | null;
156
+ brochure_view_count: number;
157
+ company_id: string | null;
158
+ created_at: string;
159
+ email: string;
160
+ email_valid: string | null;
161
+ enrichment_data: Json;
162
+ filter_reason: string | null;
163
+ first_name: string | null;
164
+ headline: string | null;
165
+ id: string;
166
+ last_name: string | null;
167
+ linkedin_url: string | null;
168
+ nurture: boolean;
169
+ opening_line: string | null;
170
+ organization_id: string;
171
+ pipeline_status: Json;
172
+ qualification_rubric_key: string | null;
173
+ qualification_score: number | null;
174
+ qualification_signals: Json | null;
175
+ source: string | null;
176
+ source_id: string | null;
177
+ status: string;
178
+ title: string | null;
179
+ updated_at: string;
180
+ };
181
+ Insert: {
182
+ batch_id?: string | null;
183
+ brochure_first_viewed_at?: string | null;
184
+ brochure_view_count?: number;
185
+ company_id?: string | null;
186
+ created_at?: string;
187
+ email: string;
188
+ email_valid?: string | null;
189
+ enrichment_data?: Json;
190
+ filter_reason?: string | null;
191
+ first_name?: string | null;
192
+ headline?: string | null;
193
+ id?: string;
194
+ last_name?: string | null;
195
+ linkedin_url?: string | null;
196
+ nurture?: boolean;
197
+ opening_line?: string | null;
198
+ organization_id: string;
199
+ pipeline_status?: Json;
200
+ qualification_rubric_key?: string | null;
201
+ qualification_score?: number | null;
202
+ qualification_signals?: Json | null;
203
+ source?: string | null;
204
+ source_id?: string | null;
205
+ status?: string;
206
+ title?: string | null;
207
+ updated_at?: string;
208
+ };
209
+ Update: {
210
+ batch_id?: string | null;
211
+ brochure_first_viewed_at?: string | null;
212
+ brochure_view_count?: number;
213
+ company_id?: string | null;
214
+ created_at?: string;
215
+ email?: string;
216
+ email_valid?: string | null;
217
+ enrichment_data?: Json;
218
+ filter_reason?: string | null;
219
+ first_name?: string | null;
220
+ headline?: string | null;
221
+ id?: string;
222
+ last_name?: string | null;
223
+ linkedin_url?: string | null;
224
+ nurture?: boolean;
225
+ opening_line?: string | null;
226
+ organization_id?: string;
227
+ pipeline_status?: Json;
228
+ qualification_rubric_key?: string | null;
229
+ qualification_score?: number | null;
230
+ qualification_signals?: Json | null;
231
+ source?: string | null;
232
+ source_id?: string | null;
233
+ status?: string;
234
+ title?: string | null;
235
+ updated_at?: string;
236
+ };
237
+ Relationships: [
238
+ {
239
+ foreignKeyName: 'acq_contacts_company_id_fkey';
240
+ columns: ['company_id'];
241
+ isOneToOne: false;
242
+ referencedRelation: 'acq_companies';
243
+ referencedColumns: ['id'];
244
+ },
245
+ {
246
+ foreignKeyName: 'acq_contacts_organization_id_fkey';
247
+ columns: ['organization_id'];
248
+ isOneToOne: false;
249
+ referencedRelation: 'organizations';
250
+ referencedColumns: ['id'];
251
+ }
252
+ ];
253
+ };
254
+ acq_content: {
255
+ Row: {
256
+ body: string | null;
257
+ created_at: string;
258
+ id: string;
259
+ organization_id: string;
260
+ pillar: string;
261
+ status: string;
262
+ title: string;
263
+ updated_at: string;
264
+ };
265
+ Insert: {
266
+ body?: string | null;
267
+ created_at?: string;
268
+ id?: string;
269
+ organization_id: string;
270
+ pillar: string;
271
+ status?: string;
272
+ title: string;
273
+ updated_at?: string;
274
+ };
275
+ Update: {
276
+ body?: string | null;
277
+ created_at?: string;
278
+ id?: string;
279
+ organization_id?: string;
280
+ pillar?: string;
281
+ status?: string;
282
+ title?: string;
283
+ updated_at?: string;
284
+ };
285
+ Relationships: [
286
+ {
287
+ foreignKeyName: 'acq_content_organization_id_fkey';
288
+ columns: ['organization_id'];
289
+ isOneToOne: false;
290
+ referencedRelation: 'organizations';
291
+ referencedColumns: ['id'];
292
+ }
293
+ ];
294
+ };
295
+ acq_content_distributions: {
296
+ Row: {
297
+ adapted_body: string | null;
298
+ checklist: Json | null;
299
+ content_id: string;
300
+ created_at: string;
301
+ format: string;
302
+ id: string;
303
+ media_urls: Json;
304
+ metrics: Json;
305
+ metrics_updated_at: string | null;
306
+ organization_id: string;
307
+ platform: string;
308
+ platform_content: Json | null;
309
+ platform_post_id: string | null;
310
+ platform_url: string | null;
311
+ published_at: string | null;
312
+ status: string;
313
+ updated_at: string;
314
+ };
315
+ Insert: {
316
+ adapted_body?: string | null;
317
+ checklist?: Json | null;
318
+ content_id: string;
319
+ created_at?: string;
320
+ format: string;
321
+ id?: string;
322
+ media_urls?: Json;
323
+ metrics?: Json;
324
+ metrics_updated_at?: string | null;
325
+ organization_id: string;
326
+ platform: string;
327
+ platform_content?: Json | null;
328
+ platform_post_id?: string | null;
329
+ platform_url?: string | null;
330
+ published_at?: string | null;
331
+ status?: string;
332
+ updated_at?: string;
333
+ };
334
+ Update: {
335
+ adapted_body?: string | null;
336
+ checklist?: Json | null;
337
+ content_id?: string;
338
+ created_at?: string;
339
+ format?: string;
340
+ id?: string;
341
+ media_urls?: Json;
342
+ metrics?: Json;
343
+ metrics_updated_at?: string | null;
344
+ organization_id?: string;
345
+ platform?: string;
346
+ platform_content?: Json | null;
347
+ platform_post_id?: string | null;
348
+ platform_url?: string | null;
349
+ published_at?: string | null;
350
+ status?: string;
351
+ updated_at?: string;
352
+ };
353
+ Relationships: [
354
+ {
355
+ foreignKeyName: 'acq_content_distributions_content_id_fkey';
356
+ columns: ['content_id'];
357
+ isOneToOne: false;
358
+ referencedRelation: 'acq_content';
359
+ referencedColumns: ['id'];
360
+ },
361
+ {
362
+ foreignKeyName: 'acq_content_distributions_organization_id_fkey';
363
+ columns: ['organization_id'];
364
+ isOneToOne: false;
365
+ referencedRelation: 'organizations';
366
+ referencedColumns: ['id'];
367
+ }
368
+ ];
369
+ };
370
+ acq_deal_notes: {
371
+ Row: {
372
+ author_user_id: string | null;
373
+ body: string;
374
+ created_at: string;
375
+ deal_id: string;
376
+ id: string;
377
+ organization_id: string;
378
+ updated_at: string;
379
+ };
380
+ Insert: {
381
+ author_user_id?: string | null;
382
+ body: string;
383
+ created_at?: string;
384
+ deal_id: string;
385
+ id?: string;
386
+ organization_id: string;
387
+ updated_at?: string;
388
+ };
389
+ Update: {
390
+ author_user_id?: string | null;
391
+ body?: string;
392
+ created_at?: string;
393
+ deal_id?: string;
394
+ id?: string;
395
+ organization_id?: string;
396
+ updated_at?: string;
397
+ };
398
+ Relationships: [
399
+ {
400
+ foreignKeyName: 'acq_deal_notes_deal_id_fkey';
401
+ columns: ['deal_id'];
402
+ isOneToOne: false;
403
+ referencedRelation: 'acq_deals';
404
+ referencedColumns: ['id'];
405
+ },
406
+ {
407
+ foreignKeyName: 'acq_deal_notes_organization_id_fkey';
408
+ columns: ['organization_id'];
409
+ isOneToOne: false;
410
+ referencedRelation: 'organizations';
411
+ referencedColumns: ['id'];
412
+ }
413
+ ];
414
+ };
415
+ acq_deal_tasks: {
416
+ Row: {
417
+ assignee_user_id: string | null;
418
+ completed_at: string | null;
419
+ completed_by_user_id: string | null;
420
+ created_at: string;
421
+ created_by_user_id: string | null;
422
+ deal_id: string;
423
+ description: string | null;
424
+ due_at: string | null;
425
+ id: string;
426
+ kind: string;
427
+ organization_id: string;
428
+ title: string;
429
+ updated_at: string;
430
+ };
431
+ Insert: {
432
+ assignee_user_id?: string | null;
433
+ completed_at?: string | null;
434
+ completed_by_user_id?: string | null;
435
+ created_at?: string;
436
+ created_by_user_id?: string | null;
437
+ deal_id: string;
438
+ description?: string | null;
439
+ due_at?: string | null;
440
+ id?: string;
441
+ kind?: string;
442
+ organization_id: string;
443
+ title: string;
444
+ updated_at?: string;
445
+ };
446
+ Update: {
447
+ assignee_user_id?: string | null;
448
+ completed_at?: string | null;
449
+ completed_by_user_id?: string | null;
450
+ created_at?: string;
451
+ created_by_user_id?: string | null;
452
+ deal_id?: string;
453
+ description?: string | null;
454
+ due_at?: string | null;
455
+ id?: string;
456
+ kind?: string;
457
+ organization_id?: string;
458
+ title?: string;
459
+ updated_at?: string;
460
+ };
461
+ Relationships: [
462
+ {
463
+ foreignKeyName: 'acq_deal_tasks_deal_id_fkey';
464
+ columns: ['deal_id'];
465
+ isOneToOne: false;
466
+ referencedRelation: 'acq_deals';
467
+ referencedColumns: ['id'];
468
+ },
469
+ {
470
+ foreignKeyName: 'acq_deal_tasks_organization_id_fkey';
471
+ columns: ['organization_id'];
472
+ isOneToOne: false;
473
+ referencedRelation: 'organizations';
474
+ referencedColumns: ['id'];
475
+ }
476
+ ];
477
+ };
478
+ acq_deals: {
479
+ Row: {
480
+ activity_log: Json;
481
+ closed_lost_at: string | null;
482
+ closed_lost_reason: string | null;
483
+ contact_email: string;
484
+ contact_id: string | null;
485
+ created_at: string;
486
+ discovery_data: Json | null;
487
+ discovery_submitted_at: string | null;
488
+ discovery_submitted_by: string | null;
489
+ id: string;
490
+ initial_fee: number | null;
491
+ monthly_fee: number | null;
492
+ organization_id: string;
493
+ payment_link_sent_at: string | null;
494
+ payment_received_at: string | null;
495
+ pipeline_key: string;
496
+ proposal_data: Json | null;
497
+ proposal_generated_at: string | null;
498
+ proposal_pdf_url: string | null;
499
+ proposal_reviewed_at: string | null;
500
+ proposal_reviewed_by: string | null;
501
+ proposal_sent_at: string | null;
502
+ proposal_signed_at: string | null;
503
+ signature_envelope_id: string | null;
504
+ source_list_id: string | null;
505
+ source_type: string | null;
506
+ stage_key: string | null;
507
+ state_key: string | null;
508
+ stripe_payment_id: string | null;
509
+ stripe_payment_link: string | null;
510
+ stripe_payment_link_id: string | null;
511
+ stripe_subscription_id: string | null;
512
+ updated_at: string;
513
+ };
514
+ Insert: {
515
+ activity_log?: Json;
516
+ closed_lost_at?: string | null;
517
+ closed_lost_reason?: string | null;
518
+ contact_email: string;
519
+ contact_id?: string | null;
520
+ created_at?: string;
521
+ discovery_data?: Json | null;
522
+ discovery_submitted_at?: string | null;
523
+ discovery_submitted_by?: string | null;
524
+ id?: string;
525
+ initial_fee?: number | null;
526
+ monthly_fee?: number | null;
527
+ organization_id: string;
528
+ payment_link_sent_at?: string | null;
529
+ payment_received_at?: string | null;
530
+ pipeline_key?: string;
531
+ proposal_data?: Json | null;
532
+ proposal_generated_at?: string | null;
533
+ proposal_pdf_url?: string | null;
534
+ proposal_reviewed_at?: string | null;
535
+ proposal_reviewed_by?: string | null;
536
+ proposal_sent_at?: string | null;
537
+ proposal_signed_at?: string | null;
538
+ signature_envelope_id?: string | null;
539
+ source_list_id?: string | null;
540
+ source_type?: string | null;
541
+ stage_key?: string | null;
542
+ state_key?: string | null;
543
+ stripe_payment_id?: string | null;
544
+ stripe_payment_link?: string | null;
545
+ stripe_payment_link_id?: string | null;
546
+ stripe_subscription_id?: string | null;
547
+ updated_at?: string;
548
+ };
549
+ Update: {
550
+ activity_log?: Json;
551
+ closed_lost_at?: string | null;
552
+ closed_lost_reason?: string | null;
553
+ contact_email?: string;
554
+ contact_id?: string | null;
555
+ created_at?: string;
556
+ discovery_data?: Json | null;
557
+ discovery_submitted_at?: string | null;
558
+ discovery_submitted_by?: string | null;
559
+ id?: string;
560
+ initial_fee?: number | null;
561
+ monthly_fee?: number | null;
562
+ organization_id?: string;
563
+ payment_link_sent_at?: string | null;
564
+ payment_received_at?: string | null;
565
+ pipeline_key?: string;
566
+ proposal_data?: Json | null;
567
+ proposal_generated_at?: string | null;
568
+ proposal_pdf_url?: string | null;
569
+ proposal_reviewed_at?: string | null;
570
+ proposal_reviewed_by?: string | null;
571
+ proposal_sent_at?: string | null;
572
+ proposal_signed_at?: string | null;
573
+ signature_envelope_id?: string | null;
574
+ source_list_id?: string | null;
575
+ source_type?: string | null;
576
+ stage_key?: string | null;
577
+ state_key?: string | null;
578
+ stripe_payment_id?: string | null;
579
+ stripe_payment_link?: string | null;
580
+ stripe_payment_link_id?: string | null;
581
+ stripe_subscription_id?: string | null;
582
+ updated_at?: string;
583
+ };
584
+ Relationships: [
585
+ {
586
+ foreignKeyName: 'acq_deals_contact_id_fkey';
587
+ columns: ['contact_id'];
588
+ isOneToOne: false;
589
+ referencedRelation: 'acq_contacts';
590
+ referencedColumns: ['id'];
591
+ },
592
+ {
593
+ foreignKeyName: 'acq_deals_organization_id_fkey';
594
+ columns: ['organization_id'];
595
+ isOneToOne: false;
596
+ referencedRelation: 'organizations';
597
+ referencedColumns: ['id'];
598
+ },
599
+ {
600
+ foreignKeyName: 'acq_deals_source_list_id_fkey';
601
+ columns: ['source_list_id'];
602
+ isOneToOne: false;
603
+ referencedRelation: 'acq_lists';
604
+ referencedColumns: ['id'];
605
+ }
606
+ ];
607
+ };
608
+ acq_list_companies: {
609
+ Row: {
610
+ activity_log: Json;
611
+ added_at: string;
612
+ added_by: string | null;
613
+ company_id: string;
614
+ id: string;
615
+ list_id: string;
616
+ pipeline_key: string;
617
+ processing_state: Json;
618
+ source_execution_id: string | null;
619
+ source_input_hash: string | null;
620
+ source_resource_id: string | null;
621
+ stage_key: string;
622
+ state_key: string;
623
+ };
624
+ Insert: {
625
+ activity_log?: Json;
626
+ added_at?: string;
627
+ added_by?: string | null;
628
+ company_id: string;
629
+ id?: string;
630
+ list_id: string;
631
+ pipeline_key?: string;
632
+ processing_state?: Json;
633
+ source_execution_id?: string | null;
634
+ source_input_hash?: string | null;
635
+ source_resource_id?: string | null;
636
+ stage_key: string;
637
+ state_key: string;
638
+ };
639
+ Update: {
640
+ activity_log?: Json;
641
+ added_at?: string;
642
+ added_by?: string | null;
643
+ company_id?: string;
644
+ id?: string;
645
+ list_id?: string;
646
+ pipeline_key?: string;
647
+ processing_state?: Json;
648
+ source_execution_id?: string | null;
649
+ source_input_hash?: string | null;
650
+ source_resource_id?: string | null;
651
+ stage_key?: string;
652
+ state_key?: string;
653
+ };
654
+ Relationships: [
655
+ {
656
+ foreignKeyName: 'acq_list_companies_company_id_fkey';
657
+ columns: ['company_id'];
658
+ isOneToOne: false;
659
+ referencedRelation: 'acq_companies';
660
+ referencedColumns: ['id'];
661
+ },
662
+ {
663
+ foreignKeyName: 'acq_list_companies_list_id_fkey';
664
+ columns: ['list_id'];
665
+ isOneToOne: false;
666
+ referencedRelation: 'acq_lists';
667
+ referencedColumns: ['id'];
668
+ },
669
+ {
670
+ foreignKeyName: 'acq_list_companies_source_execution_id_fkey';
671
+ columns: ['source_execution_id'];
672
+ isOneToOne: false;
673
+ referencedRelation: 'execution_logs';
674
+ referencedColumns: ['execution_id'];
675
+ }
676
+ ];
677
+ };
678
+ acq_list_executions: {
679
+ Row: {
680
+ created_at: string;
681
+ execution_id: string;
682
+ id: string;
683
+ list_id: string;
684
+ payload: Json;
685
+ };
686
+ Insert: {
687
+ created_at?: string;
688
+ execution_id: string;
689
+ id?: string;
690
+ list_id: string;
691
+ payload?: Json;
692
+ };
693
+ Update: {
694
+ created_at?: string;
695
+ execution_id?: string;
696
+ id?: string;
697
+ list_id?: string;
698
+ payload?: Json;
699
+ };
700
+ Relationships: [
701
+ {
702
+ foreignKeyName: 'acq_list_executions_execution_id_fkey';
703
+ columns: ['execution_id'];
704
+ isOneToOne: false;
705
+ referencedRelation: 'execution_logs';
706
+ referencedColumns: ['execution_id'];
707
+ },
708
+ {
709
+ foreignKeyName: 'acq_list_executions_list_id_fkey';
710
+ columns: ['list_id'];
711
+ isOneToOne: false;
712
+ referencedRelation: 'acq_lists';
713
+ referencedColumns: ['id'];
714
+ }
715
+ ];
716
+ };
717
+ acq_list_members: {
718
+ Row: {
719
+ activity_log: Json;
720
+ added_at: string;
721
+ added_by: string | null;
722
+ contact_id: string;
723
+ id: string;
724
+ list_id: string;
725
+ pipeline_key: string;
726
+ processing_state: Json;
727
+ source_execution_id: string | null;
728
+ source_input_hash: string | null;
729
+ source_resource_id: string | null;
730
+ stage_key: string;
731
+ state_key: string;
732
+ };
733
+ Insert: {
734
+ activity_log?: Json;
735
+ added_at?: string;
736
+ added_by?: string | null;
737
+ contact_id: string;
738
+ id?: string;
739
+ list_id: string;
740
+ pipeline_key?: string;
741
+ processing_state?: Json;
742
+ source_execution_id?: string | null;
743
+ source_input_hash?: string | null;
744
+ source_resource_id?: string | null;
745
+ stage_key: string;
746
+ state_key: string;
747
+ };
748
+ Update: {
749
+ activity_log?: Json;
750
+ added_at?: string;
751
+ added_by?: string | null;
752
+ contact_id?: string;
753
+ id?: string;
754
+ list_id?: string;
755
+ pipeline_key?: string;
756
+ processing_state?: Json;
757
+ source_execution_id?: string | null;
758
+ source_input_hash?: string | null;
759
+ source_resource_id?: string | null;
760
+ stage_key?: string;
761
+ state_key?: string;
762
+ };
763
+ Relationships: [
764
+ {
765
+ foreignKeyName: 'acq_list_members_contact_id_fkey';
766
+ columns: ['contact_id'];
767
+ isOneToOne: false;
768
+ referencedRelation: 'acq_contacts';
769
+ referencedColumns: ['id'];
770
+ },
771
+ {
772
+ foreignKeyName: 'acq_list_members_list_id_fkey';
773
+ columns: ['list_id'];
774
+ isOneToOne: false;
775
+ referencedRelation: 'acq_lists';
776
+ referencedColumns: ['id'];
777
+ },
778
+ {
779
+ foreignKeyName: 'acq_list_members_source_execution_id_fkey';
780
+ columns: ['source_execution_id'];
781
+ isOneToOne: false;
782
+ referencedRelation: 'execution_logs';
783
+ referencedColumns: ['execution_id'];
784
+ }
785
+ ];
786
+ };
787
+ acq_lists: {
788
+ Row: {
789
+ batch_ids: string[];
790
+ completed_at: string | null;
791
+ created_at: string;
792
+ description: string | null;
793
+ icp: Json;
794
+ id: string;
795
+ instantly_campaign_id: string | null;
796
+ launched_at: string | null;
797
+ metadata: Json;
798
+ name: string;
799
+ organization_id: string;
800
+ pipeline_config: Json;
801
+ scraping_config: Json;
802
+ status: string;
803
+ };
804
+ Insert: {
805
+ batch_ids?: string[];
806
+ completed_at?: string | null;
807
+ created_at?: string;
808
+ description?: string | null;
809
+ icp?: Json;
810
+ id?: string;
811
+ instantly_campaign_id?: string | null;
812
+ launched_at?: string | null;
813
+ metadata?: Json;
814
+ name: string;
815
+ organization_id: string;
816
+ pipeline_config?: Json;
817
+ scraping_config?: Json;
818
+ status?: string;
819
+ };
820
+ Update: {
821
+ batch_ids?: string[];
822
+ completed_at?: string | null;
823
+ created_at?: string;
824
+ description?: string | null;
825
+ icp?: Json;
826
+ id?: string;
827
+ instantly_campaign_id?: string | null;
828
+ launched_at?: string | null;
829
+ metadata?: Json;
830
+ name?: string;
831
+ organization_id?: string;
832
+ pipeline_config?: Json;
833
+ scraping_config?: Json;
834
+ status?: string;
835
+ };
836
+ Relationships: [
837
+ {
838
+ foreignKeyName: 'acq_lists_organization_id_fkey';
839
+ columns: ['organization_id'];
840
+ isOneToOne: false;
841
+ referencedRelation: 'organizations';
842
+ referencedColumns: ['id'];
843
+ }
844
+ ];
845
+ };
846
+ acq_seo_metrics: {
847
+ Row: {
848
+ ai_citations: Json | null;
849
+ avg_position: number | null;
850
+ clicks: number | null;
851
+ created_at: string;
852
+ cta_clicks: number | null;
853
+ ctr: number | null;
854
+ data_point_count: number | null;
855
+ faq_count: number | null;
856
+ form_submissions: number | null;
857
+ id: string;
858
+ impressions: number | null;
859
+ organization_id: string;
860
+ period: string;
861
+ quality_score: number | null;
862
+ readability: number | null;
863
+ scroll_100: number | null;
864
+ scroll_25: number | null;
865
+ scroll_50: number | null;
866
+ scroll_75: number | null;
867
+ seo_page_id: string;
868
+ word_count: number | null;
869
+ };
870
+ Insert: {
871
+ ai_citations?: Json | null;
872
+ avg_position?: number | null;
873
+ clicks?: number | null;
874
+ created_at?: string;
875
+ cta_clicks?: number | null;
876
+ ctr?: number | null;
877
+ data_point_count?: number | null;
878
+ faq_count?: number | null;
879
+ form_submissions?: number | null;
880
+ id?: string;
881
+ impressions?: number | null;
882
+ organization_id: string;
883
+ period: string;
884
+ quality_score?: number | null;
885
+ readability?: number | null;
886
+ scroll_100?: number | null;
887
+ scroll_25?: number | null;
888
+ scroll_50?: number | null;
889
+ scroll_75?: number | null;
890
+ seo_page_id: string;
891
+ word_count?: number | null;
892
+ };
893
+ Update: {
894
+ ai_citations?: Json | null;
895
+ avg_position?: number | null;
896
+ clicks?: number | null;
897
+ created_at?: string;
898
+ cta_clicks?: number | null;
899
+ ctr?: number | null;
900
+ data_point_count?: number | null;
901
+ faq_count?: number | null;
902
+ form_submissions?: number | null;
903
+ id?: string;
904
+ impressions?: number | null;
905
+ organization_id?: string;
906
+ period?: string;
907
+ quality_score?: number | null;
908
+ readability?: number | null;
909
+ scroll_100?: number | null;
910
+ scroll_25?: number | null;
911
+ scroll_50?: number | null;
912
+ scroll_75?: number | null;
913
+ seo_page_id?: string;
914
+ word_count?: number | null;
915
+ };
916
+ Relationships: [
917
+ {
918
+ foreignKeyName: 'acq_seo_metrics_organization_id_fkey';
919
+ columns: ['organization_id'];
920
+ isOneToOne: false;
921
+ referencedRelation: 'organizations';
922
+ referencedColumns: ['id'];
923
+ },
924
+ {
925
+ foreignKeyName: 'acq_seo_metrics_seo_page_id_fkey';
926
+ columns: ['seo_page_id'];
927
+ isOneToOne: false;
928
+ referencedRelation: 'acq_seo_pages';
929
+ referencedColumns: ['id'];
930
+ }
931
+ ];
932
+ };
933
+ acq_seo_pages: {
934
+ Row: {
935
+ city: string | null;
936
+ content: Json | null;
937
+ created_at: string;
938
+ faq_items: Json | null;
939
+ hero_image_url: string | null;
940
+ id: string;
941
+ internal_links: Json | null;
942
+ local_data: Json | null;
943
+ meta_description: string | null;
944
+ organization_id: string;
945
+ page_type: string;
946
+ published_at: string | null;
947
+ refreshed_at: string | null;
948
+ schema_markup: Json | null;
949
+ slug: string;
950
+ state: string | null;
951
+ status: string;
952
+ title: string;
953
+ updated_at: string;
954
+ use_case: string | null;
955
+ vertical: string;
956
+ };
957
+ Insert: {
958
+ city?: string | null;
959
+ content?: Json | null;
960
+ created_at?: string;
961
+ faq_items?: Json | null;
962
+ hero_image_url?: string | null;
963
+ id?: string;
964
+ internal_links?: Json | null;
965
+ local_data?: Json | null;
966
+ meta_description?: string | null;
967
+ organization_id: string;
968
+ page_type: string;
969
+ published_at?: string | null;
970
+ refreshed_at?: string | null;
971
+ schema_markup?: Json | null;
972
+ slug: string;
973
+ state?: string | null;
974
+ status?: string;
975
+ title: string;
976
+ updated_at?: string;
977
+ use_case?: string | null;
978
+ vertical: string;
979
+ };
980
+ Update: {
981
+ city?: string | null;
982
+ content?: Json | null;
983
+ created_at?: string;
984
+ faq_items?: Json | null;
985
+ hero_image_url?: string | null;
986
+ id?: string;
987
+ internal_links?: Json | null;
988
+ local_data?: Json | null;
989
+ meta_description?: string | null;
990
+ organization_id?: string;
991
+ page_type?: string;
992
+ published_at?: string | null;
993
+ refreshed_at?: string | null;
994
+ schema_markup?: Json | null;
995
+ slug?: string;
996
+ state?: string | null;
997
+ status?: string;
998
+ title?: string;
999
+ updated_at?: string;
1000
+ use_case?: string | null;
1001
+ vertical?: string;
1002
+ };
1003
+ Relationships: [
1004
+ {
1005
+ foreignKeyName: 'acq_seo_pages_organization_id_fkey';
1006
+ columns: ['organization_id'];
1007
+ isOneToOne: false;
1008
+ referencedRelation: 'organizations';
1009
+ referencedColumns: ['id'];
1010
+ }
1011
+ ];
1012
+ };
1013
+ acq_social_posts: {
1014
+ Row: {
1015
+ author_name: string;
1016
+ author_url: string | null;
1017
+ comments_count: number;
1018
+ created_at: string;
1019
+ discovered_at: string;
1020
+ engagement_count: number;
1021
+ feedback: string | null;
1022
+ final_response: string | null;
1023
+ fully_reviewed: boolean;
1024
+ id: string;
1025
+ initial_draft: string | null;
1026
+ matched_keywords: string[];
1027
+ matched_query: string | null;
1028
+ metadata: Json;
1029
+ organization_id: string;
1030
+ platform: string;
1031
+ platform_post_id: string;
1032
+ post_text: string;
1033
+ post_title: string;
1034
+ post_url: string;
1035
+ posted_at: string;
1036
+ relevance_score: number;
1037
+ responded_at: string | null;
1038
+ reviewed_at: string | null;
1039
+ skip_reason: string | null;
1040
+ source_category: string | null;
1041
+ status: string;
1042
+ updated_at: string;
1043
+ };
1044
+ Insert: {
1045
+ author_name: string;
1046
+ author_url?: string | null;
1047
+ comments_count?: number;
1048
+ created_at?: string;
1049
+ discovered_at?: string;
1050
+ engagement_count?: number;
1051
+ feedback?: string | null;
1052
+ final_response?: string | null;
1053
+ fully_reviewed?: boolean;
1054
+ id?: string;
1055
+ initial_draft?: string | null;
1056
+ matched_keywords?: string[];
1057
+ matched_query?: string | null;
1058
+ metadata?: Json;
1059
+ organization_id: string;
1060
+ platform: string;
1061
+ platform_post_id: string;
1062
+ post_text: string;
1063
+ post_title: string;
1064
+ post_url: string;
1065
+ posted_at: string;
1066
+ relevance_score?: number;
1067
+ responded_at?: string | null;
1068
+ reviewed_at?: string | null;
1069
+ skip_reason?: string | null;
1070
+ source_category?: string | null;
1071
+ status?: string;
1072
+ updated_at?: string;
1073
+ };
1074
+ Update: {
1075
+ author_name?: string;
1076
+ author_url?: string | null;
1077
+ comments_count?: number;
1078
+ created_at?: string;
1079
+ discovered_at?: string;
1080
+ engagement_count?: number;
1081
+ feedback?: string | null;
1082
+ final_response?: string | null;
1083
+ fully_reviewed?: boolean;
1084
+ id?: string;
1085
+ initial_draft?: string | null;
1086
+ matched_keywords?: string[];
1087
+ matched_query?: string | null;
1088
+ metadata?: Json;
1089
+ organization_id?: string;
1090
+ platform?: string;
1091
+ platform_post_id?: string;
1092
+ post_text?: string;
1093
+ post_title?: string;
1094
+ post_url?: string;
1095
+ posted_at?: string;
1096
+ relevance_score?: number;
1097
+ responded_at?: string | null;
1098
+ reviewed_at?: string | null;
1099
+ skip_reason?: string | null;
1100
+ source_category?: string | null;
1101
+ status?: string;
1102
+ updated_at?: string;
1103
+ };
1104
+ Relationships: [
1105
+ {
1106
+ foreignKeyName: 'acq_social_posts_organization_id_fkey';
1107
+ columns: ['organization_id'];
1108
+ isOneToOne: false;
1109
+ referencedRelation: 'organizations';
1110
+ referencedColumns: ['id'];
1111
+ }
1112
+ ];
1113
+ };
1114
+ activities: {
1115
+ Row: {
1116
+ activity_type: string;
1117
+ actor_id: string | null;
1118
+ actor_type: string | null;
1119
+ created_at: string;
1120
+ description: string | null;
1121
+ entity_id: string;
1122
+ entity_name: string | null;
1123
+ entity_type: string;
1124
+ id: string;
1125
+ metadata: Json | null;
1126
+ occurred_at: string;
1127
+ organization_id: string;
1128
+ status: string;
1129
+ title: string;
1130
+ };
1131
+ Insert: {
1132
+ activity_type: string;
1133
+ actor_id?: string | null;
1134
+ actor_type?: string | null;
1135
+ created_at?: string;
1136
+ description?: string | null;
1137
+ entity_id: string;
1138
+ entity_name?: string | null;
1139
+ entity_type: string;
1140
+ id?: string;
1141
+ metadata?: Json | null;
1142
+ occurred_at?: string;
1143
+ organization_id: string;
1144
+ status: string;
1145
+ title: string;
1146
+ };
1147
+ Update: {
1148
+ activity_type?: string;
1149
+ actor_id?: string | null;
1150
+ actor_type?: string | null;
1151
+ created_at?: string;
1152
+ description?: string | null;
1153
+ entity_id?: string;
1154
+ entity_name?: string | null;
1155
+ entity_type?: string;
1156
+ id?: string;
1157
+ metadata?: Json | null;
1158
+ occurred_at?: string;
1159
+ organization_id?: string;
1160
+ status?: string;
1161
+ title?: string;
1162
+ };
1163
+ Relationships: [
1164
+ {
1165
+ foreignKeyName: 'activities_organization_id_fkey';
1166
+ columns: ['organization_id'];
1167
+ isOneToOne: false;
1168
+ referencedRelation: 'organizations';
1169
+ referencedColumns: ['id'];
1170
+ }
1171
+ ];
1172
+ };
1173
+ api_keys: {
1174
+ Row: {
1175
+ created_at: string | null;
1176
+ id: string;
1177
+ key_hash: string;
1178
+ last_used_at: string | null;
1179
+ name: string;
1180
+ organization_id: string;
1181
+ };
1182
+ Insert: {
1183
+ created_at?: string | null;
1184
+ id?: string;
1185
+ key_hash: string;
1186
+ last_used_at?: string | null;
1187
+ name: string;
1188
+ organization_id: string;
1189
+ };
1190
+ Update: {
1191
+ created_at?: string | null;
1192
+ id?: string;
1193
+ key_hash?: string;
1194
+ last_used_at?: string | null;
1195
+ name?: string;
1196
+ organization_id?: string;
1197
+ };
1198
+ Relationships: [
1199
+ {
1200
+ foreignKeyName: 'api_keys_organization_id_fkey';
1201
+ columns: ['organization_id'];
1202
+ isOneToOne: false;
1203
+ referencedRelation: 'organizations';
1204
+ referencedColumns: ['id'];
1205
+ }
1206
+ ];
1207
+ };
1208
+ command_queue: {
1209
+ Row: {
1210
+ action_payload: Json | null;
1211
+ actions: Json;
1212
+ completed_at: string | null;
1213
+ completed_by: string | null;
1214
+ context: Json;
1215
+ created_at: string;
1216
+ description: string | null;
1217
+ expires_at: string | null;
1218
+ human_checkpoint: string | null;
1219
+ id: string;
1220
+ idempotency_key: string | null;
1221
+ metadata: Json | null;
1222
+ organization_id: string;
1223
+ origin_execution_id: string;
1224
+ origin_resource_id: string;
1225
+ origin_resource_type: string;
1226
+ priority: number;
1227
+ selected_action: string | null;
1228
+ status: string;
1229
+ target_execution_id: string | null;
1230
+ target_resource_id: string | null;
1231
+ target_resource_type: string | null;
1232
+ };
1233
+ Insert: {
1234
+ action_payload?: Json | null;
1235
+ actions: Json;
1236
+ completed_at?: string | null;
1237
+ completed_by?: string | null;
1238
+ context: Json;
1239
+ created_at?: string;
1240
+ description?: string | null;
1241
+ expires_at?: string | null;
1242
+ human_checkpoint?: string | null;
1243
+ id?: string;
1244
+ idempotency_key?: string | null;
1245
+ metadata?: Json | null;
1246
+ organization_id: string;
1247
+ origin_execution_id: string;
1248
+ origin_resource_id: string;
1249
+ origin_resource_type: string;
1250
+ priority?: number;
1251
+ selected_action?: string | null;
1252
+ status?: string;
1253
+ target_execution_id?: string | null;
1254
+ target_resource_id?: string | null;
1255
+ target_resource_type?: string | null;
1256
+ };
1257
+ Update: {
1258
+ action_payload?: Json | null;
1259
+ actions?: Json;
1260
+ completed_at?: string | null;
1261
+ completed_by?: string | null;
1262
+ context?: Json;
1263
+ created_at?: string;
1264
+ description?: string | null;
1265
+ expires_at?: string | null;
1266
+ human_checkpoint?: string | null;
1267
+ id?: string;
1268
+ idempotency_key?: string | null;
1269
+ metadata?: Json | null;
1270
+ organization_id?: string;
1271
+ origin_execution_id?: string;
1272
+ origin_resource_id?: string;
1273
+ origin_resource_type?: string;
1274
+ priority?: number;
1275
+ selected_action?: string | null;
1276
+ status?: string;
1277
+ target_execution_id?: string | null;
1278
+ target_resource_id?: string | null;
1279
+ target_resource_type?: string | null;
1280
+ };
1281
+ Relationships: [
1282
+ {
1283
+ foreignKeyName: 'command_queue_completed_by_fkey';
1284
+ columns: ['completed_by'];
1285
+ isOneToOne: false;
1286
+ referencedRelation: 'users';
1287
+ referencedColumns: ['id'];
1288
+ },
1289
+ {
1290
+ foreignKeyName: 'command_queue_organization_id_fkey';
1291
+ columns: ['organization_id'];
1292
+ isOneToOne: false;
1293
+ referencedRelation: 'organizations';
1294
+ referencedColumns: ['id'];
1295
+ },
1296
+ {
1297
+ foreignKeyName: 'command_queue_target_execution_id_fkey';
1298
+ columns: ['target_execution_id'];
1299
+ isOneToOne: false;
1300
+ referencedRelation: 'execution_logs';
1301
+ referencedColumns: ['execution_id'];
1302
+ }
1303
+ ];
1304
+ };
1305
+ credentials: {
1306
+ Row: {
1307
+ created_at: string;
1308
+ created_by: string | null;
1309
+ encrypted_value: string;
1310
+ id: string;
1311
+ name: string;
1312
+ organization_id: string;
1313
+ provider: string | null;
1314
+ type: string;
1315
+ updated_at: string;
1316
+ };
1317
+ Insert: {
1318
+ created_at?: string;
1319
+ created_by?: string | null;
1320
+ encrypted_value: string;
1321
+ id?: string;
1322
+ name: string;
1323
+ organization_id: string;
1324
+ provider?: string | null;
1325
+ type?: string;
1326
+ updated_at?: string;
1327
+ };
1328
+ Update: {
1329
+ created_at?: string;
1330
+ created_by?: string | null;
1331
+ encrypted_value?: string;
1332
+ id?: string;
1333
+ name?: string;
1334
+ organization_id?: string;
1335
+ provider?: string | null;
1336
+ type?: string;
1337
+ updated_at?: string;
1338
+ };
1339
+ Relationships: [
1340
+ {
1341
+ foreignKeyName: 'credentials_created_by_fkey';
1342
+ columns: ['created_by'];
1343
+ isOneToOne: false;
1344
+ referencedRelation: 'users';
1345
+ referencedColumns: ['id'];
1346
+ },
1347
+ {
1348
+ foreignKeyName: 'credentials_organization_id_fkey';
1349
+ columns: ['organization_id'];
1350
+ isOneToOne: false;
1351
+ referencedRelation: 'organizations';
1352
+ referencedColumns: ['id'];
1353
+ }
1354
+ ];
1355
+ };
1356
+ deployments: {
1357
+ Row: {
1358
+ created_at: string;
1359
+ deployment_version: string | null;
1360
+ error_message: string | null;
1361
+ id: string;
1362
+ organization_id: string;
1363
+ pid: number | null;
1364
+ port: number | null;
1365
+ sdk_version: string;
1366
+ status: string;
1367
+ tarball_path: string | null;
1368
+ updated_at: string;
1369
+ };
1370
+ Insert: {
1371
+ created_at?: string;
1372
+ deployment_version?: string | null;
1373
+ error_message?: string | null;
1374
+ id?: string;
1375
+ organization_id: string;
1376
+ pid?: number | null;
1377
+ port?: number | null;
1378
+ sdk_version: string;
1379
+ status?: string;
1380
+ tarball_path?: string | null;
1381
+ updated_at?: string;
1382
+ };
1383
+ Update: {
1384
+ created_at?: string;
1385
+ deployment_version?: string | null;
1386
+ error_message?: string | null;
1387
+ id?: string;
1388
+ organization_id?: string;
1389
+ pid?: number | null;
1390
+ port?: number | null;
1391
+ sdk_version?: string;
1392
+ status?: string;
1393
+ tarball_path?: string | null;
1394
+ updated_at?: string;
1395
+ };
1396
+ Relationships: [
1397
+ {
1398
+ foreignKeyName: 'deployments_organization_id_fkey';
1399
+ columns: ['organization_id'];
1400
+ isOneToOne: false;
1401
+ referencedRelation: 'organizations';
1402
+ referencedColumns: ['id'];
1403
+ }
1404
+ ];
1405
+ };
1406
+ execution_errors: {
1407
+ Row: {
1408
+ created_at: string | null;
1409
+ error_category: string;
1410
+ error_message: string;
1411
+ error_severity: string;
1412
+ error_stack_trace: string | null;
1413
+ error_type: string;
1414
+ execution_id: string;
1415
+ id: string;
1416
+ metadata: Json | null;
1417
+ occurred_at: string;
1418
+ organization_id: string;
1419
+ resolved: boolean;
1420
+ resolved_at: string | null;
1421
+ resolved_by: string | null;
1422
+ };
1423
+ Insert: {
1424
+ created_at?: string | null;
1425
+ error_category: string;
1426
+ error_message: string;
1427
+ error_severity: string;
1428
+ error_stack_trace?: string | null;
1429
+ error_type: string;
1430
+ execution_id: string;
1431
+ id?: string;
1432
+ metadata?: Json | null;
1433
+ occurred_at?: string;
1434
+ organization_id: string;
1435
+ resolved?: boolean;
1436
+ resolved_at?: string | null;
1437
+ resolved_by?: string | null;
1438
+ };
1439
+ Update: {
1440
+ created_at?: string | null;
1441
+ error_category?: string;
1442
+ error_message?: string;
1443
+ error_severity?: string;
1444
+ error_stack_trace?: string | null;
1445
+ error_type?: string;
1446
+ execution_id?: string;
1447
+ id?: string;
1448
+ metadata?: Json | null;
1449
+ occurred_at?: string;
1450
+ organization_id?: string;
1451
+ resolved?: boolean;
1452
+ resolved_at?: string | null;
1453
+ resolved_by?: string | null;
1454
+ };
1455
+ Relationships: [
1456
+ {
1457
+ foreignKeyName: 'execution_errors_execution_id_fkey';
1458
+ columns: ['execution_id'];
1459
+ isOneToOne: false;
1460
+ referencedRelation: 'execution_logs';
1461
+ referencedColumns: ['execution_id'];
1462
+ },
1463
+ {
1464
+ foreignKeyName: 'execution_errors_organization_id_fkey';
1465
+ columns: ['organization_id'];
1466
+ isOneToOne: false;
1467
+ referencedRelation: 'organizations';
1468
+ referencedColumns: ['id'];
1469
+ },
1470
+ {
1471
+ foreignKeyName: 'execution_errors_resolved_by_fkey';
1472
+ columns: ['resolved_by'];
1473
+ isOneToOne: false;
1474
+ referencedRelation: 'users';
1475
+ referencedColumns: ['id'];
1476
+ }
1477
+ ];
1478
+ };
1479
+ execution_logs: {
1480
+ Row: {
1481
+ api_version: string | null;
1482
+ completed_at: string | null;
1483
+ created_at: string | null;
1484
+ error: string | null;
1485
+ execution_id: string;
1486
+ input: Json | null;
1487
+ last_heartbeat_at: string | null;
1488
+ logs: Json | null;
1489
+ organization_id: string;
1490
+ origin_execution_id: string | null;
1491
+ output: Json | null;
1492
+ resource_id: string;
1493
+ resource_status: string;
1494
+ resource_type: string;
1495
+ resource_version: string | null;
1496
+ sdk_version: string | null;
1497
+ session_id: string | null;
1498
+ session_turn_number: number | null;
1499
+ started_at: string;
1500
+ status: string;
1501
+ trigger_type: string | null;
1502
+ updated_at: string | null;
1503
+ user_id: string | null;
1504
+ };
1505
+ Insert: {
1506
+ api_version?: string | null;
1507
+ completed_at?: string | null;
1508
+ created_at?: string | null;
1509
+ error?: string | null;
1510
+ execution_id?: string;
1511
+ input?: Json | null;
1512
+ last_heartbeat_at?: string | null;
1513
+ logs?: Json | null;
1514
+ organization_id: string;
1515
+ origin_execution_id?: string | null;
1516
+ output?: Json | null;
1517
+ resource_id: string;
1518
+ resource_status?: string;
1519
+ resource_type?: string;
1520
+ resource_version?: string | null;
1521
+ sdk_version?: string | null;
1522
+ session_id?: string | null;
1523
+ session_turn_number?: number | null;
1524
+ started_at?: string;
1525
+ status: string;
1526
+ trigger_type?: string | null;
1527
+ updated_at?: string | null;
1528
+ user_id?: string | null;
1529
+ };
1530
+ Update: {
1531
+ api_version?: string | null;
1532
+ completed_at?: string | null;
1533
+ created_at?: string | null;
1534
+ error?: string | null;
1535
+ execution_id?: string;
1536
+ input?: Json | null;
1537
+ last_heartbeat_at?: string | null;
1538
+ logs?: Json | null;
1539
+ organization_id?: string;
1540
+ origin_execution_id?: string | null;
1541
+ output?: Json | null;
1542
+ resource_id?: string;
1543
+ resource_status?: string;
1544
+ resource_type?: string;
1545
+ resource_version?: string | null;
1546
+ sdk_version?: string | null;
1547
+ session_id?: string | null;
1548
+ session_turn_number?: number | null;
1549
+ started_at?: string;
1550
+ status?: string;
1551
+ trigger_type?: string | null;
1552
+ updated_at?: string | null;
1553
+ user_id?: string | null;
1554
+ };
1555
+ Relationships: [
1556
+ {
1557
+ foreignKeyName: 'execution_history_organization_id_fkey';
1558
+ columns: ['organization_id'];
1559
+ isOneToOne: false;
1560
+ referencedRelation: 'organizations';
1561
+ referencedColumns: ['id'];
1562
+ },
1563
+ {
1564
+ foreignKeyName: 'execution_logs_origin_execution_id_fkey';
1565
+ columns: ['origin_execution_id'];
1566
+ isOneToOne: false;
1567
+ referencedRelation: 'execution_logs';
1568
+ referencedColumns: ['execution_id'];
1569
+ },
1570
+ {
1571
+ foreignKeyName: 'execution_logs_session_id_fkey';
1572
+ columns: ['session_id'];
1573
+ isOneToOne: false;
1574
+ referencedRelation: 'sessions';
1575
+ referencedColumns: ['session_id'];
1576
+ },
1577
+ {
1578
+ foreignKeyName: 'execution_logs_user_id_fkey';
1579
+ columns: ['user_id'];
1580
+ isOneToOne: false;
1581
+ referencedRelation: 'users';
1582
+ referencedColumns: ['id'];
1583
+ }
1584
+ ];
1585
+ };
1586
+ execution_metrics: {
1587
+ Row: {
1588
+ ai_call_count: number;
1589
+ ai_calls: Json | null;
1590
+ automation_savings_usd: number | null;
1591
+ created_at: string | null;
1592
+ duration_ms: number | null;
1593
+ execution_id: string;
1594
+ organization_id: string;
1595
+ resource_id: string;
1596
+ total_cost_usd: number;
1597
+ total_input_tokens: number;
1598
+ total_output_tokens: number;
1599
+ };
1600
+ Insert: {
1601
+ ai_call_count: number;
1602
+ ai_calls?: Json | null;
1603
+ automation_savings_usd?: number | null;
1604
+ created_at?: string | null;
1605
+ duration_ms?: number | null;
1606
+ execution_id: string;
1607
+ organization_id: string;
1608
+ resource_id: string;
1609
+ total_cost_usd: number;
1610
+ total_input_tokens: number;
1611
+ total_output_tokens: number;
1612
+ };
1613
+ Update: {
1614
+ ai_call_count?: number;
1615
+ ai_calls?: Json | null;
1616
+ automation_savings_usd?: number | null;
1617
+ created_at?: string | null;
1618
+ duration_ms?: number | null;
1619
+ execution_id?: string;
1620
+ organization_id?: string;
1621
+ resource_id?: string;
1622
+ total_cost_usd?: number;
1623
+ total_input_tokens?: number;
1624
+ total_output_tokens?: number;
1625
+ };
1626
+ Relationships: [
1627
+ {
1628
+ foreignKeyName: 'execution_metrics_execution_id_fkey';
1629
+ columns: ['execution_id'];
1630
+ isOneToOne: true;
1631
+ referencedRelation: 'execution_logs';
1632
+ referencedColumns: ['execution_id'];
1633
+ },
1634
+ {
1635
+ foreignKeyName: 'execution_metrics_organization_id_fkey';
1636
+ columns: ['organization_id'];
1637
+ isOneToOne: false;
1638
+ referencedRelation: 'organizations';
1639
+ referencedColumns: ['id'];
1640
+ }
1641
+ ];
1642
+ };
1643
+ notifications: {
1644
+ Row: {
1645
+ action_url: string | null;
1646
+ category: string;
1647
+ created_at: string | null;
1648
+ id: string;
1649
+ message: string;
1650
+ organization_id: string;
1651
+ read: boolean | null;
1652
+ read_at: string | null;
1653
+ title: string;
1654
+ user_id: string;
1655
+ };
1656
+ Insert: {
1657
+ action_url?: string | null;
1658
+ category: string;
1659
+ created_at?: string | null;
1660
+ id?: string;
1661
+ message: string;
1662
+ organization_id: string;
1663
+ read?: boolean | null;
1664
+ read_at?: string | null;
1665
+ title: string;
1666
+ user_id: string;
1667
+ };
1668
+ Update: {
1669
+ action_url?: string | null;
1670
+ category?: string;
1671
+ created_at?: string | null;
1672
+ id?: string;
1673
+ message?: string;
1674
+ organization_id?: string;
1675
+ read?: boolean | null;
1676
+ read_at?: string | null;
1677
+ title?: string;
1678
+ user_id?: string;
1679
+ };
1680
+ Relationships: [
1681
+ {
1682
+ foreignKeyName: 'notifications_organization_id_fkey';
1683
+ columns: ['organization_id'];
1684
+ isOneToOne: false;
1685
+ referencedRelation: 'organizations';
1686
+ referencedColumns: ['id'];
1687
+ },
1688
+ {
1689
+ foreignKeyName: 'notifications_user_id_fkey';
1690
+ columns: ['user_id'];
1691
+ isOneToOne: false;
1692
+ referencedRelation: 'users';
1693
+ referencedColumns: ['id'];
1694
+ }
1695
+ ];
1696
+ };
1697
+ org_invitations: {
1698
+ Row: {
1699
+ accept_invitation_url: string | null;
1700
+ accepted_at: string | null;
1701
+ created_at: string | null;
1702
+ email: string;
1703
+ expires_at: string;
1704
+ id: string;
1705
+ invitation_state: string | null;
1706
+ invitation_token: string | null;
1707
+ inviter_user_id: string | null;
1708
+ organization_id: string | null;
1709
+ revoked_at: string | null;
1710
+ role_slug: string | null;
1711
+ updated_at: string | null;
1712
+ workos_invitation_id: string;
1713
+ };
1714
+ Insert: {
1715
+ accept_invitation_url?: string | null;
1716
+ accepted_at?: string | null;
1717
+ created_at?: string | null;
1718
+ email: string;
1719
+ expires_at: string;
1720
+ id?: string;
1721
+ invitation_state?: string | null;
1722
+ invitation_token?: string | null;
1723
+ inviter_user_id?: string | null;
1724
+ organization_id?: string | null;
1725
+ revoked_at?: string | null;
1726
+ role_slug?: string | null;
1727
+ updated_at?: string | null;
1728
+ workos_invitation_id: string;
1729
+ };
1730
+ Update: {
1731
+ accept_invitation_url?: string | null;
1732
+ accepted_at?: string | null;
1733
+ created_at?: string | null;
1734
+ email?: string;
1735
+ expires_at?: string;
1736
+ id?: string;
1737
+ invitation_state?: string | null;
1738
+ invitation_token?: string | null;
1739
+ inviter_user_id?: string | null;
1740
+ organization_id?: string | null;
1741
+ revoked_at?: string | null;
1742
+ role_slug?: string | null;
1743
+ updated_at?: string | null;
1744
+ workos_invitation_id?: string;
1745
+ };
1746
+ Relationships: [
1747
+ {
1748
+ foreignKeyName: 'org_invitations_inviter_user_id_fkey';
1749
+ columns: ['inviter_user_id'];
1750
+ isOneToOne: false;
1751
+ referencedRelation: 'users';
1752
+ referencedColumns: ['id'];
1753
+ },
1754
+ {
1755
+ foreignKeyName: 'org_invitations_organization_id_fkey';
1756
+ columns: ['organization_id'];
1757
+ isOneToOne: false;
1758
+ referencedRelation: 'organizations';
1759
+ referencedColumns: ['id'];
1760
+ }
1761
+ ];
1762
+ };
1763
+ org_memberships: {
1764
+ Row: {
1765
+ config: Json;
1766
+ created_at: string | null;
1767
+ effective_permissions: string[];
1768
+ id: string;
1769
+ membership_status: string | null;
1770
+ organization_id: string;
1771
+ role_slug: string | null;
1772
+ updated_at: string | null;
1773
+ user_id: string;
1774
+ workos_membership_id: string | null;
1775
+ };
1776
+ Insert: {
1777
+ config?: Json;
1778
+ created_at?: string | null;
1779
+ effective_permissions?: string[];
1780
+ id?: string;
1781
+ membership_status?: string | null;
1782
+ organization_id: string;
1783
+ role_slug?: string | null;
1784
+ updated_at?: string | null;
1785
+ user_id: string;
1786
+ workos_membership_id?: string | null;
1787
+ };
1788
+ Update: {
1789
+ config?: Json;
1790
+ created_at?: string | null;
1791
+ effective_permissions?: string[];
1792
+ id?: string;
1793
+ membership_status?: string | null;
1794
+ organization_id?: string;
1795
+ role_slug?: string | null;
1796
+ updated_at?: string | null;
1797
+ user_id?: string;
1798
+ workos_membership_id?: string | null;
1799
+ };
1800
+ Relationships: [
1801
+ {
1802
+ foreignKeyName: 'org_memberships_organization_id_fkey';
1803
+ columns: ['organization_id'];
1804
+ isOneToOne: false;
1805
+ referencedRelation: 'organizations';
1806
+ referencedColumns: ['id'];
1807
+ },
1808
+ {
1809
+ foreignKeyName: 'org_memberships_user_id_fkey';
1810
+ columns: ['user_id'];
1811
+ isOneToOne: false;
1812
+ referencedRelation: 'users';
1813
+ referencedColumns: ['id'];
1814
+ }
1815
+ ];
1816
+ };
1817
+ org_rol_assignments: {
1818
+ Row: {
1819
+ granted_at: string;
1820
+ granted_by: string | null;
1821
+ membership_id: string;
1822
+ role_id: string;
1823
+ };
1824
+ Insert: {
1825
+ granted_at?: string;
1826
+ granted_by?: string | null;
1827
+ membership_id: string;
1828
+ role_id: string;
1829
+ };
1830
+ Update: {
1831
+ granted_at?: string;
1832
+ granted_by?: string | null;
1833
+ membership_id?: string;
1834
+ role_id?: string;
1835
+ };
1836
+ Relationships: [
1837
+ {
1838
+ foreignKeyName: 'org_rol_assignments_granted_by_fkey';
1839
+ columns: ['granted_by'];
1840
+ isOneToOne: false;
1841
+ referencedRelation: 'users';
1842
+ referencedColumns: ['id'];
1843
+ },
1844
+ {
1845
+ foreignKeyName: 'org_rol_assignments_membership_id_fkey';
1846
+ columns: ['membership_id'];
1847
+ isOneToOne: false;
1848
+ referencedRelation: 'org_memberships';
1849
+ referencedColumns: ['id'];
1850
+ },
1851
+ {
1852
+ foreignKeyName: 'org_rol_assignments_role_id_fkey';
1853
+ columns: ['role_id'];
1854
+ isOneToOne: false;
1855
+ referencedRelation: 'org_rol_definitions';
1856
+ referencedColumns: ['id'];
1857
+ }
1858
+ ];
1859
+ };
1860
+ org_rol_definitions: {
1861
+ Row: {
1862
+ created_at: string;
1863
+ description: string | null;
1864
+ id: string;
1865
+ is_system: boolean;
1866
+ name: string;
1867
+ organization_id: string | null;
1868
+ slug: string;
1869
+ updated_at: string;
1870
+ };
1871
+ Insert: {
1872
+ created_at?: string;
1873
+ description?: string | null;
1874
+ id?: string;
1875
+ is_system?: boolean;
1876
+ name: string;
1877
+ organization_id?: string | null;
1878
+ slug: string;
1879
+ updated_at?: string;
1880
+ };
1881
+ Update: {
1882
+ created_at?: string;
1883
+ description?: string | null;
1884
+ id?: string;
1885
+ is_system?: boolean;
1886
+ name?: string;
1887
+ organization_id?: string | null;
1888
+ slug?: string;
1889
+ updated_at?: string;
1890
+ };
1891
+ Relationships: [
1892
+ {
1893
+ foreignKeyName: 'org_rol_definitions_organization_id_fkey';
1894
+ columns: ['organization_id'];
1895
+ isOneToOne: false;
1896
+ referencedRelation: 'organizations';
1897
+ referencedColumns: ['id'];
1898
+ }
1899
+ ];
1900
+ };
1901
+ org_rol_grants: {
1902
+ Row: {
1903
+ granted_at: string;
1904
+ permission_key: string;
1905
+ role_id: string;
1906
+ };
1907
+ Insert: {
1908
+ granted_at?: string;
1909
+ permission_key: string;
1910
+ role_id: string;
1911
+ };
1912
+ Update: {
1913
+ granted_at?: string;
1914
+ permission_key?: string;
1915
+ role_id?: string;
1916
+ };
1917
+ Relationships: [
1918
+ {
1919
+ foreignKeyName: 'org_rol_grants_permission_key_fkey';
1920
+ columns: ['permission_key'];
1921
+ isOneToOne: false;
1922
+ referencedRelation: 'org_rol_permissions';
1923
+ referencedColumns: ['key'];
1924
+ },
1925
+ {
1926
+ foreignKeyName: 'org_rol_grants_role_id_fkey';
1927
+ columns: ['role_id'];
1928
+ isOneToOne: false;
1929
+ referencedRelation: 'org_rol_definitions';
1930
+ referencedColumns: ['id'];
1931
+ }
1932
+ ];
1933
+ };
1934
+ org_rol_permissions: {
1935
+ Row: {
1936
+ created_at: string;
1937
+ description: string;
1938
+ is_org_grantable: boolean;
1939
+ key: string;
1940
+ updated_at: string;
1941
+ };
1942
+ Insert: {
1943
+ created_at?: string;
1944
+ description: string;
1945
+ is_org_grantable?: boolean;
1946
+ key: string;
1947
+ updated_at?: string;
1948
+ };
1949
+ Update: {
1950
+ created_at?: string;
1951
+ description?: string;
1952
+ is_org_grantable?: boolean;
1953
+ key?: string;
1954
+ updated_at?: string;
1955
+ };
1956
+ Relationships: [];
1957
+ };
1958
+ organizations: {
1959
+ Row: {
1960
+ config: Json;
1961
+ created_at: string;
1962
+ id: string;
1963
+ is_test: boolean;
1964
+ metadata: Json;
1965
+ name: string;
1966
+ status: string;
1967
+ updated_at: string;
1968
+ workos_org_id: string;
1969
+ };
1970
+ Insert: {
1971
+ config?: Json;
1972
+ created_at?: string;
1973
+ id?: string;
1974
+ is_test?: boolean;
1975
+ metadata?: Json;
1976
+ name: string;
1977
+ status?: string;
1978
+ updated_at?: string;
1979
+ workos_org_id: string;
1980
+ };
1981
+ Update: {
1982
+ config?: Json;
1983
+ created_at?: string;
1984
+ id?: string;
1985
+ is_test?: boolean;
1986
+ metadata?: Json;
1987
+ name?: string;
1988
+ status?: string;
1989
+ updated_at?: string;
1990
+ workos_org_id?: string;
1991
+ };
1992
+ Relationships: [];
1993
+ };
1994
+ prj_milestones: {
1995
+ Row: {
1996
+ checklist: Json | null;
1997
+ completed_at: string | null;
1998
+ created_at: string;
1999
+ description: string | null;
2000
+ due_date: string | null;
2001
+ id: string;
2002
+ metadata: Json | null;
2003
+ name: string;
2004
+ organization_id: string;
2005
+ project_id: string;
2006
+ sequence: number;
2007
+ status: string;
2008
+ updated_at: string;
2009
+ };
2010
+ Insert: {
2011
+ checklist?: Json | null;
2012
+ completed_at?: string | null;
2013
+ created_at?: string;
2014
+ description?: string | null;
2015
+ due_date?: string | null;
2016
+ id?: string;
2017
+ metadata?: Json | null;
2018
+ name: string;
2019
+ organization_id: string;
2020
+ project_id: string;
2021
+ sequence?: number;
2022
+ status?: string;
2023
+ updated_at?: string;
2024
+ };
2025
+ Update: {
2026
+ checklist?: Json | null;
2027
+ completed_at?: string | null;
2028
+ created_at?: string;
2029
+ description?: string | null;
2030
+ due_date?: string | null;
2031
+ id?: string;
2032
+ metadata?: Json | null;
2033
+ name?: string;
2034
+ organization_id?: string;
2035
+ project_id?: string;
2036
+ sequence?: number;
2037
+ status?: string;
2038
+ updated_at?: string;
2039
+ };
2040
+ Relationships: [
2041
+ {
2042
+ foreignKeyName: 'fk_milestones_project';
2043
+ columns: ['project_id'];
2044
+ isOneToOne: false;
2045
+ referencedRelation: 'prj_projects';
2046
+ referencedColumns: ['id'];
2047
+ },
2048
+ {
2049
+ foreignKeyName: 'prj_milestones_organization_id_fkey';
2050
+ columns: ['organization_id'];
2051
+ isOneToOne: false;
2052
+ referencedRelation: 'organizations';
2053
+ referencedColumns: ['id'];
2054
+ },
2055
+ {
2056
+ foreignKeyName: 'prj_milestones_project_id_fkey';
2057
+ columns: ['project_id'];
2058
+ isOneToOne: false;
2059
+ referencedRelation: 'prj_projects';
2060
+ referencedColumns: ['id'];
2061
+ }
2062
+ ];
2063
+ };
2064
+ prj_notes: {
2065
+ Row: {
2066
+ content: string;
2067
+ created_at: string;
2068
+ created_by: string | null;
2069
+ id: string;
2070
+ metadata: Json | null;
2071
+ milestone_id: string | null;
2072
+ occurred_at: string;
2073
+ organization_id: string;
2074
+ project_id: string;
2075
+ summary: string | null;
2076
+ task_id: string | null;
2077
+ type: string;
2078
+ };
2079
+ Insert: {
2080
+ content: string;
2081
+ created_at?: string;
2082
+ created_by?: string | null;
2083
+ id?: string;
2084
+ metadata?: Json | null;
2085
+ milestone_id?: string | null;
2086
+ occurred_at?: string;
2087
+ organization_id: string;
2088
+ project_id: string;
2089
+ summary?: string | null;
2090
+ task_id?: string | null;
2091
+ type?: string;
2092
+ };
2093
+ Update: {
2094
+ content?: string;
2095
+ created_at?: string;
2096
+ created_by?: string | null;
2097
+ id?: string;
2098
+ metadata?: Json | null;
2099
+ milestone_id?: string | null;
2100
+ occurred_at?: string;
2101
+ organization_id?: string;
2102
+ project_id?: string;
2103
+ summary?: string | null;
2104
+ task_id?: string | null;
2105
+ type?: string;
2106
+ };
2107
+ Relationships: [
2108
+ {
2109
+ foreignKeyName: 'fk_notes_created_by';
2110
+ columns: ['created_by'];
2111
+ isOneToOne: false;
2112
+ referencedRelation: 'users';
2113
+ referencedColumns: ['id'];
2114
+ },
2115
+ {
2116
+ foreignKeyName: 'fk_notes_milestone';
2117
+ columns: ['milestone_id'];
2118
+ isOneToOne: false;
2119
+ referencedRelation: 'prj_milestones';
2120
+ referencedColumns: ['id'];
2121
+ },
2122
+ {
2123
+ foreignKeyName: 'fk_notes_project';
2124
+ columns: ['project_id'];
2125
+ isOneToOne: false;
2126
+ referencedRelation: 'prj_projects';
2127
+ referencedColumns: ['id'];
2128
+ },
2129
+ {
2130
+ foreignKeyName: 'fk_notes_task';
2131
+ columns: ['task_id'];
2132
+ isOneToOne: false;
2133
+ referencedRelation: 'prj_tasks';
2134
+ referencedColumns: ['id'];
2135
+ },
2136
+ {
2137
+ foreignKeyName: 'prj_notes_created_by_fkey';
2138
+ columns: ['created_by'];
2139
+ isOneToOne: false;
2140
+ referencedRelation: 'users';
2141
+ referencedColumns: ['id'];
2142
+ },
2143
+ {
2144
+ foreignKeyName: 'prj_notes_milestone_id_fkey';
2145
+ columns: ['milestone_id'];
2146
+ isOneToOne: false;
2147
+ referencedRelation: 'prj_milestones';
2148
+ referencedColumns: ['id'];
2149
+ },
2150
+ {
2151
+ foreignKeyName: 'prj_notes_organization_id_fkey';
2152
+ columns: ['organization_id'];
2153
+ isOneToOne: false;
2154
+ referencedRelation: 'organizations';
2155
+ referencedColumns: ['id'];
2156
+ },
2157
+ {
2158
+ foreignKeyName: 'prj_notes_project_id_fkey';
2159
+ columns: ['project_id'];
2160
+ isOneToOne: false;
2161
+ referencedRelation: 'prj_projects';
2162
+ referencedColumns: ['id'];
2163
+ },
2164
+ {
2165
+ foreignKeyName: 'prj_notes_task_id_fkey';
2166
+ columns: ['task_id'];
2167
+ isOneToOne: false;
2168
+ referencedRelation: 'prj_tasks';
2169
+ referencedColumns: ['id'];
2170
+ }
2171
+ ];
2172
+ };
2173
+ prj_projects: {
2174
+ Row: {
2175
+ actual_end_date: string | null;
2176
+ client_company_id: string | null;
2177
+ contract_value: number | null;
2178
+ created_at: string;
2179
+ deal_id: string | null;
2180
+ description: string | null;
2181
+ id: string;
2182
+ kind: string;
2183
+ metadata: Json | null;
2184
+ name: string;
2185
+ organization_id: string;
2186
+ start_date: string | null;
2187
+ status: string;
2188
+ target_end_date: string | null;
2189
+ updated_at: string;
2190
+ };
2191
+ Insert: {
2192
+ actual_end_date?: string | null;
2193
+ client_company_id?: string | null;
2194
+ contract_value?: number | null;
2195
+ created_at?: string;
2196
+ deal_id?: string | null;
2197
+ description?: string | null;
2198
+ id?: string;
2199
+ kind?: string;
2200
+ metadata?: Json | null;
2201
+ name: string;
2202
+ organization_id: string;
2203
+ start_date?: string | null;
2204
+ status?: string;
2205
+ target_end_date?: string | null;
2206
+ updated_at?: string;
2207
+ };
2208
+ Update: {
2209
+ actual_end_date?: string | null;
2210
+ client_company_id?: string | null;
2211
+ contract_value?: number | null;
2212
+ created_at?: string;
2213
+ deal_id?: string | null;
2214
+ description?: string | null;
2215
+ id?: string;
2216
+ kind?: string;
2217
+ metadata?: Json | null;
2218
+ name?: string;
2219
+ organization_id?: string;
2220
+ start_date?: string | null;
2221
+ status?: string;
2222
+ target_end_date?: string | null;
2223
+ updated_at?: string;
2224
+ };
2225
+ Relationships: [
2226
+ {
2227
+ foreignKeyName: 'fk_projects_company';
2228
+ columns: ['client_company_id'];
2229
+ isOneToOne: false;
2230
+ referencedRelation: 'acq_companies';
2231
+ referencedColumns: ['id'];
2232
+ },
2233
+ {
2234
+ foreignKeyName: 'fk_projects_deal';
2235
+ columns: ['deal_id'];
2236
+ isOneToOne: false;
2237
+ referencedRelation: 'acq_deals';
2238
+ referencedColumns: ['id'];
2239
+ },
2240
+ {
2241
+ foreignKeyName: 'prj_projects_client_company_id_fkey';
2242
+ columns: ['client_company_id'];
2243
+ isOneToOne: false;
2244
+ referencedRelation: 'acq_companies';
2245
+ referencedColumns: ['id'];
2246
+ },
2247
+ {
2248
+ foreignKeyName: 'prj_projects_deal_id_fkey';
2249
+ columns: ['deal_id'];
2250
+ isOneToOne: false;
2251
+ referencedRelation: 'acq_deals';
2252
+ referencedColumns: ['id'];
2253
+ },
2254
+ {
2255
+ foreignKeyName: 'prj_projects_organization_id_fkey';
2256
+ columns: ['organization_id'];
2257
+ isOneToOne: false;
2258
+ referencedRelation: 'organizations';
2259
+ referencedColumns: ['id'];
2260
+ }
2261
+ ];
2262
+ };
2263
+ prj_tasks: {
2264
+ Row: {
2265
+ checklist: Json;
2266
+ completed_at: string | null;
2267
+ created_at: string;
2268
+ description: string | null;
2269
+ due_date: string | null;
2270
+ file_url: string | null;
2271
+ id: string;
2272
+ metadata: Json | null;
2273
+ milestone_id: string | null;
2274
+ name: string;
2275
+ organization_id: string;
2276
+ parent_task_id: string | null;
2277
+ project_id: string;
2278
+ resume_context: Json | null;
2279
+ status: string;
2280
+ type: string;
2281
+ updated_at: string;
2282
+ };
2283
+ Insert: {
2284
+ checklist?: Json;
2285
+ completed_at?: string | null;
2286
+ created_at?: string;
2287
+ description?: string | null;
2288
+ due_date?: string | null;
2289
+ file_url?: string | null;
2290
+ id?: string;
2291
+ metadata?: Json | null;
2292
+ milestone_id?: string | null;
2293
+ name: string;
2294
+ organization_id: string;
2295
+ parent_task_id?: string | null;
2296
+ project_id: string;
2297
+ resume_context?: Json | null;
2298
+ status?: string;
2299
+ type?: string;
2300
+ updated_at?: string;
2301
+ };
2302
+ Update: {
2303
+ checklist?: Json;
2304
+ completed_at?: string | null;
2305
+ created_at?: string;
2306
+ description?: string | null;
2307
+ due_date?: string | null;
2308
+ file_url?: string | null;
2309
+ id?: string;
2310
+ metadata?: Json | null;
2311
+ milestone_id?: string | null;
2312
+ name?: string;
2313
+ organization_id?: string;
2314
+ parent_task_id?: string | null;
2315
+ project_id?: string;
2316
+ resume_context?: Json | null;
2317
+ status?: string;
2318
+ type?: string;
2319
+ updated_at?: string;
2320
+ };
2321
+ Relationships: [
2322
+ {
2323
+ foreignKeyName: 'fk_tasks_milestone';
2324
+ columns: ['milestone_id'];
2325
+ isOneToOne: false;
2326
+ referencedRelation: 'prj_milestones';
2327
+ referencedColumns: ['id'];
2328
+ },
2329
+ {
2330
+ foreignKeyName: 'fk_tasks_parent';
2331
+ columns: ['parent_task_id'];
2332
+ isOneToOne: false;
2333
+ referencedRelation: 'prj_tasks';
2334
+ referencedColumns: ['id'];
2335
+ },
2336
+ {
2337
+ foreignKeyName: 'fk_tasks_project';
2338
+ columns: ['project_id'];
2339
+ isOneToOne: false;
2340
+ referencedRelation: 'prj_projects';
2341
+ referencedColumns: ['id'];
2342
+ },
2343
+ {
2344
+ foreignKeyName: 'prj_tasks_milestone_id_fkey';
2345
+ columns: ['milestone_id'];
2346
+ isOneToOne: false;
2347
+ referencedRelation: 'prj_milestones';
2348
+ referencedColumns: ['id'];
2349
+ },
2350
+ {
2351
+ foreignKeyName: 'prj_tasks_organization_id_fkey';
2352
+ columns: ['organization_id'];
2353
+ isOneToOne: false;
2354
+ referencedRelation: 'organizations';
2355
+ referencedColumns: ['id'];
2356
+ },
2357
+ {
2358
+ foreignKeyName: 'prj_tasks_parent_task_id_fkey';
2359
+ columns: ['parent_task_id'];
2360
+ isOneToOne: false;
2361
+ referencedRelation: 'prj_tasks';
2362
+ referencedColumns: ['id'];
2363
+ },
2364
+ {
2365
+ foreignKeyName: 'prj_tasks_project_id_fkey';
2366
+ columns: ['project_id'];
2367
+ isOneToOne: false;
2368
+ referencedRelation: 'prj_projects';
2369
+ referencedColumns: ['id'];
2370
+ }
2371
+ ];
2372
+ };
2373
+ reported_requests: {
2374
+ Row: {
2375
+ affected_page: string | null;
2376
+ category: string;
2377
+ context: Json | null;
2378
+ created_at: string;
2379
+ description: string;
2380
+ evidence: Json | null;
2381
+ id: string;
2382
+ organization_id: string;
2383
+ project_id: string | null;
2384
+ reported_at: string;
2385
+ reporter_id: string | null;
2386
+ resolved_at: string | null;
2387
+ severity: string;
2388
+ source: string;
2389
+ status: string;
2390
+ task_id: string | null;
2391
+ title: string;
2392
+ type: string;
2393
+ updated_at: string;
2394
+ };
2395
+ Insert: {
2396
+ affected_page?: string | null;
2397
+ category: string;
2398
+ context?: Json | null;
2399
+ created_at?: string;
2400
+ description: string;
2401
+ evidence?: Json | null;
2402
+ id?: string;
2403
+ organization_id: string;
2404
+ project_id?: string | null;
2405
+ reported_at?: string;
2406
+ reporter_id?: string | null;
2407
+ resolved_at?: string | null;
2408
+ severity: string;
2409
+ source: string;
2410
+ status?: string;
2411
+ task_id?: string | null;
2412
+ title: string;
2413
+ type: string;
2414
+ updated_at?: string;
2415
+ };
2416
+ Update: {
2417
+ affected_page?: string | null;
2418
+ category?: string;
2419
+ context?: Json | null;
2420
+ created_at?: string;
2421
+ description?: string;
2422
+ evidence?: Json | null;
2423
+ id?: string;
2424
+ organization_id?: string;
2425
+ project_id?: string | null;
2426
+ reported_at?: string;
2427
+ reporter_id?: string | null;
2428
+ resolved_at?: string | null;
2429
+ severity?: string;
2430
+ source?: string;
2431
+ status?: string;
2432
+ task_id?: string | null;
2433
+ title?: string;
2434
+ type?: string;
2435
+ updated_at?: string;
2436
+ };
2437
+ Relationships: [
2438
+ {
2439
+ foreignKeyName: 'reported_requests_organization_id_fkey';
2440
+ columns: ['organization_id'];
2441
+ isOneToOne: false;
2442
+ referencedRelation: 'organizations';
2443
+ referencedColumns: ['id'];
2444
+ },
2445
+ {
2446
+ foreignKeyName: 'reported_requests_project_id_fkey';
2447
+ columns: ['project_id'];
2448
+ isOneToOne: false;
2449
+ referencedRelation: 'prj_projects';
2450
+ referencedColumns: ['id'];
2451
+ },
2452
+ {
2453
+ foreignKeyName: 'reported_requests_task_id_fkey';
2454
+ columns: ['task_id'];
2455
+ isOneToOne: false;
2456
+ referencedRelation: 'prj_tasks';
2457
+ referencedColumns: ['id'];
2458
+ }
2459
+ ];
2460
+ };
2461
+ session_messages: {
2462
+ Row: {
2463
+ created_at: string | null;
2464
+ id: string;
2465
+ message: string;
2466
+ message_index: number | null;
2467
+ message_type: string | null;
2468
+ metadata: Json | null;
2469
+ role: string;
2470
+ session_id: string;
2471
+ session_turn_number: number;
2472
+ };
2473
+ Insert: {
2474
+ created_at?: string | null;
2475
+ id: string;
2476
+ message: string;
2477
+ message_index?: number | null;
2478
+ message_type?: string | null;
2479
+ metadata?: Json | null;
2480
+ role: string;
2481
+ session_id: string;
2482
+ session_turn_number: number;
2483
+ };
2484
+ Update: {
2485
+ created_at?: string | null;
2486
+ id?: string;
2487
+ message?: string;
2488
+ message_index?: number | null;
2489
+ message_type?: string | null;
2490
+ metadata?: Json | null;
2491
+ role?: string;
2492
+ session_id?: string;
2493
+ session_turn_number?: number;
2494
+ };
2495
+ Relationships: [
2496
+ {
2497
+ foreignKeyName: 'session_messages_session_id_fkey';
2498
+ columns: ['session_id'];
2499
+ isOneToOne: false;
2500
+ referencedRelation: 'sessions';
2501
+ referencedColumns: ['session_id'];
2502
+ }
2503
+ ];
2504
+ };
2505
+ sessions: {
2506
+ Row: {
2507
+ context_window_size: number;
2508
+ created_at: string | null;
2509
+ cumulative_input_tokens: number;
2510
+ cumulative_output_tokens: number;
2511
+ deleted_at: string | null;
2512
+ ended_at: string | null;
2513
+ memory_snapshot: Json;
2514
+ metadata: Json | null;
2515
+ organization_id: string;
2516
+ resource_id: string;
2517
+ session_id: string;
2518
+ session_total_turns: number | null;
2519
+ updated_at: string | null;
2520
+ user_id: string | null;
2521
+ };
2522
+ Insert: {
2523
+ context_window_size?: number;
2524
+ created_at?: string | null;
2525
+ cumulative_input_tokens?: number;
2526
+ cumulative_output_tokens?: number;
2527
+ deleted_at?: string | null;
2528
+ ended_at?: string | null;
2529
+ memory_snapshot: Json;
2530
+ metadata?: Json | null;
2531
+ organization_id: string;
2532
+ resource_id: string;
2533
+ session_id?: string;
2534
+ session_total_turns?: number | null;
2535
+ updated_at?: string | null;
2536
+ user_id?: string | null;
2537
+ };
2538
+ Update: {
2539
+ context_window_size?: number;
2540
+ created_at?: string | null;
2541
+ cumulative_input_tokens?: number;
2542
+ cumulative_output_tokens?: number;
2543
+ deleted_at?: string | null;
2544
+ ended_at?: string | null;
2545
+ memory_snapshot?: Json;
2546
+ metadata?: Json | null;
2547
+ organization_id?: string;
2548
+ resource_id?: string;
2549
+ session_id?: string;
2550
+ session_total_turns?: number | null;
2551
+ updated_at?: string | null;
2552
+ user_id?: string | null;
2553
+ };
2554
+ Relationships: [
2555
+ {
2556
+ foreignKeyName: 'fk_organization';
2557
+ columns: ['organization_id'];
2558
+ isOneToOne: false;
2559
+ referencedRelation: 'organizations';
2560
+ referencedColumns: ['id'];
2561
+ },
2562
+ {
2563
+ foreignKeyName: 'fk_user';
2564
+ columns: ['user_id'];
2565
+ isOneToOne: false;
2566
+ referencedRelation: 'users';
2567
+ referencedColumns: ['id'];
2568
+ }
2569
+ ];
2570
+ };
2571
+ task_schedules: {
2572
+ Row: {
2573
+ created_at: string;
2574
+ current_step: number;
2575
+ description: string | null;
2576
+ id: string;
2577
+ idempotency_key: string | null;
2578
+ last_execution_id: string | null;
2579
+ last_run_at: string | null;
2580
+ max_retries: number;
2581
+ metadata: Json | null;
2582
+ name: string;
2583
+ next_run_at: string | null;
2584
+ organization_id: string;
2585
+ origin_execution_id: string | null;
2586
+ origin_resource_id: string | null;
2587
+ origin_resource_type: string | null;
2588
+ retry_count: number;
2589
+ schedule_config: Json;
2590
+ status: string;
2591
+ target_resource_id: string;
2592
+ target_resource_type: string;
2593
+ updated_at: string;
2594
+ };
2595
+ Insert: {
2596
+ created_at?: string;
2597
+ current_step?: number;
2598
+ description?: string | null;
2599
+ id?: string;
2600
+ idempotency_key?: string | null;
2601
+ last_execution_id?: string | null;
2602
+ last_run_at?: string | null;
2603
+ max_retries?: number;
2604
+ metadata?: Json | null;
2605
+ name: string;
2606
+ next_run_at?: string | null;
2607
+ organization_id: string;
2608
+ origin_execution_id?: string | null;
2609
+ origin_resource_id?: string | null;
2610
+ origin_resource_type?: string | null;
2611
+ retry_count?: number;
2612
+ schedule_config: Json;
2613
+ status?: string;
2614
+ target_resource_id: string;
2615
+ target_resource_type: string;
2616
+ updated_at?: string;
2617
+ };
2618
+ Update: {
2619
+ created_at?: string;
2620
+ current_step?: number;
2621
+ description?: string | null;
2622
+ id?: string;
2623
+ idempotency_key?: string | null;
2624
+ last_execution_id?: string | null;
2625
+ last_run_at?: string | null;
2626
+ max_retries?: number;
2627
+ metadata?: Json | null;
2628
+ name?: string;
2629
+ next_run_at?: string | null;
2630
+ organization_id?: string;
2631
+ origin_execution_id?: string | null;
2632
+ origin_resource_id?: string | null;
2633
+ origin_resource_type?: string | null;
2634
+ retry_count?: number;
2635
+ schedule_config?: Json;
2636
+ status?: string;
2637
+ target_resource_id?: string;
2638
+ target_resource_type?: string;
2639
+ updated_at?: string;
2640
+ };
2641
+ Relationships: [
2642
+ {
2643
+ foreignKeyName: 'task_schedules_organization_id_fkey';
2644
+ columns: ['organization_id'];
2645
+ isOneToOne: false;
2646
+ referencedRelation: 'organizations';
2647
+ referencedColumns: ['id'];
2648
+ }
2649
+ ];
2650
+ };
2651
+ users: {
2652
+ Row: {
2653
+ config: Json;
2654
+ created_at: string;
2655
+ display_name: string | null;
2656
+ email: string;
2657
+ first_name: string | null;
2658
+ id: string;
2659
+ is_active: boolean;
2660
+ is_platform_admin: boolean | null;
2661
+ last_login_at: string | null;
2662
+ last_name: string | null;
2663
+ last_visited_org: string | null;
2664
+ profile_picture_url: string | null;
2665
+ updated_at: string;
2666
+ workos_user_id: string | null;
2667
+ };
2668
+ Insert: {
2669
+ config?: Json;
2670
+ created_at?: string;
2671
+ display_name?: string | null;
2672
+ email: string;
2673
+ first_name?: string | null;
2674
+ id?: string;
2675
+ is_active?: boolean;
2676
+ is_platform_admin?: boolean | null;
2677
+ last_login_at?: string | null;
2678
+ last_name?: string | null;
2679
+ last_visited_org?: string | null;
2680
+ profile_picture_url?: string | null;
2681
+ updated_at?: string;
2682
+ workos_user_id?: string | null;
2683
+ };
2684
+ Update: {
2685
+ config?: Json;
2686
+ created_at?: string;
2687
+ display_name?: string | null;
2688
+ email?: string;
2689
+ first_name?: string | null;
2690
+ id?: string;
2691
+ is_active?: boolean;
2692
+ is_platform_admin?: boolean | null;
2693
+ last_login_at?: string | null;
2694
+ last_name?: string | null;
2695
+ last_visited_org?: string | null;
2696
+ profile_picture_url?: string | null;
2697
+ updated_at?: string;
2698
+ workos_user_id?: string | null;
2699
+ };
2700
+ Relationships: [
2701
+ {
2702
+ foreignKeyName: 'user_profiles_last_visited_org_fkey';
2703
+ columns: ['last_visited_org'];
2704
+ isOneToOne: false;
2705
+ referencedRelation: 'organizations';
2706
+ referencedColumns: ['id'];
2707
+ }
2708
+ ];
2709
+ };
2710
+ webhook_endpoints: {
2711
+ Row: {
2712
+ created_at: string;
2713
+ description: string | null;
2714
+ id: string;
2715
+ key_hash: string;
2716
+ key_prefix: string | null;
2717
+ last_triggered_at: string | null;
2718
+ name: string;
2719
+ organization_id: string;
2720
+ request_count: number;
2721
+ resource_id: string | null;
2722
+ status: string;
2723
+ updated_at: string;
2724
+ };
2725
+ Insert: {
2726
+ created_at?: string;
2727
+ description?: string | null;
2728
+ id?: string;
2729
+ key_hash: string;
2730
+ key_prefix?: string | null;
2731
+ last_triggered_at?: string | null;
2732
+ name: string;
2733
+ organization_id: string;
2734
+ request_count?: number;
2735
+ resource_id?: string | null;
2736
+ status?: string;
2737
+ updated_at?: string;
2738
+ };
2739
+ Update: {
2740
+ created_at?: string;
2741
+ description?: string | null;
2742
+ id?: string;
2743
+ key_hash?: string;
2744
+ key_prefix?: string | null;
2745
+ last_triggered_at?: string | null;
2746
+ name?: string;
2747
+ organization_id?: string;
2748
+ request_count?: number;
2749
+ resource_id?: string | null;
2750
+ status?: string;
2751
+ updated_at?: string;
2752
+ };
2753
+ Relationships: [
2754
+ {
2755
+ foreignKeyName: 'webhook_endpoints_organization_id_fkey';
2756
+ columns: ['organization_id'];
2757
+ isOneToOne: false;
2758
+ referencedRelation: 'organizations';
2759
+ referencedColumns: ['id'];
2760
+ }
2761
+ ];
2762
+ };
2763
+ };
2764
+ Views: {
2765
+ [_ in never]: never;
2766
+ };
2767
+ Functions: {
2768
+ acq_default_checklist: {
2769
+ Args: {
2770
+ p_platform: string;
2771
+ };
2772
+ Returns: Json;
2773
+ };
2774
+ append_deal_activity: {
2775
+ Args: {
2776
+ p_activity: Json;
2777
+ p_deal_id: string;
2778
+ p_organization_id: string;
2779
+ };
2780
+ Returns: undefined;
2781
+ };
2782
+ auth_jwt_claims: {
2783
+ Args: never;
2784
+ Returns: Json;
2785
+ };
2786
+ auth_uid_safe: {
2787
+ Args: never;
2788
+ Returns: string;
2789
+ };
2790
+ can_assign_role_in_org: {
2791
+ Args: {
2792
+ p_role_id: string;
2793
+ p_target_membership_id: string;
2794
+ };
2795
+ Returns: boolean;
2796
+ };
2797
+ current_user_is_platform_admin: {
2798
+ Args: never;
2799
+ Returns: boolean;
2800
+ };
2801
+ current_user_supabase_id: {
2802
+ Args: never;
2803
+ Returns: string;
2804
+ };
2805
+ detect_stalled_executions: {
2806
+ Args: never;
2807
+ Returns: undefined;
2808
+ };
2809
+ execute_session_turn: {
2810
+ Args: {
2811
+ p_session_id: string;
2812
+ };
2813
+ Returns: {
2814
+ created_at: string;
2815
+ ended_at: string;
2816
+ memory_snapshot: Json;
2817
+ metadata: Json;
2818
+ organization_id: string;
2819
+ resource_id: string;
2820
+ session_id: string;
2821
+ session_total_turns: number;
2822
+ updated_at: string;
2823
+ user_id: string;
2824
+ }[];
2825
+ };
2826
+ get_platform_credential_kek: {
2827
+ Args: never;
2828
+ Returns: string;
2829
+ };
2830
+ get_storage_org_id: {
2831
+ Args: {
2832
+ file_path: string;
2833
+ };
2834
+ Returns: string;
2835
+ };
2836
+ get_workos_user_id: {
2837
+ Args: never;
2838
+ Returns: string;
2839
+ };
2840
+ has_org_permission: {
2841
+ Args: {
2842
+ org_id: string;
2843
+ perm_key: string;
2844
+ };
2845
+ Returns: boolean;
2846
+ };
2847
+ is_org_member: {
2848
+ Args: {
2849
+ org_id: string;
2850
+ };
2851
+ Returns: boolean;
2852
+ };
2853
+ link_workos_membership_on_accept: {
2854
+ Args: {
2855
+ p_email: string;
2856
+ p_organization_id: string;
2857
+ p_workos_membership_id: string;
2858
+ };
2859
+ Returns: boolean;
2860
+ };
2861
+ pre_provision_invited_user: {
2862
+ Args: {
2863
+ p_email: string;
2864
+ p_organization_id: string;
2865
+ p_role_slug?: string;
2866
+ };
2867
+ Returns: Json;
2868
+ };
2869
+ process_due_schedules: {
2870
+ Args: never;
2871
+ Returns: Json;
2872
+ };
2873
+ recompute_all_memberships: {
2874
+ Args: never;
2875
+ Returns: undefined;
2876
+ };
2877
+ sync_all_memberships_with_role: {
2878
+ Args: {
2879
+ p_role_id: string;
2880
+ };
2881
+ Returns: undefined;
2882
+ };
2883
+ sync_one_membership: {
2884
+ Args: {
2885
+ p_membership_id: string;
2886
+ };
2887
+ Returns: undefined;
2888
+ };
2889
+ upsert_user_profile: {
2890
+ Args: never;
2891
+ Returns: {
2892
+ profile_display_name: string;
2893
+ profile_email: string;
2894
+ profile_id: string;
2895
+ profile_workos_user_id: string;
2896
+ }[];
2897
+ };
2898
+ };
2899
+ Enums: {
2900
+ [_ in never]: never;
2901
+ };
2902
+ CompositeTypes: {
2903
+ [_ in never]: never;
2904
+ };
2905
+ };
2906
+ };
2907
+
2908
+ /** Raw database row type for acq_deals table */
2909
+ type AcqDealRow = Database['public']['Tables']['acq_deals']['Row'];
2910
+
2911
+ interface ActionDef {
2912
+ key: string;
2913
+ label: string;
2914
+ isAvailableFor: (deal: AcqDealRow) => boolean;
2915
+ workflowId: string;
2916
+ payloadSchema?: z.ZodTypeAny;
2917
+ }
2918
+
6
2919
  interface ApiErrorDetails {
7
2920
  method: string;
8
2921
  statusCode: number;
@@ -174,6 +3087,8 @@ interface ElevasisAppConfig {
174
3087
  };
175
3088
  /** Custom QueryClient. A default is created internally when omitted. */
176
3089
  queryClient?: QueryClient;
3090
+ /** CRM action definitions for shared deal action surfaces. Defaults to platform actions. */
3091
+ crmActions?: ActionDef[];
177
3092
  /** Callback for API errors (status >= 500) */
178
3093
  onApiError?: (endpoint: string, error: Error, details?: ApiErrorDetails) => void;
179
3094
  /**