happy2 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (373) hide show
  1. package/README.md +82 -0
  2. package/package.json +74 -0
  3. package/packages/happy2-server/Dockerfile +18 -0
  4. package/packages/happy2-server/README.md +418 -0
  5. package/packages/happy2-server/bin/happy2.js +3 -0
  6. package/packages/happy2-server/dist/cli.d.ts +3 -0
  7. package/packages/happy2-server/dist/cli.d.ts.map +1 -0
  8. package/packages/happy2-server/dist/cli.js +44 -0
  9. package/packages/happy2-server/dist/cli.js.map +1 -0
  10. package/packages/happy2-server/dist/index.d.ts +24 -0
  11. package/packages/happy2-server/dist/index.d.ts.map +1 -0
  12. package/packages/happy2-server/dist/index.js +22 -0
  13. package/packages/happy2-server/dist/index.js.map +1 -0
  14. package/packages/happy2-server/dist/modules/agents/builtin-images.d.ts +8 -0
  15. package/packages/happy2-server/dist/modules/agents/builtin-images.d.ts.map +1 -0
  16. package/packages/happy2-server/dist/modules/agents/builtin-images.js +283 -0
  17. package/packages/happy2-server/dist/modules/agents/builtin-images.js.map +1 -0
  18. package/packages/happy2-server/dist/modules/agents/command.d.ts +3 -0
  19. package/packages/happy2-server/dist/modules/agents/command.d.ts.map +1 -0
  20. package/packages/happy2-server/dist/modules/agents/command.js +7 -0
  21. package/packages/happy2-server/dist/modules/agents/command.js.map +1 -0
  22. package/packages/happy2-server/dist/modules/agents/daemon.d.ts +106 -0
  23. package/packages/happy2-server/dist/modules/agents/daemon.d.ts.map +1 -0
  24. package/packages/happy2-server/dist/modules/agents/daemon.js +522 -0
  25. package/packages/happy2-server/dist/modules/agents/daemon.js.map +1 -0
  26. package/packages/happy2-server/dist/modules/agents/docker.d.ts +51 -0
  27. package/packages/happy2-server/dist/modules/agents/docker.d.ts.map +1 -0
  28. package/packages/happy2-server/dist/modules/agents/docker.js +256 -0
  29. package/packages/happy2-server/dist/modules/agents/docker.js.map +1 -0
  30. package/packages/happy2-server/dist/modules/agents/docker.test.d.ts +2 -0
  31. package/packages/happy2-server/dist/modules/agents/docker.test.d.ts.map +1 -0
  32. package/packages/happy2-server/dist/modules/agents/docker.test.js +155 -0
  33. package/packages/happy2-server/dist/modules/agents/docker.test.js.map +1 -0
  34. package/packages/happy2-server/dist/modules/agents/index.d.ts +5 -0
  35. package/packages/happy2-server/dist/modules/agents/index.d.ts.map +1 -0
  36. package/packages/happy2-server/dist/modules/agents/index.js +4 -0
  37. package/packages/happy2-server/dist/modules/agents/index.js.map +1 -0
  38. package/packages/happy2-server/dist/modules/agents/service.d.ts +140 -0
  39. package/packages/happy2-server/dist/modules/agents/service.d.ts.map +1 -0
  40. package/packages/happy2-server/dist/modules/agents/service.js +1283 -0
  41. package/packages/happy2-server/dist/modules/agents/service.js.map +1 -0
  42. package/packages/happy2-server/dist/modules/auth/cloudflare-access.d.ts +15 -0
  43. package/packages/happy2-server/dist/modules/auth/cloudflare-access.d.ts.map +1 -0
  44. package/packages/happy2-server/dist/modules/auth/cloudflare-access.js +49 -0
  45. package/packages/happy2-server/dist/modules/auth/cloudflare-access.js.map +1 -0
  46. package/packages/happy2-server/dist/modules/auth/crypto.d.ts +4 -0
  47. package/packages/happy2-server/dist/modules/auth/crypto.d.ts.map +1 -0
  48. package/packages/happy2-server/dist/modules/auth/crypto.js +31 -0
  49. package/packages/happy2-server/dist/modules/auth/crypto.js.map +1 -0
  50. package/packages/happy2-server/dist/modules/auth/crypto.test.d.ts +2 -0
  51. package/packages/happy2-server/dist/modules/auth/crypto.test.d.ts.map +1 -0
  52. package/packages/happy2-server/dist/modules/auth/crypto.test.js +11 -0
  53. package/packages/happy2-server/dist/modules/auth/crypto.test.js.map +1 -0
  54. package/packages/happy2-server/dist/modules/auth/email.d.ts +3 -0
  55. package/packages/happy2-server/dist/modules/auth/email.d.ts.map +1 -0
  56. package/packages/happy2-server/dist/modules/auth/email.js +22 -0
  57. package/packages/happy2-server/dist/modules/auth/email.js.map +1 -0
  58. package/packages/happy2-server/dist/modules/auth/metadata.d.ts +5 -0
  59. package/packages/happy2-server/dist/modules/auth/metadata.d.ts.map +1 -0
  60. package/packages/happy2-server/dist/modules/auth/metadata.js +28 -0
  61. package/packages/happy2-server/dist/modules/auth/metadata.js.map +1 -0
  62. package/packages/happy2-server/dist/modules/auth/metadata.test.d.ts +2 -0
  63. package/packages/happy2-server/dist/modules/auth/metadata.test.d.ts.map +1 -0
  64. package/packages/happy2-server/dist/modules/auth/metadata.test.js +10 -0
  65. package/packages/happy2-server/dist/modules/auth/metadata.test.js.map +1 -0
  66. package/packages/happy2-server/dist/modules/auth/methods.d.ts +10 -0
  67. package/packages/happy2-server/dist/modules/auth/methods.d.ts.map +1 -0
  68. package/packages/happy2-server/dist/modules/auth/methods.js +21 -0
  69. package/packages/happy2-server/dist/modules/auth/methods.js.map +1 -0
  70. package/packages/happy2-server/dist/modules/auth/methods.test.d.ts +2 -0
  71. package/packages/happy2-server/dist/modules/auth/methods.test.d.ts.map +1 -0
  72. package/packages/happy2-server/dist/modules/auth/methods.test.js +16 -0
  73. package/packages/happy2-server/dist/modules/auth/methods.test.js.map +1 -0
  74. package/packages/happy2-server/dist/modules/auth/oidc.d.ts +9 -0
  75. package/packages/happy2-server/dist/modules/auth/oidc.d.ts.map +1 -0
  76. package/packages/happy2-server/dist/modules/auth/oidc.js +68 -0
  77. package/packages/happy2-server/dist/modules/auth/oidc.js.map +1 -0
  78. package/packages/happy2-server/dist/modules/auth/service.d.ts +44 -0
  79. package/packages/happy2-server/dist/modules/auth/service.d.ts.map +1 -0
  80. package/packages/happy2-server/dist/modules/auth/service.js +208 -0
  81. package/packages/happy2-server/dist/modules/auth/service.js.map +1 -0
  82. package/packages/happy2-server/dist/modules/auth/tokens.d.ts +21 -0
  83. package/packages/happy2-server/dist/modules/auth/tokens.d.ts.map +1 -0
  84. package/packages/happy2-server/dist/modules/auth/tokens.js +79 -0
  85. package/packages/happy2-server/dist/modules/auth/tokens.js.map +1 -0
  86. package/packages/happy2-server/dist/modules/automation/repository.d.ts +127 -0
  87. package/packages/happy2-server/dist/modules/automation/repository.d.ts.map +1 -0
  88. package/packages/happy2-server/dist/modules/automation/repository.js +821 -0
  89. package/packages/happy2-server/dist/modules/automation/repository.js.map +1 -0
  90. package/packages/happy2-server/dist/modules/collaboration/repository.d.ts +839 -0
  91. package/packages/happy2-server/dist/modules/collaboration/repository.d.ts.map +1 -0
  92. package/packages/happy2-server/dist/modules/collaboration/repository.js +5795 -0
  93. package/packages/happy2-server/dist/modules/collaboration/repository.js.map +1 -0
  94. package/packages/happy2-server/dist/modules/collaboration/repository.test.d.ts +2 -0
  95. package/packages/happy2-server/dist/modules/collaboration/repository.test.d.ts.map +1 -0
  96. package/packages/happy2-server/dist/modules/collaboration/repository.test.js +620 -0
  97. package/packages/happy2-server/dist/modules/collaboration/repository.test.js.map +1 -0
  98. package/packages/happy2-server/dist/modules/collaboration/types.d.ts +243 -0
  99. package/packages/happy2-server/dist/modules/collaboration/types.d.ts.map +1 -0
  100. package/packages/happy2-server/dist/modules/collaboration/types.js +8 -0
  101. package/packages/happy2-server/dist/modules/collaboration/types.js.map +1 -0
  102. package/packages/happy2-server/dist/modules/config/defaults.d.ts +8 -0
  103. package/packages/happy2-server/dist/modules/config/defaults.d.ts.map +1 -0
  104. package/packages/happy2-server/dist/modules/config/defaults.js +70 -0
  105. package/packages/happy2-server/dist/modules/config/defaults.js.map +1 -0
  106. package/packages/happy2-server/dist/modules/config/defaults.test.d.ts +2 -0
  107. package/packages/happy2-server/dist/modules/config/defaults.test.d.ts.map +1 -0
  108. package/packages/happy2-server/dist/modules/config/defaults.test.js +27 -0
  109. package/packages/happy2-server/dist/modules/config/defaults.test.js.map +1 -0
  110. package/packages/happy2-server/dist/modules/config/environment.d.ts +4 -0
  111. package/packages/happy2-server/dist/modules/config/environment.d.ts.map +1 -0
  112. package/packages/happy2-server/dist/modules/config/environment.js +92 -0
  113. package/packages/happy2-server/dist/modules/config/environment.js.map +1 -0
  114. package/packages/happy2-server/dist/modules/config/loader.d.ts +5 -0
  115. package/packages/happy2-server/dist/modules/config/loader.d.ts.map +1 -0
  116. package/packages/happy2-server/dist/modules/config/loader.js +251 -0
  117. package/packages/happy2-server/dist/modules/config/loader.js.map +1 -0
  118. package/packages/happy2-server/dist/modules/config/loader.test.d.ts +2 -0
  119. package/packages/happy2-server/dist/modules/config/loader.test.d.ts.map +1 -0
  120. package/packages/happy2-server/dist/modules/config/loader.test.js +108 -0
  121. package/packages/happy2-server/dist/modules/config/loader.test.js.map +1 -0
  122. package/packages/happy2-server/dist/modules/config/paths.d.ts +7 -0
  123. package/packages/happy2-server/dist/modules/config/paths.d.ts.map +1 -0
  124. package/packages/happy2-server/dist/modules/config/paths.js +15 -0
  125. package/packages/happy2-server/dist/modules/config/paths.js.map +1 -0
  126. package/packages/happy2-server/dist/modules/config/paths.test.d.ts +2 -0
  127. package/packages/happy2-server/dist/modules/config/paths.test.d.ts.map +1 -0
  128. package/packages/happy2-server/dist/modules/config/paths.test.js +22 -0
  129. package/packages/happy2-server/dist/modules/config/paths.test.js.map +1 -0
  130. package/packages/happy2-server/dist/modules/config/runtime.d.ts +6 -0
  131. package/packages/happy2-server/dist/modules/config/runtime.d.ts.map +1 -0
  132. package/packages/happy2-server/dist/modules/config/runtime.js +14 -0
  133. package/packages/happy2-server/dist/modules/config/runtime.js.map +1 -0
  134. package/packages/happy2-server/dist/modules/config/type.d.ts +88 -0
  135. package/packages/happy2-server/dist/modules/config/type.d.ts.map +1 -0
  136. package/packages/happy2-server/dist/modules/config/type.js +2 -0
  137. package/packages/happy2-server/dist/modules/config/type.js.map +1 -0
  138. package/packages/happy2-server/dist/modules/database.d.ts +105 -0
  139. package/packages/happy2-server/dist/modules/database.d.ts.map +1 -0
  140. package/packages/happy2-server/dist/modules/database.js +583 -0
  141. package/packages/happy2-server/dist/modules/database.js.map +1 -0
  142. package/packages/happy2-server/dist/modules/drizzle.d.ts +11 -0
  143. package/packages/happy2-server/dist/modules/drizzle.d.ts.map +1 -0
  144. package/packages/happy2-server/dist/modules/drizzle.js +31 -0
  145. package/packages/happy2-server/dist/modules/drizzle.js.map +1 -0
  146. package/packages/happy2-server/dist/modules/files/lock.d.ts +3 -0
  147. package/packages/happy2-server/dist/modules/files/lock.d.ts.map +1 -0
  148. package/packages/happy2-server/dist/modules/files/lock.js +83 -0
  149. package/packages/happy2-server/dist/modules/files/lock.js.map +1 -0
  150. package/packages/happy2-server/dist/modules/files/media.d.ts +18 -0
  151. package/packages/happy2-server/dist/modules/files/media.d.ts.map +1 -0
  152. package/packages/happy2-server/dist/modules/files/media.js +352 -0
  153. package/packages/happy2-server/dist/modules/files/media.js.map +1 -0
  154. package/packages/happy2-server/dist/modules/files/provider.d.ts +130 -0
  155. package/packages/happy2-server/dist/modules/files/provider.d.ts.map +1 -0
  156. package/packages/happy2-server/dist/modules/files/provider.js +448 -0
  157. package/packages/happy2-server/dist/modules/files/provider.js.map +1 -0
  158. package/packages/happy2-server/dist/modules/files/quota.d.ts +58 -0
  159. package/packages/happy2-server/dist/modules/files/quota.d.ts.map +1 -0
  160. package/packages/happy2-server/dist/modules/files/quota.js +180 -0
  161. package/packages/happy2-server/dist/modules/files/quota.js.map +1 -0
  162. package/packages/happy2-server/dist/modules/files/routes.test.d.ts +2 -0
  163. package/packages/happy2-server/dist/modules/files/routes.test.d.ts.map +1 -0
  164. package/packages/happy2-server/dist/modules/files/routes.test.js +163 -0
  165. package/packages/happy2-server/dist/modules/files/routes.test.js.map +1 -0
  166. package/packages/happy2-server/dist/modules/files/scanner.d.ts +27 -0
  167. package/packages/happy2-server/dist/modules/files/scanner.d.ts.map +1 -0
  168. package/packages/happy2-server/dist/modules/files/scanner.js +66 -0
  169. package/packages/happy2-server/dist/modules/files/scanner.js.map +1 -0
  170. package/packages/happy2-server/dist/modules/files/storage.d.ts +95 -0
  171. package/packages/happy2-server/dist/modules/files/storage.d.ts.map +1 -0
  172. package/packages/happy2-server/dist/modules/files/storage.js +855 -0
  173. package/packages/happy2-server/dist/modules/files/storage.js.map +1 -0
  174. package/packages/happy2-server/dist/modules/files/storage.test.d.ts +2 -0
  175. package/packages/happy2-server/dist/modules/files/storage.test.d.ts.map +1 -0
  176. package/packages/happy2-server/dist/modules/files/storage.test.js +170 -0
  177. package/packages/happy2-server/dist/modules/files/storage.test.js.map +1 -0
  178. package/packages/happy2-server/dist/modules/integrations/index.d.ts +6 -0
  179. package/packages/happy2-server/dist/modules/integrations/index.d.ts.map +1 -0
  180. package/packages/happy2-server/dist/modules/integrations/index.js +6 -0
  181. package/packages/happy2-server/dist/modules/integrations/index.js.map +1 -0
  182. package/packages/happy2-server/dist/modules/integrations/repository.d.ts +136 -0
  183. package/packages/happy2-server/dist/modules/integrations/repository.d.ts.map +1 -0
  184. package/packages/happy2-server/dist/modules/integrations/repository.js +1229 -0
  185. package/packages/happy2-server/dist/modules/integrations/repository.js.map +1 -0
  186. package/packages/happy2-server/dist/modules/integrations/repository.test.d.ts +2 -0
  187. package/packages/happy2-server/dist/modules/integrations/repository.test.d.ts.map +1 -0
  188. package/packages/happy2-server/dist/modules/integrations/repository.test.js +345 -0
  189. package/packages/happy2-server/dist/modules/integrations/repository.test.js.map +1 -0
  190. package/packages/happy2-server/dist/modules/integrations/routes.test.d.ts +2 -0
  191. package/packages/happy2-server/dist/modules/integrations/routes.test.d.ts.map +1 -0
  192. package/packages/happy2-server/dist/modules/integrations/routes.test.js +161 -0
  193. package/packages/happy2-server/dist/modules/integrations/routes.test.js.map +1 -0
  194. package/packages/happy2-server/dist/modules/integrations/secrets.d.ts +19 -0
  195. package/packages/happy2-server/dist/modules/integrations/secrets.d.ts.map +1 -0
  196. package/packages/happy2-server/dist/modules/integrations/secrets.js +69 -0
  197. package/packages/happy2-server/dist/modules/integrations/secrets.js.map +1 -0
  198. package/packages/happy2-server/dist/modules/integrations/ssrf.d.ts +32 -0
  199. package/packages/happy2-server/dist/modules/integrations/ssrf.d.ts.map +1 -0
  200. package/packages/happy2-server/dist/modules/integrations/ssrf.js +185 -0
  201. package/packages/happy2-server/dist/modules/integrations/ssrf.js.map +1 -0
  202. package/packages/happy2-server/dist/modules/integrations/ssrf.test.d.ts +2 -0
  203. package/packages/happy2-server/dist/modules/integrations/ssrf.test.d.ts.map +1 -0
  204. package/packages/happy2-server/dist/modules/integrations/ssrf.test.js +56 -0
  205. package/packages/happy2-server/dist/modules/integrations/ssrf.test.js.map +1 -0
  206. package/packages/happy2-server/dist/modules/integrations/transport.d.ts +21 -0
  207. package/packages/happy2-server/dist/modules/integrations/transport.d.ts.map +1 -0
  208. package/packages/happy2-server/dist/modules/integrations/transport.js +108 -0
  209. package/packages/happy2-server/dist/modules/integrations/transport.js.map +1 -0
  210. package/packages/happy2-server/dist/modules/integrations/transport.test.d.ts +2 -0
  211. package/packages/happy2-server/dist/modules/integrations/transport.test.d.ts.map +1 -0
  212. package/packages/happy2-server/dist/modules/integrations/transport.test.js +66 -0
  213. package/packages/happy2-server/dist/modules/integrations/transport.test.js.map +1 -0
  214. package/packages/happy2-server/dist/modules/integrations/types.d.ts +155 -0
  215. package/packages/happy2-server/dist/modules/integrations/types.d.ts.map +1 -0
  216. package/packages/happy2-server/dist/modules/integrations/types.js +26 -0
  217. package/packages/happy2-server/dist/modules/integrations/types.js.map +1 -0
  218. package/packages/happy2-server/dist/modules/operations/export-worker.d.ts +16 -0
  219. package/packages/happy2-server/dist/modules/operations/export-worker.d.ts.map +1 -0
  220. package/packages/happy2-server/dist/modules/operations/export-worker.js +56 -0
  221. package/packages/happy2-server/dist/modules/operations/export-worker.js.map +1 -0
  222. package/packages/happy2-server/dist/modules/operations/repository.d.ts +215 -0
  223. package/packages/happy2-server/dist/modules/operations/repository.d.ts.map +1 -0
  224. package/packages/happy2-server/dist/modules/operations/repository.js +2011 -0
  225. package/packages/happy2-server/dist/modules/operations/repository.js.map +1 -0
  226. package/packages/happy2-server/dist/modules/operations/repository.test.d.ts +2 -0
  227. package/packages/happy2-server/dist/modules/operations/repository.test.d.ts.map +1 -0
  228. package/packages/happy2-server/dist/modules/operations/repository.test.js +610 -0
  229. package/packages/happy2-server/dist/modules/operations/repository.test.js.map +1 -0
  230. package/packages/happy2-server/dist/modules/operations/types.d.ts +144 -0
  231. package/packages/happy2-server/dist/modules/operations/types.d.ts.map +1 -0
  232. package/packages/happy2-server/dist/modules/operations/types.js +9 -0
  233. package/packages/happy2-server/dist/modules/operations/types.js.map +1 -0
  234. package/packages/happy2-server/dist/modules/realtime/events.d.ts +99 -0
  235. package/packages/happy2-server/dist/modules/realtime/events.d.ts.map +1 -0
  236. package/packages/happy2-server/dist/modules/realtime/events.js +173 -0
  237. package/packages/happy2-server/dist/modules/realtime/events.js.map +1 -0
  238. package/packages/happy2-server/dist/modules/realtime/index.d.ts +4 -0
  239. package/packages/happy2-server/dist/modules/realtime/index.d.ts.map +1 -0
  240. package/packages/happy2-server/dist/modules/realtime/index.js +4 -0
  241. package/packages/happy2-server/dist/modules/realtime/index.js.map +1 -0
  242. package/packages/happy2-server/dist/modules/realtime/local.d.ts +37 -0
  243. package/packages/happy2-server/dist/modules/realtime/local.d.ts.map +1 -0
  244. package/packages/happy2-server/dist/modules/realtime/local.js +181 -0
  245. package/packages/happy2-server/dist/modules/realtime/local.js.map +1 -0
  246. package/packages/happy2-server/dist/modules/realtime/local.test.d.ts +2 -0
  247. package/packages/happy2-server/dist/modules/realtime/local.test.d.ts.map +1 -0
  248. package/packages/happy2-server/dist/modules/realtime/local.test.js +186 -0
  249. package/packages/happy2-server/dist/modules/realtime/local.test.js.map +1 -0
  250. package/packages/happy2-server/dist/modules/realtime/pubsub.d.ts +26 -0
  251. package/packages/happy2-server/dist/modules/realtime/pubsub.d.ts.map +1 -0
  252. package/packages/happy2-server/dist/modules/realtime/pubsub.js +7 -0
  253. package/packages/happy2-server/dist/modules/realtime/pubsub.js.map +1 -0
  254. package/packages/happy2-server/dist/modules/request/database-idempotency.d.ts +15 -0
  255. package/packages/happy2-server/dist/modules/request/database-idempotency.d.ts.map +1 -0
  256. package/packages/happy2-server/dist/modules/request/database-idempotency.js +141 -0
  257. package/packages/happy2-server/dist/modules/request/database-idempotency.js.map +1 -0
  258. package/packages/happy2-server/dist/modules/request/idempotency-hook.d.ts +12 -0
  259. package/packages/happy2-server/dist/modules/request/idempotency-hook.d.ts.map +1 -0
  260. package/packages/happy2-server/dist/modules/request/idempotency-hook.js +98 -0
  261. package/packages/happy2-server/dist/modules/request/idempotency-hook.js.map +1 -0
  262. package/packages/happy2-server/dist/modules/request/idempotency.d.ts +146 -0
  263. package/packages/happy2-server/dist/modules/request/idempotency.d.ts.map +1 -0
  264. package/packages/happy2-server/dist/modules/request/idempotency.js +312 -0
  265. package/packages/happy2-server/dist/modules/request/idempotency.js.map +1 -0
  266. package/packages/happy2-server/dist/modules/request/idempotency.test.d.ts +2 -0
  267. package/packages/happy2-server/dist/modules/request/idempotency.test.d.ts.map +1 -0
  268. package/packages/happy2-server/dist/modules/request/idempotency.test.js +191 -0
  269. package/packages/happy2-server/dist/modules/request/idempotency.test.js.map +1 -0
  270. package/packages/happy2-server/dist/modules/request/index.d.ts +5 -0
  271. package/packages/happy2-server/dist/modules/request/index.d.ts.map +1 -0
  272. package/packages/happy2-server/dist/modules/request/index.js +5 -0
  273. package/packages/happy2-server/dist/modules/request/index.js.map +1 -0
  274. package/packages/happy2-server/dist/modules/request/rate-limit.d.ts +100 -0
  275. package/packages/happy2-server/dist/modules/request/rate-limit.d.ts.map +1 -0
  276. package/packages/happy2-server/dist/modules/request/rate-limit.js +239 -0
  277. package/packages/happy2-server/dist/modules/request/rate-limit.js.map +1 -0
  278. package/packages/happy2-server/dist/modules/request/rate-limit.test.d.ts +2 -0
  279. package/packages/happy2-server/dist/modules/request/rate-limit.test.d.ts.map +1 -0
  280. package/packages/happy2-server/dist/modules/request/rate-limit.test.js +123 -0
  281. package/packages/happy2-server/dist/modules/request/rate-limit.test.js.map +1 -0
  282. package/packages/happy2-server/dist/modules/schema.d.ts +31454 -0
  283. package/packages/happy2-server/dist/modules/schema.d.ts.map +1 -0
  284. package/packages/happy2-server/dist/modules/schema.js +1081 -0
  285. package/packages/happy2-server/dist/modules/schema.js.map +1 -0
  286. package/packages/happy2-server/dist/modules/workspace/index.d.ts +3 -0
  287. package/packages/happy2-server/dist/modules/workspace/index.d.ts.map +1 -0
  288. package/packages/happy2-server/dist/modules/workspace/index.js +3 -0
  289. package/packages/happy2-server/dist/modules/workspace/index.js.map +1 -0
  290. package/packages/happy2-server/dist/modules/workspace/service.d.ts +54 -0
  291. package/packages/happy2-server/dist/modules/workspace/service.d.ts.map +1 -0
  292. package/packages/happy2-server/dist/modules/workspace/service.js +997 -0
  293. package/packages/happy2-server/dist/modules/workspace/service.js.map +1 -0
  294. package/packages/happy2-server/dist/modules/workspace/types.d.ts +58 -0
  295. package/packages/happy2-server/dist/modules/workspace/types.d.ts.map +1 -0
  296. package/packages/happy2-server/dist/modules/workspace/types.js +11 -0
  297. package/packages/happy2-server/dist/modules/workspace/types.js.map +1 -0
  298. package/packages/happy2-server/dist/routes/agents.d.ts +5 -0
  299. package/packages/happy2-server/dist/routes/agents.d.ts.map +1 -0
  300. package/packages/happy2-server/dist/routes/agents.js +225 -0
  301. package/packages/happy2-server/dist/routes/agents.js.map +1 -0
  302. package/packages/happy2-server/dist/routes/auth.d.ts +5 -0
  303. package/packages/happy2-server/dist/routes/auth.d.ts.map +1 -0
  304. package/packages/happy2-server/dist/routes/auth.js +128 -0
  305. package/packages/happy2-server/dist/routes/auth.js.map +1 -0
  306. package/packages/happy2-server/dist/routes/automation.d.ts +6 -0
  307. package/packages/happy2-server/dist/routes/automation.d.ts.map +1 -0
  308. package/packages/happy2-server/dist/routes/automation.js +315 -0
  309. package/packages/happy2-server/dist/routes/automation.js.map +1 -0
  310. package/packages/happy2-server/dist/routes/basic.d.ts +3 -0
  311. package/packages/happy2-server/dist/routes/basic.d.ts.map +1 -0
  312. package/packages/happy2-server/dist/routes/basic.js +5 -0
  313. package/packages/happy2-server/dist/routes/basic.js.map +1 -0
  314. package/packages/happy2-server/dist/routes/collaboration.d.ts +7 -0
  315. package/packages/happy2-server/dist/routes/collaboration.d.ts.map +1 -0
  316. package/packages/happy2-server/dist/routes/collaboration.js +1285 -0
  317. package/packages/happy2-server/dist/routes/collaboration.js.map +1 -0
  318. package/packages/happy2-server/dist/routes/files.d.ts +9 -0
  319. package/packages/happy2-server/dist/routes/files.d.ts.map +1 -0
  320. package/packages/happy2-server/dist/routes/files.js +397 -0
  321. package/packages/happy2-server/dist/routes/files.js.map +1 -0
  322. package/packages/happy2-server/dist/routes/integrations.d.ts +6 -0
  323. package/packages/happy2-server/dist/routes/integrations.d.ts.map +1 -0
  324. package/packages/happy2-server/dist/routes/integrations.js +486 -0
  325. package/packages/happy2-server/dist/routes/integrations.js.map +1 -0
  326. package/packages/happy2-server/dist/routes/operations.d.ts +5 -0
  327. package/packages/happy2-server/dist/routes/operations.d.ts.map +1 -0
  328. package/packages/happy2-server/dist/routes/operations.js +588 -0
  329. package/packages/happy2-server/dist/routes/operations.js.map +1 -0
  330. package/packages/happy2-server/dist/routes/operations.test.d.ts +2 -0
  331. package/packages/happy2-server/dist/routes/operations.test.d.ts.map +1 -0
  332. package/packages/happy2-server/dist/routes/operations.test.js +106 -0
  333. package/packages/happy2-server/dist/routes/operations.test.js.map +1 -0
  334. package/packages/happy2-server/dist/routes/sync.d.ts +6 -0
  335. package/packages/happy2-server/dist/routes/sync.d.ts.map +1 -0
  336. package/packages/happy2-server/dist/routes/sync.js +549 -0
  337. package/packages/happy2-server/dist/routes/sync.js.map +1 -0
  338. package/packages/happy2-server/dist/routes/workspace.d.ts +5 -0
  339. package/packages/happy2-server/dist/routes/workspace.d.ts.map +1 -0
  340. package/packages/happy2-server/dist/routes/workspace.js +240 -0
  341. package/packages/happy2-server/dist/routes/workspace.js.map +1 -0
  342. package/packages/happy2-server/dist/runner.d.ts +3 -0
  343. package/packages/happy2-server/dist/runner.d.ts.map +1 -0
  344. package/packages/happy2-server/dist/runner.js +30 -0
  345. package/packages/happy2-server/dist/runner.js.map +1 -0
  346. package/packages/happy2-server/dist/server.d.ts +32 -0
  347. package/packages/happy2-server/dist/server.d.ts.map +1 -0
  348. package/packages/happy2-server/dist/server.js +284 -0
  349. package/packages/happy2-server/dist/server.js.map +1 -0
  350. package/packages/happy2-server/dist/standalone.d.ts +13 -0
  351. package/packages/happy2-server/dist/standalone.d.ts.map +1 -0
  352. package/packages/happy2-server/dist/standalone.js +99 -0
  353. package/packages/happy2-server/dist/standalone.js.map +1 -0
  354. package/packages/happy2-server/dist/web/assets/figtree-latin-wght-normal-D_ZTVpCC.woff2 +0 -0
  355. package/packages/happy2-server/dist/web/assets/happy-otter-Q2O_g-DT.png +0 -0
  356. package/packages/happy2-server/dist/web/assets/index-COvbX8JP.css +2 -0
  357. package/packages/happy2-server/dist/web/assets/index-DdpugxMO.js +57 -0
  358. package/packages/happy2-server/dist/web/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  359. package/packages/happy2-server/dist/web/assets/onboarding-CRUpq9xl.png +0 -0
  360. package/packages/happy2-server/dist/web/index.html +13 -0
  361. package/packages/happy2-server/drizzle/0000_initial.sql +13 -0
  362. package/packages/happy2-server/drizzle/0001_accounts_profiles_files.sql +42 -0
  363. package/packages/happy2-server/drizzle/0002_file_visibility_and_uploader.sql +5 -0
  364. package/packages/happy2-server/drizzle/0003_collaboration.sql +565 -0
  365. package/packages/happy2-server/drizzle/0004_collaboration_expansion.sql +1099 -0
  366. package/packages/happy2-server/drizzle/0005_ai_agents.sql +85 -0
  367. package/packages/happy2-server/drizzle/0006_rig_global_event_queue.sql +10 -0
  368. package/packages/happy2-server/drizzle/0007_rename_server_identity.sql +3 -0
  369. package/packages/happy2-server/drizzle/0008_agent_message_streaming.sql +47 -0
  370. package/packages/happy2-server/drizzle/0009_chat_workspace_binding_lookup.sql +2 -0
  371. package/packages/happy2-server/drizzle/0010_rig_secret_assignments.sql +21 -0
  372. package/packages/happy2-server/drizzle/meta/_journal.json +83 -0
  373. package/packages/happy2-server/happy2.example.toml +104 -0
