@authup/server-core 1.0.0-beta.45 → 1.0.0-beta.47

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 (448) hide show
  1. package/LICENSE +661 -201
  2. package/README.md +3 -1
  3. package/dist/adapters/database/data-source/index.d.ts +0 -1
  4. package/dist/adapters/database/data-source/index.d.ts.map +1 -1
  5. package/dist/adapters/database/data-source/index.mjs +1 -2
  6. package/dist/adapters/database/domains/client/subscriber.d.ts +3 -6
  7. package/dist/adapters/database/domains/client/subscriber.d.ts.map +1 -1
  8. package/dist/adapters/database/domains/client/subscriber.mjs +21 -39
  9. package/dist/adapters/database/domains/client/subscriber.mjs.map +1 -1
  10. package/dist/adapters/database/domains/client-permission/subscriber.d.ts +3 -6
  11. package/dist/adapters/database/domains/client-permission/subscriber.d.ts.map +1 -1
  12. package/dist/adapters/database/domains/client-permission/subscriber.mjs +24 -49
  13. package/dist/adapters/database/domains/client-permission/subscriber.mjs.map +1 -1
  14. package/dist/adapters/database/domains/client-role/subscriber.d.ts +3 -6
  15. package/dist/adapters/database/domains/client-role/subscriber.d.ts.map +1 -1
  16. package/dist/adapters/database/domains/client-role/subscriber.mjs +24 -49
  17. package/dist/adapters/database/domains/client-role/subscriber.mjs.map +1 -1
  18. package/dist/adapters/database/domains/client-scope/subscriber.d.ts +3 -6
  19. package/dist/adapters/database/domains/client-scope/subscriber.d.ts.map +1 -1
  20. package/dist/adapters/database/domains/client-scope/subscriber.mjs +21 -36
  21. package/dist/adapters/database/domains/client-scope/subscriber.mjs.map +1 -1
  22. package/dist/adapters/database/domains/identity-provider/subscriber.d.ts +3 -6
  23. package/dist/adapters/database/domains/identity-provider/subscriber.d.ts.map +1 -1
  24. package/dist/adapters/database/domains/identity-provider/subscriber.mjs +21 -39
  25. package/dist/adapters/database/domains/identity-provider/subscriber.mjs.map +1 -1
  26. package/dist/adapters/database/domains/identity-provider-account/subscriber.d.ts +3 -6
  27. package/dist/adapters/database/domains/identity-provider-account/subscriber.d.ts.map +1 -1
  28. package/dist/adapters/database/domains/identity-provider-account/subscriber.mjs +21 -36
  29. package/dist/adapters/database/domains/identity-provider-account/subscriber.mjs.map +1 -1
  30. package/dist/adapters/database/domains/identity-provider-attribute/subscriber.d.ts +3 -6
  31. package/dist/adapters/database/domains/identity-provider-attribute/subscriber.d.ts.map +1 -1
  32. package/dist/adapters/database/domains/identity-provider-attribute/subscriber.mjs +21 -36
  33. package/dist/adapters/database/domains/identity-provider-attribute/subscriber.mjs.map +1 -1
  34. package/dist/adapters/database/domains/identity-provider-role-mapping/subscriber.d.ts +3 -6
  35. package/dist/adapters/database/domains/identity-provider-role-mapping/subscriber.d.ts.map +1 -1
  36. package/dist/adapters/database/domains/identity-provider-role-mapping/subscriber.mjs +21 -45
  37. package/dist/adapters/database/domains/identity-provider-role-mapping/subscriber.mjs.map +1 -1
  38. package/dist/adapters/database/domains/permission/subscriber.d.ts +3 -6
  39. package/dist/adapters/database/domains/permission/subscriber.d.ts.map +1 -1
  40. package/dist/adapters/database/domains/permission/subscriber.mjs +28 -47
  41. package/dist/adapters/database/domains/permission/subscriber.mjs.map +1 -1
  42. package/dist/adapters/database/domains/policy/subscriber.d.ts +3 -6
  43. package/dist/adapters/database/domains/policy/subscriber.d.ts.map +1 -1
  44. package/dist/adapters/database/domains/policy/subscriber.mjs +21 -36
  45. package/dist/adapters/database/domains/policy/subscriber.mjs.map +1 -1
  46. package/dist/adapters/database/domains/policy-attribute/subscriber.d.ts +3 -6
  47. package/dist/adapters/database/domains/policy-attribute/subscriber.d.ts.map +1 -1
  48. package/dist/adapters/database/domains/policy-attribute/subscriber.mjs +24 -45
  49. package/dist/adapters/database/domains/policy-attribute/subscriber.mjs.map +1 -1
  50. package/dist/adapters/database/domains/realm/subscriber.d.ts +3 -6
  51. package/dist/adapters/database/domains/realm/subscriber.d.ts.map +1 -1
  52. package/dist/adapters/database/domains/realm/subscriber.mjs +21 -36
  53. package/dist/adapters/database/domains/realm/subscriber.mjs.map +1 -1
  54. package/dist/adapters/database/domains/robot/subscriber.d.ts +3 -6
  55. package/dist/adapters/database/domains/robot/subscriber.d.ts.map +1 -1
  56. package/dist/adapters/database/domains/robot/subscriber.mjs +21 -39
  57. package/dist/adapters/database/domains/robot/subscriber.mjs.map +1 -1
  58. package/dist/adapters/database/domains/robot-permission/subscriber.d.ts +3 -6
  59. package/dist/adapters/database/domains/robot-permission/subscriber.d.ts.map +1 -1
  60. package/dist/adapters/database/domains/robot-permission/subscriber.mjs +24 -49
  61. package/dist/adapters/database/domains/robot-permission/subscriber.mjs.map +1 -1
  62. package/dist/adapters/database/domains/robot-role/subscriber.d.ts +3 -6
  63. package/dist/adapters/database/domains/robot-role/subscriber.d.ts.map +1 -1
  64. package/dist/adapters/database/domains/robot-role/subscriber.mjs +24 -49
  65. package/dist/adapters/database/domains/robot-role/subscriber.mjs.map +1 -1
  66. package/dist/adapters/database/domains/role/subscriber.d.ts +3 -6
  67. package/dist/adapters/database/domains/role/subscriber.d.ts.map +1 -1
  68. package/dist/adapters/database/domains/role/subscriber.mjs +21 -41
  69. package/dist/adapters/database/domains/role/subscriber.mjs.map +1 -1
  70. package/dist/adapters/database/domains/role-attribute/subscriber.d.ts +3 -6
  71. package/dist/adapters/database/domains/role-attribute/subscriber.d.ts.map +1 -1
  72. package/dist/adapters/database/domains/role-attribute/subscriber.mjs +24 -45
  73. package/dist/adapters/database/domains/role-attribute/subscriber.mjs.map +1 -1
  74. package/dist/adapters/database/domains/role-permission/subscriber.d.ts +3 -6
  75. package/dist/adapters/database/domains/role-permission/subscriber.d.ts.map +1 -1
  76. package/dist/adapters/database/domains/role-permission/subscriber.mjs +24 -49
  77. package/dist/adapters/database/domains/role-permission/subscriber.mjs.map +1 -1
  78. package/dist/adapters/database/domains/scope/subscriber.d.ts +3 -6
  79. package/dist/adapters/database/domains/scope/subscriber.d.ts.map +1 -1
  80. package/dist/adapters/database/domains/scope/subscriber.mjs +17 -43
  81. package/dist/adapters/database/domains/scope/subscriber.mjs.map +1 -1
  82. package/dist/adapters/database/domains/user/subscriber.d.ts +3 -6
  83. package/dist/adapters/database/domains/user/subscriber.d.ts.map +1 -1
  84. package/dist/adapters/database/domains/user/subscriber.mjs +21 -39
  85. package/dist/adapters/database/domains/user/subscriber.mjs.map +1 -1
  86. package/dist/adapters/database/domains/user-attribute/subscriber.d.ts +3 -6
  87. package/dist/adapters/database/domains/user-attribute/subscriber.d.ts.map +1 -1
  88. package/dist/adapters/database/domains/user-attribute/subscriber.mjs +24 -43
  89. package/dist/adapters/database/domains/user-attribute/subscriber.mjs.map +1 -1
  90. package/dist/adapters/database/domains/user-permission/subscriber.d.ts +3 -6
  91. package/dist/adapters/database/domains/user-permission/subscriber.d.ts.map +1 -1
  92. package/dist/adapters/database/domains/user-permission/subscriber.mjs +24 -49
  93. package/dist/adapters/database/domains/user-permission/subscriber.mjs.map +1 -1
  94. package/dist/adapters/database/domains/user-role/subscriber.d.ts +3 -6
  95. package/dist/adapters/database/domains/user-role/subscriber.d.ts.map +1 -1
  96. package/dist/adapters/database/domains/user-role/subscriber.mjs +24 -49
  97. package/dist/adapters/database/domains/user-role/subscriber.mjs.map +1 -1
  98. package/dist/adapters/database/index.d.ts +1 -0
  99. package/dist/adapters/database/index.d.ts.map +1 -1
  100. package/dist/adapters/database/index.mjs +3 -2
  101. package/dist/adapters/database/subscriber/index.d.ts +3 -0
  102. package/dist/adapters/database/subscriber/index.d.ts.map +1 -0
  103. package/dist/adapters/database/subscriber/index.mjs +5 -0
  104. package/dist/adapters/database/subscriber/module.d.ts +19 -0
  105. package/dist/adapters/database/subscriber/module.d.ts.map +1 -0
  106. package/dist/adapters/database/subscriber/module.mjs +70 -0
  107. package/dist/adapters/database/subscriber/module.mjs.map +1 -0
  108. package/dist/adapters/database/subscriber/types.d.ts +15 -0
  109. package/dist/adapters/database/subscriber/types.d.ts.map +1 -0
  110. package/dist/adapters/http/controllers/entities/identity-provider/module.mjs +1 -1
  111. package/dist/adapters/http/controllers/workflows/activate/module.d.ts +8 -1
  112. package/dist/adapters/http/controllers/workflows/activate/module.d.ts.map +1 -1
  113. package/dist/adapters/http/controllers/workflows/activate/module.mjs +20 -1
  114. package/dist/adapters/http/controllers/workflows/activate/module.mjs.map +1 -1
  115. package/dist/adapters/http/controllers/workflows/authorize/module.d.ts.map +1 -1
  116. package/dist/adapters/http/controllers/workflows/authorize/module.mjs +16 -37
  117. package/dist/adapters/http/controllers/workflows/authorize/module.mjs.map +1 -1
  118. package/dist/adapters/http/controllers/workflows/authorize/types.d.ts +2 -0
  119. package/dist/adapters/http/controllers/workflows/authorize/types.d.ts.map +1 -1
  120. package/dist/adapters/http/controllers/workflows/password-forgot/module.d.ts +8 -1
  121. package/dist/adapters/http/controllers/workflows/password-forgot/module.d.ts.map +1 -1
  122. package/dist/adapters/http/controllers/workflows/password-forgot/module.mjs +23 -2
  123. package/dist/adapters/http/controllers/workflows/password-forgot/module.mjs.map +1 -1
  124. package/dist/adapters/http/controllers/workflows/password-reset/module.d.ts +8 -1
  125. package/dist/adapters/http/controllers/workflows/password-reset/module.d.ts.map +1 -1
  126. package/dist/adapters/http/controllers/workflows/password-reset/module.mjs +21 -1
  127. package/dist/adapters/http/controllers/workflows/password-reset/module.mjs.map +1 -1
  128. package/dist/adapters/http/controllers/workflows/register/module.d.ts +8 -1
  129. package/dist/adapters/http/controllers/workflows/register/module.d.ts.map +1 -1
  130. package/dist/adapters/http/controllers/workflows/register/module.mjs +23 -2
  131. package/dist/adapters/http/controllers/workflows/register/module.mjs.map +1 -1
  132. package/dist/adapters/http/controllers/workflows/status/module.d.ts +11 -4
  133. package/dist/adapters/http/controllers/workflows/status/module.d.ts.map +1 -1
  134. package/dist/adapters/http/controllers/workflows/status/module.mjs +17 -5
  135. package/dist/adapters/http/controllers/workflows/status/module.mjs.map +1 -1
  136. package/dist/adapters/http/index.mjs +4 -1
  137. package/dist/adapters/http/middleware/built-in/cors.d.ts.map +1 -1
  138. package/dist/adapters/http/middleware/built-in/cors.mjs.map +1 -1
  139. package/dist/adapters/http/middleware/built-in/error.d.ts +6 -1
  140. package/dist/adapters/http/middleware/built-in/error.d.ts.map +1 -1
  141. package/dist/adapters/http/middleware/built-in/error.mjs +2 -3
  142. package/dist/adapters/http/middleware/built-in/error.mjs.map +1 -1
  143. package/dist/adapters/http/middleware/built-in/index.d.ts +1 -0
  144. package/dist/adapters/http/middleware/built-in/index.d.ts.map +1 -1
  145. package/dist/adapters/http/middleware/built-in/index.mjs +2 -1
  146. package/dist/adapters/http/middleware/built-in/logger.d.ts +2 -0
  147. package/dist/adapters/http/middleware/built-in/logger.d.ts.map +1 -1
  148. package/dist/adapters/http/middleware/built-in/logger.mjs +1 -2
  149. package/dist/adapters/http/middleware/built-in/logger.mjs.map +1 -1
  150. package/dist/adapters/http/middleware/built-in/ui-http-client.d.ts +15 -0
  151. package/dist/adapters/http/middleware/built-in/ui-http-client.d.ts.map +1 -0
  152. package/dist/adapters/http/middleware/built-in/ui-http-client.mjs +25 -0
  153. package/dist/adapters/http/middleware/built-in/ui-http-client.mjs.map +1 -0
  154. package/dist/adapters/http/middleware/index.mjs +2 -1
  155. package/dist/adapters/http/request/helpers/index.d.ts +2 -0
  156. package/dist/adapters/http/request/helpers/index.d.ts.map +1 -1
  157. package/dist/adapters/http/request/helpers/index.mjs +3 -1
  158. package/dist/adapters/http/request/helpers/locale.d.ts +14 -0
  159. package/dist/adapters/http/request/helpers/locale.d.ts.map +1 -0
  160. package/dist/adapters/http/request/helpers/locale.mjs +32 -0
  161. package/dist/adapters/http/request/helpers/locale.mjs.map +1 -0
  162. package/dist/adapters/http/request/helpers/locations.mjs +1 -1
  163. package/dist/adapters/http/request/helpers/redirect.d.ts +14 -0
  164. package/dist/adapters/http/request/helpers/redirect.d.ts.map +1 -0
  165. package/dist/adapters/http/request/helpers/redirect.mjs +36 -0
  166. package/dist/adapters/http/request/helpers/redirect.mjs.map +1 -0
  167. package/dist/adapters/http/request/index.mjs +3 -1
  168. package/dist/adapters/http/ui/base-path.d.ts +9 -0
  169. package/dist/adapters/http/ui/base-path.d.ts.map +1 -0
  170. package/dist/adapters/http/ui/base-path.mjs +18 -0
  171. package/dist/adapters/http/ui/base-path.mjs.map +1 -0
  172. package/dist/adapters/http/ui/index.d.ts +5 -0
  173. package/dist/adapters/http/ui/index.d.ts.map +1 -0
  174. package/dist/adapters/http/ui/index.mjs +7 -0
  175. package/dist/adapters/http/ui/render.d.ts +4 -0
  176. package/dist/adapters/http/ui/render.d.ts.map +1 -0
  177. package/dist/adapters/http/ui/render.mjs +60 -0
  178. package/dist/adapters/http/ui/render.mjs.map +1 -0
  179. package/dist/adapters/http/ui/serve.d.ts +16 -0
  180. package/dist/adapters/http/ui/serve.d.ts.map +1 -0
  181. package/dist/adapters/http/ui/serve.mjs +32 -0
  182. package/dist/adapters/http/ui/serve.mjs.map +1 -0
  183. package/dist/adapters/http/ui/types.d.ts +8 -0
  184. package/dist/adapters/http/ui/types.d.ts.map +1 -0
  185. package/dist/adapters/http/ui/types.mjs +4 -0
  186. package/dist/app/index.d.ts +0 -2
  187. package/dist/app/index.d.ts.map +1 -1
  188. package/dist/app/index.mjs +3 -3
  189. package/dist/app/modules/config/constants.d.ts +1 -0
  190. package/dist/app/modules/config/constants.d.ts.map +1 -1
  191. package/dist/app/modules/config/constants.mjs +1 -0
  192. package/dist/app/modules/config/constants.mjs.map +1 -1
  193. package/dist/app/modules/config/index.d.ts +1 -0
  194. package/dist/app/modules/config/index.d.ts.map +1 -1
  195. package/dist/app/modules/config/index.mjs +2 -1
  196. package/dist/app/modules/config/normalize.d.ts.map +1 -1
  197. package/dist/app/modules/config/normalize.mjs +9 -2
  198. package/dist/app/modules/config/normalize.mjs.map +1 -1
  199. package/dist/app/modules/config/origins.d.ts +10 -0
  200. package/dist/app/modules/config/origins.d.ts.map +1 -0
  201. package/dist/app/modules/config/origins.mjs +21 -0
  202. package/dist/app/modules/config/origins.mjs.map +1 -0
  203. package/dist/app/modules/config/parse.d.ts.map +1 -1
  204. package/dist/app/modules/config/parse.mjs +1 -0
  205. package/dist/app/modules/config/parse.mjs.map +1 -1
  206. package/dist/app/modules/config/read/env.d.ts.map +1 -1
  207. package/dist/app/modules/config/read/env.mjs +2 -0
  208. package/dist/app/modules/config/read/env.mjs.map +1 -1
  209. package/dist/app/modules/config/types.d.ts +14 -0
  210. package/dist/app/modules/config/types.d.ts.map +1 -1
  211. package/dist/app/modules/database/constants.d.ts +2 -0
  212. package/dist/app/modules/database/constants.d.ts.map +1 -1
  213. package/dist/app/modules/database/constants.mjs +4 -1
  214. package/dist/app/modules/database/constants.mjs.map +1 -1
  215. package/dist/app/modules/database/module.d.ts +5 -1
  216. package/dist/app/modules/database/module.d.ts.map +1 -1
  217. package/dist/app/modules/database/module.mjs +26 -15
  218. package/dist/app/modules/database/module.mjs.map +1 -1
  219. package/dist/app/modules/http/constants.d.ts +11 -0
  220. package/dist/app/modules/http/constants.d.ts.map +1 -1
  221. package/dist/app/modules/http/constants.mjs +12 -1
  222. package/dist/app/modules/http/constants.mjs.map +1 -1
  223. package/dist/app/modules/http/modules/controller.d.ts +5 -1
  224. package/dist/app/modules/http/modules/controller.d.ts.map +1 -1
  225. package/dist/app/modules/http/modules/controller.mjs +75 -10
  226. package/dist/app/modules/http/modules/controller.mjs.map +1 -1
  227. package/dist/app/modules/http/modules/middleware.d.ts +2 -1
  228. package/dist/app/modules/http/modules/middleware.d.ts.map +1 -1
  229. package/dist/app/modules/http/modules/middleware.mjs +19 -4
  230. package/dist/app/modules/http/modules/middleware.mjs.map +1 -1
  231. package/dist/app/modules/identity/module.mjs +4 -4
  232. package/dist/app/modules/identity/module.mjs.map +1 -1
  233. package/dist/app/modules/identity/repositories/provider/account/module.d.ts +3 -1
  234. package/dist/app/modules/identity/repositories/provider/account/module.d.ts.map +1 -1
  235. package/dist/app/modules/identity/repositories/provider/account/module.mjs +6 -3
  236. package/dist/app/modules/identity/repositories/provider/account/module.mjs.map +1 -1
  237. package/dist/app/modules/identity/repositories/provider/mapper/attribute.d.ts +3 -0
  238. package/dist/app/modules/identity/repositories/provider/mapper/attribute.d.ts.map +1 -1
  239. package/dist/app/modules/identity/repositories/provider/mapper/attribute.mjs +5 -2
  240. package/dist/app/modules/identity/repositories/provider/mapper/attribute.mjs.map +1 -1
  241. package/dist/app/modules/identity/repositories/provider/mapper/permission.d.ts +3 -0
  242. package/dist/app/modules/identity/repositories/provider/mapper/permission.d.ts.map +1 -1
  243. package/dist/app/modules/identity/repositories/provider/mapper/permission.mjs +5 -2
  244. package/dist/app/modules/identity/repositories/provider/mapper/permission.mjs.map +1 -1
  245. package/dist/app/modules/identity/repositories/provider/mapper/role.d.ts +3 -0
  246. package/dist/app/modules/identity/repositories/provider/mapper/role.d.ts.map +1 -1
  247. package/dist/app/modules/identity/repositories/provider/mapper/role.mjs +5 -2
  248. package/dist/app/modules/identity/repositories/provider/mapper/role.mjs.map +1 -1
  249. package/dist/app/modules/index.mjs +3 -2
  250. package/dist/app/modules/logger/module.d.ts.map +1 -1
  251. package/dist/app/modules/logger/module.mjs +1 -5
  252. package/dist/app/modules/logger/module.mjs.map +1 -1
  253. package/dist/app/modules/mail/constants.d.ts +2 -1
  254. package/dist/app/modules/mail/constants.d.ts.map +1 -1
  255. package/dist/app/modules/mail/constants.mjs +2 -1
  256. package/dist/app/modules/mail/constants.mjs.map +1 -1
  257. package/dist/app/modules/mail/index.mjs +2 -2
  258. package/dist/app/modules/mail/module.d.ts.map +1 -1
  259. package/dist/app/modules/mail/module.mjs +4 -1
  260. package/dist/app/modules/mail/module.mjs.map +1 -1
  261. package/dist/app/modules/oauth2/module.d.ts.map +1 -1
  262. package/dist/app/modules/oauth2/module.mjs +3 -1
  263. package/dist/app/modules/oauth2/module.mjs.map +1 -1
  264. package/dist/app/modules/oauth2/repositories/key/repository.d.ts +3 -0
  265. package/dist/app/modules/oauth2/repositories/key/repository.d.ts.map +1 -1
  266. package/dist/app/modules/oauth2/repositories/key/repository.mjs +5 -2
  267. package/dist/app/modules/oauth2/repositories/key/repository.mjs.map +1 -1
  268. package/dist/app/modules/provisioning/module.d.ts.map +1 -1
  269. package/dist/app/modules/provisioning/module.mjs +12 -0
  270. package/dist/app/modules/provisioning/module.mjs.map +1 -1
  271. package/dist/app/modules/provisioning/sources/default/module.d.ts.map +1 -1
  272. package/dist/app/modules/provisioning/sources/default/module.mjs +2 -1
  273. package/dist/app/modules/provisioning/sources/default/module.mjs.map +1 -1
  274. package/dist/core/entities/client/index.d.ts +1 -0
  275. package/dist/core/entities/client/index.d.ts.map +1 -1
  276. package/dist/core/entities/client/index.mjs +2 -1
  277. package/dist/core/entities/client/service.d.ts.map +1 -1
  278. package/dist/core/entities/client/service.mjs +3 -2
  279. package/dist/core/entities/client/service.mjs.map +1 -1
  280. package/dist/core/entities/client/types.d.ts +11 -1
  281. package/dist/core/entities/client/types.d.ts.map +1 -1
  282. package/dist/core/entities/client/web-client.d.ts +34 -0
  283. package/dist/core/entities/client/web-client.d.ts.map +1 -0
  284. package/dist/core/entities/client/web-client.mjs +62 -0
  285. package/dist/core/entities/client/web-client.mjs.map +1 -0
  286. package/dist/core/entities/index.mjs +2 -1
  287. package/dist/core/entities/realm/service.d.ts +6 -1
  288. package/dist/core/entities/realm/service.d.ts.map +1 -1
  289. package/dist/core/entities/realm/service.mjs +9 -0
  290. package/dist/core/entities/realm/service.mjs.map +1 -1
  291. package/dist/core/identity/index.d.ts +1 -0
  292. package/dist/core/identity/index.d.ts.map +1 -1
  293. package/dist/core/identity/index.mjs +2 -1
  294. package/dist/core/identity/password-recovery/constants.d.ts +6 -0
  295. package/dist/core/identity/password-recovery/constants.d.ts.map +1 -0
  296. package/dist/core/identity/password-recovery/constants.mjs +12 -0
  297. package/dist/core/identity/password-recovery/constants.mjs.map +1 -0
  298. package/dist/core/identity/password-recovery/index.d.ts +1 -0
  299. package/dist/core/identity/password-recovery/index.d.ts.map +1 -1
  300. package/dist/core/identity/password-recovery/index.mjs +2 -1
  301. package/dist/core/identity/password-recovery/service.d.ts +4 -2
  302. package/dist/core/identity/password-recovery/service.d.ts.map +1 -1
  303. package/dist/core/identity/password-recovery/service.mjs +17 -6
  304. package/dist/core/identity/password-recovery/service.mjs.map +1 -1
  305. package/dist/core/identity/password-recovery/types.d.ts +5 -2
  306. package/dist/core/identity/password-recovery/types.d.ts.map +1 -1
  307. package/dist/core/identity/registration/service.d.ts +4 -2
  308. package/dist/core/identity/registration/service.d.ts.map +1 -1
  309. package/dist/core/identity/registration/service.mjs +15 -6
  310. package/dist/core/identity/registration/service.mjs.map +1 -1
  311. package/dist/core/identity/registration/types.d.ts +5 -2
  312. package/dist/core/identity/registration/types.d.ts.map +1 -1
  313. package/dist/core/identity/role/module.d.ts.map +1 -1
  314. package/dist/core/identity/role/module.mjs +1 -1
  315. package/dist/core/identity/role/module.mjs.map +1 -1
  316. package/dist/core/identity/types.d.ts +10 -0
  317. package/dist/core/identity/types.d.ts.map +1 -0
  318. package/dist/core/identity/types.mjs +4 -0
  319. package/dist/core/index.mjs +8 -1
  320. package/dist/core/mail/format/blocks.d.ts +12 -0
  321. package/dist/core/mail/format/blocks.d.ts.map +1 -0
  322. package/dist/core/mail/format/blocks.mjs +47 -0
  323. package/dist/core/mail/format/blocks.mjs.map +1 -0
  324. package/dist/core/mail/format/html.d.ts +9 -0
  325. package/dist/core/mail/format/html.d.ts.map +1 -0
  326. package/dist/core/mail/format/html.mjs +41 -0
  327. package/dist/core/mail/format/html.mjs.map +1 -0
  328. package/dist/core/mail/format/index.d.ts +5 -0
  329. package/dist/core/mail/format/index.d.ts.map +1 -0
  330. package/dist/core/mail/format/index.mjs +7 -0
  331. package/dist/core/mail/format/text.d.ts +3 -0
  332. package/dist/core/mail/format/text.d.ts.map +1 -0
  333. package/dist/core/mail/format/text.mjs +20 -0
  334. package/dist/core/mail/format/text.mjs.map +1 -0
  335. package/dist/core/mail/format/types.d.ts +30 -0
  336. package/dist/core/mail/format/types.d.ts.map +1 -0
  337. package/dist/core/mail/format/types.mjs +4 -0
  338. package/dist/core/mail/index.d.ts +3 -0
  339. package/dist/core/mail/index.d.ts.map +1 -1
  340. package/dist/core/mail/index.mjs +6 -1
  341. package/dist/core/mail/renderer.d.ts +10 -0
  342. package/dist/core/mail/renderer.d.ts.map +1 -0
  343. package/dist/core/mail/renderer.mjs +49 -0
  344. package/dist/core/mail/renderer.mjs.map +1 -0
  345. package/dist/core/mail/template/define.d.ts +7 -0
  346. package/dist/core/mail/template/define.d.ts.map +1 -0
  347. package/dist/core/mail/template/define.mjs +14 -0
  348. package/dist/core/mail/template/define.mjs.map +1 -0
  349. package/dist/core/mail/template/index.d.ts +4 -0
  350. package/dist/core/mail/template/index.d.ts.map +1 -0
  351. package/dist/core/mail/template/index.mjs +7 -0
  352. package/dist/core/mail/template/registry.d.ts +6 -0
  353. package/dist/core/mail/template/registry.d.ts.map +1 -0
  354. package/dist/core/mail/template/registry.mjs +15 -0
  355. package/dist/core/mail/template/registry.mjs.map +1 -0
  356. package/dist/core/mail/template/templates/password-reset.d.ts +3 -0
  357. package/dist/core/mail/template/templates/password-reset.d.ts.map +1 -0
  358. package/dist/core/mail/template/templates/password-reset.mjs +36 -0
  359. package/dist/core/mail/template/templates/password-reset.mjs.map +1 -0
  360. package/dist/core/mail/template/templates/registration-activation.d.ts +3 -0
  361. package/dist/core/mail/template/templates/registration-activation.d.ts.map +1 -0
  362. package/dist/core/mail/template/templates/registration-activation.mjs +34 -0
  363. package/dist/core/mail/template/templates/registration-activation.mjs.map +1 -0
  364. package/dist/core/mail/template/types.d.ts +39 -0
  365. package/dist/core/mail/template/types.d.ts.map +1 -0
  366. package/dist/core/mail/template/types.mjs +13 -0
  367. package/dist/core/mail/template/types.mjs.map +1 -0
  368. package/dist/core/mail/types.d.ts +21 -0
  369. package/dist/core/mail/types.d.ts.map +1 -1
  370. package/dist/index.mjs +7 -4
  371. package/dist/swagger.json +98 -3
  372. package/dist/ui/client/.vite/ssr-manifest.json +49086 -875
  373. package/dist/ui/client/assets/asap-latin-400-normal-Dc37g3Il.woff +0 -0
  374. package/dist/ui/client/assets/asap-latin-400-normal-DnZ1MOsG.woff2 +0 -0
  375. package/dist/ui/client/assets/asap-latin-700-normal-Dqcopq14.woff +0 -0
  376. package/dist/ui/client/assets/asap-latin-700-normal-l2Y8pi-F.woff2 +0 -0
  377. package/dist/ui/client/assets/asap-latin-ext-400-normal-C-fcRdtE.woff +0 -0
  378. package/dist/ui/client/assets/asap-latin-ext-400-normal-DwYtpHbV.woff2 +0 -0
  379. package/dist/ui/client/assets/asap-latin-ext-700-normal-D00OESsZ.woff +0 -0
  380. package/dist/ui/client/assets/asap-latin-ext-700-normal-y8bo5aW5.woff2 +0 -0
  381. package/dist/ui/client/assets/asap-vietnamese-400-normal-DGyJlJLT.woff2 +0 -0
  382. package/dist/ui/client/assets/asap-vietnamese-400-normal-lfLaoF2x.woff +0 -0
  383. package/dist/ui/client/assets/asap-vietnamese-700-normal-B-e19ug5.woff +0 -0
  384. package/dist/ui/client/assets/asap-vietnamese-700-normal-D-SxY94i.woff2 +0 -0
  385. package/dist/ui/client/assets/index-BeXJgvKE.css +2 -0
  386. package/dist/ui/client/assets/index-CgLTRwpP.js +95 -0
  387. package/dist/ui/client/assets/nunito-cyrillic-300-normal-BPQV259B.woff2 +0 -0
  388. package/dist/ui/client/assets/nunito-cyrillic-300-normal-g5qSsvc0.woff +0 -0
  389. package/dist/ui/client/assets/nunito-cyrillic-400-normal-D1j0u8EH.woff +0 -0
  390. package/dist/ui/client/assets/nunito-cyrillic-400-normal-xAOo5cBP.woff2 +0 -0
  391. package/dist/ui/client/assets/nunito-cyrillic-600-normal-BUjmtIuu.woff +0 -0
  392. package/dist/ui/client/assets/nunito-cyrillic-600-normal-DJGQ2h05.woff2 +0 -0
  393. package/dist/ui/client/assets/nunito-cyrillic-700-normal-DP36NgGt.woff2 +0 -0
  394. package/dist/ui/client/assets/nunito-cyrillic-700-normal-DfHRUDv-.woff +0 -0
  395. package/dist/ui/client/assets/nunito-cyrillic-ext-300-normal-BDHtqmCR.woff +0 -0
  396. package/dist/ui/client/assets/nunito-cyrillic-ext-300-normal-ChMQLIrm.woff2 +0 -0
  397. package/dist/ui/client/assets/nunito-cyrillic-ext-400-normal-CuPM9foi.woff2 +0 -0
  398. package/dist/ui/client/assets/nunito-cyrillic-ext-400-normal-xaE7D4Sw.woff +0 -0
  399. package/dist/ui/client/assets/nunito-cyrillic-ext-600-normal-CWPPjBOD.woff2 +0 -0
  400. package/dist/ui/client/assets/nunito-cyrillic-ext-600-normal-vnfu4DTE.woff +0 -0
  401. package/dist/ui/client/assets/nunito-cyrillic-ext-700-normal-BuR0mlCG.woff2 +0 -0
  402. package/dist/ui/client/assets/nunito-cyrillic-ext-700-normal-DfoqN4Gs.woff +0 -0
  403. package/dist/ui/client/assets/nunito-latin-300-normal-C3ZIKvzv.woff +0 -0
  404. package/dist/ui/client/assets/nunito-latin-300-normal-COoPE5VN.woff2 +0 -0
  405. package/dist/ui/client/assets/nunito-latin-400-normal-DKg4f3fz.woff +0 -0
  406. package/dist/ui/client/assets/nunito-latin-400-normal-r8SDr6Up.woff2 +0 -0
  407. package/dist/ui/client/assets/nunito-latin-600-normal-Br8yIETf.woff2 +0 -0
  408. package/dist/ui/client/assets/nunito-latin-600-normal-Cd0eNu1l.woff +0 -0
  409. package/dist/ui/client/assets/nunito-latin-700-normal-Dort48En.woff2 +0 -0
  410. package/dist/ui/client/assets/nunito-latin-700-normal-OcDqTBcA.woff +0 -0
  411. package/dist/ui/client/assets/nunito-latin-ext-300-normal-D1SyVuPt.woff2 +0 -0
  412. package/dist/ui/client/assets/nunito-latin-ext-300-normal-DfqbmdMl.woff +0 -0
  413. package/dist/ui/client/assets/nunito-latin-ext-400-normal-CjMJVfGn.woff +0 -0
  414. package/dist/ui/client/assets/nunito-latin-ext-400-normal-i-8OOpdj.woff2 +0 -0
  415. package/dist/ui/client/assets/nunito-latin-ext-600-normal-BKUpuB78.woff +0 -0
  416. package/dist/ui/client/assets/nunito-latin-ext-600-normal-Dd9Zuxh1.woff2 +0 -0
  417. package/dist/ui/client/assets/nunito-latin-ext-700-normal-BWeMsAzO.woff2 +0 -0
  418. package/dist/ui/client/assets/nunito-latin-ext-700-normal-D4woHhbd.woff +0 -0
  419. package/dist/ui/client/assets/nunito-vietnamese-300-normal-DATld5Vw.woff +0 -0
  420. package/dist/ui/client/assets/nunito-vietnamese-300-normal-mLneKULB.woff2 +0 -0
  421. package/dist/ui/client/assets/nunito-vietnamese-400-normal-BHkVbP3T.woff2 +0 -0
  422. package/dist/ui/client/assets/nunito-vietnamese-400-normal-DtOtW02z.woff +0 -0
  423. package/dist/ui/client/assets/nunito-vietnamese-600-normal-BY8O6Cug.woff2 +0 -0
  424. package/dist/ui/client/assets/nunito-vietnamese-600-normal-DO1RqFw5.woff +0 -0
  425. package/dist/ui/client/assets/nunito-vietnamese-700-normal-C9SQsXvj.woff +0 -0
  426. package/dist/ui/client/assets/nunito-vietnamese-700-normal-Ch8EUCfz.woff2 +0 -0
  427. package/dist/ui/client/index.html +2 -2
  428. package/dist/ui/server/server.js +20388 -18163
  429. package/package.json +20 -17
  430. package/dist/adapters/database/data-source/singleton.d.ts +0 -5
  431. package/dist/adapters/database/data-source/singleton.d.ts.map +0 -1
  432. package/dist/adapters/database/data-source/singleton.mjs +0 -19
  433. package/dist/adapters/database/data-source/singleton.mjs.map +0 -1
  434. package/dist/adapters/database/event-publisher/index.d.ts +0 -2
  435. package/dist/adapters/database/event-publisher/index.d.ts.map +0 -1
  436. package/dist/adapters/database/event-publisher/index.mjs +0 -5
  437. package/dist/adapters/database/event-publisher/module.d.ts +0 -6
  438. package/dist/adapters/database/event-publisher/module.d.ts.map +0 -1
  439. package/dist/adapters/database/event-publisher/module.mjs +0 -25
  440. package/dist/adapters/database/event-publisher/module.mjs.map +0 -1
  441. package/dist/app/module.d.ts +0 -2
  442. package/dist/app/module.d.ts.map +0 -1
  443. package/dist/app/module.mjs +0 -5
  444. package/dist/app/types.d.ts +0 -2
  445. package/dist/app/types.d.ts.map +0 -1
  446. package/dist/ui/client/assets/index-CjKS9a0I.css +0 -1
  447. package/dist/ui/client/assets/index-bGxpD1zZ.js +0 -95
  448. /package/dist/{app → adapters/database/subscriber}/types.mjs +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"subscriber.mjs","names":["EntityDefaultEventName","EntityType","buildEntityChannelName","buildEntityNamespaceName","buildRedisKeyPath","EventSubscriber","publishDomainEvent","UserPermissionEntity","CachePrefix","publishEvent","event","data","destinations","channel","id","USER_PERMISSION","user_realm_id","push","namespace","permission_realm_id","content","type","UserPermissionSubscriber","listenTo","afterInsert","connection","queryResultCache","remove","prefix","USER_OWNED_PERMISSIONS","key","entity","user_id","CREATED","Promise","resolve","undefined","afterUpdate","UPDATED","afterRemove","DELETED"],"sources":["../../../../../src/adapters/database/domains/user-permission/subscriber.ts"],"sourcesContent":["/*\n * Copyright (c) 2022-2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { UserPermission } from '@authup/core-kit';\nimport {\n EntityDefaultEventName, \n EntityType,\n buildEntityChannelName,\n buildEntityNamespaceName,\n} from '@authup/core-kit';\nimport type { DomainEventDestination } from '@authup/server-kit';\nimport { buildRedisKeyPath } from '@authup/server-kit';\nimport type {\n EntitySubscriberInterface, \n InsertEvent,\n RemoveEvent,\n UpdateEvent,\n} from 'typeorm';\nimport { EventSubscriber } from 'typeorm';\nimport { publishDomainEvent } from '../../event-publisher/index.ts';\nimport { UserPermissionEntity } from './entity.ts';\nimport { CachePrefix } from '../constants.ts';\n\nasync function publishEvent(\n event: `${EntityDefaultEventName}`,\n data: UserPermission,\n) {\n const destinations : DomainEventDestination[] = [\n { channel: (id) => buildEntityChannelName(EntityType.USER_PERMISSION, id) },\n ];\n if (data.user_realm_id) {\n destinations.push({\n channel: (id) => buildEntityChannelName(EntityType.USER_PERMISSION, id),\n namespace: buildEntityNamespaceName(data.user_realm_id),\n });\n }\n\n if (data.permission_realm_id) {\n destinations.push({\n channel: (id) => buildEntityChannelName(EntityType.USER_PERMISSION, id),\n namespace: buildEntityNamespaceName(data.permission_realm_id),\n });\n }\n\n await publishDomainEvent({\n content: {\n type: EntityType.USER_PERMISSION,\n event,\n data,\n },\n destinations,\n });\n}\n\n@EventSubscriber()\nexport class UserPermissionSubscriber implements EntitySubscriberInterface<UserPermission> {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n listenTo(): Function | string {\n return UserPermissionEntity;\n }\n\n async afterInsert(event: InsertEvent<UserPermission>): Promise<any> {\n if (event.connection.queryResultCache) {\n await event.connection.queryResultCache.remove([\n buildRedisKeyPath({\n prefix: CachePrefix.USER_OWNED_PERMISSIONS,\n key: event.entity.user_id,\n }),\n ]);\n }\n\n await publishEvent(EntityDefaultEventName.CREATED, event.entity);\n\n return Promise.resolve(undefined);\n }\n\n async afterUpdate(event: UpdateEvent<UserPermission>): Promise<any> {\n if (!event.entity) {\n return;\n }\n\n if (event.connection.queryResultCache) {\n await event.connection.queryResultCache.remove([\n buildRedisKeyPath({\n prefix: CachePrefix.USER_OWNED_PERMISSIONS,\n key: event.entity.user_id,\n }),\n ]);\n }\n\n await publishEvent(EntityDefaultEventName.UPDATED, event.entity as UserPermission);\n }\n\n async afterRemove(event: RemoveEvent<UserPermission>): Promise<any> {\n if (!event.entity) {\n return;\n }\n\n if (event.connection.queryResultCache) {\n await event.connection.queryResultCache.remove([\n buildRedisKeyPath({\n prefix: CachePrefix.USER_OWNED_PERMISSIONS,\n key: event.entity.user_id,\n }),\n ]);\n }\n\n await publishEvent(EntityDefaultEventName.DELETED, event.entity);\n }\n}\n"],"mappings":";;;;;;;;;;;AAKC,SAAA,aAAA,YAAA,QAAA,KAAA,MAAA;;;;;;AAsBD,eAAeS,aACXC,OACAC,MAAoB;CAEpB,MAAMC,eAA0C,CAC5C,EAAEC,UAAUC,OAAOZ,uBAAuBD,WAAWc,iBAAiBD,EAAAA,EAAI,CAAA;CAE9E,IAAIH,KAAKK,eACLJ,aAAaK,KAAK;EACdJ,UAAUC,OAAOZ,uBAAuBD,WAAWc,iBAAiBD,EAAAA;EACpEI,WAAWf,yBAAyBQ,KAAKK,aAAa;CAC1D,CAAA;CAGJ,IAAIL,KAAKQ,qBACLP,aAAaK,KAAK;EACdJ,UAAUC,OAAOZ,uBAAuBD,WAAWc,iBAAiBD,EAAAA;EACpEI,WAAWf,yBAAyBQ,KAAKQ,mBAAmB;CAChE,CAAA;CAGJ,MAAMb,mBAAmB;EACrBc,SAAS;GACLC,MAAMpB,WAAWc;GACjBL;GACAC;EACJ;EACAC;CACJ,CAAA;AACJ;AAGA,IAAaU,2BAAb,MAAaA;CAETC,WAA8B;EAC1B,OAAOhB;CACX;CAEA,MAAMiB,YAAYd,OAAkD;EAChE,IAAIA,MAAMe,WAAWC,kBACjB,MAAMhB,MAAMe,WAAWC,iBAAiBC,OAAO,CAC3CvB,kBAAkB;GACdwB,QAAQpB,YAAYqB;GACpBC,KAAKpB,MAAMqB,OAAOC;EACtB,CAAA,CAAA,CACH;EAGL,MAAMvB,aAAaT,uBAAuBiC,SAASvB,MAAMqB,MAAM;EAE/D,OAAOG,QAAQC,QAAQC,KAAAA,CAAAA;CAC3B;CAEA,MAAMC,YAAY3B,OAAkD;EAChE,IAAI,CAACA,MAAMqB,QACP;EAGJ,IAAIrB,MAAMe,WAAWC,kBACjB,MAAMhB,MAAMe,WAAWC,iBAAiBC,OAAO,CAC3CvB,kBAAkB;GACdwB,QAAQpB,YAAYqB;GACpBC,KAAKpB,MAAMqB,OAAOC;EACtB,CAAA,CAAA,CACH;EAGL,MAAMvB,aAAaT,uBAAuBsC,SAAS5B,MAAMqB,MAAM;CACnE;CAEA,MAAMQ,YAAY7B,OAAkD;EAChE,IAAI,CAACA,MAAMqB,QACP;EAGJ,IAAIrB,MAAMe,WAAWC,kBACjB,MAAMhB,MAAMe,WAAWC,iBAAiBC,OAAO,CAC3CvB,kBAAkB;GACdwB,QAAQpB,YAAYqB;GACpBC,KAAKpB,MAAMqB,OAAOC;EACtB,CAAA,CAAA,CACH;EAGL,MAAMvB,aAAaT,uBAAuBwC,SAAS9B,MAAMqB,MAAM;CACnE;AACJ"}
