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