@authup/server-core 1.0.0-beta.59 → 1.0.0-beta.60

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 (409) hide show
  1. package/dist/adapters/database/domains/client/entity.d.ts.map +1 -1
  2. package/dist/adapters/database/domains/client/entity.mjs +58 -30
  3. package/dist/adapters/database/domains/client/entity.mjs.map +1 -1
  4. package/dist/adapters/database/domains/client-permission/entity.d.ts.map +1 -1
  5. package/dist/adapters/database/domains/client-permission/entity.mjs +48 -24
  6. package/dist/adapters/database/domains/client-permission/entity.mjs.map +1 -1
  7. package/dist/adapters/database/domains/client-role/entity.d.ts.map +1 -1
  8. package/dist/adapters/database/domains/client-role/entity.mjs +37 -17
  9. package/dist/adapters/database/domains/client-role/entity.mjs.map +1 -1
  10. package/dist/adapters/database/domains/client-scope/entity.d.ts.map +1 -1
  11. package/dist/adapters/database/domains/client-scope/entity.mjs +30 -14
  12. package/dist/adapters/database/domains/client-scope/entity.mjs.map +1 -1
  13. package/dist/adapters/database/domains/consent/entity.d.ts.map +1 -1
  14. package/dist/adapters/database/domains/consent/entity.mjs +34 -18
  15. package/dist/adapters/database/domains/consent/entity.mjs.map +1 -1
  16. package/dist/adapters/database/domains/event/entity.d.ts +1 -0
  17. package/dist/adapters/database/domains/event/entity.d.ts.map +1 -1
  18. package/dist/adapters/database/domains/event/entity.mjs +48 -23
  19. package/dist/adapters/database/domains/event/entity.mjs.map +1 -1
  20. package/dist/adapters/database/domains/identity-provider/entity.d.ts.map +1 -1
  21. package/dist/adapters/database/domains/identity-provider/entity.mjs +43 -23
  22. package/dist/adapters/database/domains/identity-provider/entity.mjs.map +1 -1
  23. package/dist/adapters/database/domains/identity-provider-account/entity.d.ts.map +1 -1
  24. package/dist/adapters/database/domains/identity-provider-account/entity.mjs +50 -22
  25. package/dist/adapters/database/domains/identity-provider-account/entity.mjs.map +1 -1
  26. package/dist/adapters/database/domains/identity-provider-attribute/entity.d.ts.map +1 -1
  27. package/dist/adapters/database/domains/identity-provider-attribute/entity.mjs +14 -6
  28. package/dist/adapters/database/domains/identity-provider-attribute/entity.mjs.map +1 -1
  29. package/dist/adapters/database/domains/identity-provider-attribute-mapping/entity.d.ts.map +1 -1
  30. package/dist/adapters/database/domains/identity-provider-attribute-mapping/entity.mjs +5 -1
  31. package/dist/adapters/database/domains/identity-provider-attribute-mapping/entity.mjs.map +1 -1
  32. package/dist/adapters/database/domains/identity-provider-permission-mapping/entity.d.ts.map +1 -1
  33. package/dist/adapters/database/domains/identity-provider-permission-mapping/entity.mjs +18 -6
  34. package/dist/adapters/database/domains/identity-provider-permission-mapping/entity.mjs.map +1 -1
  35. package/dist/adapters/database/domains/identity-provider-role-mapping/entity.d.ts.map +1 -1
  36. package/dist/adapters/database/domains/identity-provider-role-mapping/entity.mjs +34 -14
  37. package/dist/adapters/database/domains/identity-provider-role-mapping/entity.mjs.map +1 -1
  38. package/dist/adapters/database/domains/key/entity.d.ts.map +1 -1
  39. package/dist/adapters/database/domains/key/entity.mjs +35 -19
  40. package/dist/adapters/database/domains/key/entity.mjs.map +1 -1
  41. package/dist/adapters/database/domains/permission/entity.d.ts.map +1 -1
  42. package/dist/adapters/database/domains/permission/entity.mjs +35 -19
  43. package/dist/adapters/database/domains/permission/entity.mjs.map +1 -1
  44. package/dist/adapters/database/domains/permission-policy/entity.d.ts.map +1 -1
  45. package/dist/adapters/database/domains/permission-policy/entity.mjs +37 -17
  46. package/dist/adapters/database/domains/permission-policy/entity.mjs.map +1 -1
  47. package/dist/adapters/database/domains/policy/entity.d.ts.map +1 -1
  48. package/dist/adapters/database/domains/policy/entity.mjs +51 -27
  49. package/dist/adapters/database/domains/policy/entity.mjs.map +1 -1
  50. package/dist/adapters/database/domains/policy-attribute/entity.d.ts.map +1 -1
  51. package/dist/adapters/database/domains/policy-attribute/entity.mjs +14 -6
  52. package/dist/adapters/database/domains/policy-attribute/entity.mjs.map +1 -1
  53. package/dist/adapters/database/domains/realm/entity.d.ts.map +1 -1
  54. package/dist/adapters/database/domains/realm/entity.mjs +36 -20
  55. package/dist/adapters/database/domains/realm/entity.mjs.map +1 -1
  56. package/dist/adapters/database/domains/role/entity.d.ts.map +1 -1
  57. package/dist/adapters/database/domains/role/entity.mjs +44 -24
  58. package/dist/adapters/database/domains/role/entity.mjs.map +1 -1
  59. package/dist/adapters/database/domains/role-attribute/entity.d.ts.map +1 -1
  60. package/dist/adapters/database/domains/role-attribute/entity.mjs +30 -14
  61. package/dist/adapters/database/domains/role-attribute/entity.mjs.map +1 -1
  62. package/dist/adapters/database/domains/role-permission/entity.d.ts.map +1 -1
  63. package/dist/adapters/database/domains/role-permission/entity.mjs +45 -21
  64. package/dist/adapters/database/domains/role-permission/entity.mjs.map +1 -1
  65. package/dist/adapters/database/domains/scope/entity.d.ts.map +1 -1
  66. package/dist/adapters/database/domains/scope/entity.mjs +35 -19
  67. package/dist/adapters/database/domains/scope/entity.mjs.map +1 -1
  68. package/dist/adapters/database/domains/session/entity.d.ts.map +1 -1
  69. package/dist/adapters/database/domains/session/entity.mjs +63 -31
  70. package/dist/adapters/database/domains/session/entity.mjs.map +1 -1
  71. package/dist/adapters/database/domains/session-token/entity.d.ts +4 -1
  72. package/dist/adapters/database/domains/session-token/entity.d.ts.map +1 -1
  73. package/dist/adapters/database/domains/session-token/entity.mjs +40 -11
  74. package/dist/adapters/database/domains/session-token/entity.mjs.map +1 -1
  75. package/dist/adapters/database/domains/trust-anchor/entity.d.ts.map +1 -1
  76. package/dist/adapters/database/domains/trust-anchor/entity.mjs +25 -13
  77. package/dist/adapters/database/domains/trust-anchor/entity.mjs.map +1 -1
  78. package/dist/adapters/database/domains/user/entity.d.ts.map +1 -1
  79. package/dist/adapters/database/domains/user/entity.mjs +58 -34
  80. package/dist/adapters/database/domains/user/entity.mjs.map +1 -1
  81. package/dist/adapters/database/domains/user-attribute/entity.d.ts.map +1 -1
  82. package/dist/adapters/database/domains/user-attribute/entity.mjs +27 -11
  83. package/dist/adapters/database/domains/user-attribute/entity.mjs.map +1 -1
  84. package/dist/adapters/database/domains/user-authenticator/entity.d.ts.map +1 -1
  85. package/dist/adapters/database/domains/user-authenticator/entity.mjs +43 -23
  86. package/dist/adapters/database/domains/user-authenticator/entity.mjs.map +1 -1
  87. package/dist/adapters/database/domains/user-permission/entity.d.ts.map +1 -1
  88. package/dist/adapters/database/domains/user-permission/entity.mjs +45 -21
  89. package/dist/adapters/database/domains/user-permission/entity.mjs.map +1 -1
  90. package/dist/adapters/database/domains/user-role/entity.d.ts.map +1 -1
  91. package/dist/adapters/database/domains/user-role/entity.mjs +37 -17
  92. package/dist/adapters/database/domains/user-role/entity.mjs.map +1 -1
  93. package/dist/adapters/database/errors/driver.d.ts +9 -0
  94. package/dist/adapters/database/errors/driver.d.ts.map +1 -1
  95. package/dist/adapters/database/errors/driver.mjs +20 -1
  96. package/dist/adapters/database/errors/driver.mjs.map +1 -1
  97. package/dist/adapters/database/errors/index.mjs +2 -2
  98. package/dist/adapters/database/helpers/index.mjs +2 -2
  99. package/dist/adapters/database/helpers/is-supported.d.ts +7 -0
  100. package/dist/adapters/database/helpers/is-supported.d.ts.map +1 -1
  101. package/dist/adapters/database/helpers/is-supported.mjs +9 -1
  102. package/dist/adapters/database/helpers/is-supported.mjs.map +1 -1
  103. package/dist/adapters/database/index.mjs +3 -3
  104. package/dist/adapters/database/migrations/mysql/1785871780234-AlignSchemaWithEntityMetadata.d.ts +66 -0
  105. package/dist/adapters/database/migrations/mysql/1785871780234-AlignSchemaWithEntityMetadata.d.ts.map +1 -0
  106. package/dist/adapters/database/migrations/mysql/1785871780234-AlignSchemaWithEntityMetadata.mjs +181 -0
  107. package/dist/adapters/database/migrations/mysql/1785871780234-AlignSchemaWithEntityMetadata.mjs.map +1 -0
  108. package/dist/adapters/database/migrations/mysql/1786436332251-QueryIndexes.d.ts +44 -0
  109. package/dist/adapters/database/migrations/mysql/1786436332251-QueryIndexes.d.ts.map +1 -0
  110. package/dist/adapters/database/migrations/mysql/1786436332251-QueryIndexes.mjs +1294 -0
  111. package/dist/adapters/database/migrations/mysql/1786436332251-QueryIndexes.mjs.map +1 -0
  112. package/dist/adapters/database/migrations/postgres/1785871780234-AlignSchemaWithEntityMetadata.d.ts +43 -0
  113. package/dist/adapters/database/migrations/postgres/1785871780234-AlignSchemaWithEntityMetadata.d.ts.map +1 -0
  114. package/dist/adapters/database/migrations/postgres/1785871780234-AlignSchemaWithEntityMetadata.mjs +120 -0
  115. package/dist/adapters/database/migrations/postgres/1785871780234-AlignSchemaWithEntityMetadata.mjs.map +1 -0
  116. package/dist/adapters/database/migrations/postgres/1786436332251-QueryIndexes.d.ts +44 -0
  117. package/dist/adapters/database/migrations/postgres/1786436332251-QueryIndexes.d.ts.map +1 -0
  118. package/dist/adapters/database/migrations/postgres/1786436332251-QueryIndexes.mjs +987 -0
  119. package/dist/adapters/database/migrations/postgres/1786436332251-QueryIndexes.mjs.map +1 -0
  120. package/dist/adapters/http/controllers/entities/identity-provider/module.d.ts +14 -2
  121. package/dist/adapters/http/controllers/entities/identity-provider/module.d.ts.map +1 -1
  122. package/dist/adapters/http/controllers/entities/identity-provider/module.mjs +85 -19
  123. package/dist/adapters/http/controllers/entities/identity-provider/module.mjs.map +1 -1
  124. package/dist/adapters/http/controllers/entities/identity-provider/types.d.ts +4 -1
  125. package/dist/adapters/http/controllers/entities/identity-provider/types.d.ts.map +1 -1
  126. package/dist/adapters/http/controllers/entities/identity-provider-account/index.d.ts.map +1 -0
  127. package/dist/adapters/http/controllers/entities/identity-provider-account/index.mjs +5 -0
  128. package/dist/adapters/http/controllers/entities/identity-provider-account/module.d.ts +15 -0
  129. package/dist/adapters/http/controllers/entities/identity-provider-account/module.d.ts.map +1 -0
  130. package/dist/adapters/http/controllers/entities/identity-provider-account/module.mjs +94 -0
  131. package/dist/adapters/http/controllers/entities/identity-provider-account/module.mjs.map +1 -0
  132. package/dist/adapters/http/controllers/entities/index.d.ts +2 -0
  133. package/dist/adapters/http/controllers/entities/index.d.ts.map +1 -1
  134. package/dist/adapters/http/controllers/entities/index.mjs +5 -1
  135. package/dist/adapters/http/controllers/entities/session-token/index.d.ts +2 -0
  136. package/dist/adapters/http/controllers/entities/session-token/index.d.ts.map +1 -0
  137. package/dist/adapters/http/controllers/entities/session-token/index.mjs +5 -0
  138. package/dist/adapters/http/controllers/entities/session-token/module.d.ts +23 -0
  139. package/dist/adapters/http/controllers/entities/session-token/module.d.ts.map +1 -0
  140. package/dist/adapters/http/controllers/entities/session-token/module.mjs +112 -0
  141. package/dist/adapters/http/controllers/entities/session-token/module.mjs.map +1 -0
  142. package/dist/adapters/http/controllers/index.mjs +3 -1
  143. package/dist/adapters/http/controllers/workflows/authenticator-challenge/module.d.ts.map +1 -1
  144. package/dist/adapters/http/controllers/workflows/authenticator-challenge/module.mjs +1 -0
  145. package/dist/adapters/http/controllers/workflows/authenticator-challenge/module.mjs.map +1 -1
  146. package/dist/adapters/http/index.mjs +3 -1
  147. package/dist/adapters/http/middleware/built-in/error.d.ts.map +1 -1
  148. package/dist/adapters/http/middleware/built-in/error.mjs +4 -3
  149. package/dist/adapters/http/middleware/built-in/error.mjs.map +1 -1
  150. package/dist/adapters/http/request/event-context.d.ts.map +1 -1
  151. package/dist/adapters/http/request/event-context.mjs +2 -0
  152. package/dist/adapters/http/request/event-context.mjs.map +1 -1
  153. package/dist/app/index.mjs +2 -2
  154. package/dist/app/modules/database/index.mjs +2 -1
  155. package/dist/app/modules/database/repositories/identity-provider-account/index.d.ts +2 -0
  156. package/dist/app/modules/database/repositories/identity-provider-account/index.d.ts.map +1 -0
  157. package/dist/app/modules/database/repositories/identity-provider-account/index.mjs +5 -0
  158. package/dist/app/modules/database/repositories/identity-provider-account/repository.d.ts +18 -0
  159. package/dist/app/modules/database/repositories/identity-provider-account/repository.d.ts.map +1 -0
  160. package/dist/app/modules/database/repositories/identity-provider-account/repository.mjs +69 -0
  161. package/dist/app/modules/database/repositories/identity-provider-account/repository.mjs.map +1 -0
  162. package/dist/app/modules/database/repositories/index.d.ts +1 -0
  163. package/dist/app/modules/database/repositories/index.d.ts.map +1 -1
  164. package/dist/app/modules/database/repositories/index.mjs +3 -1
  165. package/dist/app/modules/database/repositories/key/repository.d.ts +23 -0
  166. package/dist/app/modules/database/repositories/key/repository.d.ts.map +1 -1
  167. package/dist/app/modules/database/repositories/key/repository.mjs +39 -3
  168. package/dist/app/modules/database/repositories/key/repository.mjs.map +1 -1
  169. package/dist/app/modules/database/repositories/schema-validation.d.ts +14 -6
  170. package/dist/app/modules/database/repositories/schema-validation.d.ts.map +1 -1
  171. package/dist/app/modules/database/repositories/schema-validation.mjs +18 -6
  172. package/dist/app/modules/database/repositories/schema-validation.mjs.map +1 -1
  173. package/dist/app/modules/http/modules/controller.d.ts +3 -1
  174. package/dist/app/modules/http/modules/controller.d.ts.map +1 -1
  175. package/dist/app/modules/http/modules/controller.mjs +37 -1
  176. package/dist/app/modules/http/modules/controller.mjs.map +1 -1
  177. package/dist/app/modules/identity/index.mjs +1 -2
  178. package/dist/app/modules/identity/module.d.ts.map +1 -1
  179. package/dist/app/modules/identity/module.mjs +2 -2
  180. package/dist/app/modules/identity/module.mjs.map +1 -1
  181. package/dist/app/modules/identity/repositories/index.mjs +1 -2
  182. package/dist/app/modules/identity/repositories/provider/index.d.ts +0 -1
  183. package/dist/app/modules/identity/repositories/provider/index.d.ts.map +1 -1
  184. package/dist/app/modules/identity/repositories/provider/index.mjs +1 -3
  185. package/dist/app/modules/index.mjs +2 -2
  186. package/dist/app/modules/logger/module.d.ts.map +1 -1
  187. package/dist/app/modules/logger/module.mjs +1 -0
  188. package/dist/app/modules/logger/module.mjs.map +1 -1
  189. package/dist/app/modules/oauth2/repositories/session-token/repository.d.ts +25 -1
  190. package/dist/app/modules/oauth2/repositories/session-token/repository.d.ts.map +1 -1
  191. package/dist/app/modules/oauth2/repositories/session-token/repository.mjs +70 -1
  192. package/dist/app/modules/oauth2/repositories/session-token/repository.mjs.map +1 -1
  193. package/dist/app/modules/provisioning/module.d.ts.map +1 -1
  194. package/dist/app/modules/provisioning/module.mjs +3 -1
  195. package/dist/app/modules/provisioning/module.mjs.map +1 -1
  196. package/dist/app/modules/provisioning/sources/default/module.d.ts.map +1 -1
  197. package/dist/app/modules/provisioning/sources/default/module.mjs +1 -0
  198. package/dist/app/modules/provisioning/sources/default/module.mjs.map +1 -1
  199. package/dist/core/entities/client/schema.d.ts.map +1 -1
  200. package/dist/core/entities/client/schema.mjs +29 -10
  201. package/dist/core/entities/client/schema.mjs.map +1 -1
  202. package/dist/core/entities/client-permission/schema.d.ts.map +1 -1
  203. package/dist/core/entities/client-permission/schema.mjs +29 -6
  204. package/dist/core/entities/client-permission/schema.mjs.map +1 -1
  205. package/dist/core/entities/client-role/schema.d.ts.map +1 -1
  206. package/dist/core/entities/client-role/schema.mjs +27 -6
  207. package/dist/core/entities/client-role/schema.mjs.map +1 -1
  208. package/dist/core/entities/client-scope/schema.d.ts.map +1 -1
  209. package/dist/core/entities/client-scope/schema.mjs +19 -5
  210. package/dist/core/entities/client-scope/schema.mjs.map +1 -1
  211. package/dist/core/entities/consent/schema.d.ts.map +1 -1
  212. package/dist/core/entities/consent/schema.mjs +28 -6
  213. package/dist/core/entities/consent/schema.mjs.map +1 -1
  214. package/dist/core/entities/event/entity-event-handler.d.ts.map +1 -1
  215. package/dist/core/entities/event/entity-event-handler.mjs +2 -0
  216. package/dist/core/entities/event/entity-event-handler.mjs.map +1 -1
  217. package/dist/core/entities/event/sanitize.d.ts.map +1 -1
  218. package/dist/core/entities/event/sanitize.mjs +7 -4
  219. package/dist/core/entities/event/sanitize.mjs.map +1 -1
  220. package/dist/core/entities/event/schema.d.ts.map +1 -1
  221. package/dist/core/entities/event/schema.mjs +45 -16
  222. package/dist/core/entities/event/schema.mjs.map +1 -1
  223. package/dist/core/entities/event/service.d.ts.map +1 -1
  224. package/dist/core/entities/event/service.mjs +2 -0
  225. package/dist/core/entities/event/service.mjs.map +1 -1
  226. package/dist/core/entities/event/types.d.ts +2 -0
  227. package/dist/core/entities/event/types.d.ts.map +1 -1
  228. package/dist/core/entities/identity-provider/schema.d.ts.map +1 -1
  229. package/dist/core/entities/identity-provider/schema.mjs +29 -11
  230. package/dist/core/entities/identity-provider/schema.mjs.map +1 -1
  231. package/dist/core/entities/identity-provider-account/error.d.ts +7 -0
  232. package/dist/core/entities/identity-provider-account/error.d.ts.map +1 -0
  233. package/dist/core/entities/identity-provider-account/error.mjs +24 -0
  234. package/dist/core/entities/identity-provider-account/error.mjs.map +1 -0
  235. package/dist/core/entities/identity-provider-account/index.d.ts +5 -0
  236. package/dist/core/entities/identity-provider-account/index.d.ts.map +1 -0
  237. package/dist/core/entities/identity-provider-account/index.mjs +8 -0
  238. package/dist/core/entities/identity-provider-account/schema.d.ts +3 -0
  239. package/dist/core/entities/identity-provider-account/schema.d.ts.map +1 -0
  240. package/dist/core/entities/identity-provider-account/schema.mjs +52 -0
  241. package/dist/core/entities/identity-provider-account/schema.mjs.map +1 -0
  242. package/dist/core/entities/identity-provider-account/service.d.ts +24 -0
  243. package/dist/core/entities/identity-provider-account/service.d.ts.map +1 -0
  244. package/dist/core/entities/identity-provider-account/service.mjs +129 -0
  245. package/dist/core/entities/identity-provider-account/service.mjs.map +1 -0
  246. package/dist/core/entities/identity-provider-account/types.d.ts +69 -0
  247. package/dist/core/entities/identity-provider-account/types.d.ts.map +1 -0
  248. package/dist/core/entities/identity-provider-account/types.mjs +17 -0
  249. package/dist/core/entities/identity-provider-account/types.mjs.map +1 -0
  250. package/dist/core/entities/identity-provider-role-mapping/schema.d.ts.map +1 -1
  251. package/dist/core/entities/identity-provider-role-mapping/schema.mjs +27 -6
  252. package/dist/core/entities/identity-provider-role-mapping/schema.mjs.map +1 -1
  253. package/dist/core/entities/index.d.ts +2 -0
  254. package/dist/core/entities/index.d.ts.map +1 -1
  255. package/dist/core/entities/index.mjs +9 -1
  256. package/dist/core/entities/key/schema.d.ts.map +1 -1
  257. package/dist/core/entities/key/schema.mjs +39 -17
  258. package/dist/core/entities/key/schema.mjs.map +1 -1
  259. package/dist/core/entities/key/service.d.ts.map +1 -1
  260. package/dist/core/entities/key/service.mjs +1 -0
  261. package/dist/core/entities/key/service.mjs.map +1 -1
  262. package/dist/core/entities/permission/schema.d.ts.map +1 -1
  263. package/dist/core/entities/permission/schema.mjs +34 -13
  264. package/dist/core/entities/permission/schema.mjs.map +1 -1
  265. package/dist/core/entities/permission-policy/schema.d.ts.map +1 -1
  266. package/dist/core/entities/permission-policy/schema.mjs +27 -6
  267. package/dist/core/entities/permission-policy/schema.mjs.map +1 -1
  268. package/dist/core/entities/policy/schema.d.ts.map +1 -1
  269. package/dist/core/entities/policy/schema.mjs +31 -12
  270. package/dist/core/entities/policy/schema.mjs.map +1 -1
  271. package/dist/core/entities/realm/schema.d.ts.map +1 -1
  272. package/dist/core/entities/realm/schema.mjs +26 -12
  273. package/dist/core/entities/realm/schema.mjs.map +1 -1
  274. package/dist/core/entities/role/schema.d.ts.map +1 -1
  275. package/dist/core/entities/role/schema.mjs +36 -14
  276. package/dist/core/entities/role/schema.mjs.map +1 -1
  277. package/dist/core/entities/role-attribute/schema.d.ts.map +1 -1
  278. package/dist/core/entities/role-attribute/schema.mjs +28 -14
  279. package/dist/core/entities/role-attribute/schema.mjs.map +1 -1
  280. package/dist/core/entities/role-permission/schema.d.ts.map +1 -1
  281. package/dist/core/entities/role-permission/schema.mjs +29 -6
  282. package/dist/core/entities/role-permission/schema.mjs.map +1 -1
  283. package/dist/core/entities/scope/schema.d.ts.map +1 -1
  284. package/dist/core/entities/scope/schema.mjs +28 -12
  285. package/dist/core/entities/scope/schema.mjs.map +1 -1
  286. package/dist/core/entities/session/schema.d.ts.map +1 -1
  287. package/dist/core/entities/session/schema.mjs +41 -9
  288. package/dist/core/entities/session/schema.mjs.map +1 -1
  289. package/dist/core/entities/session-token/index.d.ts +4 -0
  290. package/dist/core/entities/session-token/index.d.ts.map +1 -0
  291. package/dist/core/entities/session-token/index.mjs +6 -0
  292. package/dist/core/entities/session-token/schema.d.ts +12 -0
  293. package/dist/core/entities/session-token/schema.d.ts.map +1 -0
  294. package/dist/core/entities/session-token/schema.mjs +66 -0
  295. package/dist/core/entities/session-token/schema.mjs.map +1 -0
  296. package/dist/core/entities/session-token/service.d.ts +70 -0
  297. package/dist/core/entities/session-token/service.d.ts.map +1 -0
  298. package/dist/core/entities/session-token/service.mjs +216 -0
  299. package/dist/core/entities/session-token/service.mjs.map +1 -0
  300. package/dist/core/entities/session-token/types.d.ts +37 -0
  301. package/dist/core/entities/session-token/types.d.ts.map +1 -0
  302. package/dist/core/entities/session-token/types.mjs +4 -0
  303. package/dist/core/entities/trust-anchor/schema.d.ts.map +1 -1
  304. package/dist/core/entities/trust-anchor/schema.mjs +27 -13
  305. package/dist/core/entities/trust-anchor/schema.mjs.map +1 -1
  306. package/dist/core/entities/trust-anchor/service.d.ts.map +1 -1
  307. package/dist/core/entities/trust-anchor/service.mjs +1 -0
  308. package/dist/core/entities/trust-anchor/service.mjs.map +1 -1
  309. package/dist/core/entities/user/schema.d.ts.map +1 -1
  310. package/dist/core/entities/user/schema.mjs +29 -12
  311. package/dist/core/entities/user/schema.mjs.map +1 -1
  312. package/dist/core/entities/user-attribute/schema.d.ts.map +1 -1
  313. package/dist/core/entities/user-attribute/schema.mjs +28 -14
  314. package/dist/core/entities/user-attribute/schema.mjs.map +1 -1
  315. package/dist/core/entities/user-authenticator/schema.d.ts.map +1 -1
  316. package/dist/core/entities/user-authenticator/schema.mjs +29 -12
  317. package/dist/core/entities/user-authenticator/schema.mjs.map +1 -1
  318. package/dist/core/entities/user-authenticator/service.d.ts +2 -1
  319. package/dist/core/entities/user-authenticator/service.d.ts.map +1 -1
  320. package/dist/core/entities/user-authenticator/service.mjs +5 -0
  321. package/dist/core/entities/user-authenticator/service.mjs.map +1 -1
  322. package/dist/core/entities/user-authenticator/types.d.ts +7 -1
  323. package/dist/core/entities/user-authenticator/types.d.ts.map +1 -1
  324. package/dist/core/entities/user-authenticator/types.mjs.map +1 -1
  325. package/dist/core/entities/user-permission/schema.d.ts.map +1 -1
  326. package/dist/core/entities/user-permission/schema.mjs +29 -6
  327. package/dist/core/entities/user-permission/schema.mjs.map +1 -1
  328. package/dist/core/entities/user-role/schema.d.ts.map +1 -1
  329. package/dist/core/entities/user-role/schema.mjs +27 -6
  330. package/dist/core/entities/user-role/schema.mjs.map +1 -1
  331. package/dist/core/identity/index.mjs +2 -1
  332. package/dist/core/identity/provider/account/error.d.ts +7 -0
  333. package/dist/core/identity/provider/account/error.d.ts.map +1 -0
  334. package/dist/core/identity/provider/account/error.mjs +24 -0
  335. package/dist/core/identity/provider/account/error.mjs.map +1 -0
  336. package/dist/core/identity/provider/account/index.d.ts +1 -0
  337. package/dist/core/identity/provider/account/index.d.ts.map +1 -1
  338. package/dist/core/identity/provider/account/index.mjs +2 -1
  339. package/dist/core/identity/provider/account/module.d.ts +2 -0
  340. package/dist/core/identity/provider/account/module.d.ts.map +1 -1
  341. package/dist/core/identity/provider/account/module.mjs +30 -0
  342. package/dist/core/identity/provider/account/module.mjs.map +1 -1
  343. package/dist/core/identity/provider/account/types.d.ts +12 -10
  344. package/dist/core/identity/provider/account/types.d.ts.map +1 -1
  345. package/dist/core/identity/provider/authentication/protocols/oauth2/module.d.ts +1 -0
  346. package/dist/core/identity/provider/authentication/protocols/oauth2/module.d.ts.map +1 -1
  347. package/dist/core/identity/provider/authentication/protocols/oauth2/module.mjs +5 -1
  348. package/dist/core/identity/provider/authentication/protocols/oauth2/module.mjs.map +1 -1
  349. package/dist/core/identity/provider/authentication/protocols/oauth2/types.d.ts +7 -0
  350. package/dist/core/identity/provider/authentication/protocols/oauth2/types.d.ts.map +1 -1
  351. package/dist/core/identity/provider/index.mjs +2 -1
  352. package/dist/core/index.mjs +10 -2
  353. package/dist/core/oauth2/authorization/module.d.ts.map +1 -1
  354. package/dist/core/oauth2/authorization/module.mjs +2 -0
  355. package/dist/core/oauth2/authorization/module.mjs.map +1 -1
  356. package/dist/core/oauth2/authorization/state/types.d.ts +11 -0
  357. package/dist/core/oauth2/authorization/state/types.d.ts.map +1 -1
  358. package/dist/core/oauth2/end-session/service.mjs +2 -2
  359. package/dist/core/oauth2/end-session/service.mjs.map +1 -1
  360. package/dist/core/oauth2/grant-types/authorize.d.ts.map +1 -1
  361. package/dist/core/oauth2/grant-types/authorize.mjs +1 -5
  362. package/dist/core/oauth2/grant-types/authorize.mjs.map +1 -1
  363. package/dist/core/oauth2/grant-types/password.mjs +2 -5
  364. package/dist/core/oauth2/grant-types/password.mjs.map +1 -1
  365. package/dist/core/oauth2/grant-types/refresh-token.d.ts.map +1 -1
  366. package/dist/core/oauth2/grant-types/refresh-token.mjs +37 -24
  367. package/dist/core/oauth2/grant-types/refresh-token.mjs.map +1 -1
  368. package/dist/core/oauth2/index.mjs +3 -1
  369. package/dist/core/oauth2/mfa-login/module.d.ts.map +1 -1
  370. package/dist/core/oauth2/mfa-login/module.mjs +4 -7
  371. package/dist/core/oauth2/mfa-login/module.mjs.map +1 -1
  372. package/dist/core/oauth2/session-token/error.d.ts +36 -0
  373. package/dist/core/oauth2/session-token/error.d.ts.map +1 -0
  374. package/dist/core/oauth2/session-token/error.mjs +49 -0
  375. package/dist/core/oauth2/session-token/error.mjs.map +1 -0
  376. package/dist/core/oauth2/session-token/index.d.ts +1 -0
  377. package/dist/core/oauth2/session-token/index.d.ts.map +1 -1
  378. package/dist/core/oauth2/session-token/index.mjs +2 -1
  379. package/dist/core/oauth2/session-token/types.d.ts +40 -0
  380. package/dist/core/oauth2/session-token/types.d.ts.map +1 -1
  381. package/dist/core/oauth2/token/issuer/access/module.d.ts.map +1 -1
  382. package/dist/core/oauth2/token/issuer/access/module.mjs +1 -0
  383. package/dist/core/oauth2/token/issuer/access/module.mjs.map +1 -1
  384. package/dist/core/oauth2/token/issuer/base.d.ts +1 -1
  385. package/dist/core/oauth2/token/issuer/base.d.ts.map +1 -1
  386. package/dist/core/oauth2/token/issuer/base.mjs.map +1 -1
  387. package/dist/core/oauth2/token/issuer/refresh/module.d.ts.map +1 -1
  388. package/dist/core/oauth2/token/issuer/refresh/module.mjs +1 -0
  389. package/dist/core/oauth2/token/issuer/refresh/module.mjs.map +1 -1
  390. package/dist/core/query/index.mjs +2 -2
  391. package/dist/core/query/module.d.ts +19 -9
  392. package/dist/core/query/module.d.ts.map +1 -1
  393. package/dist/core/query/module.mjs +22 -10
  394. package/dist/core/query/module.mjs.map +1 -1
  395. package/dist/index.mjs +6 -4
  396. package/dist/swagger.json +869 -140
  397. package/dist/utils/error.d.ts +20 -3
  398. package/dist/utils/error.d.ts.map +1 -1
  399. package/dist/utils/error.mjs +102 -5
  400. package/dist/utils/error.mjs.map +1 -1
  401. package/dist/utils/index.mjs +2 -2
  402. package/package.json +23 -21
  403. package/dist/app/modules/identity/repositories/provider/account/index.d.ts.map +0 -1
  404. package/dist/app/modules/identity/repositories/provider/account/index.mjs +0 -5
  405. package/dist/app/modules/identity/repositories/provider/account/module.d.ts +0 -10
  406. package/dist/app/modules/identity/repositories/provider/account/module.d.ts.map +0 -1
  407. package/dist/app/modules/identity/repositories/provider/account/module.mjs +0 -28
  408. package/dist/app/modules/identity/repositories/provider/account/module.mjs.map +0 -1
  409. /package/dist/{app/modules/identity/repositories/provider/account → adapters/http/controllers/entities/identity-provider-account}/index.d.ts +0 -0
