@elevasis/ui 1.3.3 → 1.3.5

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 (213) hide show
  1. package/dist/api/index.js +1 -1
  2. package/dist/auth/index.d.ts +174 -14
  3. package/dist/{chunk-XLV6LYN2.js → chunk-LBPALY25.js} +0 -1
  4. package/dist/{chunk-LTQAAIGE.js → chunk-Y2I5JJ3N.js} +1 -1
  5. package/dist/hooks/index.d.ts +4401 -11
  6. package/dist/hooks/published.d.ts +5013 -19
  7. package/dist/index.d.ts +6316 -15
  8. package/dist/index.js +18 -97
  9. package/dist/initialization/index.d.ts +2222 -22
  10. package/dist/organization/index.d.ts +266 -21
  11. package/dist/profile/index.d.ts +2158 -14
  12. package/dist/provider/index.d.ts +266 -7
  13. package/dist/provider/index.js +12 -3
  14. package/dist/provider/published.d.ts +263 -9
  15. package/dist/provider/published.js +2 -2
  16. package/package.json +47 -3
  17. package/dist/auth/guards/AdminGuard.d.ts +0 -32
  18. package/dist/auth/guards/AdminGuard.d.ts.map +0 -1
  19. package/dist/auth/guards/ProtectedRoute.d.ts +0 -60
  20. package/dist/auth/guards/ProtectedRoute.d.ts.map +0 -1
  21. package/dist/auth/guards/__tests__/AdminGuard.test.d.ts +0 -12
  22. package/dist/auth/guards/__tests__/AdminGuard.test.d.ts.map +0 -1
  23. package/dist/auth/guards/__tests__/ProtectedRoute.test.d.ts +0 -14
  24. package/dist/auth/guards/__tests__/ProtectedRoute.test.d.ts.map +0 -1
  25. package/dist/auth/index.d.ts.map +0 -1
  26. package/dist/hooks/command-queue/index.d.ts +0 -7
  27. package/dist/hooks/command-queue/index.d.ts.map +0 -1
  28. package/dist/hooks/command-queue/useCommandQueue.d.ts +0 -33
  29. package/dist/hooks/command-queue/useCommandQueue.d.ts.map +0 -1
  30. package/dist/hooks/command-queue/useCommandQueueTotals.d.ts +0 -17
  31. package/dist/hooks/command-queue/useCommandQueueTotals.d.ts.map +0 -1
  32. package/dist/hooks/command-queue/useDeleteTask.d.ts +0 -5
  33. package/dist/hooks/command-queue/useDeleteTask.d.ts.map +0 -1
  34. package/dist/hooks/command-queue/usePatchTask.d.ts +0 -6
  35. package/dist/hooks/command-queue/usePatchTask.d.ts.map +0 -1
  36. package/dist/hooks/command-queue/useSubmitAction.d.ts +0 -29
  37. package/dist/hooks/command-queue/useSubmitAction.d.ts.map +0 -1
  38. package/dist/hooks/executions/index.d.ts +0 -16
  39. package/dist/hooks/executions/index.d.ts.map +0 -1
  40. package/dist/hooks/executions/useBulkDeleteExecutions.d.ts +0 -15
  41. package/dist/hooks/executions/useBulkDeleteExecutions.d.ts.map +0 -1
  42. package/dist/hooks/executions/useCancelExecution.d.ts +0 -20
  43. package/dist/hooks/executions/useCancelExecution.d.ts.map +0 -1
  44. package/dist/hooks/executions/useDeleteExecution.d.ts +0 -13
  45. package/dist/hooks/executions/useDeleteExecution.d.ts.map +0 -1
  46. package/dist/hooks/executions/useExecuteAsync.d.ts +0 -21
  47. package/dist/hooks/executions/useExecuteAsync.d.ts.map +0 -1
  48. package/dist/hooks/executions/useExecution.d.ts +0 -10
  49. package/dist/hooks/executions/useExecution.d.ts.map +0 -1
  50. package/dist/hooks/executions/useExecutions.d.ts +0 -16
  51. package/dist/hooks/executions/useExecutions.d.ts.map +0 -1
  52. package/dist/hooks/executions/useResourceDefinition.d.ts +0 -9
  53. package/dist/hooks/executions/useResourceDefinition.d.ts.map +0 -1
  54. package/dist/hooks/executions/useResources.d.ts +0 -15
  55. package/dist/hooks/executions/useResources.d.ts.map +0 -1
  56. package/dist/hooks/executions/useRetryExecution.d.ts +0 -16
  57. package/dist/hooks/executions/useRetryExecution.d.ts.map +0 -1
  58. package/dist/hooks/feature-access/createUseFeatureAccess.d.ts +0 -44
  59. package/dist/hooks/feature-access/createUseFeatureAccess.d.ts.map +0 -1
  60. package/dist/hooks/feature-access/index.d.ts +0 -2
  61. package/dist/hooks/feature-access/index.d.ts.map +0 -1
  62. package/dist/hooks/index.d.ts.map +0 -1
  63. package/dist/hooks/monitoring/index.d.ts +0 -9
  64. package/dist/hooks/monitoring/index.d.ts.map +0 -1
  65. package/dist/hooks/monitoring/useActivities.d.ts +0 -52
  66. package/dist/hooks/monitoring/useActivities.d.ts.map +0 -1
  67. package/dist/hooks/monitoring/useCostSummary.d.ts +0 -7
  68. package/dist/hooks/monitoring/useCostSummary.d.ts.map +0 -1
  69. package/dist/hooks/monitoring/useExecutionHealth.d.ts +0 -10
  70. package/dist/hooks/monitoring/useExecutionHealth.d.ts.map +0 -1
  71. package/dist/hooks/monitoring/useExecutionLogs.d.ts +0 -56
  72. package/dist/hooks/monitoring/useExecutionLogs.d.ts.map +0 -1
  73. package/dist/hooks/monitoring/useNotifications.d.ts +0 -11
  74. package/dist/hooks/monitoring/useNotifications.d.ts.map +0 -1
  75. package/dist/hooks/notifications/index.d.ts +0 -8
  76. package/dist/hooks/notifications/index.d.ts.map +0 -1
  77. package/dist/hooks/notifications/useMarkAllAsRead.d.ts +0 -2
  78. package/dist/hooks/notifications/useMarkAllAsRead.d.ts.map +0 -1
  79. package/dist/hooks/notifications/useMarkAsRead.d.ts +0 -2
  80. package/dist/hooks/notifications/useMarkAsRead.d.ts.map +0 -1
  81. package/dist/hooks/notifications/useNotificationCount.d.ts +0 -8
  82. package/dist/hooks/notifications/useNotificationCount.d.ts.map +0 -1
  83. package/dist/hooks/observability/index.d.ts +0 -19
  84. package/dist/hooks/observability/index.d.ts.map +0 -1
  85. package/dist/hooks/observability/useBusinessImpact.d.ts +0 -9
  86. package/dist/hooks/observability/useBusinessImpact.d.ts.map +0 -1
  87. package/dist/hooks/observability/useCostBreakdown.d.ts +0 -10
  88. package/dist/hooks/observability/useCostBreakdown.d.ts.map +0 -1
  89. package/dist/hooks/observability/useCostByModel.d.ts +0 -3
  90. package/dist/hooks/observability/useCostByModel.d.ts.map +0 -1
  91. package/dist/hooks/observability/useCostTrends.d.ts +0 -3
  92. package/dist/hooks/observability/useCostTrends.d.ts.map +0 -1
  93. package/dist/hooks/observability/useDashboardMetrics.d.ts +0 -3
  94. package/dist/hooks/observability/useDashboardMetrics.d.ts.map +0 -1
  95. package/dist/hooks/observability/useErrorAnalysis.d.ts +0 -7
  96. package/dist/hooks/observability/useErrorAnalysis.d.ts.map +0 -1
  97. package/dist/hooks/observability/useErrorDetails.d.ts +0 -20
  98. package/dist/hooks/observability/useErrorDetails.d.ts.map +0 -1
  99. package/dist/hooks/observability/useErrorDistribution.d.ts +0 -12
  100. package/dist/hooks/observability/useErrorDistribution.d.ts.map +0 -1
  101. package/dist/hooks/observability/useErrorTrends.d.ts +0 -12
  102. package/dist/hooks/observability/useErrorTrends.d.ts.map +0 -1
  103. package/dist/hooks/observability/useResolveError.d.ts +0 -17
  104. package/dist/hooks/observability/useResolveError.d.ts.map +0 -1
  105. package/dist/hooks/observability/useTopFailingResources.d.ts +0 -13
  106. package/dist/hooks/observability/useTopFailingResources.d.ts.map +0 -1
  107. package/dist/hooks/published.d.ts.map +0 -1
  108. package/dist/hooks/scheduling/index.d.ts +0 -5
  109. package/dist/hooks/scheduling/index.d.ts.map +0 -1
  110. package/dist/hooks/scheduling/useSchedules.d.ts +0 -185
  111. package/dist/hooks/scheduling/useSchedules.d.ts.map +0 -1
  112. package/dist/hooks/sessions/index.d.ts +0 -8
  113. package/dist/hooks/sessions/index.d.ts.map +0 -1
  114. package/dist/hooks/sessions/useSessionExecutions.d.ts +0 -13
  115. package/dist/hooks/sessions/useSessionExecutions.d.ts.map +0 -1
  116. package/dist/hooks/sessions/useSessionMessages.d.ts +0 -7
  117. package/dist/hooks/sessions/useSessionMessages.d.ts.map +0 -1
  118. package/dist/hooks/sessions/useSessions.d.ts +0 -26
  119. package/dist/hooks/sessions/useSessions.d.ts.map +0 -1
  120. package/dist/index.d.ts.map +0 -1
  121. package/dist/initialization/InitializationProvider.d.ts +0 -48
  122. package/dist/initialization/InitializationProvider.d.ts.map +0 -1
  123. package/dist/initialization/hooks/useAppInitialization.d.ts +0 -32
  124. package/dist/initialization/hooks/useAppInitialization.d.ts.map +0 -1
  125. package/dist/initialization/index.d.ts.map +0 -1
  126. package/dist/organization/context/OrganizationProvider.d.ts +0 -20
  127. package/dist/organization/context/OrganizationProvider.d.ts.map +0 -1
  128. package/dist/organization/hooks/useOrgInitialization.d.ts +0 -56
  129. package/dist/organization/hooks/useOrgInitialization.d.ts.map +0 -1
  130. package/dist/organization/index.d.ts.map +0 -1
  131. package/dist/profile/context/ProfileProvider.d.ts +0 -27
  132. package/dist/profile/context/ProfileProvider.d.ts.map +0 -1
  133. package/dist/profile/hooks/useUserProfile.d.ts +0 -31
  134. package/dist/profile/hooks/useUserProfile.d.ts.map +0 -1
  135. package/dist/profile/index.d.ts.map +0 -1
  136. package/dist/provider/CoreAuthKitInner.d.ts +0 -12
  137. package/dist/provider/CoreAuthKitInner.d.ts.map +0 -1
  138. package/dist/provider/ElevasisCoreProvider.d.ts +0 -39
  139. package/dist/provider/ElevasisCoreProvider.d.ts.map +0 -1
  140. package/dist/provider/ElevasisServiceContext.d.ts +0 -31
  141. package/dist/provider/ElevasisServiceContext.d.ts.map +0 -1
  142. package/dist/provider/__tests__/CoreAuthKitInner.test.d.ts +0 -2
  143. package/dist/provider/__tests__/CoreAuthKitInner.test.d.ts.map +0 -1
  144. package/dist/provider/__tests__/ElevasisCoreProvider.test.d.ts +0 -2
  145. package/dist/provider/__tests__/ElevasisCoreProvider.test.d.ts.map +0 -1
  146. package/dist/provider/index.d.ts.map +0 -1
  147. package/dist/provider/published.d.ts.map +0 -1
  148. package/dist/provider/types.d.ts +0 -143
  149. package/dist/provider/types.d.ts.map +0 -1
  150. package/dist/provider/types.js +0 -1
  151. package/dist/sdk-barrel.d.ts +0 -20
  152. package/dist/sdk-barrel.d.ts.map +0 -1
  153. package/dist/theme/cssVariables.d.ts +0 -12
  154. package/dist/theme/cssVariables.d.ts.map +0 -1
  155. package/dist/theme/cssVariables.js +0 -93
  156. package/dist/theme/index.d.ts +0 -4
  157. package/dist/theme/index.d.ts.map +0 -1
  158. package/dist/theme/index.js +0 -1
  159. package/dist/theme/presets/__tests__/getPreset.test.d.ts +0 -2
  160. package/dist/theme/presets/__tests__/getPreset.test.d.ts.map +0 -1
  161. package/dist/theme/presets/abyss.d.ts +0 -3
  162. package/dist/theme/presets/abyss.d.ts.map +0 -1
  163. package/dist/theme/presets/abyss.js +0 -54
  164. package/dist/theme/presets/aurora.d.ts +0 -8
  165. package/dist/theme/presets/aurora.d.ts.map +0 -1
  166. package/dist/theme/presets/aurora.js +0 -59
  167. package/dist/theme/presets/canopy.d.ts +0 -3
  168. package/dist/theme/presets/canopy.d.ts.map +0 -1
  169. package/dist/theme/presets/canopy.js +0 -58
  170. package/dist/theme/presets/cyber-flux.d.ts +0 -8
  171. package/dist/theme/presets/cyber-flux.d.ts.map +0 -1
  172. package/dist/theme/presets/cyber-flux.js +0 -66
  173. package/dist/theme/presets/cyber-strike.d.ts +0 -9
  174. package/dist/theme/presets/cyber-strike.d.ts.map +0 -1
  175. package/dist/theme/presets/cyber-strike.js +0 -62
  176. package/dist/theme/presets/cyber-void.d.ts +0 -8
  177. package/dist/theme/presets/cyber-void.d.ts.map +0 -1
  178. package/dist/theme/presets/cyber-void.js +0 -62
  179. package/dist/theme/presets/cyber-volt.d.ts +0 -8
  180. package/dist/theme/presets/cyber-volt.d.ts.map +0 -1
  181. package/dist/theme/presets/cyber-volt.js +0 -66
  182. package/dist/theme/presets/default.d.ts +0 -4
  183. package/dist/theme/presets/default.d.ts.map +0 -1
  184. package/dist/theme/presets/ember.d.ts +0 -8
  185. package/dist/theme/presets/ember.d.ts.map +0 -1
  186. package/dist/theme/presets/ember.js +0 -63
  187. package/dist/theme/presets/honey.d.ts +0 -3
  188. package/dist/theme/presets/honey.d.ts.map +0 -1
  189. package/dist/theme/presets/honey.js +0 -62
  190. package/dist/theme/presets/index.d.ts +0 -6
  191. package/dist/theme/presets/index.d.ts.map +0 -1
  192. package/dist/theme/presets/index.js +0 -39
  193. package/dist/theme/presets/midnight.d.ts +0 -8
  194. package/dist/theme/presets/midnight.d.ts.map +0 -1
  195. package/dist/theme/presets/midnight.js +0 -68
  196. package/dist/theme/presets/obsidian.d.ts +0 -3
  197. package/dist/theme/presets/obsidian.d.ts.map +0 -1
  198. package/dist/theme/presets/obsidian.js +0 -56
  199. package/dist/theme/presets/regal.d.ts +0 -8
  200. package/dist/theme/presets/regal.d.ts.map +0 -1
  201. package/dist/theme/presets/regal.js +0 -63
  202. package/dist/theme/presets/rose-gold.d.ts +0 -8
  203. package/dist/theme/presets/rose-gold.d.ts.map +0 -1
  204. package/dist/theme/presets/rose-gold.js +0 -63
  205. package/dist/theme/presets/slate.d.ts +0 -3
  206. package/dist/theme/presets/slate.d.ts.map +0 -1
  207. package/dist/theme/presets/slate.js +0 -56
  208. package/dist/theme/presets/tactical.d.ts +0 -8
  209. package/dist/theme/presets/tactical.d.ts.map +0 -1
  210. package/dist/theme/presets/tactical.js +0 -57
  211. package/dist/theme/presets/types.d.ts +0 -26
  212. package/dist/theme/presets/types.d.ts.map +0 -1
  213. package/dist/theme/presets/types.js +0 -1
