@elevasis/ui 2.75.0 → 2.76.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 (105) hide show
  1. package/dist/api/index.js +3 -3
  2. package/dist/app/index.d.ts +277 -249
  3. package/dist/app/index.js +12 -11
  4. package/dist/auth/index.js +6 -7
  5. package/dist/charts/index.js +6 -7
  6. package/dist/{chunk-CRPH5AAB.js → chunk-2GIHWU5O.js} +4 -3
  7. package/dist/chunk-2Y6AKWGU.js +42 -0
  8. package/dist/chunk-3QYRZSHP.js +854 -0
  9. package/dist/{chunk-L3NBMLRN.js → chunk-3RK2NNJX.js} +1 -1
  10. package/dist/{chunk-R6NMRXNO.js → chunk-4WLAVUPS.js} +1 -1
  11. package/dist/{chunk-DTEGVSJ6.js → chunk-5R4I2PAN.js} +9 -43
  12. package/dist/chunk-6B4ZPBQJ.js +7 -0
  13. package/dist/{chunk-QFS2GZMV.js → chunk-73G3I5HJ.js} +160 -160
  14. package/dist/{chunk-7OOFMEX6.js → chunk-BFLYDVEN.js} +28 -41
  15. package/dist/{chunk-VWGCURZF.js → chunk-BG6PWDJ3.js} +381 -381
  16. package/dist/{chunk-5VF5LPYS.js → chunk-BV2RNLPP.js} +1 -1
  17. package/dist/{chunk-NMHQAYZU.js → chunk-CTT4RDXE.js} +150 -151
  18. package/dist/chunk-E2LJ3FRA.js +237 -0
  19. package/dist/{chunk-5RH6NYZH.js → chunk-EFQLXRYT.js} +1 -2
  20. package/dist/{chunk-M6VAZAQW.js → chunk-EVNLJHDD.js} +3 -3
  21. package/dist/{chunk-NYIIRZSA.js → chunk-GDQQX5SL.js} +4 -42
  22. package/dist/{chunk-IYATYH5I.js → chunk-GFSOQH3N.js} +1 -1
  23. package/dist/{chunk-G7O4CBMC.js → chunk-H5AEYSVX.js} +164 -3
  24. package/dist/{chunk-ZFISGKYW.js → chunk-IIEZXXDD.js} +1 -1
  25. package/dist/{chunk-5SLRGUC4.js → chunk-INCEZAM3.js} +1 -1
  26. package/dist/{chunk-ZG6YJUT4.js → chunk-JZQNUQE4.js} +1 -1
  27. package/dist/{chunk-SB3IHM5Y.js → chunk-K55TU6CC.js} +2023 -1700
  28. package/dist/chunk-KB5CAN5D.js +33 -0
  29. package/dist/{chunk-OGHTJKBV.js → chunk-KMA4FOSV.js} +5682 -5675
  30. package/dist/{chunk-ICHDIVQO.js → chunk-KXNRTJAE.js} +1 -1
  31. package/dist/{chunk-MLHZUN2X.js → chunk-MGAELVTZ.js} +12 -12
  32. package/dist/chunk-MKH2KOAO.js +39 -0
  33. package/dist/{chunk-6BJ5HMMC.js → chunk-NAPXMYFW.js} +35 -362
  34. package/dist/{chunk-GDTK33QT.js → chunk-OGG3QJYW.js} +14 -5
  35. package/dist/{chunk-SN7X5N2A.js → chunk-P6HHXMLJ.js} +1 -1
  36. package/dist/{chunk-SEYOVNS5.js → chunk-QAILYRC2.js} +1 -1
  37. package/dist/{chunk-RBGVNPA6.js → chunk-RXZ3XDBM.js} +1 -1
  38. package/dist/{chunk-2ZRY3ARL.js → chunk-SPW6UA6B.js} +1 -1
  39. package/dist/{chunk-3H5DIJN7.js → chunk-SVZR4GYA.js} +1 -1
  40. package/dist/{chunk-47YJVIZE.js → chunk-UEY4AB3R.js} +789 -66
  41. package/dist/{chunk-LFLM723H.js → chunk-UL6MPMKY.js} +1 -1
  42. package/dist/{chunk-TX3UHDL5.js → chunk-WELN7DDV.js} +2 -2
  43. package/dist/{chunk-D3XXPCCK.js → chunk-WJN2VVVJ.js} +1 -1
  44. package/dist/{chunk-DMSTDZCJ.js → chunk-XODQUPFW.js} +11 -11
  45. package/dist/components/index.d.ts +135 -25
  46. package/dist/components/index.js +2165 -1996
  47. package/dist/components/navigation/index.js +7 -8
  48. package/dist/features/auth/index.d.ts +35 -3716
  49. package/dist/features/auth/index.js +9 -10
  50. package/dist/features/clients/index.js +18 -12
  51. package/dist/features/content/index.js +27 -27
  52. package/dist/features/crm/index.css +59 -59
  53. package/dist/features/crm/index.d.ts +18 -1
  54. package/dist/features/crm/index.js +13 -11
  55. package/dist/features/dashboard/index.css +59 -59
  56. package/dist/features/dashboard/index.js +8 -9
  57. package/dist/features/delivery/index.d.ts +3 -0
  58. package/dist/features/delivery/index.js +21 -20
  59. package/dist/features/knowledge/index.js +6 -7
  60. package/dist/features/lead-gen/index.css +59 -59
  61. package/dist/features/lead-gen/index.d.ts +3903 -2
  62. package/dist/features/lead-gen/index.js +15 -13
  63. package/dist/features/monitoring/index.js +10 -11
  64. package/dist/features/monitoring/requests/index.css +59 -59
  65. package/dist/features/monitoring/requests/index.js +8 -9
  66. package/dist/features/notes/index.js +4 -4
  67. package/dist/features/operations/index.css +59 -59
  68. package/dist/features/operations/index.js +13 -15
  69. package/dist/features/seo/index.css +659 -0
  70. package/dist/features/seo/index.d.ts +3962 -1
  71. package/dist/features/seo/index.js +31 -2
  72. package/dist/features/settings/index.css +59 -59
  73. package/dist/features/settings/index.d.ts +79 -3742
  74. package/dist/features/settings/index.js +10 -12
  75. package/dist/hooks/access/index.js +6 -7
  76. package/dist/hooks/delivery/index.css +59 -59
  77. package/dist/hooks/delivery/index.d.ts +13 -4
  78. package/dist/hooks/delivery/index.js +3 -3
  79. package/dist/hooks/published.d.ts +63 -25
  80. package/dist/hooks/published.js +19 -19
  81. package/dist/initialization/index.d.ts +35 -3716
  82. package/dist/knowledge/index.js +11 -11
  83. package/dist/layout/index.d.ts +55 -2
  84. package/dist/layout/index.js +10 -10
  85. package/dist/organization/index.css +59 -59
  86. package/dist/profile/index.d.ts +64 -3716
  87. package/dist/provider/index.d.ts +3 -0
  88. package/dist/provider/index.js +6 -7
  89. package/dist/provider/published.d.ts +3 -0
  90. package/dist/provider/published.js +6 -7
  91. package/dist/test-utils/index.js +3 -3
  92. package/dist/theme/index.js +3 -3
  93. package/dist/theme/presets/index.js +1 -1
  94. package/dist/types/index.d.ts +298 -251
  95. package/dist/utils/index.d.ts +1 -1
  96. package/dist/utils/index.js +1 -1
  97. package/package.json +5 -9
  98. package/src/hooks/README.md +22 -23
  99. package/dist/chunk-6ZAP3FOA.js +0 -93
  100. package/dist/chunk-AH52XQB7.js +0 -1
  101. package/dist/chunk-DVAOCHIF.js +0 -165
  102. package/dist/chunk-MISHPEJX.js +0 -244
  103. package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +0 -879
  104. package/dist/hooks/operations/command-view/utils/transformCommandViewData.js +0 -2
  105. /package/dist/{chunk-A2SB32YV.js → chunk-5ZK7K7YP.js} +0 -0
@@ -51,7 +51,3744 @@ interface LeadGenSidebarMiddleProps {
51
51
  }
52
52
  declare const LeadGenSidebarMiddle: ({ items }?: LeadGenSidebarMiddleProps) => react_jsx_runtime.JSX.Element;
53
53
 
