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