@carlonicora/nestjs-neo4jsonapi 1.39.0 → 1.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/dist/config/base.config.d.ts.map +1 -1
  2. package/dist/config/base.config.js +9 -0
  3. package/dist/config/base.config.js.map +1 -1
  4. package/dist/config/interfaces/base.config.interface.d.ts +2 -0
  5. package/dist/config/interfaces/base.config.interface.d.ts.map +1 -1
  6. package/dist/config/interfaces/config.two.factor.interface.d.ts +27 -0
  7. package/dist/config/interfaces/config.two.factor.interface.d.ts.map +1 -0
  8. package/dist/config/interfaces/config.two.factor.interface.js +3 -0
  9. package/dist/config/interfaces/config.two.factor.interface.js.map +1 -0
  10. package/dist/config/interfaces/index.d.ts +1 -0
  11. package/dist/config/interfaces/index.d.ts.map +1 -1
  12. package/dist/config/interfaces/index.js +1 -0
  13. package/dist/config/interfaces/index.js.map +1 -1
  14. package/dist/core/jsonapi/services/jsonapi.service.d.ts.map +1 -1
  15. package/dist/core/jsonapi/services/jsonapi.service.js +3 -1
  16. package/dist/core/jsonapi/services/jsonapi.service.js.map +1 -1
  17. package/dist/core/llm/services/vision.llm.service.d.ts.map +1 -1
  18. package/dist/core/llm/services/vision.llm.service.js +0 -1
  19. package/dist/core/llm/services/vision.llm.service.js.map +1 -1
  20. package/dist/core/security/services/security.service.d.ts +27 -0
  21. package/dist/core/security/services/security.service.d.ts.map +1 -1
  22. package/dist/core/security/services/security.service.js +37 -0
  23. package/dist/core/security/services/security.service.js.map +1 -1
  24. package/dist/foundations/auth/auth.module.d.ts.map +1 -1
  25. package/dist/foundations/auth/auth.module.js +6 -0
  26. package/dist/foundations/auth/auth.module.js.map +1 -1
  27. package/dist/foundations/auth/entities/pending-auth.entity.d.ts +16 -0
  28. package/dist/foundations/auth/entities/pending-auth.entity.d.ts.map +1 -0
  29. package/dist/foundations/auth/entities/pending-auth.entity.js +3 -0
  30. package/dist/foundations/auth/entities/pending-auth.entity.js.map +1 -0
  31. package/dist/foundations/auth/entities/pending-auth.map.d.ts +6 -0
  32. package/dist/foundations/auth/entities/pending-auth.map.d.ts.map +1 -0
  33. package/dist/foundations/auth/entities/pending-auth.map.js +20 -0
  34. package/dist/foundations/auth/entities/pending-auth.map.js.map +1 -0
  35. package/dist/foundations/auth/entities/pending-auth.meta.d.ts +3 -0
  36. package/dist/foundations/auth/entities/pending-auth.meta.d.ts.map +1 -0
  37. package/dist/foundations/auth/entities/pending-auth.meta.js +10 -0
  38. package/dist/foundations/auth/entities/pending-auth.meta.js.map +1 -0
  39. package/dist/foundations/auth/entities/pending-auth.model.d.ts +9 -0
  40. package/dist/foundations/auth/entities/pending-auth.model.d.ts.map +1 -0
  41. package/dist/foundations/auth/entities/pending-auth.model.js +19 -0
  42. package/dist/foundations/auth/entities/pending-auth.model.js.map +1 -0
  43. package/dist/foundations/auth/serialisers/pending-auth.serialiser.d.ts +18 -0
  44. package/dist/foundations/auth/serialisers/pending-auth.serialiser.d.ts.map +1 -0
  45. package/dist/foundations/auth/serialisers/pending-auth.serialiser.js +49 -0
  46. package/dist/foundations/auth/serialisers/pending-auth.serialiser.js.map +1 -0
  47. package/dist/foundations/auth/services/auth.service.d.ts +12 -1
  48. package/dist/foundations/auth/services/auth.service.d.ts.map +1 -1
  49. package/dist/foundations/auth/services/auth.service.js +60 -6
  50. package/dist/foundations/auth/services/auth.service.js.map +1 -1
  51. package/dist/foundations/foundations.modules.d.ts.map +1 -1
  52. package/dist/foundations/foundations.modules.js +2 -0
  53. package/dist/foundations/foundations.modules.js.map +1 -1
  54. package/dist/foundations/index.d.ts +1 -0
  55. package/dist/foundations/index.d.ts.map +1 -1
  56. package/dist/foundations/index.js +1 -0
  57. package/dist/foundations/index.js.map +1 -1
  58. package/dist/foundations/stripe/services/billing.service.d.ts +3 -4
  59. package/dist/foundations/stripe/services/billing.service.d.ts.map +1 -1
  60. package/dist/foundations/stripe/services/billing.service.js +1 -1
  61. package/dist/foundations/stripe/services/billing.service.js.map +1 -1
  62. package/dist/foundations/stripe-invoice/services/stripe-invoice-admin.service.d.ts +1 -1
  63. package/dist/foundations/stripe-invoice/services/stripe-invoice-admin.service.js +1 -1
  64. package/dist/foundations/stripe-invoice/services/stripe-invoice-api.service.d.ts +1 -1
  65. package/dist/foundations/stripe-invoice/services/stripe-invoice-api.service.d.ts.map +1 -1
  66. package/dist/foundations/stripe-invoice/services/stripe-invoice-api.service.js +2 -2
  67. package/dist/foundations/stripe-invoice/services/stripe-invoice-api.service.js.map +1 -1
  68. package/dist/foundations/stripe-subscription/controllers/stripe-subscription.controller.d.ts.map +1 -1
  69. package/dist/foundations/stripe-subscription/controllers/stripe-subscription.controller.js +0 -3
  70. package/dist/foundations/stripe-subscription/controllers/stripe-subscription.controller.js.map +1 -1
  71. package/dist/foundations/stripe-subscription/services/stripe-subscription-admin.service.d.ts +1 -1
  72. package/dist/foundations/stripe-subscription/services/stripe-subscription-admin.service.d.ts.map +1 -1
  73. package/dist/foundations/stripe-subscription/services/stripe-subscription-admin.service.js +1 -3
  74. package/dist/foundations/stripe-subscription/services/stripe-subscription-admin.service.js.map +1 -1
  75. package/dist/foundations/stripe-subscription/services/stripe-subscription-api.service.d.ts +1 -1
  76. package/dist/foundations/stripe-subscription/services/stripe-subscription-api.service.d.ts.map +1 -1
  77. package/dist/foundations/stripe-subscription/services/stripe-subscription-api.service.js +1 -5
  78. package/dist/foundations/stripe-subscription/services/stripe-subscription-api.service.js.map +1 -1
  79. package/dist/foundations/two-factor/controllers/passkey.controller.d.ts +52 -0
  80. package/dist/foundations/two-factor/controllers/passkey.controller.d.ts.map +1 -0
  81. package/dist/foundations/two-factor/controllers/passkey.controller.js +155 -0
  82. package/dist/foundations/two-factor/controllers/passkey.controller.js.map +1 -0
  83. package/dist/foundations/two-factor/controllers/totp.controller.d.ts +47 -0
  84. package/dist/foundations/two-factor/controllers/totp.controller.d.ts.map +1 -0
  85. package/dist/foundations/two-factor/controllers/totp.controller.js +132 -0
  86. package/dist/foundations/two-factor/controllers/totp.controller.js.map +1 -0
  87. package/dist/foundations/two-factor/controllers/two-factor.controller.d.ts +124 -0
  88. package/dist/foundations/two-factor/controllers/two-factor.controller.d.ts.map +1 -0
  89. package/dist/foundations/two-factor/controllers/two-factor.controller.js +352 -0
  90. package/dist/foundations/two-factor/controllers/two-factor.controller.js.map +1 -0
  91. package/dist/foundations/two-factor/dtos/passkey-options.dto.d.ts +42 -0
  92. package/dist/foundations/two-factor/dtos/passkey-options.dto.d.ts.map +1 -0
  93. package/dist/foundations/two-factor/dtos/passkey-options.dto.js +77 -0
  94. package/dist/foundations/two-factor/dtos/passkey-options.dto.js.map +1 -0
  95. package/dist/foundations/two-factor/dtos/passkey-verify.dto.d.ts +120 -0
  96. package/dist/foundations/two-factor/dtos/passkey-verify.dto.d.ts.map +1 -0
  97. package/dist/foundations/two-factor/dtos/passkey-verify.dto.js +226 -0
  98. package/dist/foundations/two-factor/dtos/passkey-verify.dto.js.map +1 -0
  99. package/dist/foundations/two-factor/dtos/totp-setup.dto.d.ts +32 -0
  100. package/dist/foundations/two-factor/dtos/totp-setup.dto.d.ts.map +1 -0
  101. package/dist/foundations/two-factor/dtos/totp-setup.dto.js +67 -0
  102. package/dist/foundations/two-factor/dtos/totp-setup.dto.js.map +1 -0
  103. package/dist/foundations/two-factor/dtos/totp-verify.dto.d.ts +62 -0
  104. package/dist/foundations/two-factor/dtos/totp-verify.dto.d.ts.map +1 -0
  105. package/dist/foundations/two-factor/dtos/totp-verify.dto.js +118 -0
  106. package/dist/foundations/two-factor/dtos/totp-verify.dto.js.map +1 -0
  107. package/dist/foundations/two-factor/dtos/two-factor-verify.dto.d.ts +83 -0
  108. package/dist/foundations/two-factor/dtos/two-factor-verify.dto.d.ts.map +1 -0
  109. package/dist/foundations/two-factor/dtos/two-factor-verify.dto.js +161 -0
  110. package/dist/foundations/two-factor/dtos/two-factor-verify.dto.js.map +1 -0
  111. package/dist/foundations/two-factor/entities/backup-code.d.ts +22 -0
  112. package/dist/foundations/two-factor/entities/backup-code.d.ts.map +1 -0
  113. package/dist/foundations/two-factor/entities/backup-code.js +25 -0
  114. package/dist/foundations/two-factor/entities/backup-code.js.map +1 -0
  115. package/dist/foundations/two-factor/entities/backup-code.meta.d.ts +3 -0
  116. package/dist/foundations/two-factor/entities/backup-code.meta.d.ts.map +1 -0
  117. package/dist/foundations/two-factor/entities/backup-code.meta.js +10 -0
  118. package/dist/foundations/two-factor/entities/backup-code.meta.js.map +1 -0
  119. package/dist/foundations/two-factor/entities/backup-codes-count.d.ts +18 -0
  120. package/dist/foundations/two-factor/entities/backup-codes-count.d.ts.map +1 -0
  121. package/dist/foundations/two-factor/entities/backup-codes-count.js +19 -0
  122. package/dist/foundations/two-factor/entities/backup-codes-count.js.map +1 -0
  123. package/dist/foundations/two-factor/entities/backup-codes-count.meta.d.ts +3 -0
  124. package/dist/foundations/two-factor/entities/backup-codes-count.meta.d.ts.map +1 -0
  125. package/dist/foundations/two-factor/entities/backup-codes-count.meta.js +10 -0
  126. package/dist/foundations/two-factor/entities/backup-codes-count.meta.js.map +1 -0
  127. package/dist/foundations/two-factor/entities/backup-codes-generation.d.ts +19 -0
  128. package/dist/foundations/two-factor/entities/backup-codes-generation.d.ts.map +1 -0
  129. package/dist/foundations/two-factor/entities/backup-codes-generation.js +20 -0
  130. package/dist/foundations/two-factor/entities/backup-codes-generation.js.map +1 -0
  131. package/dist/foundations/two-factor/entities/backup-codes-generation.meta.d.ts +3 -0
  132. package/dist/foundations/two-factor/entities/backup-codes-generation.meta.d.ts.map +1 -0
  133. package/dist/foundations/two-factor/entities/backup-codes-generation.meta.js +10 -0
  134. package/dist/foundations/two-factor/entities/backup-codes-generation.meta.js.map +1 -0
  135. package/dist/foundations/two-factor/entities/passkey-authentication-options.d.ts +19 -0
  136. package/dist/foundations/two-factor/entities/passkey-authentication-options.d.ts.map +1 -0
  137. package/dist/foundations/two-factor/entities/passkey-authentication-options.js +20 -0
  138. package/dist/foundations/two-factor/entities/passkey-authentication-options.js.map +1 -0
  139. package/dist/foundations/two-factor/entities/passkey-authentication-options.meta.d.ts +3 -0
  140. package/dist/foundations/two-factor/entities/passkey-authentication-options.meta.d.ts.map +1 -0
  141. package/dist/foundations/two-factor/entities/passkey-authentication-options.meta.js +10 -0
  142. package/dist/foundations/two-factor/entities/passkey-authentication-options.meta.js.map +1 -0
  143. package/dist/foundations/two-factor/entities/passkey-registration-options.d.ts +19 -0
  144. package/dist/foundations/two-factor/entities/passkey-registration-options.d.ts.map +1 -0
  145. package/dist/foundations/two-factor/entities/passkey-registration-options.js +20 -0
  146. package/dist/foundations/two-factor/entities/passkey-registration-options.js.map +1 -0
  147. package/dist/foundations/two-factor/entities/passkey-registration-options.meta.d.ts +3 -0
  148. package/dist/foundations/two-factor/entities/passkey-registration-options.meta.d.ts.map +1 -0
  149. package/dist/foundations/two-factor/entities/passkey-registration-options.meta.js +10 -0
  150. package/dist/foundations/two-factor/entities/passkey-registration-options.meta.js.map +1 -0
  151. package/dist/foundations/two-factor/entities/passkey.d.ts +27 -0
  152. package/dist/foundations/two-factor/entities/passkey.d.ts.map +1 -0
  153. package/dist/foundations/two-factor/entities/passkey.js +30 -0
  154. package/dist/foundations/two-factor/entities/passkey.js.map +1 -0
  155. package/dist/foundations/two-factor/entities/passkey.meta.d.ts +3 -0
  156. package/dist/foundations/two-factor/entities/passkey.meta.d.ts.map +1 -0
  157. package/dist/foundations/two-factor/entities/passkey.meta.js +10 -0
  158. package/dist/foundations/two-factor/entities/passkey.meta.js.map +1 -0
  159. package/dist/foundations/two-factor/entities/pending-two-factor.d.ts +24 -0
  160. package/dist/foundations/two-factor/entities/pending-two-factor.d.ts.map +1 -0
  161. package/dist/foundations/two-factor/entities/pending-two-factor.js +27 -0
  162. package/dist/foundations/two-factor/entities/pending-two-factor.js.map +1 -0
  163. package/dist/foundations/two-factor/entities/pending-two-factor.meta.d.ts +3 -0
  164. package/dist/foundations/two-factor/entities/pending-two-factor.meta.d.ts.map +1 -0
  165. package/dist/foundations/two-factor/entities/pending-two-factor.meta.js +10 -0
  166. package/dist/foundations/two-factor/entities/pending-two-factor.meta.js.map +1 -0
  167. package/dist/foundations/two-factor/entities/totp-authenticator.d.ts +24 -0
  168. package/dist/foundations/two-factor/entities/totp-authenticator.d.ts.map +1 -0
  169. package/dist/foundations/two-factor/entities/totp-authenticator.js +27 -0
  170. package/dist/foundations/two-factor/entities/totp-authenticator.js.map +1 -0
  171. package/dist/foundations/two-factor/entities/totp-authenticator.meta.d.ts +3 -0
  172. package/dist/foundations/two-factor/entities/totp-authenticator.meta.d.ts.map +1 -0
  173. package/dist/foundations/two-factor/entities/totp-authenticator.meta.js +10 -0
  174. package/dist/foundations/two-factor/entities/totp-authenticator.meta.js.map +1 -0
  175. package/dist/foundations/two-factor/entities/totp-setup.d.ts +20 -0
  176. package/dist/foundations/two-factor/entities/totp-setup.d.ts.map +1 -0
  177. package/dist/foundations/two-factor/entities/totp-setup.js +21 -0
  178. package/dist/foundations/two-factor/entities/totp-setup.js.map +1 -0
  179. package/dist/foundations/two-factor/entities/totp-setup.meta.d.ts +3 -0
  180. package/dist/foundations/two-factor/entities/totp-setup.meta.d.ts.map +1 -0
  181. package/dist/foundations/two-factor/entities/totp-setup.meta.js +10 -0
  182. package/dist/foundations/two-factor/entities/totp-setup.meta.js.map +1 -0
  183. package/dist/foundations/two-factor/entities/two-factor-challenge.d.ts +21 -0
  184. package/dist/foundations/two-factor/entities/two-factor-challenge.d.ts.map +1 -0
  185. package/dist/foundations/two-factor/entities/two-factor-challenge.js +22 -0
  186. package/dist/foundations/two-factor/entities/two-factor-challenge.js.map +1 -0
  187. package/dist/foundations/two-factor/entities/two-factor-challenge.meta.d.ts +3 -0
  188. package/dist/foundations/two-factor/entities/two-factor-challenge.meta.d.ts.map +1 -0
  189. package/dist/foundations/two-factor/entities/two-factor-challenge.meta.js +10 -0
  190. package/dist/foundations/two-factor/entities/two-factor-challenge.meta.js.map +1 -0
  191. package/dist/foundations/two-factor/entities/two-factor-config.d.ts +21 -0
  192. package/dist/foundations/two-factor/entities/two-factor-config.d.ts.map +1 -0
  193. package/dist/foundations/two-factor/entities/two-factor-config.js +23 -0
  194. package/dist/foundations/two-factor/entities/two-factor-config.js.map +1 -0
  195. package/dist/foundations/two-factor/entities/two-factor-config.meta.d.ts +3 -0
  196. package/dist/foundations/two-factor/entities/two-factor-config.meta.d.ts.map +1 -0
  197. package/dist/foundations/two-factor/entities/two-factor-config.meta.js +10 -0
  198. package/dist/foundations/two-factor/entities/two-factor-config.meta.js.map +1 -0
  199. package/dist/foundations/two-factor/entities/two-factor-status.d.ts +25 -0
  200. package/dist/foundations/two-factor/entities/two-factor-status.d.ts.map +1 -0
  201. package/dist/foundations/two-factor/entities/two-factor-status.js +22 -0
  202. package/dist/foundations/two-factor/entities/two-factor-status.js.map +1 -0
  203. package/dist/foundations/two-factor/entities/two-factor-status.meta.d.ts +3 -0
  204. package/dist/foundations/two-factor/entities/two-factor-status.meta.d.ts.map +1 -0
  205. package/dist/foundations/two-factor/entities/two-factor-status.meta.js +10 -0
  206. package/dist/foundations/two-factor/entities/two-factor-status.meta.js.map +1 -0
  207. package/dist/foundations/two-factor/entities/two-factor-verification.d.ts +19 -0
  208. package/dist/foundations/two-factor/entities/two-factor-verification.d.ts.map +1 -0
  209. package/dist/foundations/two-factor/entities/two-factor-verification.js +20 -0
  210. package/dist/foundations/two-factor/entities/two-factor-verification.js.map +1 -0
  211. package/dist/foundations/two-factor/entities/two-factor-verification.meta.d.ts +3 -0
  212. package/dist/foundations/two-factor/entities/two-factor-verification.meta.d.ts.map +1 -0
  213. package/dist/foundations/two-factor/entities/two-factor-verification.meta.js +10 -0
  214. package/dist/foundations/two-factor/entities/two-factor-verification.meta.js.map +1 -0
  215. package/dist/foundations/two-factor/guards/pending-auth.guard.d.ts +35 -0
  216. package/dist/foundations/two-factor/guards/pending-auth.guard.d.ts.map +1 -0
  217. package/dist/foundations/two-factor/guards/pending-auth.guard.js +70 -0
  218. package/dist/foundations/two-factor/guards/pending-auth.guard.js.map +1 -0
  219. package/dist/foundations/two-factor/index.d.ts +47 -0
  220. package/dist/foundations/two-factor/index.d.ts.map +1 -0
  221. package/dist/foundations/two-factor/index.js +134 -0
  222. package/dist/foundations/two-factor/index.js.map +1 -0
  223. package/dist/foundations/two-factor/repositories/backup-code.repository.d.ts +34 -0
  224. package/dist/foundations/two-factor/repositories/backup-code.repository.d.ts.map +1 -0
  225. package/dist/foundations/two-factor/repositories/backup-code.repository.js +107 -0
  226. package/dist/foundations/two-factor/repositories/backup-code.repository.js.map +1 -0
  227. package/dist/foundations/two-factor/repositories/passkey.repository.d.ts +51 -0
  228. package/dist/foundations/two-factor/repositories/passkey.repository.d.ts.map +1 -0
  229. package/dist/foundations/two-factor/repositories/passkey.repository.js +159 -0
  230. package/dist/foundations/two-factor/repositories/passkey.repository.js.map +1 -0
  231. package/dist/foundations/two-factor/repositories/pending-two-factor.repository.d.ts +47 -0
  232. package/dist/foundations/two-factor/repositories/pending-two-factor.repository.d.ts.map +1 -0
  233. package/dist/foundations/two-factor/repositories/pending-two-factor.repository.js +159 -0
  234. package/dist/foundations/two-factor/repositories/pending-two-factor.repository.js.map +1 -0
  235. package/dist/foundations/two-factor/repositories/totp-authenticator.repository.d.ts +51 -0
  236. package/dist/foundations/two-factor/repositories/totp-authenticator.repository.d.ts.map +1 -0
  237. package/dist/foundations/two-factor/repositories/totp-authenticator.repository.js +156 -0
  238. package/dist/foundations/two-factor/repositories/totp-authenticator.repository.js.map +1 -0
  239. package/dist/foundations/two-factor/repositories/two-factor-config.repository.d.ts +32 -0
  240. package/dist/foundations/two-factor/repositories/two-factor-config.repository.d.ts.map +1 -0
  241. package/dist/foundations/two-factor/repositories/two-factor-config.repository.js +105 -0
  242. package/dist/foundations/two-factor/repositories/two-factor-config.repository.js.map +1 -0
  243. package/dist/foundations/two-factor/services/backup-code.service.d.ts +95 -0
  244. package/dist/foundations/two-factor/services/backup-code.service.d.ts.map +1 -0
  245. package/dist/foundations/two-factor/services/backup-code.service.js +216 -0
  246. package/dist/foundations/two-factor/services/backup-code.service.js.map +1 -0
  247. package/dist/foundations/two-factor/services/index.d.ts +6 -0
  248. package/dist/foundations/two-factor/services/index.d.ts.map +1 -0
  249. package/dist/foundations/two-factor/services/index.js +14 -0
  250. package/dist/foundations/two-factor/services/index.js.map +1 -0
  251. package/dist/foundations/two-factor/services/passkey.service.d.ts +132 -0
  252. package/dist/foundations/two-factor/services/passkey.service.d.ts.map +1 -0
  253. package/dist/foundations/two-factor/services/passkey.service.js +400 -0
  254. package/dist/foundations/two-factor/services/passkey.service.js.map +1 -0
  255. package/dist/foundations/two-factor/services/totp-encryption.service.d.ts +42 -0
  256. package/dist/foundations/two-factor/services/totp-encryption.service.d.ts.map +1 -0
  257. package/dist/foundations/two-factor/services/totp-encryption.service.js +136 -0
  258. package/dist/foundations/two-factor/services/totp-encryption.service.js.map +1 -0
  259. package/dist/foundations/two-factor/services/totp.service.d.ts +132 -0
  260. package/dist/foundations/two-factor/services/totp.service.d.ts.map +1 -0
  261. package/dist/foundations/two-factor/services/totp.service.js +324 -0
  262. package/dist/foundations/two-factor/services/totp.service.js.map +1 -0
  263. package/dist/foundations/two-factor/services/two-factor.service.d.ts +165 -0
  264. package/dist/foundations/two-factor/services/two-factor.service.d.ts.map +1 -0
  265. package/dist/foundations/two-factor/services/two-factor.service.js +468 -0
  266. package/dist/foundations/two-factor/services/two-factor.service.js.map +1 -0
  267. package/dist/foundations/two-factor/two-factor.module.d.ts +23 -0
  268. package/dist/foundations/two-factor/two-factor.module.d.ts.map +1 -0
  269. package/dist/foundations/two-factor/two-factor.module.js +132 -0
  270. package/dist/foundations/two-factor/two-factor.module.js.map +1 -0
  271. package/dist/foundations/user/repositories/user.repository.d.ts +8 -0
  272. package/dist/foundations/user/repositories/user.repository.d.ts.map +1 -1
  273. package/dist/foundations/user/repositories/user.repository.js +28 -1
  274. package/dist/foundations/user/repositories/user.repository.js.map +1 -1
  275. package/dist/foundations/waitlist/controllers/waitlist.controller.d.ts.map +1 -1
  276. package/dist/foundations/waitlist/controllers/waitlist.controller.js +0 -4
  277. package/dist/foundations/waitlist/controllers/waitlist.controller.js.map +1 -1
  278. package/dist/foundations/waitlist/repositories/waitlist.repository.d.ts.map +1 -1
  279. package/dist/foundations/waitlist/repositories/waitlist.repository.js +0 -2
  280. package/dist/foundations/waitlist/repositories/waitlist.repository.js.map +1 -1
  281. package/dist/foundations/waitlist/services/waitlist.service.d.ts +1 -0
  282. package/dist/foundations/waitlist/services/waitlist.service.d.ts.map +1 -1
  283. package/dist/foundations/waitlist/services/waitlist.service.js +6 -7
  284. package/dist/foundations/waitlist/services/waitlist.service.js.map +1 -1
  285. package/dist/scripts/generate-module/generator.js +13 -13
  286. package/dist/scripts/generate-module/generator.js.map +1 -1
  287. package/dist/scripts/generate-module/index.js +6 -6
  288. package/dist/scripts/generate-module/index.js.map +1 -1
  289. package/dist/scripts/generate-module/utils/file-writer.js +2 -2
  290. package/dist/scripts/generate-module/utils/file-writer.js.map +1 -1
  291. package/dist/scripts/generate-module/utils/module-registrar.js +7 -7
  292. package/dist/scripts/generate-module/utils/module-registrar.js.map +1 -1
  293. package/dist/tools/migrate-entity/index.js +3 -3
  294. package/dist/tools/migrate-entity/lib/descriptor-generator.js +6 -6
  295. package/dist/tools/migrate-entity/lib/entity-migrator.js +13 -13
  296. package/package.json +5 -1