@@ -1,34 +1,2234 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+
4
+ type Json = string | number | boolean | null | {
5
+ [key: string]: Json | undefined;
6
+ } | Json[];
7
+ type Database = {
8
+ __InternalSupabase: {
9
+ PostgrestVersion: "12.2.3 (519615d)";
10
+ };
11
+ public: {
12
+ Tables: {
13
+ acq_companies: {
14
+ Row: {
15
+ attio_company_id: string | null;
16
+ batch_id: string | null;
17
+ category: string | null;
18
+ category_pain: string | null;
19
+ created_at: string;
20
+ domain: string | null;
21
+ enrichment_data: Json | null;
22
+ filter_reason: string | null;
23
+ founded_year: number | null;
24
+ id: string;
25
+ linkedin_url: string | null;
26
+ location_city: string | null;
27
+ location_state: string | null;
28
+ name: string;
29
+ num_employees: number | null;
30
+ organization_id: string;
31
+ pipeline_status: Json;
32
+ segment: string | null;
33
+ source: string | null;
34
+ status: string;
35
+ updated_at: string;
36
+ website: string | null;
37
+ };
38
+ Insert: {
39
+ attio_company_id?: string | null;
40
+ batch_id?: string | null;
41
+ category?: string | null;
42
+ category_pain?: string | null;
43
+ created_at?: string;
44
+ domain?: string | null;
45
+ enrichment_data?: Json | null;
46
+ filter_reason?: string | null;
47
+ founded_year?: number | null;
48
+ id?: string;
49
+ linkedin_url?: string | null;
50
+ location_city?: string | null;
51
+ location_state?: string | null;
52
+ name: string;
53
+ num_employees?: number | null;
54
+ organization_id: string;
55
+ pipeline_status?: Json;
56
+ segment?: string | null;
57
+ source?: string | null;
58
+ status?: string;
59
+ updated_at?: string;
60
+ website?: string | null;
61
+ };
62
+ Update: {
63
+ attio_company_id?: string | null;
64
+ batch_id?: string | null;
65
+ category?: string | null;
66
+ category_pain?: string | null;
67
+ created_at?: string;
68
+ domain?: string | null;
69
+ enrichment_data?: Json | null;
70
+ filter_reason?: string | null;
71
+ founded_year?: number | null;
72
+ id?: string;
73
+ linkedin_url?: string | null;
74
+ location_city?: string | null;
75
+ location_state?: string | null;
76
+ name?: string;
77
+ num_employees?: number | null;
78
+ organization_id?: string;
79
+ pipeline_status?: Json;
80
+ segment?: string | null;
81
+ source?: string | null;
82
+ status?: string;
83
+ updated_at?: string;
84
+ website?: string | null;
85
+ };
86
+ Relationships: [
87
+ {
88
+ foreignKeyName: "acq_companies_organization_id_fkey";
89
+ columns: ["organization_id"];
90
+ isOneToOne: false;
91
+ referencedRelation: "organizations";
92
+ referencedColumns: ["id"];
93
+ }
94
+ ];
95
+ };
96
+ acq_contacts: {
97
+ Row: {
98
+ attio_person_id: string | null;
99
+ batch_id: string | null;
100
+ brochure_first_viewed_at: string | null;
101
+ brochure_view_count: number;
102
+ company_id: string | null;
103
+ created_at: string;
104
+ email: string;
105
+ email_valid: string | null;
106
+ enrichment_data: Json;
107
+ filter_reason: string | null;
108
+ first_name: string | null;
109
+ headline: string | null;
110
+ id: string;
111
+ last_name: string | null;
112
+ linkedin_url: string | null;
113
+ nurture: boolean;
114
+ opening_line: string | null;
115
+ organization_id: string;
116
+ pipeline_status: Json;
117
+ source: string | null;
118
+ source_id: string | null;
119
+ status: string;
120
+ title: string | null;
121
+ updated_at: string;
122
+ };
123
+ Insert: {
124
+ attio_person_id?: string | null;
125
+ batch_id?: string | null;
126
+ brochure_first_viewed_at?: string | null;
127
+ brochure_view_count?: number;
128
+ company_id?: string | null;
129
+ created_at?: string;
130
+ email: string;
131
+ email_valid?: string | null;
132
+ enrichment_data?: Json;
133
+ filter_reason?: string | null;
134
+ first_name?: string | null;
135
+ headline?: string | null;
136
+ id?: string;
137
+ last_name?: string | null;
138
+ linkedin_url?: string | null;
139
+ nurture?: boolean;
140
+ opening_line?: string | null;
141
+ organization_id: string;
142
+ pipeline_status?: Json;
143
+ source?: string | null;
144
+ source_id?: string | null;
145
+ status?: string;
146
+ title?: string | null;
147
+ updated_at?: string;
148
+ };
149
+ Update: {
150
+ attio_person_id?: string | null;
151
+ batch_id?: string | null;
152
+ brochure_first_viewed_at?: string | null;
153
+ brochure_view_count?: number;
154
+ company_id?: string | null;
155
+ created_at?: string;
156
+ email?: string;
157
+ email_valid?: string | null;
158
+ enrichment_data?: Json;
159
+ filter_reason?: string | null;
160
+ first_name?: string | null;
161
+ headline?: string | null;
162
+ id?: string;
163
+ last_name?: string | null;
164
+ linkedin_url?: string | null;
165
+ nurture?: boolean;
166
+ opening_line?: string | null;
167
+ organization_id?: string;
168
+ pipeline_status?: Json;
169
+ source?: string | null;
170
+ source_id?: string | null;
171
+ status?: string;
172
+ title?: string | null;
173
+ updated_at?: string;
174
+ };
175
+ Relationships: [
176
+ {
177
+ foreignKeyName: "acq_contacts_company_id_fkey";
178
+ columns: ["company_id"];
179
+ isOneToOne: false;
180
+ referencedRelation: "acq_companies";
181
+ referencedColumns: ["id"];
182
+ },
183
+ {
184
+ foreignKeyName: "acq_contacts_organization_id_fkey";
185
+ columns: ["organization_id"];
186
+ isOneToOne: false;
187
+ referencedRelation: "organizations";
188
+ referencedColumns: ["id"];
189
+ }
190
+ ];
191
+ };
192
+ acq_content: {
193
+ Row: {
194
+ body: string | null;
195
+ created_at: string;
196
+ id: string;
197
+ organization_id: string;
198
+ pillar: string;
199
+ status: string;
200
+ title: string;
201
+ updated_at: string;
202
+ };
203
+ Insert: {
204
+ body?: string | null;
205
+ created_at?: string;
206
+ id?: string;
207
+ organization_id: string;
208
+ pillar: string;
209
+ status?: string;
210
+ title: string;
211
+ updated_at?: string;
212
+ };
213
+ Update: {
214
+ body?: string | null;
215
+ created_at?: string;
216
+ id?: string;
217
+ organization_id?: string;
218
+ pillar?: string;
219
+ status?: string;
220
+ title?: string;
221
+ updated_at?: string;
222
+ };
223
+ Relationships: [
224
+ {
225
+ foreignKeyName: "acq_content_organization_id_fkey";
226
+ columns: ["organization_id"];
227
+ isOneToOne: false;
228
+ referencedRelation: "organizations";
229
+ referencedColumns: ["id"];
230
+ }
231
+ ];
232
+ };
233
+ acq_content_distributions: {
234
+ Row: {
235
+ adapted_body: string | null;
236
+ checklist: Json | null;
237
+ content_id: string;
238
+ created_at: string;
239
+ format: string;
240
+ id: string;
241
+ media_urls: Json;
242
+ metrics: Json;
243
+ metrics_updated_at: string | null;
244
+ organization_id: string;
245
+ platform: string;
246
+ platform_content: Json | null;
247
+ platform_post_id: string | null;
248
+ platform_url: string | null;
249
+ published_at: string | null;
250
+ status: string;
251
+ updated_at: string;
252
+ };
253
+ Insert: {
254
+ adapted_body?: string | null;
255
+ checklist?: Json | null;
256
+ content_id: string;
257
+ created_at?: string;
258
+ format: string;
259
+ id?: string;
260
+ media_urls?: Json;
261
+ metrics?: Json;
262
+ metrics_updated_at?: string | null;
263
+ organization_id: string;
264
+ platform: string;
265
+ platform_content?: Json | null;
266
+ platform_post_id?: string | null;
267
+ platform_url?: string | null;
268
+ published_at?: string | null;
269
+ status?: string;
270
+ updated_at?: string;
271
+ };
272
+ Update: {
273
+ adapted_body?: string | null;
274
+ checklist?: Json | null;
275
+ content_id?: string;
276
+ created_at?: string;
277
+ format?: string;
278
+ id?: string;
279
+ media_urls?: Json;
280
+ metrics?: Json;
281
+ metrics_updated_at?: string | null;
282
+ organization_id?: string;
283
+ platform?: string;
284
+ platform_content?: Json | null;
285
+ platform_post_id?: string | null;
286
+ platform_url?: string | null;
287
+ published_at?: string | null;
288
+ status?: string;
289
+ updated_at?: string;
290
+ };
291
+ Relationships: [
292
+ {
293
+ foreignKeyName: "acq_content_distributions_content_id_fkey";
294
+ columns: ["content_id"];
295
+ isOneToOne: false;
296
+ referencedRelation: "acq_content";
297
+ referencedColumns: ["id"];
298
+ },
299
+ {
300
+ foreignKeyName: "acq_content_distributions_organization_id_fkey";
301
+ columns: ["organization_id"];
302
+ isOneToOne: false;
303
+ referencedRelation: "organizations";
304
+ referencedColumns: ["id"];
305
+ }
306
+ ];
307
+ };
308
+ acq_deals: {
309
+ Row: {
310
+ activity_log: Json;
311
+ attio_deal_id: string;
312
+ cached_stage: string | null;
313
+ closed_lost_at: string | null;
314
+ closed_lost_reason: string | null;
315
+ contact_email: string;
316
+ contact_id: string | null;
317
+ created_at: string;
318
+ discovery_data: Json | null;
319
+ discovery_submitted_at: string | null;
320
+ discovery_submitted_by: string | null;
321
+ id: string;
322
+ initial_fee: number | null;
323
+ monthly_fee: number | null;
324
+ organization_id: string;
325
+ payment_link_sent_at: string | null;
326
+ payment_received_at: string | null;
327
+ proposal_data: Json | null;
328
+ proposal_generated_at: string | null;
329
+ proposal_pdf_url: string | null;
330
+ proposal_reviewed_at: string | null;
331
+ proposal_reviewed_by: string | null;
332
+ proposal_sent_at: string | null;
333
+ proposal_signed_at: string | null;
334
+ proposal_status: string | null;
335
+ signature_envelope_id: string | null;
336
+ source_list_id: string | null;
337
+ source_type: string | null;
338
+ stripe_payment_id: string | null;
339
+ stripe_payment_link: string | null;
340
+ stripe_payment_link_id: string | null;
341
+ stripe_subscription_id: string | null;
342
+ updated_at: string;
343
+ };
344
+ Insert: {
345
+ activity_log?: Json;
346
+ attio_deal_id: string;
347
+ cached_stage?: string | null;
348
+ closed_lost_at?: string | null;
349
+ closed_lost_reason?: string | null;
350
+ contact_email: string;
351
+ contact_id?: string | null;
352
+ created_at?: string;
353
+ discovery_data?: Json | null;
354
+ discovery_submitted_at?: string | null;
355
+ discovery_submitted_by?: string | null;
356
+ id?: string;
357
+ initial_fee?: number | null;
358
+ monthly_fee?: number | null;
359
+ organization_id: string;
360
+ payment_link_sent_at?: string | null;
361
+ payment_received_at?: string | null;
362
+ proposal_data?: Json | null;
363
+ proposal_generated_at?: string | null;
364
+ proposal_pdf_url?: string | null;
365
+ proposal_reviewed_at?: string | null;
366
+ proposal_reviewed_by?: string | null;
367
+ proposal_sent_at?: string | null;
368
+ proposal_signed_at?: string | null;
369
+ proposal_status?: string | null;
370
+ signature_envelope_id?: string | null;
371
+ source_list_id?: string | null;
372
+ source_type?: string | null;
373
+ stripe_payment_id?: string | null;
374
+ stripe_payment_link?: string | null;
375
+ stripe_payment_link_id?: string | null;
376
+ stripe_subscription_id?: string | null;
377
+ updated_at?: string;
378
+ };
379
+ Update: {
380
+ activity_log?: Json;
381
+ attio_deal_id?: string;
382
+ cached_stage?: string | null;
383
+ closed_lost_at?: string | null;
384
+ closed_lost_reason?: string | null;
385
+ contact_email?: string;
386
+ contact_id?: string | null;
387
+ created_at?: string;
388
+ discovery_data?: Json | null;
389
+ discovery_submitted_at?: string | null;
390
+ discovery_submitted_by?: string | null;
391
+ id?: string;
392
+ initial_fee?: number | null;
393
+ monthly_fee?: number | null;
394
+ organization_id?: string;
395
+ payment_link_sent_at?: string | null;
396
+ payment_received_at?: string | null;
397
+ proposal_data?: Json | null;
398
+ proposal_generated_at?: string | null;
399
+ proposal_pdf_url?: string | null;
400
+ proposal_reviewed_at?: string | null;
401
+ proposal_reviewed_by?: string | null;
402
+ proposal_sent_at?: string | null;
403
+ proposal_signed_at?: string | null;
404
+ proposal_status?: string | null;
405
+ signature_envelope_id?: string | null;
406
+ source_list_id?: string | null;
407
+ source_type?: string | null;
408
+ stripe_payment_id?: string | null;
409
+ stripe_payment_link?: string | null;
410
+ stripe_payment_link_id?: string | null;
411
+ stripe_subscription_id?: string | null;
412
+ updated_at?: string;
413
+ };
414
+ Relationships: [
415
+ {
416
+ foreignKeyName: "acq_deals_contact_id_fkey";
417
+ columns: ["contact_id"];
418
+ isOneToOne: false;
419
+ referencedRelation: "acq_contacts";
420
+ referencedColumns: ["id"];
421
+ },
422
+ {
423
+ foreignKeyName: "acq_deals_organization_id_fkey";
424
+ columns: ["organization_id"];
425
+ isOneToOne: false;
426
+ referencedRelation: "organizations";
427
+ referencedColumns: ["id"];
428
+ },
429
+ {
430
+ foreignKeyName: "acq_deals_source_list_id_fkey";
431
+ columns: ["source_list_id"];
432
+ isOneToOne: false;
433
+ referencedRelation: "acq_lists";
434
+ referencedColumns: ["id"];
435
+ }
436
+ ];
437
+ };
438
+ acq_list_members: {
439
+ Row: {
440
+ added_at: string;
441
+ added_by: string | null;
442
+ contact_id: string;
443
+ id: string;
444
+ list_id: string;
445
+ };
446
+ Insert: {
447
+ added_at?: string;
448
+ added_by?: string | null;
449
+ contact_id: string;
450
+ id?: string;
451
+ list_id: string;
452
+ };
453
+ Update: {
454
+ added_at?: string;
455
+ added_by?: string | null;
456
+ contact_id?: string;
457
+ id?: string;
458
+ list_id?: string;
459
+ };
460
+ Relationships: [
461
+ {
462
+ foreignKeyName: "acq_list_members_contact_id_fkey";
463
+ columns: ["contact_id"];
464
+ isOneToOne: false;
465
+ referencedRelation: "acq_contacts";
466
+ referencedColumns: ["id"];
467
+ },
468
+ {
469
+ foreignKeyName: "acq_list_members_list_id_fkey";
470
+ columns: ["list_id"];
471
+ isOneToOne: false;
472
+ referencedRelation: "acq_lists";
473
+ referencedColumns: ["id"];
474
+ }
475
+ ];
476
+ };
477
+ acq_lists: {
478
+ Row: {
479
+ batch_ids: string[];
480
+ completed_at: string | null;
481
+ created_at: string;
482
+ description: string | null;
483
+ id: string;
484
+ instantly_campaign_id: string | null;
485
+ launched_at: string | null;
486
+ metadata: Json;
487
+ name: string;
488
+ organization_id: string;
489
+ status: string;
490
+ type: string;
491
+ };
492
+ Insert: {
493
+ batch_ids?: string[];
494
+ completed_at?: string | null;
495
+ created_at?: string;
496
+ description?: string | null;
497
+ id?: string;
498
+ instantly_campaign_id?: string | null;
499
+ launched_at?: string | null;
500
+ metadata?: Json;
501
+ name: string;
502
+ organization_id: string;
503
+ status?: string;
504
+ type?: string;
505
+ };
506
+ Update: {
507
+ batch_ids?: string[];
508
+ completed_at?: string | null;
509
+ created_at?: string;
510
+ description?: string | null;
511
+ id?: string;
512
+ instantly_campaign_id?: string | null;
513
+ launched_at?: string | null;
514
+ metadata?: Json;
515
+ name?: string;
516
+ organization_id?: string;
517
+ status?: string;
518
+ type?: string;
519
+ };
520
+ Relationships: [
521
+ {
522
+ foreignKeyName: "acq_lists_organization_id_fkey";
523
+ columns: ["organization_id"];
524
+ isOneToOne: false;
525
+ referencedRelation: "organizations";
526
+ referencedColumns: ["id"];
527
+ }
528
+ ];
529
+ };
530
+ acq_seo_metrics: {
531
+ Row: {
532
+ ai_citations: Json | null;
533
+ avg_position: number | null;
534
+ clicks: number | null;
535
+ created_at: string;
536
+ cta_clicks: number | null;
537
+ ctr: number | null;
538
+ data_point_count: number | null;
539
+ faq_count: number | null;
540
+ form_submissions: number | null;
541
+ id: string;
542
+ impressions: number | null;
543
+ organization_id: string;
544
+ period: string;
545
+ quality_score: number | null;
546
+ readability: number | null;
547
+ scroll_100: number | null;
548
+ scroll_25: number | null;
549
+ scroll_50: number | null;
550
+ scroll_75: number | null;
551
+ seo_page_id: string;
552
+ word_count: number | null;
553
+ };
554
+ Insert: {
555
+ ai_citations?: Json | null;
556
+ avg_position?: number | null;
557
+ clicks?: number | null;
558
+ created_at?: string;
559
+ cta_clicks?: number | null;
560
+ ctr?: number | null;
561
+ data_point_count?: number | null;
562
+ faq_count?: number | null;
563
+ form_submissions?: number | null;
564
+ id?: string;
565
+ impressions?: number | null;
566
+ organization_id: string;
567
+ period: string;
568
+ quality_score?: number | null;
569
+ readability?: number | null;
570
+ scroll_100?: number | null;
571
+ scroll_25?: number | null;
572
+ scroll_50?: number | null;
573
+ scroll_75?: number | null;
574
+ seo_page_id: string;
575
+ word_count?: number | null;
576
+ };
577
+ Update: {
578
+ ai_citations?: Json | null;
579
+ avg_position?: number | null;
580
+ clicks?: number | null;
581
+ created_at?: string;
582
+ cta_clicks?: number | null;
583
+ ctr?: number | null;
584
+ data_point_count?: number | null;
585
+ faq_count?: number | null;
586
+ form_submissions?: number | null;
587
+ id?: string;
588
+ impressions?: number | null;
589
+ organization_id?: string;
590
+ period?: string;
591
+ quality_score?: number | null;
592
+ readability?: number | null;
593
+ scroll_100?: number | null;
594
+ scroll_25?: number | null;
595
+ scroll_50?: number | null;
596
+ scroll_75?: number | null;
597
+ seo_page_id?: string;
598
+ word_count?: number | null;
599
+ };
600
+ Relationships: [
601
+ {
602
+ foreignKeyName: "acq_seo_metrics_organization_id_fkey";
603
+ columns: ["organization_id"];
604
+ isOneToOne: false;
605
+ referencedRelation: "organizations";
606
+ referencedColumns: ["id"];
607
+ },
608
+ {
609
+ foreignKeyName: "acq_seo_metrics_seo_page_id_fkey";
610
+ columns: ["seo_page_id"];
611
+ isOneToOne: false;
612
+ referencedRelation: "acq_seo_pages";
613
+ referencedColumns: ["id"];
614
+ }
615
+ ];
616
+ };
617
+ acq_seo_pages: {
618
+ Row: {
619
+ city: string | null;
620
+ content: Json | null;
621
+ created_at: string;
622
+ faq_items: Json | null;
623
+ hero_image_url: string | null;
624
+ id: string;
625
+ internal_links: Json | null;
626
+ local_data: Json | null;
627
+ meta_description: string | null;
628
+ organization_id: string;
629
+ page_type: string;
630
+ published_at: string | null;
631
+ refreshed_at: string | null;
632
+ schema_markup: Json | null;
633
+ slug: string;
634
+ state: string | null;
635
+ status: string;
636
+ title: string;
637
+ updated_at: string;
638
+ use_case: string | null;
639
+ vertical: string;
640
+ };
641
+ Insert: {
642
+ city?: string | null;
643
+ content?: Json | null;
644
+ created_at?: string;
645
+ faq_items?: Json | null;
646
+ hero_image_url?: string | null;
647
+ id?: string;
648
+ internal_links?: Json | null;
649
+ local_data?: Json | null;
650
+ meta_description?: string | null;
651
+ organization_id: string;
652
+ page_type: string;
653
+ published_at?: string | null;
654
+ refreshed_at?: string | null;
655
+ schema_markup?: Json | null;
656
+ slug: string;
657
+ state?: string | null;
658
+ status?: string;
659
+ title: string;
660
+ updated_at?: string;
661
+ use_case?: string | null;
662
+ vertical: string;
663
+ };
664
+ Update: {
665
+ city?: string | null;
666
+ content?: Json | null;
667
+ created_at?: string;
668
+ faq_items?: Json | null;
669
+ hero_image_url?: string | null;
670
+ id?: string;
671
+ internal_links?: Json | null;
672
+ local_data?: Json | null;
673
+ meta_description?: string | null;
674
+ organization_id?: string;
675
+ page_type?: string;
676
+ published_at?: string | null;
677
+ refreshed_at?: string | null;
678
+ schema_markup?: Json | null;
679
+ slug?: string;
680
+ state?: string | null;
681
+ status?: string;
682
+ title?: string;
683
+ updated_at?: string;
684
+ use_case?: string | null;
685
+ vertical?: string;
686
+ };
687
+ Relationships: [
688
+ {
689
+ foreignKeyName: "acq_seo_pages_organization_id_fkey";
690
+ columns: ["organization_id"];
691
+ isOneToOne: false;
692
+ referencedRelation: "organizations";
693
+ referencedColumns: ["id"];
694
+ }
695
+ ];
696
+ };
697
+ acq_social_posts: {
698
+ Row: {
699
+ author_name: string;
700
+ author_url: string | null;
701
+ comments_count: number;
702
+ created_at: string;
703
+ discovered_at: string;
704
+ engagement_count: number;
705
+ feedback: string | null;
706
+ final_response: string | null;
707
+ fully_reviewed: boolean;
708
+ id: string;
709
+ initial_draft: string | null;
710
+ matched_keywords: string[];
711
+ matched_query: string | null;
712
+ metadata: Json;
713
+ organization_id: string;
714
+ platform: string;
715
+ platform_post_id: string;
716
+ post_text: string;
717
+ post_title: string;
718
+ post_url: string;
719
+ posted_at: string;
720
+ relevance_score: number;
721
+ responded_at: string | null;
722
+ reviewed_at: string | null;
723
+ skip_reason: string | null;
724
+ source_category: string | null;
725
+ status: string;
726
+ updated_at: string;
727
+ };
728
+ Insert: {
729
+ author_name: string;
730
+ author_url?: string | null;
731
+ comments_count?: number;
732
+ created_at?: string;
733
+ discovered_at?: string;
734
+ engagement_count?: number;
735
+ feedback?: string | null;
736
+ final_response?: string | null;
737
+ fully_reviewed?: boolean;
738
+ id?: string;
739
+ initial_draft?: string | null;
740
+ matched_keywords?: string[];
741
+ matched_query?: string | null;
742
+ metadata?: Json;
743
+ organization_id: string;
744
+ platform: string;
745
+ platform_post_id: string;
746
+ post_text: string;
747
+ post_title: string;
748
+ post_url: string;
749
+ posted_at: string;
750
+ relevance_score?: number;
751
+ responded_at?: string | null;
752
+ reviewed_at?: string | null;
753
+ skip_reason?: string | null;
754
+ source_category?: string | null;
755
+ status?: string;
756
+ updated_at?: string;
757
+ };
758
+ Update: {
759
+ author_name?: string;
760
+ author_url?: string | null;
761
+ comments_count?: number;
762
+ created_at?: string;
763
+ discovered_at?: string;
764
+ engagement_count?: number;
765
+ feedback?: string | null;
766
+ final_response?: string | null;
767
+ fully_reviewed?: boolean;
768
+ id?: string;
769
+ initial_draft?: string | null;
770
+ matched_keywords?: string[];
771
+ matched_query?: string | null;
772
+ metadata?: Json;
773
+ organization_id?: string;
774
+ platform?: string;
775
+ platform_post_id?: string;
776
+ post_text?: string;
777
+ post_title?: string;
778
+ post_url?: string;
779
+ posted_at?: string;
780
+ relevance_score?: number;
781
+ responded_at?: string | null;
782
+ reviewed_at?: string | null;
783
+ skip_reason?: string | null;
784
+ source_category?: string | null;
785
+ status?: string;
786
+ updated_at?: string;
787
+ };
788
+ Relationships: [
789
+ {
790
+ foreignKeyName: "acq_social_posts_organization_id_fkey";
791
+ columns: ["organization_id"];
792
+ isOneToOne: false;
793
+ referencedRelation: "organizations";
794
+ referencedColumns: ["id"];
795
+ }
796
+ ];
797
+ };
798
+ activities: {
799
+ Row: {
800
+ activity_type: string;
801
+ actor_id: string | null;
802
+ actor_type: string | null;
803
+ created_at: string;
804
+ description: string | null;
805
+ entity_id: string;
806
+ entity_name: string | null;
807
+ entity_type: string;
808
+ id: string;
809
+ metadata: Json | null;
810
+ occurred_at: string;
811
+ organization_id: string;
812
+ status: string;
813
+ title: string;
814
+ };
815
+ Insert: {
816
+ activity_type: string;
817
+ actor_id?: string | null;
818
+ actor_type?: string | null;
819
+ created_at?: string;
820
+ description?: string | null;
821
+ entity_id: string;
822
+ entity_name?: string | null;
823
+ entity_type: string;
824
+ id?: string;
825
+ metadata?: Json | null;
826
+ occurred_at?: string;
827
+ organization_id: string;
828
+ status: string;
829
+ title: string;
830
+ };
831
+ Update: {
832
+ activity_type?: string;
833
+ actor_id?: string | null;
834
+ actor_type?: string | null;
835
+ created_at?: string;
836
+ description?: string | null;
837
+ entity_id?: string;
838
+ entity_name?: string | null;
839
+ entity_type?: string;
840
+ id?: string;
841
+ metadata?: Json | null;
842
+ occurred_at?: string;
843
+ organization_id?: string;
844
+ status?: string;
845
+ title?: string;
846
+ };
847
+ Relationships: [
848
+ {
849
+ foreignKeyName: "activities_organization_id_fkey";
850
+ columns: ["organization_id"];
851
+ isOneToOne: false;
852
+ referencedRelation: "organizations";
853
+ referencedColumns: ["id"];
854
+ }
855
+ ];
856
+ };
857
+ api_keys: {
858
+ Row: {
859
+ created_at: string | null;
860
+ id: string;
861
+ key_hash: string;
862
+ last_used_at: string | null;
863
+ name: string;
864
+ organization_id: string;
865
+ };
866
+ Insert: {
867
+ created_at?: string | null;
868
+ id?: string;
869
+ key_hash: string;
870
+ last_used_at?: string | null;
871
+ name: string;
872
+ organization_id: string;
873
+ };
874
+ Update: {
875
+ created_at?: string | null;
876
+ id?: string;
877
+ key_hash?: string;
878
+ last_used_at?: string | null;
879
+ name?: string;
880
+ organization_id?: string;
881
+ };
882
+ Relationships: [
883
+ {
884
+ foreignKeyName: "api_keys_organization_id_fkey";
885
+ columns: ["organization_id"];
886
+ isOneToOne: false;
887
+ referencedRelation: "organizations";
888
+ referencedColumns: ["id"];
889
+ }
890
+ ];
891
+ };
892
+ calibration_projects: {
893
+ Row: {
894
+ created_at: string | null;
895
+ description: string | null;
896
+ id: string;
897
+ name: string;
898
+ organization_id: string;
899
+ resource_id: string;
900
+ resource_type: string;
901
+ updated_at: string | null;
902
+ };
903
+ Insert: {
904
+ created_at?: string | null;
905
+ description?: string | null;
906
+ id?: string;
907
+ name: string;
908
+ organization_id: string;
909
+ resource_id: string;
910
+ resource_type: string;
911
+ updated_at?: string | null;
912
+ };
913
+ Update: {
914
+ created_at?: string | null;
915
+ description?: string | null;
916
+ id?: string;
917
+ name?: string;
918
+ organization_id?: string;
919
+ resource_id?: string;
920
+ resource_type?: string;
921
+ updated_at?: string | null;
922
+ };
923
+ Relationships: [
924
+ {
925
+ foreignKeyName: "calibration_projects_organization_id_fkey";
926
+ columns: ["organization_id"];
927
+ isOneToOne: false;
928
+ referencedRelation: "organizations";
929
+ referencedColumns: ["id"];
930
+ }
931
+ ];
932
+ };
933
+ calibration_runs: {
934
+ Row: {
935
+ completed_at: string | null;
936
+ config_variants: Json;
937
+ created_at: string | null;
938
+ description: string | null;
939
+ execution_mode: string;
940
+ grader_model: string | null;
941
+ grading_rubric: Json | null;
942
+ id: string;
943
+ name: string;
944
+ organization_id: string;
945
+ project_id: string;
946
+ results: Json;
947
+ status: string;
948
+ test_inputs: Json;
949
+ };
950
+ Insert: {
951
+ completed_at?: string | null;
952
+ config_variants: Json;
953
+ created_at?: string | null;
954
+ description?: string | null;
955
+ execution_mode?: string;
956
+ grader_model?: string | null;
957
+ grading_rubric?: Json | null;
958
+ id?: string;
959
+ name: string;
960
+ organization_id: string;
961
+ project_id: string;
962
+ results?: Json;
963
+ status?: string;
964
+ test_inputs: Json;
965
+ };
966
+ Update: {
967
+ completed_at?: string | null;
968
+ config_variants?: Json;
969
+ created_at?: string | null;
970
+ description?: string | null;
971
+ execution_mode?: string;
972
+ grader_model?: string | null;
973
+ grading_rubric?: Json | null;
974
+ id?: string;
975
+ name?: string;
976
+ organization_id?: string;
977
+ project_id?: string;
978
+ results?: Json;
979
+ status?: string;
980
+ test_inputs?: Json;
981
+ };
982
+ Relationships: [
983
+ {
984
+ foreignKeyName: "calibration_runs_organization_id_fkey";
985
+ columns: ["organization_id"];
986
+ isOneToOne: false;
987
+ referencedRelation: "organizations";
988
+ referencedColumns: ["id"];
989
+ },
990
+ {
991
+ foreignKeyName: "calibration_runs_project_id_fkey";
992
+ columns: ["project_id"];
993
+ isOneToOne: false;
994
+ referencedRelation: "calibration_projects";
995
+ referencedColumns: ["id"];
996
+ }
997
+ ];
998
+ };
999
+ command_queue: {
1000
+ Row: {
1001
+ action_payload: Json | null;
1002
+ actions: Json;
1003
+ completed_at: string | null;
1004
+ completed_by: string | null;
1005
+ context: Json;
1006
+ created_at: string;
1007
+ description: string | null;
1008
+ expires_at: string | null;
1009
+ human_checkpoint: string | null;
1010
+ id: string;
1011
+ idempotency_key: string | null;
1012
+ metadata: Json | null;
1013
+ organization_id: string;
1014
+ origin_execution_id: string;
1015
+ origin_resource_id: string;
1016
+ origin_resource_type: string;
1017
+ priority: number;
1018
+ selected_action: string | null;
1019
+ status: string;
1020
+ target_execution_id: string | null;
1021
+ target_resource_id: string | null;
1022
+ target_resource_type: string | null;
1023
+ };
1024
+ Insert: {
1025
+ action_payload?: Json | null;
1026
+ actions: Json;
1027
+ completed_at?: string | null;
1028
+ completed_by?: string | null;
1029
+ context: Json;
1030
+ created_at?: string;
1031
+ description?: string | null;
1032
+ expires_at?: string | null;
1033
+ human_checkpoint?: string | null;
1034
+ id?: string;
1035
+ idempotency_key?: string | null;
1036
+ metadata?: Json | null;
1037
+ organization_id: string;
1038
+ origin_execution_id: string;
1039
+ origin_resource_id: string;
1040
+ origin_resource_type: string;
1041
+ priority?: number;
1042
+ selected_action?: string | null;
1043
+ status?: string;
1044
+ target_execution_id?: string | null;
1045
+ target_resource_id?: string | null;
1046
+ target_resource_type?: string | null;
1047
+ };
1048
+ Update: {
1049
+ action_payload?: Json | null;
1050
+ actions?: Json;
1051
+ completed_at?: string | null;
1052
+ completed_by?: string | null;
1053
+ context?: Json;
1054
+ created_at?: string;
1055
+ description?: string | null;
1056
+ expires_at?: string | null;
1057
+ human_checkpoint?: string | null;
1058
+ id?: string;
1059
+ idempotency_key?: string | null;
1060
+ metadata?: Json | null;
1061
+ organization_id?: string;
1062
+ origin_execution_id?: string;
1063
+ origin_resource_id?: string;
1064
+ origin_resource_type?: string;
1065
+ priority?: number;
1066
+ selected_action?: string | null;
1067
+ status?: string;
1068
+ target_execution_id?: string | null;
1069
+ target_resource_id?: string | null;
1070
+ target_resource_type?: string | null;
1071
+ };
1072
+ Relationships: [
1073
+ {
1074
+ foreignKeyName: "command_queue_completed_by_fkey";
1075
+ columns: ["completed_by"];
1076
+ isOneToOne: false;
1077
+ referencedRelation: "users";
1078
+ referencedColumns: ["id"];
1079
+ },
1080
+ {
1081
+ foreignKeyName: "command_queue_organization_id_fkey";
1082
+ columns: ["organization_id"];
1083
+ isOneToOne: false;
1084
+ referencedRelation: "organizations";
1085
+ referencedColumns: ["id"];
1086
+ },
1087
+ {
1088
+ foreignKeyName: "command_queue_target_execution_id_fkey";
1089
+ columns: ["target_execution_id"];
1090
+ isOneToOne: false;
1091
+ referencedRelation: "execution_logs";
1092
+ referencedColumns: ["execution_id"];
1093
+ }
1094
+ ];
1095
+ };
1096
+ credentials: {
1097
+ Row: {
1098
+ created_at: string;
1099
+ created_by: string | null;
1100
+ encrypted_value: string;
1101
+ id: string;
1102
+ name: string;
1103
+ organization_id: string;
1104
+ provider: string | null;
1105
+ type: string;
1106
+ updated_at: string;
1107
+ };
1108
+ Insert: {
1109
+ created_at?: string;
1110
+ created_by?: string | null;
1111
+ encrypted_value: string;
1112
+ id?: string;
1113
+ name: string;
1114
+ organization_id: string;
1115
+ provider?: string | null;
1116
+ type?: string;
1117
+ updated_at?: string;
1118
+ };
1119
+ Update: {
1120
+ created_at?: string;
1121
+ created_by?: string | null;
1122
+ encrypted_value?: string;
1123
+ id?: string;
1124
+ name?: string;
1125
+ organization_id?: string;
1126
+ provider?: string | null;
1127
+ type?: string;
1128
+ updated_at?: string;
1129
+ };
1130
+ Relationships: [
1131
+ {
1132
+ foreignKeyName: "credentials_created_by_fkey";
1133
+ columns: ["created_by"];
1134
+ isOneToOne: false;
1135
+ referencedRelation: "users";
1136
+ referencedColumns: ["id"];
1137
+ },
1138
+ {
1139
+ foreignKeyName: "credentials_organization_id_fkey";
1140
+ columns: ["organization_id"];
1141
+ isOneToOne: false;
1142
+ referencedRelation: "organizations";
1143
+ referencedColumns: ["id"];
1144
+ }
1145
+ ];
1146
+ };
1147
+ deployments: {
1148
+ Row: {
1149
+ compiled_docs: Json | null;
1150
+ created_at: string;
1151
+ deployment_version: string | null;
1152
+ documentation: Json | null;
1153
+ error_message: string | null;
1154
+ id: string;
1155
+ organization_id: string;
1156
+ pid: number | null;
1157
+ port: number | null;
1158
+ sdk_version: string;
1159
+ status: string;
1160
+ tarball_path: string | null;
1161
+ updated_at: string;
1162
+ };
1163
+ Insert: {
1164
+ compiled_docs?: Json | null;
1165
+ created_at?: string;
1166
+ deployment_version?: string | null;
1167
+ documentation?: Json | null;
1168
+ error_message?: string | null;
1169
+ id?: string;
1170
+ organization_id: string;
1171
+ pid?: number | null;
1172
+ port?: number | null;
1173
+ sdk_version: string;
1174
+ status?: string;
1175
+ tarball_path?: string | null;
1176
+ updated_at?: string;
1177
+ };
1178
+ Update: {
1179
+ compiled_docs?: Json | null;
1180
+ created_at?: string;
1181
+ deployment_version?: string | null;
1182
+ documentation?: Json | null;
1183
+ error_message?: string | null;
1184
+ id?: string;
1185
+ organization_id?: string;
1186
+ pid?: number | null;
1187
+ port?: number | null;
1188
+ sdk_version?: string;
1189
+ status?: string;
1190
+ tarball_path?: string | null;
1191
+ updated_at?: string;
1192
+ };
1193
+ Relationships: [
1194
+ {
1195
+ foreignKeyName: "deployments_organization_id_fkey";
1196
+ columns: ["organization_id"];
1197
+ isOneToOne: false;
1198
+ referencedRelation: "organizations";
1199
+ referencedColumns: ["id"];
1200
+ }
1201
+ ];
1202
+ };
1203
+ execution_errors: {
1204
+ Row: {
1205
+ created_at: string | null;
1206
+ error_category: string;
1207
+ error_message: string;
1208
+ error_severity: string;
1209
+ error_stack_trace: string | null;
1210
+ error_type: string;
1211
+ execution_id: string;
1212
+ id: string;
1213
+ metadata: Json | null;
1214
+ occurred_at: string;
1215
+ organization_id: string;
1216
+ resolved: boolean;
1217
+ resolved_at: string | null;
1218
+ resolved_by: string | null;
1219
+ };
1220
+ Insert: {
1221
+ created_at?: string | null;
1222
+ error_category: string;
1223
+ error_message: string;
1224
+ error_severity: string;
1225
+ error_stack_trace?: string | null;
1226
+ error_type: string;
1227
+ execution_id: string;
1228
+ id?: string;
1229
+ metadata?: Json | null;
1230
+ occurred_at?: string;
1231
+ organization_id: string;
1232
+ resolved?: boolean;
1233
+ resolved_at?: string | null;
1234
+ resolved_by?: string | null;
1235
+ };
1236
+ Update: {
1237
+ created_at?: string | null;
1238
+ error_category?: string;
1239
+ error_message?: string;
1240
+ error_severity?: string;
1241
+ error_stack_trace?: string | null;
1242
+ error_type?: string;
1243
+ execution_id?: string;
1244
+ id?: string;
1245
+ metadata?: Json | null;
1246
+ occurred_at?: string;
1247
+ organization_id?: string;
1248
+ resolved?: boolean;
1249
+ resolved_at?: string | null;
1250
+ resolved_by?: string | null;
1251
+ };
1252
+ Relationships: [
1253
+ {
1254
+ foreignKeyName: "execution_errors_execution_id_fkey";
1255
+ columns: ["execution_id"];
1256
+ isOneToOne: false;
1257
+ referencedRelation: "execution_logs";
1258
+ referencedColumns: ["execution_id"];
1259
+ },
1260
+ {
1261
+ foreignKeyName: "execution_errors_organization_id_fkey";
1262
+ columns: ["organization_id"];
1263
+ isOneToOne: false;
1264
+ referencedRelation: "organizations";
1265
+ referencedColumns: ["id"];
1266
+ },
1267
+ {
1268
+ foreignKeyName: "execution_errors_resolved_by_fkey";
1269
+ columns: ["resolved_by"];
1270
+ isOneToOne: false;
1271
+ referencedRelation: "users";
1272
+ referencedColumns: ["id"];
1273
+ }
1274
+ ];
1275
+ };
1276
+ execution_logs: {
1277
+ Row: {
1278
+ api_version: string | null;
1279
+ completed_at: string | null;
1280
+ created_at: string | null;
1281
+ error: string | null;
1282
+ execution_id: string;
1283
+ input: Json | null;
1284
+ last_heartbeat_at: string | null;
1285
+ logs: Json | null;
1286
+ organization_id: string;
1287
+ origin_execution_id: string | null;
1288
+ output: Json | null;
1289
+ resource_id: string;
1290
+ resource_status: string;
1291
+ resource_type: string;
1292
+ resource_version: string | null;
1293
+ sdk_version: string | null;
1294
+ session_id: string | null;
1295
+ session_turn_number: number | null;
1296
+ started_at: string;
1297
+ status: string;
1298
+ trigger_type: string | null;
1299
+ updated_at: string | null;
1300
+ user_id: string | null;
1301
+ };
1302
+ Insert: {
1303
+ api_version?: string | null;
1304
+ completed_at?: string | null;
1305
+ created_at?: string | null;
1306
+ error?: string | null;
1307
+ execution_id?: string;
1308
+ input?: Json | null;
1309
+ last_heartbeat_at?: string | null;
1310
+ logs?: Json | null;
1311
+ organization_id: string;
1312
+ origin_execution_id?: string | null;
1313
+ output?: Json | null;
1314
+ resource_id: string;
1315
+ resource_status?: string;
1316
+ resource_type?: string;
1317
+ resource_version?: string | null;
1318
+ sdk_version?: string | null;
1319
+ session_id?: string | null;
1320
+ session_turn_number?: number | null;
1321
+ started_at?: string;
1322
+ status: string;
1323
+ trigger_type?: string | null;
1324
+ updated_at?: string | null;
1325
+ user_id?: string | null;
1326
+ };
1327
+ Update: {
1328
+ api_version?: string | null;
1329
+ completed_at?: string | null;
1330
+ created_at?: string | null;
1331
+ error?: string | null;
1332
+ execution_id?: string;
1333
+ input?: Json | null;
1334
+ last_heartbeat_at?: string | null;
1335
+ logs?: Json | null;
1336
+ organization_id?: string;
1337
+ origin_execution_id?: string | null;
1338
+ output?: Json | null;
1339
+ resource_id?: string;
1340
+ resource_status?: string;
1341
+ resource_type?: string;
1342
+ resource_version?: string | null;
1343
+ sdk_version?: string | null;
1344
+ session_id?: string | null;
1345
+ session_turn_number?: number | null;
1346
+ started_at?: string;
1347
+ status?: string;
1348
+ trigger_type?: string | null;
1349
+ updated_at?: string | null;
1350
+ user_id?: string | null;
1351
+ };
1352
+ Relationships: [
1353
+ {
1354
+ foreignKeyName: "execution_history_organization_id_fkey";
1355
+ columns: ["organization_id"];
1356
+ isOneToOne: false;
1357
+ referencedRelation: "organizations";
1358
+ referencedColumns: ["id"];
1359
+ },
1360
+ {
1361
+ foreignKeyName: "execution_logs_origin_execution_id_fkey";
1362
+ columns: ["origin_execution_id"];
1363
+ isOneToOne: false;
1364
+ referencedRelation: "execution_logs";
1365
+ referencedColumns: ["execution_id"];
1366
+ },
1367
+ {
1368
+ foreignKeyName: "execution_logs_session_id_fkey";
1369
+ columns: ["session_id"];
1370
+ isOneToOne: false;
1371
+ referencedRelation: "sessions";
1372
+ referencedColumns: ["session_id"];
1373
+ },
1374
+ {
1375
+ foreignKeyName: "execution_logs_user_id_fkey";
1376
+ columns: ["user_id"];
1377
+ isOneToOne: false;
1378
+ referencedRelation: "users";
1379
+ referencedColumns: ["id"];
1380
+ }
1381
+ ];
1382
+ };
1383
+ execution_metrics: {
1384
+ Row: {
1385
+ ai_call_count: number;
1386
+ ai_calls: Json | null;
1387
+ automation_savings_usd: number | null;
1388
+ created_at: string | null;
1389
+ duration_ms: number | null;
1390
+ execution_id: string;
1391
+ organization_id: string;
1392
+ resource_id: string;
1393
+ total_cost_usd: number;
1394
+ total_input_tokens: number;
1395
+ total_output_tokens: number;
1396
+ };
1397
+ Insert: {
1398
+ ai_call_count: number;
1399
+ ai_calls?: Json | null;
1400
+ automation_savings_usd?: number | null;
1401
+ created_at?: string | null;
1402
+ duration_ms?: number | null;
1403
+ execution_id: string;
1404
+ organization_id: string;
1405
+ resource_id: string;
1406
+ total_cost_usd: number;
1407
+ total_input_tokens: number;
1408
+ total_output_tokens: number;
1409
+ };
1410
+ Update: {
1411
+ ai_call_count?: number;
1412
+ ai_calls?: Json | null;
1413
+ automation_savings_usd?: number | null;
1414
+ created_at?: string | null;
1415
+ duration_ms?: number | null;
1416
+ execution_id?: string;
1417
+ organization_id?: string;
1418
+ resource_id?: string;
1419
+ total_cost_usd?: number;
1420
+ total_input_tokens?: number;
1421
+ total_output_tokens?: number;
1422
+ };
1423
+ Relationships: [
1424
+ {
1425
+ foreignKeyName: "execution_metrics_execution_id_fkey";
1426
+ columns: ["execution_id"];
1427
+ isOneToOne: true;
1428
+ referencedRelation: "execution_logs";
1429
+ referencedColumns: ["execution_id"];
1430
+ },
1431
+ {
1432
+ foreignKeyName: "execution_metrics_organization_id_fkey";
1433
+ columns: ["organization_id"];
1434
+ isOneToOne: false;
1435
+ referencedRelation: "organizations";
1436
+ referencedColumns: ["id"];
1437
+ }
1438
+ ];
1439
+ };
1440
+ notifications: {
1441
+ Row: {
1442
+ action_url: string | null;
1443
+ category: string;
1444
+ created_at: string | null;
1445
+ id: string;
1446
+ message: string;
1447
+ organization_id: string;
1448
+ read: boolean | null;
1449
+ read_at: string | null;
1450
+ title: string;
1451
+ user_id: string;
1452
+ };
1453
+ Insert: {
1454
+ action_url?: string | null;
1455
+ category: string;
1456
+ created_at?: string | null;
1457
+ id?: string;
1458
+ message: string;
1459
+ organization_id: string;
1460
+ read?: boolean | null;
1461
+ read_at?: string | null;
1462
+ title: string;
1463
+ user_id: string;
1464
+ };
1465
+ Update: {
1466
+ action_url?: string | null;
1467
+ category?: string;
1468
+ created_at?: string | null;
1469
+ id?: string;
1470
+ message?: string;
1471
+ organization_id?: string;
1472
+ read?: boolean | null;
1473
+ read_at?: string | null;
1474
+ title?: string;
1475
+ user_id?: string;
1476
+ };
1477
+ Relationships: [
1478
+ {
1479
+ foreignKeyName: "notifications_organization_id_fkey";
1480
+ columns: ["organization_id"];
1481
+ isOneToOne: false;
1482
+ referencedRelation: "organizations";
1483
+ referencedColumns: ["id"];
1484
+ },
1485
+ {
1486
+ foreignKeyName: "notifications_user_id_fkey";
1487
+ columns: ["user_id"];
1488
+ isOneToOne: false;
1489
+ referencedRelation: "users";
1490
+ referencedColumns: ["id"];
1491
+ }
1492
+ ];
1493
+ };
1494
+ org_invitations: {
1495
+ Row: {
1496
+ accept_invitation_url: string | null;
1497
+ accepted_at: string | null;
1498
+ created_at: string | null;
1499
+ email: string;
1500
+ expires_at: string;
1501
+ id: string;
1502
+ invitation_state: string | null;
1503
+ invitation_token: string | null;
1504
+ inviter_user_id: string | null;
1505
+ organization_id: string | null;
1506
+ revoked_at: string | null;
1507
+ role_slug: string | null;
1508
+ updated_at: string | null;
1509
+ workos_invitation_id: string;
1510
+ };
1511
+ Insert: {
1512
+ accept_invitation_url?: string | null;
1513
+ accepted_at?: string | null;
1514
+ created_at?: string | null;
1515
+ email: string;
1516
+ expires_at: string;
1517
+ id?: string;
1518
+ invitation_state?: string | null;
1519
+ invitation_token?: string | null;
1520
+ inviter_user_id?: string | null;
1521
+ organization_id?: string | null;
1522
+ revoked_at?: string | null;
1523
+ role_slug?: string | null;
1524
+ updated_at?: string | null;
1525
+ workos_invitation_id: string;
1526
+ };
1527
+ Update: {
1528
+ accept_invitation_url?: string | null;
1529
+ accepted_at?: string | null;
1530
+ created_at?: string | null;
1531
+ email?: string;
1532
+ expires_at?: string;
1533
+ id?: string;
1534
+ invitation_state?: string | null;
1535
+ invitation_token?: string | null;
1536
+ inviter_user_id?: string | null;
1537
+ organization_id?: string | null;
1538
+ revoked_at?: string | null;
1539
+ role_slug?: string | null;
1540
+ updated_at?: string | null;
1541
+ workos_invitation_id?: string;
1542
+ };
1543
+ Relationships: [
1544
+ {
1545
+ foreignKeyName: "org_invitations_inviter_user_id_fkey";
1546
+ columns: ["inviter_user_id"];
1547
+ isOneToOne: false;
1548
+ referencedRelation: "users";
1549
+ referencedColumns: ["id"];
1550
+ },
1551
+ {
1552
+ foreignKeyName: "org_invitations_organization_id_fkey";
1553
+ columns: ["organization_id"];
1554
+ isOneToOne: false;
1555
+ referencedRelation: "organizations";
1556
+ referencedColumns: ["id"];
1557
+ }
1558
+ ];
1559
+ };
1560
+ org_memberships: {
1561
+ Row: {
1562
+ config: Json;
1563
+ created_at: string | null;
1564
+ id: string;
1565
+ membership_status: string | null;
1566
+ organization_id: string;
1567
+ role_slug: string | null;
1568
+ updated_at: string | null;
1569
+ user_id: string;
1570
+ workos_membership_id: string | null;
1571
+ };
1572
+ Insert: {
1573
+ config?: Json;
1574
+ created_at?: string | null;
1575
+ id?: string;
1576
+ membership_status?: string | null;
1577
+ organization_id: string;
1578
+ role_slug?: string | null;
1579
+ updated_at?: string | null;
1580
+ user_id: string;
1581
+ workos_membership_id?: string | null;
1582
+ };
1583
+ Update: {
1584
+ config?: Json;
1585
+ created_at?: string | null;
1586
+ id?: string;
1587
+ membership_status?: string | null;
1588
+ organization_id?: string;
1589
+ role_slug?: string | null;
1590
+ updated_at?: string | null;
1591
+ user_id?: string;
1592
+ workos_membership_id?: string | null;
1593
+ };
1594
+ Relationships: [
1595
+ {
1596
+ foreignKeyName: "org_memberships_organization_id_fkey";
1597
+ columns: ["organization_id"];
1598
+ isOneToOne: false;
1599
+ referencedRelation: "organizations";
1600
+ referencedColumns: ["id"];
1601
+ },
1602
+ {
1603
+ foreignKeyName: "org_memberships_user_id_fkey";
1604
+ columns: ["user_id"];
1605
+ isOneToOne: false;
1606
+ referencedRelation: "users";
1607
+ referencedColumns: ["id"];
1608
+ }
1609
+ ];
1610
+ };
1611
+ organizations: {
1612
+ Row: {
1613
+ config: Json;
1614
+ created_at: string;
1615
+ id: string;
1616
+ is_test: boolean;
1617
+ metadata: Json;
1618
+ name: string;
1619
+ status: string;
1620
+ updated_at: string;
1621
+ workos_org_id: string;
1622
+ };
1623
+ Insert: {
1624
+ config?: Json;
1625
+ created_at?: string;
1626
+ id?: string;
1627
+ is_test?: boolean;
1628
+ metadata?: Json;
1629
+ name: string;
1630
+ status?: string;
1631
+ updated_at?: string;
1632
+ workos_org_id: string;
1633
+ };
1634
+ Update: {
1635
+ config?: Json;
1636
+ created_at?: string;
1637
+ id?: string;
1638
+ is_test?: boolean;
1639
+ metadata?: Json;
1640
+ name?: string;
1641
+ status?: string;
1642
+ updated_at?: string;
1643
+ workos_org_id?: string;
1644
+ };
1645
+ Relationships: [];
1646
+ };
1647
+ session_messages: {
1648
+ Row: {
1649
+ created_at: string | null;
1650
+ id: string;
1651
+ message: string;
1652
+ message_index: number | null;
1653
+ message_type: string | null;
1654
+ metadata: Json | null;
1655
+ role: string;
1656
+ session_id: string;
1657
+ session_turn_number: number;
1658
+ };
1659
+ Insert: {
1660
+ created_at?: string | null;
1661
+ id: string;
1662
+ message: string;
1663
+ message_index?: number | null;
1664
+ message_type?: string | null;
1665
+ metadata?: Json | null;
1666
+ role: string;
1667
+ session_id: string;
1668
+ session_turn_number: number;
1669
+ };
1670
+ Update: {
1671
+ created_at?: string | null;
1672
+ id?: string;
1673
+ message?: string;
1674
+ message_index?: number | null;
1675
+ message_type?: string | null;
1676
+ metadata?: Json | null;
1677
+ role?: string;
1678
+ session_id?: string;
1679
+ session_turn_number?: number;
1680
+ };
1681
+ Relationships: [
1682
+ {
1683
+ foreignKeyName: "session_messages_session_id_fkey";
1684
+ columns: ["session_id"];
1685
+ isOneToOne: false;
1686
+ referencedRelation: "sessions";
1687
+ referencedColumns: ["session_id"];
1688
+ }
1689
+ ];
1690
+ };
1691
+ sessions: {
1692
+ Row: {
1693
+ context_window_size: number;
1694
+ created_at: string | null;
1695
+ cumulative_input_tokens: number;
1696
+ cumulative_output_tokens: number;
1697
+ deleted_at: string | null;
1698
+ ended_at: string | null;
1699
+ memory_snapshot: Json;
1700
+ metadata: Json | null;
1701
+ organization_id: string;
1702
+ resource_id: string;
1703
+ session_id: string;
1704
+ session_total_turns: number | null;
1705
+ updated_at: string | null;
1706
+ user_id: string | null;
1707
+ };
1708
+ Insert: {
1709
+ context_window_size?: number;
1710
+ created_at?: string | null;
1711
+ cumulative_input_tokens?: number;
1712
+ cumulative_output_tokens?: number;
1713
+ deleted_at?: string | null;
1714
+ ended_at?: string | null;
1715
+ memory_snapshot: Json;
1716
+ metadata?: Json | null;
1717
+ organization_id: string;
1718
+ resource_id: string;
1719
+ session_id?: string;
1720
+ session_total_turns?: number | null;
1721
+ updated_at?: string | null;
1722
+ user_id?: string | null;
1723
+ };
1724
+ Update: {
1725
+ context_window_size?: number;
1726
+ created_at?: string | null;
1727
+ cumulative_input_tokens?: number;
1728
+ cumulative_output_tokens?: number;
1729
+ deleted_at?: string | null;
1730
+ ended_at?: string | null;
1731
+ memory_snapshot?: Json;
1732
+ metadata?: Json | null;
1733
+ organization_id?: string;
1734
+ resource_id?: string;
1735
+ session_id?: string;
1736
+ session_total_turns?: number | null;
1737
+ updated_at?: string | null;
1738
+ user_id?: string | null;
1739
+ };
1740
+ Relationships: [
1741
+ {
1742
+ foreignKeyName: "fk_organization";
1743
+ columns: ["organization_id"];
1744
+ isOneToOne: false;
1745
+ referencedRelation: "organizations";
1746
+ referencedColumns: ["id"];
1747
+ },
1748
+ {
1749
+ foreignKeyName: "fk_user";
1750
+ columns: ["user_id"];
1751
+ isOneToOne: false;
1752
+ referencedRelation: "users";
1753
+ referencedColumns: ["id"];
1754
+ }
1755
+ ];
1756
+ };
1757
+ task_schedules: {
1758
+ Row: {
1759
+ created_at: string;
1760
+ current_step: number;
1761
+ description: string | null;
1762
+ id: string;
1763
+ idempotency_key: string | null;
1764
+ last_execution_id: string | null;
1765
+ last_run_at: string | null;
1766
+ max_retries: number;
1767
+ metadata: Json | null;
1768
+ name: string;
1769
+ next_run_at: string | null;
1770
+ organization_id: string;
1771
+ origin_execution_id: string | null;
1772
+ origin_resource_id: string | null;
1773
+ origin_resource_type: string | null;
1774
+ retry_count: number;
1775
+ schedule_config: Json;
1776
+ status: string;
1777
+ target_resource_id: string;
1778
+ target_resource_type: string;
1779
+ updated_at: string;
1780
+ };
1781
+ Insert: {
1782
+ created_at?: string;
1783
+ current_step?: number;
1784
+ description?: string | null;
1785
+ id?: string;
1786
+ idempotency_key?: string | null;
1787
+ last_execution_id?: string | null;
1788
+ last_run_at?: string | null;
1789
+ max_retries?: number;
1790
+ metadata?: Json | null;
1791
+ name: string;
1792
+ next_run_at?: string | null;
1793
+ organization_id: string;
1794
+ origin_execution_id?: string | null;
1795
+ origin_resource_id?: string | null;
1796
+ origin_resource_type?: string | null;
1797
+ retry_count?: number;
1798
+ schedule_config: Json;
1799
+ status?: string;
1800
+ target_resource_id: string;
1801
+ target_resource_type: string;
1802
+ updated_at?: string;
1803
+ };
1804
+ Update: {
1805
+ created_at?: string;
1806
+ current_step?: number;
1807
+ description?: string | null;
1808
+ id?: string;
1809
+ idempotency_key?: string | null;
1810
+ last_execution_id?: string | null;
1811
+ last_run_at?: string | null;
1812
+ max_retries?: number;
1813
+ metadata?: Json | null;
1814
+ name?: string;
1815
+ next_run_at?: string | null;
1816
+ organization_id?: string;
1817
+ origin_execution_id?: string | null;
1818
+ origin_resource_id?: string | null;
1819
+ origin_resource_type?: string | null;
1820
+ retry_count?: number;
1821
+ schedule_config?: Json;
1822
+ status?: string;
1823
+ target_resource_id?: string;
1824
+ target_resource_type?: string;
1825
+ updated_at?: string;
1826
+ };
1827
+ Relationships: [
1828
+ {
1829
+ foreignKeyName: "task_schedules_organization_id_fkey";
1830
+ columns: ["organization_id"];
1831
+ isOneToOne: false;
1832
+ referencedRelation: "organizations";
1833
+ referencedColumns: ["id"];
1834
+ }
1835
+ ];
1836
+ };
1837
+ users: {
1838
+ Row: {
1839
+ config: Json;
1840
+ created_at: string;
1841
+ display_name: string | null;
1842
+ email: string;
1843
+ first_name: string | null;
1844
+ id: string;
1845
+ is_active: boolean;
1846
+ is_platform_admin: boolean | null;
1847
+ last_login_at: string | null;
1848
+ last_name: string | null;
1849
+ last_visited_org: string | null;
1850
+ profile_picture_url: string | null;
1851
+ updated_at: string;
1852
+ workos_user_id: string | null;
1853
+ };
1854
+ Insert: {
1855
+ config?: Json;
1856
+ created_at?: string;
1857
+ display_name?: string | null;
1858
+ email: string;
1859
+ first_name?: string | null;
1860
+ id?: string;
1861
+ is_active?: boolean;
1862
+ is_platform_admin?: boolean | null;
1863
+ last_login_at?: string | null;
1864
+ last_name?: string | null;
1865
+ last_visited_org?: string | null;
1866
+ profile_picture_url?: string | null;
1867
+ updated_at?: string;
1868
+ workos_user_id?: string | null;
1869
+ };
1870
+ Update: {
1871
+ config?: Json;
1872
+ created_at?: string;
1873
+ display_name?: string | null;
1874
+ email?: string;
1875
+ first_name?: string | null;
1876
+ id?: string;
1877
+ is_active?: boolean;
1878
+ is_platform_admin?: boolean | null;
1879
+ last_login_at?: string | null;
1880
+ last_name?: string | null;
1881
+ last_visited_org?: string | null;
1882
+ profile_picture_url?: string | null;
1883
+ updated_at?: string;
1884
+ workos_user_id?: string | null;
1885
+ };
1886
+ Relationships: [
1887
+ {
1888
+ foreignKeyName: "user_profiles_last_visited_org_fkey";
1889
+ columns: ["last_visited_org"];
1890
+ isOneToOne: false;
1891
+ referencedRelation: "organizations";
1892
+ referencedColumns: ["id"];
1893
+ }
1894
+ ];
1895
+ };
1896
+ webhook_endpoints: {
1897
+ Row: {
1898
+ created_at: string;
1899
+ description: string | null;
1900
+ id: string;
1901
+ key: string;
1902
+ last_triggered_at: string | null;
1903
+ name: string;
1904
+ organization_id: string;
1905
+ request_count: number;
1906
+ resource_id: string | null;
1907
+ status: string;
1908
+ updated_at: string;
1909
+ };
1910
+ Insert: {
1911
+ created_at?: string;
1912
+ description?: string | null;
1913
+ id?: string;
1914
+ key: string;
1915
+ last_triggered_at?: string | null;
1916
+ name: string;
1917
+ organization_id: string;
1918
+ request_count?: number;
1919
+ resource_id?: string | null;
1920
+ status?: string;
1921
+ updated_at?: string;
1922
+ };
1923
+ Update: {
1924
+ created_at?: string;
1925
+ description?: string | null;
1926
+ id?: string;
1927
+ key?: string;
1928
+ last_triggered_at?: string | null;
1929
+ name?: string;
1930
+ organization_id?: string;
1931
+ request_count?: number;
1932
+ resource_id?: string | null;
1933
+ status?: string;
1934
+ updated_at?: string;
1935
+ };
1936
+ Relationships: [
1937
+ {
1938
+ foreignKeyName: "webhook_endpoints_organization_id_fkey";
1939
+ columns: ["organization_id"];
1940
+ isOneToOne: false;
1941
+ referencedRelation: "organizations";
1942
+ referencedColumns: ["id"];
1943
+ }
1944
+ ];
1945
+ };
1946
+ };
1947
+ Views: {
1948
+ [_ in never]: never;
1949
+ };
1950
+ Functions: {
1951
+ acq_default_checklist: {
1952
+ Args: {
1953
+ p_platform: string;
1954
+ };
1955
+ Returns: Json;
1956
+ };
1957
+ append_deal_activity: {
1958
+ Args: {
1959
+ p_activity: Json;
1960
+ p_deal_id: string;
1961
+ p_organization_id: string;
1962
+ };
1963
+ Returns: undefined;
1964
+ };
1965
+ auth_jwt_claims: {
1966
+ Args: never;
1967
+ Returns: Json;
1968
+ };
1969
+ auth_uid_safe: {
1970
+ Args: never;
1971
+ Returns: string;
1972
+ };
1973
+ current_user_is_platform_admin: {
1974
+ Args: never;
1975
+ Returns: boolean;
1976
+ };
1977
+ current_user_supabase_id: {
1978
+ Args: never;
1979
+ Returns: string;
1980
+ };
1981
+ detect_stalled_executions: {
1982
+ Args: never;
1983
+ Returns: undefined;
1984
+ };
1985
+ execute_session_turn: {
1986
+ Args: {
1987
+ p_session_id: string;
1988
+ };
1989
+ Returns: {
1990
+ created_at: string;
1991
+ ended_at: string;
1992
+ memory_snapshot: Json;
1993
+ metadata: Json;
1994
+ organization_id: string;
1995
+ resource_id: string;
1996
+ session_id: string;
1997
+ session_total_turns: number;
1998
+ updated_at: string;
1999
+ user_id: string;
2000
+ }[];
2001
+ };
2002
+ get_storage_org_id: {
2003
+ Args: {
2004
+ file_path: string;
2005
+ };
2006
+ Returns: string;
2007
+ };
2008
+ get_workos_user_id: {
2009
+ Args: never;
2010
+ Returns: string;
2011
+ };
2012
+ is_org_admin: {
2013
+ Args: {
2014
+ org_id: string;
2015
+ };
2016
+ Returns: boolean;
2017
+ };
2018
+ is_org_member: {
2019
+ Args: {
2020
+ org_id: string;
2021
+ };
2022
+ Returns: boolean;
2023
+ };
2024
+ link_workos_membership_on_accept: {
2025
+ Args: {
2026
+ p_email: string;
2027
+ p_organization_id: string;
2028
+ p_workos_membership_id: string;
2029
+ };
2030
+ Returns: boolean;
2031
+ };
2032
+ pre_provision_invited_user: {
2033
+ Args: {
2034
+ p_email: string;
2035
+ p_organization_id: string;
2036
+ p_role_slug?: string;
2037
+ };
2038
+ Returns: Json;
2039
+ };
2040
+ process_due_schedules: {
2041
+ Args: never;
2042
+ Returns: Json;
2043
+ };
2044
+ upsert_user_profile: {
2045
+ Args: never;
2046
+ Returns: {
2047
+ profile_display_name: string;
2048
+ profile_email: string;
2049
+ profile_id: string;
2050
+ profile_workos_user_id: string;
2051
+ }[];
2052
+ };
2053
+ };
2054
+ Enums: {
2055
+ [_ in never]: never;
2056
+ };
2057
+ CompositeTypes: {
2058
+ [_ in never]: never;
2059
+ };
2060
+ };
2061
+ };
2062
+ type DatabaseWithoutInternals = Omit<Database, "__InternalSupabase">;
2063
+ type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">];
2064
+ type Tables<DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) | {
2065
+ schema: keyof DatabaseWithoutInternals;
2066
+ }, TableName extends DefaultSchemaTableNameOrOptions extends {
2067
+ schema: keyof DatabaseWithoutInternals;
2068
+ } ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"]) : never = never> = DefaultSchemaTableNameOrOptions extends {
2069
+ schema: keyof DatabaseWithoutInternals;
2070
+ } ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends {
2071
+ Row: infer R;
2072
+ } ? R : never : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) ? (DefaultSchema["Tables"] & DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends {
2073
+ Row: infer R;
2074
+ } ? R : never : never;
2075
+
2076
+ type SupabaseUserProfile = Tables<'users'>;
2077
+
1
2078
  /**
2
- * Initialization module - Coordination layer
2079
+ * Multi-tenancy configuration types
3
2080
  *
4
- * Preferred usage (zero-config provider):
5
- * ```typescript
6
- * import { InitializationProvider, useInitialization } from '@repo/ui/initialization'
7
- *
8
- * // In your provider composition (inside OrganizationProvider):
9
- * <InitializationProvider>
10
- * <App />
11
- * </InitializationProvider>
12
- *
13
- * // In your components:
14
- * const { organizationReady, error, retry } = useInitialization()
15
- * ```
2081
+ * Config is stored in dedicated `config` columns (NOT nested in metadata):
2082
+ * - organizations.config: Org-level feature config
2083
+ * - org_memberships.config: Per-user-per-org feature overrides
2084
+ * - users.config: User-global config
2085
+ */
2086
+ /**
2087
+ * Org-level feature config (stored in organizations.config)
2088
+ * Controls which features are available to all org members
2089
+ * Valid feature keys: operations, monitoring, acquisition, calibration, seo
2090
+ */
2091
+ interface OrgFeatureConfig {
2092
+ features?: {
2093
+ operations?: boolean;
2094
+ monitoring?: boolean;
2095
+ acquisition?: boolean;
2096
+ calibration?: boolean;
2097
+ seo?: boolean;
2098
+ };
2099
+ }
2100
+ /**
2101
+ * Per-user-per-org config (stored in org_memberships.config)
2102
+ * Overrides org-level feature config for specific users
2103
+ */
2104
+ type MembershipFeatureConfig = OrgFeatureConfig;
2105
+
2106
+ /**
2107
+ * Organization Membership types based on WorkOS API
2108
+ */
2109
+ interface OrganizationMembership {
2110
+ object: 'organization_membership';
2111
+ id: string;
2112
+ userId: string;
2113
+ organizationId: string;
2114
+ role: {
2115
+ slug: string;
2116
+ };
2117
+ status: 'active' | 'inactive';
2118
+ createdAt: string;
2119
+ updatedAt: string;
2120
+ }
2121
+ /**
2122
+ * Extended membership with user and organization details for UI
2123
+ */
2124
+ interface MembershipWithDetails extends OrganizationMembership {
2125
+ user?: {
2126
+ id: string;
2127
+ email: string;
2128
+ firstName?: string;
2129
+ lastName?: string;
2130
+ profilePictureUrl?: string;
2131
+ };
2132
+ organization?: {
2133
+ id: string;
2134
+ name: string;
2135
+ workos_org_id: string;
2136
+ primaryDomain?: string;
2137
+ is_test?: boolean;
2138
+ status?: string;
2139
+ metadata?: Record<string, unknown>;
2140
+ config?: OrgFeatureConfig;
2141
+ };
2142
+ config?: MembershipFeatureConfig;
2143
+ }
2144
+
2145
+ /**
2146
+ * Return type for useOrgInitialization hook
2147
+ */
2148
+ interface UseOrgInitializationReturn {
2149
+ memberships: MembershipWithDetails[];
2150
+ isInitializing: boolean;
2151
+ isLoading: boolean;
2152
+ isInitialized: boolean;
2153
+ error: string | null;
2154
+ currentOrganization: MembershipWithDetails['organization'] | null;
2155
+ retry: () => Promise<void>;
2156
+ }
2157
+
2158
+ interface InitializationError {
2159
+ layer: 'auth' | 'profile' | 'organization';
2160
+ message: string;
2161
+ originalError?: Error;
2162
+ }
2163
+ interface AppInitializationState {
2164
+ userReady: boolean;
2165
+ organizationReady: boolean;
2166
+ allReady: boolean;
2167
+ isInitializing: boolean;
2168
+ error: InitializationError | null;
2169
+ retry: () => void;
2170
+ profile: SupabaseUserProfile | null;
2171
+ }
2172
+ /**
2173
+ * Factory function to create a useAppInitialization hook for your app.
16
2174
  *
17
- * Legacy usage (factory pattern — deprecated):
2175
+ * Usage in app:
18
2176
  * ```typescript
19
2177
  * import { createUseAppInitialization } from '@repo/ui/initialization'
20
2178
  * import { useOrgInitialization } from './organization/hooks/useOrgInitialization'
21
2179
  *
22
2180
  * export const useAppInitialization = createUseAppInitialization(useOrgInitialization)
23
2181
  * ```
2182
+ *
2183
+ * This pattern allows the shared package to provide the hook logic
2184
+ * while each app provides its own hook instances.
2185
+ */
2186
+ declare function createUseAppInitialization(useOrgInitialization: () => UseOrgInitializationReturn): () => AppInitializationState;
2187
+
2188
+ declare const InitializationContext: react.Context<AppInitializationState | null>;
2189
+ /**
2190
+ * Consumes the nearest InitializationProvider.
2191
+ *
2192
+ * @throws {Error} If called outside of an InitializationProvider tree.
24
2193
  */
25
- export { InitializationProvider, useInitialization, InitializationContext } from './InitializationProvider';
2194
+ declare function useInitialization(): AppInitializationState;
26
2195
  /**
27
- * @deprecated Use `InitializationProvider` and `useInitialization` instead.
28
- * `createUseAppInitialization` requires a factory hook parameter and does not
29
- * integrate with the shared OrganizationProvider context. The zero-config
30
- * `InitializationProvider` reads from all parent contexts automatically.
2196
+ * Aggregates auth, profile, and organization state into a single initialization context.
2197
+ *
2198
+ * Must be rendered inside:
2199
+ * - An AuthProvider (needs useAuthContext)
2200
+ * - A ProfileProvider (needs useProfile)
2201
+ * - An OrganizationProvider (needs useOrganization)
2202
+ *
2203
+ * Initialization Layers (Sequential):
2204
+ * 1. WorkOS Auth (useAuthContext)
2205
+ * 2. User Profile Sync (useProfile)
2206
+ * 3. Organization Context (useOrganization)
2207
+ *
2208
+ * @example
2209
+ * // Org-scoped pages with data queries (most common)
2210
+ * const { organizationReady } = useInitialization()
2211
+ * const { data, isLoading } = useResources()
2212
+ * if (!organizationReady || isLoading) return <SubshellLoader />
2213
+ *
2214
+ * @example
2215
+ * // Pages accessible without org (invitations, pending)
2216
+ * const { userReady, error } = useInitialization()
2217
+ * if (!userReady) return <SubshellLoader />
2218
+ * if (error?.layer === 'organization') {
2219
+ * return <PendingInvitationPage message={error.message} />
2220
+ * }
2221
+ *
2222
+ * @example
2223
+ * // Pages with error handling
2224
+ * const { organizationReady, error, retry } = useInitialization()
2225
+ * if (error?.layer === 'organization') return <NoOrgError error={error} />
2226
+ * if (error) return <ErrorCard error={error} onRetry={retry} />
2227
+ * if (!organizationReady) return <SubshellLoader />
31
2228
  */
32
- export { createUseAppInitialization } from './hooks/useAppInitialization';
33
- export type { InitializationError, AppInitializationState } from './hooks/useAppInitialization';
34
- //# sourceMappingURL=index.d.ts.map
2229
+ declare function InitializationProvider({ children }: {
2230
+ children: ReactNode;
2231
+ }): react.FunctionComponentElement<react.ProviderProps<AppInitializationState | null>>;
2232
+
2233
+ export { InitializationContext, InitializationProvider, createUseAppInitialization, useInitialization };
2234
+ export type { AppInitializationState, InitializationError, SupabaseUserProfile };