1
+ {"version":3,"file":"subscriber.mjs","names":["EntityType","buildRedisKeyPath","EventSubscriber","EntitySubscriber","buildEntityDestinations","UserPermissionEntity","CachePrefix","UserPermissionSubscriber","type","USER_PERMISSION","target","destinations","data","user_realm_id","permission_realm_id","cache","onInsert","keys","prefix","USER_OWNED_PERMISSIONS","key","user_id"],"sources":["../../../../../src/adapters/database/domains/user-permission/subscriber.ts"],"sourcesContent":["/*\n * Copyright (c) 2022-2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { UserPermission } from '@authup/core-kit';\nimport { EntityType } from '@authup/core-kit';\nimport { buildRedisKeyPath } from '@authup/server-kit';\nimport { EventSubscriber } from 'typeorm';\nimport { EntitySubscriber, buildEntityDestinations } from '../../subscriber/index.ts';\nimport { UserPermissionEntity } from './entity.ts';\nimport { CachePrefix } from '../constants.ts';\n\n@EventSubscriber()\nexport class UserPermissionSubscriber extends EntitySubscriber<UserPermission> {\n constructor() {\n super({\n type: EntityType.USER_PERMISSION,\n target: UserPermissionEntity,\n destinations: buildEntityDestinations(EntityType.USER_PERMISSION, (data) => [\n data.user_realm_id,\n data.permission_realm_id,\n ]),\n cache: {\n onInsert: true,\n keys: (data) => [\n buildRedisKeyPath({\n prefix: CachePrefix.USER_OWNED_PERMISSIONS,\n key: data.user_id,\n }),\n ],\n },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;AAKC,SAAA,aAAA,YAAA,QAAA,KAAA,MAAA;;;;;;;;;AAWD,IAAaO,2BAAb,cAA8CJ,iBAAAA;CAC1C,cAAc;EACV,MAAM;GACFK,MAAMR,WAAWS;GACjBC,QAAQL;GACRM,cAAcP,wBAAwBJ,WAAWS,kBAAkBG,SAAS,CACxEA,KAAKC,eACLD,KAAKE,mBAAAA,CACR;GACDC,OAAO;IACHC,UAAU;IACVC,OAAOL,SAAS,CACZX,kBAAkB;KACdiB,QAAQZ,YAAYa;KACpBC,KAAKR,KAAKS;IACd,CAAA,CAAA;GAER;EACJ,CAAA;CACJ;AACJ"}
@@ -1,9 +1,6 @@
1
1
  import type { UserRole } from '@authup/core-kit';
2
- import type { EntitySubscriberInterface, InsertEvent, RemoveEvent, UpdateEvent } from 'typeorm';
3
- export declare class UserRoleSubscriber implements EntitySubscriberInterface<UserRole> {
4
- listenTo(): Function | string;
5
- afterInsert(event: InsertEvent<UserRole>): Promise<any>;
6
- afterUpdate(event: UpdateEvent<UserRole>): Promise<any>;
7
- afterRemove(event: RemoveEvent<UserRole>): Promise<any>;
2
+ import { EntitySubscriber } from '../../subscriber/index.ts';
3
+ export declare class UserRoleSubscriber extends EntitySubscriber<UserRole> {
4
+ constructor();
8
5
  }
9
6
  //# sourceMappingURL=subscriber.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"subscriber.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/database/domains/user-role/subscriber.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AASjD,OAAO,KAAK,EACR,yBAAyB,EACzB,WAAW,EACX,WAAW,EACX,WAAW,EACd,MAAM,SAAS,CAAC;AAoCjB,qBACa,kBAAmB,YAAW,yBAAyB,CAAC,QAAQ,CAAC;IAE1E,QAAQ,IAAI,QAAQ,GAAG,MAAM;IAIvB,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAiBvD,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAiBvD,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;CAgBhE"}
1
+ {"version":3,"file":"subscriber.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/database/domains/user-role/subscriber.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIjD,OAAO,EAAE,gBAAgB,EAA2B,MAAM,2BAA2B,CAAC;AAItF,qBACa,kBAAmB,SAAQ,gBAAgB,CAAC,QAAQ,CAAC;;CAoBjE"}
@@ -1,12 +1,12 @@
1
1
  import "node:path";
2
2
  import "node:url";
3
3
  import.meta.url;
4
- import { publishDomainEvent } from "../../event-publisher/module.mjs";
5
- import "../../event-publisher/index.mjs";
4
+ import { EntitySubscriber, buildEntityDestinations } from "../../subscriber/module.mjs";
5
+ import "../../subscriber/index.mjs";
6
6
  import { CachePrefix } from "../constants.mjs";
7
7
  import { UserRoleEntity } from "./entity.mjs";
8
8
  import { EventSubscriber } from "typeorm";
9
- import { EntityDefaultEventName, EntityType, buildEntityChannelName, buildEntityNamespaceName } from "@authup/core-kit";
9
+ import { EntityType } from "@authup/core-kit";
10
10
  import { buildRedisKeyPath } from "@authup/server-kit";
11
11
  //#region src/adapters/database/domains/user-role/subscriber.ts
12
12
  function _ts_decorate(decorators, target, key, desc) {
@@ -15,55 +15,30 @@ function _ts_decorate(decorators, target, key, desc) {
15
15
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
16
16
  return c > 3 && r && Object.defineProperty(target, key, r), r;
17
17
  }
18
- async function publishEvent(event, data) {
19
- const destinations = [{ channel: (id) => buildEntityChannelName(EntityType.USER_ROLE, id) }];
20
- if (data.user_realm_id) destinations.push({
21
- channel: (id) => buildEntityChannelName(EntityType.USER_ROLE, id),
22
- namespace: buildEntityNamespaceName(data.user_realm_id)
23
- });
24
- if (data.role_realm_id) destinations.push({
25
- channel: (id) => buildEntityChannelName(EntityType.USER_ROLE, id),
26
- namespace: buildEntityNamespaceName(data.role_realm_id)
27
- });
28
- await publishDomainEvent({
29
- content: {
30
- type: EntityType.USER_ROLE,
31
- event,
32
- data
33
- },
34
- destinations
35
- });
18
+ function _ts_metadata(k, v) {
19
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
36
20
  }
37
- var UserRoleSubscriber = class {
38
- listenTo() {
39
- return UserRoleEntity;
40
- }
41
- async afterInsert(event) {
42
- if (!event.entity) return;
43
- if (event.connection.queryResultCache) await event.connection.queryResultCache.remove([buildRedisKeyPath({
44
- prefix: CachePrefix.USER_OWNED_ROLES,
45
- key: event.entity.user_id
46
- })]);
47
- await publishEvent(EntityDefaultEventName.CREATED, event.entity);
48
- }
49
- async afterUpdate(event) {
50
- if (!event.entity) return;
51
- if (event.connection.queryResultCache) await event.connection.queryResultCache.remove([buildRedisKeyPath({
52
- prefix: CachePrefix.USER_OWNED_ROLES,
53
- key: event.entity.user_id
54
- })]);
55
- await publishEvent(EntityDefaultEventName.UPDATED, event.entity);
56
- }
57
- async afterRemove(event) {
58
- if (!event.entity) return;
59
- if (event.connection.queryResultCache) await event.connection.queryResultCache.remove([buildRedisKeyPath({
60
- prefix: CachePrefix.USER_OWNED_ROLES,
61
- key: event.entity.user_id
62
- })]);
63
- await publishEvent(EntityDefaultEventName.DELETED, event.entity);
21
+ var UserRoleSubscriber = class extends EntitySubscriber {
22
+ constructor() {
23
+ super({
24
+ type: EntityType.USER_ROLE,
25
+ target: UserRoleEntity,
26
+ destinations: buildEntityDestinations(EntityType.USER_ROLE, (data) => [data.user_realm_id, data.role_realm_id]),
27
+ cache: {
28
+ onInsert: true,
29
+ keys: (data) => [buildRedisKeyPath({
30
+ prefix: CachePrefix.USER_OWNED_ROLES,
31
+ key: data.user_id
32
+ })]
33
+ }
34
+ });
64
35
  }
65
36
  };
66
- UserRoleSubscriber = _ts_decorate([EventSubscriber()], UserRoleSubscriber);
37
+ UserRoleSubscriber = _ts_decorate([
38
+ EventSubscriber(),
39
+ _ts_metadata("design:type", Function),
40
+ _ts_metadata("design:paramtypes", [])
41
+ ], UserRoleSubscriber);
67
42
  //#endregion
68
43
  export { UserRoleSubscriber };
69
44
 
@@ -1 +1 @@
1
- {"version":3,"file":"subscriber.mjs","names":["EntityDefaultEventName","EntityType","buildEntityChannelName","buildEntityNamespaceName","buildRedisKeyPath","EventSubscriber","publishDomainEvent","UserRoleEntity","CachePrefix","publishEvent","event","data","destinations","channel","id","USER_ROLE","user_realm_id","push","namespace","role_realm_id","content","type","UserRoleSubscriber","listenTo","afterInsert","entity","connection","queryResultCache","remove","prefix","USER_OWNED_ROLES","key","user_id","CREATED","afterUpdate","UPDATED","afterRemove","DELETED"],"sources":["../../../../../src/adapters/database/domains/user-role/subscriber.ts"],"sourcesContent":["/*\n * Copyright (c) 2022-2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { UserRole } from '@authup/core-kit';\nimport {\n EntityDefaultEventName, \n EntityType,\n buildEntityChannelName,\n buildEntityNamespaceName,\n} from '@authup/core-kit';\nimport type { DomainEventDestination } from '@authup/server-kit';\nimport { buildRedisKeyPath } from '@authup/server-kit';\nimport type {\n EntitySubscriberInterface, \n InsertEvent,\n RemoveEvent,\n UpdateEvent,\n} from 'typeorm';\nimport { EventSubscriber } from 'typeorm';\nimport { publishDomainEvent } from '../../event-publisher/index.ts';\nimport { UserRoleEntity } from './entity.ts';\nimport { CachePrefix } from '../constants.ts';\n\nasync function publishEvent(\n event: `${EntityDefaultEventName}`,\n data: UserRole,\n) {\n const destinations : DomainEventDestination[] = [\n { channel: (id) => buildEntityChannelName(EntityType.USER_ROLE, id) },\n ];\n if (data.user_realm_id) {\n destinations.push({\n channel: (id) => buildEntityChannelName(EntityType.USER_ROLE, id),\n namespace: buildEntityNamespaceName(data.user_realm_id),\n });\n }\n if (data.role_realm_id) {\n destinations.push({\n channel: (id) => buildEntityChannelName(EntityType.USER_ROLE, id),\n namespace: buildEntityNamespaceName(data.role_realm_id),\n });\n }\n\n await publishDomainEvent({\n content: {\n type: EntityType.USER_ROLE,\n event,\n data,\n },\n destinations,\n });\n}\n\n@EventSubscriber()\nexport class UserRoleSubscriber implements EntitySubscriberInterface<UserRole> {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n listenTo(): Function | string {\n return UserRoleEntity;\n }\n\n async afterInsert(event: InsertEvent<UserRole>): Promise<any> {\n if (!event.entity) {\n return;\n }\n\n if (event.connection.queryResultCache) {\n await event.connection.queryResultCache.remove([\n buildRedisKeyPath({\n prefix: CachePrefix.USER_OWNED_ROLES,\n key: event.entity.user_id,\n }),\n ]);\n }\n\n await publishEvent(EntityDefaultEventName.CREATED, event.entity);\n }\n\n async afterUpdate(event: UpdateEvent<UserRole>): Promise<any> {\n if (!event.entity) {\n return;\n }\n\n if (event.connection.queryResultCache) {\n await event.connection.queryResultCache.remove([\n buildRedisKeyPath({\n prefix: CachePrefix.USER_OWNED_ROLES,\n key: event.entity.user_id,\n }),\n ]);\n }\n\n await publishEvent(EntityDefaultEventName.UPDATED, event.entity as UserRole);\n }\n\n async afterRemove(event: RemoveEvent<UserRole>): Promise<any> {\n if (!event.entity) {\n return;\n }\n\n if (event.connection.queryResultCache) {\n await event.connection.queryResultCache.remove([\n buildRedisKeyPath({\n prefix: CachePrefix.USER_OWNED_ROLES,\n key: event.entity.user_id,\n }),\n ]);\n }\n\n await publishEvent(EntityDefaultEventName.DELETED, event.entity);\n }\n}\n"],"mappings":";;;;;;;;;;;AAKC,SAAA,aAAA,YAAA,QAAA,KAAA,MAAA;;;;;;AAsBD,eAAeS,aACXC,OACAC,MAAc;CAEd,MAAMC,eAA0C,CAC5C,EAAEC,UAAUC,OAAOZ,uBAAuBD,WAAWc,WAAWD,EAAAA,EAAI,CAAA;CAExE,IAAIH,KAAKK,eACLJ,aAAaK,KAAK;EACdJ,UAAUC,OAAOZ,uBAAuBD,WAAWc,WAAWD,EAAAA;EAC9DI,WAAWf,yBAAyBQ,KAAKK,aAAa;CAC1D,CAAA;CAEJ,IAAIL,KAAKQ,eACLP,aAAaK,KAAK;EACdJ,UAAUC,OAAOZ,uBAAuBD,WAAWc,WAAWD,EAAAA;EAC9DI,WAAWf,yBAAyBQ,KAAKQ,aAAa;CAC1D,CAAA;CAGJ,MAAMb,mBAAmB;EACrBc,SAAS;GACLC,MAAMpB,WAAWc;GACjBL;GACAC;EACJ;EACAC;CACJ,CAAA;AACJ;AAGA,IAAaU,qBAAb,MAAaA;CAETC,WAA8B;EAC1B,OAAOhB;CACX;CAEA,MAAMiB,YAAYd,OAA4C;EAC1D,IAAI,CAACA,MAAMe,QACP;EAGJ,IAAIf,MAAMgB,WAAWC,kBACjB,MAAMjB,MAAMgB,WAAWC,iBAAiBC,OAAO,CAC3CxB,kBAAkB;GACdyB,QAAQrB,YAAYsB;GACpBC,KAAKrB,MAAMe,OAAOO;EACtB,CAAA,CAAA,CACH;EAGL,MAAMvB,aAAaT,uBAAuBiC,SAASvB,MAAMe,MAAM;CACnE;CAEA,MAAMS,YAAYxB,OAA4C;EAC1D,IAAI,CAACA,MAAMe,QACP;EAGJ,IAAIf,MAAMgB,WAAWC,kBACjB,MAAMjB,MAAMgB,WAAWC,iBAAiBC,OAAO,CAC3CxB,kBAAkB;GACdyB,QAAQrB,YAAYsB;GACpBC,KAAKrB,MAAMe,OAAOO;EACtB,CAAA,CAAA,CACH;EAGL,MAAMvB,aAAaT,uBAAuBmC,SAASzB,MAAMe,MAAM;CACnE;CAEA,MAAMW,YAAY1B,OAA4C;EAC1D,IAAI,CAACA,MAAMe,QACP;EAGJ,IAAIf,MAAMgB,WAAWC,kBACjB,MAAMjB,MAAMgB,WAAWC,iBAAiBC,OAAO,CAC3CxB,kBAAkB;GACdyB,QAAQrB,YAAYsB;GACpBC,KAAKrB,MAAMe,OAAOO;EACtB,CAAA,CAAA,CACH;EAGL,MAAMvB,aAAaT,uBAAuBqC,SAAS3B,MAAMe,MAAM;CACnE;AACJ"}
1
+ {"version":3,"file":"subscriber.mjs","names":["EntityType","buildRedisKeyPath","EventSubscriber","EntitySubscriber","buildEntityDestinations","UserRoleEntity","CachePrefix","UserRoleSubscriber","type","USER_ROLE","target","destinations","data","user_realm_id","role_realm_id","cache","onInsert","keys","prefix","USER_OWNED_ROLES","key","user_id"],"sources":["../../../../../src/adapters/database/domains/user-role/subscriber.ts"],"sourcesContent":["/*\n * Copyright (c) 2022-2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { UserRole } from '@authup/core-kit';\nimport { EntityType } from '@authup/core-kit';\nimport { buildRedisKeyPath } from '@authup/server-kit';\nimport { EventSubscriber } from 'typeorm';\nimport { EntitySubscriber, buildEntityDestinations } from '../../subscriber/index.ts';\nimport { UserRoleEntity } from './entity.ts';\nimport { CachePrefix } from '../constants.ts';\n\n@EventSubscriber()\nexport class UserRoleSubscriber extends EntitySubscriber<UserRole> {\n constructor() {\n super({\n type: EntityType.USER_ROLE,\n target: UserRoleEntity,\n destinations: buildEntityDestinations(EntityType.USER_ROLE, (data) => [\n data.user_realm_id,\n data.role_realm_id,\n ]),\n cache: {\n onInsert: true,\n keys: (data) => [\n buildRedisKeyPath({\n prefix: CachePrefix.USER_OWNED_ROLES,\n key: data.user_id,\n }),\n ],\n },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;AAKC,SAAA,aAAA,YAAA,QAAA,KAAA,MAAA;;;;;;;;;AAWD,IAAaO,qBAAb,cAAwCJ,iBAAAA;CACpC,cAAc;EACV,MAAM;GACFK,MAAMR,WAAWS;GACjBC,QAAQL;GACRM,cAAcP,wBAAwBJ,WAAWS,YAAYG,SAAS,CAClEA,KAAKC,eACLD,KAAKE,aAAAA,CACR;GACDC,OAAO;IACHC,UAAU;IACVC,OAAOL,SAAS,CACZX,kBAAkB;KACdiB,QAAQZ,YAAYa;KACpBC,KAAKR,KAAKS;IACd,CAAA,CAAA;GAER;EACJ,CAAA;CACJ;AACJ"}
@@ -3,4 +3,5 @@ export * from './data-source/index.ts';
3
3
  export * from './domains/index.ts';
4
4
  export * from './errors/index.ts';
5
5
  export * from './helpers/index.ts';
6
+ export * from './subscriber/index.ts';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/database/index.ts"],"names":[],"mappings":"AAOA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/database/index.ts"],"names":[],"mappings":"AAOA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC"}
@@ -3,6 +3,8 @@ import "node:url";
3
3
  import.meta.url;
4
4
  import { RealmEntity } from "./domains/realm/entity.mjs";
5
5
  import { RealmRepository } from "./domains/realm/repository.mjs";
6
+ import { EntitySubscriber, buildEntityDestinations } from "./subscriber/module.mjs";
7
+ import "./subscriber/index.mjs";
6
8
  import { CachePrefix } from "./domains/constants.mjs";
7
9
  import { RealmSubscriber } from "./domains/realm/subscriber.mjs";
8
10
  import { KeyEntity } from "./domains/key/entity.mjs";
@@ -62,10 +64,9 @@ import "./domains/index.mjs";
62
64
  import { DatabaseQueryResultCache } from "./cache/module.mjs";
63
65
  import "./cache/index.mjs";
64
66
  import { DataSourceOptionsBuilder } from "./data-source/options/module.mjs";
65
- import { setDataSourceSync, unsetDataSourceSync, useDataSourceSync } from "./data-source/singleton.mjs";
66
67
  import "./data-source/index.mjs";
67
68
  import { DatabaseConflictError } from "./errors/conflict.mjs";
68
69
  import "./errors/index.mjs";
69
70
  import { isDatabaseTypeSupported, isDatabaseTypeSupportedForEnvironment } from "./helpers/is-supported.mjs";
70
71
  import "./helpers/index.mjs";
71
- export { CachePrefix, ClientEntity, ClientPermissionEntity, ClientPermissionSubscriber, ClientRoleEntity, ClientRoleSubscriber, ClientScopeEntity, ClientScopeSubscriber, ClientSubscriber, DataSourceOptionsBuilder, DatabaseConflictError, DatabaseQueryResultCache, IdentityProviderAccountEntity, IdentityProviderAccountSubscriber, IdentityProviderAttributeEntity, IdentityProviderAttributeMappingEntity, IdentityProviderAttributeSubscriber, IdentityProviderEntity, IdentityProviderPermissionMappingEntity, IdentityProviderRepository, IdentityProviderRoleMappingEntity, IdentityProviderRoleSubscriber, IdentityProviderSubscriber, KeyEntity, PermissionEntity, PermissionPolicyEntity, PermissionSubscriber, PolicyAttributeEntity, PolicyAttributeSubscriber, PolicyEntity, PolicyRepository, PolicySubscriber, RealmEntity, RealmRepository, RealmSubscriber, RobotEntity, RobotPermissionEntity, RobotPermissionSubscriber, RobotRoleEntity, RobotRoleSubscriber, RobotSubscriber, RoleAttributeEntity, RoleAttributeSubscriber, RoleEntity, RolePermissionEntity, RolePermissionSubscriber, RoleRepository, RoleSubscriber, ScopeEntity, ScopeSubscriber, SessionEntity, UserAttributeEntity, UserAttributeSubscriber, UserEntity, UserPermissionEntity, UserPermissionSubscriber, UserRepository, UserRoleEntity, UserRoleSubscriber, UserSubscriber, isDatabaseTypeSupported, isDatabaseTypeSupportedForEnvironment, setDataSourceSync, unsetDataSourceSync, useDataSourceSync };
72
+ export { CachePrefix, ClientEntity, ClientPermissionEntity, ClientPermissionSubscriber, ClientRoleEntity, ClientRoleSubscriber, ClientScopeEntity, ClientScopeSubscriber, ClientSubscriber, DataSourceOptionsBuilder, DatabaseConflictError, DatabaseQueryResultCache, EntitySubscriber, IdentityProviderAccountEntity, IdentityProviderAccountSubscriber, IdentityProviderAttributeEntity, IdentityProviderAttributeMappingEntity, IdentityProviderAttributeSubscriber, IdentityProviderEntity, IdentityProviderPermissionMappingEntity, IdentityProviderRepository, IdentityProviderRoleMappingEntity, IdentityProviderRoleSubscriber, IdentityProviderSubscriber, KeyEntity, PermissionEntity, PermissionPolicyEntity, PermissionSubscriber, PolicyAttributeEntity, PolicyAttributeSubscriber, PolicyEntity, PolicyRepository, PolicySubscriber, RealmEntity, RealmRepository, RealmSubscriber, RobotEntity, RobotPermissionEntity, RobotPermissionSubscriber, RobotRoleEntity, RobotRoleSubscriber, RobotSubscriber, RoleAttributeEntity, RoleAttributeSubscriber, RoleEntity, RolePermissionEntity, RolePermissionSubscriber, RoleRepository, RoleSubscriber, ScopeEntity, ScopeSubscriber, SessionEntity, UserAttributeEntity, UserAttributeSubscriber, UserEntity, UserPermissionEntity, UserPermissionSubscriber, UserRepository, UserRoleEntity, UserRoleSubscriber, UserSubscriber, buildEntityDestinations, isDatabaseTypeSupported, isDatabaseTypeSupportedForEnvironment };
@@ -0,0 +1,3 @@
1
+ export * from './module.ts';
2
+ export * from './types.ts';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapters/database/subscriber/index.ts"],"names":[],"mappings":"AAOA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,5 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { EntitySubscriber, buildEntityDestinations } from "./module.mjs";
5
+ export { EntitySubscriber, buildEntityDestinations };
@@ -0,0 +1,19 @@
1
+ import type { EntityType } from '@authup/core-kit';
2
+ import { EntityDefaultEventName } from '@authup/core-kit';
3
+ import type { DomainEventDestinations, IDomainEventPublisher } from '@authup/server-kit';
4
+ import type { DataSource, EntitySubscriberInterface, InsertEvent, ObjectLiteral, RemoveEvent, UpdateEvent } from 'typeorm';
5
+ import type { EntitySubscriberContext } from './types.ts';
6
+ export declare function buildEntityDestinations<T extends ObjectLiteral>(type: `${EntityType}`, realmIds?: (data: T) => (string | null | undefined)[]): (data: T) => DomainEventDestinations;
7
+ export declare class EntitySubscriber<T extends ObjectLiteral> implements EntitySubscriberInterface<T> {
8
+ protected ctx: EntitySubscriberContext<T>;
9
+ protected publisher?: IDomainEventPublisher;
10
+ constructor(ctx: EntitySubscriberContext<T>);
11
+ setPublisher(publisher: IDomainEventPublisher): void;
12
+ listenTo(): Function | string;
13
+ afterInsert(event: InsertEvent<T>): Promise<any>;
14
+ afterUpdate(event: UpdateEvent<T>): Promise<any>;
15
+ afterRemove(event: RemoveEvent<T>): Promise<any>;
16
+ protected dropCacheKeys(connection: DataSource, data: T): Promise<void>;
17
+ protected publish(event: `${EntityDefaultEventName}`, data: T): Promise<void>;
18
+ }
19
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../src/adapters/database/subscriber/module.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EACH,sBAAsB,EAGzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,KAAK,EACR,UAAU,EACV,yBAAyB,EACzB,WAAW,EACX,aAAa,EACb,WAAW,EACX,WAAW,EACd,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1D,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,aAAa,EAC3D,IAAI,EAAE,GAAG,UAAU,EAAE,EACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,GACrD,CAAC,IAAI,EAAE,CAAC,KAAK,uBAAuB,CAsBvC;AAED,qBAAa,gBAAgB,CAAC,CAAC,SAAS,aAAa,CAAE,YAAW,yBAAyB,CAAC,CAAC,CAAC;IAC1F,SAAS,CAAC,GAAG,EAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC;IAE3C,SAAS,CAAC,SAAS,CAAC,EAAG,qBAAqB,CAAC;gBAEjC,GAAG,EAAE,uBAAuB,CAAC,CAAC,CAAC;IAK3C,YAAY,CAAC,SAAS,EAAE,qBAAqB,GAAI,IAAI;IAKrD,QAAQ,IAAK,QAAQ,GAAG,MAAM;IAIxB,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAYhD,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAUhD,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;cAUtC,aAAa,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,GAAI,OAAO,CAAC,IAAI,CAAC;cAQ9D,OAAO,CAAC,KAAK,EAAE,GAAG,sBAAsB,EAAE,EAAE,IAAI,EAAE,CAAC,GAAI,OAAO,CAAC,IAAI,CAAC;CAcvF"}
@@ -0,0 +1,70 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { EntityDefaultEventName, buildEntityChannelName, buildEntityNamespaceName } from "@authup/core-kit";
5
+ //#region src/adapters/database/subscriber/module.ts
6
+ function buildEntityDestinations(type, realmIds) {
7
+ return (data) => {
8
+ const destinations = [{ channel: (id) => buildEntityChannelName(type, id) }];
9
+ if (realmIds) {
10
+ const items = realmIds(data);
11
+ const seen = /* @__PURE__ */ new Set();
12
+ for (const realmId of items) if (realmId && !seen.has(realmId)) {
13
+ seen.add(realmId);
14
+ destinations.push({
15
+ channel: (id) => buildEntityChannelName(type, id),
16
+ namespace: buildEntityNamespaceName(realmId)
17
+ });
18
+ }
19
+ }
20
+ return destinations;
21
+ };
22
+ }
23
+ var EntitySubscriber = class {
24
+ ctx;
25
+ publisher;
26
+ constructor(ctx) {
27
+ this.ctx = ctx;
28
+ this.publisher = ctx.publisher;
29
+ }
30
+ setPublisher(publisher) {
31
+ this.publisher = publisher;
32
+ }
33
+ listenTo() {
34
+ return this.ctx.target;
35
+ }
36
+ async afterInsert(event) {
37
+ if (!event.entity) return;
38
+ if (this.ctx.cache && this.ctx.cache.onInsert) await this.dropCacheKeys(event.connection, event.entity);
39
+ await this.publish(EntityDefaultEventName.CREATED, event.entity);
40
+ }
41
+ async afterUpdate(event) {
42
+ if (!event.entity) return;
43
+ await this.dropCacheKeys(event.connection, event.entity);
44
+ await this.publish(EntityDefaultEventName.UPDATED, event.entity);
45
+ }
46
+ async afterRemove(event) {
47
+ if (!event.entity) return;
48
+ await this.dropCacheKeys(event.connection, event.entity);
49
+ await this.publish(EntityDefaultEventName.DELETED, event.entity);
50
+ }
51
+ async dropCacheKeys(connection, data) {
52
+ if (!this.ctx.cache || !connection.queryResultCache) return;
53
+ await connection.queryResultCache.remove(this.ctx.cache.keys(data));
54
+ }
55
+ async publish(event, data) {
56
+ if (!this.publisher) return;
57
+ await this.publisher.safePublish({
58
+ content: {
59
+ type: this.ctx.type,
60
+ event,
61
+ data
62
+ },
63
+ destinations: this.ctx.destinations(data)
64
+ });
65
+ }
66
+ };
67
+ //#endregion
68
+ export { EntitySubscriber, buildEntityDestinations };
69
+
70
+ //# sourceMappingURL=module.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.mjs","names":["EntityDefaultEventName","buildEntityChannelName","buildEntityNamespaceName","buildEntityDestinations","type","realmIds","data","destinations","channel","id","items","seen","Set","realmId","has","add","push","namespace","EntitySubscriber","ctx","publisher","setPublisher","listenTo","target","afterInsert","event","entity","cache","onInsert","dropCacheKeys","connection","publish","CREATED","afterUpdate","UPDATED","afterRemove","DELETED","queryResultCache","remove","keys","safePublish","content"],"sources":["../../../../src/adapters/database/subscriber/module.ts"],"sourcesContent":["/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { EntityType } from '@authup/core-kit';\nimport {\n EntityDefaultEventName,\n buildEntityChannelName,\n buildEntityNamespaceName,\n} from '@authup/core-kit';\nimport type { DomainEventDestinations, IDomainEventPublisher } from '@authup/server-kit';\nimport type {\n DataSource,\n EntitySubscriberInterface,\n InsertEvent,\n ObjectLiteral,\n RemoveEvent,\n UpdateEvent,\n} from 'typeorm';\nimport type { EntitySubscriberContext } from './types.ts';\n\nexport function buildEntityDestinations<T extends ObjectLiteral>(\n type: `${EntityType}`,\n realmIds?: (data: T) => (string | null | undefined)[],\n) : (data: T) => DomainEventDestinations {\n return (data) => {\n const destinations : DomainEventDestinations = [\n { channel: (id) => buildEntityChannelName(type, id) },\n ];\n\n if (realmIds) {\n const items = realmIds(data);\n const seen = new Set<string>();\n for (const realmId of items) {\n if (realmId && !seen.has(realmId)) {\n seen.add(realmId);\n destinations.push({\n channel: (id) => buildEntityChannelName(type, id),\n namespace: buildEntityNamespaceName(realmId),\n });\n }\n }\n }\n\n return destinations;\n };\n}\n\nexport class EntitySubscriber<T extends ObjectLiteral> implements EntitySubscriberInterface<T> {\n protected ctx : EntitySubscriberContext<T>;\n\n protected publisher? : IDomainEventPublisher;\n\n constructor(ctx: EntitySubscriberContext<T>) {\n this.ctx = ctx;\n this.publisher = ctx.publisher;\n }\n\n setPublisher(publisher: IDomainEventPublisher) : void {\n this.publisher = publisher;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n listenTo() : Function | string {\n return this.ctx.target;\n }\n\n async afterInsert(event: InsertEvent<T>): Promise<any> {\n if (!event.entity) {\n return;\n }\n\n if (this.ctx.cache && this.ctx.cache.onInsert) {\n await this.dropCacheKeys(event.connection, event.entity);\n }\n\n await this.publish(EntityDefaultEventName.CREATED, event.entity);\n }\n\n async afterUpdate(event: UpdateEvent<T>): Promise<any> {\n if (!event.entity) {\n return;\n }\n\n await this.dropCacheKeys(event.connection, event.entity as T);\n\n await this.publish(EntityDefaultEventName.UPDATED, event.entity as T);\n }\n\n async afterRemove(event: RemoveEvent<T>): Promise<any> {\n if (!event.entity) {\n return;\n }\n\n await this.dropCacheKeys(event.connection, event.entity);\n\n await this.publish(EntityDefaultEventName.DELETED, event.entity);\n }\n\n protected async dropCacheKeys(connection: DataSource, data: T) : Promise<void> {\n if (!this.ctx.cache || !connection.queryResultCache) {\n return;\n }\n\n await connection.queryResultCache.remove(this.ctx.cache.keys(data));\n }\n\n protected async publish(event: `${EntityDefaultEventName}`, data: T) : Promise<void> {\n if (!this.publisher) {\n return;\n }\n\n await this.publisher.safePublish({\n content: {\n type: this.ctx.type,\n event,\n data,\n },\n destinations: this.ctx.destinations(data),\n });\n }\n}\n"],"mappings":";;;;;AAwBA,SAAgBG,wBACZC,MACAC,UAAqD;CAErD,QAAQC,SAAAA;EACJ,MAAMC,eAAyC,CAC3C,EAAEC,UAAUC,OAAOR,uBAAuBG,MAAMK,EAAAA,EAAI,CAAA;EAGxD,IAAIJ,UAAU;GACV,MAAMK,QAAQL,SAASC,IAAAA;GACvB,MAAMK,uBAAO,IAAIC,IAAAA;GACjB,KAAK,MAAMC,WAAWH,OAClB,IAAIG,WAAW,CAACF,KAAKG,IAAID,OAAAA,GAAU;IAC/BF,KAAKI,IAAIF,OAAAA;IACTN,aAAaS,KAAK;KACdR,UAAUC,OAAOR,uBAAuBG,MAAMK,EAAAA;KAC9CQ,WAAWf,yBAAyBW,OAAAA;IACxC,CAAA;GACJ;EAER;EAEA,OAAON;CACX;AACJ;AAEA,IAAaW,mBAAb,MAAaA;CACCC;CAEAC;CAEV,YAAYD,KAAiC;EACzC,KAAKA,MAAMA;EACX,KAAKC,YAAYD,IAAIC;CACzB;CAEAC,aAAaD,WAAyC;EAClD,KAAKA,YAAYA;CACrB;CAGAE,WAA+B;EAC3B,OAAO,KAAKH,IAAII;CACpB;CAEA,MAAMC,YAAYC,OAAqC;EACnD,IAAI,CAACA,MAAMC,QACP;EAGJ,IAAI,KAAKP,IAAIQ,SAAS,KAAKR,IAAIQ,MAAMC,UACjC,MAAM,KAAKC,cAAcJ,MAAMK,YAAYL,MAAMC,MAAM;EAG3D,MAAM,KAAKK,QAAQ/B,uBAAuBgC,SAASP,MAAMC,MAAM;CACnE;CAEA,MAAMO,YAAYR,OAAqC;EACnD,IAAI,CAACA,MAAMC,QACP;EAGJ,MAAM,KAAKG,cAAcJ,MAAMK,YAAYL,MAAMC,MAAM;EAEvD,MAAM,KAAKK,QAAQ/B,uBAAuBkC,SAAST,MAAMC,MAAM;CACnE;CAEA,MAAMS,YAAYV,OAAqC;EACnD,IAAI,CAACA,MAAMC,QACP;EAGJ,MAAM,KAAKG,cAAcJ,MAAMK,YAAYL,MAAMC,MAAM;EAEvD,MAAM,KAAKK,QAAQ/B,uBAAuBoC,SAASX,MAAMC,MAAM;CACnE;CAEA,MAAgBG,cAAcC,YAAwBxB,MAAyB;EAC3E,IAAI,CAAC,KAAKa,IAAIQ,SAAS,CAACG,WAAWO,kBAC/B;EAGJ,MAAMP,WAAWO,iBAAiBC,OAAO,KAAKnB,IAAIQ,MAAMY,KAAKjC,IAAAA,CAAAA;CACjE;CAEA,MAAgByB,QAAQN,OAAoCnB,MAAyB;EACjF,IAAI,CAAC,KAAKc,WACN;EAGJ,MAAM,KAAKA,UAAUoB,YAAY;GAC7BC,SAAS;IACLrC,MAAM,KAAKe,IAAIf;IACfqB;IACAnB;GACJ;GACAC,cAAc,KAAKY,IAAIZ,aAAaD,IAAAA;EACxC,CAAA;CACJ;AACJ"}
@@ -0,0 +1,15 @@
1
+ import type { EntityType } from '@authup/core-kit';
2
+ import type { DomainEventDestinations, IDomainEventPublisher } from '@authup/server-kit';
3
+ import type { ObjectLiteral } from 'typeorm';
4
+ export type EntitySubscriberCacheContext<T extends ObjectLiteral> = {
5
+ keys: (data: T) => string[];
6
+ onInsert?: boolean;
7
+ };
8
+ export type EntitySubscriberContext<T extends ObjectLiteral> = {
9
+ type: `${EntityType}`;
10
+ target: Function;
11
+ destinations: (data: T) => DomainEventDestinations;
12
+ cache?: EntitySubscriberCacheContext<T>;
13
+ publisher?: IDomainEventPublisher;
14
+ };
15
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/adapters/database/subscriber/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,MAAM,4BAA4B,CAAC,CAAC,SAAS,aAAa,IAAI;IAChE,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,aAAa,IAAI;IAC3D,IAAI,EAAE,GAAG,UAAU,EAAE,CAAC;IAEtB,MAAM,EAAE,QAAQ,CAAC;IACjB,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,uBAAuB,CAAC;IACnD,KAAK,CAAC,EAAE,4BAA4B,CAAC,CAAC,CAAC,CAAC;IACxC,SAAS,CAAC,EAAE,qBAAqB,CAAC;CACrC,CAAC"}
@@ -19,11 +19,11 @@ import { ValidatorGroup, base64URLDecode, isUUID } from "@authup/kit";
19
19
  import { BuiltInPolicyType, PolicyData } from "@authup/access";
20
20
  import { BadRequestError, EntityNotFoundError } from "@authup/errors";
21
21
  import { OAuth2RequestError } from "@authup/specs";
22
+ import { URL } from "node:url";
22
23
  import { getRequestHeader, getRequestIP, sendRedirect } from "routup";
23
24
  import { DBody, DContext, DController, DDelete, DGet, DPath, DPost, DPut, DTags } from "@routup/decorators";
24
25
  import { readRequestBody } from "@routup/basic/body";
25
26
  import { useRequestQuery } from "@routup/basic/query";
26
- import { URL } from "node:url";
27
27
  //#region src/adapters/http/controllers/entities/identity-provider/module.ts
28
28
  function _ts_decorate(decorators, target, key, desc) {
29
29
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -1,12 +1,19 @@
1
1
  import type { IAppEvent } from 'routup';
2
- import type { ActivatePayload } from '@authup/core-http-kit';
2
+ import type { ActivatePayload, StatusResponseFeatures } from '@authup/core-http-kit';
3
3
  import type { IRegistrationService } from '../../../../../core/index.ts';
4
+ export type ActivateControllerOptions = {
5
+ baseURL: string;
6
+ features: StatusResponseFeatures;
7
+ };
4
8
  export type ActivateControllerContext = {
9
+ options: ActivateControllerOptions;
5
10
  service: IRegistrationService;
6
11
  };
7
12
  export declare class ActivateController {
13
+ protected options: ActivateControllerOptions;
8
14
  protected service: IRegistrationService;
9
15
  constructor(ctx: ActivateControllerContext);
16
+ serve(event: IAppEvent): Promise<string>;
10
17
  execute(data: ActivatePayload, event: IAppEvent): Promise<null>;
11
18
  }
12
19
  //# sourceMappingURL=module.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/http/controllers/workflows/activate/module.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAGzE,MAAM,MAAM,yBAAyB,GAAG;IACpC,OAAO,EAAE,oBAAoB,CAAC;CACjC,CAAC;AAEF,qBACa,kBAAkB;IAC3B,SAAS,CAAC,OAAO,EAAE,oBAAoB,CAAC;gBAE5B,GAAG,EAAE,yBAAyB;IAKpC,OAAO,CACA,IAAI,EAAE,eAAe,EAClB,KAAK,EAAE,SAAS,GAC7B,OAAO,CAAC,IAAI,CAAC;CASnB"}
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/http/controllers/workflows/activate/module.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAIzE,MAAM,MAAM,yBAAyB,GAAG;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,sBAAsB,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACpC,OAAO,EAAE,yBAAyB,CAAC;IACnC,OAAO,EAAE,oBAAoB,CAAC;CACjC,CAAC;AAEF,qBACa,kBAAkB;IAC3B,SAAS,CAAC,OAAO,EAAE,yBAAyB,CAAC;IAE7C,SAAS,CAAC,OAAO,EAAE,oBAAoB,CAAC;gBAE5B,GAAG,EAAE,yBAAyB;IAMpC,KAAK,CAAa,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;IAUpD,OAAO,CACA,IAAI,EAAE,eAAe,EAClB,KAAK,EAAE,SAAS,GAC7B,OAAO,CAAC,IAAI,CAAC;CASnB"}
@@ -1,8 +1,10 @@
1
1
  import "node:path";
2
2
  import "node:url";
3
3
  import.meta.url;
4
+ import { serveWorkflowPage } from "../../../ui/serve.mjs";
5
+ import "../../../ui/index.mjs";
4
6
  import { ActivateRequestValidator } from "./validator.mjs";
5
- import { DBody, DContext, DController, DPost } from "@routup/decorators";
7
+ import { DBody, DContext, DController, DGet, DPost } from "@routup/decorators";
6
8
  //#region src/adapters/http/controllers/workflows/activate/module.ts
7
9
  function _ts_decorate(decorators, target, key, desc) {
8
10
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -19,10 +21,20 @@ function _ts_param(paramIndex, decorator) {
19
21
  };
20
22
  }
21
23
  var ActivateController = class {
24
+ options;
22
25
  service;
23
26
  constructor(ctx) {
27
+ this.options = ctx.options;
24
28
  this.service = ctx.service;
25
29
  }
30
+ async serve(event) {
31
+ return serveWorkflowPage(event, {
32
+ url: "/activate",
33
+ baseURL: this.options.baseURL,
34
+ features: this.options.features,
35
+ tokenAware: true
36
+ });
37
+ }
26
38
  async execute(data, event) {
27
39
  const validated = await new ActivateRequestValidator().run(data);
28
40
  await this.service.activate(validated);
@@ -30,6 +42,13 @@ var ActivateController = class {
30
42
  return null;
31
43
  }
32
44
  };
45
+ _ts_decorate([
46
+ DGet("", []),
47
+ _ts_param(0, DContext()),
48
+ _ts_metadata("design:type", Function),
49
+ _ts_metadata("design:paramtypes", [typeof IAppEvent === "undefined" ? Object : IAppEvent]),
50
+ _ts_metadata("design:returntype", Promise)
51
+ ], ActivateController.prototype, "serve", null);
33
52
  _ts_decorate([
34
53
  DPost("", []),
35
54
  _ts_param(0, DBody()),
@@ -1 +1 @@
1
- {"version":3,"file":"module.mjs","names":["DBody","DContext","DController","DPost","ActivateRequestValidator","ActivateController","service","ctx","execute","data","event","validator","validated","run","activate","response","status"],"sources":["../../../../../../src/adapters/http/controllers/workflows/activate/module.ts"],"sourcesContent":["/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport {\n DBody,\n DContext,\n DController,\n DPost,\n} from '@routup/decorators';\nimport type { IAppEvent } from 'routup';\nimport type { ActivatePayload } from '@authup/core-http-kit';\nimport type { IRegistrationService } from '../../../../../core/index.ts';\nimport { ActivateRequestValidator } from './validator.ts';\n\nexport type ActivateControllerContext = {\n service: IRegistrationService,\n};\n\n@DController('/activate')\nexport class ActivateController {\n protected service: IRegistrationService;\n\n constructor(ctx: ActivateControllerContext) {\n this.service = ctx.service;\n }\n\n @DPost('', [])\n async execute(\n @DBody() data: ActivatePayload,\n @DContext() event: IAppEvent,\n ): Promise<null> {\n const validator = new ActivateRequestValidator();\n const validated = await validator.run(data);\n\n await this.service.activate(validated);\n\n event.response.status = 202;\n return null;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuBA,IAAaK,qBAAb,MAAaA;CACCC;CAEV,YAAYC,KAAgC;EACxC,KAAKD,UAAUC,IAAID;CACvB;CAEA,MACME,QACF,MACA,OACa;EAEb,MAAMI,YAAY,MAAMD,IADFP,yBACEO,CAAAA,CAAUE,IAAIJ,IAAAA;EAEtC,MAAM,KAAKH,QAAQQ,SAASF,SAAAA;EAE5BF,MAAMK,SAASC,SAAS;EACxB,OAAO;CACX;AACJ"}
1
+ {"version":3,"file":"module.mjs","names":["DBody","DContext","DController","DGet","DPost","serveWorkflowPage","ActivateRequestValidator","ActivateController","options","service","ctx","serve","event","url","baseURL","features","tokenAware","execute","data","validator","validated","run","activate","response","status"],"sources":["../../../../../../src/adapters/http/controllers/workflows/activate/module.ts"],"sourcesContent":["/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport {\n DBody,\n DContext,\n DController,\n DGet,\n DPost,\n} from '@routup/decorators';\nimport type { IAppEvent } from 'routup';\nimport type { ActivatePayload, StatusResponseFeatures } from '@authup/core-http-kit';\nimport type { IRegistrationService } from '../../../../../core/index.ts';\nimport { serveWorkflowPage } from '../../../ui/index.ts';\nimport { ActivateRequestValidator } from './validator.ts';\n\nexport type ActivateControllerOptions = {\n baseURL: string,\n features: StatusResponseFeatures,\n};\n\nexport type ActivateControllerContext = {\n options: ActivateControllerOptions,\n service: IRegistrationService,\n};\n\n@DController('/activate')\nexport class ActivateController {\n protected options: ActivateControllerOptions;\n\n protected service: IRegistrationService;\n\n constructor(ctx: ActivateControllerContext) {\n this.options = ctx.options;\n this.service = ctx.service;\n }\n\n @DGet('', [])\n async serve(@DContext() event: IAppEvent): Promise<string> {\n return serveWorkflowPage(event, {\n url: '/activate',\n baseURL: this.options.baseURL,\n features: this.options.features,\n tokenAware: true,\n });\n }\n\n @DPost('', [])\n async execute(\n @DBody() data: ActivatePayload,\n @DContext() event: IAppEvent,\n ): Promise<null> {\n const validator = new ActivateRequestValidator();\n const validated = await validator.run(data);\n\n await this.service.activate(validated);\n\n event.response.status = 202;\n return null;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAaO,qBAAb,MAAaA;CACCC;CAEAC;CAEV,YAAYC,KAAgC;EACxC,KAAKF,UAAUE,IAAIF;EACnB,KAAKC,UAAUC,IAAID;CACvB;CAEA,MACME,MAAM,OAA+C;EACvD,OAAON,kBAAkBO,OAAO;GAC5BC,KAAK;GACLC,SAAS,KAAKN,QAAQM;GACtBC,UAAU,KAAKP,QAAQO;GACvBC,YAAY;EAChB,CAAA;CACJ;CAEA,MACMC,QACF,MACA,OACa;EAEb,MAAMG,YAAY,MAAMD,IADFb,yBACEa,CAAAA,CAAUE,IAAIH,IAAAA;EAEtC,MAAM,KAAKT,QAAQa,SAASF,SAAAA;EAE5BR,MAAMW,SAASC,SAAS;EACxB,OAAO;CACX;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/http/controllers/workflows/authorize/module.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAMxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EAAE,uCAAuC,EAAE,MAAM,8BAA8B,CAAC;AACvF,OAAO,KAAK,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAGzF,qBACa,mBAAmB;IAI5B,SAAS,CAAC,OAAO,EAAE,0BAA0B,CAAC;IAE9C,SAAS,CAAC,mBAAmB,EAAG,uCAAuC,CAAC;IAExE,SAAS,CAAC,oBAAoB,EAAG,uCAAuC,CAAC;IAEzE,SAAS,CAAC,UAAU,EAAE,oBAAoB,CAAC;gBAI/B,GAAG,EAAE,0BAA0B;IAmBrC,OAAO,CAAa,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAwB/D,KAAK,CAAa,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;CA8E7D"}
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/http/controllers/workflows/authorize/module.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGlE,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EAAE,uCAAuC,EAAE,MAAM,8BAA8B,CAAC;AACvF,OAAO,KAAK,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAGzF,qBACa,mBAAmB;IAI5B,SAAS,CAAC,OAAO,EAAE,0BAA0B,CAAC;IAE9C,SAAS,CAAC,mBAAmB,EAAG,uCAAuC,CAAC;IAExE,SAAS,CAAC,oBAAoB,EAAG,uCAAuC,CAAC;IAEzE,SAAS,CAAC,UAAU,EAAE,oBAAoB,CAAC;gBAI/B,GAAG,EAAE,0BAA0B;IAmBrC,OAAO,CAAa,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAwB/D,KAAK,CAAa,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;CA6C7D"}
@@ -10,15 +10,11 @@ import "../../../adapters/index.mjs";
10
10
  import { sanitizeError } from "../../../../../utils/error.mjs";
11
11
  import "../../../../../utils/index.mjs";
12
12
  import { ForceUserLoggedInMiddleware } from "../../../middleware/built-in/loggedin/user.mjs";
13
- import { UI_DIST_PATH, UI_SOURCE_PATH } from "../../../../../path.mjs";
14
- import { VITE_SERVER_STORE_KEY } from "../../../middleware/built-in/assets.mjs";
15
13
  import "../../../middleware/index.mjs";
16
- import path from "node:path";
17
- import { CodeTransformation, isCodeTransformation } from "typeorm-extension";
18
- import { DContext, DController, DGet, DPost } from "@routup/decorators";
19
- import { load } from "locter";
14
+ import { renderUIPage } from "../../../ui/render.mjs";
15
+ import "../../../ui/index.mjs";
20
16
  import { URL } from "node:url";
21
- import fs from "node:fs";
17
+ import { DContext, DController, DGet, DPost } from "@routup/decorators";
22
18
  //#region src/adapters/http/controllers/workflows/authorize/module.ts
23
19
  function _ts_decorate(decorators, target, key, desc) {
24
20
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -79,38 +75,21 @@ var AuthorizeController = class {
79
75
  message: normalized.message
80
76
  };
81
77
  }
82
- const isJIT = isCodeTransformation(CodeTransformation.JUST_IN_TIME);
83
- const payload = {
84
- config: { baseURL: this.options.baseURL },
85
- data: {
86
- codeRequest,
87
- error,
88
- client,
89
- scopes
90
- }
91
- };
92
- let html;
93
- let manifest;
94
- let render;
95
- if (isJIT) {
96
- const vite = event.store[VITE_SERVER_STORE_KEY];
97
- html = await fs.promises.readFile(path.join(UI_SOURCE_PATH, "index.html"), "utf-8");
98
- html = await vite.transformIndexHtml("/", html);
99
- manifest = {};
100
- render = (await vite.ssrLoadModule("/src/server.ts")).render;
101
- } else {
102
- html = await fs.promises.readFile(path.join(UI_DIST_PATH, "client", "index.html"), "utf-8");
103
- manifest = JSON.parse(await fs.promises.readFile(path.join(UI_DIST_PATH, "client", ".vite", "ssr-manifest.json"), "utf-8"));
104
- render = (await load(path.join(UI_DIST_PATH, "server", "server.js"))).render;
105
- }
106
- const [appHtml, preloadLinks] = await render({
78
+ const requestURL = new URL(event.request.url);
79
+ return renderUIPage(event, {
107
80
  url: "/authorize",
108
- manifest,
109
- payload
81
+ payload: {
82
+ config: { baseURL: this.options.baseURL },
83
+ data: {
84
+ codeRequest,
85
+ error,
86
+ client,
87
+ scopes,
88
+ features: this.options.features,
89
+ requestPath: `${requestURL.pathname}${requestURL.search}`
90
+ }
91
+ }
110
92
  });
111
- const body = html.replace("<!--preload-links-->", preloadLinks).replace("<!--app-html-->", appHtml);
112
- event.response.headers.set("content-type", "text/html; charset=utf-8");
113
- return body;
114
93
  }
115
94
  };
116
95
  _ts_decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"module.mjs","names":["DContext","DController","DGet","DPost","load","fs","path","URL","CodeTransformation","isCodeTransformation","UI_DIST_PATH","UI_SOURCE_PATH","ForceUserLoggedInMiddleware","VITE_SERVER_STORE_KEY","HTTPOAuth2Authorizer","readFromLocations","OAuth2AuthorizationCodeRequestValidator","sanitizeError","AuthorizeController","options","codeRequestVerifier","codeRequestValidator","authorizer","ctx","accessTokenIssuer","openIdTokenIssuer","codeIssuer","identityResolver","confirm","event","result","authorizeWithRequest","url","redirectUri","state","searchParams","set","authorizationCode","accessToken","idToken","href","serve","codeRequest","client","scopes","error","merged","data","run","verify","e","normalized","message","isJIT","JUST_IN_TIME","payload","config","baseURL","html","manifest","render","vite","store","promises","readFile","join","transformIndexHtml","ssrLoadModule","JSON","parse","appHtml","preloadLinks","body","replace","response","headers"],"sources":["../../../../../../src/adapters/http/controllers/workflows/authorize/module.ts"],"sourcesContent":["/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport {\n DContext,\n DController,\n DGet,\n DPost,\n} from '@routup/decorators';\nimport { load } from 'locter';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { URL } from 'node:url';\n\nimport type { IAppEvent } from 'routup';\nimport type { ViteDevServer } from 'vite';\nimport type { Client, OAuth2AuthorizationCodeRequest, Scope } from '@authup/core-kit';\nimport { CodeTransformation, isCodeTransformation } from 'typeorm-extension';\nimport { UI_DIST_PATH, UI_SOURCE_PATH } from '../../../../../path.ts';\nimport { ForceUserLoggedInMiddleware, VITE_SERVER_STORE_KEY } from '../../../middleware/index.ts';\nimport { HTTPOAuth2Authorizer } from '../../../adapters/index.ts';\nimport { readFromLocations } from '../../../request/index.ts';\nimport type { IOAuth2AuthorizationCodeRequestVerifier } from '../../../../../core/index.ts';\nimport { OAuth2AuthorizationCodeRequestValidator } from '../../../../../core/index.ts';\nimport type { AuthorizeControllerContext, AuthorizeControllerOptions } from './types.ts';\nimport { sanitizeError } from '../../../../../utils/index.ts';\n\n@DController('/authorize')\nexport class AuthorizeController {\n // todo: maybe /realms/<realm>/protocol/openid-connect/authorize\n // todo: maybe /realms/<realm>/[...]/authorize\n\n protected options: AuthorizeControllerOptions;\n\n protected codeRequestVerifier : IOAuth2AuthorizationCodeRequestVerifier;\n\n protected codeRequestValidator : OAuth2AuthorizationCodeRequestValidator;\n\n protected authorizer: HTTPOAuth2Authorizer;\n\n // ---------------------------------------------------------\n\n constructor(ctx: AuthorizeControllerContext) {\n this.options = ctx.options;\n\n this.codeRequestVerifier = ctx.codeRequestVerifier;\n\n this.codeRequestValidator = new OAuth2AuthorizationCodeRequestValidator();\n\n this.authorizer = new HTTPOAuth2Authorizer({\n codeRequestVerifier: this.codeRequestVerifier,\n accessTokenIssuer: ctx.accessTokenIssuer,\n openIdTokenIssuer: ctx.openIdTokenIssuer,\n codeIssuer: ctx.codeIssuer,\n identityResolver: ctx.identityResolver,\n });\n }\n\n // ---------------------------------------------------------\n\n @DPost('', [ForceUserLoggedInMiddleware])\n async confirm(@DContext() event: IAppEvent): Promise<{ url: string }> {\n const result = await this.authorizer.authorizeWithRequest(event);\n\n const url = new URL(result.redirectUri);\n if (result.state) {\n url.searchParams.set('state', result.state);\n }\n\n if (result.authorizationCode) {\n url.searchParams.set('code', result.authorizationCode);\n }\n\n if (result.accessToken) {\n url.searchParams.set('access_token', result.accessToken);\n }\n\n if (result.idToken) {\n url.searchParams.set('id_token', result.idToken);\n }\n\n return { url: url.href };\n }\n\n @DGet('', [])\n async serve(@DContext() event: IAppEvent): Promise<string> {\n let codeRequest : OAuth2AuthorizationCodeRequest | undefined;\n\n let client : Client | undefined;\n let scopes : Scope[] | undefined;\n\n let error : Error | undefined;\n\n try {\n const merged = await readFromLocations(event, ['body', 'query']);\n const data = await this.codeRequestValidator.run(merged);\n\n const result = await this.codeRequestVerifier.verify(data);\n client = result.client;\n scopes = result.scopes;\n\n codeRequest = result.data;\n } catch (e) {\n const normalized = sanitizeError(e);\n error = {\n ...normalized,\n message: normalized.message,\n };\n }\n\n const isJIT = isCodeTransformation(CodeTransformation.JUST_IN_TIME);\n\n const payload = {\n config: { baseURL: this.options.baseURL },\n data: {\n codeRequest,\n error,\n client,\n scopes,\n },\n };\n\n let html : string;\n let manifest : Record<string, any>;\n let render : CallableFunction;\n\n if (isJIT) {\n const vite = event.store[VITE_SERVER_STORE_KEY] as ViteDevServer;\n\n html = await fs.promises.readFile(\n path.join(UI_SOURCE_PATH, 'index.html'),\n 'utf-8',\n );\n html = await vite.transformIndexHtml('/', html);\n manifest = {};\n render = (await vite.ssrLoadModule('/src/server.ts')).render;\n } else {\n html = await fs.promises.readFile(\n path.join(UI_DIST_PATH, 'client', 'index.html'),\n 'utf-8',\n );\n\n manifest = JSON.parse(await fs.promises.readFile(\n path.join(UI_DIST_PATH, 'client', '.vite', 'ssr-manifest.json'),\n 'utf-8',\n ));\n\n render = (await load(path.join(UI_DIST_PATH, 'server', 'server.js'))).render;\n }\n\n const [appHtml, preloadLinks] = await render({\n url: '/authorize',\n manifest,\n payload,\n });\n\n const body = html\n .replace('<!--preload-links-->', preloadLinks)\n .replace('<!--app-html-->', appHtml);\n\n event.response.headers.set('content-type', 'text/html; charset=utf-8');\n return body;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,IAAakB,sBAAb,MAAaA;CAICC;CAEAC;CAEAC;CAEAC;CAIV,YAAYC,KAAiC;EACzC,KAAKJ,UAAUI,IAAIJ;EAEnB,KAAKC,sBAAsBG,IAAIH;EAE/B,KAAKC,uBAAuB,IAAIL,wCAAAA;EAEhC,KAAKM,aAAa,IAAIR,qBAAqB;GACvCM,qBAAqB,KAAKA;GAC1BI,mBAAmBD,IAAIC;GACvBC,mBAAmBF,IAAIE;GACvBC,YAAYH,IAAIG;GAChBC,kBAAkBJ,IAAII;EAC1B,CAAA;CACJ;CAIA,MACMC,QAAQ,OAAwD;EAClE,MAAME,SAAS,MAAM,KAAKR,WAAWS,qBAAqBF,KAAAA;EAE1D,MAAMG,MAAM,IAAIzB,IAAIuB,OAAOG,WAAW;EACtC,IAAIH,OAAOI,OACPF,IAAIG,aAAaC,IAAI,SAASN,OAAOI,KAAK;EAG9C,IAAIJ,OAAOO,mBACPL,IAAIG,aAAaC,IAAI,QAAQN,OAAOO,iBAAiB;EAGzD,IAAIP,OAAOQ,aACPN,IAAIG,aAAaC,IAAI,gBAAgBN,OAAOQ,WAAW;EAG3D,IAAIR,OAAOS,SACPP,IAAIG,aAAaC,IAAI,YAAYN,OAAOS,OAAO;EAGnD,OAAO,EAAEP,KAAKA,IAAIQ,KAAK;CAC3B;CAEA,MACMC,MAAM,OAA+C;EACvD,IAAIC;EAEJ,IAAIC;EACJ,IAAIC;EAEJ,IAAIC;EAEJ,IAAI;GACA,MAAMC,SAAS,MAAM/B,kBAAkBc,OAAO,CAAC,QAAQ,OAAA,CAAQ;GAC/D,MAAMkB,OAAO,MAAM,KAAK1B,qBAAqB2B,IAAIF,MAAAA;GAEjD,MAAMhB,SAAS,MAAM,KAAKV,oBAAoB6B,OAAOF,IAAAA;GACrDJ,SAASb,OAAOa;GAChBC,SAASd,OAAOc;GAEhBF,cAAcZ,OAAOiB;EACzB,SAASG,GAAG;GACR,MAAMC,aAAalC,cAAciC,CAAAA;GACjCL,QAAQ;IACJ,GAAGM;IACHC,SAASD,WAAWC;GACxB;EACJ;EAEA,MAAMC,QAAQ5C,qBAAqBD,mBAAmB8C,YAAY;EAElE,MAAMC,UAAU;GACZC,QAAQ,EAAEC,SAAS,KAAKtC,QAAQsC,QAAQ;GACxCV,MAAM;IACFL;IACAG;IACAF;IACAC;GACJ;EACJ;EAEA,IAAIc;EACJ,IAAIC;EACJ,IAAIC;EAEJ,IAAIP,OAAO;GACP,MAAMQ,OAAOhC,MAAMiC,MAAMjD;GAEzB6C,OAAO,MAAMrD,GAAG0D,SAASC,SACrB1D,KAAK2D,KAAKtD,gBAAgB,YAAA,GAC1B,OAAA;GAEJ+C,OAAO,MAAMG,KAAKK,mBAAmB,KAAKR,IAAAA;GAC1CC,WAAW,CAAC;GACZC,UAAU,MAAMC,KAAKM,cAAc,gBAAA,EAAA,CAAmBP;EAC1D,OAAO;GACHF,OAAO,MAAMrD,GAAG0D,SAASC,SACrB1D,KAAK2D,KAAKvD,cAAc,UAAU,YAAA,GAClC,OAAA;GAGJiD,WAAWS,KAAKC,MAAM,MAAMhE,GAAG0D,SAASC,SACpC1D,KAAK2D,KAAKvD,cAAc,UAAU,SAAS,mBAAA,GAC3C,OAAA,CAAA;GAGJkD,UAAU,MAAMxD,KAAKE,KAAK2D,KAAKvD,cAAc,UAAU,WAAA,CAAA,EAAA,CAAekD;EAC1E;EAEA,MAAM,CAACU,SAASC,gBAAgB,MAAMX,OAAO;GACzC5B,KAAK;GACL2B;GACAJ;EACJ,CAAA;EAEA,MAAMiB,OAAOd,KACRe,QAAQ,wBAAwBF,YAAAA,CAAAA,CAChCE,QAAQ,mBAAmBH,OAAAA;EAEhCzC,MAAM6C,SAASC,QAAQvC,IAAI,gBAAgB,0BAAA;EAC3C,OAAOoC;CACX;AACJ;;YAvGgB5D,2BAAAA,CAAAA"}
1
+ {"version":3,"file":"module.mjs","names":["DContext","DController","DGet","DPost","URL","ForceUserLoggedInMiddleware","HTTPOAuth2Authorizer","renderUIPage","readFromLocations","OAuth2AuthorizationCodeRequestValidator","sanitizeError","AuthorizeController","options","codeRequestVerifier","codeRequestValidator","authorizer","ctx","accessTokenIssuer","openIdTokenIssuer","codeIssuer","identityResolver","confirm","event","result","authorizeWithRequest","url","redirectUri","state","searchParams","set","authorizationCode","accessToken","idToken","href","serve","codeRequest","client","scopes","error","merged","data","run","verify","e","normalized","message","requestURL","request","payload","config","baseURL","features","requestPath","pathname","search"],"sources":["../../../../../../src/adapters/http/controllers/workflows/authorize/module.ts"],"sourcesContent":["/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport {\n DContext,\n DController,\n DGet,\n DPost,\n} from '@routup/decorators';\nimport { URL } from 'node:url';\n\nimport type { IAppEvent } from 'routup';\nimport type { Client, OAuth2AuthorizationCodeRequest, Scope } from '@authup/core-kit';\nimport { ForceUserLoggedInMiddleware } from '../../../middleware/index.ts';\nimport { HTTPOAuth2Authorizer } from '../../../adapters/index.ts';\nimport { renderUIPage } from '../../../ui/index.ts';\nimport { readFromLocations } from '../../../request/index.ts';\nimport type { IOAuth2AuthorizationCodeRequestVerifier } from '../../../../../core/index.ts';\nimport { OAuth2AuthorizationCodeRequestValidator } from '../../../../../core/index.ts';\nimport type { AuthorizeControllerContext, AuthorizeControllerOptions } from './types.ts';\nimport { sanitizeError } from '../../../../../utils/index.ts';\n\n@DController('/authorize')\nexport class AuthorizeController {\n // todo: maybe /realms/<realm>/protocol/openid-connect/authorize\n // todo: maybe /realms/<realm>/[...]/authorize\n\n protected options: AuthorizeControllerOptions;\n\n protected codeRequestVerifier : IOAuth2AuthorizationCodeRequestVerifier;\n\n protected codeRequestValidator : OAuth2AuthorizationCodeRequestValidator;\n\n protected authorizer: HTTPOAuth2Authorizer;\n\n // ---------------------------------------------------------\n\n constructor(ctx: AuthorizeControllerContext) {\n this.options = ctx.options;\n\n this.codeRequestVerifier = ctx.codeRequestVerifier;\n\n this.codeRequestValidator = new OAuth2AuthorizationCodeRequestValidator();\n\n this.authorizer = new HTTPOAuth2Authorizer({\n codeRequestVerifier: this.codeRequestVerifier,\n accessTokenIssuer: ctx.accessTokenIssuer,\n openIdTokenIssuer: ctx.openIdTokenIssuer,\n codeIssuer: ctx.codeIssuer,\n identityResolver: ctx.identityResolver,\n });\n }\n\n // ---------------------------------------------------------\n\n @DPost('', [ForceUserLoggedInMiddleware])\n async confirm(@DContext() event: IAppEvent): Promise<{ url: string }> {\n const result = await this.authorizer.authorizeWithRequest(event);\n\n const url = new URL(result.redirectUri);\n if (result.state) {\n url.searchParams.set('state', result.state);\n }\n\n if (result.authorizationCode) {\n url.searchParams.set('code', result.authorizationCode);\n }\n\n if (result.accessToken) {\n url.searchParams.set('access_token', result.accessToken);\n }\n\n if (result.idToken) {\n url.searchParams.set('id_token', result.idToken);\n }\n\n return { url: url.href };\n }\n\n @DGet('', [])\n async serve(@DContext() event: IAppEvent): Promise<string> {\n let codeRequest : OAuth2AuthorizationCodeRequest | undefined;\n\n let client : Client | undefined;\n let scopes : Scope[] | undefined;\n\n let error : Error | undefined;\n\n try {\n const merged = await readFromLocations(event, ['body', 'query']);\n const data = await this.codeRequestValidator.run(merged);\n\n const result = await this.codeRequestVerifier.verify(data);\n client = result.client;\n scopes = result.scopes;\n\n codeRequest = result.data;\n } catch (e) {\n const normalized = sanitizeError(e);\n error = {\n ...normalized,\n message: normalized.message,\n };\n }\n\n // Path + query of the original request the SSR page uses it as\n // the same-origin `redirect` parameter on register / password links\n // so those pages can lead back into this authorize request.\n const requestURL = new URL(event.request.url);\n\n return renderUIPage(event, {\n url: '/authorize',\n payload: {\n config: { baseURL: this.options.baseURL },\n data: {\n codeRequest,\n error,\n client,\n scopes,\n features: this.options.features,\n requestPath: `${requestURL.pathname}${requestURL.search}`,\n },\n },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,IAAaW,sBAAb,MAAaA;CAICC;CAEAC;CAEAC;CAEAC;CAIV,YAAYC,KAAiC;EACzC,KAAKJ,UAAUI,IAAIJ;EAEnB,KAAKC,sBAAsBG,IAAIH;EAE/B,KAAKC,uBAAuB,IAAIL,wCAAAA;EAEhC,KAAKM,aAAa,IAAIT,qBAAqB;GACvCO,qBAAqB,KAAKA;GAC1BI,mBAAmBD,IAAIC;GACvBC,mBAAmBF,IAAIE;GACvBC,YAAYH,IAAIG;GAChBC,kBAAkBJ,IAAII;EAC1B,CAAA;CACJ;CAIA,MACMC,QAAQ,OAAwD;EAClE,MAAME,SAAS,MAAM,KAAKR,WAAWS,qBAAqBF,KAAAA;EAE1D,MAAMG,MAAM,IAAIrB,IAAImB,OAAOG,WAAW;EACtC,IAAIH,OAAOI,OACPF,IAAIG,aAAaC,IAAI,SAASN,OAAOI,KAAK;EAG9C,IAAIJ,OAAOO,mBACPL,IAAIG,aAAaC,IAAI,QAAQN,OAAOO,iBAAiB;EAGzD,IAAIP,OAAOQ,aACPN,IAAIG,aAAaC,IAAI,gBAAgBN,OAAOQ,WAAW;EAG3D,IAAIR,OAAOS,SACPP,IAAIG,aAAaC,IAAI,YAAYN,OAAOS,OAAO;EAGnD,OAAO,EAAEP,KAAKA,IAAIQ,KAAK;CAC3B;CAEA,MACMC,MAAM,OAA+C;EACvD,IAAIC;EAEJ,IAAIC;EACJ,IAAIC;EAEJ,IAAIC;EAEJ,IAAI;GACA,MAAMC,SAAS,MAAM/B,kBAAkBc,OAAO,CAAC,QAAQ,OAAA,CAAQ;GAC/D,MAAMkB,OAAO,MAAM,KAAK1B,qBAAqB2B,IAAIF,MAAAA;GAEjD,MAAMhB,SAAS,MAAM,KAAKV,oBAAoB6B,OAAOF,IAAAA;GACrDJ,SAASb,OAAOa;GAChBC,SAASd,OAAOc;GAEhBF,cAAcZ,OAAOiB;EACzB,SAASG,GAAG;GACR,MAAMC,aAAalC,cAAciC,CAAAA;GACjCL,QAAQ;IACJ,GAAGM;IACHC,SAASD,WAAWC;GACxB;EACJ;EAKA,MAAMC,aAAa,IAAI1C,IAAIkB,MAAMyB,QAAQtB,GAAG;EAE5C,OAAOlB,aAAae,OAAO;GACvBG,KAAK;GACLuB,SAAS;IACLC,QAAQ,EAAEC,SAAS,KAAKtC,QAAQsC,QAAQ;IACxCV,MAAM;KACFL;KACAG;KACAF;KACAC;KACAc,UAAU,KAAKvC,QAAQuC;KACvBC,aAAa,GAAGN,WAAWO,WAAWP,WAAWQ;IACrD;GACJ;EACJ,CAAA;CACJ;AACJ;;YAtEgBjD,2BAAAA,CAAAA"}
@@ -1,6 +1,8 @@
1
+ import type { StatusResponseFeatures } from '@authup/core-http-kit';
1
2
  import type { IIdentityResolver, IOAuth2AuthorizationCodeIssuer, IOAuth2AuthorizationCodeRequestVerifier, IOAuth2OpenIDTokenIssuer, IOAuth2TokenIssuer } from '../../../../../core/index.ts';
2
3
  export type AuthorizeControllerOptions = {
3
4
  baseURL: string;
5
+ features: StatusResponseFeatures;
4
6
  };
5
7
  export type AuthorizeControllerContext = {
6
8
  options: AuthorizeControllerOptions;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/http/controllers/workflows/authorize/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACR,iBAAiB,EACjB,8BAA8B,EAC9B,uCAAuC,EACvC,wBAAwB,EACxB,kBAAkB,EACrB,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,0BAA0B,GAAG;IACrC,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACrC,OAAO,EAAE,0BAA0B,CAAC;IAEpC,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,iBAAiB,EAAE,wBAAwB,CAAC;IAE5C,UAAU,EAAE,8BAA8B,CAAC;IAC3C,mBAAmB,EAAE,uCAAuC,CAAC;IAE7D,gBAAgB,EAAE,iBAAiB,CAAA;CACtC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/http/controllers/workflows/authorize/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EACR,iBAAiB,EACjB,8BAA8B,EAC9B,uCAAuC,EACvC,wBAAwB,EACxB,kBAAkB,EACrB,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,0BAA0B,GAAG;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,sBAAsB,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACrC,OAAO,EAAE,0BAA0B,CAAC;IAEpC,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,iBAAiB,EAAE,wBAAwB,CAAC;IAE5C,UAAU,EAAE,8BAA8B,CAAC;IAC3C,mBAAmB,EAAE,uCAAuC,CAAC;IAE7D,gBAAgB,EAAE,iBAAiB,CAAA;CACtC,CAAC"}