@@ -5,12 +5,29 @@ import { AuthupError } from '@authup/errors';
5
5
  * 1. AuthupError instance → returned as-is
6
6
  * 2. EntityRelationLookupError → BAD_REQUEST AuthupError
7
7
  * 3. validup Issue error → BAD_REQUEST AuthupError carrying issues
8
- * 4. foreign @ebec/http HTTPError → AuthupError with the closest semantic code
9
- * 5. driver error w/ a recognised code → ENTITY_CONFLICT or STORAGE_INSUFFICIENT
10
- * 6. anything else INTERNAL_ERROR AuthupError
8
+ * 4. rapiq ParseError / CodecError BAD_REQUEST AuthupError (client wire query)
9
+ * 5. hapic ClientError → UPSTREAM_ERROR AuthupError (outbound call)
10
+ * 6. foreign @ebec/http HTTPError AuthupError with the closest semantic code
11
+ * 7. driver error w/ a recognised code → ENTITY_CONFLICT or STORAGE_INSUFFICIENT
12
+ * 8. anything else → INTERNAL_ERROR AuthupError
11
13
  *
12
14
  * The HTTP-status concern is handled separately by `httpStatusFromCode` in
13
15
  * the adapter — this function only assigns a semantic `code`.
14
16
  */
15
17
  export declare function sanitizeError(input: unknown): AuthupError;