@@ -0,0 +1,124 @@
1
+ import { FastifyReply } from "fastify";
2
+ import { AuthenticatedRequest } from "../../../common/interfaces/authenticated.request.interface";
3
+ import { JsonApiService } from "../../../core/jsonapi/services/jsonapi.service";
4
+ import { AuthService } from "../../auth/services/auth.service";
5
+ import { PasskeyAuthenticationVerifyDTO } from "../dtos/passkey-verify.dto";
6
+ import { TotpVerifyDTO } from "../dtos/totp-verify.dto";
7
+ import { BackupCodeVerifyDTO, TwoFactorChallengeDTO, TwoFactorEnableDTO } from "../dtos/two-factor-verify.dto";
8
+ import { PendingAuthPayload } from "../guards/pending-auth.guard";
9
+ import { BackupCodeService } from "../services/backup-code.service";
10
+ import { PasskeyService } from "../services/passkey.service";
11
+ import { TwoFactorService } from "../services/two-factor.service";
12
+ /**
13
+ * Request with pending auth payload attached.
14
+ */
15
+ interface PendingAuthRequest {
16
+ pendingAuth: PendingAuthPayload;
17
+ }
18
+ /**
19
+ * Two-Factor Authentication Controller
20
+ *
21
+ * Handles 2FA status management and verification during login.
22
+ *
23
+ * Status/Enable/Disable endpoints require full JWT authentication.
24
+ * Verification endpoints require pending 2FA token (issued after password validation).
25
+ */
26
+ export declare class TwoFactorController {
27
+ private readonly jsonApiService;
28
+ private readonly twoFactorService;
29
+ private readonly passkeyService;
30
+ private readonly backupCodeService;
31
+ private readonly authService;
32
+ private readonly logger;
33
+ constructor(jsonApiService: JsonApiService, twoFactorService: TwoFactorService, passkeyService: PasskeyService, backupCodeService: BackupCodeService, authService: AuthService);
34
+ /**
35
+ * GET /auth/two-factor/status
36
+ *
37
+ * Get the 2FA status for the authenticated user.
38
+ * Returns enabled state, preferred method, available methods, and backup codes count.
39
+ */
40
+ getStatus(req: AuthenticatedRequest, reply: FastifyReply): Promise<void>;
41
+ /**
42
+ * POST /auth/two-factor/enable
43
+ *
44
+ * Enable 2FA for the authenticated user.
45
+ * Requires at least one 2FA method (TOTP or passkey) to be configured.
46
+ */
47
+ enable(req: AuthenticatedRequest, reply: FastifyReply, body: TwoFactorEnableDTO): Promise<void>;
48
+ /**
49
+ * POST /auth/two-factor/disable
50
+ *
51
+ * Disable 2FA for the authenticated user.
52
+ */
53
+ disable(req: AuthenticatedRequest, reply: FastifyReply): Promise<void>;
54
+ /**
55
+ * POST /auth/two-factor/challenge
56
+ *
57
+ * Request a 2FA challenge for the specified method.
58
+ * For passkeys, returns WebAuthn authentication options.
59
+ * For TOTP and backup codes, returns a simple acknowledgment (no challenge needed).
60
+ *
61
+ * Requires pending 2FA token from login.
62
+ */
63
+ challenge(req: PendingAuthRequest, reply: FastifyReply, body: TwoFactorChallengeDTO): Promise<void>;
64
+ /**
65
+ * POST /auth/two-factor/verify/totp
66
+ *
67
+ * Verify a TOTP code to complete 2FA login.
68
+ * On success, the full JWT tokens are issued by the auth service.
69
+ *
70
+ * Requires pending 2FA token from login.
71
+ */
72
+ verifyTotp(req: PendingAuthRequest, reply: FastifyReply, body: TotpVerifyDTO): Promise<void>;
73
+ /**
74
+ * POST /auth/two-factor/verify/passkey/options
75
+ *
76
+ * Get passkey authentication options for 2FA verification.
77
+ * Returns WebAuthn options to be passed to navigator.credentials.get().
78
+ *
79
+ * Requires pending 2FA token from login.
80
+ */
81
+ getPasskeyOptions(req: PendingAuthRequest, reply: FastifyReply): Promise<void>;
82
+ /**
83
+ * POST /auth/two-factor/verify/passkey
84
+ *
85
+ * Verify a passkey to complete 2FA login.
86
+ * On success, the full JWT tokens are issued by the auth service.
87
+ *
88
+ * Requires pending 2FA token from login.
89
+ */
90
+ verifyPasskey(req: PendingAuthRequest, reply: FastifyReply, body: PasskeyAuthenticationVerifyDTO): Promise<void>;
91
+ /**
92
+ * POST /auth/two-factor/verify/backup
93
+ *
94
+ * Verify a backup code to complete 2FA login.
95
+ * Backup codes are single-use and will be marked as used after successful verification.
96
+ *
97
+ * Requires pending 2FA token from login.
98
+ */
99
+ verifyBackupCode(req: PendingAuthRequest, reply: FastifyReply, body: BackupCodeVerifyDTO): Promise<void>;
100
+ /**
101
+ * POST /auth/backup-codes/generate
102
+ *
103
+ * Generate new backup codes for the authenticated user.
104
+ * If the user already has backup codes, use regenerate endpoint instead.
105
+ * Returns the plain text codes ONCE - they should be shown to the user.
106
+ */
107
+ generateBackupCodes(req: AuthenticatedRequest, reply: FastifyReply): Promise<void>;
108
+ /**
109
+ * POST /auth/backup-codes/regenerate
110
+ *
111
+ * Regenerate backup codes for the authenticated user.
112
+ * This deletes all existing codes (used and unused) and generates a new batch.
113
+ * Returns the new plain text codes ONCE - they should be shown to the user.
114
+ */
115
+ regenerateBackupCodes(req: AuthenticatedRequest, reply: FastifyReply): Promise<void>;
116
+ /**
117
+ * GET /auth/backup-codes/count
118
+ *
119
+ * Get the count of unused backup codes for the authenticated user.
120
+ */
121
+ getBackupCodesCount(req: AuthenticatedRequest, reply: FastifyReply): Promise<void>;
122
+ }
123
+ export {};
124
+ //# sourceMappingURL=two-factor.controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"two-factor.controller.d.ts","sourceRoot":"","sources":["../../../../src/foundations/two-factor/controllers/two-factor.controller.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAG/G,OAAO,EAAoB,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE;;GAEG;AACH,UAAU,kBAAkB;IAC1B,WAAW,EAAE,kBAAkB,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,qBACa,mBAAmB;IAI5B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAElC,OAAO,CAAC,QAAQ,CAAC,WAAW;IAR9B,OAAO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}
@@ -0,0 +1,352 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var TwoFactorController_1;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.TwoFactorController = void 0;
17
+ const common_1 = require("@nestjs/common");
18
+ const jwt_auth_guard_1 = require("../../../common/guards/jwt.auth.guard");
19
+ const jsonapi_service_1 = require("../../../core/jsonapi/services/jsonapi.service");
20
+ const auth_service_1 = require("../../auth/services/auth.service");
21
+ const passkey_verify_dto_1 = require("../dtos/passkey-verify.dto");
22
+ const totp_verify_dto_1 = require("../dtos/totp-verify.dto");
23
+ const two_factor_verify_dto_1 = require("../dtos/two-factor-verify.dto");
24
+ const two_factor_challenge_1 = require("../entities/two-factor-challenge");
25
+ const two_factor_verification_1 = require("../entities/two-factor-verification");
26
+ const pending_auth_guard_1 = require("../guards/pending-auth.guard");
27
+ const backup_code_service_1 = require("../services/backup-code.service");
28
+ const passkey_service_1 = require("../services/passkey.service");
29
+ const two_factor_service_1 = require("../services/two-factor.service");
30
+ /**
31
+ * Two-Factor Authentication Controller
32
+ *
33
+ * Handles 2FA status management and verification during login.
34
+ *
35
+ * Status/Enable/Disable endpoints require full JWT authentication.
36
+ * Verification endpoints require pending 2FA token (issued after password validation).
37
+ */
38
+ let TwoFactorController = TwoFactorController_1 = class TwoFactorController {
39
+ constructor(jsonApiService, twoFactorService, passkeyService, backupCodeService, authService) {
40
+ this.jsonApiService = jsonApiService;
41
+ this.twoFactorService = twoFactorService;
42
+ this.passkeyService = passkeyService;
43
+ this.backupCodeService = backupCodeService;
44
+ this.authService = authService;
45
+ this.logger = new common_1.Logger(TwoFactorController_1.name);
46
+ }
47
+ /**
48
+ * GET /auth/two-factor/status
49
+ *
50
+ * Get the 2FA status for the authenticated user.
51
+ * Returns enabled state, preferred method, available methods, and backup codes count.
52
+ */
53
+ async getStatus(req, reply) {
54
+ const userId = req.user.userId;
55
+ const response = await this.twoFactorService.getStatus(userId);
56
+ reply.send(response);
57
+ }
58
+ /**
59
+ * POST /auth/two-factor/enable
60
+ *
61
+ * Enable 2FA for the authenticated user.
62
+ * Requires at least one 2FA method (TOTP or passkey) to be configured.
63
+ */
64
+ async enable(req, reply, body) {
65
+ const userId = req.user.userId;
66
+ const response = await this.twoFactorService.enable(userId, body.data.attributes.preferredMethod);
67
+ reply.send(response);
68
+ }
69
+ /**
70
+ * POST /auth/two-factor/disable
71
+ *
72
+ * Disable 2FA for the authenticated user.
73
+ */
74
+ async disable(req, reply) {
75
+ const userId = req.user.userId;
76
+ await this.twoFactorService.disable(userId);
77
+ reply.send();
78
+ }
79
+ /**
80
+ * POST /auth/two-factor/challenge
81
+ *
82
+ * Request a 2FA challenge for the specified method.
83
+ * For passkeys, returns WebAuthn authentication options.
84
+ * For TOTP and backup codes, returns a simple acknowledgment (no challenge needed).
85
+ *
86
+ * Requires pending 2FA token from login.
87
+ */
88
+ async challenge(req, reply, body) {
89
+ const { userId, pendingId } = req.pendingAuth;
90
+ const method = body.data.attributes.method;
91
+ if (method === "passkey") {
92
+ // Generate WebAuthn authentication options - service returns JSON:API
93
+ const optionsResponse = await this.passkeyService.generateAuthenticationOptions({ userId });
94
+ // Build challenge response with passkey options
95
+ const response = this.jsonApiService.buildSingle(two_factor_challenge_1.TwoFactorChallengeDescriptor.model, {
96
+ id: pendingId,
97
+ method: "passkey",
98
+ pendingId: optionsResponse.data.attributes.pendingId,
99
+ options: optionsResponse.data.attributes.options,
100
+ });
101
+ reply.send(response);
102
+ return;
103
+ }
104
+ // For TOTP and backup codes, no challenge is needed - just return available methods
105
+ const methods = await this.twoFactorService.getAvailableMethods(userId);
106
+ const response = this.jsonApiService.buildSingle(two_factor_challenge_1.TwoFactorChallengeDescriptor.model, {
107
+ id: pendingId,
108
+ method,
109
+ pendingId,
110
+ availableMethods: methods,
111
+ });
112
+ reply.send(response);
113
+ }
114
+ /**
115
+ * POST /auth/two-factor/verify/totp
116
+ *
117
+ * Verify a TOTP code to complete 2FA login.
118
+ * On success, the full JWT tokens are issued by the auth service.
119
+ *
120
+ * Requires pending 2FA token from login.
121
+ */
122
+ async verifyTotp(req, reply, body) {
123
+ const { pendingId, userId } = req.pendingAuth;
124
+ const verificationResult = await this.twoFactorService.verifyTotp(pendingId, body.data.attributes.code);
125
+ // Check if verification was successful
126
+ if (verificationResult.data?.attributes?.success) {
127
+ // Return full auth tokens
128
+ const authResponse = await this.authService.completeTwoFactorLogin(userId);
129
+ reply.send(authResponse);
130
+ return;
131
+ }
132
+ // Verification failed - return the error response
133
+ reply.send(verificationResult);
134
+ }
135
+ /**
136
+ * POST /auth/two-factor/verify/passkey/options
137
+ *
138
+ * Get passkey authentication options for 2FA verification.
139
+ * Returns WebAuthn options to be passed to navigator.credentials.get().
140
+ *
141
+ * Requires pending 2FA token from login.
142
+ */
143
+ async getPasskeyOptions(req, reply) {
144
+ const { userId } = req.pendingAuth;
145
+ const response = await this.passkeyService.generateAuthenticationOptions({ userId });
146
+ reply.send(response);
147
+ }
148
+ /**
149
+ * POST /auth/two-factor/verify/passkey
150
+ *
151
+ * Verify a passkey to complete 2FA login.
152
+ * On success, the full JWT tokens are issued by the auth service.
153
+ *
154
+ * Requires pending 2FA token from login.
155
+ */
156
+ async verifyPasskey(req, reply, body) {
157
+ const { pendingId } = body.data.attributes;
158
+ const passkeyId = await this.passkeyService.verifyAuthentication({
159
+ pendingId,
160
+ response: body.data.attributes.response,
161
+ });
162
+ // Delete the login pending session
163
+ await this.twoFactorService.deletePendingSession(req.pendingAuth.pendingId);
164
+ if (passkeyId) {
165
+ // Verification successful - return full auth tokens
166
+ const authResponse = await this.authService.completeTwoFactorLogin(req.pendingAuth.userId);
167
+ reply.send(authResponse);
168
+ return;
169
+ }
170
+ // Verification failed
171
+ const response = this.jsonApiService.buildSingle(two_factor_verification_1.TwoFactorVerificationDescriptor.model, {
172
+ id: req.pendingAuth.pendingId,
173
+ success: false,
174
+ });
175
+ reply.send(response);
176
+ }
177
+ /**
178
+ * POST /auth/two-factor/verify/backup
179
+ *
180
+ * Verify a backup code to complete 2FA login.
181
+ * Backup codes are single-use and will be marked as used after successful verification.
182
+ *
183
+ * Requires pending 2FA token from login.
184
+ */
185
+ async verifyBackupCode(req, reply, body) {
186
+ const { pendingId, userId } = req.pendingAuth;
187
+ const verificationResult = await this.twoFactorService.verifyBackupCode(pendingId, body.data.attributes.code);
188
+ // Check if verification was successful
189
+ if (verificationResult.data?.attributes?.success) {
190
+ // Return full auth tokens
191
+ const authResponse = await this.authService.completeTwoFactorLogin(userId);
192
+ reply.send(authResponse);
193
+ return;
194
+ }
195
+ // Verification failed - return the error response
196
+ reply.send(verificationResult);
197
+ }
198
+ /**
199
+ * POST /auth/backup-codes/generate
200
+ *
201
+ * Generate new backup codes for the authenticated user.
202
+ * If the user already has backup codes, use regenerate endpoint instead.
203
+ * Returns the plain text codes ONCE - they should be shown to the user.
204
+ */
205
+ async generateBackupCodes(req, reply) {
206
+ const userId = req.user.userId;
207
+ const response = await this.backupCodeService.generateCodes({ userId });
208
+ // Update backup codes count in 2FA config
209
+ await this.twoFactorService.updateBackupCodesCount(userId);
210
+ reply.send(response);
211
+ }
212
+ /**
213
+ * POST /auth/backup-codes/regenerate
214
+ *
215
+ * Regenerate backup codes for the authenticated user.
216
+ * This deletes all existing codes (used and unused) and generates a new batch.
217
+ * Returns the new plain text codes ONCE - they should be shown to the user.
218
+ */
219
+ async regenerateBackupCodes(req, reply) {
220
+ const userId = req.user.userId;
221
+ const response = await this.backupCodeService.regenerateCodes({ userId });
222
+ // Update backup codes count in 2FA config
223
+ await this.twoFactorService.updateBackupCodesCount(userId);
224
+ reply.send(response);
225
+ }
226
+ /**
227
+ * GET /auth/backup-codes/count
228
+ *
229
+ * Get the count of unused backup codes for the authenticated user.
230
+ */
231
+ async getBackupCodesCount(req, reply) {
232
+ const userId = req.user.userId;
233
+ const response = await this.backupCodeService.getUnusedCount({ userId });
234
+ reply.send(response);
235
+ }
236
+ };
237
+ exports.TwoFactorController = TwoFactorController;
238
+ __decorate([
239
+ (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
240
+ (0, common_1.Get)("two-factor/status"),
241
+ __param(0, (0, common_1.Req)()),
242
+ __param(1, (0, common_1.Res)()),
243
+ __metadata("design:type", Function),
244
+ __metadata("design:paramtypes", [Object, Object]),
245
+ __metadata("design:returntype", Promise)
246
+ ], TwoFactorController.prototype, "getStatus", null);
247
+ __decorate([
248
+ (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
249
+ (0, common_1.Post)("two-factor/enable"),
250
+ __param(0, (0, common_1.Req)()),
251
+ __param(1, (0, common_1.Res)()),
252
+ __param(2, (0, common_1.Body)()),
253
+ __metadata("design:type", Function),
254
+ __metadata("design:paramtypes", [Object, Object, two_factor_verify_dto_1.TwoFactorEnableDTO]),
255
+ __metadata("design:returntype", Promise)
256
+ ], TwoFactorController.prototype, "enable", null);
257
+ __decorate([
258
+ (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
259
+ (0, common_1.Post)("two-factor/disable"),
260
+ (0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
261
+ __param(0, (0, common_1.Req)()),
262
+ __param(1, (0, common_1.Res)()),
263
+ __metadata("design:type", Function),
264
+ __metadata("design:paramtypes", [Object, Object]),
265
+ __metadata("design:returntype", Promise)
266
+ ], TwoFactorController.prototype, "disable", null);
267
+ __decorate([
268
+ (0, common_1.UseGuards)(pending_auth_guard_1.PendingAuthGuard),
269
+ (0, common_1.Post)("two-factor/challenge"),
270
+ __param(0, (0, common_1.Req)()),
271
+ __param(1, (0, common_1.Res)()),
272
+ __param(2, (0, common_1.Body)()),
273
+ __metadata("design:type", Function),
274
+ __metadata("design:paramtypes", [Object, Object, two_factor_verify_dto_1.TwoFactorChallengeDTO]),
275
+ __metadata("design:returntype", Promise)
276
+ ], TwoFactorController.prototype, "challenge", null);
277
+ __decorate([
278
+ (0, common_1.UseGuards)(pending_auth_guard_1.PendingAuthGuard),
279
+ (0, common_1.Post)("two-factor/verify/totp"),
280
+ __param(0, (0, common_1.Req)()),
281
+ __param(1, (0, common_1.Res)()),
282
+ __param(2, (0, common_1.Body)()),
283
+ __metadata("design:type", Function),
284
+ __metadata("design:paramtypes", [Object, Object, totp_verify_dto_1.TotpVerifyDTO]),
285
+ __metadata("design:returntype", Promise)
286
+ ], TwoFactorController.prototype, "verifyTotp", null);
287
+ __decorate([
288
+ (0, common_1.UseGuards)(pending_auth_guard_1.PendingAuthGuard),
289
+ (0, common_1.Post)("two-factor/verify/passkey/options"),
290
+ __param(0, (0, common_1.Req)()),
291
+ __param(1, (0, common_1.Res)()),
292
+ __metadata("design:type", Function),
293
+ __metadata("design:paramtypes", [Object, Object]),
294
+ __metadata("design:returntype", Promise)
295
+ ], TwoFactorController.prototype, "getPasskeyOptions", null);
296
+ __decorate([
297
+ (0, common_1.UseGuards)(pending_auth_guard_1.PendingAuthGuard),
298
+ (0, common_1.Post)("two-factor/verify/passkey"),
299
+ __param(0, (0, common_1.Req)()),
300
+ __param(1, (0, common_1.Res)()),
301
+ __param(2, (0, common_1.Body)()),
302
+ __metadata("design:type", Function),
303
+ __metadata("design:paramtypes", [Object, Object, passkey_verify_dto_1.PasskeyAuthenticationVerifyDTO]),
304
+ __metadata("design:returntype", Promise)
305
+ ], TwoFactorController.prototype, "verifyPasskey", null);
306
+ __decorate([
307
+ (0, common_1.UseGuards)(pending_auth_guard_1.PendingAuthGuard),
308
+ (0, common_1.Post)("two-factor/verify/backup"),
309
+ __param(0, (0, common_1.Req)()),
310
+ __param(1, (0, common_1.Res)()),
311
+ __param(2, (0, common_1.Body)()),
312
+ __metadata("design:type", Function),
313
+ __metadata("design:paramtypes", [Object, Object, two_factor_verify_dto_1.BackupCodeVerifyDTO]),
314
+ __metadata("design:returntype", Promise)
315
+ ], TwoFactorController.prototype, "verifyBackupCode", null);
316
+ __decorate([
317
+ (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
318
+ (0, common_1.Post)("backup-codes/generate"),
319
+ __param(0, (0, common_1.Req)()),
320
+ __param(1, (0, common_1.Res)()),
321
+ __metadata("design:type", Function),
322
+ __metadata("design:paramtypes", [Object, Object]),
323
+ __metadata("design:returntype", Promise)
324
+ ], TwoFactorController.prototype, "generateBackupCodes", null);
325
+ __decorate([
326
+ (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
327
+ (0, common_1.Post)("backup-codes/regenerate"),
328
+ __param(0, (0, common_1.Req)()),
329
+ __param(1, (0, common_1.Res)()),
330
+ __metadata("design:type", Function),
331
+ __metadata("design:paramtypes", [Object, Object]),
332
+ __metadata("design:returntype", Promise)
333
+ ], TwoFactorController.prototype, "regenerateBackupCodes", null);
334
+ __decorate([
335
+ (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
336
+ (0, common_1.Get)("backup-codes/count"),
337
+ __param(0, (0, common_1.Req)()),
338
+ __param(1, (0, common_1.Res)()),
339
+ __metadata("design:type", Function),
340
+ __metadata("design:paramtypes", [Object, Object]),
341
+ __metadata("design:returntype", Promise)
342
+ ], TwoFactorController.prototype, "getBackupCodesCount", null);
343
+ exports.TwoFactorController = TwoFactorController = TwoFactorController_1 = __decorate([
344
+ (0, common_1.Controller)("auth"),
345
+ __param(4, (0, common_1.Inject)((0, common_1.forwardRef)(() => auth_service_1.AuthService))),
346
+ __metadata("design:paramtypes", [jsonapi_service_1.JsonApiService,
347
+ two_factor_service_1.TwoFactorService,
348
+ passkey_service_1.PasskeyService,
349
+ backup_code_service_1.BackupCodeService,
350
+ auth_service_1.AuthService])
351
+ ], TwoFactorController);
352
+ //# sourceMappingURL=two-factor.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"two-factor.controller.js","sourceRoot":"","sources":["../../../../src/foundations/two-factor/controllers/two-factor.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAawB;AAGxB,0EAAqE;AAErE,oFAAgF;AAChF,mEAA+D;AAC/D,mEAA4E;AAC5E,6DAAwD;AACxD,yEAA+G;AAC/G,2EAAgF;AAChF,iFAAsF;AACtF,qEAAoF;AACpF,yEAAoE;AACpE,iEAA6D;AAC7D,uEAAkE;AASlE;;;;;;;GAOG;AAEI,IAAM,mBAAmB,2BAAzB,MAAM,mBAAmB;IAG9B,YACmB,cAA8B,EAC9B,gBAAkC,EAClC,cAA8B,EAC9B,iBAAoC,EAErD,WAAyC;QALxB,mBAAc,GAAd,cAAc,CAAgB;QAC9B,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,mBAAc,GAAd,cAAc,CAAgB;QAC9B,sBAAiB,GAAjB,iBAAiB,CAAmB;QAEpC,gBAAW,GAAX,WAAW,CAAa;QAR1B,WAAM,GAAW,IAAI,eAAM,CAAC,qBAAmB,CAAC,IAAI,CAAC,CAAC;IASpE,CAAC;IAEJ;;;;;OAKG;IAGG,AAAN,KAAK,CAAC,SAAS,CAAQ,GAAyB,EAAS,KAAmB;QAC1E,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;QAC/B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC/D,KAAK,CAAC,IAAI,C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ACC,WAAA,IAAA,YAAG,GAAE,CAAA;IAA6B,WAAA,IAAA,YAAG,GAAE,CAAA;;;;8DAIjE;8BA9PU,mBAAmB;IAD/B,IAAA,mBAAU,EAAC,MAAM,CAAC;IASd,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,0BAAW,CAAC,CAAC,CAAA;qCAJL,gCAAc;QACZ,qCAAgB;QAClB,gCAAc;QACX,uCAAiB;QAEvB,0BAAW;GAThC,mBAAmB,CA+P/B"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Attributes for passkey registration options request.
3
+ */
4
+ export declare class PasskeyRegistrationOptionsAttributesDTO {
5
+ /**
6
+ * The user's username or email (displayed in the passkey prompt).
7
+ */
8
+ userName: string;
9
+ /**
10
+ * The user's display name (optional, defaults to userName).
11
+ */
12
+ userDisplayName?: string;
13
+ }
14
+ /**
15
+ * Data wrapper for passkey registration options request.
16
+ */
17
+ export declare class PasskeyRegistrationOptionsDataDTO {
18
+ type: string;
19
+ attributes: PasskeyRegistrationOptionsAttributesDTO;
20
+ }
21
+ /**
22
+ * DTO for passkey registration options request.
23
+ *
24
+ * Used to generate WebAuthn registration options for creating a new passkey.
25
+ * Returns options to be passed to navigator.credentials.create().
26
+ *
27
+ * Endpoint: POST /auth/passkey/register/options
28
+ */
29
+ export declare class PasskeyRegistrationOptionsDTO {
30
+ data: PasskeyRegistrationOptionsDataDTO;
31
+ }
32
+ /**
33
+ * DTO for passkey authentication options request.
34
+ *
35
+ * No attributes needed - uses userId from token.
36
+ * Returns options to be passed to navigator.credentials.get().
37
+ *
38
+ * Endpoint: POST /auth/two-factor/verify/passkey/options
39
+ */
40
+ export declare class PasskeyAuthenticationOptionsDTO {
41
+ }
42
+ //# sourceMappingURL=passkey-options.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"passkey-options.dto.d.ts","sourceRoot":"","sources":["../../../../src/foundations/two-factor/dtos/passkey-options.dto.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,qBAAa,uCAAuC;IAClD;;OAEG;IAIH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IAGH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,qBAAa,iCAAiC;IAE5C,IAAI,EAAE,MAAM,CAAC;IAKb,UAAU,EAAE,uCAAuC,CAAC;CACrD;AAED;;;;;;;GAOG;AACH,qBAAa,6BAA6B;IAIxC,IAAI,EAAE,iCAAiC,CAAC;CACzC;AAED;;;;;;;GAOG;AACH,qBAAa,+BAA+B;CAE3C"}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PasskeyAuthenticationOptionsDTO = exports.PasskeyRegistrationOptionsDTO = exports.PasskeyRegistrationOptionsDataDTO = exports.PasskeyRegistrationOptionsAttributesDTO = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ const passkey_meta_1 = require("../entities/passkey.meta");
16
+ /**
17
+ * Attributes for passkey registration options request.
18
+ */
19
+ class PasskeyRegistrationOptionsAttributesDTO {
20
+ }
21
+ exports.PasskeyRegistrationOptionsAttributesDTO = PasskeyRegistrationOptionsAttributesDTO;
22
+ __decorate([
23
+ (0, class_validator_1.IsDefined)(),
24
+ (0, class_validator_1.IsNotEmpty)(),
25
+ (0, class_validator_1.IsString)(),
26
+ __metadata("design:type", String)
27
+ ], PasskeyRegistrationOptionsAttributesDTO.prototype, "userName", void 0);
28
+ __decorate([
29
+ (0, class_validator_1.IsOptional)(),
30
+ (0, class_validator_1.IsString)(),
31
+ __metadata("design:type", String)
32
+ ], PasskeyRegistrationOptionsAttributesDTO.prototype, "userDisplayName", void 0);
33
+ /**
34
+ * Data wrapper for passkey registration options request.
35
+ */
36
+ class PasskeyRegistrationOptionsDataDTO {
37
+ }
38
+ exports.PasskeyRegistrationOptionsDataDTO = PasskeyRegistrationOptionsDataDTO;
39
+ __decorate([
40
+ (0, class_validator_1.Equals)(passkey_meta_1.passkeyMeta.endpoint),
41
+ __metadata("design:type", String)
42
+ ], PasskeyRegistrationOptionsDataDTO.prototype, "type", void 0);
43
+ __decorate([
44
+ (0, class_validator_1.ValidateNested)(),
45
+ (0, class_validator_1.IsNotEmpty)(),
46
+ (0, class_transformer_1.Type)(() => PasskeyRegistrationOptionsAttributesDTO),
47
+ __metadata("design:type", PasskeyRegistrationOptionsAttributesDTO)
48
+ ], PasskeyRegistrationOptionsDataDTO.prototype, "attributes", void 0);
49
+ /**
50
+ * DTO for passkey registration options request.
51
+ *
52
+ * Used to generate WebAuthn registration options for creating a new passkey.
53
+ * Returns options to be passed to navigator.credentials.create().
54
+ *
55
+ * Endpoint: POST /auth/passkey/register/options
56
+ */
57
+ class PasskeyRegistrationOptionsDTO {
58
+ }
59
+ exports.PasskeyRegistrationOptionsDTO = PasskeyRegistrationOptionsDTO;
60
+ __decorate([
61
+ (0, class_validator_1.ValidateNested)(),
62
+ (0, class_validator_1.IsNotEmpty)(),
63
+ (0, class_transformer_1.Type)(() => PasskeyRegistrationOptionsDataDTO),
64
+ __metadata("design:type", PasskeyRegistrationOptionsDataDTO)
65
+ ], PasskeyRegistrationOptionsDTO.prototype, "data", void 0);
66
+ /**
67
+ * DTO for passkey authentication options request.
68
+ *
69
+ * No attributes needed - uses userId from token.
70
+ * Returns options to be passed to navigator.credentials.get().
71
+ *
72
+ * Endpoint: POST /auth/two-factor/verify/passkey/options
73
+ */
74
+ class PasskeyAuthenticationOptionsDTO {
75
+ }
76
+ exports.PasskeyAuthenticationOptionsDTO = PasskeyAuthenticationOptionsDTO;
77
+ //# sourceMappingURL=passkey-options.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"passkey-options.dto.js","sourceRoot":"","sources":["../../../../src/foundations/two-factor/dtos/passkey-options.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAyC;AACzC,qDAAsG;AACtG,2DAAuD;AAEvD;;GAEG;AACH,MAAa,uCAAuC;CAenD;AAfD,0FAeC;AARC;IAHC,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;yEACM;AAOjB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;gFACc;AAG3B;;GAEG;AACH,MAAa,iCAAiC;CAQ7C;AARD,8EAQC;AANC;IADC,IAAA,wBAAM,EAAC,0BAAW,CAAC,QAAQ,CAAC;;+DAChB;AAKb;IAHC,IAAA,gCAAc,GAAE;IAChB,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,uCAAuC,CAAC;8BACxC,uCAAuC;qEAAC;AAGtD;;;;;;;GAOG;AACH,MAAa,6BAA6B;CAKzC;AALD,sEAKC;AADC;IAHC,IAAA,gCAAc,GAAE;IAChB,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,iCAAiC,CAAC;8BACxC,iCAAiC;2DAAC;AAG1C;;;;;;;GAOG;AACH,MAAa,+BAA+B;CAE3C;AAFD,0EAEC"}