@fidelios/db 0.0.1

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 (473) hide show
  1. package/dist/backup-lib.d.ts +26 -0
  2. package/dist/backup-lib.d.ts.map +1 -0
  3. package/dist/backup-lib.js +498 -0
  4. package/dist/backup-lib.js.map +1 -0
  5. package/dist/backup.d.ts +2 -0
  6. package/dist/backup.d.ts.map +1 -0
  7. package/dist/backup.js +103 -0
  8. package/dist/backup.js.map +1 -0
  9. package/dist/client.d.ts +43 -0
  10. package/dist/client.d.ts.map +1 -0
  11. package/dist/client.js +586 -0
  12. package/dist/client.js.map +1 -0
  13. package/dist/client.test.d.ts +2 -0
  14. package/dist/client.test.d.ts.map +1 -0
  15. package/dist/client.test.js +120 -0
  16. package/dist/client.test.js.map +1 -0
  17. package/dist/embedded-postgres-error.d.ts +9 -0
  18. package/dist/embedded-postgres-error.d.ts.map +1 -0
  19. package/dist/embedded-postgres-error.js +73 -0
  20. package/dist/embedded-postgres-error.js.map +1 -0
  21. package/dist/embedded-postgres-error.test.d.ts +2 -0
  22. package/dist/embedded-postgres-error.test.d.ts.map +1 -0
  23. package/dist/embedded-postgres-error.test.js +25 -0
  24. package/dist/embedded-postgres-error.test.js.map +1 -0
  25. package/dist/index.d.ts +6 -0
  26. package/dist/index.d.ts.map +1 -0
  27. package/dist/index.js +6 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/migrate.d.ts +2 -0
  30. package/dist/migrate.d.ts.map +1 -0
  31. package/dist/migrate.js +25 -0
  32. package/dist/migrate.js.map +1 -0
  33. package/dist/migration-runtime.d.ts +7 -0
  34. package/dist/migration-runtime.d.ts.map +1 -0
  35. package/dist/migration-runtime.js +157 -0
  36. package/dist/migration-runtime.js.map +1 -0
  37. package/dist/migration-status.d.ts +2 -0
  38. package/dist/migration-status.d.ts.map +1 -0
  39. package/dist/migration-status.js +55 -0
  40. package/dist/migration-status.js.map +1 -0
  41. package/dist/migrations/0000_mature_masked_marvel.sql +208 -0
  42. package/dist/migrations/0001_fast_northstar.sql +87 -0
  43. package/dist/migrations/0002_big_zaladane.sql +1 -0
  44. package/dist/migrations/0003_shallow_quentin_quire.sql +5 -0
  45. package/dist/migrations/0004_issue_identifiers.sql +28 -0
  46. package/dist/migrations/0005_chief_luke_cage.sql +19 -0
  47. package/dist/migrations/0006_overjoyed_mister_sinister.sql +36 -0
  48. package/dist/migrations/0007_new_quentin_quire.sql +20 -0
  49. package/dist/migrations/0008_amused_zzzax.sql +1 -0
  50. package/dist/migrations/0009_fast_jackal.sql +36 -0
  51. package/dist/migrations/0010_stale_justin_hammer.sql +37 -0
  52. package/dist/migrations/0011_windy_corsair.sql +18 -0
  53. package/dist/migrations/0012_perpetual_ser_duncan.sql +2 -0
  54. package/dist/migrations/0013_dashing_wasp.sql +4 -0
  55. package/dist/migrations/0014_many_mikhail_rasputin.sql +135 -0
  56. package/dist/migrations/0015_project_color_archived.sql +2 -0
  57. package/dist/migrations/0016_agent_icon.sql +1 -0
  58. package/dist/migrations/0017_tiresome_gabe_jones.sql +51 -0
  59. package/dist/migrations/0018_flat_sleepwalker.sql +26 -0
  60. package/dist/migrations/0019_public_victor_mancha.sql +18 -0
  61. package/dist/migrations/0020_white_anita_blake.sql +1 -0
  62. package/dist/migrations/0021_chief_vindicator.sql +1 -0
  63. package/dist/migrations/0022_company_brand_color.sql +1 -0
  64. package/dist/migrations/0023_fair_lethal_legion.sql +3 -0
  65. package/dist/migrations/0024_far_beast.sql +2 -0
  66. package/dist/migrations/0025_nasty_salo.sql +15 -0
  67. package/dist/migrations/0026_lying_pete_wisdom.sql +39 -0
  68. package/dist/migrations/0027_tranquil_tenebrous.sql +2 -0
  69. package/dist/migrations/0028_harsh_goliath.sql +54 -0
  70. package/dist/migrations/0029_plugin_tables.sql +177 -0
  71. package/dist/migrations/0030_rich_magneto.sql +12 -0
  72. package/dist/migrations/0031_zippy_magma.sql +51 -0
  73. package/dist/migrations/0032_pretty_doctor_octopus.sql +102 -0
  74. package/dist/migrations/0033_shiny_black_tarantula.sql +2 -0
  75. package/dist/migrations/0034_fat_dormammu.sql +2 -0
  76. package/dist/migrations/0035_marvelous_satana.sql +91 -0
  77. package/dist/migrations/0036_cheerful_nitro.sql +9 -0
  78. package/dist/migrations/0037_friendly_eddie_brock.sql +29 -0
  79. package/dist/migrations/0038_careless_iron_monger.sql +5 -0
  80. package/dist/migrations/0039_fat_magneto.sql +161 -0
  81. package/dist/migrations/0040_eager_shotgun.sql +5 -0
  82. package/dist/migrations/0041_curly_maria_hill.sql +1 -0
  83. package/dist/migrations/0042_spotty_the_renegades.sql +26 -0
  84. package/dist/migrations/0043_reflective_captain_universe.sql +6 -0
  85. package/dist/migrations/0044_illegal_toad.sql +56 -0
  86. package/dist/migrations/0045_workable_shockwave.sql +17 -0
  87. package/dist/migrations/meta/0000_snapshot.json +1743 -0
  88. package/dist/migrations/meta/0001_snapshot.json +2441 -0
  89. package/dist/migrations/meta/0002_snapshot.json +2454 -0
  90. package/dist/migrations/meta/0003_snapshot.json +2502 -0
  91. package/dist/migrations/meta/0005_snapshot.json +2719 -0
  92. package/dist/migrations/meta/0006_snapshot.json +3048 -0
  93. package/dist/migrations/meta/0007_snapshot.json +3258 -0
  94. package/dist/migrations/meta/0008_snapshot.json +3264 -0
  95. package/dist/migrations/meta/0009_snapshot.json +3587 -0
  96. package/dist/migrations/meta/0010_snapshot.json +3929 -0
  97. package/dist/migrations/meta/0011_snapshot.json +4068 -0
  98. package/dist/migrations/meta/0012_snapshot.json +4087 -0
  99. package/dist/migrations/meta/0013_snapshot.json +4118 -0
  100. package/dist/migrations/meta/0014_snapshot.json +5187 -0
  101. package/dist/migrations/meta/0017_snapshot.json +5215 -0
  102. package/dist/migrations/meta/0018_snapshot.json +5450 -0
  103. package/dist/migrations/meta/0019_snapshot.json +5603 -0
  104. package/dist/migrations/meta/0020_snapshot.json +5603 -0
  105. package/dist/migrations/meta/0021_snapshot.json +5609 -0
  106. package/dist/migrations/meta/0023_snapshot.json +5633 -0
  107. package/dist/migrations/meta/0024_snapshot.json +5693 -0
  108. package/dist/migrations/meta/0025_snapshot.json +5849 -0
  109. package/dist/migrations/meta/0027_snapshot.json +6205 -0
  110. package/dist/migrations/meta/0028_snapshot.json +6710 -0
  111. package/dist/migrations/meta/0029_snapshot.json +7899 -0
  112. package/dist/migrations/meta/0030_snapshot.json +8003 -0
  113. package/dist/migrations/meta/0031_snapshot.json +7242 -0
  114. package/dist/migrations/meta/0032_snapshot.json +7733 -0
  115. package/dist/migrations/meta/0033_snapshot.json +9038 -0
  116. package/dist/migrations/meta/0034_snapshot.json +9039 -0
  117. package/dist/migrations/meta/0035_snapshot.json +9959 -0
  118. package/dist/migrations/meta/0036_snapshot.json +10023 -0
  119. package/dist/migrations/meta/0037_snapshot.json +10263 -0
  120. package/dist/migrations/meta/0038_snapshot.json +11350 -0
  121. package/dist/migrations/meta/0039_snapshot.json +10308 -0
  122. package/dist/migrations/meta/0040_snapshot.json +10481 -0
  123. package/dist/migrations/meta/0041_snapshot.json +11393 -0
  124. package/dist/migrations/meta/0044_snapshot.json +11701 -0
  125. package/dist/migrations/meta/0045_snapshot.json +11857 -0
  126. package/dist/migrations/meta/_journal.json +328 -0
  127. package/dist/migrations/migrations/0000_mature_masked_marvel.sql +208 -0
  128. package/dist/migrations/migrations/0001_fast_northstar.sql +87 -0
  129. package/dist/migrations/migrations/0002_big_zaladane.sql +1 -0
  130. package/dist/migrations/migrations/0003_shallow_quentin_quire.sql +5 -0
  131. package/dist/migrations/migrations/0004_issue_identifiers.sql +28 -0
  132. package/dist/migrations/migrations/0005_chief_luke_cage.sql +19 -0
  133. package/dist/migrations/migrations/0006_overjoyed_mister_sinister.sql +36 -0
  134. package/dist/migrations/migrations/0007_new_quentin_quire.sql +20 -0
  135. package/dist/migrations/migrations/0008_amused_zzzax.sql +1 -0
  136. package/dist/migrations/migrations/0009_fast_jackal.sql +36 -0
  137. package/dist/migrations/migrations/0010_stale_justin_hammer.sql +37 -0
  138. package/dist/migrations/migrations/0011_windy_corsair.sql +18 -0
  139. package/dist/migrations/migrations/0012_perpetual_ser_duncan.sql +2 -0
  140. package/dist/migrations/migrations/0013_dashing_wasp.sql +4 -0
  141. package/dist/migrations/migrations/0014_many_mikhail_rasputin.sql +135 -0
  142. package/dist/migrations/migrations/0015_project_color_archived.sql +2 -0
  143. package/dist/migrations/migrations/0016_agent_icon.sql +1 -0
  144. package/dist/migrations/migrations/0017_tiresome_gabe_jones.sql +51 -0
  145. package/dist/migrations/migrations/0018_flat_sleepwalker.sql +26 -0
  146. package/dist/migrations/migrations/0019_public_victor_mancha.sql +18 -0
  147. package/dist/migrations/migrations/0020_white_anita_blake.sql +1 -0
  148. package/dist/migrations/migrations/0021_chief_vindicator.sql +1 -0
  149. package/dist/migrations/migrations/0022_company_brand_color.sql +1 -0
  150. package/dist/migrations/migrations/0023_fair_lethal_legion.sql +3 -0
  151. package/dist/migrations/migrations/0024_far_beast.sql +2 -0
  152. package/dist/migrations/migrations/0025_nasty_salo.sql +15 -0
  153. package/dist/migrations/migrations/0026_lying_pete_wisdom.sql +39 -0
  154. package/dist/migrations/migrations/0027_tranquil_tenebrous.sql +2 -0
  155. package/dist/migrations/migrations/0028_harsh_goliath.sql +54 -0
  156. package/dist/migrations/migrations/0029_plugin_tables.sql +177 -0
  157. package/dist/migrations/migrations/0030_rich_magneto.sql +12 -0
  158. package/dist/migrations/migrations/0031_zippy_magma.sql +51 -0
  159. package/dist/migrations/migrations/0032_pretty_doctor_octopus.sql +102 -0
  160. package/dist/migrations/migrations/0033_shiny_black_tarantula.sql +2 -0
  161. package/dist/migrations/migrations/0034_fat_dormammu.sql +2 -0
  162. package/dist/migrations/migrations/0035_marvelous_satana.sql +91 -0
  163. package/dist/migrations/migrations/0036_cheerful_nitro.sql +9 -0
  164. package/dist/migrations/migrations/0037_friendly_eddie_brock.sql +29 -0
  165. package/dist/migrations/migrations/0038_careless_iron_monger.sql +5 -0
  166. package/dist/migrations/migrations/0039_fat_magneto.sql +161 -0
  167. package/dist/migrations/migrations/0040_eager_shotgun.sql +5 -0
  168. package/dist/migrations/migrations/0041_curly_maria_hill.sql +1 -0
  169. package/dist/migrations/migrations/0042_spotty_the_renegades.sql +26 -0
  170. package/dist/migrations/migrations/0043_reflective_captain_universe.sql +6 -0
  171. package/dist/migrations/migrations/0044_illegal_toad.sql +56 -0
  172. package/dist/migrations/migrations/0045_workable_shockwave.sql +17 -0
  173. package/dist/migrations/migrations/meta/0000_snapshot.json +1743 -0
  174. package/dist/migrations/migrations/meta/0001_snapshot.json +2441 -0
  175. package/dist/migrations/migrations/meta/0002_snapshot.json +2454 -0
  176. package/dist/migrations/migrations/meta/0003_snapshot.json +2502 -0
  177. package/dist/migrations/migrations/meta/0005_snapshot.json +2719 -0
  178. package/dist/migrations/migrations/meta/0006_snapshot.json +3048 -0
  179. package/dist/migrations/migrations/meta/0007_snapshot.json +3258 -0
  180. package/dist/migrations/migrations/meta/0008_snapshot.json +3264 -0
  181. package/dist/migrations/migrations/meta/0009_snapshot.json +3587 -0
  182. package/dist/migrations/migrations/meta/0010_snapshot.json +3929 -0
  183. package/dist/migrations/migrations/meta/0011_snapshot.json +4068 -0
  184. package/dist/migrations/migrations/meta/0012_snapshot.json +4087 -0
  185. package/dist/migrations/migrations/meta/0013_snapshot.json +4118 -0
  186. package/dist/migrations/migrations/meta/0014_snapshot.json +5187 -0
  187. package/dist/migrations/migrations/meta/0017_snapshot.json +5215 -0
  188. package/dist/migrations/migrations/meta/0018_snapshot.json +5450 -0
  189. package/dist/migrations/migrations/meta/0019_snapshot.json +5603 -0
  190. package/dist/migrations/migrations/meta/0020_snapshot.json +5603 -0
  191. package/dist/migrations/migrations/meta/0021_snapshot.json +5609 -0
  192. package/dist/migrations/migrations/meta/0023_snapshot.json +5633 -0
  193. package/dist/migrations/migrations/meta/0024_snapshot.json +5693 -0
  194. package/dist/migrations/migrations/meta/0025_snapshot.json +5849 -0
  195. package/dist/migrations/migrations/meta/0027_snapshot.json +6205 -0
  196. package/dist/migrations/migrations/meta/0028_snapshot.json +6710 -0
  197. package/dist/migrations/migrations/meta/0029_snapshot.json +7899 -0
  198. package/dist/migrations/migrations/meta/0030_snapshot.json +8003 -0
  199. package/dist/migrations/migrations/meta/0031_snapshot.json +7242 -0
  200. package/dist/migrations/migrations/meta/0032_snapshot.json +7733 -0
  201. package/dist/migrations/migrations/meta/0033_snapshot.json +9038 -0
  202. package/dist/migrations/migrations/meta/0034_snapshot.json +9039 -0
  203. package/dist/migrations/migrations/meta/0035_snapshot.json +9959 -0
  204. package/dist/migrations/migrations/meta/0036_snapshot.json +10023 -0
  205. package/dist/migrations/migrations/meta/0037_snapshot.json +10263 -0
  206. package/dist/migrations/migrations/meta/0038_snapshot.json +11350 -0
  207. package/dist/migrations/migrations/meta/0039_snapshot.json +10308 -0
  208. package/dist/migrations/migrations/meta/0040_snapshot.json +10481 -0
  209. package/dist/migrations/migrations/meta/0041_snapshot.json +11393 -0
  210. package/dist/migrations/migrations/meta/0044_snapshot.json +11701 -0
  211. package/dist/migrations/migrations/meta/0045_snapshot.json +11857 -0
  212. package/dist/migrations/migrations/meta/_journal.json +328 -0
  213. package/dist/restore.d.ts +2 -0
  214. package/dist/restore.d.ts.map +1 -0
  215. package/dist/restore.js +211 -0
  216. package/dist/restore.js.map +1 -0
  217. package/dist/runtime-config.d.ts +16 -0
  218. package/dist/runtime-config.d.ts.map +1 -0
  219. package/dist/runtime-config.js +197 -0
  220. package/dist/runtime-config.js.map +1 -0
  221. package/dist/runtime-config.test.d.ts +2 -0
  222. package/dist/runtime-config.test.d.ts.map +1 -0
  223. package/dist/runtime-config.test.js +93 -0
  224. package/dist/runtime-config.test.js.map +1 -0
  225. package/dist/s3-sync.d.ts +36 -0
  226. package/dist/s3-sync.d.ts.map +1 -0
  227. package/dist/s3-sync.js +120 -0
  228. package/dist/s3-sync.js.map +1 -0
  229. package/dist/schema/activity_log.d.ts +197 -0
  230. package/dist/schema/activity_log.d.ts.map +1 -0
  231. package/dist/schema/activity_log.js +22 -0
  232. package/dist/schema/activity_log.js.map +1 -0
  233. package/dist/schema/agent_api_keys.d.ts +144 -0
  234. package/dist/schema/agent_api_keys.d.ts.map +1 -0
  235. package/dist/schema/agent_api_keys.js +17 -0
  236. package/dist/schema/agent_api_keys.js.map +1 -0
  237. package/dist/schema/agent_config_revisions.d.ts +201 -0
  238. package/dist/schema/agent_config_revisions.d.ts.map +1 -0
  239. package/dist/schema/agent_config_revisions.js +20 -0
  240. package/dist/schema/agent_config_revisions.js.map +1 -0
  241. package/dist/schema/agent_runtime_state.d.ts +248 -0
  242. package/dist/schema/agent_runtime_state.d.ts.map +1 -0
  243. package/dist/schema/agent_runtime_state.js +23 -0
  244. package/dist/schema/agent_runtime_state.js.map +1 -0
  245. package/dist/schema/agent_task_sessions.d.ts +197 -0
  246. package/dist/schema/agent_task_sessions.d.ts.map +1 -0
  247. package/dist/schema/agent_task_sessions.js +22 -0
  248. package/dist/schema/agent_task_sessions.js.map +1 -0
  249. package/dist/schema/agent_wakeup_requests.d.ts +333 -0
  250. package/dist/schema/agent_wakeup_requests.d.ts.map +1 -0
  251. package/dist/schema/agent_wakeup_requests.js +29 -0
  252. package/dist/schema/agent_wakeup_requests.js.map +1 -0
  253. package/dist/schema/agents.d.ts +373 -0
  254. package/dist/schema/agents.d.ts.map +1 -0
  255. package/dist/schema/agents.js +29 -0
  256. package/dist/schema/agents.js.map +1 -0
  257. package/dist/schema/approval_comments.d.ts +144 -0
  258. package/dist/schema/approval_comments.d.ts.map +1 -0
  259. package/dist/schema/approval_comments.js +19 -0
  260. package/dist/schema/approval_comments.js.map +1 -0
  261. package/dist/schema/approvals.d.ts +214 -0
  262. package/dist/schema/approvals.d.ts.map +1 -0
  263. package/dist/schema/approvals.js +20 -0
  264. package/dist/schema/approvals.js.map +1 -0
  265. package/dist/schema/assets.d.ts +212 -0
  266. package/dist/schema/assets.d.ts.map +1 -0
  267. package/dist/schema/assets.js +22 -0
  268. package/dist/schema/assets.js.map +1 -0
  269. package/dist/schema/auth.d.ts +607 -0
  270. package/dist/schema/auth.d.ts.map +1 -0
  271. package/dist/schema/auth.js +44 -0
  272. package/dist/schema/auth.js.map +1 -0
  273. package/dist/schema/board_api_keys.d.ts +144 -0
  274. package/dist/schema/board_api_keys.d.ts.map +1 -0
  275. package/dist/schema/board_api_keys.js +16 -0
  276. package/dist/schema/board_api_keys.js.map +1 -0
  277. package/dist/schema/budget_incidents.d.ts +297 -0
  278. package/dist/schema/budget_incidents.d.ts.map +1 -0
  279. package/dist/schema/budget_incidents.js +29 -0
  280. package/dist/schema/budget_incidents.js.map +1 -0
  281. package/dist/schema/budget_policies.d.ts +263 -0
  282. package/dist/schema/budget_policies.d.ts.map +1 -0
  283. package/dist/schema/budget_policies.js +24 -0
  284. package/dist/schema/budget_policies.js.map +1 -0
  285. package/dist/schema/cli_auth_challenges.d.ts +263 -0
  286. package/dist/schema/cli_auth_challenges.d.ts.map +1 -0
  287. package/dist/schema/cli_auth_challenges.js +26 -0
  288. package/dist/schema/cli_auth_challenges.js.map +1 -0
  289. package/dist/schema/companies.d.ts +246 -0
  290. package/dist/schema/companies.d.ts.map +1 -0
  291. package/dist/schema/companies.js +22 -0
  292. package/dist/schema/companies.js.map +1 -0
  293. package/dist/schema/company_logos.d.ts +93 -0
  294. package/dist/schema/company_logos.d.ts.map +1 -0
  295. package/dist/schema/company_logos.js +14 -0
  296. package/dist/schema/company_logos.js.map +1 -0
  297. package/dist/schema/company_memberships.d.ts +144 -0
  298. package/dist/schema/company_memberships.d.ts.map +1 -0
  299. package/dist/schema/company_memberships.js +17 -0
  300. package/dist/schema/company_memberships.js.map +1 -0
  301. package/dist/schema/company_secret_versions.d.ts +163 -0
  302. package/dist/schema/company_secret_versions.d.ts.map +1 -0
  303. package/dist/schema/company_secret_versions.js +19 -0
  304. package/dist/schema/company_secret_versions.js.map +1 -0
  305. package/dist/schema/company_secrets.d.ts +195 -0
  306. package/dist/schema/company_secrets.d.ts.map +1 -0
  307. package/dist/schema/company_secrets.js +21 -0
  308. package/dist/schema/company_secrets.js.map +1 -0
  309. package/dist/schema/company_skills.d.ts +284 -0
  310. package/dist/schema/company_skills.d.ts.map +1 -0
  311. package/dist/schema/company_skills.js +24 -0
  312. package/dist/schema/company_skills.js.map +1 -0
  313. package/dist/schema/cost_events.d.ts +314 -0
  314. package/dist/schema/cost_events.d.ts.map +1 -0
  315. package/dist/schema/cost_events.js +34 -0
  316. package/dist/schema/cost_events.js.map +1 -0
  317. package/dist/schema/document_revisions.d.ts +161 -0
  318. package/dist/schema/document_revisions.d.ts.map +1 -0
  319. package/dist/schema/document_revisions.js +19 -0
  320. package/dist/schema/document_revisions.js.map +1 -0
  321. package/dist/schema/documents.d.ts +229 -0
  322. package/dist/schema/documents.d.ts.map +1 -0
  323. package/dist/schema/documents.js +22 -0
  324. package/dist/schema/documents.js.map +1 -0
  325. package/dist/schema/execution_workspaces.d.ts +418 -0
  326. package/dist/schema/execution_workspaces.d.ts.map +1 -0
  327. package/dist/schema/execution_workspaces.js +39 -0
  328. package/dist/schema/execution_workspaces.js.map +1 -0
  329. package/dist/schema/finance_events.d.ts +469 -0
  330. package/dist/schema/finance_events.d.ts.map +1 -0
  331. package/dist/schema/finance_events.js +45 -0
  332. package/dist/schema/finance_events.js.map +1 -0
  333. package/dist/schema/goals.d.ts +178 -0
  334. package/dist/schema/goals.d.ts.map +1 -0
  335. package/dist/schema/goals.js +18 -0
  336. package/dist/schema/goals.js.map +1 -0
  337. package/dist/schema/heartbeat_run_events.d.ts +214 -0
  338. package/dist/schema/heartbeat_run_events.d.ts.map +1 -0
  339. package/dist/schema/heartbeat_run_events.js +23 -0
  340. package/dist/schema/heartbeat_run_events.js.map +1 -0
  341. package/dist/schema/heartbeat_runs.d.ts +558 -0
  342. package/dist/schema/heartbeat_runs.d.ts.map +1 -0
  343. package/dist/schema/heartbeat_runs.js +43 -0
  344. package/dist/schema/heartbeat_runs.js.map +1 -0
  345. package/dist/schema/index.d.ts +59 -0
  346. package/dist/schema/index.d.ts.map +1 -0
  347. package/dist/schema/index.js +59 -0
  348. package/dist/schema/index.js.map +1 -0
  349. package/dist/schema/instance_settings.d.ts +114 -0
  350. package/dist/schema/instance_settings.d.ts.map +1 -0
  351. package/dist/schema/instance_settings.js +12 -0
  352. package/dist/schema/instance_settings.js.map +1 -0
  353. package/dist/schema/instance_user_roles.d.ts +93 -0
  354. package/dist/schema/instance_user_roles.d.ts.map +1 -0
  355. package/dist/schema/instance_user_roles.js +12 -0
  356. package/dist/schema/instance_user_roles.js.map +1 -0
  357. package/dist/schema/invites.d.ts +214 -0
  358. package/dist/schema/invites.d.ts.map +1 -0
  359. package/dist/schema/invites.js +20 -0
  360. package/dist/schema/invites.js.map +1 -0
  361. package/dist/schema/issue_approvals.d.ts +110 -0
  362. package/dist/schema/issue_approvals.d.ts.map +1 -0
  363. package/dist/schema/issue_approvals.js +19 -0
  364. package/dist/schema/issue_approvals.js.map +1 -0
  365. package/dist/schema/issue_attachments.d.ts +127 -0
  366. package/dist/schema/issue_attachments.d.ts.map +1 -0
  367. package/dist/schema/issue_attachments.js +19 -0
  368. package/dist/schema/issue_attachments.js.map +1 -0
  369. package/dist/schema/issue_comments.d.ts +144 -0
  370. package/dist/schema/issue_comments.d.ts.map +1 -0
  371. package/dist/schema/issue_comments.js +20 -0
  372. package/dist/schema/issue_comments.js.map +1 -0
  373. package/dist/schema/issue_documents.d.ts +127 -0
  374. package/dist/schema/issue_documents.d.ts.map +1 -0
  375. package/dist/schema/issue_documents.js +18 -0
  376. package/dist/schema/issue_documents.js.map +1 -0
  377. package/dist/schema/issue_inbox_archives.d.ts +127 -0
  378. package/dist/schema/issue_inbox_archives.d.ts.map +1 -0
  379. package/dist/schema/issue_inbox_archives.js +17 -0
  380. package/dist/schema/issue_inbox_archives.js.map +1 -0
  381. package/dist/schema/issue_labels.d.ts +76 -0
  382. package/dist/schema/issue_labels.d.ts.map +1 -0
  383. package/dist/schema/issue_labels.js +16 -0
  384. package/dist/schema/issue_labels.js.map +1 -0
  385. package/dist/schema/issue_read_states.d.ts +127 -0
  386. package/dist/schema/issue_read_states.d.ts.map +1 -0
  387. package/dist/schema/issue_read_states.js +17 -0
  388. package/dist/schema/issue_read_states.js.map +1 -0
  389. package/dist/schema/issue_work_products.d.ts +350 -0
  390. package/dist/schema/issue_work_products.d.ts.map +1 -0
  391. package/dist/schema/issue_work_products.js +37 -0
  392. package/dist/schema/issue_work_products.js.map +1 -0
  393. package/dist/schema/issues.d.ts +607 -0
  394. package/dist/schema/issues.d.ts.map +1 -0
  395. package/dist/schema/issues.js +65 -0
  396. package/dist/schema/issues.js.map +1 -0
  397. package/dist/schema/join_requests.d.ts +384 -0
  398. package/dist/schema/join_requests.d.ts.map +1 -0
  399. package/dist/schema/join_requests.js +32 -0
  400. package/dist/schema/join_requests.js.map +1 -0
  401. package/dist/schema/labels.d.ts +110 -0
  402. package/dist/schema/labels.d.ts.map +1 -0
  403. package/dist/schema/labels.js +14 -0
  404. package/dist/schema/labels.js.map +1 -0
  405. package/dist/schema/plugin_company_settings.d.ts +158 -0
  406. package/dist/schema/plugin_company_settings.d.ts.map +1 -0
  407. package/dist/schema/plugin_company_settings.js +34 -0
  408. package/dist/schema/plugin_company_settings.js.map +1 -0
  409. package/dist/schema/plugin_config.d.ts +123 -0
  410. package/dist/schema/plugin_config.d.ts.map +1 -0
  411. package/dist/schema/plugin_config.js +26 -0
  412. package/dist/schema/plugin_config.js.map +1 -0
  413. package/dist/schema/plugin_entities.d.ts +213 -0
  414. package/dist/schema/plugin_entities.d.ts.map +1 -0
  415. package/dist/schema/plugin_entities.js +37 -0
  416. package/dist/schema/plugin_entities.js.map +1 -0
  417. package/dist/schema/plugin_jobs.d.ts +392 -0
  418. package/dist/schema/plugin_jobs.d.ts.map +1 -0
  419. package/dist/schema/plugin_jobs.js +83 -0
  420. package/dist/schema/plugin_jobs.js.map +1 -0
  421. package/dist/schema/plugin_logs.d.ts +125 -0
  422. package/dist/schema/plugin_logs.d.ts.map +1 -0
  423. package/dist/schema/plugin_logs.js +29 -0
  424. package/dist/schema/plugin_logs.js.map +1 -0
  425. package/dist/schema/plugin_state.d.ts +169 -0
  426. package/dist/schema/plugin_state.d.ts.map +1 -0
  427. package/dist/schema/plugin_state.js +68 -0
  428. package/dist/schema/plugin_state.js.map +1 -0
  429. package/dist/schema/plugin_webhooks.d.ts +239 -0
  430. package/dist/schema/plugin_webhooks.d.ts.map +1 -0
  431. package/dist/schema/plugin_webhooks.js +52 -0
  432. package/dist/schema/plugin_webhooks.js.map +1 -0
  433. package/dist/schema/plugins.d.ts +246 -0
  434. package/dist/schema/plugins.d.ts.map +1 -0
  435. package/dist/schema/plugins.js +31 -0
  436. package/dist/schema/plugins.js.map +1 -0
  437. package/dist/schema/principal_permission_grants.d.ts +163 -0
  438. package/dist/schema/principal_permission_grants.d.ts.map +1 -0
  439. package/dist/schema/principal_permission_grants.js +17 -0
  440. package/dist/schema/principal_permission_grants.js.map +1 -0
  441. package/dist/schema/project_goals.d.ts +93 -0
  442. package/dist/schema/project_goals.d.ts.map +1 -0
  443. package/dist/schema/project_goals.js +17 -0
  444. package/dist/schema/project_goals.js.map +1 -0
  445. package/dist/schema/project_workspaces.d.ts +333 -0
  446. package/dist/schema/project_workspaces.d.ts.map +1 -0
  447. package/dist/schema/project_workspaces.js +32 -0
  448. package/dist/schema/project_workspaces.js.map +1 -0
  449. package/dist/schema/projects.d.ts +265 -0
  450. package/dist/schema/projects.d.ts.map +1 -0
  451. package/dist/schema/projects.js +24 -0
  452. package/dist/schema/projects.js.map +1 -0
  453. package/dist/schema/routines.d.ts +993 -0
  454. package/dist/schema/routines.d.ts.map +1 -0
  455. package/dist/schema/routines.js +86 -0
  456. package/dist/schema/routines.js.map +1 -0
  457. package/dist/schema/workspace_operations.d.ts +367 -0
  458. package/dist/schema/workspace_operations.d.ts.map +1 -0
  459. package/dist/schema/workspace_operations.js +35 -0
  460. package/dist/schema/workspace_operations.js.map +1 -0
  461. package/dist/schema/workspace_runtime_services.d.ts +469 -0
  462. package/dist/schema/workspace_runtime_services.d.ts.map +1 -0
  463. package/dist/schema/workspace_runtime_services.js +44 -0
  464. package/dist/schema/workspace_runtime_services.js.map +1 -0
  465. package/dist/seed.d.ts +2 -0
  466. package/dist/seed.d.ts.map +1 -0
  467. package/dist/seed.js +91 -0
  468. package/dist/seed.js.map +1 -0
  469. package/dist/test-embedded-postgres.d.ts +11 -0
  470. package/dist/test-embedded-postgres.d.ts.map +1 -0
  471. package/dist/test-embedded-postgres.js +110 -0
  472. package/dist/test-embedded-postgres.js.map +1 -0
  473. package/package.json +60 -0