18
+ /**
19
+ * Render an error for the LOG. It is the counterpart of `@authup/errors`'
20
+ * `serializeError`, which renders one for the response.
21
+ *
22
+ * The detail an outbound failure carries never survives `sanitizeError`
23
+ * (by design: upstream internals must not reach the caller), and
24
+ * `Error.cause` is non-enumerable, so a plain serialization drops it too.
25
+ * Both were therefore already gone by the time anything was written,
26
+ * which left a refused connection and an upstream `invalid_request`
27
+ * indistinguishable in the log.
28
+ *
29
+ * Everything not present is omitted, so an ordinary error still renders
30
+ * as its bare message.
31
+ */
32
+ export declare function describeError(input: unknown, headline?: string): string;
16
33
  //# sourceMappingURL=error.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/utils/error.ts"],"names":[],"mappings":"AAOA,OAAO,EACH,WAAW,EAId,MAAM,gBAAgB,CAAC;AAMxB;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAoEzD"}
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/utils/error.ts"],"names":[],"mappings":"AAOA,OAAO,EACH,WAAW,EAKd,MAAM,gBAAgB,CAAC;AAQxB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAgGzD;AA0ED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CA8BvE"}
@@ -2,9 +2,11 @@ import "node:path";
2
2
  import "node:url";
