alepha 0.21.2 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (463) hide show
  1. package/README.md +0 -1
  2. package/dist/api/audits/index.browser.js.map +1 -1
  3. package/dist/api/audits/index.d.ts +393 -403
  4. package/dist/api/audits/index.d.ts.map +1 -1
  5. package/dist/api/audits/index.js +25 -56
  6. package/dist/api/audits/index.js.map +1 -1
  7. package/dist/api/files/index.browser.js +31 -1
  8. package/dist/api/files/index.browser.js.map +1 -1
  9. package/dist/api/files/index.d.ts +313 -208
  10. package/dist/api/files/index.d.ts.map +1 -1
  11. package/dist/api/files/index.js +152 -42
  12. package/dist/api/files/index.js.map +1 -1
  13. package/dist/api/jobs/index.browser.js +2 -2
  14. package/dist/api/jobs/index.browser.js.map +1 -1
  15. package/dist/api/jobs/index.d.ts +289 -292
  16. package/dist/api/jobs/index.d.ts.map +1 -1
  17. package/dist/api/jobs/index.js +39 -33
  18. package/dist/api/jobs/index.js.map +1 -1
  19. package/dist/api/keys/index.d.ts +211 -216
  20. package/dist/api/keys/index.d.ts.map +1 -1
  21. package/dist/api/keys/index.js.map +1 -1
  22. package/dist/api/notifications/index.browser.js.map +1 -1
  23. package/dist/api/notifications/index.d.ts +188 -195
  24. package/dist/api/notifications/index.d.ts.map +1 -1
  25. package/dist/api/notifications/index.js.map +1 -1
  26. package/dist/api/oauth/index.d.ts +71 -76
  27. package/dist/api/oauth/index.d.ts.map +1 -1
  28. package/dist/api/oauth/index.js.map +1 -1
  29. package/dist/api/organizations/index.browser.js.map +1 -1
  30. package/dist/api/organizations/index.d.ts +104 -109
  31. package/dist/api/organizations/index.d.ts.map +1 -1
  32. package/dist/api/organizations/index.js.map +1 -1
  33. package/dist/api/parameters/index.browser.js +43 -16
  34. package/dist/api/parameters/index.browser.js.map +1 -1
  35. package/dist/api/parameters/index.d.ts +488 -344
  36. package/dist/api/parameters/index.d.ts.map +1 -1
  37. package/dist/api/parameters/index.js +175 -35
  38. package/dist/api/parameters/index.js.map +1 -1
  39. package/dist/api/payments/index.d.ts +396 -402
  40. package/dist/api/payments/index.d.ts.map +1 -1
  41. package/dist/api/payments/index.js.map +1 -1
  42. package/dist/api/subscriptions/index.d.ts +644 -652
  43. package/dist/api/subscriptions/index.d.ts.map +1 -1
  44. package/dist/api/subscriptions/index.js +1 -1
  45. package/dist/api/subscriptions/index.js.map +1 -1
  46. package/dist/api/users/index.browser.js +7 -0
  47. package/dist/api/users/index.browser.js.map +1 -1
  48. package/dist/api/users/index.d.ts +1073 -1006
  49. package/dist/api/users/index.d.ts.map +1 -1
  50. package/dist/api/users/index.js +283 -61
  51. package/dist/api/users/index.js.map +1 -1
  52. package/dist/api/verifications/index.browser.js.map +1 -1
  53. package/dist/api/verifications/index.d.ts +134 -140
  54. package/dist/api/verifications/index.d.ts.map +1 -1
  55. package/dist/api/verifications/index.js.map +1 -1
  56. package/dist/background/index.d.ts +95 -0
  57. package/dist/background/index.d.ts.map +1 -0
  58. package/dist/background/index.js +121 -0
  59. package/dist/background/index.js.map +1 -0
  60. package/dist/background/index.workerd.js +110 -0
  61. package/dist/background/index.workerd.js.map +1 -0
  62. package/dist/batch/index.d.ts +5 -7
  63. package/dist/batch/index.d.ts.map +1 -1
  64. package/dist/batch/index.js.map +1 -1
  65. package/dist/bin/index.js.map +1 -1
  66. package/dist/bucket/index.d.ts +76 -54
  67. package/dist/bucket/index.d.ts.map +1 -1
  68. package/dist/bucket/index.js +58 -11
  69. package/dist/bucket/index.js.map +1 -1
  70. package/dist/bucket/index.workerd.js +200 -5
  71. package/dist/bucket/index.workerd.js.map +1 -1
  72. package/dist/cache/core/index.d.ts +7 -10
  73. package/dist/cache/core/index.d.ts.map +1 -1
  74. package/dist/cache/core/index.js.map +1 -1
  75. package/dist/cache/core/index.workerd.js.map +1 -1
  76. package/dist/cache/database/index.d.ts +22 -26
  77. package/dist/cache/database/index.d.ts.map +1 -1
  78. package/dist/cache/database/index.js.map +1 -1
  79. package/dist/cache/redis/index.d.ts +4 -7
  80. package/dist/cache/redis/index.d.ts.map +1 -1
  81. package/dist/cache/redis/index.js.map +1 -1
  82. package/dist/captcha/index.d.ts +3 -6
  83. package/dist/captcha/index.d.ts.map +1 -1
  84. package/dist/captcha/index.js.map +1 -1
  85. package/dist/cli/config/index.d.ts.map +1 -1
  86. package/dist/cli/config/index.js.map +1 -1
  87. package/dist/cli/core/index.d.ts +417 -214
  88. package/dist/cli/core/index.d.ts.map +1 -1
  89. package/dist/cli/core/index.js +325 -563
  90. package/dist/cli/core/index.js.map +1 -1
  91. package/dist/cli/devtools/index.d.ts +3 -5
  92. package/dist/cli/devtools/index.d.ts.map +1 -1
  93. package/dist/cli/devtools/index.js.map +1 -1
  94. package/dist/cli/i18n/index.d.ts +8 -12
  95. package/dist/cli/i18n/index.d.ts.map +1 -1
  96. package/dist/cli/i18n/index.js.map +1 -1
  97. package/dist/cli/platform/index.d.ts +126 -1342
  98. package/dist/cli/platform/index.d.ts.map +1 -1
  99. package/dist/cli/platform/index.js +136 -2374
  100. package/dist/cli/platform/index.js.map +1 -1
  101. package/dist/cli/platform-lib/index.d.ts +1446 -0
  102. package/dist/cli/platform-lib/index.d.ts.map +1 -0
  103. package/dist/cli/platform-lib/index.js +2597 -0
  104. package/dist/cli/platform-lib/index.js.map +1 -0
  105. package/dist/cli/vendor/index.d.ts +17 -21
  106. package/dist/cli/vendor/index.d.ts.map +1 -1
  107. package/dist/cli/vendor/index.js.map +1 -1
  108. package/dist/command/index.d.ts +21 -20
  109. package/dist/command/index.d.ts.map +1 -1
  110. package/dist/command/index.js +39 -10
  111. package/dist/command/index.js.map +1 -1
  112. package/dist/{containers → container}/core/index.d.ts +13 -15
  113. package/dist/container/core/index.d.ts.map +1 -0
  114. package/dist/{containers → container}/core/index.js +23 -14
  115. package/dist/container/core/index.js.map +1 -0
  116. package/dist/{containers → container}/core/index.workerd.js +37 -22
  117. package/dist/container/core/index.workerd.js.map +1 -0
  118. package/dist/core/index.browser.js +27 -1
  119. package/dist/core/index.browser.js.map +1 -1
  120. package/dist/core/index.d.ts +48 -24
  121. package/dist/core/index.d.ts.map +1 -1
  122. package/dist/core/index.js +27 -1
  123. package/dist/core/index.js.map +1 -1
  124. package/dist/core/index.native.js +27 -1
  125. package/dist/core/index.native.js.map +1 -1
  126. package/dist/core/index.workerd.js +27 -1
  127. package/dist/core/index.workerd.js.map +1 -1
  128. package/dist/crypto/index.browser.js.map +1 -1
  129. package/dist/crypto/index.d.ts +5 -8
  130. package/dist/crypto/index.d.ts.map +1 -1
  131. package/dist/crypto/index.js.map +1 -1
  132. package/dist/datetime/index.d.ts +3 -4
  133. package/dist/datetime/index.d.ts.map +1 -1
  134. package/dist/datetime/index.js.map +1 -1
  135. package/dist/email/brevo/index.d.ts +2 -4
  136. package/dist/email/brevo/index.d.ts.map +1 -1
  137. package/dist/email/brevo/index.js.map +1 -1
  138. package/dist/email/cloudflare/index.d.ts +20 -7
  139. package/dist/email/cloudflare/index.d.ts.map +1 -1
  140. package/dist/email/cloudflare/index.js +46 -9
  141. package/dist/email/cloudflare/index.js.map +1 -1
  142. package/dist/email/core/index.d.ts +6 -9
  143. package/dist/email/core/index.d.ts.map +1 -1
  144. package/dist/email/core/index.js.map +1 -1
  145. package/dist/email/core/index.workerd.js.map +1 -1
  146. package/dist/email/smtp/index.d.ts +10 -13
  147. package/dist/email/smtp/index.d.ts.map +1 -1
  148. package/dist/email/smtp/index.js +107 -32
  149. package/dist/email/smtp/index.js.map +1 -1
  150. package/dist/fake/index.d.ts +1 -2
  151. package/dist/fake/index.d.ts.map +1 -1
  152. package/dist/fake/index.js.map +1 -1
  153. package/dist/lock/core/index.d.ts +9 -14
  154. package/dist/lock/core/index.d.ts.map +1 -1
  155. package/dist/lock/core/index.js.map +1 -1
  156. package/dist/lock/redis/index.d.ts +2 -4
  157. package/dist/lock/redis/index.d.ts.map +1 -1
  158. package/dist/lock/redis/index.js.map +1 -1
  159. package/dist/logger/index.d.ts +105 -76
  160. package/dist/logger/index.d.ts.map +1 -1
  161. package/dist/logger/index.js +196 -174
  162. package/dist/logger/index.js.map +1 -1
  163. package/dist/mcp/index.d.ts +16 -20
  164. package/dist/mcp/index.d.ts.map +1 -1
  165. package/dist/mcp/index.js.map +1 -1
  166. package/dist/orm/core/index.browser.js.map +1 -1
  167. package/dist/orm/core/index.bun.js +19 -1
  168. package/dist/orm/core/index.bun.js.map +1 -1
  169. package/dist/orm/core/index.d.ts +76 -62
  170. package/dist/orm/core/index.d.ts.map +1 -1
  171. package/dist/orm/core/index.js +20 -2
  172. package/dist/orm/core/index.js.map +1 -1
  173. package/dist/orm/postgres/index.bun.js.map +1 -1
  174. package/dist/orm/postgres/index.d.ts +28 -20
  175. package/dist/orm/postgres/index.d.ts.map +1 -1
  176. package/dist/orm/postgres/index.js.map +1 -1
  177. package/dist/queue/core/index.d.ts +12 -15
  178. package/dist/queue/core/index.d.ts.map +1 -1
  179. package/dist/queue/core/index.js.map +1 -1
  180. package/dist/queue/core/index.workerd.js.map +1 -1
  181. package/dist/queue/redis/index.d.ts +3 -5
  182. package/dist/queue/redis/index.d.ts.map +1 -1
  183. package/dist/queue/redis/index.js.map +1 -1
  184. package/dist/react/auth/index.browser.js +9 -2
  185. package/dist/react/auth/index.browser.js.map +1 -1
  186. package/dist/react/auth/index.d.ts +14 -9
  187. package/dist/react/auth/index.d.ts.map +1 -1
  188. package/dist/react/auth/index.js +9 -2
  189. package/dist/react/auth/index.js.map +1 -1
  190. package/dist/react/core/index.d.ts +7 -8
  191. package/dist/react/core/index.d.ts.map +1 -1
  192. package/dist/react/core/index.js +6 -3
  193. package/dist/react/core/index.js.map +1 -1
  194. package/dist/react/form/index.d.ts +2 -4
  195. package/dist/react/form/index.d.ts.map +1 -1
  196. package/dist/react/form/index.js.map +1 -1
  197. package/dist/react/head/index.browser.js.map +1 -1
  198. package/dist/react/head/index.d.ts +2 -4
  199. package/dist/react/head/index.d.ts.map +1 -1
  200. package/dist/react/head/index.js.map +1 -1
  201. package/dist/react/i18n/index.d.ts +47 -11
  202. package/dist/react/i18n/index.d.ts.map +1 -1
  203. package/dist/react/i18n/index.js +33 -1
  204. package/dist/react/i18n/index.js.map +1 -1
  205. package/dist/react/intro/index.d.ts +1 -2
  206. package/dist/react/intro/index.d.ts.map +1 -1
  207. package/dist/react/intro/index.js +2 -2
  208. package/dist/react/intro/index.js.map +1 -1
  209. package/dist/react/router/index.browser.js +65 -19
  210. package/dist/react/router/index.browser.js.map +1 -1
  211. package/dist/react/router/index.d.ts +327 -222
  212. package/dist/react/router/index.d.ts.map +1 -1
  213. package/dist/react/router/index.js +65 -29
  214. package/dist/react/router/index.js.map +1 -1
  215. package/dist/react/testing/index.d.ts +1 -2
  216. package/dist/react/testing/index.d.ts.map +1 -1
  217. package/dist/react/testing/index.js +16 -17
  218. package/dist/react/testing/index.js.map +1 -1
  219. package/dist/react/ui/index.d.ts +20 -25
  220. package/dist/react/ui/index.d.ts.map +1 -1
  221. package/dist/react/ui/index.js.map +1 -1
  222. package/dist/redis/index.bun.js.map +1 -1
  223. package/dist/redis/index.d.ts +17 -19
  224. package/dist/redis/index.d.ts.map +1 -1
  225. package/dist/redis/index.js.map +1 -1
  226. package/dist/retry/index.d.ts +2 -4
  227. package/dist/retry/index.d.ts.map +1 -1
  228. package/dist/retry/index.js.map +1 -1
  229. package/dist/router/index.d.ts.map +1 -1
  230. package/dist/router/index.js.map +1 -1
  231. package/dist/scheduler/index.d.ts +10 -13
  232. package/dist/scheduler/index.d.ts.map +1 -1
  233. package/dist/scheduler/index.js.map +1 -1
  234. package/dist/scheduler/index.workerd.js.map +1 -1
  235. package/dist/security/index.browser.js.map +1 -1
  236. package/dist/security/index.d.ts +45 -48
  237. package/dist/security/index.d.ts.map +1 -1
  238. package/dist/security/index.js.map +1 -1
  239. package/dist/server/auth/index.browser.js.map +1 -1
  240. package/dist/server/auth/index.d.ts +167 -172
  241. package/dist/server/auth/index.d.ts.map +1 -1
  242. package/dist/server/auth/index.js +4 -8
  243. package/dist/server/auth/index.js.map +1 -1
  244. package/dist/server/cookies/index.browser.js.map +1 -1
  245. package/dist/server/cookies/index.d.ts +5 -7
  246. package/dist/server/cookies/index.d.ts.map +1 -1
  247. package/dist/server/cookies/index.js.map +1 -1
  248. package/dist/server/core/index.browser.js.map +1 -1
  249. package/dist/server/core/index.d.ts +88 -73
  250. package/dist/server/core/index.d.ts.map +1 -1
  251. package/dist/server/core/index.js +19 -0
  252. package/dist/server/core/index.js.map +1 -1
  253. package/dist/server/cors/index.d.ts +11 -14
  254. package/dist/server/cors/index.d.ts.map +1 -1
  255. package/dist/server/cors/index.js.map +1 -1
  256. package/dist/server/etag/index.d.ts +6 -9
  257. package/dist/server/etag/index.d.ts.map +1 -1
  258. package/dist/server/etag/index.js.map +1 -1
  259. package/dist/server/health/index.d.ts +18 -21
  260. package/dist/server/health/index.d.ts.map +1 -1
  261. package/dist/server/health/index.js.map +1 -1
  262. package/dist/server/links/index.browser.js +2 -0
  263. package/dist/server/links/index.browser.js.map +1 -1
  264. package/dist/server/links/index.d.ts +63 -67
  265. package/dist/server/links/index.d.ts.map +1 -1
  266. package/dist/server/links/index.js +2 -0
  267. package/dist/server/links/index.js.map +1 -1
  268. package/dist/server/metrics/index.d.ts +5 -7
  269. package/dist/server/metrics/index.d.ts.map +1 -1
  270. package/dist/server/metrics/index.js.map +1 -1
  271. package/dist/server/proxy/index.d.ts +3 -5
  272. package/dist/server/proxy/index.d.ts.map +1 -1
  273. package/dist/server/proxy/index.js.map +1 -1
  274. package/dist/server/rate-limit/index.d.ts +10 -13
  275. package/dist/server/rate-limit/index.d.ts.map +1 -1
  276. package/dist/server/rate-limit/index.js.map +1 -1
  277. package/dist/server/static/index.d.ts +3 -5
  278. package/dist/server/static/index.d.ts.map +1 -1
  279. package/dist/server/static/index.js.map +1 -1
  280. package/dist/server/swagger/index.d.ts +5 -8
  281. package/dist/server/swagger/index.d.ts.map +1 -1
  282. package/dist/server/swagger/index.js.map +1 -1
  283. package/dist/sms/index.d.ts +3 -5
  284. package/dist/sms/index.d.ts.map +1 -1
  285. package/dist/sms/index.js.map +1 -1
  286. package/dist/system/index.browser.js.map +1 -1
  287. package/dist/system/index.d.ts +2 -4
  288. package/dist/system/index.d.ts.map +1 -1
  289. package/dist/system/index.js.map +1 -1
  290. package/dist/system/index.workerd.js.map +1 -1
  291. package/dist/topic/core/index.d.ts +4 -6
  292. package/dist/topic/core/index.d.ts.map +1 -1
  293. package/dist/topic/core/index.js.map +1 -1
  294. package/dist/topic/redis/index.d.ts +5 -8
  295. package/dist/topic/redis/index.d.ts.map +1 -1
  296. package/dist/topic/redis/index.js.map +1 -1
  297. package/package.json +45 -22
  298. package/src/api/audits/__tests__/AuditService.spec.ts +18 -110
  299. package/src/api/audits/controllers/AdminAuditController.ts +14 -0
  300. package/src/api/audits/services/AuditService.ts +21 -88
  301. package/src/api/files/__tests__/FileService.spec.ts +207 -2
  302. package/src/api/files/index.ts +3 -0
  303. package/src/api/files/schemas/fileCreatorSummarySchema.ts +22 -0
  304. package/src/api/files/schemas/fileResourceSchema.ts +10 -1
  305. package/src/api/files/services/FileService.ts +170 -72
  306. package/src/api/jobs/__tests__/$job.spec.ts +24 -1
  307. package/src/api/jobs/index.ts +4 -3
  308. package/src/api/jobs/primitives/$job.ts +7 -3
  309. package/src/api/jobs/providers/DirectJobDispatcher.ts +17 -36
  310. package/src/api/jobs/providers/JobProvider.ts +53 -24
  311. package/src/api/jobs/schemas/jobConfigAtom.ts +1 -1
  312. package/src/api/jobs/schemas/jobExecutionResourceSchema.ts +4 -1
  313. package/src/api/keys/schemas/adminApiKeyResourceSchema.ts +3 -1
  314. package/src/api/parameters/__tests__/$parameter.spec.ts +19 -2
  315. package/src/api/parameters/audits/ParameterAudits.ts +17 -0
  316. package/src/api/parameters/controllers/AdminParameterController.ts +95 -19
  317. package/src/api/parameters/index.ts +3 -0
  318. package/src/api/parameters/schemas/activateParameterBodySchema.ts +3 -3
  319. package/src/api/parameters/schemas/createParameterVersionBodySchema.ts +3 -2
  320. package/src/api/parameters/schemas/parameterCreatorSummarySchema.ts +25 -0
  321. package/src/api/parameters/schemas/parameterResponseSchema.ts +5 -0
  322. package/src/api/parameters/schemas/rollbackParameterBodySchema.ts +4 -2
  323. package/src/api/parameters/services/ParameterProvider.ts +69 -6
  324. package/src/api/subscriptions/jobs/SubscriptionJobs.ts +1 -1
  325. package/src/api/users/__tests__/AdminSessionController.spec.ts +37 -0
  326. package/src/api/users/audits/SessionAudits.ts +33 -0
  327. package/src/api/users/audits/UserAudits.ts +19 -43
  328. package/src/api/users/controllers/AdminUserController.ts +66 -1
  329. package/src/api/users/entities/sessions.ts +6 -0
  330. package/src/api/users/entities/users.ts +2 -0
  331. package/src/api/users/index.ts +9 -1
  332. package/src/api/users/primitives/$realm.ts +3 -0
  333. package/src/api/users/schemas/sessionResourceSchema.ts +16 -0
  334. package/src/api/users/schemas/updateUserSchema.ts +1 -8
  335. package/src/api/users/schemas/userQuerySchema.ts +7 -0
  336. package/src/api/users/services/CredentialService.ts +15 -6
  337. package/src/api/users/services/IdentityService.ts +2 -1
  338. package/src/api/users/services/RegistrationService.ts +2 -1
  339. package/src/api/users/services/SessionCrudService.ts +19 -2
  340. package/src/api/users/services/SessionService.ts +39 -19
  341. package/src/api/users/services/UserService.ts +106 -8
  342. package/src/background/__tests__/BackgroundTaskProvider.spec.ts +96 -0
  343. package/src/background/index.ts +37 -0
  344. package/src/background/index.workerd.ts +28 -0
  345. package/src/background/providers/BackgroundTaskProvider.ts +70 -0
  346. package/src/background/providers/WorkerdBackgroundTaskProvider.ts +43 -0
  347. package/src/bucket/__tests__/$bucket.spec.ts +18 -0
  348. package/src/bucket/__tests__/LocalFileStorageProvider.spec.ts +5 -0
  349. package/src/bucket/__tests__/MemoryFileStorageProvider.spec.ts +5 -0
  350. package/src/bucket/__tests__/NodeS3BucketProvider.spec.ts +23 -4
  351. package/src/bucket/__tests__/shared.ts +30 -0
  352. package/src/bucket/index.ts +5 -5
  353. package/src/bucket/index.workerd.ts +11 -4
  354. package/src/bucket/primitives/$bucket.ts +27 -0
  355. package/src/bucket/providers/FileStorageProvider.ts +13 -0
  356. package/src/bucket/providers/LocalFileStorageProvider.ts +17 -1
  357. package/src/bucket/providers/MemoryFileStorageProvider.ts +7 -0
  358. package/src/bucket/providers/{CloudflareR2Provider.ts → R2FileStorageProvider.ts} +10 -1
  359. package/src/bucket/providers/{NodeS3BucketProvider.ts → S3FileStorageProvider.ts} +27 -5
  360. package/src/cli/core/__tests__/BuildDockerTask.spec.ts +25 -1
  361. package/src/cli/core/__tests__/init.spec.ts +0 -219
  362. package/src/cli/core/commands/__tests__/BuildCommand.spec.ts +43 -0
  363. package/src/cli/core/commands/build.ts +108 -30
  364. package/src/cli/core/commands/init.ts +0 -12
  365. package/src/cli/core/commands/pack.ts +133 -0
  366. package/src/cli/core/index.ts +3 -0
  367. package/src/cli/core/providers/ViteDevServerProvider.ts +40 -16
  368. package/src/cli/core/services/PackageManagerUtils.ts +0 -16
  369. package/src/cli/core/services/ProjectScaffolder.ts +29 -291
  370. package/src/cli/core/tasks/BuildCloudflareTask.ts +353 -47
  371. package/src/cli/core/tasks/BuildDockerTask.ts +33 -3
  372. package/src/cli/core/tasks/BuildTask.ts +34 -0
  373. package/src/cli/core/templates/apiIndexTs.ts +1 -22
  374. package/src/cli/core/templates/mainCss.ts +0 -1
  375. package/src/cli/core/templates/webAppRouterTs.ts +0 -99
  376. package/src/cli/core/templates/webIndexTs.ts +1 -22
  377. package/src/cli/platform/__tests__/SecretsCommand.spec.ts +5 -3
  378. package/src/cli/platform/commands/SecretsCommand.ts +8 -6
  379. package/src/cli/platform/commands/platform.ts +192 -46
  380. package/src/cli/platform/index.ts +12 -52
  381. package/src/cli/{platform → platform-lib}/__tests__/CloudflareAdapter.spec.ts +426 -169
  382. package/src/cli/{platform → platform-lib}/__tests__/NamingService.spec.ts +91 -4
  383. package/src/cli/{platform → platform-lib}/__tests__/VercelAdapter.spec.ts +56 -85
  384. package/src/cli/{platform → platform-lib}/adapters/CloudflareAdapter.ts +402 -165
  385. package/src/cli/{platform → platform-lib}/adapters/PlatformAdapter.ts +62 -35
  386. package/src/cli/{platform → platform-lib}/adapters/VercelAdapter.ts +6 -10
  387. package/src/cli/{platform → platform-lib}/atoms/platformOptions.ts +34 -1
  388. package/src/cli/platform-lib/index.ts +67 -0
  389. package/src/cli/platform-lib/services/NamingService.ts +136 -0
  390. package/src/cli/{platform → platform-lib}/services/PlatformInspector.ts +60 -13
  391. package/src/cli/{platform → platform-lib}/services/PlatformOrchestrator.ts +54 -43
  392. package/src/cli/{platform → platform-lib}/services/WranglerApi.ts +4 -2
  393. package/src/command/__tests__/Runner.spec.ts +20 -0
  394. package/src/command/helpers/EnvUtils.ts +19 -3
  395. package/src/command/helpers/Runner.ts +12 -2
  396. package/src/command/providers/CliProvider.ts +34 -1
  397. package/src/{containers → container}/core/__tests__/$container.spec.ts +5 -5
  398. package/src/{containers → container}/core/index.ts +4 -4
  399. package/src/{containers → container}/core/index.workerd.ts +19 -3
  400. package/src/{containers → container}/core/primitives/$container.ts +1 -1
  401. package/src/{containers → container}/core/providers/CloudflareContainerProvider.ts +17 -19
  402. package/src/{containers → container}/core/providers/ContainerProvider.ts +16 -2
  403. package/src/{containers → container}/core/providers/MockContainerProvider.ts +1 -1
  404. package/src/core/Alepha.ts +49 -1
  405. package/src/core/__tests__/$env.spec.ts +42 -0
  406. package/src/core/__tests__/dump.spec.ts +47 -0
  407. package/src/email/cloudflare/__tests__/CloudflareEmailProvider.spec.ts +42 -10
  408. package/src/email/cloudflare/index.ts +14 -5
  409. package/src/email/cloudflare/providers/CloudflareEmailProvider.ts +54 -9
  410. package/src/logger/__tests__/Logger.spec.ts +55 -0
  411. package/src/logger/index.ts +13 -0
  412. package/src/logger/services/Logger.ts +31 -1
  413. package/src/orm/__tests__/orm-showcase-tests.ts +27 -0
  414. package/src/orm/__tests__/orm-showcase.spec.ts +12 -0
  415. package/src/orm/core/interfaces/PgQuery.ts +4 -1
  416. package/src/orm/core/services/Repository.ts +27 -11
  417. package/src/react/auth/hooks/useAuth.ts +10 -5
  418. package/src/react/core/__tests__/useQuery.browser.spec.tsx +25 -0
  419. package/src/react/core/hooks/useAction.ts +14 -3
  420. package/src/react/core/hooks/useQuery.ts +24 -4
  421. package/src/react/i18n/components/Translate.tsx +47 -0
  422. package/src/react/i18n/index.ts +2 -0
  423. package/src/react/intro/components/GettingStartedAdminSlide.tsx +2 -2
  424. package/src/react/router/__tests__/$page.spec.tsx +3 -2
  425. package/src/react/router/__tests__/page-can.spec.ts +18 -13
  426. package/src/react/router/hooks/useQueryParams.ts +114 -14
  427. package/src/react/router/primitives/$page.ts +85 -4
  428. package/src/react/router/providers/ReactBrowserRouterProvider.ts +3 -7
  429. package/src/react/router/providers/ReactServerProvider.ts +4 -13
  430. package/src/react/ui/services/SchemaControl.ts +3 -4
  431. package/src/server/core/providers/ServerMultipartProvider.ts +19 -0
  432. package/src/server/links/providers/LinkProvider.ts +10 -0
  433. package/dist/containers/core/index.d.ts.map +0 -1
  434. package/dist/containers/core/index.js.map +0 -1
  435. package/dist/containers/core/index.workerd.js.map +0 -1
  436. package/src/cli/core/templates/componentsJsonTs.ts +0 -39
  437. package/src/cli/core/templates/saasAdminLayoutTsx.ts +0 -77
  438. package/src/cli/core/templates/saasAdminPagesTsx.ts +0 -26
  439. package/src/cli/core/templates/saasAuthLayoutTsx.ts +0 -22
  440. package/src/cli/core/templates/saasAuthPagesTsx.ts +0 -62
  441. package/src/cli/core/templates/saasRealmProviderTs.ts +0 -52
  442. package/src/cli/platform/services/NamingService.ts +0 -54
  443. /package/dist/orm/core/{chunk-o8xxKEmq.js → chunk-B4FMCO8f.js} +0 -0
  444. /package/dist/react/testing/{chunk-6Ep1yQYe.js → chunk-BpyX8vjI.js} +0 -0
  445. /package/src/cli/{platform → platform-lib}/__tests__/GitHubSecretStore.spec.ts +0 -0
  446. /package/src/cli/{platform → platform-lib}/__tests__/PlatformCacheProvider.spec.ts +0 -0
  447. /package/src/cli/{platform → platform-lib}/__tests__/PlatformInspector.spec.ts +0 -0
  448. /package/src/cli/{platform → platform-lib}/__tests__/PlatformOrchestrator.spec.ts +0 -0
  449. /package/src/cli/{platform → platform-lib}/__tests__/SecretFilterService.spec.ts +0 -0
  450. /package/src/cli/{platform → platform-lib}/__tests__/detectResources.spec.ts +0 -0
  451. /package/src/cli/{platform → platform-lib}/providers/GitHubSecretStore.ts +0 -0
  452. /package/src/cli/{platform → platform-lib}/providers/MemorySecretStore.ts +0 -0
  453. /package/src/cli/{platform → platform-lib}/providers/PlatformCacheProvider.ts +0 -0
  454. /package/src/cli/{platform → platform-lib}/providers/SecretStoreProvider.ts +0 -0
  455. /package/src/cli/{platform → platform-lib}/schemas/cloudflare.ts +0 -0
  456. /package/src/cli/{platform → platform-lib}/schemas/platform.ts +0 -0
  457. /package/src/cli/{platform → platform-lib}/schemas/vercel.ts +0 -0
  458. /package/src/cli/{platform → platform-lib}/services/CloudflareApi.ts +0 -0
  459. /package/src/cli/{platform → platform-lib}/services/SecretFilterService.ts +0 -0
  460. /package/src/cli/{platform → platform-lib}/services/VercelApi.ts +0 -0
  461. /package/src/cli/{platform → platform-lib}/services/VercelCli.ts +0 -0
  462. /package/src/{containers → container}/core/interfaces/ContainerOptions.ts +0 -0
  463. /package/src/{containers → container}/core/providers/NodeContainerProvider.ts +0 -0
