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