3
3
  import.meta.url;
4
4
  import { hasOwnProperty, isObject } from "@authup/kit";
5
- import { AuthupError, ErrorCode, codeFromHttpStatus, isAuthupError } from "@authup/errors";
5
+ import { AuthupError, ErrorCode, codeFromHttpStatus, isAuthupError, normalizeError } from "@authup/errors";
6
+ import { CodecError, ParseError } from "@rapiq/core";
6
7
  import { buildErrorMessageForAttributes, isValidupError, stringifyPath } from "validup";
7
8
  import { EntityRelationLookupError } from "typeorm-extension";
9
+ import { isClientError } from "hapic";
8
10
  import { isHTTPError } from "@ebec/http";
9
11
  //#region src/utils/error.ts
10
12
  /**
@@ -13,9 +15,11 @@ import { isHTTPError } from "@ebec/http";
13
15
  * 1. AuthupError instance → returned as-is
14
16
  * 2. EntityRelationLookupError → BAD_REQUEST AuthupError
15
17
  * 3. validup Issue error → BAD_REQUEST AuthupError carrying issues
16
- * 4. foreign @ebec/http HTTPError → AuthupError with the closest semantic code
17
- * 5. driver error w/ a recognised code → ENTITY_CONFLICT or STORAGE_INSUFFICIENT
18
- * 6. anything else INTERNAL_ERROR AuthupError
18
+ * 4. rapiq ParseError / CodecError BAD_REQUEST AuthupError (client wire query)
19
+ * 5. hapic ClientError → UPSTREAM_ERROR AuthupError (outbound call)
20
+ * 6. foreign @ebec/http HTTPError AuthupError with the closest semantic code
21
+ * 7. driver error w/ a recognised code → ENTITY_CONFLICT or STORAGE_INSUFFICIENT
22
+ * 8. anything else → INTERNAL_ERROR AuthupError
19
23
  *
20
24
  * The HTTP-status concern is handled separately by `httpStatusFromCode` in
21
25
  * the adapter — this function only assigns a semantic `code`.
@@ -36,6 +40,27 @@ import { isHTTPError } from "@ebec/http";
36
40
  error.issues.push(...input.issues);
37
41
  return error;
38
42
  }
43
+ if (input instanceof ParseError || input instanceof CodecError) return new AuthupError({
44
+ code: ErrorCode.BAD_REQUEST,
45
+ message: input.message,
46
+ stack: input.stack
47
+ });
48
+ /**
49
+ * An outbound call failed. This branch MUST precede the `isHTTPError`
50
+ * one below: a hapic `HttpResponseError` extends `BaseError` and carries
51
+ * the upstream `status`, so the duck guard matches it and would mirror
52
+ * that status onto our own response. An upstream 400 would then read as
53
+ * "your request was malformed" when the caller's request was fine.
54
+ *
55
+ * The message is deliberately dropped rather than forwarded: hapic
56
+ * embeds the outbound method and URL in it (`400 Bad Request (POST
57
+ * https://idp.example.com/token)`), which must not reach the caller.
58
+ * `describeError` is what carries the detail, into the log only.
59
+ */ if (isClientError(input)) return new AuthupError({
60
+ code: ErrorCode.UPSTREAM_ERROR,
61
+ message: "A request to an upstream service failed.",
62
+ stack: input.stack
63
+ });
39
64
  if (isHTTPError(input)) return new AuthupError({
40
65
  code: codeFromHttpStatus(input.status),
41
66
  message: input.message,
@@ -66,7 +91,79 @@ import { isHTTPError } from "@ebec/http";
66
91
  }
67
92
  return new AuthupError({ code: ErrorCode.INTERNAL_ERROR });
68
93
  }