54
+ type Json = string | number | boolean | null | {
55
+ [key: string]: Json | undefined;
56
+ } | Json[];
57
+ type Database = {
58
+ public: {
59
+ Tables: {
60
+ acq_companies: {
61
+ Row: {
62
+ batch_id: string | null;
63
+ category: string | null;
64
+ category_pain: string | null;
65
+ client_id: string | null;
66
+ created_at: string;
67
+ domain: string | null;
68
+ enrichment_data: Json | null;
69
+ filter_reason: string | null;
70
+ founded_year: number | null;
71
+ id: string;
72
+ linkedin_url: string | null;
73
+ location_city: string | null;
74
+ location_state: string | null;
75
+ name: string;
76
+ num_employees: number | null;
77
+ organization_id: string;
78
+ processing_state: Json;
79
+ qualification_rubric_key: string | null;
80
+ qualification_score: number | null;
81
+ qualification_signals: Json | null;
82
+ segment: string | null;
83
+ source: string | null;
84
+ status: string;
85
+ updated_at: string;
86
+ website: string | null;
87
+ };
88
+ Insert: {
89
+ batch_id?: string | null;
90
+ category?: string | null;
91
+ category_pain?: string | null;
92
+ client_id?: string | null;
93
+ created_at?: string;
94
+ domain?: string | null;
95
+ enrichment_data?: Json | null;
96
+ filter_reason?: string | null;
97
+ founded_year?: number | null;
98
+ id?: string;
99
+ linkedin_url?: string | null;
100
+ location_city?: string | null;
101
+ location_state?: string | null;
102
+ name: string;
103
+ num_employees?: number | null;
104
+ organization_id: string;
105
+ processing_state?: Json;
106
+ qualification_rubric_key?: string | null;
107
+ qualification_score?: number | null;
108
+ qualification_signals?: Json | null;
109
+ segment?: string | null;
110
+ source?: string | null;
111
+ status?: string;
112
+ updated_at?: string;
113
+ website?: string | null;
114
+ };
115
+ Update: {
116
+ batch_id?: string | null;
117
+ category?: string | null;
118
+ category_pain?: string | null;
119
+ client_id?: string | null;
120
+ created_at?: string;
121
+ domain?: string | null;
122
+ enrichment_data?: Json | null;
123
+ filter_reason?: string | null;
124
+ founded_year?: number | null;
125
+ id?: string;
126
+ linkedin_url?: string | null;
127
+ location_city?: string | null;
128
+ location_state?: string | null;
129
+ name?: string;
130
+ num_employees?: number | null;
131
+ organization_id?: string;
132
+ processing_state?: Json;
133
+ qualification_rubric_key?: string | null;
134
+ qualification_score?: number | null;
135
+ qualification_signals?: Json | null;
136
+ segment?: string | null;
137
+ source?: string | null;
138
+ status?: string;
139
+ updated_at?: string;
140
+ website?: string | null;
141
+ };
142
+ Relationships: [
143
+ {
144
+ foreignKeyName: "acq_companies_client_id_fkey";
145
+ columns: ["client_id"];
146
+ isOneToOne: false;
147
+ referencedRelation: "clients";
148
+ referencedColumns: ["id"];
149
+ },
150
+ {
151
+ foreignKeyName: "acq_companies_organization_id_fkey";
152
+ columns: ["organization_id"];
153
+ isOneToOne: false;
154
+ referencedRelation: "organizations";
155
+ referencedColumns: ["id"];
156
+ }
157
+ ];
158
+ };
159
+ acq_contacts: {
160
+ Row: {
161
+ batch_id: string | null;
162
+ brochure_first_viewed_at: string | null;
163
+ brochure_view_count: number;
164
+ client_id: string | null;
165
+ company_id: string | null;
166
+ created_at: string;
167
+ email: string;
168
+ email_valid: string | null;
169
+ enrichment_data: Json;
170
+ filter_reason: string | null;
171
+ first_name: string | null;
172
+ headline: string | null;
173
+ id: string;
174
+ last_name: string | null;
175
+ linkedin_url: string | null;
176
+ nurture: boolean;
177
+ opening_line: string | null;
178
+ organization_id: string;
179
+ processing_state: Json;
180
+ qualification_rubric_key: string | null;
181
+ qualification_score: number | null;
182
+ qualification_signals: Json | null;
183
+ source: string | null;
184
+ source_id: string | null;
185
+ status: string;
186
+ title: string | null;
187
+ updated_at: string;
188
+ };
189
+ Insert: {
190
+ batch_id?: string | null;
191
+ brochure_first_viewed_at?: string | null;
192
+ brochure_view_count?: number;
193
+ client_id?: string | null;
194
+ company_id?: string | null;
195
+ created_at?: string;
196
+ email: string;
197
+ email_valid?: string | null;
198
+ enrichment_data?: Json;
199
+ filter_reason?: string | null;
200
+ first_name?: string | null;
201
+ headline?: string | null;
202
+ id?: string;
203
+ last_name?: string | null;
204
+ linkedin_url?: string | null;
205
+ nurture?: boolean;
206
+ opening_line?: string | null;
207
+ organization_id: string;
208
+ processing_state?: Json;
209
+ qualification_rubric_key?: string | null;
210
+ qualification_score?: number | null;
211
+ qualification_signals?: Json | null;
212
+ source?: string | null;
213
+ source_id?: string | null;
214
+ status?: string;
215
+ title?: string | null;
216
+ updated_at?: string;
217
+ };
218
+ Update: {
219
+ batch_id?: string | null;
220
+ brochure_first_viewed_at?: string | null;
221
+ brochure_view_count?: number;
222
+ client_id?: string | null;
223
+ company_id?: string | null;
224
+ created_at?: string;
225
+ email?: string;
226
+ email_valid?: string | null;
227
+ enrichment_data?: Json;
228
+ filter_reason?: string | null;
229
+ first_name?: string | null;
230
+ headline?: string | null;
231
+ id?: string;
232
+ last_name?: string | null;
233
+ linkedin_url?: string | null;
234
+ nurture?: boolean;
235
+ opening_line?: string | null;
236
+ organization_id?: string;
237
+ processing_state?: Json;
238
+ qualification_rubric_key?: string | null;
239
+ qualification_score?: number | null;
240
+ qualification_signals?: Json | null;
241
+ source?: string | null;
242
+ source_id?: string | null;
243
+ status?: string;
244
+ title?: string | null;
245
+ updated_at?: string;
246
+ };
247
+ Relationships: [
248
+ {
249
+ foreignKeyName: "acq_contacts_client_id_fkey";
250
+ columns: ["client_id"];
251
+ isOneToOne: false;
252
+ referencedRelation: "clients";
253
+ referencedColumns: ["id"];
254
+ },
255
+ {
256
+ foreignKeyName: "acq_contacts_company_id_fkey";
257
+ columns: ["company_id"];
258
+ isOneToOne: false;
259
+ referencedRelation: "acq_companies";
260
+ referencedColumns: ["id"];
261
+ },
262
+ {
263
+ foreignKeyName: "acq_contacts_organization_id_fkey";
264
+ columns: ["organization_id"];
265
+ isOneToOne: false;
266
+ referencedRelation: "organizations";
267
+ referencedColumns: ["id"];
268
+ }
269
+ ];
270
+ };
271
+ acq_deal_notes: {
272
+ Row: {
273
+ author_user_id: string | null;
274
+ body: string;
275
+ created_at: string;
276
+ deal_id: string;
277
+ id: string;
278
+ organization_id: string;
279
+ updated_at: string;
280
+ };
281
+ Insert: {
282
+ author_user_id?: string | null;
283
+ body: string;
284
+ created_at?: string;
285
+ deal_id: string;
286
+ id?: string;
287
+ organization_id: string;
288
+ updated_at?: string;
289
+ };
290
+ Update: {
291
+ author_user_id?: string | null;
292
+ body?: string;
293
+ created_at?: string;
294
+ deal_id?: string;
295
+ id?: string;
296
+ organization_id?: string;
297
+ updated_at?: string;
298
+ };
299
+ Relationships: [
300
+ {
301
+ foreignKeyName: "acq_deal_notes_author_user_id_fkey";
302
+ columns: ["author_user_id"];
303
+ isOneToOne: false;
304
+ referencedRelation: "users";
305
+ referencedColumns: ["id"];
306
+ },
307
+ {
308
+ foreignKeyName: "acq_deal_notes_deal_id_fkey";
309
+ columns: ["deal_id"];
310
+ isOneToOne: false;
311
+ referencedRelation: "acq_deals";
312
+ referencedColumns: ["id"];
313
+ },
314
+ {
315
+ foreignKeyName: "acq_deal_notes_organization_id_fkey";
316
+ columns: ["organization_id"];
317
+ isOneToOne: false;
318
+ referencedRelation: "organizations";
319
+ referencedColumns: ["id"];
320
+ }
321
+ ];
322
+ };
323
+ acq_deal_tasks: {
324
+ Row: {
325
+ assignee_user_id: string | null;
326
+ completed_at: string | null;
327
+ completed_by_user_id: string | null;
328
+ created_at: string;
329
+ created_by_user_id: string | null;
330
+ deal_id: string;
331
+ description: string | null;
332
+ due_at: string | null;
333
+ id: string;
334
+ kind: string;
335
+ organization_id: string;
336
+ title: string;
337
+ updated_at: string;
338
+ };
339
+ Insert: {
340
+ assignee_user_id?: string | null;
341
+ completed_at?: string | null;
342
+ completed_by_user_id?: string | null;
343
+ created_at?: string;
344
+ created_by_user_id?: string | null;
345
+ deal_id: string;
346
+ description?: string | null;
347
+ due_at?: string | null;
348
+ id?: string;
349
+ kind?: string;
350
+ organization_id: string;
351
+ title: string;
352
+ updated_at?: string;
353
+ };
354
+ Update: {
355
+ assignee_user_id?: string | null;
356
+ completed_at?: string | null;
357
+ completed_by_user_id?: string | null;
358
+ created_at?: string;
359
+ created_by_user_id?: string | null;
360
+ deal_id?: string;
361
+ description?: string | null;
362
+ due_at?: string | null;
363
+ id?: string;
364
+ kind?: string;
365
+ organization_id?: string;
366
+ title?: string;
367
+ updated_at?: string;
368
+ };
369
+ Relationships: [
370
+ {
371
+ foreignKeyName: "acq_deal_tasks_assignee_user_id_fkey";
372
+ columns: ["assignee_user_id"];
373
+ isOneToOne: false;
374
+ referencedRelation: "users";
375
+ referencedColumns: ["id"];
376
+ },
377
+ {
378
+ foreignKeyName: "acq_deal_tasks_completed_by_user_id_fkey";
379
+ columns: ["completed_by_user_id"];
380
+ isOneToOne: false;
381
+ referencedRelation: "users";
382
+ referencedColumns: ["id"];
383
+ },
384
+ {
385
+ foreignKeyName: "acq_deal_tasks_created_by_user_id_fkey";
386
+ columns: ["created_by_user_id"];
387
+ isOneToOne: false;
388
+ referencedRelation: "users";
389
+ referencedColumns: ["id"];
390
+ },
391
+ {
392
+ foreignKeyName: "acq_deal_tasks_deal_id_fkey";
393
+ columns: ["deal_id"];
394
+ isOneToOne: false;
395
+ referencedRelation: "acq_deals";
396
+ referencedColumns: ["id"];
397
+ },
398
+ {
399
+ foreignKeyName: "acq_deal_tasks_organization_id_fkey";
400
+ columns: ["organization_id"];
401
+ isOneToOne: false;
402
+ referencedRelation: "organizations";
403
+ referencedColumns: ["id"];
404
+ }
405
+ ];
406
+ };
407
+ acq_deals: {
408
+ Row: {
409
+ activity_log: Json;
410
+ client_id: string | null;
411
+ closed_lost_at: string | null;
412
+ closed_lost_reason: string | null;
413
+ company_id: string | null;
414
+ contact_email: string;
415
+ contact_id: string | null;
416
+ created_at: string;
417
+ discovery_data: Json | null;
418
+ discovery_submitted_at: string | null;
419
+ discovery_submitted_by: string | null;
420
+ id: string;
421
+ initial_fee: number | null;
422
+ instantly_email_account: string | null;
423
+ instantly_thread_uuid: string | null;
424
+ monthly_fee: number | null;
425
+ organization_id: string;
426
+ payment_link_sent_at: string | null;
427
+ payment_received_at: string | null;
428
+ pipeline_key: string;
429
+ proposal_data: Json | null;
430
+ proposal_generated_at: string | null;
431
+ proposal_pdf_url: string | null;
432
+ proposal_reviewed_at: string | null;
433
+ proposal_reviewed_by: string | null;
434
+ proposal_sent_at: string | null;
435
+ proposal_signed_at: string | null;
436
+ signature_envelope_id: string | null;
437
+ source_list_id: string | null;
438
+ source_type: string | null;
439
+ stage_key: string | null;
440
+ state_key: string | null;
441
+ stripe_payment_id: string | null;
442
+ stripe_payment_link: string | null;
443
+ stripe_payment_link_id: string | null;
444
+ stripe_subscription_id: string | null;
445
+ updated_at: string;
446
+ };
447
+ Insert: {
448
+ activity_log?: Json;
449
+ client_id?: string | null;
450
+ closed_lost_at?: string | null;
451
+ closed_lost_reason?: string | null;
452
+ company_id?: string | null;
453
+ contact_email: string;
454
+ contact_id?: string | null;
455
+ created_at?: string;
456
+ discovery_data?: Json | null;
457
+ discovery_submitted_at?: string | null;
458
+ discovery_submitted_by?: string | null;
459
+ id?: string;
460
+ initial_fee?: number | null;
461
+ instantly_email_account?: string | null;
462
+ instantly_thread_uuid?: string | null;
463
+ monthly_fee?: number | null;
464
+ organization_id: string;
465
+ payment_link_sent_at?: string | null;
466
+ payment_received_at?: string | null;
467
+ pipeline_key?: string;
468
+ proposal_data?: Json | null;
469
+ proposal_generated_at?: string | null;
470
+ proposal_pdf_url?: string | null;
471
+ proposal_reviewed_at?: string | null;
472
+ proposal_reviewed_by?: string | null;
473
+ proposal_sent_at?: string | null;
474
+ proposal_signed_at?: string | null;
475
+ signature_envelope_id?: string | null;
476
+ source_list_id?: string | null;
477
+ source_type?: string | null;
478
+ stage_key?: string | null;
479
+ state_key?: 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
+ client_id?: string | null;
489
+ closed_lost_at?: string | null;
490
+ closed_lost_reason?: string | null;
491
+ company_id?: string | null;
492
+ contact_email?: string;
493
+ contact_id?: string | null;
494
+ created_at?: string;
495
+ discovery_data?: Json | null;
496
+ discovery_submitted_at?: string | null;
497
+ discovery_submitted_by?: string | null;
498
+ id?: string;
499
+ initial_fee?: number | null;
500
+ instantly_email_account?: string | null;
501
+ instantly_thread_uuid?: string | null;
502
+ monthly_fee?: number | null;
503
+ organization_id?: string;
504
+ payment_link_sent_at?: string | null;
505
+ payment_received_at?: string | null;
506
+ pipeline_key?: string;
507
+ proposal_data?: Json | null;
508
+ proposal_generated_at?: string | null;
509
+ proposal_pdf_url?: string | null;
510
+ proposal_reviewed_at?: string | null;
511
+ proposal_reviewed_by?: string | null;
512
+ proposal_sent_at?: string | null;
513
+ proposal_signed_at?: string | null;
514
+ signature_envelope_id?: string | null;
515
+ source_list_id?: string | null;
516
+ source_type?: string | null;
517
+ stage_key?: string | null;
518
+ state_key?: string | null;
519
+ stripe_payment_id?: string | null;
520
+ stripe_payment_link?: string | null;
521
+ stripe_payment_link_id?: string | null;
522
+ stripe_subscription_id?: string | null;
523
+ updated_at?: string;
524
+ };
525
+ Relationships: [
526
+ {
527
+ foreignKeyName: "acq_deals_client_id_fkey";
528
+ columns: ["client_id"];
529
+ isOneToOne: false;
530
+ referencedRelation: "clients";
531
+ referencedColumns: ["id"];
532
+ },
533
+ {
534
+ foreignKeyName: "acq_deals_company_id_fkey";
535
+ columns: ["company_id"];
536
+ isOneToOne: false;
537
+ referencedRelation: "acq_companies";
538
+ referencedColumns: ["id"];
539
+ },
540
+ {
541
+ foreignKeyName: "acq_deals_contact_id_fkey";
542
+ columns: ["contact_id"];
543
+ isOneToOne: false;
544
+ referencedRelation: "acq_contacts";
545
+ referencedColumns: ["id"];
546
+ },
547
+ {
548
+ foreignKeyName: "acq_deals_discovery_submitted_by_fkey";
549
+ columns: ["discovery_submitted_by"];
550
+ isOneToOne: false;
551
+ referencedRelation: "users";
552
+ referencedColumns: ["id"];
553
+ },
554
+ {
555
+ foreignKeyName: "acq_deals_organization_id_fkey";
556
+ columns: ["organization_id"];
557
+ isOneToOne: false;
558
+ referencedRelation: "organizations";
559
+ referencedColumns: ["id"];
560
+ },
561
+ {
562
+ foreignKeyName: "acq_deals_proposal_reviewed_by_fkey";
563
+ columns: ["proposal_reviewed_by"];
564
+ isOneToOne: false;
565
+ referencedRelation: "users";
566
+ referencedColumns: ["id"];
567
+ },
568
+ {
569
+ foreignKeyName: "acq_deals_source_list_id_fkey";
570
+ columns: ["source_list_id"];
571
+ isOneToOne: false;
572
+ referencedRelation: "acq_lists";
573
+ referencedColumns: ["id"];
574
+ }
575
+ ];
576
+ };
577
+ acq_list_companies: {
578
+ Row: {
579
+ activity_log: Json;
580
+ added_at: string;
581
+ added_by: string | null;
582
+ company_id: string;
583
+ id: string;
584
+ list_id: string;
585
+ pipeline_key: string;
586
+ source_execution_id: string | null;
587
+ source_input_hash: string | null;
588
+ source_resource_id: string | null;
589
+ stage_key: string;
590
+ state_key: string;
591
+ };
592
+ Insert: {
593
+ activity_log?: Json;
594
+ added_at?: string;
595
+ added_by?: string | null;
596
+ company_id: string;
597
+ id?: string;
598
+ list_id: string;
599
+ pipeline_key?: string;
600
+ source_execution_id?: string | null;
601
+ source_input_hash?: string | null;
602
+ source_resource_id?: string | null;
603
+ stage_key: string;
604
+ state_key: string;
605
+ };
606
+ Update: {
607
+ activity_log?: Json;
608
+ added_at?: string;
609
+ added_by?: string | null;
610
+ company_id?: string;
611
+ id?: string;
612
+ list_id?: string;
613
+ pipeline_key?: string;
614
+ source_execution_id?: string | null;
615
+ source_input_hash?: string | null;
616
+ source_resource_id?: string | null;
617
+ stage_key?: string;
618
+ state_key?: string;
619
+ };
620
+ Relationships: [
621
+ {
622
+ foreignKeyName: "acq_list_companies_added_by_fkey";
623
+ columns: ["added_by"];
624
+ isOneToOne: false;
625
+ referencedRelation: "users";
626
+ referencedColumns: ["id"];
627
+ },
628
+ {
629
+ foreignKeyName: "acq_list_companies_company_id_fkey";
630
+ columns: ["company_id"];
631
+ isOneToOne: false;
632
+ referencedRelation: "acq_companies";
633
+ referencedColumns: ["id"];
634
+ },
635
+ {
636
+ foreignKeyName: "acq_list_companies_list_id_fkey";
637
+ columns: ["list_id"];
638
+ isOneToOne: false;
639
+ referencedRelation: "acq_lists";
640
+ referencedColumns: ["id"];
641
+ },
642
+ {
643
+ foreignKeyName: "acq_list_companies_source_execution_id_fkey";
644
+ columns: ["source_execution_id"];
645
+ isOneToOne: false;
646
+ referencedRelation: "execution_logs";
647
+ referencedColumns: ["execution_id"];
648
+ }
649
+ ];
650
+ };
651
+ acq_list_executions: {
652
+ Row: {
653
+ created_at: string;
654
+ execution_id: string;
655
+ id: string;
656
+ list_id: string;
657
+ payload: Json;
658
+ };
659
+ Insert: {
660
+ created_at?: string;
661
+ execution_id: string;
662
+ id?: string;
663
+ list_id: string;
664
+ payload?: Json;
665
+ };
666
+ Update: {
667
+ created_at?: string;
668
+ execution_id?: string;
669
+ id?: string;
670
+ list_id?: string;
671
+ payload?: Json;
672
+ };
673
+ Relationships: [
674
+ {
675
+ foreignKeyName: "acq_list_executions_execution_id_fkey";
676
+ columns: ["execution_id"];
677
+ isOneToOne: false;
678
+ referencedRelation: "execution_logs";
679
+ referencedColumns: ["execution_id"];
680
+ },
681
+ {
682
+ foreignKeyName: "acq_list_executions_list_id_fkey";
683
+ columns: ["list_id"];
684
+ isOneToOne: false;
685
+ referencedRelation: "acq_lists";
686
+ referencedColumns: ["id"];
687
+ }
688
+ ];
689
+ };
690
+ acq_list_members: {
691
+ Row: {
692
+ activity_log: Json;
693
+ added_at: string;
694
+ added_by: string | null;
695
+ contact_id: string;
696
+ id: string;
697
+ list_id: string;
698
+ pipeline_key: string;
699
+ source_execution_id: string | null;
700
+ source_input_hash: string | null;
701
+ source_resource_id: string | null;
702
+ stage_key: string;
703
+ state_key: string;
704
+ };
705
+ Insert: {
706
+ activity_log?: Json;
707
+ added_at?: string;
708
+ added_by?: string | null;
709
+ contact_id: string;
710
+ id?: string;
711
+ list_id: string;
712
+ pipeline_key?: string;
713
+ source_execution_id?: string | null;
714
+ source_input_hash?: string | null;
715
+ source_resource_id?: string | null;
716
+ stage_key: string;
717
+ state_key: string;
718
+ };
719
+ Update: {
720
+ activity_log?: Json;
721
+ added_at?: string;
722
+ added_by?: string | null;
723
+ contact_id?: string;
724
+ id?: string;
725
+ list_id?: string;
726
+ pipeline_key?: string;
727
+ source_execution_id?: string | null;
728
+ source_input_hash?: string | null;
729
+ source_resource_id?: string | null;
730
+ stage_key?: string;
731
+ state_key?: string;
732
+ };
733
+ Relationships: [
734
+ {
735
+ foreignKeyName: "acq_list_members_added_by_fkey";
736
+ columns: ["added_by"];
737
+ isOneToOne: false;
738
+ referencedRelation: "users";
739
+ referencedColumns: ["id"];
740
+ },
741
+ {
742
+ foreignKeyName: "acq_list_members_contact_id_fkey";
743
+ columns: ["contact_id"];
744
+ isOneToOne: false;
745
+ referencedRelation: "acq_contacts";
746
+ referencedColumns: ["id"];
747
+ },
748
+ {
749
+ foreignKeyName: "acq_list_members_list_id_fkey";
750
+ columns: ["list_id"];
751
+ isOneToOne: false;
752
+ referencedRelation: "acq_lists";
753
+ referencedColumns: ["id"];
754
+ },
755
+ {
756
+ foreignKeyName: "acq_list_members_source_execution_id_fkey";
757
+ columns: ["source_execution_id"];
758
+ isOneToOne: false;
759
+ referencedRelation: "execution_logs";
760
+ referencedColumns: ["execution_id"];
761
+ }
762
+ ];
763
+ };
764
+ acq_lists: {
765
+ Row: {
766
+ batch_ids: string[];
767
+ completed_at: string | null;
768
+ created_at: string;
769
+ description: string | null;
770
+ icp: Json;
771
+ id: string;
772
+ instantly_campaign_id: string | null;
773
+ launched_at: string | null;
774
+ metadata: Json;
775
+ name: string;
776
+ organization_id: string;
777
+ pipeline_config: Json;
778
+ scraping_config: Json;
779
+ status: string;
780
+ };
781
+ Insert: {
782
+ batch_ids?: string[];
783
+ completed_at?: string | null;
784
+ created_at?: string;
785
+ description?: string | null;
786
+ icp?: Json;
787
+ id?: string;
788
+ instantly_campaign_id?: string | null;
789
+ launched_at?: string | null;
790
+ metadata?: Json;
791
+ name: string;
792
+ organization_id: string;
793
+ pipeline_config?: Json;
794
+ scraping_config?: Json;
795
+ status?: string;
796
+ };
797
+ Update: {
798
+ batch_ids?: string[];
799
+ completed_at?: string | null;
800
+ created_at?: string;
801
+ description?: string | null;
802
+ icp?: Json;
803
+ id?: string;
804
+ instantly_campaign_id?: string | null;
805
+ launched_at?: string | null;
806
+ metadata?: Json;
807
+ name?: string;
808
+ organization_id?: string;
809
+ pipeline_config?: Json;
810
+ scraping_config?: Json;
811
+ status?: string;
812
+ };
813
+ Relationships: [
814
+ {
815
+ foreignKeyName: "acq_lists_organization_id_fkey";
816
+ columns: ["organization_id"];
817
+ isOneToOne: false;
818
+ referencedRelation: "organizations";
819
+ referencedColumns: ["id"];
820
+ }
821
+ ];
822
+ };
823
+ acq_seo_metrics: {
824
+ Row: {
825
+ ai_citations: Json | null;
826
+ avg_position: number | null;
827
+ clicks: number | null;
828
+ created_at: string;
829
+ cta_clicks: number | null;
830
+ ctr: number | null;
831
+ data_point_count: number | null;
832
+ faq_count: number | null;
833
+ form_submissions: number | null;
834
+ id: string;
835
+ impressions: number | null;
836
+ organization_id: string;
837
+ period: string;
838
+ quality_score: number | null;
839
+ readability: number | null;
840
+ scroll_100: number | null;
841
+ scroll_25: number | null;
842
+ scroll_50: number | null;
843
+ scroll_75: number | null;
844
+ seo_page_id: string;
845
+ word_count: number | null;
846
+ };
847
+ Insert: {
848
+ ai_citations?: Json | null;
849
+ avg_position?: number | null;
850
+ clicks?: number | null;
851
+ created_at?: string;
852
+ cta_clicks?: number | null;
853
+ ctr?: number | null;
854
+ data_point_count?: number | null;
855
+ faq_count?: number | null;
856
+ form_submissions?: number | null;
857
+ id?: string;
858
+ impressions?: number | null;
859
+ organization_id: string;
860
+ period: string;
861
+ quality_score?: number | null;
862
+ readability?: number | null;
863
+ scroll_100?: number | null;
864
+ scroll_25?: number | null;
865
+ scroll_50?: number | null;
866
+ scroll_75?: number | null;
867
+ seo_page_id: string;
868
+ word_count?: number | null;
869
+ };
870
+ Update: {
871
+ ai_citations?: Json | null;
872
+ avg_position?: number | null;
873
+ clicks?: number | null;
874
+ created_at?: string;
875
+ cta_clicks?: number | null;
876
+ ctr?: number | null;
877
+ data_point_count?: number | null;
878
+ faq_count?: number | null;
879
+ form_submissions?: number | null;
880
+ id?: string;
881
+ impressions?: number | null;
882
+ organization_id?: string;
883
+ period?: string;
884
+ quality_score?: number | null;
885
+ readability?: number | null;
886
+ scroll_100?: number | null;
887
+ scroll_25?: number | null;
888
+ scroll_50?: number | null;
889
+ scroll_75?: number | null;
890
+ seo_page_id?: string;
891
+ word_count?: number | null;
892
+ };
893
+ Relationships: [
894
+ {
895
+ foreignKeyName: "acq_seo_metrics_organization_id_fkey";
896
+ columns: ["organization_id"];
897
+ isOneToOne: false;
898
+ referencedRelation: "organizations";
899
+ referencedColumns: ["id"];
900
+ },
901
+ {
902
+ foreignKeyName: "acq_seo_metrics_seo_page_id_fkey";
903
+ columns: ["seo_page_id"];
904
+ isOneToOne: false;
905
+ referencedRelation: "acq_seo_pages";
906
+ referencedColumns: ["id"];
907
+ }
908
+ ];
909
+ };
910
+ acq_seo_pages: {
911
+ Row: {
912
+ city: string | null;
913
+ content: Json | null;
914
+ created_at: string;
915
+ faq_items: Json | null;
916
+ hero_image_url: string | null;
917
+ id: string;
918
+ internal_links: Json | null;
919
+ local_data: Json | null;
920
+ meta_description: string | null;
921
+ organization_id: string;
922
+ page_type: string;
923
+ published_at: string | null;
924
+ refreshed_at: string | null;
925
+ schema_markup: Json | null;
926
+ slug: string;
927
+ state: string | null;
928
+ status: string;
929
+ title: string;
930
+ updated_at: string;
931
+ use_case: string | null;
932
+ vertical: string;
933
+ };
934
+ Insert: {
935
+ city?: string | null;
936
+ content?: Json | null;
937
+ created_at?: string;
938
+ faq_items?: Json | null;
939
+ hero_image_url?: string | null;
940
+ id?: string;
941
+ internal_links?: Json | null;
942
+ local_data?: Json | null;
943
+ meta_description?: string | null;
944
+ organization_id: string;
945
+ page_type: string;
946
+ published_at?: string | null;
947
+ refreshed_at?: string | null;
948
+ schema_markup?: Json | null;
949
+ slug: string;
950
+ state?: string | null;
951
+ status?: string;
952
+ title: string;
953
+ updated_at?: string;
954
+ use_case?: string | null;
955
+ vertical: string;
956
+ };
957
+ Update: {
958
+ city?: string | null;
959
+ content?: Json | null;
960
+ created_at?: string;
961
+ faq_items?: Json | null;
962
+ hero_image_url?: string | null;
963
+ id?: string;
964
+ internal_links?: Json | null;
965
+ local_data?: Json | null;
966
+ meta_description?: string | null;
967
+ organization_id?: string;
968
+ page_type?: string;
969
+ published_at?: string | null;
970
+ refreshed_at?: string | null;
971
+ schema_markup?: Json | null;
972
+ slug?: string;
973
+ state?: string | null;
974
+ status?: string;
975
+ title?: string;
976
+ updated_at?: string;
977
+ use_case?: string | null;
978
+ vertical?: string;
979
+ };
980
+ Relationships: [
981
+ {
982
+ foreignKeyName: "acq_seo_pages_organization_id_fkey";
983
+ columns: ["organization_id"];
984
+ isOneToOne: false;
985
+ referencedRelation: "organizations";
986
+ referencedColumns: ["id"];
987
+ }
988
+ ];
989
+ };
990
+ acq_social_posts: {
991
+ Row: {
992
+ author_name: string;
993
+ author_url: string | null;
994
+ comments_count: number;
995
+ created_at: string;
996
+ discovered_at: string;
997
+ engagement_count: number;
998
+ feedback: string | null;
999
+ final_response: string | null;
1000
+ fully_reviewed: boolean;
1001
+ id: string;
1002
+ initial_draft: string | null;
1003
+ matched_keywords: string[];
1004
+ matched_query: string | null;
1005
+ metadata: Json;
1006
+ organization_id: string;
1007
+ platform: string;
1008
+ platform_post_id: string;
1009
+ post_text: string;
1010
+ post_title: string;
1011
+ post_url: string;
1012
+ posted_at: string;
1013
+ relevance_score: number;
1014
+ responded_at: string | null;
1015
+ reviewed_at: string | null;
1016
+ skip_reason: string | null;
1017
+ source_category: string | null;
1018
+ status: string;
1019
+ updated_at: string;
1020
+ };
1021
+ Insert: {
1022
+ author_name: string;
1023
+ author_url?: string | null;
1024
+ comments_count?: number;
1025
+ created_at?: string;
1026
+ discovered_at?: string;
1027
+ engagement_count?: number;
1028
+ feedback?: string | null;
1029
+ final_response?: string | null;
1030
+ fully_reviewed?: boolean;
1031
+ id?: string;
1032
+ initial_draft?: string | null;
1033
+ matched_keywords?: string[];
1034
+ matched_query?: string | null;
1035
+ metadata?: Json;
1036
+ organization_id: string;
1037
+ platform: string;
1038
+ platform_post_id: string;
1039
+ post_text: string;
1040
+ post_title: string;
1041
+ post_url: string;
1042
+ posted_at: string;
1043
+ relevance_score?: number;
1044
+ responded_at?: string | null;
1045
+ reviewed_at?: string | null;
1046
+ skip_reason?: string | null;
1047
+ source_category?: string | null;
1048
+ status?: string;
1049
+ updated_at?: string;
1050
+ };
1051
+ Update: {
1052
+ author_name?: string;
1053
+ author_url?: string | null;
1054
+ comments_count?: number;
1055
+ created_at?: string;
1056
+ discovered_at?: string;
1057
+ engagement_count?: number;
1058
+ feedback?: string | null;
1059
+ final_response?: string | null;
1060
+ fully_reviewed?: boolean;
1061
+ id?: string;
1062
+ initial_draft?: string | null;
1063
+ matched_keywords?: string[];
1064
+ matched_query?: string | null;
1065
+ metadata?: Json;
1066
+ organization_id?: string;
1067
+ platform?: string;
1068
+ platform_post_id?: string;
1069
+ post_text?: string;
1070
+ post_title?: string;
1071
+ post_url?: string;
1072
+ posted_at?: string;
1073
+ relevance_score?: number;
1074
+ responded_at?: string | null;
1075
+ reviewed_at?: string | null;
1076
+ skip_reason?: string | null;
1077
+ source_category?: string | null;
1078
+ status?: string;
1079
+ updated_at?: string;
1080
+ };
1081
+ Relationships: [
1082
+ {
1083
+ foreignKeyName: "acq_social_posts_organization_id_fkey";
1084
+ columns: ["organization_id"];
1085
+ isOneToOne: false;
1086
+ referencedRelation: "organizations";
1087
+ referencedColumns: ["id"];
1088
+ }
1089
+ ];
1090
+ };
1091
+ activities: {
1092
+ Row: {
1093
+ activity_type: string;
1094
+ actor_api_key_id: string | null;
1095
+ actor_id: string | null;
1096
+ actor_type: string | null;
1097
+ created_at: string;
1098
+ description: string | null;
1099
+ entity_id: string;
1100
+ entity_name: string | null;
1101
+ entity_type: string;
1102
+ id: string;
1103
+ metadata: Json | null;
1104
+ occurred_at: string;
1105
+ organization_id: string;
1106
+ status: string;
1107
+ title: string;
1108
+ };
1109
+ Insert: {
1110
+ activity_type: string;
1111
+ actor_api_key_id?: string | null;
1112
+ actor_id?: string | null;
1113
+ actor_type?: string | null;
1114
+ created_at?: string;
1115
+ description?: string | null;
1116
+ entity_id: string;
1117
+ entity_name?: string | null;
1118
+ entity_type: string;
1119
+ id?: string;
1120
+ metadata?: Json | null;
1121
+ occurred_at?: string;
1122
+ organization_id: string;
1123
+ status: string;
1124
+ title: string;
1125
+ };
1126
+ Update: {
1127
+ activity_type?: string;
1128
+ actor_api_key_id?: string | null;
1129
+ actor_id?: string | null;
1130
+ actor_type?: string | null;
1131
+ created_at?: string;
1132
+ description?: string | null;
1133
+ entity_id?: string;
1134
+ entity_name?: string | null;
1135
+ entity_type?: string;
1136
+ id?: string;
1137
+ metadata?: Json | null;
1138
+ occurred_at?: string;
1139
+ organization_id?: string;
1140
+ status?: string;
1141
+ title?: string;
1142
+ };
1143
+ Relationships: [
1144
+ {
1145
+ foreignKeyName: "activities_actor_api_key_id_fkey";
1146
+ columns: ["actor_api_key_id"];
1147
+ isOneToOne: false;
1148
+ referencedRelation: "api_keys";
1149
+ referencedColumns: ["id"];
1150
+ },
1151
+ {
1152
+ foreignKeyName: "activities_actor_id_fkey";
1153
+ columns: ["actor_id"];
1154
+ isOneToOne: false;
1155
+ referencedRelation: "users";
1156
+ referencedColumns: ["id"];
1157
+ },
1158
+ {
1159
+ foreignKeyName: "activities_organization_id_fkey";
1160
+ columns: ["organization_id"];
1161
+ isOneToOne: false;
1162
+ referencedRelation: "organizations";
1163
+ referencedColumns: ["id"];
1164
+ }
1165
+ ];
1166
+ };
1167
+ agent_access_grants: {
1168
+ Row: {
1169
+ allowed_origins: string[];
1170
+ branding: Json;
1171
+ capture_fields: Json;
1172
+ code_hash: string | null;
1173
+ code_salt: string | null;
1174
+ created_at: string;
1175
+ disabled_at: string | null;
1176
+ expires_at: string | null;
1177
+ id: string;
1178
+ max_sessions_per_visitor: number;
1179
+ max_turns_per_session: number;
1180
+ mode: string;
1181
+ organization_id: string;
1182
+ resource_id: string;
1183
+ slug: string;
1184
+ tool_policy: Json;
1185
+ updated_at: string;
1186
+ };
1187
+ Insert: {
1188
+ allowed_origins?: string[];
1189
+ branding?: Json;
1190
+ capture_fields?: Json;
1191
+ code_hash?: string | null;
1192
+ code_salt?: string | null;
1193
+ created_at?: string;
1194
+ disabled_at?: string | null;
1195
+ expires_at?: string | null;
1196
+ id?: string;
1197
+ max_sessions_per_visitor?: number;
1198
+ max_turns_per_session?: number;
1199
+ mode?: string;
1200
+ organization_id: string;
1201
+ resource_id: string;
1202
+ slug: string;
1203
+ tool_policy?: Json;
1204
+ updated_at?: string;
1205
+ };
1206
+ Update: {
1207
+ allowed_origins?: string[];
1208
+ branding?: Json;
1209
+ capture_fields?: Json;
1210
+ code_hash?: string | null;
1211
+ code_salt?: string | null;
1212
+ created_at?: string;
1213
+ disabled_at?: string | null;
1214
+ expires_at?: string | null;
1215
+ id?: string;
1216
+ max_sessions_per_visitor?: number;
1217
+ max_turns_per_session?: number;
1218
+ mode?: string;
1219
+ organization_id?: string;
1220
+ resource_id?: string;
1221
+ slug?: string;
1222
+ tool_policy?: Json;
1223
+ updated_at?: string;
1224
+ };
1225
+ Relationships: [
1226
+ {
1227
+ foreignKeyName: "agent_access_grants_organization_id_fkey";
1228
+ columns: ["organization_id"];
1229
+ isOneToOne: false;
1230
+ referencedRelation: "organizations";
1231
+ referencedColumns: ["id"];
1232
+ }
1233
+ ];
1234
+ };
1235
+ api_keys: {
1236
+ Row: {
1237
+ created_at: string | null;
1238
+ created_by: string | null;
1239
+ id: string;
1240
+ key_hash: string;
1241
+ last_used_at: string | null;
1242
+ name: string;
1243
+ organization_id: string;
1244
+ };
1245
+ Insert: {
1246
+ created_at?: string | null;
1247
+ created_by?: string | null;
1248
+ id?: string;
1249
+ key_hash: string;
1250
+ last_used_at?: string | null;
1251
+ name: string;
1252
+ organization_id: string;
1253
+ };
1254
+ Update: {
1255
+ created_at?: string | null;
1256
+ created_by?: string | null;
1257
+ id?: string;
1258
+ key_hash?: string;
1259
+ last_used_at?: string | null;
1260
+ name?: string;
1261
+ organization_id?: string;
1262
+ };
1263
+ Relationships: [
1264
+ {
1265
+ foreignKeyName: "api_keys_created_by_fkey";
1266
+ columns: ["created_by"];
1267
+ isOneToOne: false;
1268
+ referencedRelation: "users";
1269
+ referencedColumns: ["id"];
1270
+ },
1271
+ {
1272
+ foreignKeyName: "api_keys_organization_id_fkey";
1273
+ columns: ["organization_id"];
1274
+ isOneToOne: false;
1275
+ referencedRelation: "organizations";
1276
+ referencedColumns: ["id"];
1277
+ }
1278
+ ];
1279
+ };
1280
+ artifacts: {
1281
+ Row: {
1282
+ content: Json;
1283
+ created_at: string;
1284
+ created_by: string | null;
1285
+ id: string;
1286
+ is_active: boolean;
1287
+ kind: string;
1288
+ organization_id: string;
1289
+ owner_id: string | null;
1290
+ owner_kind: string;
1291
+ pipeline_id: string | null;
1292
+ source_execution_id: string | null;
1293
+ updated_at: string;
1294
+ version: number;
1295
+ };
1296
+ Insert: {
1297
+ content: Json;
1298
+ created_at?: string;
1299
+ created_by?: string | null;
1300
+ id?: string;
1301
+ is_active?: boolean;
1302
+ kind: string;
1303
+ organization_id: string;
1304
+ owner_id?: string | null;
1305
+ owner_kind: string;
1306
+ pipeline_id?: string | null;
1307
+ source_execution_id?: string | null;
1308
+ updated_at?: string;
1309
+ version?: number;
1310
+ };
1311
+ Update: {
1312
+ content?: Json;
1313
+ created_at?: string;
1314
+ created_by?: string | null;
1315
+ id?: string;
1316
+ is_active?: boolean;
1317
+ kind?: string;
1318
+ organization_id?: string;
1319
+ owner_id?: string | null;
1320
+ owner_kind?: string;
1321
+ pipeline_id?: string | null;
1322
+ source_execution_id?: string | null;
1323
+ updated_at?: string;
1324
+ version?: number;
1325
+ };
1326
+ Relationships: [
1327
+ {
1328
+ foreignKeyName: "artifacts_organization_id_fkey";
1329
+ columns: ["organization_id"];
1330
+ isOneToOne: false;
1331
+ referencedRelation: "organizations";
1332
+ referencedColumns: ["id"];
1333
+ }
1334
+ ];
1335
+ };
1336
+ clients: {
1337
+ Row: {
1338
+ converted_at: string | null;
1339
+ created_at: string;
1340
+ id: string;
1341
+ metadata: Json;
1342
+ name: string;
1343
+ organization_id: string;
1344
+ primary_company_id: string | null;
1345
+ primary_contact_id: string | null;
1346
+ source: string;
1347
+ source_deal_id: string | null;
1348
+ status: string;
1349
+ updated_at: string;
1350
+ };
1351
+ Insert: {
1352
+ converted_at?: string | null;
1353
+ created_at?: string;
1354
+ id?: string;
1355
+ metadata?: Json;
1356
+ name: string;
1357
+ organization_id: string;
1358
+ primary_company_id?: string | null;
1359
+ primary_contact_id?: string | null;
1360
+ source?: string;
1361
+ source_deal_id?: string | null;
1362
+ status?: string;
1363
+ updated_at?: string;
1364
+ };
1365
+ Update: {
1366
+ converted_at?: string | null;
1367
+ created_at?: string;
1368
+ id?: string;
1369
+ metadata?: Json;
1370
+ name?: string;
1371
+ organization_id?: string;
1372
+ primary_company_id?: string | null;
1373
+ primary_contact_id?: string | null;
1374
+ source?: string;
1375
+ source_deal_id?: string | null;
1376
+ status?: string;
1377
+ updated_at?: string;
1378
+ };
1379
+ Relationships: [
1380
+ {
1381
+ foreignKeyName: "clients_organization_id_fkey";
1382
+ columns: ["organization_id"];
1383
+ isOneToOne: false;
1384
+ referencedRelation: "organizations";
1385
+ referencedColumns: ["id"];
1386
+ },
1387
+ {
1388
+ foreignKeyName: "clients_primary_company_id_fkey";
1389
+ columns: ["primary_company_id"];
1390
+ isOneToOne: false;
1391
+ referencedRelation: "acq_companies";
1392
+ referencedColumns: ["id"];
1393
+ },
1394
+ {
1395
+ foreignKeyName: "clients_primary_contact_id_fkey";
1396
+ columns: ["primary_contact_id"];
1397
+ isOneToOne: false;
1398
+ referencedRelation: "acq_contacts";
1399
+ referencedColumns: ["id"];
1400
+ },
1401
+ {
1402
+ foreignKeyName: "clients_source_deal_id_fkey";
1403
+ columns: ["source_deal_id"];
1404
+ isOneToOne: false;
1405
+ referencedRelation: "acq_deals";
1406
+ referencedColumns: ["id"];
1407
+ }
1408
+ ];
1409
+ };
1410
+ command_queue: {
1411
+ Row: {
1412
+ action_payload: Json | null;
1413
+ actions: Json;
1414
+ completed_at: string | null;
1415
+ completed_by: string | null;
1416
+ context: Json;
1417
+ created_at: string;
1418
+ description: string | null;
1419
+ expires_at: string | null;
1420
+ human_checkpoint: string | null;
1421
+ id: string;
1422
+ idempotency_key: string | null;
1423
+ metadata: Json | null;
1424
+ organization_id: string;
1425
+ origin_execution_id: string;
1426
+ origin_resource_id: string;
1427
+ origin_resource_type: string;
1428
+ priority: number;
1429
+ selected_action: string | null;
1430
+ status: string;
1431
+ target_execution_id: string | null;
1432
+ target_resource_id: string | null;
1433
+ target_resource_type: string | null;
1434
+ };
1435
+ Insert: {
1436
+ action_payload?: Json | null;
1437
+ actions: Json;
1438
+ completed_at?: string | null;
1439
+ completed_by?: string | null;
1440
+ context: Json;
1441
+ created_at?: string;
1442
+ description?: string | null;
1443
+ expires_at?: string | null;
1444
+ human_checkpoint?: string | null;
1445
+ id?: string;
1446
+ idempotency_key?: string | null;
1447
+ metadata?: Json | null;
1448
+ organization_id: string;
1449
+ origin_execution_id: string;
1450
+ origin_resource_id: string;
1451
+ origin_resource_type: string;
1452
+ priority?: number;
1453
+ selected_action?: string | null;
1454
+ status?: string;
1455
+ target_execution_id?: string | null;
1456
+ target_resource_id?: string | null;
1457
+ target_resource_type?: string | null;
1458
+ };
1459
+ Update: {
1460
+ action_payload?: Json | null;
1461
+ actions?: Json;
1462
+ completed_at?: string | null;
1463
+ completed_by?: string | null;
1464
+ context?: Json;
1465
+ created_at?: string;
1466
+ description?: string | null;
1467
+ expires_at?: string | null;
1468
+ human_checkpoint?: string | null;
1469
+ id?: string;
1470
+ idempotency_key?: string | null;
1471
+ metadata?: Json | null;
1472
+ organization_id?: string;
1473
+ origin_execution_id?: string;
1474
+ origin_resource_id?: string;
1475
+ origin_resource_type?: string;
1476
+ priority?: number;
1477
+ selected_action?: string | null;
1478
+ status?: string;
1479
+ target_execution_id?: string | null;
1480
+ target_resource_id?: string | null;
1481
+ target_resource_type?: string | null;
1482
+ };
1483
+ Relationships: [
1484
+ {
1485
+ foreignKeyName: "command_queue_completed_by_fkey";
1486
+ columns: ["completed_by"];
1487
+ isOneToOne: false;
1488
+ referencedRelation: "users";
1489
+ referencedColumns: ["id"];
1490
+ },
1491
+ {
1492
+ foreignKeyName: "command_queue_organization_id_fkey";
1493
+ columns: ["organization_id"];
1494
+ isOneToOne: false;
1495
+ referencedRelation: "organizations";
1496
+ referencedColumns: ["id"];
1497
+ },
1498
+ {
1499
+ foreignKeyName: "command_queue_target_execution_id_fkey";
1500
+ columns: ["target_execution_id"];
1501
+ isOneToOne: false;
1502
+ referencedRelation: "execution_logs";
1503
+ referencedColumns: ["execution_id"];
1504
+ }
1505
+ ];
1506
+ };
1507
+ content_distribution_metrics: {
1508
+ Row: {
1509
+ captured_at: string;
1510
+ created_at: string;
1511
+ distribution_id: string;
1512
+ id: string;
1513
+ metrics: Json;
1514
+ organization_id: string;
1515
+ raw: Json;
1516
+ source: string;
1517
+ source_execution_id: string | null;
1518
+ };
1519
+ Insert: {
1520
+ captured_at?: string;
1521
+ created_at?: string;
1522
+ distribution_id: string;
1523
+ id?: string;
1524
+ metrics?: Json;
1525
+ organization_id: string;
1526
+ raw?: Json;
1527
+ source: string;
1528
+ source_execution_id?: string | null;
1529
+ };
1530
+ Update: {
1531
+ captured_at?: string;
1532
+ created_at?: string;
1533
+ distribution_id?: string;
1534
+ id?: string;
1535
+ metrics?: Json;
1536
+ organization_id?: string;
1537
+ raw?: Json;
1538
+ source?: string;
1539
+ source_execution_id?: string | null;
1540
+ };
1541
+ Relationships: [
1542
+ {
1543
+ foreignKeyName: "content_distribution_metrics_distribution_fkey";
1544
+ columns: ["distribution_id", "organization_id"];
1545
+ isOneToOne: false;
1546
+ referencedRelation: "content_distributions";
1547
+ referencedColumns: ["id", "organization_id"];
1548
+ },
1549
+ {
1550
+ foreignKeyName: "content_distribution_metrics_organization_id_fkey";
1551
+ columns: ["organization_id"];
1552
+ isOneToOne: false;
1553
+ referencedRelation: "organizations";
1554
+ referencedColumns: ["id"];
1555
+ },
1556
+ {
1557
+ foreignKeyName: "content_distribution_metrics_source_execution_id_fkey";
1558
+ columns: ["source_execution_id"];
1559
+ isOneToOne: false;
1560
+ referencedRelation: "execution_logs";
1561
+ referencedColumns: ["execution_id"];
1562
+ }
1563
+ ];
1564
+ };
1565
+ content_distributions: {
1566
+ Row: {
1567
+ adapted_body: string | null;
1568
+ checklist: Json | null;
1569
+ content_item_id: string;
1570
+ created_at: string;
1571
+ format: string;
1572
+ id: string;
1573
+ media_urls: Json;
1574
+ metrics: Json;
1575
+ metrics_updated_at: string | null;
1576
+ organization_id: string;
1577
+ platform: string;
1578
+ platform_content: Json | null;
1579
+ platform_post_id: string | null;
1580
+ platform_url: string | null;
1581
+ processing_state: Json;
1582
+ publish_method: string | null;
1583
+ published_at: string | null;
1584
+ status: string;
1585
+ updated_at: string;
1586
+ };
1587
+ Insert: {
1588
+ adapted_body?: string | null;
1589
+ checklist?: Json | null;
1590
+ content_item_id: string;
1591
+ created_at?: string;
1592
+ format: string;
1593
+ id?: string;
1594
+ media_urls?: Json;
1595
+ metrics?: Json;
1596
+ metrics_updated_at?: string | null;
1597
+ organization_id: string;
1598
+ platform: string;
1599
+ platform_content?: Json | null;
1600
+ platform_post_id?: string | null;
1601
+ platform_url?: string | null;
1602
+ processing_state?: Json;
1603
+ publish_method?: string | null;
1604
+ published_at?: string | null;
1605
+ status?: string;
1606
+ updated_at?: string;
1607
+ };
1608
+ Update: {
1609
+ adapted_body?: string | null;
1610
+ checklist?: Json | null;
1611
+ content_item_id?: string;
1612
+ created_at?: string;
1613
+ format?: string;
1614
+ id?: string;
1615
+ media_urls?: Json;
1616
+ metrics?: Json;
1617
+ metrics_updated_at?: string | null;
1618
+ organization_id?: string;
1619
+ platform?: string;
1620
+ platform_content?: Json | null;
1621
+ platform_post_id?: string | null;
1622
+ platform_url?: string | null;
1623
+ processing_state?: Json;
1624
+ publish_method?: string | null;
1625
+ published_at?: string | null;
1626
+ status?: string;
1627
+ updated_at?: string;
1628
+ };
1629
+ Relationships: [
1630
+ {
1631
+ foreignKeyName: "content_distributions_content_item_id_fkey";
1632
+ columns: ["content_item_id"];
1633
+ isOneToOne: false;
1634
+ referencedRelation: "content_items";
1635
+ referencedColumns: ["id"];
1636
+ },
1637
+ {
1638
+ foreignKeyName: "content_distributions_organization_id_fkey";
1639
+ columns: ["organization_id"];
1640
+ isOneToOne: false;
1641
+ referencedRelation: "organizations";
1642
+ referencedColumns: ["id"];
1643
+ }
1644
+ ];
1645
+ };
1646
+ content_item_attempts: {
1647
+ Row: {
1648
+ attempt_number: number;
1649
+ content_item_id: string;
1650
+ created_at: string;
1651
+ created_by: string | null;
1652
+ id: string;
1653
+ organization_id: string;
1654
+ payload: Json;
1655
+ source_execution_id: string | null;
1656
+ status: string;
1657
+ step_key: string | null;
1658
+ };
1659
+ Insert: {
1660
+ attempt_number: number;
1661
+ content_item_id: string;
1662
+ created_at?: string;
1663
+ created_by?: string | null;
1664
+ id?: string;
1665
+ organization_id: string;
1666
+ payload?: Json;
1667
+ source_execution_id?: string | null;
1668
+ status: string;
1669
+ step_key?: string | null;
1670
+ };
1671
+ Update: {
1672
+ attempt_number?: number;
1673
+ content_item_id?: string;
1674
+ created_at?: string;
1675
+ created_by?: string | null;
1676
+ id?: string;
1677
+ organization_id?: string;
1678
+ payload?: Json;
1679
+ source_execution_id?: string | null;
1680
+ status?: string;
1681
+ step_key?: string | null;
1682
+ };
1683
+ Relationships: [
1684
+ {
1685
+ foreignKeyName: "content_item_attempts_content_item_id_fkey";
1686
+ columns: ["content_item_id"];
1687
+ isOneToOne: false;
1688
+ referencedRelation: "content_items";
1689
+ referencedColumns: ["id"];
1690
+ },
1691
+ {
1692
+ foreignKeyName: "content_item_attempts_created_by_fkey";
1693
+ columns: ["created_by"];
1694
+ isOneToOne: false;
1695
+ referencedRelation: "users";
1696
+ referencedColumns: ["id"];
1697
+ },
1698
+ {
1699
+ foreignKeyName: "content_item_attempts_organization_id_fkey";
1700
+ columns: ["organization_id"];
1701
+ isOneToOne: false;
1702
+ referencedRelation: "organizations";
1703
+ referencedColumns: ["id"];
1704
+ },
1705
+ {
1706
+ foreignKeyName: "content_item_attempts_source_execution_id_fkey";
1707
+ columns: ["source_execution_id"];
1708
+ isOneToOne: false;
1709
+ referencedRelation: "execution_logs";
1710
+ referencedColumns: ["execution_id"];
1711
+ }
1712
+ ];
1713
+ };
1714
+ content_item_source_assets: {
1715
+ Row: {
1716
+ alt_text: string | null;
1717
+ content_item_id: string;
1718
+ created_at: string;
1719
+ crop: Json | null;
1720
+ derivative_crop: Json | null;
1721
+ derivative_path: string | null;
1722
+ derivative_rendered_at: string | null;
1723
+ id: string;
1724
+ organization_id: string;
1725
+ position: number;
1726
+ source_asset_id: string;
1727
+ };
1728
+ Insert: {
1729
+ alt_text?: string | null;
1730
+ content_item_id: string;
1731
+ created_at?: string;
1732
+ crop?: Json | null;
1733
+ derivative_crop?: Json | null;
1734
+ derivative_path?: string | null;
1735
+ derivative_rendered_at?: string | null;
1736
+ id?: string;
1737
+ organization_id: string;
1738
+ position: number;
1739
+ source_asset_id: string;
1740
+ };
1741
+ Update: {
1742
+ alt_text?: string | null;
1743
+ content_item_id?: string;
1744
+ created_at?: string;
1745
+ crop?: Json | null;
1746
+ derivative_crop?: Json | null;
1747
+ derivative_path?: string | null;
1748
+ derivative_rendered_at?: string | null;
1749
+ id?: string;
1750
+ organization_id?: string;
1751
+ position?: number;
1752
+ source_asset_id?: string;
1753
+ };
1754
+ Relationships: [
1755
+ {
1756
+ foreignKeyName: "content_item_source_assets_asset_fkey";
1757
+ columns: ["source_asset_id", "organization_id"];
1758
+ isOneToOne: false;
1759
+ referencedRelation: "content_source_assets";
1760
+ referencedColumns: ["id", "organization_id"];
1761
+ },
1762
+ {
1763
+ foreignKeyName: "content_item_source_assets_item_fkey";
1764
+ columns: ["content_item_id", "organization_id"];
1765
+ isOneToOne: false;
1766
+ referencedRelation: "content_items";
1767
+ referencedColumns: ["id", "organization_id"];
1768
+ }
1769
+ ];
1770
+ };
1771
+ content_items: {
1772
+ Row: {
1773
+ body: string | null;
1774
+ client_id: string | null;
1775
+ created_at: string;
1776
+ created_by: string | null;
1777
+ id: string;
1778
+ organization_id: string;
1779
+ payload: Json;
1780
+ pillar: string | null;
1781
+ pipeline_id: string | null;
1782
+ processing_state: Json;
1783
+ reject_reason: string | null;
1784
+ reviewed_at: string | null;
1785
+ reviewed_by: string | null;
1786
+ reviewer_feedback: string | null;
1787
+ source_asset_id: string | null;
1788
+ status: string;
1789
+ title: string;
1790
+ updated_at: string;
1791
+ updated_by: string | null;
1792
+ };
1793
+ Insert: {
1794
+ body?: string | null;
1795
+ client_id?: string | null;
1796
+ created_at?: string;
1797
+ created_by?: string | null;
1798
+ id?: string;
1799
+ organization_id: string;
1800
+ payload?: Json;
1801
+ pillar?: string | null;
1802
+ pipeline_id?: string | null;
1803
+ processing_state?: Json;
1804
+ reject_reason?: string | null;
1805
+ reviewed_at?: string | null;
1806
+ reviewed_by?: string | null;
1807
+ reviewer_feedback?: string | null;
1808
+ source_asset_id?: string | null;
1809
+ status?: string;
1810
+ title: string;
1811
+ updated_at?: string;
1812
+ updated_by?: string | null;
1813
+ };
1814
+ Update: {
1815
+ body?: string | null;
1816
+ client_id?: string | null;
1817
+ created_at?: string;
1818
+ created_by?: string | null;
1819
+ id?: string;
1820
+ organization_id?: string;
1821
+ payload?: Json;
1822
+ pillar?: string | null;
1823
+ pipeline_id?: string | null;
1824
+ processing_state?: Json;
1825
+ reject_reason?: string | null;
1826
+ reviewed_at?: string | null;
1827
+ reviewed_by?: string | null;
1828
+ reviewer_feedback?: string | null;
1829
+ source_asset_id?: string | null;
1830
+ status?: string;
1831
+ title?: string;
1832
+ updated_at?: string;
1833
+ updated_by?: string | null;
1834
+ };
1835
+ Relationships: [
1836
+ {
1837
+ foreignKeyName: "content_items_client_id_fkey";
1838
+ columns: ["client_id"];
1839
+ isOneToOne: false;
1840
+ referencedRelation: "clients";
1841
+ referencedColumns: ["id"];
1842
+ },
1843
+ {
1844
+ foreignKeyName: "content_items_created_by_fkey";
1845
+ columns: ["created_by"];
1846
+ isOneToOne: false;
1847
+ referencedRelation: "users";
1848
+ referencedColumns: ["id"];
1849
+ },
1850
+ {
1851
+ foreignKeyName: "content_items_organization_id_fkey";
1852
+ columns: ["organization_id"];
1853
+ isOneToOne: false;
1854
+ referencedRelation: "organizations";
1855
+ referencedColumns: ["id"];
1856
+ },
1857
+ {
1858
+ foreignKeyName: "content_items_reviewed_by_fkey";
1859
+ columns: ["reviewed_by"];
1860
+ isOneToOne: false;
1861
+ referencedRelation: "users";
1862
+ referencedColumns: ["id"];
1863
+ },
1864
+ {
1865
+ foreignKeyName: "content_items_source_asset_id_fkey";
1866
+ columns: ["source_asset_id"];
1867
+ isOneToOne: false;
1868
+ referencedRelation: "content_source_assets";
1869
+ referencedColumns: ["id"];
1870
+ },
1871
+ {
1872
+ foreignKeyName: "content_items_updated_by_fkey";
1873
+ columns: ["updated_by"];
1874
+ isOneToOne: false;
1875
+ referencedRelation: "users";
1876
+ referencedColumns: ["id"];
1877
+ }
1878
+ ];
1879
+ };
1880
+ content_source_assets: {
1881
+ Row: {
1882
+ created_at: string;
1883
+ duration_seconds: number | null;
1884
+ external_url: string | null;
1885
+ id: string;
1886
+ kind: string;
1887
+ metadata: Json;
1888
+ organization_id: string;
1889
+ payload: Json;
1890
+ processing_state: Json;
1891
+ storage_path: string | null;
1892
+ title: string;
1893
+ updated_at: string;
1894
+ };
1895
+ Insert: {
1896
+ created_at?: string;
1897
+ duration_seconds?: number | null;
1898
+ external_url?: string | null;
1899
+ id?: string;
1900
+ kind: string;
1901
+ metadata?: Json;
1902
+ organization_id: string;
1903
+ payload?: Json;
1904
+ processing_state?: Json;
1905
+ storage_path?: string | null;
1906
+ title: string;
1907
+ updated_at?: string;
1908
+ };
1909
+ Update: {
1910
+ created_at?: string;
1911
+ duration_seconds?: number | null;
1912
+ external_url?: string | null;
1913
+ id?: string;
1914
+ kind?: string;
1915
+ metadata?: Json;
1916
+ organization_id?: string;
1917
+ payload?: Json;
1918
+ processing_state?: Json;
1919
+ storage_path?: string | null;
1920
+ title?: string;
1921
+ updated_at?: string;
1922
+ };
1923
+ Relationships: [
1924
+ {
1925
+ foreignKeyName: "content_source_assets_organization_id_fkey";
1926
+ columns: ["organization_id"];
1927
+ isOneToOne: false;
1928
+ referencedRelation: "organizations";
1929
+ referencedColumns: ["id"];
1930
+ }
1931
+ ];
1932
+ };
1933
+ credentials: {
1934
+ Row: {
1935
+ created_at: string;
1936
+ created_by: string | null;
1937
+ encrypted_value: string;
1938
+ id: string;
1939
+ name: string;
1940
+ organization_id: string;
1941
+ provider: string | null;
1942
+ type: string;
1943
+ updated_at: string;
1944
+ };
1945
+ Insert: {
1946
+ created_at?: string;
1947
+ created_by?: string | null;
1948
+ encrypted_value: string;
1949
+ id?: string;
1950
+ name: string;
1951
+ organization_id: string;
1952
+ provider?: string | null;
1953
+ type?: string;
1954
+ updated_at?: string;
1955
+ };
1956
+ Update: {
1957
+ created_at?: string;
1958
+ created_by?: string | null;
1959
+ encrypted_value?: string;
1960
+ id?: string;
1961
+ name?: string;
1962
+ organization_id?: string;
1963
+ provider?: string | null;
1964
+ type?: string;
1965
+ updated_at?: string;
1966
+ };
1967
+ Relationships: [
1968
+ {
1969
+ foreignKeyName: "credentials_created_by_fkey";
1970
+ columns: ["created_by"];
1971
+ isOneToOne: false;
1972
+ referencedRelation: "users";
1973
+ referencedColumns: ["id"];
1974
+ },
1975
+ {
1976
+ foreignKeyName: "credentials_organization_id_fkey";
1977
+ columns: ["organization_id"];
1978
+ isOneToOne: false;
1979
+ referencedRelation: "organizations";
1980
+ referencedColumns: ["id"];
1981
+ }
1982
+ ];
1983
+ };
1984
+ deployment_organization_models: {
1985
+ Row: {
1986
+ created_at: string;
1987
+ deployment_id: string;
1988
+ model_hash: string | null;
1989
+ organization_id: string;
1990
+ organization_model: Json;
1991
+ schema_version: string;
1992
+ updated_at: string;
1993
+ };
1994
+ Insert: {
1995
+ created_at?: string;
1996
+ deployment_id: string;
1997
+ model_hash?: string | null;
1998
+ organization_id: string;
1999
+ organization_model: Json;
2000
+ schema_version?: string;
2001
+ updated_at?: string;
2002
+ };
2003
+ Update: {
2004
+ created_at?: string;
2005
+ deployment_id?: string;
2006
+ model_hash?: string | null;
2007
+ organization_id?: string;
2008
+ organization_model?: Json;
2009
+ schema_version?: string;
2010
+ updated_at?: string;
2011
+ };
2012
+ Relationships: [
2013
+ {
2014
+ foreignKeyName: "deployment_organization_models_deployment_id_fkey";
2015
+ columns: ["deployment_id"];
2016
+ isOneToOne: true;
2017
+ referencedRelation: "deployments";
2018
+ referencedColumns: ["id"];
2019
+ },
2020
+ {
2021
+ foreignKeyName: "deployment_organization_models_organization_id_fkey";
2022
+ columns: ["organization_id"];
2023
+ isOneToOne: false;
2024
+ referencedRelation: "organizations";
2025
+ referencedColumns: ["id"];
2026
+ }
2027
+ ];
2028
+ };
2029
+ deployments: {
2030
+ Row: {
2031
+ created_at: string;
2032
+ deployment_version: string | null;
2033
+ error_message: string | null;
2034
+ id: string;
2035
+ organization_id: string;
2036
+ pid: number | null;
2037
+ port: number | null;
2038
+ sdk_version: string;
2039
+ status: string;
2040
+ tarball_path: string | null;
2041
+ updated_at: string;
2042
+ };
2043
+ Insert: {
2044
+ created_at?: string;
2045
+ deployment_version?: string | null;
2046
+ error_message?: string | null;
2047
+ id?: string;
2048
+ organization_id: string;
2049
+ pid?: number | null;
2050
+ port?: number | null;
2051
+ sdk_version: string;
2052
+ status?: string;
2053
+ tarball_path?: string | null;
2054
+ updated_at?: string;
2055
+ };
2056
+ Update: {
2057
+ created_at?: string;
2058
+ deployment_version?: string | null;
2059
+ error_message?: string | null;
2060
+ id?: string;
2061
+ organization_id?: string;
2062
+ pid?: number | null;
2063
+ port?: number | null;
2064
+ sdk_version?: string;
2065
+ status?: string;
2066
+ tarball_path?: string | null;
2067
+ updated_at?: string;
2068
+ };
2069
+ Relationships: [
2070
+ {
2071
+ foreignKeyName: "deployments_organization_id_fkey";
2072
+ columns: ["organization_id"];
2073
+ isOneToOne: false;
2074
+ referencedRelation: "organizations";
2075
+ referencedColumns: ["id"];
2076
+ }
2077
+ ];
2078
+ };
2079
+ execution_errors: {
2080
+ Row: {
2081
+ created_at: string | null;
2082
+ error_category: string;
2083
+ error_message: string;
2084
+ error_severity: string;
2085
+ error_stack_trace: string | null;
2086
+ error_type: string;
2087
+ execution_id: string;
2088
+ id: string;
2089
+ metadata: Json | null;
2090
+ occurred_at: string;
2091
+ organization_id: string;
2092
+ resolved: boolean;
2093
+ resolved_at: string | null;
2094
+ resolved_by: string | null;
2095
+ };
2096
+ Insert: {
2097
+ created_at?: string | null;
2098
+ error_category: string;
2099
+ error_message: string;
2100
+ error_severity: string;
2101
+ error_stack_trace?: string | null;
2102
+ error_type: string;
2103
+ execution_id: string;
2104
+ id?: string;
2105
+ metadata?: Json | null;
2106
+ occurred_at?: string;
2107
+ organization_id: string;
2108
+ resolved?: boolean;
2109
+ resolved_at?: string | null;
2110
+ resolved_by?: string | null;
2111
+ };
2112
+ Update: {
2113
+ created_at?: string | null;
2114
+ error_category?: string;
2115
+ error_message?: string;
2116
+ error_severity?: string;
2117
+ error_stack_trace?: string | null;
2118
+ error_type?: string;
2119
+ execution_id?: string;
2120
+ id?: string;
2121
+ metadata?: Json | null;
2122
+ occurred_at?: string;
2123
+ organization_id?: string;
2124
+ resolved?: boolean;
2125
+ resolved_at?: string | null;
2126
+ resolved_by?: string | null;
2127
+ };
2128
+ Relationships: [
2129
+ {
2130
+ foreignKeyName: "execution_errors_execution_id_fkey";
2131
+ columns: ["execution_id"];
2132
+ isOneToOne: false;
2133
+ referencedRelation: "execution_logs";
2134
+ referencedColumns: ["execution_id"];
2135
+ },
2136
+ {
2137
+ foreignKeyName: "execution_errors_organization_id_fkey";
2138
+ columns: ["organization_id"];
2139
+ isOneToOne: false;
2140
+ referencedRelation: "organizations";
2141
+ referencedColumns: ["id"];
2142
+ },
2143
+ {
2144
+ foreignKeyName: "execution_errors_resolved_by_fkey";
2145
+ columns: ["resolved_by"];
2146
+ isOneToOne: false;
2147
+ referencedRelation: "users";
2148
+ referencedColumns: ["id"];
2149
+ }
2150
+ ];
2151
+ };
2152
+ execution_logs: {
2153
+ Row: {
2154
+ api_version: string | null;
2155
+ completed_at: string | null;
2156
+ created_at: string | null;
2157
+ error: string | null;
2158
+ execution_id: string;
2159
+ idempotency_key: string | null;
2160
+ input: Json | null;
2161
+ last_heartbeat_at: string | null;
2162
+ logs: Json | null;
2163
+ organization_id: string;
2164
+ origin_execution_id: string | null;
2165
+ output: Json | null;
2166
+ resource_id: string;
2167
+ resource_snapshot: Json | null;
2168
+ resource_status: string;
2169
+ resource_type: string;
2170
+ resource_version: string | null;
2171
+ sdk_version: string | null;
2172
+ session_id: string | null;
2173
+ session_turn_number: number | null;
2174
+ started_at: string;
2175
+ status: string;
2176
+ trigger_type: string | null;
2177
+ updated_at: string | null;
2178
+ user_id: string | null;
2179
+ };
2180
+ Insert: {
2181
+ api_version?: string | null;
2182
+ completed_at?: string | null;
2183
+ created_at?: string | null;
2184
+ error?: string | null;
2185
+ execution_id?: string;
2186
+ idempotency_key?: string | null;
2187
+ input?: Json | null;
2188
+ last_heartbeat_at?: string | null;
2189
+ logs?: Json | null;
2190
+ organization_id: string;
2191
+ origin_execution_id?: string | null;
2192
+ output?: Json | null;
2193
+ resource_id: string;
2194
+ resource_snapshot?: Json | null;
2195
+ resource_status?: string;
2196
+ resource_type?: string;
2197
+ resource_version?: string | null;
2198
+ sdk_version?: string | null;
2199
+ session_id?: string | null;
2200
+ session_turn_number?: number | null;
2201
+ started_at?: string;
2202
+ status: string;
2203
+ trigger_type?: string | null;
2204
+ updated_at?: string | null;
2205
+ user_id?: string | null;
2206
+ };
2207
+ Update: {
2208
+ api_version?: string | null;
2209
+ completed_at?: string | null;
2210
+ created_at?: string | null;
2211
+ error?: string | null;
2212
+ execution_id?: string;
2213
+ idempotency_key?: string | null;
2214
+ input?: Json | null;
2215
+ last_heartbeat_at?: string | null;
2216
+ logs?: Json | null;
2217
+ organization_id?: string;
2218
+ origin_execution_id?: string | null;
2219
+ output?: Json | null;
2220
+ resource_id?: string;
2221
+ resource_snapshot?: Json | null;
2222
+ resource_status?: string;
2223
+ resource_type?: string;
2224
+ resource_version?: string | null;
2225
+ sdk_version?: string | null;
2226
+ session_id?: string | null;
2227
+ session_turn_number?: number | null;
2228
+ started_at?: string;
2229
+ status?: string;
2230
+ trigger_type?: string | null;
2231
+ updated_at?: string | null;
2232
+ user_id?: string | null;
2233
+ };
2234
+ Relationships: [
2235
+ {
2236
+ foreignKeyName: "execution_history_organization_id_fkey";
2237
+ columns: ["organization_id"];
2238
+ isOneToOne: false;
2239
+ referencedRelation: "organizations";
2240
+ referencedColumns: ["id"];
2241
+ },
2242
+ {
2243
+ foreignKeyName: "execution_logs_origin_execution_id_fkey";
2244
+ columns: ["origin_execution_id"];
2245
+ isOneToOne: false;
2246
+ referencedRelation: "execution_logs";
2247
+ referencedColumns: ["execution_id"];
2248
+ },
2249
+ {
2250
+ foreignKeyName: "execution_logs_session_id_fkey";
2251
+ columns: ["session_id"];
2252
+ isOneToOne: false;
2253
+ referencedRelation: "sessions";
2254
+ referencedColumns: ["session_id"];
2255
+ },
2256
+ {
2257
+ foreignKeyName: "execution_logs_user_id_fkey";
2258
+ columns: ["user_id"];
2259
+ isOneToOne: false;
2260
+ referencedRelation: "users";
2261
+ referencedColumns: ["id"];
2262
+ }
2263
+ ];
2264
+ };
2265
+ execution_metrics: {
2266
+ Row: {
2267
+ ai_call_count: number;
2268
+ ai_calls: Json | null;
2269
+ automation_savings_usd: number | null;
2270
+ created_at: string | null;
2271
+ duration_ms: number | null;
2272
+ execution_id: string;
2273
+ organization_id: string;
2274
+ resource_id: string;
2275
+ total_cost_usd: number;
2276
+ total_input_tokens: number;
2277
+ total_output_tokens: number;
2278
+ };
2279
+ Insert: {
2280
+ ai_call_count: number;
2281
+ ai_calls?: Json | null;
2282
+ automation_savings_usd?: number | null;
2283
+ created_at?: string | null;
2284
+ duration_ms?: number | null;
2285
+ execution_id: string;
2286
+ organization_id: string;
2287
+ resource_id: string;
2288
+ total_cost_usd: number;
2289
+ total_input_tokens: number;
2290
+ total_output_tokens: number;
2291
+ };
2292
+ Update: {
2293
+ ai_call_count?: number;
2294
+ ai_calls?: Json | null;
2295
+ automation_savings_usd?: number | null;
2296
+ created_at?: string | null;
2297
+ duration_ms?: number | null;
2298
+ execution_id?: string;
2299
+ organization_id?: string;
2300
+ resource_id?: string;
2301
+ total_cost_usd?: number;
2302
+ total_input_tokens?: number;
2303
+ total_output_tokens?: number;
2304
+ };
2305
+ Relationships: [
2306
+ {
2307
+ foreignKeyName: "execution_metrics_execution_id_fkey";
2308
+ columns: ["execution_id"];
2309
+ isOneToOne: true;
2310
+ referencedRelation: "execution_logs";
2311
+ referencedColumns: ["execution_id"];
2312
+ },
2313
+ {
2314
+ foreignKeyName: "execution_metrics_organization_id_fkey";
2315
+ columns: ["organization_id"];
2316
+ isOneToOne: false;
2317
+ referencedRelation: "organizations";
2318
+ referencedColumns: ["id"];
2319
+ }
2320
+ ];
2321
+ };
2322
+ notifications: {
2323
+ Row: {
2324
+ action_url: string | null;
2325
+ category: string;
2326
+ created_at: string | null;
2327
+ id: string;
2328
+ message: string;
2329
+ organization_id: string;
2330
+ read: boolean | null;
2331
+ read_at: string | null;
2332
+ title: string;
2333
+ user_id: string;
2334
+ };
2335
+ Insert: {
2336
+ action_url?: string | null;
2337
+ category: string;
2338
+ created_at?: string | null;
2339
+ id?: string;
2340
+ message: string;
2341
+ organization_id: string;
2342
+ read?: boolean | null;
2343
+ read_at?: string | null;
2344
+ title: string;
2345
+ user_id: string;
2346
+ };
2347
+ Update: {
2348
+ action_url?: string | null;
2349
+ category?: string;
2350
+ created_at?: string | null;
2351
+ id?: string;
2352
+ message?: string;
2353
+ organization_id?: string;
2354
+ read?: boolean | null;
2355
+ read_at?: string | null;
2356
+ title?: string;
2357
+ user_id?: string;
2358
+ };
2359
+ Relationships: [
2360
+ {
2361
+ foreignKeyName: "notifications_organization_id_fkey";
2362
+ columns: ["organization_id"];
2363
+ isOneToOne: false;
2364
+ referencedRelation: "organizations";
2365
+ referencedColumns: ["id"];
2366
+ },
2367
+ {
2368
+ foreignKeyName: "notifications_user_id_fkey";
2369
+ columns: ["user_id"];
2370
+ isOneToOne: false;
2371
+ referencedRelation: "users";
2372
+ referencedColumns: ["id"];
2373
+ }
2374
+ ];
2375
+ };
2376
+ org_invitations: {
2377
+ Row: {
2378
+ accept_invitation_url: string | null;
2379
+ accepted_at: string | null;
2380
+ created_at: string | null;
2381
+ email: string;
2382
+ expires_at: string;
2383
+ id: string;
2384
+ invitation_state: string | null;
2385
+ invitation_token: string | null;
2386
+ inviter_user_id: string | null;
2387
+ organization_id: string | null;
2388
+ revoked_at: string | null;
2389
+ role_slug: string | null;
2390
+ updated_at: string | null;
2391
+ workos_invitation_id: string;
2392
+ };
2393
+ Insert: {
2394
+ accept_invitation_url?: string | null;
2395
+ accepted_at?: string | null;
2396
+ created_at?: string | null;
2397
+ email: string;
2398
+ expires_at: string;
2399
+ id?: string;
2400
+ invitation_state?: string | null;
2401
+ invitation_token?: string | null;
2402
+ inviter_user_id?: string | null;
2403
+ organization_id?: string | null;
2404
+ revoked_at?: string | null;
2405
+ role_slug?: string | null;
2406
+ updated_at?: string | null;
2407
+ workos_invitation_id: string;
2408
+ };
2409
+ Update: {
2410
+ accept_invitation_url?: string | null;
2411
+ accepted_at?: string | null;
2412
+ created_at?: string | null;
2413
+ email?: string;
2414
+ expires_at?: string;
2415
+ id?: string;
2416
+ invitation_state?: string | null;
2417
+ invitation_token?: string | null;
2418
+ inviter_user_id?: string | null;
2419
+ organization_id?: string | null;
2420
+ revoked_at?: string | null;
2421
+ role_slug?: string | null;
2422
+ updated_at?: string | null;
2423
+ workos_invitation_id?: string;
2424
+ };
2425
+ Relationships: [
2426
+ {
2427
+ foreignKeyName: "org_invitations_inviter_user_id_fkey";
2428
+ columns: ["inviter_user_id"];
2429
+ isOneToOne: false;
2430
+ referencedRelation: "users";
2431
+ referencedColumns: ["id"];
2432
+ },
2433
+ {
2434
+ foreignKeyName: "org_invitations_organization_id_fkey";
2435
+ columns: ["organization_id"];
2436
+ isOneToOne: false;
2437
+ referencedRelation: "organizations";
2438
+ referencedColumns: ["id"];
2439
+ }
2440
+ ];
2441
+ };
2442
+ org_memberships: {
2443
+ Row: {
2444
+ config: Json;
2445
+ created_at: string | null;
2446
+ effective_permissions: string[];
2447
+ id: string;
2448
+ membership_status: string | null;
2449
+ organization_id: string;
2450
+ role_slug: string | null;
2451
+ updated_at: string | null;
2452
+ user_id: string;
2453
+ workos_membership_id: string | null;
2454
+ };
2455
+ Insert: {
2456
+ config?: Json;
2457
+ created_at?: string | null;
2458
+ effective_permissions?: string[];
2459
+ id?: string;
2460
+ membership_status?: string | null;
2461
+ organization_id: string;
2462
+ role_slug?: string | null;
2463
+ updated_at?: string | null;
2464
+ user_id: string;
2465
+ workos_membership_id?: string | null;
2466
+ };
2467
+ Update: {
2468
+ config?: Json;
2469
+ created_at?: string | null;
2470
+ effective_permissions?: string[];
2471
+ id?: string;
2472
+ membership_status?: string | null;
2473
+ organization_id?: string;
2474
+ role_slug?: string | null;
2475
+ updated_at?: string | null;
2476
+ user_id?: string;
2477
+ workos_membership_id?: string | null;
2478
+ };
2479
+ Relationships: [
2480
+ {
2481
+ foreignKeyName: "org_memberships_organization_id_fkey";
2482
+ columns: ["organization_id"];
2483
+ isOneToOne: false;
2484
+ referencedRelation: "organizations";
2485
+ referencedColumns: ["id"];
2486
+ },
2487
+ {
2488
+ foreignKeyName: "org_memberships_user_id_fkey";
2489
+ columns: ["user_id"];
2490
+ isOneToOne: false;
2491
+ referencedRelation: "users";
2492
+ referencedColumns: ["id"];
2493
+ }
2494
+ ];
2495
+ };
2496
+ org_rol_assignments: {
2497
+ Row: {
2498
+ granted_at: string;
2499
+ granted_by: string | null;
2500
+ membership_id: string;
2501
+ role_id: string;
2502
+ };
2503
+ Insert: {
2504
+ granted_at?: string;
2505
+ granted_by?: string | null;
2506
+ membership_id: string;
2507
+ role_id: string;
2508
+ };
2509
+ Update: {
2510
+ granted_at?: string;
2511
+ granted_by?: string | null;
2512
+ membership_id?: string;
2513
+ role_id?: string;
2514
+ };
2515
+ Relationships: [
2516
+ {
2517
+ foreignKeyName: "org_rol_assignments_granted_by_fkey";
2518
+ columns: ["granted_by"];
2519
+ isOneToOne: false;
2520
+ referencedRelation: "users";
2521
+ referencedColumns: ["id"];
2522
+ },
2523
+ {
2524
+ foreignKeyName: "org_rol_assignments_membership_id_fkey";
2525
+ columns: ["membership_id"];
2526
+ isOneToOne: false;
2527
+ referencedRelation: "org_memberships";
2528
+ referencedColumns: ["id"];
2529
+ },
2530
+ {
2531
+ foreignKeyName: "org_rol_assignments_role_id_fkey";
2532
+ columns: ["role_id"];
2533
+ isOneToOne: false;
2534
+ referencedRelation: "org_rol_definitions";
2535
+ referencedColumns: ["id"];
2536
+ }
2537
+ ];
2538
+ };
2539
+ org_rol_definitions: {
2540
+ Row: {
2541
+ created_at: string;
2542
+ description: string | null;
2543
+ id: string;
2544
+ is_system: boolean;
2545
+ name: string;
2546
+ organization_id: string | null;
2547
+ slug: string;
2548
+ updated_at: string;
2549
+ };
2550
+ Insert: {
2551
+ created_at?: string;
2552
+ description?: string | null;
2553
+ id?: string;
2554
+ is_system?: boolean;
2555
+ name: string;
2556
+ organization_id?: string | null;
2557
+ slug: string;
2558
+ updated_at?: string;
2559
+ };
2560
+ Update: {
2561
+ created_at?: string;
2562
+ description?: string | null;
2563
+ id?: string;
2564
+ is_system?: boolean;
2565
+ name?: string;
2566
+ organization_id?: string | null;
2567
+ slug?: string;
2568
+ updated_at?: string;
2569
+ };
2570
+ Relationships: [
2571
+ {
2572
+ foreignKeyName: "org_rol_definitions_organization_id_fkey";
2573
+ columns: ["organization_id"];
2574
+ isOneToOne: false;
2575
+ referencedRelation: "organizations";
2576
+ referencedColumns: ["id"];
2577
+ }
2578
+ ];
2579
+ };
2580
+ org_rol_grants: {
2581
+ Row: {
2582
+ granted_at: string;
2583
+ permission_key: string;
2584
+ role_id: string;
2585
+ };
2586
+ Insert: {
2587
+ granted_at?: string;
2588
+ permission_key: string;
2589
+ role_id: string;
2590
+ };
2591
+ Update: {
2592
+ granted_at?: string;
2593
+ permission_key?: string;
2594
+ role_id?: string;
2595
+ };
2596
+ Relationships: [
2597
+ {
2598
+ foreignKeyName: "org_rol_grants_permission_key_fkey";
2599
+ columns: ["permission_key"];
2600
+ isOneToOne: false;
2601
+ referencedRelation: "org_rol_permissions";
2602
+ referencedColumns: ["key"];
2603
+ },
2604
+ {
2605
+ foreignKeyName: "org_rol_grants_role_id_fkey";
2606
+ columns: ["role_id"];
2607
+ isOneToOne: false;
2608
+ referencedRelation: "org_rol_definitions";
2609
+ referencedColumns: ["id"];
2610
+ }
2611
+ ];
2612
+ };
2613
+ org_rol_permissions: {
2614
+ Row: {
2615
+ created_at: string;
2616
+ description: string;
2617
+ is_org_grantable: boolean;
2618
+ key: string;
2619
+ updated_at: string;
2620
+ };
2621
+ Insert: {
2622
+ created_at?: string;
2623
+ description: string;
2624
+ is_org_grantable?: boolean;
2625
+ key: string;
2626
+ updated_at?: string;
2627
+ };
2628
+ Update: {
2629
+ created_at?: string;
2630
+ description?: string;
2631
+ is_org_grantable?: boolean;
2632
+ key?: string;
2633
+ updated_at?: string;
2634
+ };
2635
+ Relationships: [];
2636
+ };
2637
+ organizations: {
2638
+ Row: {
2639
+ config: Json;
2640
+ created_at: string;
2641
+ id: string;
2642
+ is_test: boolean;
2643
+ metadata: Json;
2644
+ name: string;
2645
+ status: string;
2646
+ updated_at: string;
2647
+ workos_org_id: string;
2648
+ };
2649
+ Insert: {
2650
+ config?: Json;
2651
+ created_at?: string;
2652
+ id?: string;
2653
+ is_test?: boolean;
2654
+ metadata?: Json;
2655
+ name: string;
2656
+ status?: string;
2657
+ updated_at?: string;
2658
+ workos_org_id: string;
2659
+ };
2660
+ Update: {
2661
+ config?: Json;
2662
+ created_at?: string;
2663
+ id?: string;
2664
+ is_test?: boolean;
2665
+ metadata?: Json;
2666
+ name?: string;
2667
+ status?: string;
2668
+ updated_at?: string;
2669
+ workos_org_id?: string;
2670
+ };
2671
+ Relationships: [];
2672
+ };
2673
+ prj_milestones: {
2674
+ Row: {
2675
+ checklist: Json | null;
2676
+ completed_at: string | null;
2677
+ created_at: string;
2678
+ description: string | null;
2679
+ due_date: string | null;
2680
+ id: string;
2681
+ metadata: Json | null;
2682
+ name: string;
2683
+ organization_id: string;
2684
+ project_id: string;
2685
+ sequence: number;
2686
+ status: string;
2687
+ updated_at: string;
2688
+ };
2689
+ Insert: {
2690
+ checklist?: Json | null;
2691
+ completed_at?: string | null;
2692
+ created_at?: string;
2693
+ description?: string | null;
2694
+ due_date?: string | null;
2695
+ id?: string;
2696
+ metadata?: Json | null;
2697
+ name: string;
2698
+ organization_id: string;
2699
+ project_id: string;
2700
+ sequence?: number;
2701
+ status?: string;
2702
+ updated_at?: string;
2703
+ };
2704
+ Update: {
2705
+ checklist?: Json | null;
2706
+ completed_at?: string | null;
2707
+ created_at?: string;
2708
+ description?: string | null;
2709
+ due_date?: string | null;
2710
+ id?: string;
2711
+ metadata?: Json | null;
2712
+ name?: string;
2713
+ organization_id?: string;
2714
+ project_id?: string;
2715
+ sequence?: number;
2716
+ status?: string;
2717
+ updated_at?: string;
2718
+ };
2719
+ Relationships: [
2720
+ {
2721
+ foreignKeyName: "fk_milestones_project";
2722
+ columns: ["project_id"];
2723
+ isOneToOne: false;
2724
+ referencedRelation: "prj_projects";
2725
+ referencedColumns: ["id"];
2726
+ },
2727
+ {
2728
+ foreignKeyName: "prj_milestones_organization_id_fkey";
2729
+ columns: ["organization_id"];
2730
+ isOneToOne: false;
2731
+ referencedRelation: "organizations";
2732
+ referencedColumns: ["id"];
2733
+ },
2734
+ {
2735
+ foreignKeyName: "prj_milestones_project_id_fkey";
2736
+ columns: ["project_id"];
2737
+ isOneToOne: false;
2738
+ referencedRelation: "prj_projects";
2739
+ referencedColumns: ["id"];
2740
+ }
2741
+ ];
2742
+ };
2743
+ prj_notes: {
2744
+ Row: {
2745
+ content: string;
2746
+ created_at: string;
2747
+ created_by: string | null;
2748
+ id: string;
2749
+ metadata: Json | null;
2750
+ milestone_id: string | null;
2751
+ occurred_at: string;
2752
+ organization_id: string;
2753
+ project_id: string;
2754
+ summary: string | null;
2755
+ task_id: string | null;
2756
+ type: string;
2757
+ };
2758
+ Insert: {
2759
+ content: string;
2760
+ created_at?: string;
2761
+ created_by?: string | null;
2762
+ id?: string;
2763
+ metadata?: Json | null;
2764
+ milestone_id?: string | null;
2765
+ occurred_at?: string;
2766
+ organization_id: string;
2767
+ project_id: string;
2768
+ summary?: string | null;
2769
+ task_id?: string | null;
2770
+ type?: string;
2771
+ };
2772
+ Update: {
2773
+ content?: string;
2774
+ created_at?: string;
2775
+ created_by?: string | null;
2776
+ id?: string;
2777
+ metadata?: Json | null;
2778
+ milestone_id?: string | null;
2779
+ occurred_at?: string;
2780
+ organization_id?: string;
2781
+ project_id?: string;
2782
+ summary?: string | null;
2783
+ task_id?: string | null;
2784
+ type?: string;
2785
+ };
2786
+ Relationships: [
2787
+ {
2788
+ foreignKeyName: "fk_notes_created_by";
2789
+ columns: ["created_by"];
2790
+ isOneToOne: false;
2791
+ referencedRelation: "users";
2792
+ referencedColumns: ["id"];
2793
+ },
2794
+ {
2795
+ foreignKeyName: "fk_notes_milestone";
2796
+ columns: ["milestone_id"];
2797
+ isOneToOne: false;
2798
+ referencedRelation: "prj_milestones";
2799
+ referencedColumns: ["id"];
2800
+ },
2801
+ {
2802
+ foreignKeyName: "fk_notes_project";
2803
+ columns: ["project_id"];
2804
+ isOneToOne: false;
2805
+ referencedRelation: "prj_projects";
2806
+ referencedColumns: ["id"];
2807
+ },
2808
+ {
2809
+ foreignKeyName: "fk_notes_task";
2810
+ columns: ["task_id"];
2811
+ isOneToOne: false;
2812
+ referencedRelation: "prj_tasks";
2813
+ referencedColumns: ["id"];
2814
+ },
2815
+ {
2816
+ foreignKeyName: "prj_notes_created_by_fkey";
2817
+ columns: ["created_by"];
2818
+ isOneToOne: false;
2819
+ referencedRelation: "users";
2820
+ referencedColumns: ["id"];
2821
+ },
2822
+ {
2823
+ foreignKeyName: "prj_notes_milestone_id_fkey";
2824
+ columns: ["milestone_id"];
2825
+ isOneToOne: false;
2826
+ referencedRelation: "prj_milestones";
2827
+ referencedColumns: ["id"];
2828
+ },
2829
+ {
2830
+ foreignKeyName: "prj_notes_organization_id_fkey";
2831
+ columns: ["organization_id"];
2832
+ isOneToOne: false;
2833
+ referencedRelation: "organizations";
2834
+ referencedColumns: ["id"];
2835
+ },
2836
+ {
2837
+ foreignKeyName: "prj_notes_project_id_fkey";
2838
+ columns: ["project_id"];
2839
+ isOneToOne: false;
2840
+ referencedRelation: "prj_projects";
2841
+ referencedColumns: ["id"];
2842
+ },
2843
+ {
2844
+ foreignKeyName: "prj_notes_task_id_fkey";
2845
+ columns: ["task_id"];
2846
+ isOneToOne: false;
2847
+ referencedRelation: "prj_tasks";
2848
+ referencedColumns: ["id"];
2849
+ }
2850
+ ];
2851
+ };
2852
+ prj_projects: {
2853
+ Row: {
2854
+ actual_end_date: string | null;
2855
+ client_company_id: string | null;
2856
+ client_id: string | null;
2857
+ contract_value: number | null;
2858
+ created_at: string;
2859
+ deal_id: string | null;
2860
+ description: string | null;
2861
+ id: string;
2862
+ kind: string;
2863
+ metadata: Json | null;
2864
+ name: string;
2865
+ organization_id: string;
2866
+ start_date: string | null;
2867
+ status: string;
2868
+ target_end_date: string | null;
2869
+ updated_at: string;
2870
+ };
2871
+ Insert: {
2872
+ actual_end_date?: string | null;
2873
+ client_company_id?: string | null;
2874
+ client_id?: string | null;
2875
+ contract_value?: number | null;
2876
+ created_at?: string;
2877
+ deal_id?: string | null;
2878
+ description?: string | null;
2879
+ id?: string;
2880
+ kind?: string;
2881
+ metadata?: Json | null;
2882
+ name: string;
2883
+ organization_id: string;
2884
+ start_date?: string | null;
2885
+ status?: string;
2886
+ target_end_date?: string | null;
2887
+ updated_at?: string;
2888
+ };
2889
+ Update: {
2890
+ actual_end_date?: string | null;
2891
+ client_company_id?: string | null;
2892
+ client_id?: string | null;
2893
+ contract_value?: number | null;
2894
+ created_at?: string;
2895
+ deal_id?: string | null;
2896
+ description?: string | null;
2897
+ id?: string;
2898
+ kind?: string;
2899
+ metadata?: Json | null;
2900
+ name?: string;
2901
+ organization_id?: string;
2902
+ start_date?: string | null;
2903
+ status?: string;
2904
+ target_end_date?: string | null;
2905
+ updated_at?: string;
2906
+ };
2907
+ Relationships: [
2908
+ {
2909
+ foreignKeyName: "fk_projects_company";
2910
+ columns: ["client_company_id"];
2911
+ isOneToOne: false;
2912
+ referencedRelation: "acq_companies";
2913
+ referencedColumns: ["id"];
2914
+ },
2915
+ {
2916
+ foreignKeyName: "fk_projects_deal";
2917
+ columns: ["deal_id"];
2918
+ isOneToOne: false;
2919
+ referencedRelation: "acq_deals";
2920
+ referencedColumns: ["id"];
2921
+ },
2922
+ {
2923
+ foreignKeyName: "prj_projects_client_company_id_fkey";
2924
+ columns: ["client_company_id"];
2925
+ isOneToOne: false;
2926
+ referencedRelation: "acq_companies";
2927
+ referencedColumns: ["id"];
2928
+ },
2929
+ {
2930
+ foreignKeyName: "prj_projects_client_id_fkey";
2931
+ columns: ["client_id"];
2932
+ isOneToOne: false;
2933
+ referencedRelation: "clients";
2934
+ referencedColumns: ["id"];
2935
+ },
2936
+ {
2937
+ foreignKeyName: "prj_projects_deal_id_fkey";
2938
+ columns: ["deal_id"];
2939
+ isOneToOne: false;
2940
+ referencedRelation: "acq_deals";
2941
+ referencedColumns: ["id"];
2942
+ },
2943
+ {
2944
+ foreignKeyName: "prj_projects_organization_id_fkey";
2945
+ columns: ["organization_id"];
2946
+ isOneToOne: false;
2947
+ referencedRelation: "organizations";
2948
+ referencedColumns: ["id"];
2949
+ }
2950
+ ];
2951
+ };
2952
+ prj_tasks: {
2953
+ Row: {
2954
+ checklist: Json;
2955
+ completed_at: string | null;
2956
+ created_at: string;
2957
+ description: string | null;
2958
+ due_date: string | null;
2959
+ file_url: string | null;
2960
+ id: string;
2961
+ metadata: Json | null;
2962
+ milestone_id: string | null;
2963
+ name: string;
2964
+ organization_id: string;
2965
+ parent_task_id: string | null;
2966
+ project_id: string;
2967
+ resume_context: Json | null;
2968
+ status: string;
2969
+ type: string;
2970
+ updated_at: string;
2971
+ };
2972
+ Insert: {
2973
+ checklist?: Json;
2974
+ completed_at?: string | null;
2975
+ created_at?: string;
2976
+ description?: string | null;
2977
+ due_date?: string | null;
2978
+ file_url?: string | null;
2979
+ id?: string;
2980
+ metadata?: Json | null;
2981
+ milestone_id?: string | null;
2982
+ name: string;
2983
+ organization_id: string;
2984
+ parent_task_id?: string | null;
2985
+ project_id: string;
2986
+ resume_context?: Json | null;
2987
+ status?: string;
2988
+ type?: string;
2989
+ updated_at?: string;
2990
+ };
2991
+ Update: {
2992
+ checklist?: Json;
2993
+ completed_at?: string | null;
2994
+ created_at?: string;
2995
+ description?: string | null;
2996
+ due_date?: string | null;
2997
+ file_url?: string | null;
2998
+ id?: string;
2999
+ metadata?: Json | null;
3000
+ milestone_id?: string | null;
3001
+ name?: string;
3002
+ organization_id?: string;
3003
+ parent_task_id?: string | null;
3004
+ project_id?: string;
3005
+ resume_context?: Json | null;
3006
+ status?: string;
3007
+ type?: string;
3008
+ updated_at?: string;
3009
+ };
3010
+ Relationships: [
3011
+ {
3012
+ foreignKeyName: "fk_tasks_milestone";
3013
+ columns: ["milestone_id"];
3014
+ isOneToOne: false;
3015
+ referencedRelation: "prj_milestones";
3016
+ referencedColumns: ["id"];
3017
+ },
3018
+ {
3019
+ foreignKeyName: "fk_tasks_parent";
3020
+ columns: ["parent_task_id"];
3021
+ isOneToOne: false;
3022
+ referencedRelation: "prj_tasks";
3023
+ referencedColumns: ["id"];
3024
+ },
3025
+ {
3026
+ foreignKeyName: "fk_tasks_project";
3027
+ columns: ["project_id"];
3028
+ isOneToOne: false;
3029
+ referencedRelation: "prj_projects";
3030
+ referencedColumns: ["id"];
3031
+ },
3032
+ {
3033
+ foreignKeyName: "prj_tasks_milestone_id_fkey";
3034
+ columns: ["milestone_id"];
3035
+ isOneToOne: false;
3036
+ referencedRelation: "prj_milestones";
3037
+ referencedColumns: ["id"];
3038
+ },
3039
+ {
3040
+ foreignKeyName: "prj_tasks_organization_id_fkey";
3041
+ columns: ["organization_id"];
3042
+ isOneToOne: false;
3043
+ referencedRelation: "organizations";
3044
+ referencedColumns: ["id"];
3045
+ },
3046
+ {
3047
+ foreignKeyName: "prj_tasks_parent_task_id_fkey";
3048
+ columns: ["parent_task_id"];
3049
+ isOneToOne: false;
3050
+ referencedRelation: "prj_tasks";
3051
+ referencedColumns: ["id"];
3052
+ },
3053
+ {
3054
+ foreignKeyName: "prj_tasks_project_id_fkey";
3055
+ columns: ["project_id"];
3056
+ isOneToOne: false;
3057
+ referencedRelation: "prj_projects";
3058
+ referencedColumns: ["id"];
3059
+ }
3060
+ ];
3061
+ };
3062
+ reported_requests: {
3063
+ Row: {
3064
+ affected_page: string | null;
3065
+ category: string;
3066
+ context: Json | null;
3067
+ created_at: string;
3068
+ description: string;
3069
+ evidence: Json | null;
3070
+ id: string;
3071
+ organization_id: string;
3072
+ project_id: string | null;
3073
+ reported_at: string;
3074
+ reporter_id: string | null;
3075
+ resolved_at: string | null;
3076
+ severity: string;
3077
+ source: string;
3078
+ status: string;
3079
+ task_id: string | null;
3080
+ title: string;
3081
+ type: string;
3082
+ updated_at: string;
3083
+ };
3084
+ Insert: {
3085
+ affected_page?: string | null;
3086
+ category: string;
3087
+ context?: Json | null;
3088
+ created_at?: string;
3089
+ description: string;
3090
+ evidence?: Json | null;
3091
+ id?: string;
3092
+ organization_id: string;
3093
+ project_id?: string | null;
3094
+ reported_at?: string;
3095
+ reporter_id?: string | null;
3096
+ resolved_at?: string | null;
3097
+ severity: string;
3098
+ source: string;
3099
+ status?: string;
3100
+ task_id?: string | null;
3101
+ title: string;
3102
+ type: string;
3103
+ updated_at?: string;
3104
+ };
3105
+ Update: {
3106
+ affected_page?: string | null;
3107
+ category?: string;
3108
+ context?: Json | null;
3109
+ created_at?: string;
3110
+ description?: string;
3111
+ evidence?: Json | null;
3112
+ id?: string;
3113
+ organization_id?: string;
3114
+ project_id?: string | null;
3115
+ reported_at?: string;
3116
+ reporter_id?: string | null;
3117
+ resolved_at?: string | null;
3118
+ severity?: string;
3119
+ source?: string;
3120
+ status?: string;
3121
+ task_id?: string | null;
3122
+ title?: string;
3123
+ type?: string;
3124
+ updated_at?: string;
3125
+ };
3126
+ Relationships: [
3127
+ {
3128
+ foreignKeyName: "reported_requests_organization_id_fkey";
3129
+ columns: ["organization_id"];
3130
+ isOneToOne: false;
3131
+ referencedRelation: "organizations";
3132
+ referencedColumns: ["id"];
3133
+ },
3134
+ {
3135
+ foreignKeyName: "reported_requests_project_id_fkey";
3136
+ columns: ["project_id"];
3137
+ isOneToOne: false;
3138
+ referencedRelation: "prj_projects";
3139
+ referencedColumns: ["id"];
3140
+ },
3141
+ {
3142
+ foreignKeyName: "reported_requests_task_id_fkey";
3143
+ columns: ["task_id"];
3144
+ isOneToOne: false;
3145
+ referencedRelation: "prj_tasks";
3146
+ referencedColumns: ["id"];
3147
+ }
3148
+ ];
3149
+ };
3150
+ session_messages: {
3151
+ Row: {
3152
+ created_at: string | null;
3153
+ id: string;
3154
+ message: string;
3155
+ message_index: number | null;
3156
+ message_type: string | null;
3157
+ metadata: Json | null;
3158
+ role: string;
3159
+ session_id: string;
3160
+ session_turn_number: number;
3161
+ };
3162
+ Insert: {
3163
+ created_at?: string | null;
3164
+ id: string;
3165
+ message: string;
3166
+ message_index?: number | null;
3167
+ message_type?: string | null;
3168
+ metadata?: Json | null;
3169
+ role: string;
3170
+ session_id: string;
3171
+ session_turn_number: number;
3172
+ };
3173
+ Update: {
3174
+ created_at?: string | null;
3175
+ id?: string;
3176
+ message?: string;
3177
+ message_index?: number | null;
3178
+ message_type?: string | null;
3179
+ metadata?: Json | null;
3180
+ role?: string;
3181
+ session_id?: string;
3182
+ session_turn_number?: number;
3183
+ };
3184
+ Relationships: [
3185
+ {
3186
+ foreignKeyName: "session_messages_session_id_fkey";
3187
+ columns: ["session_id"];
3188
+ isOneToOne: false;
3189
+ referencedRelation: "sessions";
3190
+ referencedColumns: ["session_id"];
3191
+ }
3192
+ ];
3193
+ };
3194
+ sessions: {
3195
+ Row: {
3196
+ context_window_size: number;
3197
+ created_at: string | null;
3198
+ cumulative_input_tokens: number;
3199
+ cumulative_output_tokens: number;
3200
+ deleted_at: string | null;
3201
+ ended_at: string | null;
3202
+ memory_snapshot: Json;
3203
+ memory_version: number;
3204
+ metadata: Json | null;
3205
+ organization_id: string;
3206
+ resource_id: string;
3207
+ session_id: string;
3208
+ session_total_turns: number | null;
3209
+ updated_at: string | null;
3210
+ user_id: string | null;
3211
+ };
3212
+ Insert: {
3213
+ context_window_size?: number;
3214
+ created_at?: string | null;
3215
+ cumulative_input_tokens?: number;
3216
+ cumulative_output_tokens?: number;
3217
+ deleted_at?: string | null;
3218
+ ended_at?: string | null;
3219
+ memory_snapshot: Json;
3220
+ memory_version?: number;
3221
+ metadata?: Json | null;
3222
+ organization_id: string;
3223
+ resource_id: string;
3224
+ session_id?: string;
3225
+ session_total_turns?: number | null;
3226
+ updated_at?: string | null;
3227
+ user_id?: string | null;
3228
+ };
3229
+ Update: {
3230
+ context_window_size?: number;
3231
+ created_at?: string | null;
3232
+ cumulative_input_tokens?: number;
3233
+ cumulative_output_tokens?: number;
3234
+ deleted_at?: string | null;
3235
+ ended_at?: string | null;
3236
+ memory_snapshot?: Json;
3237
+ memory_version?: number;
3238
+ metadata?: Json | null;
3239
+ organization_id?: string;
3240
+ resource_id?: string;
3241
+ session_id?: string;
3242
+ session_total_turns?: number | null;
3243
+ updated_at?: string | null;
3244
+ user_id?: string | null;
3245
+ };
3246
+ Relationships: [
3247
+ {
3248
+ foreignKeyName: "fk_organization";
3249
+ columns: ["organization_id"];
3250
+ isOneToOne: false;
3251
+ referencedRelation: "organizations";
3252
+ referencedColumns: ["id"];
3253
+ },
3254
+ {
3255
+ foreignKeyName: "fk_user";
3256
+ columns: ["user_id"];
3257
+ isOneToOne: false;
3258
+ referencedRelation: "users";
3259
+ referencedColumns: ["id"];
3260
+ }
3261
+ ];
3262
+ };
3263
+ task_schedules: {
3264
+ Row: {
3265
+ created_at: string;
3266
+ current_step: number;
3267
+ description: string | null;
3268
+ id: string;
3269
+ idempotency_key: string | null;
3270
+ last_execution_id: string | null;
3271
+ last_run_at: string | null;
3272
+ max_retries: number;
3273
+ metadata: Json | null;
3274
+ name: string;
3275
+ next_run_at: string | null;
3276
+ organization_id: string;
3277
+ origin_execution_id: string | null;
3278
+ origin_resource_id: string | null;
3279
+ origin_resource_type: string | null;
3280
+ retry_count: number;
3281
+ schedule_config: Json;
3282
+ status: string;
3283
+ target_resource_id: string;
3284
+ target_resource_type: string;
3285
+ updated_at: string;
3286
+ };
3287
+ Insert: {
3288
+ created_at?: string;
3289
+ current_step?: number;
3290
+ description?: string | null;
3291
+ id?: string;
3292
+ idempotency_key?: string | null;
3293
+ last_execution_id?: string | null;
3294
+ last_run_at?: string | null;
3295
+ max_retries?: number;
3296
+ metadata?: Json | null;
3297
+ name: string;
3298
+ next_run_at?: string | null;
3299
+ organization_id: string;
3300
+ origin_execution_id?: string | null;
3301
+ origin_resource_id?: string | null;
3302
+ origin_resource_type?: string | null;
3303
+ retry_count?: number;
3304
+ schedule_config: Json;
3305
+ status?: string;
3306
+ target_resource_id: string;
3307
+ target_resource_type: string;
3308
+ updated_at?: string;
3309
+ };
3310
+ Update: {
3311
+ created_at?: string;
3312
+ current_step?: number;
3313
+ description?: string | null;
3314
+ id?: string;
3315
+ idempotency_key?: string | null;
3316
+ last_execution_id?: string | null;
3317
+ last_run_at?: string | null;
3318
+ max_retries?: number;
3319
+ metadata?: Json | null;
3320
+ name?: string;
3321
+ next_run_at?: string | null;
3322
+ organization_id?: string;
3323
+ origin_execution_id?: string | null;
3324
+ origin_resource_id?: string | null;
3325
+ origin_resource_type?: string | null;
3326
+ retry_count?: number;
3327
+ schedule_config?: Json;
3328
+ status?: string;
3329
+ target_resource_id?: string;
3330
+ target_resource_type?: string;
3331
+ updated_at?: string;
3332
+ };
3333
+ Relationships: [
3334
+ {
3335
+ foreignKeyName: "task_schedules_organization_id_fkey";
3336
+ columns: ["organization_id"];
3337
+ isOneToOne: false;
3338
+ referencedRelation: "organizations";
3339
+ referencedColumns: ["id"];
3340
+ }
3341
+ ];
3342
+ };
3343
+ user_notes: {
3344
+ Row: {
3345
+ content: string;
3346
+ created_at: string;
3347
+ created_by: string;
3348
+ id: string;
3349
+ metadata: Json;
3350
+ organization_id: string | null;
3351
+ pinned: boolean;
3352
+ priority: string;
3353
+ source: string | null;
3354
+ title: string | null;
3355
+ updated_at: string;
3356
+ user_id: string;
3357
+ visibility: string;
3358
+ };
3359
+ Insert: {
3360
+ content: string;
3361
+ created_at?: string;
3362
+ created_by?: string;
3363
+ id?: string;
3364
+ metadata?: Json;
3365
+ organization_id?: string | null;
3366
+ pinned?: boolean;
3367
+ priority?: string;
3368
+ source?: string | null;
3369
+ title?: string | null;
3370
+ updated_at?: string;
3371
+ user_id: string;
3372
+ visibility?: string;
3373
+ };
3374
+ Update: {
3375
+ content?: string;
3376
+ created_at?: string;
3377
+ created_by?: string;
3378
+ id?: string;
3379
+ metadata?: Json;
3380
+ organization_id?: string | null;
3381
+ pinned?: boolean;
3382
+ priority?: string;
3383
+ source?: string | null;
3384
+ title?: string | null;
3385
+ updated_at?: string;
3386
+ user_id?: string;
3387
+ visibility?: string;
3388
+ };
3389
+ Relationships: [
3390
+ {
3391
+ foreignKeyName: "user_notes_organization_id_fkey";
3392
+ columns: ["organization_id"];
3393
+ isOneToOne: false;
3394
+ referencedRelation: "organizations";
3395
+ referencedColumns: ["id"];
3396
+ },
3397
+ {
3398
+ foreignKeyName: "user_notes_user_id_fkey";
3399
+ columns: ["user_id"];
3400
+ isOneToOne: false;
3401
+ referencedRelation: "users";
3402
+ referencedColumns: ["id"];
3403
+ }
3404
+ ];
3405
+ };
3406
+ users: {
3407
+ Row: {
3408
+ config: Json;
3409
+ created_at: string;
3410
+ display_name: string | null;
3411
+ email: string;
3412
+ first_name: string | null;
3413
+ id: string;
3414
+ is_active: boolean;
3415
+ is_platform_admin: boolean | null;
3416
+ last_login_at: string | null;
3417
+ last_name: string | null;
3418
+ last_visited_org: string | null;
3419
+ profile_picture_url: string | null;
3420
+ updated_at: string;
3421
+ workos_user_id: string | null;
3422
+ };
3423
+ Insert: {
3424
+ config?: Json;
3425
+ created_at?: string;
3426
+ display_name?: string | null;
3427
+ email: string;
3428
+ first_name?: string | null;
3429
+ id?: string;
3430
+ is_active?: boolean;
3431
+ is_platform_admin?: boolean | null;
3432
+ last_login_at?: string | null;
3433
+ last_name?: string | null;
3434
+ last_visited_org?: string | null;
3435
+ profile_picture_url?: string | null;
3436
+ updated_at?: string;
3437
+ workos_user_id?: string | null;
3438
+ };
3439
+ Update: {
3440
+ config?: Json;
3441
+ created_at?: string;
3442
+ display_name?: string | null;
3443
+ email?: string;
3444
+ first_name?: string | null;
3445
+ id?: string;
3446
+ is_active?: boolean;
3447
+ is_platform_admin?: boolean | null;
3448
+ last_login_at?: string | null;
3449
+ last_name?: string | null;
3450
+ last_visited_org?: string | null;
3451
+ profile_picture_url?: string | null;
3452
+ updated_at?: string;
3453
+ workos_user_id?: string | null;
3454
+ };
3455
+ Relationships: [
3456
+ {
3457
+ foreignKeyName: "user_profiles_last_visited_org_fkey";
3458
+ columns: ["last_visited_org"];
3459
+ isOneToOne: false;
3460
+ referencedRelation: "organizations";
3461
+ referencedColumns: ["id"];
3462
+ }
3463
+ ];
3464
+ };
3465
+ webhook_endpoints: {
3466
+ Row: {
3467
+ created_at: string;
3468
+ description: string | null;
3469
+ id: string;
3470
+ key_hash: string;
3471
+ key_prefix: string | null;
3472
+ last_triggered_at: string | null;
3473
+ name: string;
3474
+ organization_id: string;
3475
+ request_count: number;
3476
+ resource_id: string | null;
3477
+ status: string;
3478
+ updated_at: string;
3479
+ };
3480
+ Insert: {
3481
+ created_at?: string;
3482
+ description?: string | null;
3483
+ id?: string;
3484
+ key_hash: string;
3485
+ key_prefix?: string | null;
3486
+ last_triggered_at?: string | null;
3487
+ name: string;
3488
+ organization_id: string;
3489
+ request_count?: number;
3490
+ resource_id?: string | null;
3491
+ status?: string;
3492
+ updated_at?: string;
3493
+ };
3494
+ Update: {
3495
+ created_at?: string;
3496
+ description?: string | null;
3497
+ id?: string;
3498
+ key_hash?: string;
3499
+ key_prefix?: string | null;
3500
+ last_triggered_at?: string | null;
3501
+ name?: string;
3502
+ organization_id?: string;
3503
+ request_count?: number;
3504
+ resource_id?: string | null;
3505
+ status?: string;
3506
+ updated_at?: string;
3507
+ };
3508
+ Relationships: [
3509
+ {
3510
+ foreignKeyName: "webhook_endpoints_organization_id_fkey";
3511
+ columns: ["organization_id"];
3512
+ isOneToOne: false;
3513
+ referencedRelation: "organizations";
3514
+ referencedColumns: ["id"];
3515
+ }
3516
+ ];
3517
+ };
3518
+ };
3519
+ Views: {
3520
+ [_ in never]: never;
3521
+ };
3522
+ Functions: {
3523
+ acq_default_checklist: {
3524
+ Args: {
3525
+ p_platform: string;
3526
+ };
3527
+ Returns: Json;
3528
+ };
3529
+ activate_deployment_atomic: {
3530
+ Args: {
3531
+ p_deployment_id: string;
3532
+ p_organization_id: string;
3533
+ };
3534
+ Returns: {
3535
+ created_at: string;
3536
+ deployment_version: string | null;
3537
+ error_message: string | null;
3538
+ id: string;
3539
+ organization_id: string;
3540
+ pid: number | null;
3541
+ port: number | null;
3542
+ sdk_version: string;
3543
+ status: string;
3544
+ tarball_path: string | null;
3545
+ updated_at: string;
3546
+ };
3547
+ };
3548
+ append_deal_activity: {
3549
+ Args: {
3550
+ p_activity: Json;
3551
+ p_deal_id: string;
3552
+ p_organization_id: string;
3553
+ };
3554
+ Returns: undefined;
3555
+ };
3556
+ auth_jwt_claims: {
3557
+ Args: Record<PropertyKey, never>;
3558
+ Returns: Json;
3559
+ };
3560
+ auth_uid_safe: {
3561
+ Args: Record<PropertyKey, never>;
3562
+ Returns: string;
3563
+ };
3564
+ can_assign_role_in_org: {
3565
+ Args: {
3566
+ p_role_id: string;
3567
+ p_target_membership_id: string;
3568
+ };
3569
+ Returns: boolean;
3570
+ };
3571
+ create_artifact_version: {
3572
+ Args: {
3573
+ p_content: Json;
3574
+ p_created_by?: string;
3575
+ p_kind: string;
3576
+ p_organization_id: string;
3577
+ p_owner_id?: string;
3578
+ p_owner_kind: string;
3579
+ p_pipeline_id?: string;
3580
+ p_source_execution_id?: string;
3581
+ };
3582
+ Returns: {
3583
+ content: Json;
3584
+ created_at: string;
3585
+ created_by: string | null;
3586
+ id: string;
3587
+ is_active: boolean;
3588
+ kind: string;
3589
+ organization_id: string;
3590
+ owner_id: string | null;
3591
+ owner_kind: string;
3592
+ pipeline_id: string | null;
3593
+ source_execution_id: string | null;
3594
+ updated_at: string;
3595
+ version: number;
3596
+ };
3597
+ };
3598
+ current_user_is_platform_admin: {
3599
+ Args: Record<PropertyKey, never>;
3600
+ Returns: boolean;
3601
+ };
3602
+ current_user_shares_org_with: {
3603
+ Args: {
3604
+ other_user_id: string;
3605
+ };
3606
+ Returns: boolean;
3607
+ };
3608
+ current_user_supabase_id: {
3609
+ Args: Record<PropertyKey, never>;
3610
+ Returns: string;
3611
+ };
3612
+ execute_session_turn: {
3613
+ Args: {
3614
+ p_session_id: string;
3615
+ };
3616
+ Returns: {
3617
+ context_window_size: number;
3618
+ created_at: string;
3619
+ cumulative_input_tokens: number;
3620
+ cumulative_output_tokens: number;
3621
+ deleted_at: string;
3622
+ ended_at: string;
3623
+ memory_snapshot: Json;
3624
+ memory_version: number;
3625
+ metadata: Json;
3626
+ organization_id: string;
3627
+ resource_id: string;
3628
+ session_id: string;
3629
+ session_total_turns: number;
3630
+ updated_at: string;
3631
+ user_id: string;
3632
+ }[];
3633
+ };
3634
+ get_platform_credential_kek: {
3635
+ Args: Record<PropertyKey, never>;
3636
+ Returns: string;
3637
+ };
3638
+ get_storage_org_id: {
3639
+ Args: {
3640
+ file_path: string;
3641
+ };
3642
+ Returns: string;
3643
+ };
3644
+ get_workos_user_id: {
3645
+ Args: Record<PropertyKey, never>;
3646
+ Returns: string;
3647
+ };
3648
+ has_org_access: {
3649
+ Args: {
3650
+ action?: string;
3651
+ org_id: string;
3652
+ system_path: string;
3653
+ } | {
3654
+ action?: string;
3655
+ system_path: string;
3656
+ };
3657
+ Returns: boolean;
3658
+ };
3659
+ has_org_permission: {
3660
+ Args: {
3661
+ org_id: string;
3662
+ perm_key: string;
3663
+ };
3664
+ Returns: boolean;
3665
+ };
3666
+ increment_session_tokens: {
3667
+ Args: {
3668
+ p_input_tokens: number;
3669
+ p_output_tokens: number;
3670
+ p_session_id: string;
3671
+ };
3672
+ Returns: {
3673
+ context_window_size: number;
3674
+ cumulative_input_tokens: number;
3675
+ cumulative_output_tokens: number;
3676
+ }[];
3677
+ };
3678
+ is_org_member: {
3679
+ Args: {
3680
+ org_id: string;
3681
+ };
3682
+ Returns: boolean;
3683
+ };
3684
+ link_workos_membership_on_accept: {
3685
+ Args: {
3686
+ p_email: string;
3687
+ p_organization_id: string;
3688
+ p_workos_membership_id: string;
3689
+ };
3690
+ Returns: boolean;
3691
+ };
3692
+ pre_provision_invited_user: {
3693
+ Args: {
3694
+ p_email: string;
3695
+ p_organization_id: string;
3696
+ p_role_slug?: string;
3697
+ };
3698
+ Returns: Json;
3699
+ };
3700
+ process_due_schedules: {
3701
+ Args: Record<PropertyKey, never>;
3702
+ Returns: Json;
3703
+ };
3704
+ purge_stale_test_data: {
3705
+ Args: {
3706
+ p_max_age?: unknown;
3707
+ };
3708
+ Returns: Json;
3709
+ };
3710
+ recompute_all_memberships: {
3711
+ Args: Record<PropertyKey, never>;
3712
+ Returns: undefined;
3713
+ };
3714
+ repair_membership_role_assignments: {
3715
+ Args: Record<PropertyKey, never>;
3716
+ Returns: {
3717
+ membership_id: string;
3718
+ organization_id: string;
3719
+ repaired: boolean;
3720
+ role_id: string;
3721
+ role_slug: string;
3722
+ user_id: string;
3723
+ }[];
3724
+ };
3725
+ sync_all_memberships_with_role: {
3726
+ Args: {
3727
+ p_role_id: string;
3728
+ };
3729
+ Returns: undefined;
3730
+ };
3731
+ sync_one_membership: {
3732
+ Args: {
3733
+ p_membership_id: string;
3734
+ };
3735
+ Returns: undefined;
3736
+ };
3737
+ update_membership_role_assignment: {
3738
+ Args: {
3739
+ p_role_slug: string;
3740
+ p_workos_membership_id: string;
3741
+ };
3742
+ Returns: string;
3743
+ };
3744
+ upsert_user_profile: {
3745
+ Args: Record<PropertyKey, never>;
3746
+ Returns: {
3747
+ profile_display_name: string;
3748
+ profile_email: string;
3749
+ profile_id: string;
3750
+ profile_workos_user_id: string;
3751
+ }[];
3752
+ };
3753
+ };
3754
+ Enums: {
3755
+ [_ in never]: never;
3756
+ };
3757
+ CompositeTypes: {
3758
+ [_ in never]: never;
3759
+ };
3760
+ };
3761
+ };
3762
+
3763
+ /**
3764
+ * Branded organization identifiers.
3765
+ *
3766
+ * Every organization carries TWO distinct ID values that are both plain
3767
+ * strings at runtime but mean different things:
3768
+ *
3769
+ * - WorkOS organization id (`org_...`) -- the auth/JWT identity. Used for API
3770
+ * requests, SSE headers, and org-scoped query keys.
3771
+ * - Supabase organization id (UUID) -- the database key. Used for
3772
+ * `.eq('organization_id', ...)` queries and RLS scoping.
3773
+ *
3774
+ * They are not interchangeable, yet both are `string` -- so a swap compiles
3775
+ * cleanly and fails silently (zero rows on the Supabase side, cross-pollinated
3776
+ * cache keys on the API side). These brands make the two non-assignable to one
3777
+ * another, turning that silent footgun into a compile error at the sink.
3778
+ *
3779
+ * Mint a brand only through the `as*` factories below: they are the single
3780
+ * validate-and-tag boundary (compile-time brand + runtime format check). The
3781
+ * type predicates double as the cast, so no raw `as` cast is needed anywhere.
3782
+ *
3783
+ * Lives on the published `@repo/core` / `@repo/core/auth` surface so the UI,
3784
+ * the API, and the dogfooding `@repo/elevasis-*` packages can all use it.
3785
+ */
3786
+ declare const supabaseOrgIdBrand: unique symbol;
54
3787
  declare const workOsOrgIdBrand: unique symbol;