@@ -0,0 +1,169 @@
1
+ /**
2
+ * `plugin_state` table — scoped key-value storage for plugin workers.
3
+ *
4
+ * Each row stores a single JSON value identified by
5
+ * `(plugin_id, scope_kind, scope_id, namespace, state_key)`. Plugins use
6
+ * this table through `ctx.state.get()`, `ctx.state.set()`, and
7
+ * `ctx.state.delete()` in the SDK.
8
+ *
9
+ * Scope kinds determine the granularity of isolation:
10
+ * - `instance` — one value shared across the whole FideliOS instance
11
+ * - `company` — one value per company
12
+ * - `project` — one value per project
13
+ * - `project_workspace` — one value per project workspace
14
+ * - `agent` — one value per agent
15
+ * - `issue` — one value per issue
16
+ * - `goal` — one value per goal
17
+ * - `run` — one value per agent run
18
+ *
19
+ * The `namespace` column defaults to `"default"` and can be used to
20
+ * logically group keys without polluting the root namespace.
21
+ *
22
+ * @see PLUGIN_SPEC.md §21.3 — `plugin_state`
23
+ */
24
+ export declare const pluginState: import("drizzle-orm/pg-core").PgTableWithColumns<{
25
+ name: "plugin_state";
26
+ schema: undefined;
27
+ columns: {
28
+ id: import("drizzle-orm/pg-core").PgColumn<{
29
+ name: "id";
30
+ tableName: "plugin_state";
31
+ dataType: "string";
32
+ columnType: "PgUUID";
33
+ data: string;
34
+ driverParam: string;
35
+ notNull: true;
36
+ hasDefault: true;
37
+ isPrimaryKey: true;
38
+ isAutoincrement: false;
39
+ hasRuntimeDefault: false;
40
+ enumValues: undefined;
41
+ baseColumn: never;
42
+ identity: undefined;
43
+ generated: undefined;
44
+ }, {}, {}>;
45
+ pluginId: import("drizzle-orm/pg-core").PgColumn<{
46
+ name: "plugin_id";
47
+ tableName: "plugin_state";
48
+ dataType: "string";
49
+ columnType: "PgUUID";
50
+ data: string;
51
+ driverParam: string;
52
+ notNull: true;
53
+ hasDefault: false;
54
+ isPrimaryKey: false;
55
+ isAutoincrement: false;
56
+ hasRuntimeDefault: false;
57
+ enumValues: undefined;
58
+ baseColumn: never;
59
+ identity: undefined;
60
+ generated: undefined;
61
+ }, {}, {}>;
62
+ scopeKind: import("drizzle-orm/pg-core").PgColumn<{
63
+ name: "scope_kind";
64
+ tableName: "plugin_state";
65
+ dataType: "string";
66
+ columnType: "PgText";
67
+ data: "company" | "agent" | "project" | "issue" | "goal" | "run" | "instance" | "project_workspace";
68
+ driverParam: string;
69
+ notNull: true;
70
+ hasDefault: false;
71
+ isPrimaryKey: false;
72
+ isAutoincrement: false;
73
+ hasRuntimeDefault: false;
74
+ enumValues: [string, ...string[]];
75
+ baseColumn: never;
76
+ identity: undefined;
77
+ generated: undefined;
78
+ }, {}, {
79
+ $type: "company" | "agent" | "project" | "issue" | "goal" | "run" | "instance" | "project_workspace";
80
+ }>;
81
+ scopeId: import("drizzle-orm/pg-core").PgColumn<{
82
+ name: "scope_id";
83
+ tableName: "plugin_state";
84
+ dataType: "string";
85
+ columnType: "PgText";
86
+ data: string;
87
+ driverParam: string;
88
+ notNull: false;
89
+ hasDefault: false;
90
+ isPrimaryKey: false;
91
+ isAutoincrement: false;
92
+ hasRuntimeDefault: false;
93
+ enumValues: [string, ...string[]];
94
+ baseColumn: never;
95
+ identity: undefined;
96
+ generated: undefined;
97
+ }, {}, {}>;
98
+ namespace: import("drizzle-orm/pg-core").PgColumn<{
99
+ name: "namespace";
100
+ tableName: "plugin_state";
101
+ dataType: "string";
102
+ columnType: "PgText";
103
+ data: string;
104
+ driverParam: string;
105
+ notNull: true;
106
+ hasDefault: true;
107
+ isPrimaryKey: false;
108
+ isAutoincrement: false;
109
+ hasRuntimeDefault: false;
110
+ enumValues: [string, ...string[]];
111
+ baseColumn: never;
112
+ identity: undefined;
113
+ generated: undefined;
114
+ }, {}, {}>;
115
+ stateKey: import("drizzle-orm/pg-core").PgColumn<{
116
+ name: "state_key";
117
+ tableName: "plugin_state";
118
+ dataType: "string";
119
+ columnType: "PgText";
120
+ data: string;
121
+ driverParam: string;
122
+ notNull: true;
123
+ hasDefault: false;
124
+ isPrimaryKey: false;
125
+ isAutoincrement: false;
126
+ hasRuntimeDefault: false;
127
+ enumValues: [string, ...string[]];
128
+ baseColumn: never;
129
+ identity: undefined;
130
+ generated: undefined;
131
+ }, {}, {}>;
132
+ valueJson: import("drizzle-orm/pg-core").PgColumn<{
133
+ name: "value_json";
134
+ tableName: "plugin_state";
135
+ dataType: "json";
136
+ columnType: "PgJsonb";
137
+ data: unknown;
138
+ driverParam: unknown;
139
+ notNull: true;
140
+ hasDefault: false;
141
+ isPrimaryKey: false;
142
+ isAutoincrement: false;
143
+ hasRuntimeDefault: false;
144
+ enumValues: undefined;
145
+ baseColumn: never;
146
+ identity: undefined;
147
+ generated: undefined;
148
+ }, {}, {}>;
149
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
150
+ name: "updated_at";
151
+ tableName: "plugin_state";
152
+ dataType: "date";
153
+ columnType: "PgTimestamp";
154
+ data: Date;
155
+ driverParam: string;
156
+ notNull: true;
157
+ hasDefault: true;
158
+ isPrimaryKey: false;
159
+ isAutoincrement: false;
160
+ hasRuntimeDefault: false;
161
+ enumValues: undefined;
162
+ baseColumn: never;
163
+ identity: undefined;
164
+ generated: undefined;
165
+ }, {}, {}>;
166
+ };
167
+ dialect: "pg";
168
+ }>;
169
+ //# sourceMappingURL=plugin_state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin_state.d.ts","sourceRoot":"","sources":["../../src/schema/plugin_state.ts"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsDvB,CAAC"}
@@ -0,0 +1,68 @@
1
+ import { pgTable, uuid, text, timestamp, jsonb, index, unique, } from "drizzle-orm/pg-core";
2
+ import { plugins } from "./plugins.js";
3
+ /**
4
+ * `plugin_state` table — scoped key-value storage for plugin workers.
5
+ *
6
+ * Each row stores a single JSON value identified by
7
+ * `(plugin_id, scope_kind, scope_id, namespace, state_key)`. Plugins use
8
+ * this table through `ctx.state.get()`, `ctx.state.set()`, and
9
+ * `ctx.state.delete()` in the SDK.
10
+ *
11
+ * Scope kinds determine the granularity of isolation:
12
+ * - `instance` — one value shared across the whole FideliOS instance
13
+ * - `company` — one value per company
14
+ * - `project` — one value per project
15
+ * - `project_workspace` — one value per project workspace
16
+ * - `agent` — one value per agent
17
+ * - `issue` — one value per issue
18
+ * - `goal` — one value per goal
19
+ * - `run` — one value per agent run
20
+ *
21
+ * The `namespace` column defaults to `"default"` and can be used to
22
+ * logically group keys without polluting the root namespace.
23
+ *
24
+ * @see PLUGIN_SPEC.md §21.3 — `plugin_state`
25
+ */
26
+ export const pluginState = pgTable("plugin_state", {
27
+ id: uuid("id").primaryKey().defaultRandom(),
28
+ /** FK to the owning plugin. Cascades on delete. */
29
+ pluginId: uuid("plugin_id")
30
+ .notNull()
31
+ .references(() => plugins.id, { onDelete: "cascade" }),
32
+ /** Granularity of the scope (e.g. `"instance"`, `"project"`, `"issue"`). */
33
+ scopeKind: text("scope_kind").$type().notNull(),
34
+ /**
35
+ * UUID or text identifier for the scoped object.
36
+ * Null for `instance` scope (which has no associated entity).
37
+ */
38
+ scopeId: text("scope_id"),
39
+ /**
40
+ * Sub-namespace to avoid key collisions within a scope.
41
+ * Defaults to `"default"` if the plugin does not specify one.
42
+ */
43
+ namespace: text("namespace").notNull().default("default"),
44
+ /** The key identifying this state entry within the namespace. */
45
+ stateKey: text("state_key").notNull(),
46
+ /** JSON-serializable value stored by the plugin. */
47
+ valueJson: jsonb("value_json").notNull(),
48
+ /** Timestamp of the most recent write. */
49
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
50
+ }, (table) => ({
51
+ /**
52
+ * Unique constraint enforces that there is at most one value per
53
+ * (plugin, scope kind, scope id, namespace, key) tuple.
54
+ *
55
+ * `nullsNotDistinct()` is required so that `scope_id IS NULL` entries
56
+ * (used by `instance` scope) are treated as equal by PostgreSQL rather
57
+ * than as distinct nulls — otherwise the upsert target in `set()` would
58
+ * fail to match existing rows and create duplicates.
59
+ *
60
+ * Requires PostgreSQL 15+.
61
+ */
62
+ uniqueEntry: unique("plugin_state_unique_entry_idx")
63
+ .on(table.pluginId, table.scopeKind, table.scopeId, table.namespace, table.stateKey)
64
+ .nullsNotDistinct(),
65
+ /** Speed up lookups by plugin + scope kind (most common access pattern). */
66
+ pluginScopeIdx: index("plugin_state_plugin_scope_idx").on(table.pluginId, table.scopeKind),
67
+ }));
68
+ //# sourceMappingURL=plugin_state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin_state.js","sourceRoot":"","sources":["../../src/schema/plugin_state.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,KAAK,EACL,KAAK,EACL,MAAM,GACP,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAChC,cAAc,EACd;IACE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC,aAAa,EAAE;IAC3C,mDAAmD;IACnD,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC;SACxB,OAAO,EAAE;SACT,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACxD,4EAA4E;IAC5E,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,KAAK,EAAwB,CAAC,OAAO,EAAE;IACrE;;;OAGG;IACH,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC;IACzB;;;OAGG;IACH,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC;IACzD,iEAAiE;IACjE,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE;IACrC,oDAAoD;IACpD,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IACxC,0CAA0C;IAC1C,SAAS,EAAE,SAAS,CAAC,YAAY,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE;CAClF,EACD,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACV;;;;;;;;;;OAUG;IACH,WAAW,EAAE,MAAM,CAAC,+BAA+B,CAAC;SACjD,EAAE,CACD,KAAK,CAAC,QAAQ,EACd,KAAK,CAAC,SAAS,EACf,KAAK,CAAC,OAAO,EACb,KAAK,CAAC,SAAS,EACf,KAAK,CAAC,QAAQ,CACf;SACA,gBAAgB,EAAE;IACrB,4EAA4E;IAC5E,cAAc,EAAE,KAAK,CAAC,+BAA+B,CAAC,CAAC,EAAE,CACvD,KAAK,CAAC,QAAQ,EACd,KAAK,CAAC,SAAS,CAChB;CACF,CAAC,CACH,CAAC"}
@@ -0,0 +1,239 @@
1
+ /**
2
+ * `plugin_webhook_deliveries` table — inbound webhook delivery history for plugins.
3
+ *
4
+ * When an external system sends an HTTP POST to a plugin's registered webhook
5
+ * endpoint (e.g. `/api/plugins/:pluginKey/webhooks/:webhookKey`), the server
6
+ * creates a row in this table before dispatching the payload to the plugin
7
+ * worker. This provides an auditable log of every delivery attempt.
8
+ *
9
+ * The `webhook_key` matches the key declared in the plugin manifest's
10
+ * `webhooks` array. `external_id` is an optional identifier supplied by the
11
+ * remote system (e.g. a GitHub delivery GUID) that can be used to detect
12
+ * and reject duplicate deliveries.
13
+ *
14
+ * Status values:
15
+ * - `pending` — received but not yet dispatched to the worker
16
+ * - `processing` — currently being handled by the plugin worker
17
+ * - `succeeded` — worker processed the payload successfully
18
+ * - `failed` — worker returned an error or timed out
19
+ *
20
+ * @see PLUGIN_SPEC.md §21.3 — `plugin_webhook_deliveries`
21
+ */
22
+ export declare const pluginWebhookDeliveries: import("drizzle-orm/pg-core").PgTableWithColumns<{
23
+ name: "plugin_webhook_deliveries";
24
+ schema: undefined;
25
+ columns: {
26
+ id: import("drizzle-orm/pg-core").PgColumn<{
27
+ name: "id";
28
+ tableName: "plugin_webhook_deliveries";
29
+ dataType: "string";
30
+ columnType: "PgUUID";
31
+ data: string;
32
+ driverParam: string;
33
+ notNull: true;
34
+ hasDefault: true;
35
+ isPrimaryKey: true;
36
+ isAutoincrement: false;
37
+ hasRuntimeDefault: false;
38
+ enumValues: undefined;
39
+ baseColumn: never;
40
+ identity: undefined;
41
+ generated: undefined;
42
+ }, {}, {}>;
43
+ pluginId: import("drizzle-orm/pg-core").PgColumn<{
44
+ name: "plugin_id";
45
+ tableName: "plugin_webhook_deliveries";
46
+ dataType: "string";
47
+ columnType: "PgUUID";
48
+ data: string;
49
+ driverParam: string;
50
+ notNull: true;
51
+ hasDefault: false;
52
+ isPrimaryKey: false;
53
+ isAutoincrement: false;
54
+ hasRuntimeDefault: false;
55
+ enumValues: undefined;
56
+ baseColumn: never;
57
+ identity: undefined;
58
+ generated: undefined;
59
+ }, {}, {}>;
60
+ webhookKey: import("drizzle-orm/pg-core").PgColumn<{
61
+ name: "webhook_key";
62
+ tableName: "plugin_webhook_deliveries";
63
+ dataType: "string";
64
+ columnType: "PgText";
65
+ data: string;
66
+ driverParam: string;
67
+ notNull: true;
68
+ hasDefault: false;
69
+ isPrimaryKey: false;
70
+ isAutoincrement: false;
71
+ hasRuntimeDefault: false;
72
+ enumValues: [string, ...string[]];
73
+ baseColumn: never;
74
+ identity: undefined;
75
+ generated: undefined;
76
+ }, {}, {}>;
77
+ externalId: import("drizzle-orm/pg-core").PgColumn<{
78
+ name: "external_id";
79
+ tableName: "plugin_webhook_deliveries";
80
+ dataType: "string";
81
+ columnType: "PgText";
82
+ data: string;
83
+ driverParam: string;
84
+ notNull: false;
85
+ hasDefault: false;
86
+ isPrimaryKey: false;
87
+ isAutoincrement: false;
88
+ hasRuntimeDefault: false;
89
+ enumValues: [string, ...string[]];
90
+ baseColumn: never;
91
+ identity: undefined;
92
+ generated: undefined;
93
+ }, {}, {}>;
94
+ status: import("drizzle-orm/pg-core").PgColumn<{
95
+ name: "status";
96
+ tableName: "plugin_webhook_deliveries";
97
+ dataType: "string";
98
+ columnType: "PgText";
99
+ data: "pending" | "failed" | "success";
100
+ driverParam: string;
101
+ notNull: true;
102
+ hasDefault: true;
103
+ isPrimaryKey: false;
104
+ isAutoincrement: false;
105
+ hasRuntimeDefault: false;
106
+ enumValues: [string, ...string[]];
107
+ baseColumn: never;
108
+ identity: undefined;
109
+ generated: undefined;
110
+ }, {}, {
111
+ $type: "pending" | "failed" | "success";
112
+ }>;
113
+ durationMs: import("drizzle-orm/pg-core").PgColumn<{
114
+ name: "duration_ms";
115
+ tableName: "plugin_webhook_deliveries";
116
+ dataType: "number";
117
+ columnType: "PgInteger";
118
+ data: number;
119
+ driverParam: string | number;
120
+ notNull: false;
121
+ hasDefault: false;
122
+ isPrimaryKey: false;
123
+ isAutoincrement: false;
124
+ hasRuntimeDefault: false;
125
+ enumValues: undefined;
126
+ baseColumn: never;
127
+ identity: undefined;
128
+ generated: undefined;
129
+ }, {}, {}>;
130
+ error: import("drizzle-orm/pg-core").PgColumn<{
131
+ name: "error";
132
+ tableName: "plugin_webhook_deliveries";
133
+ dataType: "string";
134
+ columnType: "PgText";
135
+ data: string;
136
+ driverParam: string;
137
+ notNull: false;
138
+ hasDefault: false;
139
+ isPrimaryKey: false;
140
+ isAutoincrement: false;
141
+ hasRuntimeDefault: false;
142
+ enumValues: [string, ...string[]];
143
+ baseColumn: never;
144
+ identity: undefined;
145
+ generated: undefined;
146
+ }, {}, {}>;
147
+ payload: import("drizzle-orm/pg-core").PgColumn<{
148
+ name: "payload";
149
+ tableName: "plugin_webhook_deliveries";
150
+ dataType: "json";
151
+ columnType: "PgJsonb";
152
+ data: Record<string, unknown>;
153
+ driverParam: unknown;
154
+ notNull: true;
155
+ hasDefault: false;
156
+ isPrimaryKey: false;
157
+ isAutoincrement: false;
158
+ hasRuntimeDefault: false;
159
+ enumValues: undefined;
160
+ baseColumn: never;
161
+ identity: undefined;
162
+ generated: undefined;
163
+ }, {}, {
164
+ $type: Record<string, unknown>;
165
+ }>;
166
+ headers: import("drizzle-orm/pg-core").PgColumn<{
167
+ name: "headers";
168
+ tableName: "plugin_webhook_deliveries";
169
+ dataType: "json";
170
+ columnType: "PgJsonb";
171
+ data: Record<string, string>;
172
+ driverParam: unknown;
173
+ notNull: true;
174
+ hasDefault: true;
175
+ isPrimaryKey: false;
176
+ isAutoincrement: false;
177
+ hasRuntimeDefault: false;
178
+ enumValues: undefined;
179
+ baseColumn: never;
180
+ identity: undefined;
181
+ generated: undefined;
182
+ }, {}, {
183
+ $type: Record<string, string>;
184
+ }>;
185
+ startedAt: import("drizzle-orm/pg-core").PgColumn<{
186
+ name: "started_at";
187
+ tableName: "plugin_webhook_deliveries";
188
+ dataType: "date";
189
+ columnType: "PgTimestamp";
190
+ data: Date;
191
+ driverParam: string;
192
+ notNull: false;
193
+ hasDefault: false;
194
+ isPrimaryKey: false;
195
+ isAutoincrement: false;
196
+ hasRuntimeDefault: false;
197
+ enumValues: undefined;
198
+ baseColumn: never;
199
+ identity: undefined;
200
+ generated: undefined;
201
+ }, {}, {}>;
202
+ finishedAt: import("drizzle-orm/pg-core").PgColumn<{
203
+ name: "finished_at";
204
+ tableName: "plugin_webhook_deliveries";
205
+ dataType: "date";
206
+ columnType: "PgTimestamp";
207
+ data: Date;
208
+ driverParam: string;
209
+ notNull: false;
210
+ hasDefault: false;
211
+ isPrimaryKey: false;
212
+ isAutoincrement: false;
213
+ hasRuntimeDefault: false;
214
+ enumValues: undefined;
215
+ baseColumn: never;
216
+ identity: undefined;
217
+ generated: undefined;
218
+ }, {}, {}>;
219
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
220
+ name: "created_at";
221
+ tableName: "plugin_webhook_deliveries";
222
+ dataType: "date";
223
+ columnType: "PgTimestamp";
224
+ data: Date;
225
+ driverParam: string;
226
+ notNull: true;
227
+ hasDefault: true;
228
+ isPrimaryKey: false;
229
+ isAutoincrement: false;
230
+ hasRuntimeDefault: false;
231
+ enumValues: undefined;
232
+ baseColumn: never;
233
+ identity: undefined;
234
+ generated: undefined;
235
+ }, {}, {}>;
236
+ };
237
+ dialect: "pg";
238
+ }>;
239
+ //# sourceMappingURL=plugin_webhooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin_webhooks.d.ts","sourceRoot":"","sources":["../../src/schema/plugin_webhooks.ts"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BnC,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { pgTable, uuid, text, integer, timestamp, jsonb, index, } from "drizzle-orm/pg-core";
2
+ import { plugins } from "./plugins.js";
3
+ /**
4
+ * `plugin_webhook_deliveries` table — inbound webhook delivery history for plugins.
5
+ *
6
+ * When an external system sends an HTTP POST to a plugin's registered webhook
7
+ * endpoint (e.g. `/api/plugins/:pluginKey/webhooks/:webhookKey`), the server
8
+ * creates a row in this table before dispatching the payload to the plugin
9
+ * worker. This provides an auditable log of every delivery attempt.
10
+ *
11
+ * The `webhook_key` matches the key declared in the plugin manifest's
12
+ * `webhooks` array. `external_id` is an optional identifier supplied by the
13
+ * remote system (e.g. a GitHub delivery GUID) that can be used to detect
14
+ * and reject duplicate deliveries.
15
+ *
16
+ * Status values:
17
+ * - `pending` — received but not yet dispatched to the worker
18
+ * - `processing` — currently being handled by the plugin worker
19
+ * - `succeeded` — worker processed the payload successfully
20
+ * - `failed` — worker returned an error or timed out
21
+ *
22
+ * @see PLUGIN_SPEC.md §21.3 — `plugin_webhook_deliveries`
23
+ */
24
+ export const pluginWebhookDeliveries = pgTable("plugin_webhook_deliveries", {
25
+ id: uuid("id").primaryKey().defaultRandom(),
26
+ /** FK to the owning plugin. Cascades on delete. */
27
+ pluginId: uuid("plugin_id")
28
+ .notNull()
29
+ .references(() => plugins.id, { onDelete: "cascade" }),
30
+ /** Identifier matching the key in the plugin manifest's `webhooks` array. */
31
+ webhookKey: text("webhook_key").notNull(),
32
+ /** Optional de-duplication ID provided by the external system. */
33
+ externalId: text("external_id"),
34
+ /** Current delivery state. */
35
+ status: text("status").$type().notNull().default("pending"),
36
+ /** Wall-clock processing duration in milliseconds. Null until delivery finishes. */
37
+ durationMs: integer("duration_ms"),
38
+ /** Error message if `status === "failed"`. */
39
+ error: text("error"),
40
+ /** Raw JSON body of the inbound HTTP request. */
41
+ payload: jsonb("payload").$type().notNull(),
42
+ /** Relevant HTTP headers from the inbound request (e.g. signature headers). */
43
+ headers: jsonb("headers").$type().notNull().default({}),
44
+ startedAt: timestamp("started_at", { withTimezone: true }),
45
+ finishedAt: timestamp("finished_at", { withTimezone: true }),
46
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
47
+ }, (table) => ({
48
+ pluginIdx: index("plugin_webhook_deliveries_plugin_idx").on(table.pluginId),
49
+ statusIdx: index("plugin_webhook_deliveries_status_idx").on(table.status),
50
+ keyIdx: index("plugin_webhook_deliveries_key_idx").on(table.webhookKey),
51
+ }));
52
+ //# sourceMappingURL=plugin_webhooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin_webhooks.js","sourceRoot":"","sources":["../../src/schema/plugin_webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,SAAS,EACT,KAAK,EACL,KAAK,GACN,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,OAAO,CAC5C,2BAA2B,EAC3B;IACE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC,aAAa,EAAE;IAC3C,mDAAmD;IACnD,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC;SACxB,OAAO,EAAE;SACT,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACxD,6EAA6E;IAC7E,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE;IACzC,kEAAkE;IAClE,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC;IAC/B,8BAA8B;IAC9B,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,EAA+B,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC;IACxF,oFAAoF;IACpF,UAAU,EAAE,OAAO,CAAC,aAAa,CAAC;IAClC,8CAA8C;IAC9C,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC;IACpB,iDAAiD;IACjD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,KAAK,EAA2B,CAAC,OAAO,EAAE;IACpE,+EAA+E;IAC/E,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,KAAK,EAA0B,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC/E,SAAS,EAAE,SAAS,CAAC,YAAY,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;IAC1D,UAAU,EAAE,SAAS,CAAC,aAAa,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;IAC5D,SAAS,EAAE,SAAS,CAAC,YAAY,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE;CAClF,EACD,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACV,SAAS,EAAE,KAAK,CAAC,sCAAsC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC3E,SAAS,EAAE,KAAK,CAAC,sCAAsC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC;IACzE,MAAM,EAAE,KAAK,CAAC,mCAAmC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC;CACxE,CAAC,CACH,CAAC"}