94
+ const DESCRIBE_BODY_MAX_LENGTH = 1024;
95
+ const DESCRIBE_CAUSE_MAX_DEPTH = 5;
96
+ const DESCRIBE_CAUSE_KEYS = [
97
+ "code",
98
+ "errno",
99
+ "syscall",
100
+ "address",
101
+ "port"
102
+ ];
103
+ function describeBody(input) {
104
+ let value;
105
+ if (typeof input === "string") value = input;
106
+ else try {
107
+ value = JSON.stringify(input) ?? String(input);
108
+ } catch {
109
+ value = Object.prototype.toString.call(input);
110
+ }
111
+ if (value.length === 0) return;
112
+ if (value.length > DESCRIBE_BODY_MAX_LENGTH) return `${value.substring(0, DESCRIBE_BODY_MAX_LENGTH)}… (truncated)`;
113
+ return value;
114
+ }
115
+ function describeCauseLink(input) {
116
+ const error = input;
117
+ const parts = [`${typeof error.name === "string" ? error.name : "Error"}: ${error.message}`];
118
+ const details = [];
119
+ for (const key of DESCRIBE_CAUSE_KEYS) {
120
+ const value = input[key];
121
+ if (typeof value === "string" || typeof value === "number") details.push(`${key}=${value}`);
122
+ }
123
+ if (details.length > 0) parts.push(`(${details.join(" ")})`);
124
+ return parts.join(" ");
125
+ }
126
+ function describeCauseChain(input) {
127
+ const links = [];
128
+ const seen = /* @__PURE__ */ new Set();
129
+ let current = isObject(input) ? input.cause : void 0;
130
+ while (isObject(current) && !seen.has(current) && links.length < DESCRIBE_CAUSE_MAX_DEPTH) {
131
+ seen.add(current);
132
+ links.push(describeCauseLink(current));
133
+ current = current.cause;
134
+ }
135
+ if (links.length === 0) return;
136
+ return links.join(" <- ");
137
+ }
138
+ /**
139
+ * Render an error for the LOG. It is the counterpart of `@authup/errors`'
140
+ * `serializeError`, which renders one for the response.
141
+ *
142
+ * The detail an outbound failure carries never survives `sanitizeError`
143
+ * (by design: upstream internals must not reach the caller), and
144
+ * `Error.cause` is non-enumerable, so a plain serialization drops it too.
145
+ * Both were therefore already gone by the time anything was written,
146
+ * which left a refused connection and an upstream `invalid_request`
147
+ * indistinguishable in the log.
148
+ *
149
+ * Everything not present is omitted, so an ordinary error still renders
150
+ * as its bare message.
151
+ */ function describeError(input, headline) {
152
+ const error = normalizeError(input);
153
+ const lines = [];
154
+ if (headline) lines.push(headline);
155
+ lines.push(error.message);
156
+ if (isClientError(error) && error.response) {
157
+ lines.push(` upstream status: ${error.response.status}`);
158
+ const body = describeBody(error.response.data);
159
+ if (body) lines.push(` upstream body: ${body}`);
160
+ }
161
+ const causes = describeCauseChain(error);
162
+ if (causes) lines.push(` cause: ${causes}`);
163
+ if (error.stack) lines.push(` stack: ${error.stack}`);
164
+ return lines.join("\n");
165
+ }
69
166
  //#endregion
