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