@@ -1,10 +1,5 @@
1
- import * as _$alepha from "alepha";
2
1
  import { Alepha, Static, TNull, TObject, TOptional, TSchema, TUnion } from "alepha";
3
- import * as _$alepha_server0 from "alepha/server";
4
- import * as _$alepha_orm0 from "alepha/orm";
5
2
  import { Page } from "alepha/orm";
6
- import * as _$alepha_logger0 from "alepha/logger";
7
- import * as _$typebox from "typebox";
8
3
  import { BuildExtraConfigColumns, SQL } from "drizzle-orm";
9
4
  import { PgColumnBuilderBase, PgSequenceOptions, PgTableExtraConfigValue, UpdateDeleteAction } from "drizzle-orm/pg-core";
10
5
  //#region ../../src/orm/core/schemas/insertSchema.d.ts
@@ -298,8 +293,8 @@ type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]:
298
293
  * - `d1://BINDING_NAME` — Cloudflare D1
299
294
  * - `hyperdrive://BINDING_NAME` — Cloudflare Hyperdrive
300
295
  */
301
- declare const databaseEnvSchema: _$typebox.TObject<{
302
- DATABASE_URL: _$typebox.TOptional<_$typebox.TString>;
296
+ declare const databaseEnvSchema: import("typebox").TObject<{
297
+ DATABASE_URL: import("typebox").TOptional<import("typebox").TString>;
303
298
  /**
304
299
  * Enable or disable push-based schema synchronization (drizzle-kit push).
305
300
  *
@@ -307,62 +302,62 @@ declare const databaseEnvSchema: _$typebox.TObject<{
307
302
  * Set to `false` in development to skip automatic schema sync
308
303
  * (e.g. when managing migrations manually).
309
304
  */
310
- DATABASE_SYNC: _$typebox.TOptional<_$typebox.TBoolean>;
305
+ DATABASE_SYNC: import("typebox").TOptional<import("typebox").TBoolean>;
311
306
  }>;
312
307
  declare module "alepha" {
313
308
  interface Env extends Partial<Static<typeof databaseEnvSchema>> {}
314
309
  } //# sourceMappingURL=databaseEnvSchema.d.ts.map
315
310
  //#endregion
316
311
  //#region ../../src/api/organizations/entities/organizations.d.ts
317
- declare const organizations: _$alepha_orm0.EntityPrimitive<_$typebox.TObject<{
318
- id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
319
- version: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TInteger, typeof _$alepha_orm0.PG_VERSION>, typeof _$alepha_orm0.PG_DEFAULT>;
320
- createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
321
- updatedAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_UPDATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
322
- name: _$typebox.TString;
323
- slug: _$typebox.TString;
324
- enabled: _$alepha_orm0.PgAttr<_$typebox.TBoolean, typeof _$alepha_orm0.PG_DEFAULT>;
312
+ declare const organizations: import("alepha/orm").EntityPrimitive<import("typebox").TObject<{
313
+ id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
314
+ version: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TInteger, typeof import("alepha/orm").PG_VERSION>, typeof import("alepha/orm").PG_DEFAULT>;
315
+ createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
316
+ updatedAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_UPDATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
317
+ name: import("typebox").TString;
318
+ slug: import("typebox").TString;
319
+ enabled: import("alepha/orm").PgAttr<import("typebox").TBoolean, typeof import("alepha/orm").PG_DEFAULT>;
325
320
  }>>;
326
321
  type OrganizationEntity = Static<typeof organizations.schema>;
327
322
  //#endregion
328
323
  //#region ../../src/api/organizations/schemas/createOrganizationSchema.d.ts
329
- declare const createOrganizationSchema: _$typebox.TObject<{
330
- name: _$typebox.TString;
331
- slug: _$typebox.TString;
332
- enabled: _$typebox.TOptional<_$typebox.TBoolean>;
324
+ declare const createOrganizationSchema: import("typebox").TObject<{
325
+ name: import("typebox").TString;
326
+ slug: import("typebox").TString;
327
+ enabled: import("typebox").TOptional<import("typebox").TBoolean>;
333
328
  }>;
334
329
  type CreateOrganization = Static<typeof createOrganizationSchema>;
335
330
  //#endregion
336
331
  //#region ../../src/api/organizations/schemas/organizationQuerySchema.d.ts
337
- declare const organizationQuerySchema: _$typebox.TObject<{
338
- page: _$typebox.TOptional<_$typebox.TInteger>;
339
- size: _$typebox.TOptional<_$typebox.TInteger>;
340
- sort: _$typebox.TOptional<_$typebox.TString>;
341
- name: _$typebox.TOptional<_$typebox.TString>;
342
- enabled: _$typebox.TOptional<_$typebox.TBoolean>;
332
+ declare const organizationQuerySchema: import("typebox").TObject<{
333
+ page: import("typebox").TOptional<import("typebox").TInteger>;
334
+ size: import("typebox").TOptional<import("typebox").TInteger>;
335
+ sort: import("typebox").TOptional<import("typebox").TString>;
336
+ name: import("typebox").TOptional<import("typebox").TString>;
337
+ enabled: import("typebox").TOptional<import("typebox").TBoolean>;
343
338
  }>;
344
339
  type OrganizationQuery = Static<typeof organizationQuerySchema>;
345
340
  //#endregion
346
341
  //#region ../../src/api/organizations/schemas/updateOrganizationSchema.d.ts
347
- declare const updateOrganizationSchema: _$typebox.TObject<{
348
- name: _$typebox.TOptional<_$typebox.TString>;
349
- slug: _$typebox.TOptional<_$typebox.TString>;
350
- enabled: _$typebox.TOptional<_$typebox.TBoolean>;
342
+ declare const updateOrganizationSchema: import("typebox").TObject<{
343
+ name: import("typebox").TOptional<import("typebox").TString>;
344
+ slug: import("typebox").TOptional<import("typebox").TString>;
345
+ enabled: import("typebox").TOptional<import("typebox").TBoolean>;
351
346
  }>;
352
347
  type UpdateOrganization = Static<typeof updateOrganizationSchema>;
353
348
  //#endregion
354
349
  //#region ../../src/api/organizations/services/OrganizationService.d.ts
355
350
  declare class OrganizationService {
356
351
  protected readonly alepha: Alepha;
357
- protected readonly log: _$alepha_logger0.Logger;
358
- protected readonly repo: _$alepha_orm0.Repository<_$typebox.TObject<{
359
- id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
360
- version: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TInteger, typeof _$alepha_orm0.PG_VERSION>, typeof _$alepha_orm0.PG_DEFAULT>;
361
- createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
362
- updatedAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_UPDATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
363
- name: _$typebox.TString;
364
- slug: _$typebox.TString;
365
- enabled: _$alepha_orm0.PgAttr<_$typebox.TBoolean, typeof _$alepha_orm0.PG_DEFAULT>;
352
+ protected readonly log: import("alepha/logger").Logger;
353
+ protected readonly repo: import("alepha/orm").Repository<import("typebox").TObject<{
354
+ id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
355
+ version: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TInteger, typeof import("alepha/orm").PG_VERSION>, typeof import("alepha/orm").PG_DEFAULT>;
356
+ createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
357
+ updatedAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("typebox").TString, typeof import("alepha/orm").PG_UPDATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
358
+ name: import("typebox").TString;
359
+ slug: import("typebox").TString;
360
+ enabled: import("alepha/orm").PgAttr<import("typebox").TBoolean, typeof import("alepha/orm").PG_DEFAULT>;
366
361
  }>>;
367
362
  /**
368
363
  * Find organizations with pagination and filtering.
@@ -398,106 +393,106 @@ declare class AdminOrganizationController {
398
393
  /**
399
394
  * Find organizations with pagination and filtering.
400
395
  */
401
- readonly findOrganizations: _$alepha_server0.ActionPrimitiveFn<{
402
- query: _$typebox.TObject<{
403
- page: _$typebox.TOptional<_$typebox.TInteger>;
404
- size: _$typebox.TOptional<_$typebox.TInteger>;
405
- sort: _$typebox.TOptional<_$typebox.TString>;
406
- name: _$typebox.TOptional<_$typebox.TString>;
407
- enabled: _$typebox.TOptional<_$typebox.TBoolean>;
396
+ readonly findOrganizations: import("alepha/server").ActionPrimitiveFn<{
397
+ query: import("typebox").TObject<{
398
+ page: import("typebox").TOptional<import("typebox").TInteger>;
399
+ size: import("typebox").TOptional<import("typebox").TInteger>;
400
+ sort: import("typebox").TOptional<import("typebox").TString>;
401
+ name: import("typebox").TOptional<import("typebox").TString>;
402
+ enabled: import("typebox").TOptional<import("typebox").TBoolean>;
408
403
  }>;
409
- response: _$alepha.TPage<_$typebox.TObject<{
410
- id: PgAttr<PgAttr<_$typebox.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
411
- version: PgAttr<PgAttr<_$typebox.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
412
- createdAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
413
- updatedAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
414
- name: _$typebox.TString;
415
- slug: _$typebox.TString;
416
- enabled: PgAttr<_$typebox.TBoolean, typeof PG_DEFAULT>;
404
+ response: import("alepha").TPage<import("typebox").TObject<{
405
+ id: PgAttr<PgAttr<import("typebox").TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
406
+ version: PgAttr<PgAttr<import("typebox").TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
407
+ createdAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
408
+ updatedAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
409
+ name: import("typebox").TString;
410
+ slug: import("typebox").TString;
411
+ enabled: PgAttr<import("typebox").TBoolean, typeof PG_DEFAULT>;
417
412
  }>>;
418
413
  }>;
419
414
  /**
420
415
  * Get an organization by ID.
421
416
  */
422
- readonly getOrganization: _$alepha_server0.ActionPrimitiveFn<{
423
- params: _$typebox.TObject<{
424
- id: _$typebox.TString;
417
+ readonly getOrganization: import("alepha/server").ActionPrimitiveFn<{
418
+ params: import("typebox").TObject<{
419
+ id: import("typebox").TString;
425
420
  }>;
426
- response: _$typebox.TObject<{
427
- id: PgAttr<PgAttr<_$typebox.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
428
- version: PgAttr<PgAttr<_$typebox.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
429
- createdAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
430
- updatedAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
431
- name: _$typebox.TString;
432
- slug: _$typebox.TString;
433
- enabled: PgAttr<_$typebox.TBoolean, typeof PG_DEFAULT>;
421
+ response: import("typebox").TObject<{
422
+ id: PgAttr<PgAttr<import("typebox").TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
423
+ version: PgAttr<PgAttr<import("typebox").TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
424
+ createdAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
425
+ updatedAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
426
+ name: import("typebox").TString;
427
+ slug: import("typebox").TString;
428
+ enabled: PgAttr<import("typebox").TBoolean, typeof PG_DEFAULT>;
434
429
  }>;
435
430
  }>;
436
431
  /**
437
432
  * Create a new organization.
438
433
  */
439
- readonly createOrganization: _$alepha_server0.ActionPrimitiveFn<{
440
- body: _$typebox.TObject<{
441
- name: _$typebox.TString;
442
- slug: _$typebox.TString;
443
- enabled: _$typebox.TOptional<_$typebox.TBoolean>;
434
+ readonly createOrganization: import("alepha/server").ActionPrimitiveFn<{
435
+ body: import("typebox").TObject<{
436
+ name: import("typebox").TString;
437
+ slug: import("typebox").TString;
438
+ enabled: import("typebox").TOptional<import("typebox").TBoolean>;
444
439
  }>;
445
- response: _$typebox.TObject<{
446
- id: PgAttr<PgAttr<_$typebox.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
447
- version: PgAttr<PgAttr<_$typebox.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
448
- createdAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
449
- updatedAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
450
- name: _$typebox.TString;
451
- slug: _$typebox.TString;
452
- enabled: PgAttr<_$typebox.TBoolean, typeof PG_DEFAULT>;
440
+ response: import("typebox").TObject<{
441
+ id: PgAttr<PgAttr<import("typebox").TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
442
+ version: PgAttr<PgAttr<import("typebox").TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
443
+ createdAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
444
+ updatedAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
445
+ name: import("typebox").TString;
446
+ slug: import("typebox").TString;
447
+ enabled: PgAttr<import("typebox").TBoolean, typeof PG_DEFAULT>;
453
448
  }>;
454
449
  }>;
455
450
  /**
456
451
  * Update an organization.
457
452
  */
458
- readonly updateOrganization: _$alepha_server0.ActionPrimitiveFn<{
459
- params: _$typebox.TObject<{
460
- id: _$typebox.TString;
453
+ readonly updateOrganization: import("alepha/server").ActionPrimitiveFn<{
454
+ params: import("typebox").TObject<{
455
+ id: import("typebox").TString;
461
456
  }>;
462
- body: _$typebox.TObject<{
463
- name: _$typebox.TOptional<_$typebox.TString>;
464
- slug: _$typebox.TOptional<_$typebox.TString>;
465
- enabled: _$typebox.TOptional<_$typebox.TBoolean>;
457
+ body: import("typebox").TObject<{
458
+ name: import("typebox").TOptional<import("typebox").TString>;
459
+ slug: import("typebox").TOptional<import("typebox").TString>;
460
+ enabled: import("typebox").TOptional<import("typebox").TBoolean>;
466
461
  }>;
467
- response: _$typebox.TObject<{
468
- id: PgAttr<PgAttr<_$typebox.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
469
- version: PgAttr<PgAttr<_$typebox.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
470
- createdAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
471
- updatedAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
472
- name: _$typebox.TString;
473
- slug: _$typebox.TString;
474
- enabled: PgAttr<_$typebox.TBoolean, typeof PG_DEFAULT>;
462
+ response: import("typebox").TObject<{
463
+ id: PgAttr<PgAttr<import("typebox").TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
464
+ version: PgAttr<PgAttr<import("typebox").TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
465
+ createdAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
466
+ updatedAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
467
+ name: import("typebox").TString;
468
+ slug: import("typebox").TString;
469
+ enabled: PgAttr<import("typebox").TBoolean, typeof PG_DEFAULT>;
475
470
  }>;
476
471
  }>;
477
472
  /**
478
473
  * Delete an organization.
479
474
  */
480
- readonly deleteOrganization: _$alepha_server0.ActionPrimitiveFn<{
481
- params: _$typebox.TObject<{
482
- id: _$typebox.TString;
475
+ readonly deleteOrganization: import("alepha/server").ActionPrimitiveFn<{
476
+ params: import("typebox").TObject<{
477
+ id: import("typebox").TString;
483
478
  }>;
484
- response: _$typebox.TObject<{
485
- ok: _$typebox.TBoolean;
486
- id: _$typebox.TOptional<_$typebox.TUnion<[_$typebox.TString, _$typebox.TInteger]>>;
487
- count: _$typebox.TOptional<_$typebox.TNumber>;
479
+ response: import("typebox").TObject<{
480
+ ok: import("typebox").TBoolean;
481
+ id: import("typebox").TOptional<import("typebox").TUnion<[import("typebox").TString, import("typebox").TInteger]>>;
482
+ count: import("typebox").TOptional<import("typebox").TNumber>;
488
483
  }>;
489
484
  }>;
490
485
  }
491
486
  //#endregion
492
487
  //#region ../../src/api/organizations/schemas/organizationResourceSchema.d.ts
493
- declare const organizationResourceSchema: _$typebox.TObject<{
494
- id: PgAttr<PgAttr<_$typebox.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
495
- version: PgAttr<PgAttr<_$typebox.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
496
- createdAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
497
- updatedAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
498
- name: _$typebox.TString;
499
- slug: _$typebox.TString;
500
- enabled: PgAttr<_$typebox.TBoolean, typeof PG_DEFAULT>;
488
+ declare const organizationResourceSchema: import("typebox").TObject<{
489
+ id: PgAttr<PgAttr<import("typebox").TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
490
+ version: PgAttr<PgAttr<import("typebox").TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
491
+ createdAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
492
+ updatedAt: PgAttr<PgAttr<import("typebox").TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
493
+ name: import("typebox").TString;
494
+ slug: import("typebox").TString;
495
+ enabled: PgAttr<import("typebox").TBoolean, typeof PG_DEFAULT>;
501
496
  }>;
502
497
  type OrganizationResource = Static<typeof organizationResourceSchema>;
503
498
  //#endregion
@@ -513,7 +508,7 @@ type OrganizationResource = Static<typeof organizationResourceSchema>;
513
508
  *
514
509
  * @module alepha.api.organizations
515
510
  */
516
- declare const AlephaApiOrganizations: _$alepha.Service<_$alepha.Module>;
511
+ declare const AlephaApiOrganizations: import("alepha").Service<import("alepha").Module>;
517
512
  //#endregion
518
513
  export { AdminOrganizationController, AlephaApiOrganizations, CreateOrganization, OrganizationEntity, OrganizationQuery, OrganizationResource, OrganizationService, UpdateOrganization, createOrganizationSchema, organizationQuerySchema, organizationResourceSchema, organizations, updateOrganizationSchema };
519
514
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/orm/core/schemas/insertSchema.ts","../../../src/orm/core/schemas/updateSchema.ts","../../../src/orm/core/primitives/$entity.ts","../../../src/orm/core/constants/PG_SYMBOLS.ts","../../../src/orm/core/helpers/pgAttr.ts","../../../src/orm/core/schemas/databaseEnvSchema.ts","../../../src/api/organizations/entities/organizations.ts","../../../src/api/organizations/schemas/createOrganizationSchema.ts","../../../src/api/organizations/schemas/organizationQuerySchema.ts","../../../src/api/organizations/schemas/updateOrganizationSchema.ts","../../../src/api/organizations/services/OrganizationService.ts","../../../src/api/organizations/controllers/AdminOrganizationController.ts","../../../src/api/organizations/schemas/organizationResourceSchema.ts","../../../src/api/organizations/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;KAiBY,aAAA,WAAwB,OAAA,IAAW,OAAA,eACjC,CAAA,kBAAmB,CAAA,eAAgB,CAAA;EAAA,CAC5C,YAAA;AAAA,YAGC,CAAA,GAAI,CAAA,eAAgB,CAAA;EAAA,CACjB,UAAA;AAAA;EAAA,CACA,eAAA;AAAA;EACD,WAAA;AAAA,IACF,SAAA,CAAU,CAAA,eAAgB,CAAA,KAC1B,CAAA,eAAgB,CAAA;;;;;;;;;;;;KCTV,aAAA,WAAwB,OAAA,IAAW,OAAA,eACjC,CAAA,kBAAmB,CAAA,eAAgB,CAAA;EAAA,CAC5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,IAAA,WAAe,OAAA,CAAQ,kBAAA;EVvBvC;;;EU8BM,MAAA,CAAO,IAAA,EAAM,kBAAA,GAAqB,OAAA,CAAQ,kBAAA;EV3BnD;;;EUkCS,MAAA,CACX,EAAA,UACA,IAAA,EAAM,kBAAA,GACL,OAAA,CAAQ,kBAAA;EV/CyC;;;EUsDvC,MAAA,CAAO,EAAA,WAAa,OAAA;AAAA;;;cC9DtB,2BAAA;EAAA,mBACQ,GAAA;EAAA,mBACA,KAAA;EAAA,mBACA,mBAAA,EAAmB,mBAAA;;;;WAKtB,iBAAA,mBAAiB,iBAAA;;gCALK,SAAA,CAAA,QAAA;;;;;;;;;;;;;;;;EXUlC;;;EAAA,SWUY,eAAA,mBAAe,iBAAA;;UAfE,SAAA,CAAA,OAAA;IAAA;;;;;;;;;;;EXCrB;;;EAAA,SW+BI,kBAAA,mBAAkB,iBAAA;;YAjBH,SAAA,CAAA,OAAA;;;;;;;;;;;;;;;AVdjC;;WU+CkB,kBAAA,mBAAkB,iBAAA;;UAhBA,SAAA,CAAA,OAAA;IAAA;;;;;;;;;;;;;;;;EV/BV;;;EAAA,SUmER,kBAAA,mBAAkB,iBAAA;;UApBA,SAAA,CAAA,OAAA;IAAA;;;;;;;;;;cC9DvB,0BAAA,YAA0B,OAAA;oBAAuB,SAAA,CAAA,OAAA;;;;;;;;KAElD,oBAAA,GAAuB,MAAA,QAAc,0BAAA;;;;;;;;;;;;;;cCsBpC,sBAAA,EAAsB,QAAA,CAAA,OAAA,CAGjC,QAAA,CAHiC,MAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/orm/core/schemas/insertSchema.ts","../../../src/orm/core/schemas/updateSchema.ts","../../../src/orm/core/primitives/$entity.ts","../../../src/orm/core/constants/PG_SYMBOLS.ts","../../../src/orm/core/helpers/pgAttr.ts","../../../src/orm/core/schemas/databaseEnvSchema.ts","../../../src/api/organizations/entities/organizations.ts","../../../src/api/organizations/schemas/createOrganizationSchema.ts","../../../src/api/organizations/schemas/organizationQuerySchema.ts","../../../src/api/organizations/schemas/updateOrganizationSchema.ts","../../../src/api/organizations/services/OrganizationService.ts","../../../src/api/organizations/controllers/AdminOrganizationController.ts","../../../src/api/organizations/schemas/organizationResourceSchema.ts","../../../src/api/organizations/index.ts"],"mappings":";;;;;;;;;;;;;;KAiBY,aAAA,WAAwB,OAAA,IAAW,OAAA,eACjC,CAAA,kBAAmB,CAAA,eAAgB,CAAA;EAAA,CAC5C,YAAA;AAAA,YAGC,CAAA,GAAI,CAAA,eAAgB,CAAA;EAAA,CACjB,UAAA;AAAA;EAAA,CACA,eAAA;AAAA;EACD,WAAA;AAAA,IACF,SAAA,CAAU,CAAA,eAAgB,CAAA,KAC1B,CAAA,eAAgB,CAAA;;;;;;;;;;;;KCTV,aAAA,WAAwB,OAAA,IAAW,OAAA,eACjC,CAAA,kBAAmB,CAAA,eAAgB,CAAA;EAAA,CAC5C,YAAA;AAAA,YAGC,CAAA,GAAI,CAAA,eAAgB,CAAA,UAAW,SAAA,YAC/B,SAAA,CAAU,MAAA,EAAQ,CAAA,EAAG,KAAA,MACrB,CAAA,eAAgB,CAAA;;;UCWL,sBAAA,WACL,OAAA,eACG,MAAA,CAAO,CAAA;EFZhB;;;;EEkBJ,IAAA;EF3BoD;;;EEgCpD,MAAA,EAAQ,CAAA;EF/BP;;;EEoCD,OAAA,IACI,IAAA;IFpCD;;;IEyCG,MAAA,EAAQ,IAAA;IFrCP;;;IEyCD,MAAA;IFtCQ;;;IE0CR,IAAA;IFzCe;AAAA;;IE6Cf,KAAA,GAAQ,GAAA;EAAA;IDtDJ;;;IC4DJ,OAAA,EAAS,IAAA;ID3DH;;;IC+DN,MAAA;ID3DF;;;IC+DE,IAAA;ID9DgB;;;ICkEhB,KAAA,GAAQ,GAAA;EAAA;IDjEM;;;;;;;;;;;;;;;;ICoFd,WAAA,GAAc,IAAA,EAAM,MAAA,CAAO,IAAA,qBAAyB,GAAA;IDrFtD;;;ICyFE,MAAA;IDxFF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../../../src/api/organizations/schemas/createOrganizationSchema.ts","../../../src/api/organizations/schemas/organizationQuerySchema.ts","../../../src/api/organizations/entities/organizations.ts","../../../src/api/organizations/schemas/organizationResourceSchema.ts","../../../src/api/organizations/schemas/updateOrganizationSchema.ts","../../../src/api/organizations/services/OrganizationService.ts","../../../src/api/organizations/controllers/AdminOrganizationController.ts","../../../src/api/organizations/index.ts"],"sourcesContent":["import type { Static } from \"alepha\";\nimport { t } from \"alepha\";\n\nexport const createOrganizationSchema = t.object({\n name: t.text(),\n slug: t.text({ minLength: 2, maxLength: 100 }),\n enabled: t.optional(t.boolean()),\n});\n\nexport type CreateOrganization = Static<typeof createOrganizationSchema>;\n","import type { Static } from \"alepha\";\nimport { t } from \"alepha\";\nimport { pageQuerySchema } from \"alepha/orm\";\n\nexport const organizationQuerySchema = t.extend(pageQuerySchema, {\n name: t.optional(t.text({ description: \"Filter by name (partial match)\" })),\n enabled: t.optional(t.boolean({ description: \"Filter by enabled status\" })),\n});\n\nexport type OrganizationQuery = Static<typeof organizationQuerySchema>;\n","import type { Static } from \"alepha\";\nimport { t } from \"alepha\";\nimport { $entity, db } from \"alepha/orm\";\n\nexport const organizations = $entity({\n name: \"organizations\",\n schema: t.object({\n id: db.primaryKey(t.uuid()),\n version: db.version(),\n createdAt: db.createdAt(),\n updatedAt: db.updatedAt(),\n\n name: t.text(),\n slug: t.text({ minLength: 2, maxLength: 100 }),\n enabled: db.default(t.boolean(), true),\n }),\n indexes: [{ columns: [\"slug\"], unique: true }],\n});\n\nexport type OrganizationEntity = Static<typeof organizations.schema>;\n","import type { Static } from \"alepha\";\nimport { organizations } from \"../entities/organizations.ts\";\n\nexport const organizationResourceSchema = organizations.schema;\n\nexport type OrganizationResource = Static<typeof organizationResourceSchema>;\n","import type { Static } from \"alepha\";\nimport { t } from \"alepha\";\nimport { createOrganizationSchema } from \"./createOrganizationSchema.ts\";\n\nexport const updateOrganizationSchema = t.partial(createOrganizationSchema);\n\nexport type UpdateOrganization = Static<typeof updateOrganizationSchema>;\n","import { $inject, Alepha } from \"alepha\";\nimport { $logger } from \"alepha/logger\";\nimport { $repository, type Page } from \"alepha/orm\";\nimport {\n type OrganizationEntity,\n organizations,\n} from \"../entities/organizations.ts\";\nimport type { CreateOrganization } from \"../schemas/createOrganizationSchema.ts\";\nimport type { OrganizationQuery } from \"../schemas/organizationQuerySchema.ts\";\nimport type { UpdateOrganization } from \"../schemas/updateOrganizationSchema.ts\";\n\nexport class OrganizationService {\n protected readonly alepha = $inject(Alepha);\n protected readonly log = $logger();\n protected readonly repo = $repository(organizations);\n\n /**\n * Find organizations with pagination and filtering.\n */\n public async find(\n query: OrganizationQuery = {},\n ): Promise<Page<OrganizationEntity>> {\n query.sort ??= \"-createdAt\";\n\n const where = this.repo.createQueryWhere();\n\n if (query.name) {\n where.name = { like: `%${query.name}%` };\n }\n\n if (query.enabled !== undefined) {\n where.enabled = { eq: query.enabled };\n }\n\n return this.repo.paginate(query, { where }, { count: true });\n }\n\n /**\n * Get an organization by ID.\n */\n public async getById(id: string): Promise<OrganizationEntity> {\n return this.repo.getById(id);\n }\n\n /**\n * Get an organization by slug.\n */\n public async getBySlug(slug: string): Promise<OrganizationEntity> {\n return this.repo.getOne({ where: { slug: { eq: slug } } });\n }\n\n /**\n * Create a new organization.\n */\n public async create(data: CreateOrganization): Promise<OrganizationEntity> {\n return this.repo.create(data);\n }\n\n /**\n * Update an organization.\n */\n public async update(\n id: string,\n data: UpdateOrganization,\n ): Promise<OrganizationEntity> {\n return this.repo.updateById(id, data);\n }\n\n /**\n * Delete an organization.\n */\n public async delete(id: string): Promise<void> {\n await this.repo.deleteById(id);\n }\n}\n","import { $inject, t } from \"alepha\";\nimport { $secure } from \"alepha/security\";\nimport { $action, okSchema } from \"alepha/server\";\nimport { createOrganizationSchema } from \"../schemas/createOrganizationSchema.ts\";\nimport { organizationQuerySchema } from \"../schemas/organizationQuerySchema.ts\";\nimport { organizationResourceSchema } from \"../schemas/organizationResourceSchema.ts\";\nimport { updateOrganizationSchema } from \"../schemas/updateOrganizationSchema.ts\";\nimport { OrganizationService } from \"../services/OrganizationService.ts\";\n\nexport class AdminOrganizationController {\n protected readonly url = \"/organizations\";\n protected readonly group = \"admin:organizations\";\n protected readonly organizationService = $inject(OrganizationService);\n\n /**\n * Find organizations with pagination and filtering.\n */\n public readonly findOrganizations = $action({\n path: this.url,\n group: this.group,\n use: [$secure({ permissions: [\"admin:organization:read\"] })],\n description: \"Find organizations with pagination and filtering\",\n schema: {\n query: organizationQuerySchema,\n response: t.page(organizationResourceSchema),\n },\n handler: ({ query }) => this.organizationService.find(query),\n });\n\n /**\n * Get an organization by ID.\n */\n public readonly getOrganization = $action({\n path: `${this.url}/:id`,\n group: this.group,\n use: [$secure({ permissions: [\"admin:organization:read\"] })],\n description: \"Get an organization by ID\",\n schema: {\n params: t.object({\n id: t.uuid(),\n }),\n response: organizationResourceSchema,\n },\n handler: ({ params }) => this.organizationService.getById(params.id),\n });\n\n /**\n * Create a new organization.\n */\n public readonly createOrganization = $action({\n method: \"POST\",\n path: this.url,\n group: this.group,\n use: [$secure({ permissions: [\"admin:organization:create\"] })],\n description: \"Create a new organization\",\n schema: {\n body: createOrganizationSchema,\n response: organizationResourceSchema,\n },\n handler: ({ body }) => this.organizationService.create(body),\n });\n\n /**\n * Update an organization.\n */\n public readonly updateOrganization = $action({\n method: \"PATCH\",\n path: `${this.url}/:id`,\n group: this.group,\n use: [$secure({ permissions: [\"admin:organization:update\"] })],\n description: \"Update an organization\",\n schema: {\n params: t.object({\n id: t.uuid(),\n }),\n body: updateOrganizationSchema,\n response: organizationResourceSchema,\n },\n handler: ({ params, body }) =>\n this.organizationService.update(params.id, body),\n });\n\n /**\n * Delete an organization.\n */\n public readonly deleteOrganization = $action({\n method: \"DELETE\",\n path: `${this.url}/:id`,\n group: this.group,\n use: [$secure({ permissions: [\"admin:organization:delete\"] })],\n description: \"Delete an organization\",\n schema: {\n params: t.object({\n id: t.uuid(),\n }),\n response: okSchema,\n },\n handler: async ({ params }) => {\n await this.organizationService.delete(params.id);\n return { ok: true, id: params.id };\n },\n });\n}\n","import { $module } from \"alepha\";\nimport { AdminOrganizationController } from \"./controllers/AdminOrganizationController.ts\";\nimport { OrganizationService } from \"./services/OrganizationService.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport * from \"./controllers/AdminOrganizationController.ts\";\nexport * from \"./entities/organizations.ts\";\nexport * from \"./schemas/createOrganizationSchema.ts\";\nexport * from \"./schemas/organizationQuerySchema.ts\";\nexport * from \"./schemas/organizationResourceSchema.ts\";\nexport * from \"./schemas/updateOrganizationSchema.ts\";\nexport * from \"./services/OrganizationService.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n/**\n * Organization management for multi-tenancy.\n *\n * **Features:**\n * - Admin CRUD for organizations\n * - Organization scoping via `db.organization()` on entities\n * - User with no organization = god mode (sees all resources)\n * - User with an organization = scoped to that organization\n *\n * @module alepha.api.organizations\n */\nexport const AlephaApiOrganizations = $module({\n name: \"alepha.api.organizations\",\n services: [OrganizationService, AdminOrganizationController],\n});\n"],"mappings":";;;;;;AAGA,MAAa,2BAA2B,EAAE,OAAO;CAC/C,MAAM,EAAE,MAAM;CACd,MAAM,EAAE,KAAK;EAAE,WAAW;EAAG,WAAW;EAAK,CAAC;CAC9C,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;CACjC,CAAC;;;ACHF,MAAa,0BAA0B,EAAE,OAAO,iBAAiB;CAC/D,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,kCAAkC,CAAC,CAAC;CAC3E,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,4BAA4B,CAAC,CAAC;CAC5E,CAAC;;;ACHF,MAAa,gBAAgB,QAAQ;CACnC,MAAM;CACN,QAAQ,EAAE,OAAO;EACf,IAAI,GAAG,WAAW,EAAE,MAAM,CAAC;EAC3B,SAAS,GAAG,SAAS;EACrB,WAAW,GAAG,WAAW;EACzB,WAAW,GAAG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M,GAAG,KAAK,IAAI;EAClB,OAAO,KAAK;EACZ,KAAK,CAAC,QAAQ,EAAE,aAAa,CAAC,4BAA4B,EAAE,CAAC,CAAC;EAC9D,aAAa;EACb,QAAQ;GACN,QAAQ,EAAE,OAAO,EACf,IAAI,EAAE,MAAM,EACb,CAAC;GACF,UAAU;GACX;EACD,SAAS,OAAO,EAAE,aAAa;GAC7B,MAAM,KAAK,oBAAoB,OAAO,OAAO,GAAG;GAChD,OAAO;IAAE,IAAI;IAAM,IAAI,OAAO;IAAI;;EAErC,CAAC;;;;;;;;;;;;;;;AC1EJ,MAAa,yBAAyB,QAAQ;CAC5C,MAAM;CACN,UAAU,CAAC,qBAAqB,4BAA4B;CAC7D,CAAC"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/api/organizations/schemas/createOrganizationSchema.ts","../../../src/api/organizations/schemas/organizationQuerySchema.ts","../../../src/api/organizations/entities/organizations.ts","../../../src/api/organizations/schemas/organizationResourceSchema.ts","../../../src/api/organizations/schemas/updateOrganizationSchema.ts","../../../src/api/organizations/services/OrganizationService.ts","../../../src/api/organizations/controllers/AdminOrganizationController.ts","../../../src/api/organizations/index.ts"],"sourcesContent":["import type { Static } from \"alepha\";\nimport { t } from \"alepha\";\n\nexport const createOrganizationSchema = t.object({\n name: t.text(),\n slug: t.text({ minLength: 2, maxLength: 100 }),\n enabled: t.optional(t.boolean()),\n});\n\nexport type CreateOrganization = Static<typeof createOrganizationSchema>;\n","import type { Static } from \"alepha\";\nimport { t } from \"alepha\";\nimport { pageQuerySchema } from \"alepha/orm\";\n\nexport const organizationQuerySchema = t.extend(pageQuerySchema, {\n name: t.optional(t.text({ description: \"Filter by name (partial match)\" })),\n enabled: t.optional(t.boolean({ description: \"Filter by enabled status\" })),\n});\n\nexport type OrganizationQuery = Static<typeof organizationQuerySchema>;\n","import type { Static } from \"alepha\";\nimport { t } from \"alepha\";\nimport { $entity, db } from \"alepha/orm\";\n\nexport const organizations = $entity({\n name: \"organizations\",\n schema: t.object({\n id: db.primaryKey(t.uuid()),\n version: db.version(),\n createdAt: db.createdAt(),\n updatedAt: db.updatedAt(),\n\n name: t.text(),\n slug: t.text({ minLength: 2, maxLength: 100 }),\n enabled: db.default(t.boolean(), true),\n }),\n indexes: [{ columns: [\"slug\"], unique: true }],\n});\n\nexport type OrganizationEntity = Static<typeof organizations.schema>;\n","import type { Static } from \"alepha\";\nimport { organizations } from \"../entities/organizations.ts\";\n\nexport const organizationResourceSchema = organizations.schema;\n\nexport type OrganizationResource = Static<typeof organizationResourceSchema>;\n","import type { Static } from \"alepha\";\nimport { t } from \"alepha\";\nimport { createOrganizationSchema } from \"./createOrganizationSchema.ts\";\n\nexport const updateOrganizationSchema = t.partial(createOrganizationSchema);\n\nexport type UpdateOrganization = Static<typeof updateOrganizationSchema>;\n","import { $inject, Alepha } from \"alepha\";\nimport { $logger } from \"alepha/logger\";\nimport { $repository, type Page } from \"alepha/orm\";\nimport {\n type OrganizationEntity,\n organizations,\n} from \"../entities/organizations.ts\";\nimport type { CreateOrganization } from \"../schemas/createOrganizationSchema.ts\";\nimport type { OrganizationQuery } from \"../schemas/organizationQuerySchema.ts\";\nimport type { UpdateOrganization } from \"../schemas/updateOrganizationSchema.ts\";\n\nexport class OrganizationService {\n protected readonly alepha = $inject(Alepha);\n protected readonly log = $logger();\n protected readonly repo = $repository(organizations);\n\n /**\n * Find organizations with pagination and filtering.\n */\n public async find(\n query: OrganizationQuery = {},\n ): Promise<Page<OrganizationEntity>> {\n query.sort ??= \"-createdAt\";\n\n const where = this.repo.createQueryWhere();\n\n if (query.name) {\n where.name = { like: `%${query.name}%` };\n }\n\n if (query.enabled !== undefined) {\n where.enabled = { eq: query.enabled };\n }\n\n return this.repo.paginate(query, { where }, { count: true });\n }\n\n /**\n * Get an organization by ID.\n */\n public async getById(id: string): Promise<OrganizationEntity> {\n return this.repo.getById(id);\n }\n\n /**\n * Get an organization by slug.\n */\n public async getBySlug(slug: string): Promise<OrganizationEntity> {\n return this.repo.getOne({ where: { slug: { eq: slug } } });\n }\n\n /**\n * Create a new organization.\n */\n public async create(data: CreateOrganization): Promise<OrganizationEntity> {\n return this.repo.create(data);\n }\n\n /**\n * Update an organization.\n */\n public async update(\n id: string,\n data: UpdateOrganization,\n ): Promise<OrganizationEntity> {\n return this.repo.updateById(id, data);\n }\n\n /**\n * Delete an organization.\n */\n public async delete(id: string): Promise<void> {\n await this.repo.deleteById(id);\n }\n}\n","import { $inject, t } from \"alepha\";\nimport { $secure } from \"alepha/security\";\nimport { $action, okSchema } from \"alepha/server\";\nimport { createOrganizationSchema } from \"../schemas/createOrganizationSchema.ts\";\nimport { organizationQuerySchema } from \"../schemas/organizationQuerySchema.ts\";\nimport { organizationResourceSchema } from \"../schemas/organizationResourceSchema.ts\";\nimport { updateOrganizationSchema } from \"../schemas/updateOrganizationSchema.ts\";\nimport { OrganizationService } from \"../services/OrganizationService.ts\";\n\nexport class AdminOrganizationController {\n protected readonly url = \"/organizations\";\n protected readonly group = \"admin:organizations\";\n protected readonly organizationService = $inject(OrganizationService);\n\n /**\n * Find organizations with pagination and filtering.\n */\n public readonly findOrganizations = $action({\n path: this.url,\n group: this.group,\n use: [$secure({ permissions: [\"admin:organization:read\"] })],\n description: \"Find organizations with pagination and filtering\",\n schema: {\n query: organizationQuerySchema,\n response: t.page(organizationResourceSchema),\n },\n handler: ({ query }) => this.organizationService.find(query),\n });\n\n /**\n * Get an organization by ID.\n */\n public readonly getOrganization = $action({\n path: `${this.url}/:id`,\n group: this.group,\n use: [$secure({ permissions: [\"admin:organization:read\"] })],\n description: \"Get an organization by ID\",\n schema: {\n params: t.object({\n id: t.uuid(),\n }),\n response: organizationResourceSchema,\n },\n handler: ({ params }) => this.organizationService.getById(params.id),\n });\n\n /**\n * Create a new organization.\n */\n public readonly createOrganization = $action({\n method: \"POST\",\n path: this.url,\n group: this.group,\n use: [$secure({ permissions: [\"admin:organization:create\"] })],\n description: \"Create a new organization\",\n schema: {\n body: createOrganizationSchema,\n response: organizationResourceSchema,\n },\n handler: ({ body }) => this.organizationService.create(body),\n });\n\n /**\n * Update an organization.\n */\n public readonly updateOrganization = $action({\n method: \"PATCH\",\n path: `${this.url}/:id`,\n group: this.group,\n use: [$secure({ permissions: [\"admin:organization:update\"] })],\n description: \"Update an organization\",\n schema: {\n params: t.object({\n id: t.uuid(),\n }),\n body: updateOrganizationSchema,\n response: organizationResourceSchema,\n },\n handler: ({ params, body }) =>\n this.organizationService.update(params.id, body),\n });\n\n /**\n * Delete an organization.\n */\n public readonly deleteOrganization = $action({\n method: \"DELETE\",\n path: `${this.url}/:id`,\n group: this.group,\n use: [$secure({ permissions: [\"admin:organization:delete\"] })],\n description: \"Delete an organization\",\n schema: {\n params: t.object({\n id: t.uuid(),\n }),\n response: okSchema,\n },\n handler: async ({ params }) => {\n await this.organizationService.delete(params.id);\n return { ok: true, id: params.id };\n },\n });\n}\n","import { $module } from \"alepha\";\nimport { AdminOrganizationController } from \"./controllers/AdminOrganizationController.ts\";\nimport { OrganizationService } from \"./services/OrganizationService.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport * from \"./controllers/AdminOrganizationController.ts\";\nexport * from \"./entities/organizations.ts\";\nexport * from \"./schemas/createOrganizationSchema.ts\";\nexport * from \"./schemas/organizationQuerySchema.ts\";\nexport * from \"./schemas/organizationResourceSchema.ts\";\nexport * from \"./schemas/updateOrganizationSchema.ts\";\nexport * from \"./services/OrganizationService.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n/**\n * Organization management for multi-tenancy.\n *\n * **Features:**\n * - Admin CRUD for organizations\n * - Organization scoping via `db.organization()` on entities\n * - User with no organization = god mode (sees all resources)\n * - User with an organization = scoped to that organization\n *\n * @module alepha.api.organizations\n */\nexport const AlephaApiOrganizations = $module({\n name: \"alepha.api.organizations\",\n services: [OrganizationService, AdminOrganizationController],\n});\n"],"mappings":";;;;;;AAGA,MAAa,2BAA2B,EAAE,OAAO;CAC/C,MAAM,EAAE,KAAK;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,CAAC,CAAC;EAC7D,aAAa;EACb,QAAQ;GACN,MAAM;GACN,UAAU;EACZ;EACA,UAAU,EAAE,WAAW,KAAK,oBAAoB,OAAO,IAAI;CAC7D,CAAC;;;;CAKD,qBAAqC,QAAQ;EAC3C,QAAQ;EACR,MAAM,GAAG,KAAK,IAAI;EAClB,OAAO,KAAK;EACZ,KAAK,CAAC,QAAQ,EAAE,aAAa,CAAC,2BAA2B,EAAE,CAAC,CAAC;EAC7D,aAAa;EACb,QAAQ;GACN,QAAQ,EAAE,OAAO,EACf,IAAI,EAAE,KAAK,EACb,CAAC;GACD,MAAM;GACN,UAAU;EACZ;EACA,UAAU,EAAE,QAAQ,WAClB,KAAK,oBAAoB,OAAO,OAAO,IAAI,IAAI;CACnD,CAAC;;;;CAKD,qBAAqC,QAAQ;EAC3C,QAAQ;EACR,MAAM,GAAG,KAAK,IAAI;EAClB,OAAO,KAAK;EACZ,KAAK,CAAC,QAAQ,EAAE,aAAa,CAAC,2BAA2B,EAAE,CAAC,CAAC;EAC7D,aAAa;EACb,QAAQ;GACN,QAAQ,EAAE,OAAO,EACf,IAAI,EAAE,KAAK,EACb,CAAC;GACD,UAAU;EACZ;EACA,SAAS,OAAO,EAAE,aAAa;GAC7B,MAAM,KAAK,oBAAoB,OAAO,OAAO,EAAE;GAC/C,OAAO;IAAE,IAAI;IAAM,IAAI,OAAO;GAAG;EACnC;CACF,CAAC;AACH;;;;;;;;;;;;;;AC3EA,MAAa,yBAAyB,QAAQ;CAC5C,MAAM;CACN,UAAU,CAAC,qBAAqB,2BAA2B;AAC7D,CAAC"}
@@ -78,28 +78,51 @@ const parameters = $entity({
78
78
  //#region ../../src/api/parameters/schemas/activateParameterBodySchema.ts
79
79
  /**
80
80
  * Activate parameter body schema.
81
- * Uses t.pick for version and creator fields.
81
+ *
82
+ * Creator fields are omitted; the controller captures the authenticated user
83
+ * server-side.
82
84
  */
83
- const activateParameterBodySchema = t.pick(parameters.schema, [
84
- "version",
85
- "creatorId",
86
- "creatorName"
87
- ]);
85
+ const activateParameterBodySchema = t.pick(parameters.schema, ["version"]);
88
86
  //#endregion
89
87
  //#region ../../src/api/parameters/schemas/createParameterVersionBodySchema.ts
90
88
  /**
91
89
  * Create parameter version body schema.
92
90
  * Uses t.pick to derive from entity, with required fields made non-optional.
91
+ *
92
+ * Creator fields are intentionally omitted: the controller captures the
93
+ * authenticated user server-side, so they cannot be spoofed by the client.
93
94
  */
94
95
  const createParameterVersionBodySchema = t.extend(t.pick(parameters.schema, [
95
96
  "content",
96
97
  "schemaHash",
97
98
  "changeDescription",
98
- "tags",
99
- "creatorId",
100
- "creatorName"
99
+ "tags"
101
100
  ]), { activationDate: t.optional(t.datetime({ description: "When to activate (default: now)" })) });
102
101
  //#endregion
102
+ //#region ../../src/api/parameters/schemas/parameterCreatorSummarySchema.ts
103
+ /**
104
+ * Slim view of a parameter version's creator, embedded by the admin history
105
+ * endpoint via a best-effort left join (`parameters.creatorId` → `users.id`)
106
+ * so the UI can render a human-readable identifier (and link) instead of a
107
+ * bare UUID.
108
+ *
109
+ * Optional end-to-end: the join only runs when the `users` entity is
110
+ * registered in the running app (see `ParameterProvider.resolveCreatorJoin`),
111
+ * and a version whose creator was deleted — or who lives in a non-default
112
+ * realm — comes back with `creator` undefined. Callers fall back to the raw
113
+ * `creatorId`.
114
+ */
115
+ const parameterCreatorSummarySchema = t.object({
116
+ id: t.uuid(),
117
+ email: t.optional(t.string({ format: "email" })),
118
+ username: t.optional(t.shortText({
119
+ minLength: 3,
120
+ maxLength: 30
121
+ })),
122
+ firstName: t.optional(t.string()),
123
+ lastName: t.optional(t.string())
124
+ });
125
+ //#endregion
103
126
  //#region ../../src/api/parameters/schemas/parameterStatusSchema.ts
104
127
  /**
105
128
  * Parameter status enum schema.
@@ -116,8 +139,14 @@ const parameterStatusSchema = t.enum([
116
139
  * Parameter response schema for API responses.
117
140
  * Extends the entity schema with a calculated status field.
118
141
  * Status is derived from activationDate at query time, not stored.
142
+ *
143
+ * `creator` is embedded on read via a best-effort left join on `creatorId`
144
+ * (see `parameterCreatorSummarySchema`); it is not a stored column.
119
145
  */
120
- const parameterResponseSchema = t.extend(parameters.schema, { status: parameterStatusSchema });
146
+ const parameterResponseSchema = t.extend(parameters.schema, {
147
+ status: parameterStatusSchema,
148
+ creator: t.optional(parameterCreatorSummarySchema)
149
+ });
121
150
  //#endregion
122
151
  //#region ../../src/api/parameters/schemas/parameterCurrentResponseSchema.ts
123
152
  /**
@@ -178,13 +207,11 @@ const parameterVersionResponseSchema = t.object({ parameter: t.optional(paramete
178
207
  //#region ../../src/api/parameters/schemas/rollbackParameterBodySchema.ts
179
208
  /**
180
209
  * Rollback parameter body schema.
181
- * Uses t.pick for creator fields, adds targetVersion.
210
+ *
211
+ * Creator fields are omitted; the controller captures the authenticated user
212
+ * server-side.
182
213
  */
183
- const rollbackParameterBodySchema = t.extend(t.pick(parameters.schema, [
184
- "changeDescription",
185
- "creatorId",
186
- "creatorName"
187
- ]), { targetVersion: t.integer({ description: "Version number to rollback to" }) });
214
+ const rollbackParameterBodySchema = t.extend(t.pick(parameters.schema, ["changeDescription"]), { targetVersion: t.integer({ description: "Version number to rollback to" }) });
188
215
  //#endregion
189
216
  //#region ../../src/api/parameters/index.browser.ts
190
217
  const AlephaApiParameters = $module({
@@ -1 +1 @@
1
- {"version":3,"file":"index.browser.js","names":[],"sources":["../../../src/api/parameters/entities/parameters.ts","../../../src/api/parameters/schemas/activateParameterBodySchema.ts","../../../src/api/parameters/schemas/createParameterVersionBodySchema.ts","../../../src/api/parameters/schemas/parameterStatusSchema.ts","../../../src/api/parameters/schemas/parameterResponseSchema.ts","../../../src/api/parameters/schemas/parameterCurrentResponseSchema.ts","../../../src/api/parameters/schemas/parameterHistoryResponseSchema.ts","../../../src/api/parameters/schemas/parameterNameParamSchema.ts","../../../src/api/parameters/schemas/parameterNamesResponseSchema.ts","../../../src/api/parameters/schemas/parameterTreeNodeSchema.ts","../../../src/api/parameters/schemas/parameterVersionParamSchema.ts","../../../src/api/parameters/schemas/parameterVersionResponseSchema.ts","../../../src/api/parameters/schemas/rollbackParameterBodySchema.ts","../../../src/api/parameters/index.browser.ts"],"sourcesContent":["import { type Static, t } from \"alepha\";\nimport { $entity, db } from \"alepha/orm\";\n\n/**\n * Configuration parameter entity for versioned configuration management.\n *\n * Stores all versions of configuration parameters with:\n * - Status derived from activationDate at query time\n * - Schema versioning for migrations\n * - Activation scheduling\n * - Audit trail (creator info)\n */\nexport const parameters = $entity({\n name: \"parameters\",\n schema: t.object({\n id: db.primaryKey(t.uuid()),\n createdAt: db.createdAt(),\n updatedAt: db.updatedAt(),\n\n /**\n * Configuration name using dot notation for tree hierarchy.\n * Examples: \"app.features\", \"app.pricing.tiers\", \"system.limits\"\n */\n name: t.text(),\n\n /**\n * The configuration content as JSON.\n */\n content: t.json(),\n\n /**\n * Schema version hash for detecting schema changes.\n * Used for auto-migration when schema evolves.\n */\n schemaHash: t.text(),\n\n /**\n * When this version should become active.\n * Default is immediate (now).\n */\n activationDate: t.datetime(),\n\n /**\n * Version number for this configuration.\n * Auto-incremented per config name.\n */\n version: t.integer(),\n\n /**\n * Optional description of changes in this version.\n */\n changeDescription: t.optional(t.text()),\n\n /**\n * Optional tags for filtering/categorization.\n */\n tags: t.optional(t.array(t.text())),\n\n /**\n * Creator user ID (if available).\n */\n creatorId: t.optional(t.uuid()),\n\n /**\n * Creator display name for audit trail.\n */\n creatorName: t.optional(t.text()),\n\n /**\n * Previous content before this change (for rollback reference).\n */\n previousContent: t.optional(t.json()),\n\n /**\n * Migration log if schema changed.\n */\n migrationLog: t.optional(t.text()),\n }),\n indexes: [\n { columns: [\"name\", \"activationDate\"] },\n { columns: [\"name\", \"version\"], unique: true },\n { columns: [\"activationDate\"] },\n ],\n});\n\nexport type Parameter = Static<typeof parameters.schema>;\n","import { type Static, t } from \"alepha\";\nimport { parameters } from \"../entities/parameters.ts\";\n\n/**\n * Activate parameter body schema.\n * Uses t.pick for version and creator fields.\n */\nexport const activateParameterBodySchema = t.pick(parameters.schema, [\n \"version\",\n \"creatorId\",\n \"creatorName\",\n]);\n\nexport type ActivateParameterBody = Static<typeof activateParameterBodySchema>;\n","import { type Static, t } from \"alepha\";\nimport { parameters } from \"../entities/parameters.ts\";\n\n/**\n * Create parameter version body schema.\n * Uses t.pick to derive from entity, with required fields made non-optional.\n */\nexport const createParameterVersionBodySchema = t.extend(\n t.pick(parameters.schema, [\n \"content\",\n \"schemaHash\",\n \"changeDescription\",\n \"tags\",\n \"creatorId\",\n \"creatorName\",\n ]),\n {\n activationDate: t.optional(\n t.datetime({ description: \"When to activate (default: now)\" }),\n ),\n },\n);\n\nexport type CreateParameterVersionBody = Static<\n typeof createParameterVersionBodySchema\n>;\n","import { type Static, t } from \"alepha\";\n\n/**\n * Parameter status enum schema.\n */\nexport const parameterStatusSchema = t.enum([\n \"expired\",\n \"current\",\n \"next\",\n \"future\",\n]);\n\nexport type ParameterStatus = Static<typeof parameterStatusSchema>;\n","import { type Static, t } from \"alepha\";\nimport { parameters } from \"../entities/parameters.ts\";\nimport { parameterStatusSchema } from \"./parameterStatusSchema.ts\";\n\n/**\n * Parameter response schema for API responses.\n * Extends the entity schema with a calculated status field.\n * Status is derived from activationDate at query time, not stored.\n */\nexport const parameterResponseSchema = t.extend(parameters.schema, {\n status: parameterStatusSchema,\n});\n\nexport type ParameterResponse = Static<typeof parameterResponseSchema>;\n","import { type Static, t } from \"alepha\";\nimport { parameterResponseSchema } from \"./parameterResponseSchema.ts\";\n\n/**\n * Current parameter response schema.\n * Includes current version, next scheduled version, and defaults.\n */\nexport const parameterCurrentResponseSchema = t.object({\n current: t.optional(parameterResponseSchema),\n next: t.optional(parameterResponseSchema),\n defaultValue: t.optional(t.json()),\n currentValue: t.optional(t.json()),\n schema: t.optional(t.json()),\n});\n\nexport type ParameterCurrentResponse = Static<\n typeof parameterCurrentResponseSchema\n>;\n","import { type Static, t } from \"alepha\";\nimport { parameterResponseSchema } from \"./parameterResponseSchema.ts\";\n\n/**\n * Parameter history response schema.\n */\nexport const parameterHistoryResponseSchema = t.object({\n versions: t.array(parameterResponseSchema),\n});\n\nexport type ParameterHistoryResponse = Static<\n typeof parameterHistoryResponseSchema\n>;\n","import { t } from \"alepha\";\nimport { parameters } from \"../entities/parameters.ts\";\n\n/**\n * Parameter name param schema.\n * Uses t.pick from entity for consistency.\n */\nexport const parameterNameParamSchema = t.pick(parameters.schema, [\"name\"]);\n","import { type Static, t } from \"alepha\";\n\n/**\n * Parameter names list response schema.\n */\nexport const parameterNamesResponseSchema = t.object({\n names: t.array(t.text()),\n});\n\nexport type ParameterNamesResponse = Static<\n typeof parameterNamesResponseSchema\n>;\n","import { type Static, t } from \"alepha\";\n\n/**\n * Tree node schema for parameter tree navigation.\n */\nexport const parameterTreeNodeSchema = t.object({\n name: t.text(),\n path: t.text(),\n isLeaf: t.boolean(),\n children: t.array(t.any()),\n});\n\nexport type ParameterTreeNode = Static<typeof parameterTreeNodeSchema>;\n","import { t } from \"alepha\";\nimport { parameters } from \"../entities/parameters.ts\";\n\n/**\n * Parameter name and version param schema.\n * Uses t.pick from entity for consistency.\n */\nexport const parameterVersionParamSchema = t.pick(parameters.schema, [\n \"name\",\n \"version\",\n]);\n","import { type Static, t } from \"alepha\";\nimport { parameterResponseSchema } from \"./parameterResponseSchema.ts\";\n\n/**\n * Parameter version response schema.\n */\nexport const parameterVersionResponseSchema = t.object({\n parameter: t.optional(parameterResponseSchema),\n});\n\nexport type ParameterVersionResponse = Static<\n typeof parameterVersionResponseSchema\n>;\n","import { type Static, t } from \"alepha\";\nimport { parameters } from \"../entities/parameters.ts\";\n\n/**\n * Rollback parameter body schema.\n * Uses t.pick for creator fields, adds targetVersion.\n */\nexport const rollbackParameterBodySchema = t.extend(\n t.pick(parameters.schema, [\"changeDescription\", \"creatorId\", \"creatorName\"]),\n {\n targetVersion: t.integer({\n description: \"Version number to rollback to\",\n }),\n },\n);\n\nexport type RollbackParameterBody = Static<typeof rollbackParameterBodySchema>;\n","import { $module } from \"alepha\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport * from \"./entities/parameters.ts\";\nexport * from \"./schemas/activateParameterBodySchema.ts\";\nexport * from \"./schemas/createParameterVersionBodySchema.ts\";\nexport * from \"./schemas/parameterCurrentResponseSchema.ts\";\nexport * from \"./schemas/parameterHistoryResponseSchema.ts\";\nexport * from \"./schemas/parameterNameParamSchema.ts\";\nexport * from \"./schemas/parameterNamesResponseSchema.ts\";\nexport * from \"./schemas/parameterResponseSchema.ts\";\nexport * from \"./schemas/parameterStatusSchema.ts\";\nexport * from \"./schemas/parameterTreeNodeSchema.ts\";\nexport * from \"./schemas/parameterVersionParamSchema.ts\";\nexport * from \"./schemas/parameterVersionResponseSchema.ts\";\nexport * from \"./schemas/rollbackParameterBodySchema.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport const AlephaApiParameters = $module({\n name: \"alepha.api.parameters\",\n services: [],\n});\n"],"mappings":";;;;;;;;;;;;AAYA,MAAa,aAAa,QAAQ;CAChC,MAAM;CACN,QAAQ,EAAE,OAAO;EACf,IAAI,GAAG,WAAW,EAAE,MAAM,CAAC;EAC3B,WAAW,GAAG,WAAW;EACzB,WAAW,GAAG,WAAW;;;;;EAMzB,MAAM,EAAE,MAAM;;;;EAKd,SAAS,EAAE,MAAM;;;;;EAMjB,YAAY,EAAE,MAAM;;;;;EAMpB,gBAAgB,EAAE,UAAU;;;;;EAM5B,SAAS,EAAE,SAAS;;;;EAKpB,mBAAmB,EAAE,SAAS,EAAE,MAAM,CAAC;;;;EAKvC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;;;;EAKnC,WAAW,EAAE,SAAS,EAAE,MAAM,CAAC;;;;EAK/B,aAAa,EAAE,SAAS,EAAE,MAAM,CAAC;;;;EAKjC,iBAAiB,EAAE,SAAS,EAAE,MAAM,CAAC;;;;EAKrC,cAAc,EAAE,SAAS,EAAE,MAAM,CAAC;EACnC,CAAC;CACF,SAAS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C3B,CAAC;;;;;;;ACHF,MAAa,8BAA8B,EAAE,KAAK,WAAW,QAAQ,CACnE,QACA,UACD,CAAC;;;;;;ACJF,MAAa,iCAAiC,EAAE,OAAO,EACrD,WAAW,EAAE,SAAS,wBAAwB,EAC/C,CAAC;;;;;;;ACDF,MAAa,8BAA8B,EAAE,OAC3C,EAAE,KAAK,WAAW,QAAQ;CAAC;CAAqB;CAAa;CAAc,CAAC,EAC5E,EACE,eAAe,EAAE,QAAQ,EACvB,aAAa,iCACd,CAAC,EACH,CACF;;;ACMD,MAAa,sBAAsB,QAAQ;CACzC,MAAM;CACN,UAAU,EAAE;CACb,CAAC"}
1
+ {"version":3,"file":"index.browser.js","names":[],"sources":["../../../src/api/parameters/entities/parameters.ts","../../../src/api/parameters/schemas/activateParameterBodySchema.ts","../../../src/api/parameters/schemas/createParameterVersionBodySchema.ts","../../../src/api/parameters/schemas/parameterCreatorSummarySchema.ts","../../../src/api/parameters/schemas/parameterStatusSchema.ts","../../../src/api/parameters/schemas/parameterResponseSchema.ts","../../../src/api/parameters/schemas/parameterCurrentResponseSchema.ts","../../../src/api/parameters/schemas/parameterHistoryResponseSchema.ts","../../../src/api/parameters/schemas/parameterNameParamSchema.ts","../../../src/api/parameters/schemas/parameterNamesResponseSchema.ts","../../../src/api/parameters/schemas/parameterTreeNodeSchema.ts","../../../src/api/parameters/schemas/parameterVersionParamSchema.ts","../../../src/api/parameters/schemas/parameterVersionResponseSchema.ts","../../../src/api/parameters/schemas/rollbackParameterBodySchema.ts","../../../src/api/parameters/index.browser.ts"],"sourcesContent":["import { type Static, t } from \"alepha\";\nimport { $entity, db } from \"alepha/orm\";\n\n/**\n * Configuration parameter entity for versioned configuration management.\n *\n * Stores all versions of configuration parameters with:\n * - Status derived from activationDate at query time\n * - Schema versioning for migrations\n * - Activation scheduling\n * - Audit trail (creator info)\n */\nexport const parameters = $entity({\n name: \"parameters\",\n schema: t.object({\n id: db.primaryKey(t.uuid()),\n createdAt: db.createdAt(),\n updatedAt: db.updatedAt(),\n\n /**\n * Configuration name using dot notation for tree hierarchy.\n * Examples: \"app.features\", \"app.pricing.tiers\", \"system.limits\"\n */\n name: t.text(),\n\n /**\n * The configuration content as JSON.\n */\n content: t.json(),\n\n /**\n * Schema version hash for detecting schema changes.\n * Used for auto-migration when schema evolves.\n */\n schemaHash: t.text(),\n\n /**\n * When this version should become active.\n * Default is immediate (now).\n */\n activationDate: t.datetime(),\n\n /**\n * Version number for this configuration.\n * Auto-incremented per config name.\n */\n version: t.integer(),\n\n /**\n * Optional description of changes in this version.\n */\n changeDescription: t.optional(t.text()),\n\n /**\n * Optional tags for filtering/categorization.\n */\n tags: t.optional(t.array(t.text())),\n\n /**\n * Creator user ID (if available).\n */\n creatorId: t.optional(t.uuid()),\n\n /**\n * Creator display name for audit trail.\n */\n creatorName: t.optional(t.text()),\n\n /**\n * Previous content before this change (for rollback reference).\n */\n previousContent: t.optional(t.json()),\n\n /**\n * Migration log if schema changed.\n */\n migrationLog: t.optional(t.text()),\n }),\n indexes: [\n { columns: [\"name\", \"activationDate\"] },\n { columns: [\"name\", \"version\"], unique: true },\n { columns: [\"activationDate\"] },\n ],\n});\n\nexport type Parameter = Static<typeof parameters.schema>;\n","import { type Static, t } from \"alepha\";\nimport { parameters } from \"../entities/parameters.ts\";\n\n/**\n * Activate parameter body schema.\n *\n * Creator fields are omitted; the controller captures the authenticated user\n * server-side.\n */\nexport const activateParameterBodySchema = t.pick(parameters.schema, [\n \"version\",\n]);\n\nexport type ActivateParameterBody = Static<typeof activateParameterBodySchema>;\n","import { type Static, t } from \"alepha\";\nimport { parameters } from \"../entities/parameters.ts\";\n\n/**\n * Create parameter version body schema.\n * Uses t.pick to derive from entity, with required fields made non-optional.\n *\n * Creator fields are intentionally omitted: the controller captures the\n * authenticated user server-side, so they cannot be spoofed by the client.\n */\nexport const createParameterVersionBodySchema = t.extend(\n t.pick(parameters.schema, [\n \"content\",\n \"schemaHash\",\n \"changeDescription\",\n \"tags\",\n ]),\n {\n activationDate: t.optional(\n t.datetime({ description: \"When to activate (default: now)\" }),\n ),\n },\n);\n\nexport type CreateParameterVersionBody = Static<\n typeof createParameterVersionBodySchema\n>;\n","import { type Static, t } from \"alepha\";\n\n/**\n * Slim view of a parameter version's creator, embedded by the admin history\n * endpoint via a best-effort left join (`parameters.creatorId` → `users.id`)\n * so the UI can render a human-readable identifier (and link) instead of a\n * bare UUID.\n *\n * Optional end-to-end: the join only runs when the `users` entity is\n * registered in the running app (see `ParameterProvider.resolveCreatorJoin`),\n * and a version whose creator was deleted — or who lives in a non-default\n * realm — comes back with `creator` undefined. Callers fall back to the raw\n * `creatorId`.\n */\nexport const parameterCreatorSummarySchema = t.object({\n id: t.uuid(),\n email: t.optional(t.string({ format: \"email\" })),\n username: t.optional(t.shortText({ minLength: 3, maxLength: 30 })),\n firstName: t.optional(t.string()),\n lastName: t.optional(t.string()),\n});\n\nexport type ParameterCreatorSummary = Static<\n typeof parameterCreatorSummarySchema\n>;\n","import { type Static, t } from \"alepha\";\n\n/**\n * Parameter status enum schema.\n */\nexport const parameterStatusSchema = t.enum([\n \"expired\",\n \"current\",\n \"next\",\n \"future\",\n]);\n\nexport type ParameterStatus = Static<typeof parameterStatusSchema>;\n","import { type Static, t } from \"alepha\";\nimport { parameters } from \"../entities/parameters.ts\";\nimport { parameterCreatorSummarySchema } from \"./parameterCreatorSummarySchema.ts\";\nimport { parameterStatusSchema } from \"./parameterStatusSchema.ts\";\n\n/**\n * Parameter response schema for API responses.\n * Extends the entity schema with a calculated status field.\n * Status is derived from activationDate at query time, not stored.\n *\n * `creator` is embedded on read via a best-effort left join on `creatorId`\n * (see `parameterCreatorSummarySchema`); it is not a stored column.\n */\nexport const parameterResponseSchema = t.extend(parameters.schema, {\n status: parameterStatusSchema,\n creator: t.optional(parameterCreatorSummarySchema),\n});\n\nexport type ParameterResponse = Static<typeof parameterResponseSchema>;\n","import { type Static, t } from \"alepha\";\nimport { parameterResponseSchema } from \"./parameterResponseSchema.ts\";\n\n/**\n * Current parameter response schema.\n * Includes current version, next scheduled version, and defaults.\n */\nexport const parameterCurrentResponseSchema = t.object({\n current: t.optional(parameterResponseSchema),\n next: t.optional(parameterResponseSchema),\n defaultValue: t.optional(t.json()),\n currentValue: t.optional(t.json()),\n schema: t.optional(t.json()),\n});\n\nexport type ParameterCurrentResponse = Static<\n typeof parameterCurrentResponseSchema\n>;\n","import { type Static, t } from \"alepha\";\nimport { parameterResponseSchema } from \"./parameterResponseSchema.ts\";\n\n/**\n * Parameter history response schema.\n */\nexport const parameterHistoryResponseSchema = t.object({\n versions: t.array(parameterResponseSchema),\n});\n\nexport type ParameterHistoryResponse = Static<\n typeof parameterHistoryResponseSchema\n>;\n","import { t } from \"alepha\";\nimport { parameters } from \"../entities/parameters.ts\";\n\n/**\n * Parameter name param schema.\n * Uses t.pick from entity for consistency.\n */\nexport const parameterNameParamSchema = t.pick(parameters.schema, [\"name\"]);\n","import { type Static, t } from \"alepha\";\n\n/**\n * Parameter names list response schema.\n */\nexport const parameterNamesResponseSchema = t.object({\n names: t.array(t.text()),\n});\n\nexport type ParameterNamesResponse = Static<\n typeof parameterNamesResponseSchema\n>;\n","import { type Static, t } from \"alepha\";\n\n/**\n * Tree node schema for parameter tree navigation.\n */\nexport const parameterTreeNodeSchema = t.object({\n name: t.text(),\n path: t.text(),\n isLeaf: t.boolean(),\n children: t.array(t.any()),\n});\n\nexport type ParameterTreeNode = Static<typeof parameterTreeNodeSchema>;\n","import { t } from \"alepha\";\nimport { parameters } from \"../entities/parameters.ts\";\n\n/**\n * Parameter name and version param schema.\n * Uses t.pick from entity for consistency.\n */\nexport const parameterVersionParamSchema = t.pick(parameters.schema, [\n \"name\",\n \"version\",\n]);\n","import { type Static, t } from \"alepha\";\nimport { parameterResponseSchema } from \"./parameterResponseSchema.ts\";\n\n/**\n * Parameter version response schema.\n */\nexport const parameterVersionResponseSchema = t.object({\n parameter: t.optional(parameterResponseSchema),\n});\n\nexport type ParameterVersionResponse = Static<\n typeof parameterVersionResponseSchema\n>;\n","import { type Static, t } from \"alepha\";\nimport { parameters } from \"../entities/parameters.ts\";\n\n/**\n * Rollback parameter body schema.\n *\n * Creator fields are omitted; the controller captures the authenticated user\n * server-side.\n */\nexport const rollbackParameterBodySchema = t.extend(\n t.pick(parameters.schema, [\"changeDescription\"]),\n {\n targetVersion: t.integer({\n description: \"Version number to rollback to\",\n }),\n },\n);\n\nexport type RollbackParameterBody = Static<typeof rollbackParameterBodySchema>;\n","import { $module } from \"alepha\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport * from \"./entities/parameters.ts\";\nexport * from \"./schemas/activateParameterBodySchema.ts\";\nexport * from \"./schemas/createParameterVersionBodySchema.ts\";\nexport * from \"./schemas/parameterCurrentResponseSchema.ts\";\nexport * from \"./schemas/parameterHistoryResponseSchema.ts\";\nexport * from \"./schemas/parameterNameParamSchema.ts\";\nexport * from \"./schemas/parameterNamesResponseSchema.ts\";\nexport * from \"./schemas/parameterResponseSchema.ts\";\nexport * from \"./schemas/parameterStatusSchema.ts\";\nexport * from \"./schemas/parameterTreeNodeSchema.ts\";\nexport * from \"./schemas/parameterVersionParamSchema.ts\";\nexport * from \"./schemas/parameterVersionResponseSchema.ts\";\nexport * from \"./schemas/rollbackParameterBodySchema.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport const AlephaApiParameters = $module({\n name: \"alepha.api.parameters\",\n services: [],\n});\n"],"mappings":";;;;;;;;;;;;AAYA,MAAa,aAAa,QAAQ;CAChC,MAAM;CACN,QAAQ,EAAE,OAAO;EACf,IAAI,GAAG,WAAW,EAAE,KAAK,CAAC;EAC1B,WAAW,GAAG,UAAU;EACxB,WAAW,GAAG,UAAU;;;;;EAMxB,MAAM,EAAE,KAAK;;;;EAKb,SAAS,EAAE,KAAK;;;;;EAMhB,YAAY,EAAE,KAAK;;;;;EAMnB,gBAAgB,EAAE,SAAS;;;;;EAM3B,SAAS,EAAE,QAAQ;;;;EAKnB,mBAAmB,EA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