70
- export { sanitizeError };
167
+ export { describeError, sanitizeError };
71
168
 
72
169
  //# sourceMappingURL=error.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"error.mjs","names":["AuthupError","ErrorCode","codeFromHttpStatus","isAuthupError","isHTTPError","EntityRelationLookupError","buildErrorMessageForAttributes","isValidupError","stringifyPath","hasOwnProperty","isObject","sanitizeError","input","code","ENTITY_RELATION_INVALID","message","stack","paths","issues","map","issue","path","error","BAD_REQUEST","push","status","undefined","ENTITY_CONFLICT","STORAGE_INSUFFICIENT","INTERNAL_ERROR"],"sources":["../../src/utils/error.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 AuthupError, \n ErrorCode, \n codeFromHttpStatus, \n isAuthupError, \n} from '@authup/errors';\nimport { isHTTPError } from '@ebec/http';\nimport { EntityRelationLookupError } from 'typeorm-extension';\nimport { buildErrorMessageForAttributes, isValidupError, stringifyPath } from 'validup';\nimport { hasOwnProperty, isObject } from '@authup/kit';\n\n/**\n * Normalize an unknown error to an AuthupError. Recognised shapes:\n *\n * 1. AuthupError instance → returned as-is\n * 2. EntityRelationLookupError → BAD_REQUEST AuthupError\n * 3. validup Issue error → BAD_REQUEST AuthupError carrying issues\n * 4. foreign @ebec/http HTTPError → AuthupError with the closest semantic code\n * 5. driver error w/ a recognised code → ENTITY_CONFLICT or STORAGE_INSUFFICIENT\n * 6. anything else → INTERNAL_ERROR AuthupError\n *\n * The HTTP-status concern is handled separately by `httpStatusFromCode` in\n * the adapter — this function only assigns a semantic `code`.\n */\nexport function sanitizeError(input: unknown): AuthupError {\n if (isAuthupError(input)) {\n return input;\n }\n\n if (input instanceof EntityRelationLookupError) {\n return new AuthupError({\n code: ErrorCode.ENTITY_RELATION_INVALID,\n message: input.message,\n stack: input.stack,\n });\n }\n\n if (isValidupError(input)) {\n const paths = input.issues.map((issue) => stringifyPath(issue.path));\n const error = new AuthupError({\n code: ErrorCode.BAD_REQUEST,\n stack: input.stack,\n message: input.message || buildErrorMessageForAttributes(paths),\n });\n\n error.issues.push(...input.issues);\n return error;\n }\n\n if (isHTTPError(input)) {\n return new AuthupError({\n code: codeFromHttpStatus(input.status),\n message: input.message,\n stack: input.stack,\n });\n }\n\n if (isObject(input)) {\n const code = hasOwnProperty(input, 'code') &&\n typeof input.code === 'string' ?\n input.code :\n undefined;\n\n /**\n * @see https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html\n */\n switch (code) {\n case '23505':\n case 'ER_DUP_ENTRY':\n case 'SQLITE_CONSTRAINT_UNIQUE': {\n return new AuthupError({\n code: ErrorCode.ENTITY_CONFLICT,\n message: 'An entry with some unique attributes already exists.',\n stack: input.stack as string | undefined,\n });\n }\n case 'ER_DISK_FULL':\n return new AuthupError({\n code: ErrorCode.STORAGE_INSUFFICIENT,\n message: 'No database operation possible, due to the lack of free disk space.',\n stack: input.stack as string | undefined,\n });\n }\n\n return new AuthupError({\n code: ErrorCode.INTERNAL_ERROR,\n message: input.message as string | undefined,\n stack: input.stack as string | undefined,\n });\n }\n\n return new AuthupError({ code: ErrorCode.INTERNAL_ERROR });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;GA+BA,SAAgBW,cAAcC,OAAc;CACxC,IAAIT,cAAcS,KAAAA,GACd,OAAOA;CAGX,IAAIA,iBAAiBP,2BACjB,OAAO,IAAIL,YAAY;EACnBa,MAAMZ,UAAUa;EAChBC,SAASH,MAAMG;EACfC,OAAOJ,MAAMI;CACjB,CAAA;CAGJ,IAAIT,eAAeK,KAAAA,GAAQ;EACvB,MAAMK,QAAQL,MAAMM,OAAOC,KAAKC,UAAUZ,cAAcY,MAAMC,IAAI,CAAA;EAClE,MAAMC,QAAQ,IAAItB,YAAY;GAC1Ba,MAAMZ,UAAUsB;GAChBP,OAAOJ,MAAMI;GACbD,SAASH,MAAMG,WAAWT,+BAA+BW,KAAAA;EAC7D,CAAA;EAEAK,MAAMJ,OAAOM,KAAI,GAAIZ,MAAMM,MAAM;EACjC,OAAOI;CACX;CAEA,IAAIlB,YAAYQ,KAAAA,GACZ,OAAO,IAAIZ,YAAY;EACnBa,MAAMX,mBAAmBU,MAAMa,MAAM;EACrCV,SAASH,MAAMG;EACfC,OAAOJ,MAAMI;CACjB,CAAA;CAGJ,IAAIN,SAASE,KAAAA,GAAQ;;;KASjB,QARaH,eAAeG,OAAO,MAAA,KACnC,OAAOA,MAAMC,SAAS,WAClBD,MAAMC,OACNa,KAAAA,GAKJ;GACI,KAAK;GACL,KAAK;GACL,KAAK,4BACD,OAAO,IAAI1B,YAAY;IACnBa,MAAMZ,UAAU0B;IAChBZ,SAAS;IACTC,OAAOJ,MAAMI;GACjB,CAAA;GAEJ,KAAK,gBACD,OAAO,IAAIhB,YAAY;IACnBa,MAAMZ,UAAU2B;IAChBb,SAAS;IACTC,OAAOJ,MAAMI;GACjB,CAAA;EACR;EAEA,OAAO,IAAIhB,YAAY;GACnBa,MAAMZ,UAAU4B;GAChBd,SAASH,MAAMG;GACfC,OAAOJ,MAAMI;EACjB,CAAA;CACJ;CAEA,OAAO,IAAIhB,YAAY,EAAEa,MAAMZ,UAAU4B,eAAe,CAAA;AAC5D"}