@@ -0,0 +1,839 @@
1
+ import { type Client } from "@libsql/client";
2
+ import type { FileKind } from "../database.js";
3
+ import { type ChatBookmarkSummary, type ChatPinSummary, type ChatRole, type ChatSummary, type CallSummary, type AdminUserSummary, type AgentImageDetails, type AgentImageSummary, type FileSummary, type MessageSummary, type MutationHint, type NotificationLevel, type NotificationSummary, type PresenceSettingsSummary, type SyncState, type ThreadSummary, type UserSummary } from "./types.js";
4
+ interface SendMessageRepositoryInput {
5
+ actorUserId: string;
6
+ chatId: string;
7
+ text: string;
8
+ attachmentFileIds?: string[];
9
+ quotedMessageId?: string;
10
+ threadRootMessageId?: string;
11
+ expiresAt?: string;
12
+ expiryMode?: "none" | "after_send" | "after_read";
13
+ selfDestructSeconds?: number;
14
+ afterReadScope?: "any_reader" | "all_readers";
15
+ clientMutationId?: string;
16
+ kind?: "user" | "automated";
17
+ senderBotId?: string;
18
+ forwardedFromMessageId?: string;
19
+ agentSessionId?: string;
20
+ agentTurn?: {
21
+ agentUserId: string;
22
+ sessionId: string;
23
+ };
24
+ }
25
+ export interface RigEventCheckpoint {
26
+ cursor?: number;
27
+ eventsSinceTrim: number;
28
+ lastTrimmedAt: string;
29
+ trimmedThrough?: number;
30
+ }
31
+ export interface AgentChatContext {
32
+ agentUserId: string;
33
+ chatId: string;
34
+ image: AgentExecutionImage;
35
+ privateUserId: string;
36
+ binding?: {
37
+ containerName: string;
38
+ cwd: string;
39
+ sessionId: string;
40
+ };
41
+ }
42
+ export interface ChatWorkspaceBinding {
43
+ chatId: string;
44
+ cwd: string;
45
+ }
46
+ export interface AgentExecutionImage {
47
+ id: string;
48
+ dockerImageId: string;
49
+ dockerTag: string;
50
+ }
51
+ export interface AgentImageBuild {
52
+ buildContext?: string;
53
+ dockerfile: string;
54
+ id: string;
55
+ dockerTag: string;
56
+ }
57
+ export interface AgentSecretAssignment {
58
+ secretId: string;
59
+ agentUserIds: string[];
60
+ channelIds: string[];
61
+ }
62
+ export interface AgentSecretBinding {
63
+ agentUserId: string;
64
+ chatId: string;
65
+ secretIds: string[];
66
+ sessionId: string;
67
+ }
68
+ export declare class CollaborationRepository {
69
+ private readonly client;
70
+ private readonly db;
71
+ private readonly ownsClient;
72
+ constructor(source: string | Client, authToken?: string);
73
+ initialize(): Promise<void>;
74
+ close(): void;
75
+ /** Package-internal shared connection for transactional backend extensions. */
76
+ extensionClient(): Client;
77
+ getState(): Promise<SyncState>;
78
+ acknowledgeSyncConsumer(input: {
79
+ userId: string;
80
+ deviceId: string;
81
+ generation: string;
82
+ sequence: number;
83
+ }): Promise<void>;
84
+ compactSync(): Promise<{
85
+ minRecoverableSequence: string;
86
+ eventsDeleted: number;
87
+ mutationsDeleted: number;
88
+ chatUpdatesDeleted: number;
89
+ }>;
90
+ canAccessChat(userId: string, chatId: string): Promise<boolean>;
91
+ canAccessChatWorkspace(userId: string, chatId: string): Promise<boolean>;
92
+ getChatWorkspaceBinding(userId: string, chatId: string): Promise<ChatWorkspaceBinding>;
93
+ canPostToChat(userId: string, chatId: string): Promise<boolean>;
94
+ listChats(userId: string): Promise<ChatSummary[]>;
95
+ getChat(userId: string, chatId: string): Promise<ChatSummary>;
96
+ listChatMembers(userId: string, chatId: string): Promise<UserSummary[]>;
97
+ listChatMemberships(userId: string, chatId: string): Promise<Array<{
98
+ user: UserSummary;
99
+ role: ChatRole;
100
+ joinedAt: string;
101
+ }>>;
102
+ createChannel(input: {
103
+ actorUserId: string;
104
+ kind: "public_channel" | "private_channel";
105
+ name: string;
106
+ slug: string;
107
+ topic?: string;
108
+ }): Promise<{
109
+ chat: ChatSummary;
110
+ hint: MutationHint;
111
+ }>;
112
+ ensureAgentImageDefinitions(definitions: ReadonlyArray<{
113
+ buildContext: string;
114
+ builtinKey: "daycare-full" | "daycare-minimal";
115
+ definitionHash: string;
116
+ dockerTag: string;
117
+ dockerfile: string;
118
+ name: string;
119
+ }>): Promise<void>;
120
+ listAgentImages(actorUserId: string): Promise<{
121
+ defaultImageId?: string;
122
+ images: AgentImageSummary[];
123
+ }>;
124
+ getAgentImage(actorUserId: string, imageId: string): Promise<AgentImageDetails>;
125
+ createAgentImage(input: {
126
+ actorUserId: string;
127
+ definitionHash: string;
128
+ dockerTag: string;
129
+ dockerfile: string;
130
+ name: string;
131
+ }): Promise<{
132
+ hint: MutationHint;
133
+ image: AgentImageSummary;
134
+ }>;
135
+ requestAgentImageBuild(input: {
136
+ actorUserId: string;
137
+ imageId: string;
138
+ }): Promise<{
139
+ hint: MutationHint;
140
+ image: AgentImageSummary;
141
+ }>;
142
+ setDefaultAgentImage(input: {
143
+ actorUserId: string;
144
+ imageId: string;
145
+ }): Promise<{
146
+ hint: MutationHint;
147
+ image: AgentImageSummary;
148
+ }>;
149
+ getReadyDefaultAgentImage(): Promise<AgentExecutionImage | undefined>;
150
+ listRequestedAgentImageBuildIds(): Promise<string[]>;
151
+ takeAgentImageBuild(imageId: string, workerId: string): Promise<{
152
+ build: AgentImageBuild;
153
+ hint: MutationHint;
154
+ } | undefined>;
155
+ recordAgentImageBuildOutput(input: {
156
+ imageId: string;
157
+ lastBuildLogLine?: string;
158
+ logChunk: string;
159
+ progress: number;
160
+ workerId: string;
161
+ }): Promise<MutationHint | undefined>;
162
+ renewAgentImageBuildLease(imageId: string, workerId: string): Promise<boolean>;
163
+ completeAgentImageBuild(input: {
164
+ dockerImageId: string;
165
+ imageId: string;
166
+ workerId: string;
167
+ }): Promise<MutationHint | undefined>;
168
+ failAgentImageBuild(input: {
169
+ error: string;
170
+ imageId: string;
171
+ workerId: string;
172
+ }): Promise<MutationHint | undefined>;
173
+ releaseAgentImageBuildLeases(workerId: string): Promise<void>;
174
+ authorizeAgentSecretManagement(actorUserId: string): Promise<void>;
175
+ listAgentSecretAssignments(actorUserId: string): Promise<AgentSecretAssignment[]>;
176
+ listAgentSecretBindings(input?: {
177
+ agentUserId?: string;
178
+ chatId?: string;
179
+ }): Promise<AgentSecretBinding[]>;
180
+ recordAgentSecretRegistration(input: {
181
+ actorUserId: string;
182
+ secretId: string;
183
+ }): Promise<MutationHint>;
184
+ deleteAgentSecretAssignments(input: {
185
+ actorUserId: string;
186
+ secretId: string;
187
+ }): Promise<MutationHint>;
188
+ attachAgentSecretToAgent(input: {
189
+ actorUserId: string;
190
+ agentUserId: string;
191
+ secretId: string;
192
+ }): Promise<MutationHint | undefined>;
193
+ detachAgentSecretFromAgent(input: {
194
+ actorUserId: string;
195
+ agentUserId: string;
196
+ secretId: string;
197
+ }): Promise<MutationHint | undefined>;
198
+ attachAgentSecretToChannel(input: {
199
+ actorUserId: string;
200
+ channelId: string;
201
+ secretId: string;
202
+ }): Promise<MutationHint | undefined>;
203
+ detachAgentSecretFromChannel(input: {
204
+ actorUserId: string;
205
+ channelId: string;
206
+ secretId: string;
207
+ }): Promise<MutationHint | undefined>;
208
+ createAgent(input: {
209
+ agentUserId: string;
210
+ actorUserId: string;
211
+ containerName: string;
212
+ imageId: string;
213
+ name: string;
214
+ username: string;
215
+ sessionId: string;
216
+ cwd: string;
217
+ }): Promise<{
218
+ chat: ChatSummary;
219
+ hint: MutationHint;
220
+ }>;
221
+ agentUsernameAvailable(username: string): Promise<boolean>;
222
+ getDirectAgentChatContext(userId: string, chatId: string): Promise<AgentChatContext | undefined>;
223
+ bindAgentChat(input: {
224
+ actorUserId: string;
225
+ agentUserId: string;
226
+ chatId: string;
227
+ containerName: string;
228
+ cwd: string;
229
+ imageId: string;
230
+ sessionId: string;
231
+ }): Promise<{
232
+ containerName: string;
233
+ cwd: string;
234
+ sessionId: string;
235
+ }>;
236
+ listUnfinishedAgentChatIds(): Promise<string[]>;
237
+ hasUnfinishedAgentTurn(chatId: string): Promise<boolean>;
238
+ hasRunnableAgentTurn(chatId: string): Promise<boolean>;
239
+ takeNextAgentTurn(chatId: string, workerId: string): Promise<{
240
+ agentUserId: string;
241
+ actorUserId: string;
242
+ baselineMessageCount?: number;
243
+ chatId: string;
244
+ lastSessionEventId?: string;
245
+ leaseExpiresAt?: string;
246
+ runId?: string;
247
+ sessionId: string;
248
+ streamCommittedText: string;
249
+ text: string;
250
+ userMessageId: string;
251
+ workerId: string;
252
+ } | undefined>;
253
+ renewAgentTurnLease(input: {
254
+ agentUserId: string;
255
+ userMessageId: string;
256
+ workerId: string;
257
+ }): Promise<boolean>;
258
+ releaseAgentTurnLeases(workerId: string): Promise<void>;
259
+ checkpointAgentTurn(input: {
260
+ agentUserId: string;
261
+ baselineMessageCount: number;
262
+ lastSessionEventId?: string;
263
+ runId?: string;
264
+ userMessageId: string;
265
+ workerId: string;
266
+ }): Promise<boolean>;
267
+ attachAgentRun(input: {
268
+ runId: string;
269
+ sessionId: string;
270
+ text: string;
271
+ }): Promise<void>;
272
+ getRunningAgentTurn(sessionId: string, runId: string): Promise<{
273
+ agentUserId: string;
274
+ actorUserId: string;
275
+ baselineMessageCount?: number | undefined;
276
+ chatId: string;
277
+ lastSessionEventId?: string | undefined;
278
+ leaseExpiresAt?: string | undefined;
279
+ runId?: string | undefined;
280
+ sessionId: string;
281
+ streamCommittedText: string;
282
+ text: string;
283
+ userMessageId: string;
284
+ workerId: string;
285
+ } | undefined>;
286
+ getRigEventCheckpoint(): Promise<RigEventCheckpoint>;
287
+ checkpointRigEvent(cursor: number, eventCount?: number): Promise<RigEventCheckpoint>;
288
+ markRigEventsTrimmed(through: number): Promise<RigEventCheckpoint>;
289
+ streamAgentTurnReply(input: {
290
+ agentUserId: string;
291
+ actorUserId: string;
292
+ eventId: string;
293
+ expectedEventId?: string;
294
+ sessionId: string;
295
+ streamCommittedText: string;
296
+ userMessageId: string;
297
+ text: string;
298
+ workerId: string;
299
+ }): Promise<{
300
+ applied: boolean;
301
+ message?: MessageSummary;
302
+ hint?: MutationHint;
303
+ }>;
304
+ completeAgentTurn(input: {
305
+ agentUserId: string;
306
+ actorUserId: string;
307
+ sessionId: string;
308
+ userMessageId: string;
309
+ text: string;
310
+ workerId: string;
311
+ }): Promise<{
312
+ message: MessageSummary;
313
+ hint: MutationHint;
314
+ } | undefined>;
315
+ failAgentTurn(input: {
316
+ agentUserId: string;
317
+ actorUserId: string;
318
+ error: string;
319
+ sessionId: string;
320
+ userMessageId: string;
321
+ workerId: string;
322
+ }): Promise<{
323
+ message: MessageSummary;
324
+ hint: MutationHint;
325
+ } | undefined>;
326
+ private finishAgentTurn;
327
+ createDirectMessage(actorUserId: string, otherUserId: string): Promise<{
328
+ chat: ChatSummary;
329
+ hint?: MutationHint;
330
+ }>;
331
+ createGroupDirectMessage(input: {
332
+ actorUserId: string;
333
+ userIds: string[];
334
+ name?: string;
335
+ }): Promise<{
336
+ chat: ChatSummary;
337
+ hint?: MutationHint;
338
+ memberUserIds: string[];
339
+ }>;
340
+ updateChannel(input: {
341
+ actorUserId: string;
342
+ chatId: string;
343
+ name?: string;
344
+ slug?: string;
345
+ topic?: string | null;
346
+ kind?: "public_channel" | "private_channel";
347
+ photoFileId?: string | null;
348
+ isListed?: boolean;
349
+ }): Promise<{
350
+ chat: ChatSummary;
351
+ hint: MutationHint;
352
+ }>;
353
+ setChannelArchived(input: {
354
+ actorUserId: string;
355
+ chatId: string;
356
+ archived: boolean;
357
+ reason?: string;
358
+ }): Promise<{
359
+ chat: ChatSummary;
360
+ hint: MutationHint;
361
+ }>;
362
+ updateChannelPolicies(input: {
363
+ actorUserId: string;
364
+ chatId: string;
365
+ retentionMode?: "inherit" | "forever" | "duration";
366
+ retentionSeconds?: number | null;
367
+ defaultExpiryMode?: "none" | "after_send" | "after_read";
368
+ defaultSelfDestructSeconds?: number | null;
369
+ defaultAfterReadScope?: "any_reader" | "all_readers";
370
+ }): Promise<{
371
+ chat: ChatSummary;
372
+ hint: MutationHint;
373
+ }>;
374
+ deleteChannel(input: {
375
+ actorUserId: string;
376
+ chatId: string;
377
+ reason?: string;
378
+ }): Promise<{
379
+ hint: MutationHint;
380
+ memberUserIds: string[];
381
+ }>;
382
+ setChannelMemberRole(input: {
383
+ actorUserId: string;
384
+ chatId: string;
385
+ userId: string;
386
+ role: ChatRole;
387
+ }): Promise<{
388
+ hint: MutationHint;
389
+ }>;
390
+ updateTopic(actorUserId: string, chatId: string, topic: string | undefined): Promise<{
391
+ chat: ChatSummary;
392
+ hint: MutationHint;
393
+ }>;
394
+ joinPublicChannel(actorUserId: string, chatId: string): Promise<{
395
+ chat: ChatSummary;
396
+ hint: MutationHint;
397
+ }>;
398
+ leaveChannel(actorUserId: string, chatId: string): Promise<{
399
+ hint: MutationHint;
400
+ }>;
401
+ addChannelMember(input: {
402
+ actorUserId: string;
403
+ chatId: string;
404
+ userId: string;
405
+ role?: ChatRole;
406
+ }): Promise<{
407
+ hint: MutationHint;
408
+ }>;
409
+ removeChannelMember(input: {
410
+ actorUserId: string;
411
+ chatId: string;
412
+ userId: string;
413
+ }): Promise<{
414
+ hint: MutationHint;
415
+ }>;
416
+ setStar(actorUserId: string, chatId: string, starred: boolean): Promise<{
417
+ hint: MutationHint;
418
+ }>;
419
+ reorderStarred(actorUserId: string, chatIds: string[]): Promise<{
420
+ hint: MutationHint;
421
+ }>;
422
+ markChatRead(input: {
423
+ actorUserId: string;
424
+ chatId: string;
425
+ messageId?: string;
426
+ }): Promise<{
427
+ chat: ChatSummary;
428
+ hint: MutationHint;
429
+ }>;
430
+ setChatNotificationPreferences(input: {
431
+ actorUserId: string;
432
+ chatId: string;
433
+ notificationLevel?: NotificationLevel;
434
+ mutedUntil?: string | null;
435
+ notifyThreadReplies?: boolean;
436
+ showMessagePreviews?: boolean;
437
+ }): Promise<{
438
+ chat: ChatSummary;
439
+ hint: MutationHint;
440
+ }>;
441
+ getNotificationPreferences(userId: string): Promise<{
442
+ directMessages: "all" | "none";
443
+ mentions: "all" | "none";
444
+ threadReplies: NotificationLevel;
445
+ reactions: "all" | "none";
446
+ calls: "all" | "none";
447
+ emailNotifications: boolean;
448
+ desktopNotifications: boolean;
449
+ dndStartMinutes?: number;
450
+ dndEndMinutes?: number;
451
+ timezone?: string;
452
+ }>;
453
+ updateNotificationPreferences(input: {
454
+ actorUserId: string;
455
+ directMessages?: "all" | "none";
456
+ mentions?: "all" | "none";
457
+ threadReplies?: NotificationLevel;
458
+ reactions?: "all" | "none";
459
+ calls?: "all" | "none";
460
+ emailNotifications?: boolean;
461
+ desktopNotifications?: boolean;
462
+ dndStartMinutes?: number | null;
463
+ dndEndMinutes?: number | null;
464
+ timezone?: string | null;
465
+ }): Promise<{
466
+ preferences: Awaited<ReturnType<CollaborationRepository["getNotificationPreferences"]>>;
467
+ hint: MutationHint;
468
+ }>;
469
+ listNotifications(input: {
470
+ userId: string;
471
+ before?: string;
472
+ unreadOnly?: boolean;
473
+ limit: number;
474
+ }): Promise<{
475
+ notifications: NotificationSummary[];
476
+ nextCursor?: string;
477
+ }>;
478
+ markNotificationsRead(input: {
479
+ actorUserId: string;
480
+ notificationIds?: string[];
481
+ all?: boolean;
482
+ }): Promise<{
483
+ hint: MutationHint;
484
+ }>;
485
+ listMyThreads(input: {
486
+ userId: string;
487
+ before?: string;
488
+ unreadOnly?: boolean;
489
+ limit: number;
490
+ }): Promise<{
491
+ threads: ThreadSummary[];
492
+ nextCursor?: string;
493
+ }>;
494
+ setThreadSubscription(input: {
495
+ actorUserId: string;
496
+ threadRootMessageId: string;
497
+ subscribed: boolean;
498
+ notificationLevel?: NotificationLevel;
499
+ }): Promise<{
500
+ hint: MutationHint;
501
+ }>;
502
+ markThreadRead(input: {
503
+ actorUserId: string;
504
+ threadRootMessageId: string;
505
+ messageId?: string;
506
+ }): Promise<{
507
+ hint: MutationHint;
508
+ }>;
509
+ listChatPins(userId: string, chatId: string): Promise<ChatPinSummary[]>;
510
+ setMessagePinned(input: {
511
+ actorUserId: string;
512
+ messageId: string;
513
+ pinned: boolean;
514
+ }): Promise<{
515
+ hint: MutationHint;
516
+ }>;
517
+ listChatBookmarks(userId: string, chatId: string): Promise<ChatBookmarkSummary[]>;
518
+ createChatBookmark(input: {
519
+ actorUserId: string;
520
+ chatId: string;
521
+ kind: "link" | "message" | "file";
522
+ title: string;
523
+ url?: string;
524
+ messageId?: string;
525
+ fileId?: string;
526
+ emoji?: string;
527
+ }): Promise<{
528
+ bookmark: ChatBookmarkSummary;
529
+ hint: MutationHint;
530
+ }>;
531
+ deleteChatBookmark(input: {
532
+ actorUserId: string;
533
+ chatId: string;
534
+ bookmarkId: string;
535
+ }): Promise<{
536
+ hint: MutationHint;
537
+ }>;
538
+ sendMessage(input: SendMessageRepositoryInput): Promise<{
539
+ message: MessageSummary;
540
+ hint: MutationHint;
541
+ }>;
542
+ private sendMessageDb;
543
+ forwardMessage(input: {
544
+ actorUserId: string;
545
+ messageId: string;
546
+ targetChatIds: string[];
547
+ clientMutationId?: string;
548
+ }): Promise<{
549
+ messages: MessageSummary[];
550
+ hints: MutationHint[];
551
+ }>;
552
+ getMessage(userId: string, messageId: string): Promise<MessageSummary>;
553
+ editMessage(input: {
554
+ actorUserId: string;
555
+ messageId: string;
556
+ text: string;
557
+ reason?: string;
558
+ expectedRevision?: number;
559
+ }): Promise<{
560
+ message: MessageSummary;
561
+ hint: MutationHint;
562
+ }>;
563
+ listMessageRevisions(userId: string, messageId: string): Promise<Array<{
564
+ revision: number;
565
+ text: string;
566
+ editedByUserId?: string;
567
+ editReason?: string;
568
+ createdAt: string;
569
+ }>>;
570
+ listMessages(input: {
571
+ userId: string;
572
+ chatId: string;
573
+ beforeSequence?: number;
574
+ afterSequence?: number;
575
+ threadRootMessageId?: string;
576
+ limit: number;
577
+ }): Promise<{
578
+ messages: MessageSummary[];
579
+ chatPts: string;
580
+ hasMore: boolean;
581
+ }>;
582
+ deleteMessage(actorUserId: string, messageId: string): Promise<{
583
+ message: MessageSummary;
584
+ hint: MutationHint;
585
+ }>;
586
+ setReaction(input: {
587
+ actorUserId: string;
588
+ messageId: string;
589
+ emoji?: string;
590
+ customEmojiId?: string;
591
+ active: boolean;
592
+ }): Promise<{
593
+ message: MessageSummary;
594
+ hint: MutationHint;
595
+ }>;
596
+ getDifference(input: {
597
+ userId: string;
598
+ generation: string;
599
+ fromSequence: number;
600
+ untilSequence?: number;
601
+ limit: number;
602
+ }): Promise<{
603
+ kind: "empty" | "difference" | "slice" | "reset";
604
+ changedChats: ChatSummary[];
605
+ removedChatIds: string[];
606
+ areas: string[];
607
+ state: SyncState;
608
+ targetState: SyncState;
609
+ }>;
610
+ getChatDifference(input: {
611
+ userId: string;
612
+ chatId: string;
613
+ membershipEpoch: string;
614
+ fromPts: number;
615
+ untilPts?: number;
616
+ limit: number;
617
+ }): Promise<{
618
+ kind: "empty" | "difference" | "slice" | "reset" | "tooLong";
619
+ updates: Array<{
620
+ pts: string;
621
+ ptsCount: 1;
622
+ kind: string;
623
+ entityId?: string;
624
+ }>;
625
+ messages: MessageSummary[];
626
+ chat: ChatSummary;
627
+ state: {
628
+ membershipEpoch: string;
629
+ pts: string;
630
+ };
631
+ targetState: {
632
+ membershipEpoch: string;
633
+ pts: string;
634
+ };
635
+ }>;
636
+ expireDueMessages(limit?: number): Promise<MutationHint | undefined>;
637
+ listContacts(): Promise<UserSummary[]>;
638
+ listPresenceSettings(userIds?: string[]): Promise<PresenceSettingsSummary[]>;
639
+ updatePresenceSettings(input: {
640
+ actorUserId: string;
641
+ availability?: "automatic" | "online" | "away" | "dnd";
642
+ customStatusText?: string | null;
643
+ customStatusEmoji?: string | null;
644
+ statusExpiresAt?: string | null;
645
+ dndUntil?: string | null;
646
+ }): Promise<{
647
+ presence: PresenceSettingsSummary;
648
+ hint: MutationHint;
649
+ }>;
650
+ createCall(input: {
651
+ actorUserId: string;
652
+ chatId: string;
653
+ kind: "audio" | "video";
654
+ invitedUserIds?: string[];
655
+ }): Promise<{
656
+ call: CallSummary;
657
+ hint: MutationHint;
658
+ invitedUserIds: string[];
659
+ }>;
660
+ getCall(userId: string, callId: string): Promise<CallSummary>;
661
+ listCalls(input: {
662
+ userId: string;
663
+ chatId?: string;
664
+ limit: number;
665
+ }): Promise<CallSummary[]>;
666
+ updateCallParticipation(input: {
667
+ actorUserId: string;
668
+ callId: string;
669
+ action: "join" | "decline" | "leave";
670
+ }): Promise<{
671
+ call: CallSummary;
672
+ hint: MutationHint;
673
+ }>;
674
+ endCall(input: {
675
+ actorUserId: string;
676
+ callId: string;
677
+ reason?: string;
678
+ }): Promise<{
679
+ call: CallSummary;
680
+ hint: MutationHint;
681
+ }>;
682
+ canSignalCall(input: {
683
+ userId: string;
684
+ callId: string;
685
+ chatId: string;
686
+ recipientUserId?: string;
687
+ }): Promise<boolean>;
688
+ listDirectoryChannels(userId: string): Promise<ChatSummary[]>;
689
+ listFiles(input: {
690
+ userId: string;
691
+ kind?: FileKind;
692
+ before?: string;
693
+ limit: number;
694
+ }): Promise<{
695
+ files: FileSummary[];
696
+ nextCursor?: string;
697
+ }>;
698
+ canAccessFile(userId: string, fileId: string): Promise<boolean>;
699
+ listCustomEmoji(): Promise<Array<{
700
+ id: string;
701
+ name: string;
702
+ file: FileSummary;
703
+ createdByUserId: string;
704
+ }>>;
705
+ createCustomEmoji(input: {
706
+ actorUserId: string;
707
+ name: string;
708
+ fileId: string;
709
+ }): Promise<{
710
+ emoji: {
711
+ id: string;
712
+ name: string;
713
+ file: FileSummary;
714
+ createdByUserId: string;
715
+ };
716
+ hint: MutationHint;
717
+ }>;
718
+ deleteCustomEmoji(actorUserId: string, emojiId: string): Promise<{
719
+ hint: MutationHint;
720
+ }>;
721
+ search(userId: string, query: string, limit: number): Promise<Array<{
722
+ type: "message";
723
+ score: number;
724
+ message: MessageSummary;
725
+ } | {
726
+ type: "channel";
727
+ score: number;
728
+ channel: ChatSummary;
729
+ } | {
730
+ type: "user";
731
+ score: number;
732
+ user: UserSummary;
733
+ }>>;
734
+ searchPage(input: {
735
+ userId: string;
736
+ query: string;
737
+ limit: number;
738
+ cursor?: string;
739
+ }): Promise<{
740
+ results: Array<{
741
+ type: "message";
742
+ score: number;
743
+ message: MessageSummary;
744
+ } | {
745
+ type: "channel";
746
+ score: number;
747
+ channel: ChatSummary;
748
+ } | {
749
+ type: "user";
750
+ score: number;
751
+ user: UserSummary;
752
+ }>;
753
+ nextCursor?: string;
754
+ }>;
755
+ getServerProfile(): Promise<{
756
+ name: string;
757
+ title?: string;
758
+ photoFileId?: string;
759
+ defaultRetentionMode: "forever" | "duration";
760
+ defaultRetentionSeconds?: number;
761
+ updatedAt: string;
762
+ }>;
763
+ listAdminUsers(actorUserId: string): Promise<Array<AdminUserSummary & {
764
+ email: string;
765
+ bannedAt?: string;
766
+ deletedAt?: string;
767
+ sessionLastSeenAt?: string;
768
+ }>>;
769
+ updateServerProfile(input: {
770
+ actorUserId: string;
771
+ name?: string;
772
+ title?: string | null;
773
+ photoFileId?: string | null;
774
+ defaultRetentionMode?: "forever" | "duration";
775
+ defaultRetentionSeconds?: number | null;
776
+ }): Promise<{
777
+ server: Awaited<ReturnType<CollaborationRepository["getServerProfile"]>>;
778
+ hint: MutationHint;
779
+ }>;
780
+ updateUserAdministration(input: {
781
+ actorUserId: string;
782
+ userId: string;
783
+ title?: string | null;
784
+ role?: "member" | "admin";
785
+ }): Promise<{
786
+ user: UserSummary;
787
+ hint: MutationHint;
788
+ }>;
789
+ setUserBanned(input: {
790
+ actorUserId: string;
791
+ userId: string;
792
+ banned: boolean;
793
+ }): Promise<{
794
+ hint: MutationHint;
795
+ }>;
796
+ deleteUser(input: {
797
+ actorUserId: string;
798
+ userId: string;
799
+ }): Promise<{
800
+ hint: MutationHint;
801
+ }>;
802
+ sendAutomatedMessage(input: {
803
+ actorUserId: string;
804
+ chatId: string;
805
+ text: string;
806
+ attachmentFileIds?: string[];
807
+ clientMutationId?: string;
808
+ botId?: string;
809
+ }): Promise<{
810
+ message: MessageSummary;
811
+ hint: MutationHint;
812
+ }>;
813
+ private chatAccessDb;
814
+ private requireChatManagerDb;
815
+ private requireActiveUserDb;
816
+ private requireActiveIdentityDb;
817
+ private isPostingRestrictedDb;
818
+ private getCallProjectionDb;
819
+ private listPresenceSettingsWithDb;
820
+ private nextSequence;
821
+ private advanceChat;
822
+ private advanceChatWithSequence;
823
+ private insertChatUpdate;
824
+ private insertSyncEvent;
825
+ private recomputeThreadProjectionDb;
826
+ private canAccessFileWithDb;
827
+ private requireMessageInChatDb;
828
+ private getMessageProjectionDb;
829
+ private replaceMessageMentionsDb;
830
+ private indexMessageForSearchDb;
831
+ private recordMessageDeliveryDb;
832
+ private findClientMutationDb;
833
+ private storeClientMutationDb;
834
+ private requireServerAdminDb;
835
+ private appendAuditDb;
836
+ private writeDb;
837
+ }
838
+ export {};
839
+ //# sourceMappingURL=repository.d.ts.map