3788
+ /** A Supabase organization id (UUID) -- the database key for RLS-scoped rows. */
3789
+ type SupabaseOrgId = string & {
3790
+ readonly [supabaseOrgIdBrand]: true;
3791
+ };
55
3792
  /** A WorkOS organization id (`org_...`) -- the auth identity for API/SSE/query keys. */
56
3793
  type WorkOsOrgId = string & {
57
3794
  readonly [workOsOrgIdBrand]: true;
@@ -2933,5 +6670,169 @@ declare function ListBuilderPage({ listId }: {
2933
6670
  listId: string;
2934
6671
  }): react_jsx_runtime.JSX.Element;
2935
6672
 
2936
- export { EMPTY_LIST_ACTIONS, LEAD_GEN_ITEMS, LEAD_GEN_ROUTE_LINKS, LeadGenCompaniesPage, LeadGenContactsPage, LeadGenListDetailPage, LeadGenListsPage, LeadGenOverviewPage, LeadGenRouteShell, LeadGenSidebar, LeadGenSidebarMiddle, LeadGenSidebarTop, ListActionsProvider, ListBuilderIndexPage, ListBuilderPage, ORPHAN_STAGE_ORDER, companyKeys as acquisitionCompanyKeys, contactKeys as acquisitionContactKeys, companyKeys, contactKeys, deriveBusinessProgress, findListActionByAction, formatDate, getEnrichmentColor, getEnrichmentStatus, getLeadGenApiInterfaceReadiness, getLeadGenExportWorkflowId, getListActionWorkflowId, getStateKeyColor, getStatusColor, getStepActionLabel, isLeadGenExportAction, leadGenArtifactKeys, leadGenListCompanyKeys, leadGenListMemberKeys, leadGenManifest, resolveBuildPlanSteps, resolveBuildState, sortStageKeys, useArtifacts, useCompanies, useCompany, useCompanyFacets, useContact, useContacts, useCreateArtifact, useCreateCompany, useCreateContact, useDeleteCompanies, useDeleteContacts, useDeleteLists, useDeriveActions, useLeadGenActionRegistry, useLeadGenBulkActions, useLeadGenConfig, useLeadGenHeaderActions, useLeadGenRowActions, useListActions, useListMember, useListMembers, useListProgress, useTransitionListCompany, useTransitionListMember, useUpdateCompany, useUpdateContact, useUpdateListStatus };
2937
- export type { AcqCompanyWithCount, AcqContactWithCompany, BuildResolution, BuildStepPrimaryEntity, BuildStepState, LeadGenActionKey, LeadGenActionRegistry, LeadGenApiInterfaceReadiness, LeadGenBuildConfig, LeadGenBulkAction, LeadGenCompaniesPageSlots, LeadGenCompanyListItem, LeadGenConfig, LeadGenContactListItem, LeadGenContactsPageSlots, LeadGenHeaderAction, LeadGenListDetailPageSlots, LeadGenManifest, LeadGenOverviewPageSlots, LeadGenPageOverrides, LeadGenRouteLink, LeadGenRowAction, LeadGenSidebarMiddleProps, LeadGenStageKey, LeadGenSystemModule, ListActionDefinition, ListActionFormContext, ListActionSelectionMode, ListBuildActionKind, ListBuildRecommendedAction, ListBuildStepStatus, ListBuilderRegistry, ListBuilderWorkflow, ListBuilderWorkflowCategory, MvpBuildStepDefinition, StatefulItem, TransitionListCompanyInput, TransitionListMemberInput, UpdateListStatusInput, UseArtifactsParams };
6673
+ type AcqSocialPostRow = Database['public']['Tables']['acq_social_posts']['Row'];
6674
+ type SocialPostPlatform = 'reddit' | 'linkedin';
6675
+ type SocialPostStatus = 'new' | 'skipped' | 'complete';
6676
+ interface SocialPostFilters {
6677
+ platform?: SocialPostPlatform;
6678
+ status?: SocialPostStatus;
6679
+ search?: string;
6680
+ }
6681
+
6682
+ /**
6683
+ * Query keys for social posts (monitoring)
6684
+ */
6685
+ declare const socialPostKeys: {
6686
+ all: readonly ["acq-social-posts"];
6687
+ lists: () => readonly ["acq-social-posts", "list"];
6688
+ list: (orgId: SupabaseOrgId | null, filters: SocialPostFilters) => readonly ["acq-social-posts", "list", SupabaseOrgId | null, SocialPostFilters];
6689
+ };
6690
+ /**
6691
+ * Fetch social posts with optional filters
6692
+ */
6693
+ declare function useSocialPosts(filters?: SocialPostFilters): _tanstack_react_query.UseQueryResult<{
6694
+ author_name: string;
6695
+ author_url: string | null;
6696
+ comments_count: number;
6697
+ created_at: string;
6698
+ discovered_at: string;
6699
+ engagement_count: number;
6700
+ feedback: string | null;
6701
+ final_response: string | null;
6702
+ fully_reviewed: boolean;
6703
+ id: string;
6704
+ initial_draft: string | null;
6705
+ matched_keywords: string[];
6706
+ matched_query: string | null;
6707
+ metadata: Json;
6708
+ organization_id: string;
6709
+ platform: string;
6710
+ platform_post_id: string;
6711
+ post_text: string;
6712
+ post_title: string;
6713
+ post_url: string;
6714
+ posted_at: string;
6715
+ relevance_score: number;
6716
+ responded_at: string | null;
6717
+ reviewed_at: string | null;
6718
+ skip_reason: string | null;
6719
+ source_category: string | null;
6720
+ status: string;
6721
+ updated_at: string;
6722
+ }[], Error>;
6723
+
6724
+ /**
6725
+ * Query keys for a single social post
6726
+ */
6727
+ declare const socialPostDetailKeys: {
6728
+ detail: (id: string) => readonly ["acq-social-posts", "detail", string];
6729
+ };
6730
+ /**
6731
+ * Get adjacent post IDs (previous/next) for navigation.
6732
+ * Uses the cached social posts list to stay consistent with list view ordering.
6733
+ */
6734
+ declare function useAdjacentPosts(postId: string): {
6735
+ prevId: string | null;
6736
+ nextId: string | null;
6737
+ };
6738
+ /**
6739
+ * Fetch a single social post by ID
6740
+ */
6741
+ declare function useSocialPost(postId: string): _tanstack_react_query.UseQueryResult<{
6742
+ author_name: string;
6743
+ author_url: string | null;
6744
+ comments_count: number;
6745
+ created_at: string;
6746
+ discovered_at: string;
6747
+ engagement_count: number;
6748
+ feedback: string | null;
6749
+ final_response: string | null;
6750
+ fully_reviewed: boolean;
6751
+ id: string;
6752
+ initial_draft: string | null;
6753
+ matched_keywords: string[];
6754
+ matched_query: string | null;
6755
+ metadata: Json;
6756
+ organization_id: string;
6757
+ platform: string;
6758
+ platform_post_id: string;
6759
+ post_text: string;
6760
+ post_title: string;
6761
+ post_url: string;
6762
+ posted_at: string;
6763
+ relevance_score: number;
6764
+ responded_at: string | null;
6765
+ reviewed_at: string | null;
6766
+ skip_reason: string | null;
6767
+ source_category: string | null;
6768
+ status: string;
6769
+ updated_at: string;
6770
+ } | null, Error>;
6771
+ type SocialPostUpdatableFields = {
6772
+ status?: string;
6773
+ final_response?: string | null;
6774
+ skip_reason?: string | null;
6775
+ feedback?: string | null;
6776
+ responded_at?: string | null;
6777
+ reviewed_at?: string | null;
6778
+ };
6779
+ /**
6780
+ * Update a social post (status, response notes)
6781
+ */
6782
+ /**
6783
+ * Delete a social post by ID
6784
+ */
6785
+ declare function useDeleteSocialPost(): _tanstack_react_query.UseMutationResult<void, Error, string, unknown>;
6786
+ declare function useUpdateSocialPost(postId: string): _tanstack_react_query.UseMutationResult<void, Error, SocialPostUpdatableFields, {
6787
+ previous: [readonly unknown[], {
6788
+ author_name: string;
6789
+ author_url: string | null;
6790
+ comments_count: number;
6791
+ created_at: string;
6792
+ discovered_at: string;
6793
+ engagement_count: number;
6794
+ feedback: string | null;
6795
+ final_response: string | null;
6796
+ fully_reviewed: boolean;
6797
+ id: string;
6798
+ initial_draft: string | null;
6799
+ matched_keywords: string[];
6800
+ matched_query: string | null;
6801
+ metadata: Json;
6802
+ organization_id: string;
6803
+ platform: string;
6804
+ platform_post_id: string;
6805
+ post_text: string;
6806
+ post_title: string;
6807
+ post_url: string;
6808
+ posted_at: string;
6809
+ relevance_score: number;
6810
+ responded_at: string | null;
6811
+ reviewed_at: string | null;
6812
+ skip_reason: string | null;
6813
+ source_category: string | null;
6814
+ status: string;
6815
+ updated_at: string;
6816
+ } | undefined][];
6817
+ }>;
6818
+
6819
+ interface SocialMonitoringPageProps {
6820
+ /** Called with the row's post id when a table row is clicked. */
6821
+ onPostClick: (postId: string) => void;
6822
+ }
6823
+ declare function SocialMonitoringPage({ onPostClick }: SocialMonitoringPageProps): react_jsx_runtime.JSX.Element;
6824
+
6825
+ interface SocialPostDetailPageProps {
6826
+ /** Id of the `acq_social_posts` row to render. */
6827
+ postId: string;
6828
+ /** Called with a post id when the previous/next buttons are used. */
6829
+ onPostChange: (postId: string) => void;
6830
+ /** Invoked by the back button in the page header. */
6831
+ onBack: () => void;
6832
+ /** Label for the back button. */
6833
+ backLabel?: string;
6834
+ }
6835
+ declare function SocialPostDetailPage({ postId, onPostChange, onBack, backLabel }: SocialPostDetailPageProps): react_jsx_runtime.JSX.Element;
6836
+
6837
+ export { EMPTY_LIST_ACTIONS, LEAD_GEN_ITEMS, LEAD_GEN_ROUTE_LINKS, LeadGenCompaniesPage, LeadGenContactsPage, LeadGenListDetailPage, LeadGenListsPage, LeadGenOverviewPage, LeadGenRouteShell, LeadGenSidebar, LeadGenSidebarMiddle, LeadGenSidebarTop, ListActionsProvider, ListBuilderIndexPage, ListBuilderPage, ORPHAN_STAGE_ORDER, SocialMonitoringPage, SocialPostDetailPage, companyKeys as acquisitionCompanyKeys, contactKeys as acquisitionContactKeys, companyKeys, contactKeys, deriveBusinessProgress, findListActionByAction, formatDate, getEnrichmentColor, getEnrichmentStatus, getLeadGenApiInterfaceReadiness, getLeadGenExportWorkflowId, getListActionWorkflowId, getStateKeyColor, getStatusColor, getStepActionLabel, isLeadGenExportAction, leadGenArtifactKeys, leadGenListCompanyKeys, leadGenListMemberKeys, leadGenManifest, resolveBuildPlanSteps, resolveBuildState, socialPostDetailKeys, socialPostKeys, sortStageKeys, useAdjacentPosts, useArtifacts, useCompanies, useCompany, useCompanyFacets, useContact, useContacts, useCreateArtifact, useCreateCompany, useCreateContact, useDeleteCompanies, useDeleteContacts, useDeleteLists, useDeleteSocialPost, useDeriveActions, useLeadGenActionRegistry, useLeadGenBulkActions, useLeadGenConfig, useLeadGenHeaderActions, useLeadGenRowActions, useListActions, useListMember, useListMembers, useListProgress, useSocialPost, useSocialPosts, useTransitionListCompany, useTransitionListMember, useUpdateCompany, useUpdateContact, useUpdateListStatus, useUpdateSocialPost };
6838
+ export type { AcqCompanyWithCount, AcqContactWithCompany, AcqSocialPostRow, BuildResolution, BuildStepPrimaryEntity, BuildStepState, LeadGenActionKey, LeadGenActionRegistry, LeadGenApiInterfaceReadiness, LeadGenBuildConfig, LeadGenBulkAction, LeadGenCompaniesPageSlots, LeadGenCompanyListItem, LeadGenConfig, LeadGenContactListItem, LeadGenContactsPageSlots, LeadGenHeaderAction, LeadGenListDetailPageSlots, LeadGenManifest, LeadGenOverviewPageSlots, LeadGenPageOverrides, LeadGenRouteLink, LeadGenRowAction, LeadGenSidebarMiddleProps, LeadGenStageKey, LeadGenSystemModule, ListActionDefinition, ListActionFormContext, ListActionSelectionMode, ListBuildActionKind, ListBuildRecommendedAction, ListBuildStepStatus, ListBuilderRegistry, ListBuilderWorkflow, ListBuilderWorkflowCategory, MvpBuildStepDefinition, SocialMonitoringPageProps, SocialPostDetailPageProps, SocialPostFilters, SocialPostPlatform, SocialPostStatus, StatefulItem, TransitionListCompanyInput, TransitionListMemberInput, UpdateListStatusInput, UseArtifactsParams };