1
+ {"version":3,"file":"error.mjs","names":["AuthupError","ErrorCode","codeFromHttpStatus","isAuthupError","normalizeError","isHTTPError","isClientError","CodecError","ParseError","EntityRelationLookupError","buildErrorMessageForAttributes","isValidupError","stringifyPath","hasOwnProperty","isObject","sanitizeError","input","code","ENTITY_RELATION_INVALID","message","stack","paths","issues","map","issue","path","error","BAD_REQUEST","push","UPSTREAM_ERROR","status","undefined","ENTITY_CONFLICT","STORAGE_INSUFFICIENT","INTERNAL_ERROR","DESCRIBE_BODY_MAX_LENGTH","DESCRIBE_CAUSE_MAX_DEPTH","DESCRIBE_CAUSE_KEYS","describeBody","value","JSON","stringify","String","Object","prototype","toString","call","length","substring","describeCauseLink","name","parts","details","key","join","describeCauseChain","links","seen","Set","current","cause","has","add","describeError","headline","lines","response","body","data","causes"],"sources":["../../src/utils/error.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 AuthupError,\n ErrorCode,\n codeFromHttpStatus,\n isAuthupError,\n normalizeError,\n} from '@authup/errors';\nimport { isHTTPError } from '@ebec/http';\nimport { isClientError } from 'hapic';\nimport { CodecError, ParseError } from '@rapiq/core';\nimport { EntityRelationLookupError } from 'typeorm-extension';\nimport { buildErrorMessageForAttributes, isValidupError, stringifyPath } from 'validup';\nimport { hasOwnProperty, isObject } from '@authup/kit';\n\n/**\n * Normalize an unknown error to an AuthupError. Recognised shapes:\n *\n * 1. AuthupError instance → returned as-is\n * 2. EntityRelationLookupError → BAD_REQUEST AuthupError\n * 3. validup Issue error → BAD_REQUEST AuthupError carrying issues\n * 4. rapiq ParseError / CodecError → BAD_REQUEST AuthupError (client wire query)\n * 5. hapic ClientError → UPSTREAM_ERROR AuthupError (outbound call)\n * 6. foreign @ebec/http HTTPError → AuthupError with the closest semantic code\n * 7. driver error w/ a recognised code → ENTITY_CONFLICT or STORAGE_INSUFFICIENT\n * 8. anything else → INTERNAL_ERROR AuthupError\n *\n * The HTTP-status concern is handled separately by `httpStatusFromCode` in\n * the adapter — this function only assigns a semantic `code`.\n */\nexport function sanitizeError(input: unknown): AuthupError {\n if (isAuthupError(input)) {\n return input;\n }\n\n if (input instanceof EntityRelationLookupError) {\n return new AuthupError({\n code: ErrorCode.ENTITY_RELATION_INVALID,\n message: input.message,\n stack: input.stack,\n });\n }\n\n if (isValidupError(input)) {\n const paths = input.issues.map((issue) => stringifyPath(issue.path));\n const error = new AuthupError({\n code: ErrorCode.BAD_REQUEST,\n stack: input.stack,\n message: input.message || buildErrorMessageForAttributes(paths),\n });\n\n error.issues.push(...input.issues);\n return error;\n }\n\n if (input instanceof ParseError || input instanceof CodecError) {\n return new AuthupError({\n code: ErrorCode.BAD_REQUEST,\n message: input.message,\n stack: input.stack,\n });\n }\n\n /**\n * An outbound call failed. This branch MUST precede the `isHTTPError`\n * one below: a hapic `HttpResponseError` extends `BaseError` and carries\n * the upstream `status`, so the duck guard matches it and would mirror\n * that status onto our own response. An upstream 400 would then read as\n * \"your request was malformed\" when the caller's request was fine.\n *\n * The message is deliberately dropped rather than forwarded: hapic\n * embeds the outbound method and URL in it (`400 Bad Request (POST\n * https://idp.example.com/token)`), which must not reach the caller.\n * `describeError` is what carries the detail, into the log only.\n */\n if (isClientError(input)) {\n return new AuthupError({\n code: ErrorCode.UPSTREAM_ERROR,\n message: 'A request to an upstream service failed.',\n stack: input.stack,\n });\n }\n\n if (isHTTPError(input)) {\n return new AuthupError({\n code: codeFromHttpStatus(input.status),\n message: input.message,\n stack: input.stack,\n });\n }\n\n if (isObject(input)) {\n const code = hasOwnProperty(input, 'code') &&\n typeof input.code === 'string' ?\n input.code :\n undefined;\n\n /**\n * @see https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html\n */\n switch (code) {\n case '23505':\n case 'ER_DUP_ENTRY':\n case 'SQLITE_CONSTRAINT_UNIQUE': {\n return new AuthupError({\n code: ErrorCode.ENTITY_CONFLICT,\n message: 'An entry with some unique attributes already exists.',\n stack: input.stack as string | undefined,\n });\n }\n case 'ER_DISK_FULL':\n return new AuthupError({\n code: ErrorCode.STORAGE_INSUFFICIENT,\n message: 'No database operation possible, due to the lack of free disk space.',\n stack: input.stack as string | undefined,\n });\n }\n\n return new AuthupError({\n code: ErrorCode.INTERNAL_ERROR,\n message: input.message as string | undefined,\n stack: input.stack as string | undefined,\n });\n }\n\n return new AuthupError({ code: ErrorCode.INTERNAL_ERROR });\n}\n\nconst DESCRIBE_BODY_MAX_LENGTH = 1024;\nconst DESCRIBE_CAUSE_MAX_DEPTH = 5;\n\n// Fields node attaches to a syscall error. Without them a transport failure\n// reads as a bare \"connect ECONNREFUSED\" with no way back to the reason.\nconst DESCRIBE_CAUSE_KEYS = ['code', 'errno', 'syscall', 'address', 'port'] as const;\n\nfunction describeBody(input: unknown): string | undefined {\n let value: string;\n\n if (typeof input === 'string') {\n value = input;\n } else {\n try {\n value = JSON.stringify(input) ?? String(input);\n } catch {\n // A body that cannot be serialized (circular, a stream) is\n // still worth naming by shape.\n value = Object.prototype.toString.call(input);\n }\n }\n\n if (value.length === 0) {\n return undefined;\n }\n\n if (value.length > DESCRIBE_BODY_MAX_LENGTH) {\n return `${value.substring(0, DESCRIBE_BODY_MAX_LENGTH)}… (truncated)`;\n }\n\n return value;\n}\n\nfunction describeCauseLink(input: object): string {\n const error = input as Error;\n const name = typeof error.name === 'string' ? error.name : 'Error';\n const parts: string[] = [`${name}: ${error.message}`];\n\n const details: string[] = [];\n for (const key of DESCRIBE_CAUSE_KEYS) {\n const value = (input as Record<string, unknown>)[key];\n if (typeof value === 'string' || typeof value === 'number') {\n details.push(`${key}=${value}`);\n }\n }\n\n if (details.length > 0) {\n parts.push(`(${details.join(' ')})`);\n }\n\n return parts.join(' ');\n}\n\nfunction describeCauseChain(input: unknown): string | undefined {\n const links: string[] = [];\n const seen = new Set<unknown>();\n\n let current: unknown = isObject(input) ? (input as { cause?: unknown }).cause : undefined;\n\n while (isObject(current) && !seen.has(current) && links.length < DESCRIBE_CAUSE_MAX_DEPTH) {\n seen.add(current);\n links.push(describeCauseLink(current));\n current = (current as { cause?: unknown }).cause;\n }\n\n if (links.length === 0) {\n return undefined;\n }\n\n return links.join(' <- ');\n}\n\n/**\n * Render an error for the LOG. It is the counterpart of `@authup/errors`'\n * `serializeError`, which renders one for the response.\n *\n * The detail an outbound failure carries never survives `sanitizeError`\n * (by design: upstream internals must not reach the caller), and\n * `Error.cause` is non-enumerable, so a plain serialization drops it too.\n * Both were therefore already gone by the time anything was written,\n * which left a refused connection and an upstream `invalid_request`\n * indistinguishable in the log.\n *\n * Everything not present is omitted, so an ordinary error still renders\n * as its bare message.\n */\nexport function describeError(input: unknown, headline?: string): string {\n const error = normalizeError(input);\n\n const lines: string[] = [];\n if (headline) {\n lines.push(headline);\n }\n lines.push(error.message);\n\n // hapic attaches the decoded body to the response through a getter, so\n // it is non-enumerable and only reachable by an explicit read.\n if (isClientError(error) && error.response) {\n lines.push(` upstream status: ${error.response.status}`);\n\n const body = describeBody(error.response.data);\n if (body) {\n lines.push(` upstream body: ${body}`);\n }\n }\n\n const causes = describeCauseChain(error);\n if (causes) {\n lines.push(` cause: ${causes}`);\n }\n\n if (error.stack) {\n lines.push(` stack: ${error.stack}`);\n }\n\n return lines.join('\\n');\n}\n"],"mappings":"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"}
@@ -1,7 +1,7 @@
1
1
  import "node:path";
2
2
  import "node:url";
3
3
  import.meta.url;
4
- import { sanitizeError } from "./error.mjs";
4
+ import { describeError, sanitizeError } from "./error.mjs";
5
5
  import { isSelfToken } from "./self-id.mjs";
6
6
  import { resolveURL } from "./url.mjs";
7
- export { isSelfToken, resolveURL, sanitizeError };
7
+ export { describeError, isSelfToken, resolveURL, sanitizeError };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@authup/server-core",
3
3
  "type": "module",
4
- "version": "1.0.0-beta.59",
4
+ "version": "1.0.0-beta.60",
5
5
  "description": "This is a standalone application.",
6
6
  "license": "AGPL-3.0-only",
7
7
  "main": "dist/index.mjs",
@@ -24,6 +24,8 @@
24
24
  "test:mysql": "cross-env DB_TYPE=mysql DB_HOST=127.0.0.1 DB_USERNAME=root DB_PASSWORD=start123 DB_DATABASE=app vitest run --config test/vitest.config.ts",
25
25
  "test:psql": "cross-env DB_TYPE=postgres DB_HOST=127.0.0.1 DB_USERNAME=postgres DB_PASSWORD=start123 DB_DATABASE=app vitest run --config test/vitest.config.ts",
26
26
  "test:coverage": "cross-env NODE_ENV=test vitest run --config test/vitest.config.ts --coverage",
27
+ "test:schema-drift": "node scripts/assert-schema-drift.mjs",
28
+ "test:migration-latest": "node scripts/verify-latest-migration.mjs",
27
29
  "check:types": "tsc -p tsconfig.test.json"
28
30
  },
29
31
  "engines": {
@@ -65,24 +67,24 @@
65
67
  },
66
68
  "homepage": "https://github.com/authup/authup#readme",
