@authup/server-core 1.0.0-beta.46 → 1.0.0-beta.48

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 (438) 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/database/subscriber/types.mjs +4 -0
  111. package/dist/adapters/http/controllers/entities/identity-provider/module.mjs +1 -1
  112. package/dist/adapters/http/controllers/workflows/activate/module.d.ts +8 -1
  113. package/dist/adapters/http/controllers/workflows/activate/module.d.ts.map +1 -1
  114. package/dist/adapters/http/controllers/workflows/activate/module.mjs +20 -1
  115. package/dist/adapters/http/controllers/workflows/activate/module.mjs.map +1 -1
  116. package/dist/adapters/http/controllers/workflows/authorize/module.d.ts.map +1 -1
  117. package/dist/adapters/http/controllers/workflows/authorize/module.mjs +16 -37
  118. package/dist/adapters/http/controllers/workflows/authorize/module.mjs.map +1 -1
  119. package/dist/adapters/http/controllers/workflows/authorize/types.d.ts +2 -0
  120. package/dist/adapters/http/controllers/workflows/authorize/types.d.ts.map +1 -1
  121. package/dist/adapters/http/controllers/workflows/password-forgot/module.d.ts +8 -1
  122. package/dist/adapters/http/controllers/workflows/password-forgot/module.d.ts.map +1 -1
  123. package/dist/adapters/http/controllers/workflows/password-forgot/module.mjs +23 -2
  124. package/dist/adapters/http/controllers/workflows/password-forgot/module.mjs.map +1 -1
  125. package/dist/adapters/http/controllers/workflows/password-reset/module.d.ts +8 -1
  126. package/dist/adapters/http/controllers/workflows/password-reset/module.d.ts.map +1 -1
  127. package/dist/adapters/http/controllers/workflows/password-reset/module.mjs +21 -1
  128. package/dist/adapters/http/controllers/workflows/password-reset/module.mjs.map +1 -1
  129. package/dist/adapters/http/controllers/workflows/register/module.d.ts +8 -1
  130. package/dist/adapters/http/controllers/workflows/register/module.d.ts.map +1 -1
  131. package/dist/adapters/http/controllers/workflows/register/module.mjs +23 -2
  132. package/dist/adapters/http/controllers/workflows/register/module.mjs.map +1 -1
  133. package/dist/adapters/http/controllers/workflows/status/module.d.ts +11 -4
  134. package/dist/adapters/http/controllers/workflows/status/module.d.ts.map +1 -1
  135. package/dist/adapters/http/controllers/workflows/status/module.mjs +17 -5
  136. package/dist/adapters/http/controllers/workflows/status/module.mjs.map +1 -1
  137. package/dist/adapters/http/index.mjs +4 -1
  138. package/dist/adapters/http/middleware/built-in/cors.d.ts.map +1 -1
  139. package/dist/adapters/http/middleware/built-in/cors.mjs.map +1 -1
  140. package/dist/adapters/http/middleware/built-in/error.d.ts +6 -1
  141. package/dist/adapters/http/middleware/built-in/error.d.ts.map +1 -1
  142. package/dist/adapters/http/middleware/built-in/error.mjs +2 -3
  143. package/dist/adapters/http/middleware/built-in/error.mjs.map +1 -1
  144. package/dist/adapters/http/middleware/built-in/index.d.ts +1 -0
  145. package/dist/adapters/http/middleware/built-in/index.d.ts.map +1 -1
  146. package/dist/adapters/http/middleware/built-in/index.mjs +2 -1
  147. package/dist/adapters/http/middleware/built-in/logger.d.ts +2 -0
  148. package/dist/adapters/http/middleware/built-in/logger.d.ts.map +1 -1
  149. package/dist/adapters/http/middleware/built-in/logger.mjs +1 -2
  150. package/dist/adapters/http/middleware/built-in/logger.mjs.map +1 -1
  151. package/dist/adapters/http/middleware/built-in/ui-http-client.d.ts +15 -0
  152. package/dist/adapters/http/middleware/built-in/ui-http-client.d.ts.map +1 -0
  153. package/dist/adapters/http/middleware/built-in/ui-http-client.mjs +25 -0
  154. package/dist/adapters/http/middleware/built-in/ui-http-client.mjs.map +1 -0
  155. package/dist/adapters/http/middleware/index.mjs +2 -1
  156. package/dist/adapters/http/request/helpers/index.d.ts +2 -0
  157. package/dist/adapters/http/request/helpers/index.d.ts.map +1 -1
  158. package/dist/adapters/http/request/helpers/index.mjs +3 -1
  159. package/dist/adapters/http/request/helpers/locale.d.ts +14 -0
  160. package/dist/adapters/http/request/helpers/locale.d.ts.map +1 -0
  161. package/dist/adapters/http/request/helpers/locale.mjs +32 -0
  162. package/dist/adapters/http/request/helpers/locale.mjs.map +1 -0
  163. package/dist/adapters/http/request/helpers/locations.mjs +1 -1
  164. package/dist/adapters/http/request/helpers/redirect.d.ts +14 -0
  165. package/dist/adapters/http/request/helpers/redirect.d.ts.map +1 -0
  166. package/dist/adapters/http/request/helpers/redirect.mjs +36 -0
  167. package/dist/adapters/http/request/helpers/redirect.mjs.map +1 -0
  168. package/dist/adapters/http/request/index.mjs +3 -1
  169. package/dist/adapters/http/ui/base-path.d.ts +9 -0
  170. package/dist/adapters/http/ui/base-path.d.ts.map +1 -0
  171. package/dist/adapters/http/ui/base-path.mjs +18 -0
  172. package/dist/adapters/http/ui/base-path.mjs.map +1 -0
  173. package/dist/adapters/http/ui/index.d.ts +5 -0
  174. package/dist/adapters/http/ui/index.d.ts.map +1 -0
  175. package/dist/adapters/http/ui/index.mjs +7 -0
  176. package/dist/adapters/http/ui/render.d.ts +4 -0
  177. package/dist/adapters/http/ui/render.d.ts.map +1 -0
  178. package/dist/adapters/http/ui/render.mjs +60 -0
  179. package/dist/adapters/http/ui/render.mjs.map +1 -0
  180. package/dist/adapters/http/ui/serve.d.ts +16 -0
  181. package/dist/adapters/http/ui/serve.d.ts.map +1 -0
  182. package/dist/adapters/http/ui/serve.mjs +32 -0
  183. package/dist/adapters/http/ui/serve.mjs.map +1 -0
  184. package/dist/adapters/http/ui/types.d.ts +8 -0
  185. package/dist/adapters/http/ui/types.d.ts.map +1 -0
  186. package/dist/adapters/http/ui/types.mjs +4 -0
  187. package/dist/app/index.mjs +3 -2
  188. package/dist/app/modules/config/constants.d.ts +1 -0
  189. package/dist/app/modules/config/constants.d.ts.map +1 -1
  190. package/dist/app/modules/config/constants.mjs +1 -0
  191. package/dist/app/modules/config/constants.mjs.map +1 -1
  192. package/dist/app/modules/config/index.d.ts +1 -0
  193. package/dist/app/modules/config/index.d.ts.map +1 -1
  194. package/dist/app/modules/config/index.mjs +2 -1
  195. package/dist/app/modules/config/normalize.d.ts.map +1 -1
  196. package/dist/app/modules/config/normalize.mjs +9 -2
  197. package/dist/app/modules/config/normalize.mjs.map +1 -1
  198. package/dist/app/modules/config/origins.d.ts +10 -0
  199. package/dist/app/modules/config/origins.d.ts.map +1 -0
  200. package/dist/app/modules/config/origins.mjs +21 -0
  201. package/dist/app/modules/config/origins.mjs.map +1 -0
  202. package/dist/app/modules/config/parse.d.ts.map +1 -1
  203. package/dist/app/modules/config/parse.mjs +1 -0
  204. package/dist/app/modules/config/parse.mjs.map +1 -1
  205. package/dist/app/modules/config/read/env.d.ts.map +1 -1
  206. package/dist/app/modules/config/read/env.mjs +2 -0
  207. package/dist/app/modules/config/read/env.mjs.map +1 -1
  208. package/dist/app/modules/config/types.d.ts +14 -0
  209. package/dist/app/modules/config/types.d.ts.map +1 -1
  210. package/dist/app/modules/database/constants.d.ts +2 -0
  211. package/dist/app/modules/database/constants.d.ts.map +1 -1
  212. package/dist/app/modules/database/constants.mjs +4 -1
  213. package/dist/app/modules/database/constants.mjs.map +1 -1
  214. package/dist/app/modules/database/module.d.ts +5 -1
  215. package/dist/app/modules/database/module.d.ts.map +1 -1
  216. package/dist/app/modules/database/module.mjs +26 -15
  217. package/dist/app/modules/database/module.mjs.map +1 -1
  218. package/dist/app/modules/http/constants.d.ts +11 -0
  219. package/dist/app/modules/http/constants.d.ts.map +1 -1
  220. package/dist/app/modules/http/constants.mjs +12 -1
  221. package/dist/app/modules/http/constants.mjs.map +1 -1
  222. package/dist/app/modules/http/modules/controller.d.ts +5 -1
  223. package/dist/app/modules/http/modules/controller.d.ts.map +1 -1
  224. package/dist/app/modules/http/modules/controller.mjs +75 -10
  225. package/dist/app/modules/http/modules/controller.mjs.map +1 -1
  226. package/dist/app/modules/http/modules/middleware.d.ts +2 -1
  227. package/dist/app/modules/http/modules/middleware.d.ts.map +1 -1
  228. package/dist/app/modules/http/modules/middleware.mjs +16 -4
  229. package/dist/app/modules/http/modules/middleware.mjs.map +1 -1
  230. package/dist/app/modules/identity/module.mjs +4 -4
  231. package/dist/app/modules/identity/module.mjs.map +1 -1
  232. package/dist/app/modules/identity/repositories/provider/account/module.d.ts +3 -1
  233. package/dist/app/modules/identity/repositories/provider/account/module.d.ts.map +1 -1
  234. package/dist/app/modules/identity/repositories/provider/account/module.mjs +6 -3
  235. package/dist/app/modules/identity/repositories/provider/account/module.mjs.map +1 -1
  236. package/dist/app/modules/identity/repositories/provider/mapper/attribute.d.ts +3 -0
  237. package/dist/app/modules/identity/repositories/provider/mapper/attribute.d.ts.map +1 -1
  238. package/dist/app/modules/identity/repositories/provider/mapper/attribute.mjs +5 -2
  239. package/dist/app/modules/identity/repositories/provider/mapper/attribute.mjs.map +1 -1
  240. package/dist/app/modules/identity/repositories/provider/mapper/permission.d.ts +3 -0
  241. package/dist/app/modules/identity/repositories/provider/mapper/permission.d.ts.map +1 -1
  242. package/dist/app/modules/identity/repositories/provider/mapper/permission.mjs +5 -2
  243. package/dist/app/modules/identity/repositories/provider/mapper/permission.mjs.map +1 -1
  244. package/dist/app/modules/identity/repositories/provider/mapper/role.d.ts +3 -0
  245. package/dist/app/modules/identity/repositories/provider/mapper/role.d.ts.map +1 -1
  246. package/dist/app/modules/identity/repositories/provider/mapper/role.mjs +5 -2
  247. package/dist/app/modules/identity/repositories/provider/mapper/role.mjs.map +1 -1
  248. package/dist/app/modules/index.mjs +3 -2
  249. package/dist/app/modules/logger/module.d.ts.map +1 -1
  250. package/dist/app/modules/logger/module.mjs +1 -5
  251. package/dist/app/modules/logger/module.mjs.map +1 -1
  252. package/dist/app/modules/mail/constants.d.ts +2 -1
  253. package/dist/app/modules/mail/constants.d.ts.map +1 -1
  254. package/dist/app/modules/mail/constants.mjs +2 -1
  255. package/dist/app/modules/mail/constants.mjs.map +1 -1
  256. package/dist/app/modules/mail/index.mjs +2 -2
  257. package/dist/app/modules/mail/module.d.ts.map +1 -1
  258. package/dist/app/modules/mail/module.mjs +4 -1
  259. package/dist/app/modules/mail/module.mjs.map +1 -1
  260. package/dist/app/modules/oauth2/module.d.ts.map +1 -1
  261. package/dist/app/modules/oauth2/module.mjs +3 -1
  262. package/dist/app/modules/oauth2/module.mjs.map +1 -1
  263. package/dist/app/modules/oauth2/repositories/key/repository.d.ts +3 -0
  264. package/dist/app/modules/oauth2/repositories/key/repository.d.ts.map +1 -1
  265. package/dist/app/modules/oauth2/repositories/key/repository.mjs +5 -2
  266. package/dist/app/modules/oauth2/repositories/key/repository.mjs.map +1 -1
  267. package/dist/app/modules/provisioning/module.d.ts.map +1 -1
  268. package/dist/app/modules/provisioning/module.mjs +12 -0
  269. package/dist/app/modules/provisioning/module.mjs.map +1 -1
  270. package/dist/core/entities/client/index.d.ts +1 -0
  271. package/dist/core/entities/client/index.d.ts.map +1 -1
  272. package/dist/core/entities/client/index.mjs +2 -1
  273. package/dist/core/entities/client/service.d.ts.map +1 -1
  274. package/dist/core/entities/client/service.mjs +3 -2
  275. package/dist/core/entities/client/service.mjs.map +1 -1
  276. package/dist/core/entities/client/types.d.ts +11 -1
  277. package/dist/core/entities/client/types.d.ts.map +1 -1
  278. package/dist/core/entities/client/web-client.d.ts +34 -0
  279. package/dist/core/entities/client/web-client.d.ts.map +1 -0
  280. package/dist/core/entities/client/web-client.mjs +62 -0
  281. package/dist/core/entities/client/web-client.mjs.map +1 -0
  282. package/dist/core/entities/index.mjs +2 -1
  283. package/dist/core/entities/realm/service.d.ts +6 -1
  284. package/dist/core/entities/realm/service.d.ts.map +1 -1
  285. package/dist/core/entities/realm/service.mjs +9 -0
  286. package/dist/core/entities/realm/service.mjs.map +1 -1
  287. package/dist/core/identity/index.d.ts +1 -0
  288. package/dist/core/identity/index.d.ts.map +1 -1
  289. package/dist/core/identity/index.mjs +2 -1
  290. package/dist/core/identity/password-recovery/constants.d.ts +6 -0
  291. package/dist/core/identity/password-recovery/constants.d.ts.map +1 -0
  292. package/dist/core/identity/password-recovery/constants.mjs +12 -0
  293. package/dist/core/identity/password-recovery/constants.mjs.map +1 -0
  294. package/dist/core/identity/password-recovery/index.d.ts +1 -0
  295. package/dist/core/identity/password-recovery/index.d.ts.map +1 -1
  296. package/dist/core/identity/password-recovery/index.mjs +2 -1
  297. package/dist/core/identity/password-recovery/service.d.ts +4 -2
  298. package/dist/core/identity/password-recovery/service.d.ts.map +1 -1
  299. package/dist/core/identity/password-recovery/service.mjs +17 -6
  300. package/dist/core/identity/password-recovery/service.mjs.map +1 -1
  301. package/dist/core/identity/password-recovery/types.d.ts +5 -2
  302. package/dist/core/identity/password-recovery/types.d.ts.map +1 -1
  303. package/dist/core/identity/registration/service.d.ts +4 -2
  304. package/dist/core/identity/registration/service.d.ts.map +1 -1
  305. package/dist/core/identity/registration/service.mjs +15 -6
  306. package/dist/core/identity/registration/service.mjs.map +1 -1
  307. package/dist/core/identity/registration/types.d.ts +5 -2
  308. package/dist/core/identity/registration/types.d.ts.map +1 -1
  309. package/dist/core/identity/role/module.d.ts.map +1 -1
  310. package/dist/core/identity/role/module.mjs +1 -1
  311. package/dist/core/identity/role/module.mjs.map +1 -1
  312. package/dist/core/identity/types.d.ts +10 -0
  313. package/dist/core/identity/types.d.ts.map +1 -0
  314. package/dist/core/identity/types.mjs +4 -0
  315. package/dist/core/index.mjs +8 -1
  316. package/dist/core/mail/format/blocks.d.ts +12 -0
  317. package/dist/core/mail/format/blocks.d.ts.map +1 -0
  318. package/dist/core/mail/format/blocks.mjs +47 -0
  319. package/dist/core/mail/format/blocks.mjs.map +1 -0
  320. package/dist/core/mail/format/html.d.ts +9 -0
  321. package/dist/core/mail/format/html.d.ts.map +1 -0
  322. package/dist/core/mail/format/html.mjs +41 -0
  323. package/dist/core/mail/format/html.mjs.map +1 -0
  324. package/dist/core/mail/format/index.d.ts +5 -0
  325. package/dist/core/mail/format/index.d.ts.map +1 -0
  326. package/dist/core/mail/format/index.mjs +7 -0
  327. package/dist/core/mail/format/text.d.ts +3 -0
  328. package/dist/core/mail/format/text.d.ts.map +1 -0
  329. package/dist/core/mail/format/text.mjs +20 -0
  330. package/dist/core/mail/format/text.mjs.map +1 -0
  331. package/dist/core/mail/format/types.d.ts +30 -0
  332. package/dist/core/mail/format/types.d.ts.map +1 -0
  333. package/dist/core/mail/format/types.mjs +4 -0
  334. package/dist/core/mail/index.d.ts +3 -0
  335. package/dist/core/mail/index.d.ts.map +1 -1
  336. package/dist/core/mail/index.mjs +6 -1
  337. package/dist/core/mail/renderer.d.ts +10 -0
  338. package/dist/core/mail/renderer.d.ts.map +1 -0
  339. package/dist/core/mail/renderer.mjs +49 -0
  340. package/dist/core/mail/renderer.mjs.map +1 -0
  341. package/dist/core/mail/template/define.d.ts +7 -0
  342. package/dist/core/mail/template/define.d.ts.map +1 -0
  343. package/dist/core/mail/template/define.mjs +14 -0
  344. package/dist/core/mail/template/define.mjs.map +1 -0
  345. package/dist/core/mail/template/index.d.ts +4 -0
  346. package/dist/core/mail/template/index.d.ts.map +1 -0
  347. package/dist/core/mail/template/index.mjs +7 -0
  348. package/dist/core/mail/template/registry.d.ts +6 -0
  349. package/dist/core/mail/template/registry.d.ts.map +1 -0
  350. package/dist/core/mail/template/registry.mjs +15 -0
  351. package/dist/core/mail/template/registry.mjs.map +1 -0
  352. package/dist/core/mail/template/templates/password-reset.d.ts +3 -0
  353. package/dist/core/mail/template/templates/password-reset.d.ts.map +1 -0
  354. package/dist/core/mail/template/templates/password-reset.mjs +36 -0
  355. package/dist/core/mail/template/templates/password-reset.mjs.map +1 -0
  356. package/dist/core/mail/template/templates/registration-activation.d.ts +3 -0
  357. package/dist/core/mail/template/templates/registration-activation.d.ts.map +1 -0
  358. package/dist/core/mail/template/templates/registration-activation.mjs +34 -0
  359. package/dist/core/mail/template/templates/registration-activation.mjs.map +1 -0
  360. package/dist/core/mail/template/types.d.ts +39 -0
  361. package/dist/core/mail/template/types.d.ts.map +1 -0
  362. package/dist/core/mail/template/types.mjs +13 -0
  363. package/dist/core/mail/template/types.mjs.map +1 -0
  364. package/dist/core/mail/types.d.ts +21 -0
  365. package/dist/core/mail/types.d.ts.map +1 -1
  366. package/dist/index.mjs +7 -3
  367. package/dist/swagger.json +98 -3
  368. package/dist/ui/client/.vite/ssr-manifest.json +49086 -874
  369. package/dist/ui/client/assets/asap-latin-400-normal-Dc37g3Il.woff +0 -0
  370. package/dist/ui/client/assets/asap-latin-400-normal-DnZ1MOsG.woff2 +0 -0
  371. package/dist/ui/client/assets/asap-latin-700-normal-Dqcopq14.woff +0 -0
  372. package/dist/ui/client/assets/asap-latin-700-normal-l2Y8pi-F.woff2 +0 -0
  373. package/dist/ui/client/assets/asap-latin-ext-400-normal-C-fcRdtE.woff +0 -0
  374. package/dist/ui/client/assets/asap-latin-ext-400-normal-DwYtpHbV.woff2 +0 -0
  375. package/dist/ui/client/assets/asap-latin-ext-700-normal-D00OESsZ.woff +0 -0
  376. package/dist/ui/client/assets/asap-latin-ext-700-normal-y8bo5aW5.woff2 +0 -0
  377. package/dist/ui/client/assets/asap-vietnamese-400-normal-DGyJlJLT.woff2 +0 -0
  378. package/dist/ui/client/assets/asap-vietnamese-400-normal-lfLaoF2x.woff +0 -0
  379. package/dist/ui/client/assets/asap-vietnamese-700-normal-B-e19ug5.woff +0 -0
  380. package/dist/ui/client/assets/asap-vietnamese-700-normal-D-SxY94i.woff2 +0 -0
  381. package/dist/ui/client/assets/index-BeXJgvKE.css +2 -0
  382. package/dist/ui/client/assets/index-CgLTRwpP.js +95 -0
  383. package/dist/ui/client/assets/nunito-cyrillic-300-normal-BPQV259B.woff2 +0 -0
  384. package/dist/ui/client/assets/nunito-cyrillic-300-normal-g5qSsvc0.woff +0 -0
  385. package/dist/ui/client/assets/nunito-cyrillic-400-normal-D1j0u8EH.woff +0 -0
  386. package/dist/ui/client/assets/nunito-cyrillic-400-normal-xAOo5cBP.woff2 +0 -0
  387. package/dist/ui/client/assets/nunito-cyrillic-600-normal-BUjmtIuu.woff +0 -0
  388. package/dist/ui/client/assets/nunito-cyrillic-600-normal-DJGQ2h05.woff2 +0 -0
  389. package/dist/ui/client/assets/nunito-cyrillic-700-normal-DP36NgGt.woff2 +0 -0
  390. package/dist/ui/client/assets/nunito-cyrillic-700-normal-DfHRUDv-.woff +0 -0
  391. package/dist/ui/client/assets/nunito-cyrillic-ext-300-normal-BDHtqmCR.woff +0 -0
  392. package/dist/ui/client/assets/nunito-cyrillic-ext-300-normal-ChMQLIrm.woff2 +0 -0
  393. package/dist/ui/client/assets/nunito-cyrillic-ext-400-normal-CuPM9foi.woff2 +0 -0
  394. package/dist/ui/client/assets/nunito-cyrillic-ext-400-normal-xaE7D4Sw.woff +0 -0
  395. package/dist/ui/client/assets/nunito-cyrillic-ext-600-normal-CWPPjBOD.woff2 +0 -0
  396. package/dist/ui/client/assets/nunito-cyrillic-ext-600-normal-vnfu4DTE.woff +0 -0
  397. package/dist/ui/client/assets/nunito-cyrillic-ext-700-normal-BuR0mlCG.woff2 +0 -0
  398. package/dist/ui/client/assets/nunito-cyrillic-ext-700-normal-DfoqN4Gs.woff +0 -0
  399. package/dist/ui/client/assets/nunito-latin-300-normal-C3ZIKvzv.woff +0 -0
  400. package/dist/ui/client/assets/nunito-latin-300-normal-COoPE5VN.woff2 +0 -0
  401. package/dist/ui/client/assets/nunito-latin-400-normal-DKg4f3fz.woff +0 -0
  402. package/dist/ui/client/assets/nunito-latin-400-normal-r8SDr6Up.woff2 +0 -0
  403. package/dist/ui/client/assets/nunito-latin-600-normal-Br8yIETf.woff2 +0 -0
  404. package/dist/ui/client/assets/nunito-latin-600-normal-Cd0eNu1l.woff +0 -0
  405. package/dist/ui/client/assets/nunito-latin-700-normal-Dort48En.woff2 +0 -0
  406. package/dist/ui/client/assets/nunito-latin-700-normal-OcDqTBcA.woff +0 -0
  407. package/dist/ui/client/assets/nunito-latin-ext-300-normal-D1SyVuPt.woff2 +0 -0
  408. package/dist/ui/client/assets/nunito-latin-ext-300-normal-DfqbmdMl.woff +0 -0
  409. package/dist/ui/client/assets/nunito-latin-ext-400-normal-CjMJVfGn.woff +0 -0
  410. package/dist/ui/client/assets/nunito-latin-ext-400-normal-i-8OOpdj.woff2 +0 -0
  411. package/dist/ui/client/assets/nunito-latin-ext-600-normal-BKUpuB78.woff +0 -0
  412. package/dist/ui/client/assets/nunito-latin-ext-600-normal-Dd9Zuxh1.woff2 +0 -0
  413. package/dist/ui/client/assets/nunito-latin-ext-700-normal-BWeMsAzO.woff2 +0 -0
  414. package/dist/ui/client/assets/nunito-latin-ext-700-normal-D4woHhbd.woff +0 -0
  415. package/dist/ui/client/assets/nunito-vietnamese-300-normal-DATld5Vw.woff +0 -0
  416. package/dist/ui/client/assets/nunito-vietnamese-300-normal-mLneKULB.woff2 +0 -0
  417. package/dist/ui/client/assets/nunito-vietnamese-400-normal-BHkVbP3T.woff2 +0 -0
  418. package/dist/ui/client/assets/nunito-vietnamese-400-normal-DtOtW02z.woff +0 -0
  419. package/dist/ui/client/assets/nunito-vietnamese-600-normal-BY8O6Cug.woff2 +0 -0
  420. package/dist/ui/client/assets/nunito-vietnamese-600-normal-DO1RqFw5.woff +0 -0
  421. package/dist/ui/client/assets/nunito-vietnamese-700-normal-C9SQsXvj.woff +0 -0
  422. package/dist/ui/client/assets/nunito-vietnamese-700-normal-Ch8EUCfz.woff2 +0 -0
  423. package/dist/ui/client/index.html +2 -2
  424. package/dist/ui/server/server.js +2765 -540
  425. package/package.json +20 -17
  426. package/dist/adapters/database/data-source/singleton.d.ts +0 -5
  427. package/dist/adapters/database/data-source/singleton.d.ts.map +0 -1
  428. package/dist/adapters/database/data-source/singleton.mjs +0 -19
  429. package/dist/adapters/database/data-source/singleton.mjs.map +0 -1
  430. package/dist/adapters/database/event-publisher/index.d.ts +0 -2
  431. package/dist/adapters/database/event-publisher/index.d.ts.map +0 -1
  432. package/dist/adapters/database/event-publisher/index.mjs +0 -5
  433. package/dist/adapters/database/event-publisher/module.d.ts +0 -6
  434. package/dist/adapters/database/event-publisher/module.d.ts.map +0 -1
  435. package/dist/adapters/database/event-publisher/module.mjs +0 -25
  436. package/dist/adapters/database/event-publisher/module.mjs.map +0 -1
  437. package/dist/ui/client/assets/index-Cvz0JzBe.js +0 -95
  438. package/dist/ui/client/assets/index-DNeLkYQO.css +0 -1