67
69
  "dependencies": {
68
- "@authup/access": "^1.0.0-beta.59",
69
- "@authup/client-account-console": "^1.0.0-beta.59",
70
- "@authup/client-auth-console": "^1.0.0-beta.59",
71
- "@authup/core-http-kit": "^1.0.0-beta.59",
72
- "@authup/core-kit": "^1.0.0-beta.59",
73
- "@authup/errors": "^1.0.0-beta.59",
74
- "@authup/i18n": "^1.0.0-beta.59",
75
- "@authup/kit": "^1.0.0-beta.59",
76
- "@authup/server-kit": "^1.0.0-beta.59",
77
- "@authup/specs": "^1.0.0-beta.59",
70
+ "@authup/access": "^1.0.0-beta.60",
71
+ "@authup/client-account-console": "^1.0.0-beta.60",
72
+ "@authup/client-auth-console": "^1.0.0-beta.60",
73
+ "@authup/core-http-kit": "^1.0.0-beta.60",
74
+ "@authup/core-kit": "^1.0.0-beta.60",
75
+ "@authup/errors": "^1.0.0-beta.60",
76
+ "@authup/i18n": "^1.0.0-beta.60",
77
+ "@authup/kit": "^1.0.0-beta.60",
78
+ "@authup/server-kit": "^1.0.0-beta.60",
79
+ "@authup/specs": "^1.0.0-beta.60",
78
80
  "@ebec/http": "^4.2.0",
79
81
  "@hapic/oauth2": "^4.0.1",
80
82
  "@peculiar/x509": "^2.0.0",
81
- "@rapiq/adapter-memory": "^2.0.0-beta.15",
82
- "@rapiq/adapter-sql": "^2.0.0-beta.15",
83
- "@rapiq/adapter-typeorm": "^2.0.0-beta.15",
84
- "@rapiq/codec-url": "^2.0.0-beta.15",
85
- "@rapiq/core": "^2.0.0-beta.15",
83
+ "@rapiq/adapter-memory": "^2.1.0",
84
+ "@rapiq/adapter-sql": "^2.1.0",
85
+ "@rapiq/adapter-typeorm": "^2.1.0",
86
+ "@rapiq/codec-url": "^2.1.0",
87
+ "@rapiq/core": "^2.1.0",
86
88
  "@routup/assets": "^5.0.0",
87
89
  "@routup/basic": "^3.0.0",
88
90
  "@routup/cors": "^2.0.0",
@@ -107,7 +109,7 @@
107
109
  "locter": "^4.0.0",
108
110
  "mysql2": "^3.23.2",
109
111
  "node-cron": "^4.6.0",
110
- "nodemailer": "^9.0.3",
112
+ "nodemailer": "^9.0.4",
111
113
  "orkos": "^1.1.1",
112
114
  "otpauth": "^9.5.1",
113
115
  "pg": "^8.22.0",
@@ -118,13 +120,13 @@
118
120
  "smob": "^1.6.1",
119
121
  "tsyringe": "^4.10.0",
120
122
  "typeorm": "1.1.0",
121
- "typeorm-extension": "^4.0.0-beta.1",
123
+ "typeorm-extension": "^4.0.0-beta.3",
122
124
  "uncrypto": "^0.1.3",
123
125
  "validup": "^1.0.0",
124
126
  "zod": "^4.4.3"
125
127
  },
126
128
  "devDependencies": {
127
- "@authup/server-test-kit": "^1.0.0-beta.59",
129
+ "@authup/server-test-kit": "^1.0.0-beta.60",
128
130
  "@faker-js/faker": "^10.5.0",
129
131
  "@trapi/cli": "^2.0.4",
130
132
  "@types/ldapjs": "^3.0.6",
@@ -134,9 +136,9 @@
134
136
  "jest-serial-runner": "^1.2.1",
135
137
  "nodemon": "^3.1.14",
136
138
  "supertest": "^7.2.2",
137
- "testcontainers": "^12.0.4",
139
+ "testcontainers": "^12.1.0",
138
140
  "ts-node": "^10.8.2",
139
- "unplugin-swc": "^1.5.9",
141
+ "unplugin-swc": "^1.5.10",
140
142
  "vite": "^8.1.3",
141
143
  "vitest": "^4.0.14"
142
144
  },
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/app/modules/identity/repositories/provider/account/index.ts"],"names":[],"mappings":"AAOA,cAAc,aAAa,CAAC"}
@@ -1,5 +0,0 @@
1
- import "node:path";
2
- import "node:url";
3
- import.meta.url;
4
- import { IdentityProviderAccountRepository } from "./module.mjs";
5
- export { IdentityProviderAccountRepository };
@@ -1,10 +0,0 @@
1
- import type { IdentityProviderAccount } from '@authup/core-kit';
2
- import type { DataSource, DeepPartial } from 'typeorm';
3
- import type { IIdentityProviderAccountRepository, IdentityProviderIdentity } from '../../../../../../core/index.ts';
4
- export declare class IdentityProviderAccountRepository implements IIdentityProviderAccountRepository {
5
- protected dataSource: DataSource;
6
- constructor(dataSource: DataSource);
7
- findOneByProviderIdentity(identity: IdentityProviderIdentity): Promise<IdentityProviderAccount | null>;
8
- save(entity: DeepPartial<IdentityProviderAccount>): Promise<IdentityProviderAccount>;
9
- }
10
- //# sourceMappingURL=module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../../../src/app/modules/identity/repositories/provider/account/module.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,KAAK,EAAE,kCAAkC,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAGpH,qBAAa,iCAAkC,YAAW,kCAAkC;IACxF,SAAS,CAAC,UAAU,EAAG,UAAU,CAAC;gBAEtB,UAAU,EAAE,UAAU;IAI5B,yBAAyB,CAAC,QAAQ,EAAE,wBAAwB,GAAG,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC;IAYtG,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,uBAAuB,CAAC,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAK7F"}
@@ -1,28 +0,0 @@
1
- import "node:path";
2
- import "node:url";
3
- import.meta.url;
4
- import { IdentityProviderAccountEntity } from "../../../../../../adapters/database/domains/identity-provider-account/entity.mjs";
5
- import "../../../../../../adapters/database/domains/index.mjs";
6
- //#region src/app/modules/identity/repositories/provider/account/module.ts
7
- var IdentityProviderAccountRepository = class {
8
- dataSource;
9
- constructor(dataSource) {
10
- this.dataSource = dataSource;
11
- }
12
- async findOneByProviderIdentity(identity) {
13
- return this.dataSource.getRepository(IdentityProviderAccountEntity).findOne({
14
- where: {
15
- providerUserId: identity.id,
16
- providerId: identity.provider.id
17
- },
18
- relations: { user: true }
19
- });
20
- }
21
- async save(entity) {
22
- return this.dataSource.getRepository(IdentityProviderAccountEntity).save(entity);
23
- }
24
- };
25
- //#endregion
26
- export { IdentityProviderAccountRepository };
27
-
28
- //# sourceMappingURL=module.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"module.mjs","names":["IdentityProviderAccountEntity","IdentityProviderAccountRepository","dataSource","findOneByProviderIdentity","identity","repository","getRepository","findOne","where","providerUserId","id","providerId","provider","relations","user","save","entity"],"sources":["../../../../../../../src/app/modules/identity/repositories/provider/account/module.ts"],"sourcesContent":["/*\n * Copyright (c) 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 { IdentityProviderAccount } from '@authup/core-kit';\nimport type { DataSource, DeepPartial } from 'typeorm';\nimport type { IIdentityProviderAccountRepository, IdentityProviderIdentity } from '../../../../../../core/index.ts';\nimport { IdentityProviderAccountEntity } from '../../../../../../adapters/database/domains/index.ts';\n\nexport class IdentityProviderAccountRepository implements IIdentityProviderAccountRepository {\n protected dataSource : DataSource;\n\n constructor(dataSource: DataSource) {\n this.dataSource = dataSource;\n }\n\n async findOneByProviderIdentity(identity: IdentityProviderIdentity): Promise<IdentityProviderAccount | null> {\n const repository = this.dataSource.getRepository(IdentityProviderAccountEntity);\n\n return repository.findOne({\n where: {\n providerUserId: identity.id,\n providerId: identity.provider.id,\n },\n relations: { user: true },\n });\n }\n\n async save(entity: DeepPartial<IdentityProviderAccount>): Promise<IdentityProviderAccount> {\n const repository = this.dataSource.getRepository(IdentityProviderAccountEntity);\n\n return repository.save(entity);\n }\n}\n"],"mappings":";;;;;;AAYA,IAAaC,oCAAb,MAAaA;CACCC;CAEV,YAAYA,YAAwB;EAChC,KAAKA,aAAaA;CACtB;CAEA,MAAMC,0BAA0BC,UAA6E;EAGzG,OAFmB,KAAKF,WAAWI,cAAcN,6BAE1CK,CAAAA,CAAWE,QAAQ;GACtBC,OAAO;IACHC,gBAAgBL,SAASM;IACzBC,YAAYP,SAASQ,SAASF;GAClC;GACAG,WAAW,EAAEC,MAAM,KAAK;EAC5B,CAAA;CACJ;CAEA,MAAMC,KAAKC,QAAgF;EAGvF,OAFmB,KAAKd,WAAWI,cAAcN,6BAE1CK,CAAAA,CAAWU,KAAKC,MAAAA;CAC3B;AACJ"}