@@ -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 { RobotPermissionEntity } 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/robot-permission/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.ROBOT_PERMISSION, id) }];
20
- if (data.robot_realm_id) destinations.push({
21
- channel: (id) => buildEntityChannelName(EntityType.ROBOT_PERMISSION, id),
22
- namespace: buildEntityNamespaceName(data.robot_realm_id)
23
- });
24
- if (data.permission_realm_id) destinations.push({
25
- channel: (id) => buildEntityChannelName(EntityType.ROBOT_PERMISSION, id),
26
- namespace: buildEntityNamespaceName(data.permission_realm_id)
27
- });
28
- await publishDomainEvent({
29
- content: {
30
- type: EntityType.ROBOT_PERMISSION,
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 RobotPermissionSubscriber = class {
38
- listenTo() {
39
- return RobotPermissionEntity;
40
- }
41
- async afterInsert(event) {
42
- if (event.connection.queryResultCache) await event.connection.queryResultCache.remove([buildRedisKeyPath({
43
- prefix: CachePrefix.ROBOT_OWNED_PERMISSIONS,
44
- key: event.entity.robot_id
45
- })]);
46
- await publishEvent(EntityDefaultEventName.CREATED, event.entity);
47
- return Promise.resolve(void 0);
48
- }
49
- async afterUpdate(event) {
50
- if (!event.entity) return;
51
- if (event.connection.queryResultCache) await event.connection.queryResultCache.remove([buildRedisKeyPath({
52
- prefix: CachePrefix.ROBOT_OWNED_PERMISSIONS,
53
- key: event.entity.robot_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.ROBOT_OWNED_PERMISSIONS,
61
- key: event.entity.robot_id
62
- })]);
63
- await publishEvent(EntityDefaultEventName.DELETED, event.entity);
21
+ var RobotPermissionSubscriber = class extends EntitySubscriber {
22
+ constructor() {
23
+ super({
24
+ type: EntityType.ROBOT_PERMISSION,
25
+ target: RobotPermissionEntity,
26
+ destinations: buildEntityDestinations(EntityType.ROBOT_PERMISSION, (data) => [data.robot_realm_id, data.permission_realm_id]),
27
+ cache: {
28
+ onInsert: true,
29
+ keys: (data) => [buildRedisKeyPath({
30
+ prefix: CachePrefix.ROBOT_OWNED_PERMISSIONS,
31
+ key: data.robot_id
32
+ })]
33
+ }
34
+ });
64
35
  }
65
36
  };
66
- RobotPermissionSubscriber = _ts_decorate([EventSubscriber()], RobotPermissionSubscriber);
37
+ RobotPermissionSubscriber = _ts_decorate([
38
+ EventSubscriber(),
39
+ _ts_metadata("design:type", Function),
40
+ _ts_metadata("design:paramtypes", [])
41
+ ], RobotPermissionSubscriber);
67
42
  //#endregion
68
43
  export { RobotPermissionSubscriber };
69
44
 
@@ -1 +1 @@
1
- {"version":3,"file":"subscriber.mjs","names":["EntityDefaultEventName","EntityType","buildEntityChannelName","buildEntityNamespaceName","buildRedisKeyPath","EventSubscriber","publishDomainEvent","RobotPermissionEntity","CachePrefix","publishEvent","event","data","destinations","channel","id","ROBOT_PERMISSION","robot_realm_id","push","namespace","permission_realm_id","content","type","RobotPermissionSubscriber","listenTo","afterInsert","connection","queryResultCache","remove","prefix","ROBOT_OWNED_PERMISSIONS","key","entity","robot_id","CREATED","Promise","resolve","undefined","afterUpdate","UPDATED","afterRemove","DELETED"],"sources":["../../../../../src/adapters/database/domains/robot-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 { RobotPermission } 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 { RobotPermissionEntity } from './entity.ts';\nimport { CachePrefix } from '../constants.ts';\n\nasync function publishEvent(\n event: `${EntityDefaultEventName}`,\n data: RobotPermission,\n) {\n const destinations : DomainEventDestination[] = [\n { channel: (id) => buildEntityChannelName(EntityType.ROBOT_PERMISSION, id) },\n ];\n if (data.robot_realm_id) {\n destinations.push({\n channel: (id) => buildEntityChannelName(EntityType.ROBOT_PERMISSION, id),\n namespace: buildEntityNamespaceName(data.robot_realm_id),\n });\n }\n if (data.permission_realm_id) {\n destinations.push({\n channel: (id) => buildEntityChannelName(EntityType.ROBOT_PERMISSION, id),\n namespace: buildEntityNamespaceName(data.permission_realm_id),\n });\n }\n\n await publishDomainEvent({\n content: {\n type: EntityType.ROBOT_PERMISSION,\n event,\n data,\n },\n destinations,\n });\n}\n\n@EventSubscriber()\nexport class RobotPermissionSubscriber implements EntitySubscriberInterface<RobotPermission> {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n listenTo(): Function | string {\n return RobotPermissionEntity;\n }\n\n async afterInsert(event: InsertEvent<RobotPermission>): Promise<any> {\n if (event.connection.queryResultCache) {\n await event.connection.queryResultCache.remove([\n buildRedisKeyPath({\n prefix: CachePrefix.ROBOT_OWNED_PERMISSIONS,\n key: event.entity.robot_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<RobotPermission>): 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.ROBOT_OWNED_PERMISSIONS,\n key: event.entity.robot_id,\n }),\n ]);\n }\n\n await publishEvent(EntityDefaultEventName.UPDATED, event.entity as RobotPermission);\n }\n\n async afterRemove(event: RemoveEvent<RobotPermission>): 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.ROBOT_OWNED_PERMISSIONS,\n key: event.entity.robot_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,MAAqB;CAErB,MAAMC,eAA0C,CAC5C,EAAEC,UAAUC,OAAOZ,uBAAuBD,WAAWc,kBAAkBD,EAAAA,EAAI,CAAA;CAE/E,IAAIH,KAAKK,gBACLJ,aAAaK,KAAK;EACdJ,UAAUC,OAAOZ,uBAAuBD,WAAWc,kBAAkBD,EAAAA;EACrEI,WAAWf,yBAAyBQ,KAAKK,cAAc;CAC3D,CAAA;CAEJ,IAAIL,KAAKQ,qBACLP,aAAaK,KAAK;EACdJ,UAAUC,OAAOZ,uBAAuBD,WAAWc,kBAAkBD,EAAAA;EACrEI,WAAWf,yBAAyBQ,KAAKQ,mBAAmB;CAChE,CAAA;CAGJ,MAAMb,mBAAmB;EACrBc,SAAS;GACLC,MAAMpB,WAAWc;GACjBL;GACAC;EACJ;EACAC;CACJ,CAAA;AACJ;AAGA,IAAaU,4BAAb,MAAaA;CAETC,WAA8B;EAC1B,OAAOhB;CACX;CAEA,MAAMiB,YAAYd,OAAmD;EACjE,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,OAAmD;EACjE,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,OAAmD;EACjE,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","RobotPermissionEntity","CachePrefix","RobotPermissionSubscriber","type","ROBOT_PERMISSION","target","destinations","data","robot_realm_id","permission_realm_id","cache","onInsert","keys","prefix","ROBOT_OWNED_PERMISSIONS","key","robot_id"],"sources":["../../../../../src/adapters/database/domains/robot-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 { RobotPermission } 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 { RobotPermissionEntity } from './entity.ts';\nimport { CachePrefix } from '../constants.ts';\n\n@EventSubscriber()\nexport class RobotPermissionSubscriber extends EntitySubscriber<RobotPermission> {\n constructor() {\n super({\n type: EntityType.ROBOT_PERMISSION,\n target: RobotPermissionEntity,\n destinations: buildEntityDestinations(EntityType.ROBOT_PERMISSION, (data) => [\n data.robot_realm_id,\n data.permission_realm_id,\n ]),\n cache: {\n onInsert: true,\n keys: (data) => [\n buildRedisKeyPath({\n prefix: CachePrefix.ROBOT_OWNED_PERMISSIONS,\n key: data.robot_id,\n }),\n ],\n },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;AAKC,SAAA,aAAA,YAAA,QAAA,KAAA,MAAA;;;;;;;;;AAWD,IAAaO,4BAAb,cAA+CJ,iBAAAA;CAC3C,cAAc;EACV,MAAM;GACFK,MAAMR,WAAWS;GACjBC,QAAQL;GACRM,cAAcP,wBAAwBJ,WAAWS,mBAAmBG,SAAS,CACzEA,KAAKC,gBACLD,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 { RobotRole } from '@authup/core-kit';
2
- import type { EntitySubscriberInterface, InsertEvent, RemoveEvent, UpdateEvent } from 'typeorm';
3
- export declare class RobotRoleSubscriber implements EntitySubscriberInterface<RobotRole> {
4
- listenTo(): Function | string;
5
- afterInsert(event: InsertEvent<RobotRole>): Promise<any>;
6
- afterUpdate(event: UpdateEvent<RobotRole>): Promise<any>;
7
- afterRemove(event: RemoveEvent<RobotRole>): Promise<any>;
2
+ import { EntitySubscriber } from '../../subscriber/index.ts';
3
+ export declare class RobotRoleSubscriber extends EntitySubscriber<RobotRole> {
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/robot-role/subscriber.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AASlD,OAAO,KAAK,EACR,yBAAyB,EACzB,WAAW,EACX,WAAW,EACX,WAAW,EACd,MAAM,SAAS,CAAC;AAoCjB,qBACa,mBAAoB,YAAW,yBAAyB,CAAC,SAAS,CAAC;IAE5E,QAAQ,IAAI,QAAQ,GAAG,MAAM;IAIvB,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAiBxD,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAiBxD,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;CAgBjE"}
1
+ {"version":3,"file":"subscriber.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/database/domains/robot-role/subscriber.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAIlD,OAAO,EAAE,gBAAgB,EAA2B,MAAM,2BAA2B,CAAC;AAItF,qBACa,mBAAoB,SAAQ,gBAAgB,CAAC,SAAS,CAAC;;CAoBnE"}
@@ -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 { RobotRoleEntity } 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/robot-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.ROBOT_ROLE, id) }];
20
- if (data.robot_realm_id) destinations.push({
21
- channel: (id) => buildEntityChannelName(EntityType.ROBOT_ROLE, id),
22
- namespace: buildEntityNamespaceName(data.robot_realm_id)
23
- });
24
- if (data.role_realm_id) destinations.push({
25
- channel: (id) => buildEntityChannelName(EntityType.ROBOT_ROLE, id),
26
- namespace: buildEntityNamespaceName(data.role_realm_id)
27
- });
28
- await publishDomainEvent({
29
- content: {
30
- type: EntityType.ROBOT_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 RobotRoleSubscriber = class {
38
- listenTo() {
39
- return RobotRoleEntity;
40
- }
41
- async afterInsert(event) {
42
- if (!event.entity) return;
43
- if (event.connection.queryResultCache) await event.connection.queryResultCache.remove([buildRedisKeyPath({
44
- prefix: CachePrefix.ROBOT_OWNED_ROLES,
45
- key: event.entity.robot_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.ROBOT_OWNED_ROLES,
53
- key: event.entity.robot_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.ROBOT_OWNED_ROLES,
61
- key: event.entity.robot_id
62
- })]);
63
- await publishEvent(EntityDefaultEventName.DELETED, event.entity);
21
+ var RobotRoleSubscriber = class extends EntitySubscriber {
22
+ constructor() {
23
+ super({
24
+ type: EntityType.ROBOT_ROLE,
25
+ target: RobotRoleEntity,
26
+ destinations: buildEntityDestinations(EntityType.ROBOT_ROLE, (data) => [data.robot_realm_id, data.role_realm_id]),
27
+ cache: {
28
+ onInsert: true,
29
+ keys: (data) => [buildRedisKeyPath({
30
+ prefix: CachePrefix.ROBOT_OWNED_ROLES,
31
+ key: data.robot_id
32
+ })]
33
+ }
34
+ });
64
35
  }
65
36
  };
66
- RobotRoleSubscriber = _ts_decorate([EventSubscriber()], RobotRoleSubscriber);
37
+ RobotRoleSubscriber = _ts_decorate([
38
+ EventSubscriber(),
39
+ _ts_metadata("design:type", Function),
40
+ _ts_metadata("design:paramtypes", [])
41
+ ], RobotRoleSubscriber);
67
42
  //#endregion
68
43
  export { RobotRoleSubscriber };
69
44
 
@@ -1 +1 @@
1
- {"version":3,"file":"subscriber.mjs","names":["EntityDefaultEventName","EntityType","buildEntityChannelName","buildEntityNamespaceName","buildRedisKeyPath","EventSubscriber","publishDomainEvent","CachePrefix","RobotRoleEntity","publishEvent","event","data","destinations","channel","id","ROBOT_ROLE","robot_realm_id","push","namespace","role_realm_id","content","type","RobotRoleSubscriber","listenTo","afterInsert","entity","connection","queryResultCache","remove","prefix","ROBOT_OWNED_ROLES","key","robot_id","CREATED","afterUpdate","UPDATED","afterRemove","DELETED"],"sources":["../../../../../src/adapters/database/domains/robot-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 { RobotRole } 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 { CachePrefix } from '../constants.ts';\nimport { RobotRoleEntity } from './entity.ts';\n\nasync function publishEvent(\n event: `${EntityDefaultEventName}`,\n data: RobotRole,\n) {\n const destinations : DomainEventDestination[] = [\n { channel: (id) => buildEntityChannelName(EntityType.ROBOT_ROLE, id) },\n ];\n if (data.robot_realm_id) {\n destinations.push({\n channel: (id) => buildEntityChannelName(EntityType.ROBOT_ROLE, id),\n namespace: buildEntityNamespaceName(data.robot_realm_id),\n });\n }\n if (data.role_realm_id) {\n destinations.push({\n channel: (id) => buildEntityChannelName(EntityType.ROBOT_ROLE, id),\n namespace: buildEntityNamespaceName(data.role_realm_id),\n });\n }\n\n await publishDomainEvent({\n content: {\n type: EntityType.ROBOT_ROLE,\n event,\n data,\n },\n destinations,\n });\n}\n\n@EventSubscriber()\nexport class RobotRoleSubscriber implements EntitySubscriberInterface<RobotRole> {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n listenTo(): Function | string {\n return RobotRoleEntity;\n }\n\n async afterInsert(event: InsertEvent<RobotRole>): 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.ROBOT_OWNED_ROLES,\n key: event.entity.robot_id,\n }),\n ]);\n }\n\n await publishEvent(EntityDefaultEventName.CREATED, event.entity);\n }\n\n async afterUpdate(event: UpdateEvent<RobotRole>): 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.ROBOT_OWNED_ROLES,\n key: event.entity.robot_id,\n }),\n ]);\n }\n\n await publishEvent(EntityDefaultEventName.UPDATED, event.entity as RobotRole);\n }\n\n async afterRemove(event: RemoveEvent<RobotRole>): 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.ROBOT_OWNED_ROLES,\n key: event.entity.robot_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,MAAe;CAEf,MAAMC,eAA0C,CAC5C,EAAEC,UAAUC,OAAOZ,uBAAuBD,WAAWc,YAAYD,EAAAA,EAAI,CAAA;CAEzE,IAAIH,KAAKK,gBACLJ,aAAaK,KAAK;EACdJ,UAAUC,OAAOZ,uBAAuBD,WAAWc,YAAYD,EAAAA;EAC/DI,WAAWf,yBAAyBQ,KAAKK,cAAc;CAC3D,CAAA;CAEJ,IAAIL,KAAKQ,eACLP,aAAaK,KAAK;EACdJ,UAAUC,OAAOZ,uBAAuBD,WAAWc,YAAYD,EAAAA;EAC/DI,WAAWf,yBAAyBQ,KAAKQ,aAAa;CAC1D,CAAA;CAGJ,MAAMb,mBAAmB;EACrBc,SAAS;GACLC,MAAMpB,WAAWc;GACjBL;GACAC;EACJ;EACAC;CACJ,CAAA;AACJ;AAGA,IAAaU,sBAAb,MAAaA;CAETC,WAA8B;EAC1B,OAAOf;CACX;CAEA,MAAMgB,YAAYd,OAA6C;EAC3D,IAAI,CAACA,MAAMe,QACP;EAGJ,IAAIf,MAAMgB,WAAWC,kBACjB,MAAMjB,MAAMgB,WAAWC,iBAAiBC,OAAO,CAC3CxB,kBAAkB;GACdyB,QAAQtB,YAAYuB;GACpBC,KAAKrB,MAAMe,OAAOO;EACtB,CAAA,CAAA,CACH;EAGL,MAAMvB,aAAaT,uBAAuBiC,SAASvB,MAAMe,MAAM;CACnE;CAEA,MAAMS,YAAYxB,OAA6C;EAC3D,IAAI,CAACA,MAAMe,QACP;EAGJ,IAAIf,MAAMgB,WAAWC,kBACjB,MAAMjB,MAAMgB,WAAWC,iBAAiBC,OAAO,CAC3CxB,kBAAkB;GACdyB,QAAQtB,YAAYuB;GACpBC,KAAKrB,MAAMe,OAAOO;EACtB,CAAA,CAAA,CACH;EAGL,MAAMvB,aAAaT,uBAAuBmC,SAASzB,MAAMe,MAAM;CACnE;CAEA,MAAMW,YAAY1B,OAA6C;EAC3D,IAAI,CAACA,MAAMe,QACP;EAGJ,IAAIf,MAAMgB,WAAWC,kBACjB,MAAMjB,MAAMgB,WAAWC,iBAAiBC,OAAO,CAC3CxB,kBAAkB;GACdyB,QAAQtB,YAAYuB;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","RobotRoleEntity","CachePrefix","RobotRoleSubscriber","type","ROBOT_ROLE","target","destinations","data","robot_realm_id","role_realm_id","cache","onInsert","keys","prefix","ROBOT_OWNED_ROLES","key","robot_id"],"sources":["../../../../../src/adapters/database/domains/robot-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 { RobotRole } 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 { RobotRoleEntity } from './entity.ts';\nimport { CachePrefix } from '../constants.ts';\n\n@EventSubscriber()\nexport class RobotRoleSubscriber extends EntitySubscriber<RobotRole> {\n constructor() {\n super({\n type: EntityType.ROBOT_ROLE,\n target: RobotRoleEntity,\n destinations: buildEntityDestinations(EntityType.ROBOT_ROLE, (data) => [\n data.robot_realm_id,\n data.role_realm_id,\n ]),\n cache: {\n onInsert: true,\n keys: (data) => [\n buildRedisKeyPath({\n prefix: CachePrefix.ROBOT_OWNED_ROLES,\n key: data.robot_id,\n }),\n ],\n },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;AAKC,SAAA,aAAA,YAAA,QAAA,KAAA,MAAA;;;;;;;;;AAWD,IAAaO,sBAAb,cAAyCJ,iBAAAA;CACrC,cAAc;EACV,MAAM;GACFK,MAAMR,WAAWS;GACjBC,QAAQL;GACRM,cAAcP,wBAAwBJ,WAAWS,aAAaG,SAAS,CACnEA,KAAKC,gBACLD,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"}
@@ -1,9 +1,6 @@
1
1
  import type { Role } from '@authup/core-kit';
2
- import type { EntitySubscriberInterface, InsertEvent, RemoveEvent, UpdateEvent } from 'typeorm';
3
- export declare class RoleSubscriber implements EntitySubscriberInterface<Role> {
4
- listenTo(): Function | string;
5
- afterInsert(event: InsertEvent<Role>): Promise<any>;
6
- afterUpdate(event: UpdateEvent<Role>): Promise<any>;
7
- afterRemove(event: RemoveEvent<Role>): Promise<any>;
2
+ import { EntitySubscriber } from '../../subscriber/index.ts';
3
+ export declare class RoleSubscriber extends EntitySubscriber<Role> {
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/role/subscriber.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAS7C,OAAO,KAAK,EACR,yBAAyB,EACzB,WAAW,EACX,WAAW,EACX,WAAW,EACd,MAAM,SAAS,CAAC;AA6BjB,qBACa,cAAe,YAAW,yBAAyB,CAAC,IAAI,CAAC;IAElE,QAAQ,IAAI,QAAQ,GAAG,MAAM;IAIvB,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAQnD,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAiBnD,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;CAgB5D"}
1
+ {"version":3,"file":"subscriber.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/database/domains/role/subscriber.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAI7C,OAAO,EAAE,gBAAgB,EAA2B,MAAM,2BAA2B,CAAC;AAItF,qBACa,cAAe,SAAQ,gBAAgB,CAAC,IAAI,CAAC;;CAgBzD"}
@@ -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 { RoleEntity } 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/role/subscriber.ts
12
12
  function _ts_decorate(decorators, target, key, desc) {
@@ -15,47 +15,27 @@ 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.ROLE, id) }];
20
- if (data.realm_id) destinations.push({
21
- channel: (id) => buildEntityChannelName(EntityType.ROLE, id),
22
- namespace: buildEntityNamespaceName(data.realm_id)
23
- });
24
- await publishDomainEvent({
25
- content: {
26
- type: EntityType.ROLE,
27
- event,
28
- data
29
- },
30
- destinations
31
- });
18
+ function _ts_metadata(k, v) {
19
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
32
20
  }
33
- var RoleSubscriber = class {
34
- listenTo() {
35
- return RoleEntity;
36
- }
37
- async afterInsert(event) {
38
- if (!event.entity) return;
39
- await publishEvent(EntityDefaultEventName.CREATED, event.entity);
40
- }
41
- async afterUpdate(event) {
42
- if (!event.entity) return;
43
- if (event.connection.queryResultCache) await event.connection.queryResultCache.remove([buildRedisKeyPath({
44
- prefix: CachePrefix.ROLE,
45
- key: event.entity.id
46
- })]);
47
- await publishEvent(EntityDefaultEventName.UPDATED, event.entity);
48
- }
49
- async afterRemove(event) {
50
- if (!event.entity) return;
51
- if (event.connection.queryResultCache) await event.connection.queryResultCache.remove([buildRedisKeyPath({
52
- prefix: CachePrefix.ROLE,
53
- key: event.entity.id
54
- })]);
55
- await publishEvent(EntityDefaultEventName.DELETED, event.entity);
21
+ var RoleSubscriber = class extends EntitySubscriber {
22
+ constructor() {
23
+ super({
24
+ type: EntityType.ROLE,
25
+ target: RoleEntity,
26
+ destinations: buildEntityDestinations(EntityType.ROLE, (data) => [data.realm_id]),
27
+ cache: { keys: (data) => [buildRedisKeyPath({
28
+ prefix: CachePrefix.ROLE,
29
+ key: data.id
30
+ })] }
31
+ });
56
32
  }
57
33
  };
58
- RoleSubscriber = _ts_decorate([EventSubscriber()], RoleSubscriber);
34
+ RoleSubscriber = _ts_decorate([
35
+ EventSubscriber(),
36
+ _ts_metadata("design:type", Function),
37
+ _ts_metadata("design:paramtypes", [])
38
+ ], RoleSubscriber);
59
39
  //#endregion
60
40
  export { RoleSubscriber };
61
41
 
@@ -1 +1 @@
1
- {"version":3,"file":"subscriber.mjs","names":["EntityDefaultEventName","EntityType","buildEntityChannelName","buildEntityNamespaceName","buildRedisKeyPath","EventSubscriber","publishDomainEvent","RoleEntity","CachePrefix","publishEvent","event","data","destinations","channel","id","ROLE","realm_id","push","namespace","content","type","RoleSubscriber","listenTo","afterInsert","entity","CREATED","afterUpdate","connection","queryResultCache","remove","prefix","key","UPDATED","afterRemove","DELETED"],"sources":["../../../../../src/adapters/database/domains/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 { Role } from '@authup/core-kit';\nimport {\n EntityDefaultEventName, \n EntityType,\n buildEntityChannelName,\n buildEntityNamespaceName,\n} from '@authup/core-kit';\nimport type { DomainEventDestinations } 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 { RoleEntity } from './entity.ts';\nimport { CachePrefix } from '../constants.ts';\n\nasync function publishEvent(\n event: `${EntityDefaultEventName}`,\n data: Role,\n) {\n const destinations : DomainEventDestinations = [\n { channel: (id) => buildEntityChannelName(EntityType.ROLE, id) },\n ];\n if (data.realm_id) {\n destinations.push({\n channel: (id) => buildEntityChannelName(EntityType.ROLE, id),\n namespace: buildEntityNamespaceName(data.realm_id),\n });\n }\n await publishDomainEvent({\n content: {\n type: EntityType.ROLE,\n event,\n data,\n },\n destinations,\n });\n}\n\n@EventSubscriber()\nexport class RoleSubscriber implements EntitySubscriberInterface<Role> {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n listenTo(): Function | string {\n return RoleEntity;\n }\n\n async afterInsert(event: InsertEvent<Role>): Promise<any> {\n if (!event.entity) {\n return;\n }\n\n await publishEvent(EntityDefaultEventName.CREATED, event.entity);\n }\n\n async afterUpdate(event: UpdateEvent<Role>): 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.ROLE,\n key: event.entity.id,\n }),\n ]);\n }\n\n await publishEvent(EntityDefaultEventName.UPDATED, event.entity as Role);\n }\n\n async afterRemove(event: RemoveEvent<Role>): 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.ROLE,\n key: event.entity.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,MAAU;CAEV,MAAMC,eAAyC,CAC3C,EAAEC,UAAUC,OAAOZ,uBAAuBD,WAAWc,MAAMD,EAAAA,EAAI,CAAA;CAEnE,IAAIH,KAAKK,UACLJ,aAAaK,KAAK;EACdJ,UAAUC,OAAOZ,uBAAuBD,WAAWc,MAAMD,EAAAA;EACzDI,WAAWf,yBAAyBQ,KAAKK,QAAQ;CACrD,CAAA;CAEJ,MAAMV,mBAAmB;EACrBa,SAAS;GACLC,MAAMnB,WAAWc;GACjBL;GACAC;EACJ;EACAC;CACJ,CAAA;AACJ;AAGA,IAAaS,iBAAb,MAAaA;CAETC,WAA8B;EAC1B,OAAOf;CACX;CAEA,MAAMgB,YAAYb,OAAwC;EACtD,IAAI,CAACA,MAAMc,QACP;EAGJ,MAAMf,aAAaT,uBAAuByB,SAASf,MAAMc,MAAM;CACnE;CAEA,MAAME,YAAYhB,OAAwC;EACtD,IAAI,CAACA,MAAMc,QACP;EAGJ,IAAId,MAAMiB,WAAWC,kBACjB,MAAMlB,MAAMiB,WAAWC,iBAAiBC,OAAO,CAC3CzB,kBAAkB;GACd0B,QAAQtB,YAAYO;GACpBgB,KAAKrB,MAAMc,OAAOV;EACtB,CAAA,CAAA,CACH;EAGL,MAAML,aAAaT,uBAAuBgC,SAAStB,MAAMc,MAAM;CACnE;CAEA,MAAMS,YAAYvB,OAAwC;EACtD,IAAI,CAACA,MAAMc,QACP;EAGJ,IAAId,MAAMiB,WAAWC,kBACjB,MAAMlB,MAAMiB,WAAWC,iBAAiBC,OAAO,CAC3CzB,kBAAkB;GACd0B,QAAQtB,YAAYO;GACpBgB,KAAKrB,MAAMc,OAAOV;EACtB,CAAA,CAAA,CACH;EAGL,MAAML,aAAaT,uBAAuBkC,SAASxB,MAAMc,MAAM;CACnE;AACJ"}
1
+ {"version":3,"file":"subscriber.mjs","names":["EntityType","buildRedisKeyPath","EventSubscriber","EntitySubscriber","buildEntityDestinations","RoleEntity","CachePrefix","RoleSubscriber","type","ROLE","target","destinations","data","realm_id","cache","keys","prefix","key","id"],"sources":["../../../../../src/adapters/database/domains/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 { Role } 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 { RoleEntity } from './entity.ts';\nimport { CachePrefix } from '../constants.ts';\n\n@EventSubscriber()\nexport class RoleSubscriber extends EntitySubscriber<Role> {\n constructor() {\n super({\n type: EntityType.ROLE,\n target: RoleEntity,\n destinations: buildEntityDestinations(EntityType.ROLE, (data) => [data.realm_id]),\n cache: {\n keys: (data) => [\n buildRedisKeyPath({\n prefix: CachePrefix.ROLE,\n key: data.id,\n }),\n ],\n },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;AAKC,SAAA,aAAA,YAAA,QAAA,KAAA,MAAA;;;;;;;;;AAWD,IAAaO,iBAAb,cAAoCJ,iBAAAA;CAChC,cAAc;EACV,MAAM;GACFK,MAAMR,WAAWS;GACjBC,QAAQL;GACRM,cAAcP,wBAAwBJ,WAAWS,OAAOG,SAAS,CAACA,KAAKC,QAAAA,CAAS;GAChFC,OAAO,EACHC,OAAOH,SAAS,CACZX,kBAAkB;IACde,QAAQV,YAAYG;IACpBQ,KAAKL,KAAKM;GACd,CAAA,CAAA,EAER;EACJ,CAAA;CACJ;AACJ"}
@@ -1,9 +1,6 @@
1
1
  import type { RoleAttribute } from '@authup/core-kit';
2
- import type { EntitySubscriberInterface, InsertEvent, RemoveEvent, UpdateEvent } from 'typeorm';
3
- export declare class RoleAttributeSubscriber implements EntitySubscriberInterface<RoleAttribute> {
4
- listenTo(): Function | string;
5
- afterInsert(event: InsertEvent<RoleAttribute>): Promise<any>;
6
- afterUpdate(event: UpdateEvent<RoleAttribute>): Promise<any>;
7
- afterRemove(event: RemoveEvent<RoleAttribute>): Promise<any>;
2
+ import { EntitySubscriber } from '../../subscriber/index.ts';
3
+ export declare class RoleAttributeSubscriber extends EntitySubscriber<RoleAttribute> {
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/role-attribute/subscriber.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAStD,OAAO,KAAK,EACR,yBAAyB,EACzB,WAAW,EACX,WAAW,EACX,WAAW,EACd,MAAM,SAAS,CAAC;AA8BjB,qBACa,uBAAwB,YAAW,yBAAyB,CAAC,aAAa,CAAC;IAEpF,QAAQ,IAAI,QAAQ,GAAG,MAAM;IAIvB,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAiB5D,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAiB5D,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;CAgBrE"}
1
+ {"version":3,"file":"subscriber.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/database/domains/role-attribute/subscriber.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAItD,OAAO,EAAE,gBAAgB,EAA2B,MAAM,2BAA2B,CAAC;AAItF,qBACa,uBAAwB,SAAQ,gBAAgB,CAAC,aAAa,CAAC;;CAiB3E"}
@@ -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 { RoleAttributeEntity } 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/role-attribute/subscriber.ts
12
12
  function _ts_decorate(decorators, target, key, desc) {
@@ -15,51 +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.ROLE_ATTRIBUTE, id) }];
20
- if (data.realm_id) destinations.push({
21
- channel: (id) => buildEntityChannelName(EntityType.ROLE_ATTRIBUTE, id),
22
- namespace: buildEntityNamespaceName(data.realm_id)
23
- });
24
- await publishDomainEvent({
25
- content: {
26
- type: EntityType.ROLE_ATTRIBUTE,
27
- event,
28
- data
29
- },
30
- destinations
31
- });
18
+ function _ts_metadata(k, v) {
19
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
32
20
  }
33
- var RoleAttributeSubscriber = class {
34
- listenTo() {
35
- return RoleAttributeEntity;
36
- }
37
- async afterInsert(event) {
38
- if (!event.entity) return;
39
- if (event.connection.queryResultCache) await event.connection.queryResultCache.remove([buildRedisKeyPath({
40
- prefix: CachePrefix.ROLE_OWNED_PERMISSIONS,
41
- key: event.entity.role_id
42
- })]);
43
- await publishEvent(EntityDefaultEventName.CREATED, event.entity);
44
- }
45
- async afterUpdate(event) {
46
- if (!event.entity) return;
47
- if (event.connection.queryResultCache) await event.connection.queryResultCache.remove([buildRedisKeyPath({
48
- prefix: CachePrefix.ROLE_OWNED_PERMISSIONS,
49
- key: event.entity.role_id
50
- })]);
51
- await publishEvent(EntityDefaultEventName.UPDATED, event.entity);
52
- }
53
- async afterRemove(event) {
54
- if (!event.entity) return;
55
- if (event.connection.queryResultCache) await event.connection.queryResultCache.remove([buildRedisKeyPath({
56
- prefix: CachePrefix.ROLE_OWNED_PERMISSIONS,
57
- key: event.entity.role_id
58
- })]);
59
- await publishEvent(EntityDefaultEventName.DELETED, event.entity);
21
+ var RoleAttributeSubscriber = class extends EntitySubscriber {
22
+ constructor() {
23
+ super({
24
+ type: EntityType.ROLE_ATTRIBUTE,
25
+ target: RoleAttributeEntity,
26
+ destinations: buildEntityDestinations(EntityType.ROLE_ATTRIBUTE, (data) => [data.realm_id]),
27
+ cache: {
28
+ onInsert: true,
29
+ keys: (data) => [buildRedisKeyPath({
30
+ prefix: CachePrefix.ROLE_OWNED_PERMISSIONS,
31
+ key: data.role_id
32
+ })]
33
+ }
34
+ });
60
35
  }
61
36
  };
62
- RoleAttributeSubscriber = _ts_decorate([EventSubscriber()], RoleAttributeSubscriber);
37
+ RoleAttributeSubscriber = _ts_decorate([
38
+ EventSubscriber(),
39
+ _ts_metadata("design:type", Function),
40
+ _ts_metadata("design:paramtypes", [])
41
+ ], RoleAttributeSubscriber);
63
42
  //#endregion
64
43
  export { RoleAttributeSubscriber };
65
44
 
@@ -1 +1 @@
1
- {"version":3,"file":"subscriber.mjs","names":["EntityDefaultEventName","EntityType","buildEntityChannelName","buildEntityNamespaceName","buildRedisKeyPath","EventSubscriber","publishDomainEvent","RoleAttributeEntity","CachePrefix","publishEvent","event","data","destinations","channel","id","ROLE_ATTRIBUTE","realm_id","push","namespace","content","type","RoleAttributeSubscriber","listenTo","afterInsert","entity","connection","queryResultCache","remove","prefix","ROLE_OWNED_PERMISSIONS","key","role_id","CREATED","afterUpdate","UPDATED","afterRemove","DELETED"],"sources":["../../../../../src/adapters/database/domains/role-attribute/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 { RoleAttribute } from '@authup/core-kit';\nimport {\n EntityDefaultEventName, \n EntityType, \n buildEntityChannelName, \n buildEntityNamespaceName,\n} from '@authup/core-kit';\nimport type { DomainEventDestinations } 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 { RoleAttributeEntity } from './entity.ts';\nimport { CachePrefix } from '../constants.ts';\n\nasync function publishEvent(\n event: `${EntityDefaultEventName}`,\n data: RoleAttribute,\n) {\n const destinations : DomainEventDestinations = [\n { channel: (id) => buildEntityChannelName(EntityType.ROLE_ATTRIBUTE, id) },\n ];\n if (data.realm_id) {\n destinations.push({\n channel: (id) => buildEntityChannelName(EntityType.ROLE_ATTRIBUTE, id),\n namespace: buildEntityNamespaceName(data.realm_id),\n });\n }\n\n await publishDomainEvent({\n content: {\n type: EntityType.ROLE_ATTRIBUTE,\n event,\n data,\n },\n destinations,\n });\n}\n\n@EventSubscriber()\nexport class RoleAttributeSubscriber implements EntitySubscriberInterface<RoleAttribute> {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n listenTo(): Function | string {\n return RoleAttributeEntity;\n }\n\n async afterInsert(event: InsertEvent<RoleAttribute>): 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.ROLE_OWNED_PERMISSIONS,\n key: event.entity.role_id,\n }),\n ]);\n }\n\n await publishEvent(EntityDefaultEventName.CREATED, event.entity);\n }\n\n async afterUpdate(event: UpdateEvent<RoleAttribute>): 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.ROLE_OWNED_PERMISSIONS,\n key: event.entity.role_id,\n }),\n ]);\n }\n\n await publishEvent(EntityDefaultEventName.UPDATED, event.entity as RoleAttribute);\n }\n\n async afterRemove(event: RemoveEvent<RoleAttribute>): 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.ROLE_OWNED_PERMISSIONS,\n key: event.entity.role_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,MAAmB;CAEnB,MAAMC,eAAyC,CAC3C,EAAEC,UAAUC,OAAOZ,uBAAuBD,WAAWc,gBAAgBD,EAAAA,EAAI,CAAA;CAE7E,IAAIH,KAAKK,UACLJ,aAAaK,KAAK;EACdJ,UAAUC,OAAOZ,uBAAuBD,WAAWc,gBAAgBD,EAAAA;EACnEI,WAAWf,yBAAyBQ,KAAKK,QAAQ;CACrD,CAAA;CAGJ,MAAMV,mBAAmB;EACrBa,SAAS;GACLC,MAAMnB,WAAWc;GACjBL;GACAC;EACJ;EACAC;CACJ,CAAA;AACJ;AAGA,IAAaS,0BAAb,MAAaA;CAETC,WAA8B;EAC1B,OAAOf;CACX;CAEA,MAAMgB,YAAYb,OAAiD;EAC/D,IAAI,CAACA,MAAMc,QACP;EAGJ,IAAId,MAAMe,WAAWC,kBACjB,MAAMhB,MAAMe,WAAWC,iBAAiBC,OAAO,CAC3CvB,kBAAkB;GACdwB,QAAQpB,YAAYqB;GACpBC,KAAKpB,MAAMc,OAAOO;EACtB,CAAA,CAAA,CACH;EAGL,MAAMtB,aAAaT,uBAAuBgC,SAAStB,MAAMc,MAAM;CACnE;CAEA,MAAMS,YAAYvB,OAAiD;EAC/D,IAAI,CAACA,MAAMc,QACP;EAGJ,IAAId,MAAMe,WAAWC,kBACjB,MAAMhB,MAAMe,WAAWC,iBAAiBC,OAAO,CAC3CvB,kBAAkB;GACdwB,QAAQpB,YAAYqB;GACpBC,KAAKpB,MAAMc,OAAOO;EACtB,CAAA,CAAA,CACH;EAGL,MAAMtB,aAAaT,uBAAuBkC,SAASxB,MAAMc,MAAM;CACnE;CAEA,MAAMW,YAAYzB,OAAiD;EAC/D,IAAI,CAACA,MAAMc,QACP;EAGJ,IAAId,MAAMe,WAAWC,kBACjB,MAAMhB,MAAMe,WAAWC,iBAAiBC,OAAO,CAC3CvB,kBAAkB;GACdwB,QAAQpB,YAAYqB;GACpBC,KAAKpB,MAAMc,OAAOO;EACtB,CAAA,CAAA,CACH;EAGL,MAAMtB,aAAaT,uBAAuBoC,SAAS1B,MAAMc,MAAM;CACnE;AACJ"}
1
+ {"version":3,"file":"subscriber.mjs","names":["EntityType","buildRedisKeyPath","EventSubscriber","EntitySubscriber","buildEntityDestinations","RoleAttributeEntity","CachePrefix","RoleAttributeSubscriber","type","ROLE_ATTRIBUTE","target","destinations","data","realm_id","cache","onInsert","keys","prefix","ROLE_OWNED_PERMISSIONS","key","role_id"],"sources":["../../../../../src/adapters/database/domains/role-attribute/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 { RoleAttribute } 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 { RoleAttributeEntity } from './entity.ts';\nimport { CachePrefix } from '../constants.ts';\n\n@EventSubscriber()\nexport class RoleAttributeSubscriber extends EntitySubscriber<RoleAttribute> {\n constructor() {\n super({\n type: EntityType.ROLE_ATTRIBUTE,\n target: RoleAttributeEntity,\n destinations: buildEntityDestinations(EntityType.ROLE_ATTRIBUTE, (data) => [data.realm_id]),\n cache: {\n onInsert: true,\n keys: (data) => [\n buildRedisKeyPath({\n prefix: CachePrefix.ROLE_OWNED_PERMISSIONS,\n key: data.role_id,\n }),\n ],\n },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;AAKC,SAAA,aAAA,YAAA,QAAA,KAAA,MAAA;;;;;;;;;AAWD,IAAaO,0BAAb,cAA6CJ,iBAAAA;CACzC,cAAc;EACV,MAAM;GACFK,MAAMR,WAAWS;GACjBC,QAAQL;GACRM,cAAcP,wBAAwBJ,WAAWS,iBAAiBG,SAAS,CAACA,KAAKC,QAAAA,CAAS;GAC1FC,OAAO;IACHC,UAAU;IACVC,OAAOJ,SAAS,CACZX,kBAAkB;KACdgB,QAAQX,YAAYY;KACpBC,KAAKP,KAAKQ;IACd,CAAA,CAAA;GAER;EACJ,CAAA;CACJ;AACJ"}
@@ -1,9 +1,6 @@
1
1
  import type { RolePermission } from '@authup/core-kit';
2
- import type { EntitySubscriberInterface, InsertEvent, RemoveEvent, UpdateEvent } from 'typeorm';
3
- export declare class RolePermissionSubscriber implements EntitySubscriberInterface<RolePermission> {
4
- listenTo(): Function | string;
5
- afterInsert(event: InsertEvent<RolePermission>): Promise<any>;
6
- afterUpdate(event: UpdateEvent<RolePermission>): Promise<any>;
7
- afterRemove(event: RemoveEvent<RolePermission>): Promise<any>;
2
+ import { EntitySubscriber } from '../../subscriber/index.ts';
3
+ export declare class RolePermissionSubscriber extends EntitySubscriber<RolePermission> {
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/role-permission/subscriber.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AASvD,OAAO,KAAK,EACR,yBAAyB,EACzB,WAAW,EACX,WAAW,EACX,WAAW,EACd,MAAM,SAAS,CAAC;AAoCjB,qBACa,wBAAyB,YAAW,yBAAyB,CAAC,cAAc,CAAC;IAEtF,QAAQ,IAAI,QAAQ,GAAG,MAAM;IAIvB,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAiB7D,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAiB7D,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;CAgBtE"}
1
+ {"version":3,"file":"subscriber.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/database/domains/role-permission/subscriber.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,gBAAgB,EAA2B,MAAM,2BAA2B,CAAC;AAItF,qBACa,wBAAyB,SAAQ,gBAAgB,CAAC,cAAc,CAAC;;CAoB7E"}