@intlayer/backend 7.0.8 → 7.0.9-canary.2

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 (909) hide show
  1. package/README.md +6 -5
  2. package/dist/assets/utils/AI/askDocQuestion/embeddings/frequent_questions/en/package_version_error.json +3080 -0
  3. package/dist/cjs/controllers/dictionary.controller.cjs +64 -41
  4. package/dist/cjs/controllers/dictionary.controller.cjs.map +1 -1
  5. package/dist/cjs/emails/MagicLinkEmail.cjs +242 -0
  6. package/dist/cjs/emails/MagicLinkEmail.cjs.map +1 -0
  7. package/dist/cjs/index.cjs +1 -1
  8. package/dist/cjs/index.cjs.map +1 -1
  9. package/dist/cjs/node_modules/@authenio/xml-encryption/lib/index.cjs +16 -0
  10. package/dist/cjs/node_modules/@authenio/xml-encryption/lib/index.cjs.map +1 -0
  11. package/dist/cjs/node_modules/@authenio/xml-encryption/lib/templates/encrypted-key.tpl.xml.cjs +25 -0
  12. package/dist/cjs/node_modules/@authenio/xml-encryption/lib/templates/encrypted-key.tpl.xml.cjs.map +1 -0
  13. package/dist/cjs/node_modules/@authenio/xml-encryption/lib/templates/keyinfo.tpl.xml.cjs +31 -0
  14. package/dist/cjs/node_modules/@authenio/xml-encryption/lib/templates/keyinfo.tpl.xml.cjs.map +1 -0
  15. package/dist/cjs/node_modules/@authenio/xml-encryption/lib/utils.cjs +38 -0
  16. package/dist/cjs/node_modules/@authenio/xml-encryption/lib/utils.cjs.map +1 -0
  17. package/dist/cjs/node_modules/@authenio/xml-encryption/lib/xmlenc.cjs +231 -0
  18. package/dist/cjs/node_modules/@authenio/xml-encryption/lib/xmlenc.cjs.map +1 -0
  19. package/dist/cjs/node_modules/@better-auth/sso/dist/index.cjs +1210 -0
  20. package/dist/cjs/node_modules/@better-auth/sso/dist/index.cjs.map +1 -0
  21. package/dist/cjs/node_modules/@better-fetch/fetch/dist/index.cjs +362 -0
  22. package/dist/cjs/node_modules/@better-fetch/fetch/dist/index.cjs.map +1 -0
  23. package/dist/cjs/node_modules/@xmldom/is-dom-node/dist/index.cjs +89 -0
  24. package/dist/cjs/node_modules/@xmldom/is-dom-node/dist/index.cjs.map +1 -0
  25. package/dist/cjs/node_modules/@xmldom/xmldom/lib/conventions.cjs +110 -0
  26. package/dist/cjs/node_modules/@xmldom/xmldom/lib/conventions.cjs.map +1 -0
  27. package/dist/cjs/node_modules/@xmldom/xmldom/lib/dom-parser.cjs +248 -0
  28. package/dist/cjs/node_modules/@xmldom/xmldom/lib/dom-parser.cjs.map +1 -0
  29. package/dist/cjs/node_modules/@xmldom/xmldom/lib/dom.cjs +1309 -0
  30. package/dist/cjs/node_modules/@xmldom/xmldom/lib/dom.cjs.map +1 -0
  31. package/dist/cjs/node_modules/@xmldom/xmldom/lib/entities.cjs +2176 -0
  32. package/dist/cjs/node_modules/@xmldom/xmldom/lib/entities.cjs.map +1 -0
  33. package/dist/cjs/node_modules/@xmldom/xmldom/lib/index.cjs +20 -0
  34. package/dist/cjs/node_modules/@xmldom/xmldom/lib/index.cjs.map +1 -0
  35. package/dist/cjs/node_modules/@xmldom/xmldom/lib/sax.cjs +499 -0
  36. package/dist/cjs/node_modules/@xmldom/xmldom/lib/sax.cjs.map +1 -0
  37. package/dist/cjs/node_modules/asn1/lib/ber/errors.cjs +20 -0
  38. package/dist/cjs/node_modules/asn1/lib/ber/errors.cjs.map +1 -0
  39. package/dist/cjs/node_modules/asn1/lib/ber/index.cjs +28 -0
  40. package/dist/cjs/node_modules/asn1/lib/ber/index.cjs.map +1 -0
  41. package/dist/cjs/node_modules/asn1/lib/ber/reader.cjs +167 -0
  42. package/dist/cjs/node_modules/asn1/lib/ber/reader.cjs.map +1 -0
  43. package/dist/cjs/node_modules/asn1/lib/ber/types.cjs +47 -0
  44. package/dist/cjs/node_modules/asn1/lib/ber/types.cjs.map +1 -0
  45. package/dist/cjs/node_modules/asn1/lib/ber/writer.cjs +223 -0
  46. package/dist/cjs/node_modules/asn1/lib/ber/writer.cjs.map +1 -0
  47. package/dist/cjs/node_modules/asn1/lib/index.cjs +21 -0
  48. package/dist/cjs/node_modules/asn1/lib/index.cjs.map +1 -0
  49. package/dist/cjs/node_modules/camelcase/index.cjs +78 -0
  50. package/dist/cjs/node_modules/camelcase/index.cjs.map +1 -0
  51. package/dist/cjs/node_modules/escape-html/index.cjs +71 -0
  52. package/dist/cjs/node_modules/escape-html/index.cjs.map +1 -0
  53. package/dist/cjs/node_modules/fast-xml-parser/src/fxp.cjs +9 -0
  54. package/dist/cjs/node_modules/fast-xml-parser/src/fxp.cjs.map +1 -0
  55. package/dist/cjs/node_modules/fast-xml-parser/src/util.cjs +29 -0
  56. package/dist/cjs/node_modules/fast-xml-parser/src/util.cjs.map +1 -0
  57. package/dist/cjs/node_modules/fast-xml-parser/src/validator.cjs +244 -0
  58. package/dist/cjs/node_modules/fast-xml-parser/src/validator.cjs.map +1 -0
  59. package/dist/cjs/node_modules/jose/dist/webapi/lib/base64.cjs +14 -0
  60. package/dist/cjs/node_modules/jose/dist/webapi/lib/base64.cjs.map +1 -0
  61. package/dist/cjs/node_modules/jose/dist/webapi/lib/buffer_utils.cjs +10 -0
  62. package/dist/cjs/node_modules/jose/dist/webapi/lib/buffer_utils.cjs.map +1 -0
  63. package/dist/cjs/node_modules/jose/dist/webapi/lib/is_object.cjs +17 -0
  64. package/dist/cjs/node_modules/jose/dist/webapi/lib/is_object.cjs.map +1 -0
  65. package/dist/cjs/node_modules/jose/dist/webapi/util/base64url.cjs +20 -0
  66. package/dist/cjs/node_modules/jose/dist/webapi/util/base64url.cjs.map +1 -0
  67. package/dist/cjs/node_modules/jose/dist/webapi/util/decode_jwt.cjs +32 -0
  68. package/dist/cjs/node_modules/jose/dist/webapi/util/decode_jwt.cjs.map +1 -0
  69. package/dist/cjs/node_modules/jose/dist/webapi/util/errors.cjs +28 -0
  70. package/dist/cjs/node_modules/jose/dist/webapi/util/errors.cjs.map +1 -0
  71. package/dist/cjs/node_modules/node-forge/lib/aes.cjs +604 -0
  72. package/dist/cjs/node_modules/node-forge/lib/aes.cjs.map +1 -0
  73. package/dist/cjs/node_modules/node-forge/lib/aesCipherSuites.cjs +202 -0
  74. package/dist/cjs/node_modules/node-forge/lib/aesCipherSuites.cjs.map +1 -0
  75. package/dist/cjs/node_modules/node-forge/lib/asn1-validator.cjs +83 -0
  76. package/dist/cjs/node_modules/node-forge/lib/asn1-validator.cjs.map +1 -0
  77. package/dist/cjs/node_modules/node-forge/lib/asn1.cjs +945 -0
  78. package/dist/cjs/node_modules/node-forge/lib/asn1.cjs.map +1 -0
  79. package/dist/cjs/node_modules/node-forge/lib/baseN.cjs +144 -0
  80. package/dist/cjs/node_modules/node-forge/lib/baseN.cjs.map +1 -0
  81. package/dist/cjs/node_modules/node-forge/lib/cipher.cjs +193 -0
  82. package/dist/cjs/node_modules/node-forge/lib/cipher.cjs.map +1 -0
  83. package/dist/cjs/node_modules/node-forge/lib/cipherModes.cjs +604 -0
  84. package/dist/cjs/node_modules/node-forge/lib/cipherModes.cjs.map +1 -0
  85. package/dist/cjs/node_modules/node-forge/lib/des.cjs +1194 -0
  86. package/dist/cjs/node_modules/node-forge/lib/des.cjs.map +1 -0
  87. package/dist/cjs/node_modules/node-forge/lib/ed25519.cjs +1027 -0
  88. package/dist/cjs/node_modules/node-forge/lib/ed25519.cjs.map +1 -0
  89. package/dist/cjs/node_modules/node-forge/lib/forge.cjs +22 -0
  90. package/dist/cjs/node_modules/node-forge/lib/forge.cjs.map +1 -0
  91. package/dist/cjs/node_modules/node-forge/lib/hmac.cjs +114 -0
  92. package/dist/cjs/node_modules/node-forge/lib/hmac.cjs.map +1 -0
  93. package/dist/cjs/node_modules/node-forge/lib/index.cjs +73 -0
  94. package/dist/cjs/node_modules/node-forge/lib/index.cjs.map +1 -0
  95. package/dist/cjs/node_modules/node-forge/lib/jsbn.cjs +1263 -0
  96. package/dist/cjs/node_modules/node-forge/lib/jsbn.cjs.map +1 -0
  97. package/dist/cjs/node_modules/node-forge/lib/kem.cjs +153 -0
  98. package/dist/cjs/node_modules/node-forge/lib/kem.cjs.map +1 -0
  99. package/dist/cjs/node_modules/node-forge/lib/log.cjs +248 -0
  100. package/dist/cjs/node_modules/node-forge/lib/log.cjs.map +1 -0
  101. package/dist/cjs/node_modules/node-forge/lib/md.all.cjs +31 -0
  102. package/dist/cjs/node_modules/node-forge/lib/md.all.cjs.map +1 -0
  103. package/dist/cjs/node_modules/node-forge/lib/md.cjs +25 -0
  104. package/dist/cjs/node_modules/node-forge/lib/md.cjs.map +1 -0
  105. package/dist/cjs/node_modules/node-forge/lib/md5.cjs +331 -0
  106. package/dist/cjs/node_modules/node-forge/lib/md5.cjs.map +1 -0
  107. package/dist/cjs/node_modules/node-forge/lib/mgf.cjs +27 -0
  108. package/dist/cjs/node_modules/node-forge/lib/mgf.cjs.map +1 -0
  109. package/dist/cjs/node_modules/node-forge/lib/mgf1.cjs +51 -0
  110. package/dist/cjs/node_modules/node-forge/lib/mgf1.cjs.map +1 -0
  111. package/dist/cjs/node_modules/node-forge/lib/oids.cjs +160 -0
  112. package/dist/cjs/node_modules/node-forge/lib/oids.cjs.map +1 -0
  113. package/dist/cjs/node_modules/node-forge/lib/pbe.cjs +822 -0
  114. package/dist/cjs/node_modules/node-forge/lib/pbe.cjs.map +1 -0
  115. package/dist/cjs/node_modules/node-forge/lib/pbkdf2.cjs +132 -0
  116. package/dist/cjs/node_modules/node-forge/lib/pbkdf2.cjs.map +1 -0
  117. package/dist/cjs/node_modules/node-forge/lib/pem.cjs +182 -0
  118. package/dist/cjs/node_modules/node-forge/lib/pem.cjs.map +1 -0
  119. package/dist/cjs/node_modules/node-forge/lib/pkcs1.cjs +207 -0
  120. package/dist/cjs/node_modules/node-forge/lib/pkcs1.cjs.map +1 -0
  121. package/dist/cjs/node_modules/node-forge/lib/pkcs12.cjs +730 -0
  122. package/dist/cjs/node_modules/node-forge/lib/pkcs12.cjs.map +1 -0
  123. package/dist/cjs/node_modules/node-forge/lib/pkcs7.cjs +648 -0
  124. package/dist/cjs/node_modules/node-forge/lib/pkcs7.cjs.map +1 -0
  125. package/dist/cjs/node_modules/node-forge/lib/pkcs7asn1.cjs +412 -0
  126. package/dist/cjs/node_modules/node-forge/lib/pkcs7asn1.cjs.map +1 -0
  127. package/dist/cjs/node_modules/node-forge/lib/pki.cjs +108 -0
  128. package/dist/cjs/node_modules/node-forge/lib/pki.cjs.map +1 -0
  129. package/dist/cjs/node_modules/node-forge/lib/prime.cjs +200 -0
  130. package/dist/cjs/node_modules/node-forge/lib/prime.cjs.map +1 -0
  131. package/dist/cjs/node_modules/node-forge/lib/prng.cjs +297 -0
  132. package/dist/cjs/node_modules/node-forge/lib/prng.cjs.map +1 -0
  133. package/dist/cjs/node_modules/node-forge/lib/pss.cjs +148 -0
  134. package/dist/cjs/node_modules/node-forge/lib/pss.cjs.map +1 -0
  135. package/dist/cjs/node_modules/node-forge/lib/random.cjs +148 -0
  136. package/dist/cjs/node_modules/node-forge/lib/random.cjs.map +1 -0
  137. package/dist/cjs/node_modules/node-forge/lib/rc2.cjs +545 -0
  138. package/dist/cjs/node_modules/node-forge/lib/rc2.cjs.map +1 -0
  139. package/dist/cjs/node_modules/node-forge/lib/rsa.cjs +1306 -0
  140. package/dist/cjs/node_modules/node-forge/lib/rsa.cjs.map +1 -0
  141. package/dist/cjs/node_modules/node-forge/lib/sha1.cjs +237 -0
  142. package/dist/cjs/node_modules/node-forge/lib/sha1.cjs.map +1 -0
  143. package/dist/cjs/node_modules/node-forge/lib/sha256.cjs +274 -0
  144. package/dist/cjs/node_modules/node-forge/lib/sha256.cjs.map +1 -0
  145. package/dist/cjs/node_modules/node-forge/lib/sha512.cjs +420 -0
  146. package/dist/cjs/node_modules/node-forge/lib/sha512.cjs.map +1 -0
  147. package/dist/cjs/node_modules/node-forge/lib/ssh.cjs +201 -0
  148. package/dist/cjs/node_modules/node-forge/lib/ssh.cjs.map +1 -0
  149. package/dist/cjs/node_modules/node-forge/lib/tls.cjs +3662 -0
  150. package/dist/cjs/node_modules/node-forge/lib/tls.cjs.map +1 -0
  151. package/dist/cjs/node_modules/node-forge/lib/util.cjs +2124 -0
  152. package/dist/cjs/node_modules/node-forge/lib/util.cjs.map +1 -0
  153. package/dist/cjs/node_modules/node-forge/lib/x509.cjs +2171 -0
  154. package/dist/cjs/node_modules/node-forge/lib/x509.cjs.map +1 -0
  155. package/dist/cjs/node_modules/node-rsa/src/NodeRSA.cjs +341 -0
  156. package/dist/cjs/node_modules/node-rsa/src/NodeRSA.cjs.map +1 -0
  157. package/dist/cjs/node_modules/node-rsa/src/encryptEngines/encryptEngines.cjs +26 -0
  158. package/dist/cjs/node_modules/node-rsa/src/encryptEngines/encryptEngines.cjs.map +1 -0
  159. package/dist/cjs/node_modules/node-rsa/src/encryptEngines/io.cjs +65 -0
  160. package/dist/cjs/node_modules/node-rsa/src/encryptEngines/io.cjs.map +1 -0
  161. package/dist/cjs/node_modules/node-rsa/src/encryptEngines/js.cjs +44 -0
  162. package/dist/cjs/node_modules/node-rsa/src/encryptEngines/js.cjs.map +1 -0
  163. package/dist/cjs/node_modules/node-rsa/src/encryptEngines/node12.cjs +49 -0
  164. package/dist/cjs/node_modules/node-rsa/src/encryptEngines/node12.cjs.map +1 -0
  165. package/dist/cjs/node_modules/node-rsa/src/formats/components.cjs +55 -0
  166. package/dist/cjs/node_modules/node-rsa/src/formats/components.cjs.map +1 -0
  167. package/dist/cjs/node_modules/node-rsa/src/formats/formats.cjs +86 -0
  168. package/dist/cjs/node_modules/node-rsa/src/formats/formats.cjs.map +1 -0
  169. package/dist/cjs/node_modules/node-rsa/src/formats/openssh.cjs +177 -0
  170. package/dist/cjs/node_modules/node-rsa/src/formats/openssh.cjs.map +1 -0
  171. package/dist/cjs/node_modules/node-rsa/src/formats/pkcs1.cjs +104 -0
  172. package/dist/cjs/node_modules/node-rsa/src/formats/pkcs1.cjs.map +1 -0
  173. package/dist/cjs/node_modules/node-rsa/src/formats/pkcs8.cjs +131 -0
  174. package/dist/cjs/node_modules/node-rsa/src/formats/pkcs8.cjs.map +1 -0
  175. package/dist/cjs/node_modules/node-rsa/src/libs/jsbn.cjs +1347 -0
  176. package/dist/cjs/node_modules/node-rsa/src/libs/jsbn.cjs.map +1 -0
  177. package/dist/cjs/node_modules/node-rsa/src/libs/rsa.cjs +231 -0
  178. package/dist/cjs/node_modules/node-rsa/src/libs/rsa.cjs.map +1 -0
  179. package/dist/cjs/node_modules/node-rsa/src/schemes/oaep.cjs +123 -0
  180. package/dist/cjs/node_modules/node-rsa/src/schemes/oaep.cjs.map +1 -0
  181. package/dist/cjs/node_modules/node-rsa/src/schemes/pkcs1.cjs +175 -0
  182. package/dist/cjs/node_modules/node-rsa/src/schemes/pkcs1.cjs.map +1 -0
  183. package/dist/cjs/node_modules/node-rsa/src/schemes/pss.cjs +123 -0
  184. package/dist/cjs/node_modules/node-rsa/src/schemes/pss.cjs.map +1 -0
  185. package/dist/cjs/node_modules/node-rsa/src/schemes/schemes.cjs +28 -0
  186. package/dist/cjs/node_modules/node-rsa/src/schemes/schemes.cjs.map +1 -0
  187. package/dist/cjs/node_modules/node-rsa/src/utils.cjs +84 -0
  188. package/dist/cjs/node_modules/node-rsa/src/utils.cjs.map +1 -0
  189. package/dist/cjs/node_modules/pako/index.cjs +25 -0
  190. package/dist/cjs/node_modules/pako/index.cjs.map +1 -0
  191. package/dist/cjs/node_modules/pako/lib/deflate.cjs +311 -0
  192. package/dist/cjs/node_modules/pako/lib/deflate.cjs.map +1 -0
  193. package/dist/cjs/node_modules/pako/lib/inflate.cjs +317 -0
  194. package/dist/cjs/node_modules/pako/lib/inflate.cjs.map +1 -0
  195. package/dist/cjs/node_modules/pako/lib/utils/common.cjs +77 -0
  196. package/dist/cjs/node_modules/pako/lib/utils/common.cjs.map +1 -0
  197. package/dist/cjs/node_modules/pako/lib/utils/strings.cjs +131 -0
  198. package/dist/cjs/node_modules/pako/lib/utils/strings.cjs.map +1 -0
  199. package/dist/cjs/node_modules/pako/lib/zlib/adler32.cjs +29 -0
  200. package/dist/cjs/node_modules/pako/lib/zlib/adler32.cjs.map +1 -0
  201. package/dist/cjs/node_modules/pako/lib/zlib/constants.cjs +43 -0
  202. package/dist/cjs/node_modules/pako/lib/zlib/constants.cjs.map +1 -0
  203. package/dist/cjs/node_modules/pako/lib/zlib/crc32.cjs +31 -0
  204. package/dist/cjs/node_modules/pako/lib/zlib/crc32.cjs.map +1 -0
  205. package/dist/cjs/node_modules/pako/lib/zlib/deflate.cjs +889 -0
  206. package/dist/cjs/node_modules/pako/lib/zlib/deflate.cjs.map +1 -0
  207. package/dist/cjs/node_modules/pako/lib/zlib/gzheader.cjs +27 -0
  208. package/dist/cjs/node_modules/pako/lib/zlib/gzheader.cjs.map +1 -0
  209. package/dist/cjs/node_modules/pako/lib/zlib/inffast.cjs +227 -0
  210. package/dist/cjs/node_modules/pako/lib/zlib/inffast.cjs.map +1 -0
  211. package/dist/cjs/node_modules/pako/lib/zlib/inflate.cjs +1038 -0
  212. package/dist/cjs/node_modules/pako/lib/zlib/inflate.cjs.map +1 -0
  213. package/dist/cjs/node_modules/pako/lib/zlib/inftrees.cjs +278 -0
  214. package/dist/cjs/node_modules/pako/lib/zlib/inftrees.cjs.map +1 -0
  215. package/dist/cjs/node_modules/pako/lib/zlib/messages.cjs +25 -0
  216. package/dist/cjs/node_modules/pako/lib/zlib/messages.cjs.map +1 -0
  217. package/dist/cjs/node_modules/pako/lib/zlib/trees.cjs +626 -0
  218. package/dist/cjs/node_modules/pako/lib/zlib/trees.cjs.map +1 -0
  219. package/dist/cjs/node_modules/pako/lib/zlib/zstream.cjs +29 -0
  220. package/dist/cjs/node_modules/pako/lib/zlib/zstream.cjs.map +1 -0
  221. package/dist/cjs/node_modules/safer-buffer/safer.cjs +52 -0
  222. package/dist/cjs/node_modules/safer-buffer/safer.cjs.map +1 -0
  223. package/dist/cjs/node_modules/samlify/build/index.cjs +120 -0
  224. package/dist/cjs/node_modules/samlify/build/index.cjs.map +1 -0
  225. package/dist/cjs/node_modules/samlify/build/src/api.cjs +36 -0
  226. package/dist/cjs/node_modules/samlify/build/src/api.cjs.map +1 -0
  227. package/dist/cjs/node_modules/samlify/build/src/binding-post.cjs +507 -0
  228. package/dist/cjs/node_modules/samlify/build/src/binding-post.cjs.map +1 -0
  229. package/dist/cjs/node_modules/samlify/build/src/binding-redirect.cjs +342 -0
  230. package/dist/cjs/node_modules/samlify/build/src/binding-redirect.cjs.map +1 -0
  231. package/dist/cjs/node_modules/samlify/build/src/binding-simplesign.cjs +361 -0
  232. package/dist/cjs/node_modules/samlify/build/src/binding-simplesign.cjs.map +1 -0
  233. package/dist/cjs/node_modules/samlify/build/src/entity-idp.cjs +282 -0
  234. package/dist/cjs/node_modules/samlify/build/src/entity-idp.cjs.map +1 -0
  235. package/dist/cjs/node_modules/samlify/build/src/entity-sp.cjs +145 -0
  236. package/dist/cjs/node_modules/samlify/build/src/entity-sp.cjs.map +1 -0
  237. package/dist/cjs/node_modules/samlify/build/src/entity.cjs +256 -0
  238. package/dist/cjs/node_modules/samlify/build/src/entity.cjs.map +1 -0
  239. package/dist/cjs/node_modules/samlify/build/src/extractor.cjs +355 -0
  240. package/dist/cjs/node_modules/samlify/build/src/extractor.cjs.map +1 -0
  241. package/dist/cjs/node_modules/samlify/build/src/flow.cjs +392 -0
  242. package/dist/cjs/node_modules/samlify/build/src/flow.cjs.map +1 -0
  243. package/dist/cjs/node_modules/samlify/build/src/libsaml.cjs +547 -0
  244. package/dist/cjs/node_modules/samlify/build/src/libsaml.cjs.map +1 -0
  245. package/dist/cjs/node_modules/samlify/build/src/metadata-idp.cjs +174 -0
  246. package/dist/cjs/node_modules/samlify/build/src/metadata-idp.cjs.map +1 -0
  247. package/dist/cjs/node_modules/samlify/build/src/metadata-sp.cjs +217 -0
  248. package/dist/cjs/node_modules/samlify/build/src/metadata-sp.cjs.map +1 -0
  249. package/dist/cjs/node_modules/samlify/build/src/metadata.cjs +203 -0
  250. package/dist/cjs/node_modules/samlify/build/src/metadata.cjs.map +1 -0
  251. package/dist/cjs/node_modules/samlify/build/src/urn.cjs +228 -0
  252. package/dist/cjs/node_modules/samlify/build/src/urn.cjs.map +1 -0
  253. package/dist/cjs/node_modules/samlify/build/src/utility.cjs +280 -0
  254. package/dist/cjs/node_modules/samlify/build/src/utility.cjs.map +1 -0
  255. package/dist/cjs/node_modules/samlify/build/src/validator.cjs +56 -0
  256. package/dist/cjs/node_modules/samlify/build/src/validator.cjs.map +1 -0
  257. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/index.cjs +50 -0
  258. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/index.cjs.map +1 -0
  259. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/md5.cjs +25 -0
  260. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/md5.cjs.map +1 -0
  261. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/nil.cjs +18 -0
  262. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/nil.cjs.map +1 -0
  263. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/parse.cjs +42 -0
  264. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/parse.cjs.map +1 -0
  265. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/regex.cjs +18 -0
  266. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/regex.cjs.map +1 -0
  267. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/rng.cjs +28 -0
  268. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/rng.cjs.map +1 -0
  269. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/sha1.cjs +25 -0
  270. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/sha1.cjs.map +1 -0
  271. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/stringify.cjs +27 -0
  272. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/stringify.cjs.map +1 -0
  273. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/v1.cjs +69 -0
  274. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/v1.cjs.map +1 -0
  275. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/v3.cjs +23 -0
  276. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/v3.cjs.map +1 -0
  277. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/v35.cjs +54 -0
  278. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/v35.cjs.map +1 -0
  279. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/v4.cjs +34 -0
  280. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/v4.cjs.map +1 -0
  281. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/v5.cjs +23 -0
  282. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/v5.cjs.map +1 -0
  283. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/validate.cjs +23 -0
  284. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/validate.cjs.map +1 -0
  285. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/version.cjs +24 -0
  286. package/dist/cjs/node_modules/samlify/node_modules/uuid/dist/esm-node/version.cjs.map +1 -0
  287. package/dist/cjs/node_modules/xml/lib/escapeForXML.cjs +27 -0
  288. package/dist/cjs/node_modules/xml/lib/escapeForXML.cjs.map +1 -0
  289. package/dist/cjs/node_modules/xml/lib/xml.cjs +186 -0
  290. package/dist/cjs/node_modules/xml/lib/xml.cjs.map +1 -0
  291. package/dist/cjs/node_modules/xml-crypto/lib/c14n-canonicalization.cjs +202 -0
  292. package/dist/cjs/node_modules/xml-crypto/lib/c14n-canonicalization.cjs.map +1 -0
  293. package/dist/cjs/node_modules/xml-crypto/lib/enveloped-signature.cjs +52 -0
  294. package/dist/cjs/node_modules/xml-crypto/lib/enveloped-signature.cjs.map +1 -0
  295. package/dist/cjs/node_modules/xml-crypto/lib/exclusive-canonicalization.cjs +223 -0
  296. package/dist/cjs/node_modules/xml-crypto/lib/exclusive-canonicalization.cjs.map +1 -0
  297. package/dist/cjs/node_modules/xml-crypto/lib/hash-algorithms.cjs +56 -0
  298. package/dist/cjs/node_modules/xml-crypto/lib/hash-algorithms.cjs.map +1 -0
  299. package/dist/cjs/node_modules/xml-crypto/lib/index.cjs +73 -0
  300. package/dist/cjs/node_modules/xml-crypto/lib/index.cjs.map +1 -0
  301. package/dist/cjs/node_modules/xml-crypto/lib/signature-algorithms.cjs +91 -0
  302. package/dist/cjs/node_modules/xml-crypto/lib/signature-algorithms.cjs.map +1 -0
  303. package/dist/cjs/node_modules/xml-crypto/lib/signed-xml.cjs +695 -0
  304. package/dist/cjs/node_modules/xml-crypto/lib/signed-xml.cjs.map +1 -0
  305. package/dist/cjs/node_modules/xml-crypto/lib/types.cjs +58 -0
  306. package/dist/cjs/node_modules/xml-crypto/lib/types.cjs.map +1 -0
  307. package/dist/cjs/node_modules/xml-crypto/lib/utils.cjs +213 -0
  308. package/dist/cjs/node_modules/xml-crypto/lib/utils.cjs.map +1 -0
  309. package/dist/cjs/node_modules/xml-crypto/node_modules/xpath/xpath.cjs +3445 -0
  310. package/dist/cjs/node_modules/xml-crypto/node_modules/xpath/xpath.cjs.map +1 -0
  311. package/dist/cjs/node_modules/xml-escape/index.cjs +30 -0
  312. package/dist/cjs/node_modules/xml-escape/index.cjs.map +1 -0
  313. package/dist/cjs/node_modules/xpath/xpath.cjs +3410 -0
  314. package/dist/cjs/node_modules/xpath/xpath.cjs.map +1 -0
  315. package/dist/cjs/node_modules/zod/v4/classic/errors.cjs +31 -0
  316. package/dist/cjs/node_modules/zod/v4/classic/errors.cjs.map +1 -0
  317. package/dist/cjs/node_modules/zod/v4/classic/iso.cjs +42 -0
  318. package/dist/cjs/node_modules/zod/v4/classic/iso.cjs.map +1 -0
  319. package/dist/cjs/node_modules/zod/v4/classic/parse.cjs +32 -0
  320. package/dist/cjs/node_modules/zod/v4/classic/parse.cjs.map +1 -0
  321. package/dist/cjs/node_modules/zod/v4/classic/schemas.cjs +527 -0
  322. package/dist/cjs/node_modules/zod/v4/classic/schemas.cjs.map +1 -0
  323. package/dist/cjs/node_modules/zod/v4/core/api.cjs +443 -0
  324. package/dist/cjs/node_modules/zod/v4/core/api.cjs.map +1 -0
  325. package/dist/cjs/node_modules/zod/v4/core/checks.cjs +238 -0
  326. package/dist/cjs/node_modules/zod/v4/core/checks.cjs.map +1 -0
  327. package/dist/cjs/node_modules/zod/v4/core/core.cjs +63 -0
  328. package/dist/cjs/node_modules/zod/v4/core/core.cjs.map +1 -0
  329. package/dist/cjs/node_modules/zod/v4/core/doc.cjs +36 -0
  330. package/dist/cjs/node_modules/zod/v4/core/doc.cjs.map +1 -0
  331. package/dist/cjs/node_modules/zod/v4/core/errors.cjs +67 -0
  332. package/dist/cjs/node_modules/zod/v4/core/errors.cjs.map +1 -0
  333. package/dist/cjs/node_modules/zod/v4/core/parse.cjs +124 -0
  334. package/dist/cjs/node_modules/zod/v4/core/parse.cjs.map +1 -0
  335. package/dist/cjs/node_modules/zod/v4/core/regexes.cjs +87 -0
  336. package/dist/cjs/node_modules/zod/v4/core/regexes.cjs.map +1 -0
  337. package/dist/cjs/node_modules/zod/v4/core/registries.cjs +55 -0
  338. package/dist/cjs/node_modules/zod/v4/core/registries.cjs.map +1 -0
  339. package/dist/cjs/node_modules/zod/v4/core/schemas.cjs +1115 -0
  340. package/dist/cjs/node_modules/zod/v4/core/schemas.cjs.map +1 -0
  341. package/dist/cjs/node_modules/zod/v4/core/util.cjs +333 -0
  342. package/dist/cjs/node_modules/zod/v4/core/util.cjs.map +1 -0
  343. package/dist/cjs/node_modules/zod/v4/core/versions.cjs +12 -0
  344. package/dist/cjs/node_modules/zod/v4/core/versions.cjs.map +1 -0
  345. package/dist/cjs/schemas/user.schema.cjs +17 -0
  346. package/dist/cjs/schemas/user.schema.cjs.map +1 -1
  347. package/dist/cjs/services/dictionary.service.cjs +7 -31
  348. package/dist/cjs/services/dictionary.service.cjs.map +1 -1
  349. package/dist/cjs/services/email.service.cjs +13 -0
  350. package/dist/cjs/services/email.service.cjs.map +1 -1
  351. package/dist/cjs/types/user.types.cjs.map +1 -1
  352. package/dist/cjs/utils/auth/getAuth.cjs +60 -26
  353. package/dist/cjs/utils/auth/getAuth.cjs.map +1 -1
  354. package/dist/cjs/utils/mongoDB/connectDB.cjs.map +1 -1
  355. package/dist/esm/_virtual/rolldown_runtime.mjs +43 -0
  356. package/dist/esm/controllers/dictionary.controller.mjs +65 -42
  357. package/dist/esm/controllers/dictionary.controller.mjs.map +1 -1
  358. package/dist/esm/emails/MagicLinkEmail.mjs +239 -0
  359. package/dist/esm/emails/MagicLinkEmail.mjs.map +1 -0
  360. package/dist/esm/index.mjs +1 -1
  361. package/dist/esm/index.mjs.map +1 -1
  362. package/dist/esm/node_modules/@authenio/xml-encryption/lib/index.mjs +13 -0
  363. package/dist/esm/node_modules/@authenio/xml-encryption/lib/index.mjs.map +1 -0
  364. package/dist/esm/node_modules/@authenio/xml-encryption/lib/templates/encrypted-key.tpl.xml.mjs +22 -0
  365. package/dist/esm/node_modules/@authenio/xml-encryption/lib/templates/encrypted-key.tpl.xml.mjs.map +1 -0
  366. package/dist/esm/node_modules/@authenio/xml-encryption/lib/templates/keyinfo.tpl.xml.mjs +28 -0
  367. package/dist/esm/node_modules/@authenio/xml-encryption/lib/templates/keyinfo.tpl.xml.mjs.map +1 -0
  368. package/dist/esm/node_modules/@authenio/xml-encryption/lib/utils.mjs +35 -0
  369. package/dist/esm/node_modules/@authenio/xml-encryption/lib/utils.mjs.map +1 -0
  370. package/dist/esm/node_modules/@authenio/xml-encryption/lib/xmlenc.mjs +228 -0
  371. package/dist/esm/node_modules/@authenio/xml-encryption/lib/xmlenc.mjs.map +1 -0
  372. package/dist/esm/node_modules/@better-auth/sso/dist/index.mjs +1210 -0
  373. package/dist/esm/node_modules/@better-auth/sso/dist/index.mjs.map +1 -0
  374. package/dist/esm/node_modules/@better-fetch/fetch/dist/index.mjs +359 -0
  375. package/dist/esm/node_modules/@better-fetch/fetch/dist/index.mjs.map +1 -0
  376. package/dist/esm/node_modules/@xmldom/is-dom-node/dist/index.mjs +86 -0
  377. package/dist/esm/node_modules/@xmldom/is-dom-node/dist/index.mjs.map +1 -0
  378. package/dist/esm/node_modules/@xmldom/xmldom/lib/conventions.mjs +107 -0
  379. package/dist/esm/node_modules/@xmldom/xmldom/lib/conventions.mjs.map +1 -0
  380. package/dist/esm/node_modules/@xmldom/xmldom/lib/dom-parser.mjs +245 -0
  381. package/dist/esm/node_modules/@xmldom/xmldom/lib/dom-parser.mjs.map +1 -0
  382. package/dist/esm/node_modules/@xmldom/xmldom/lib/dom.mjs +1306 -0
  383. package/dist/esm/node_modules/@xmldom/xmldom/lib/dom.mjs.map +1 -0
  384. package/dist/esm/node_modules/@xmldom/xmldom/lib/entities.mjs +2173 -0
  385. package/dist/esm/node_modules/@xmldom/xmldom/lib/entities.mjs.map +1 -0
  386. package/dist/esm/node_modules/@xmldom/xmldom/lib/index.mjs +17 -0
  387. package/dist/esm/node_modules/@xmldom/xmldom/lib/index.mjs.map +1 -0
  388. package/dist/esm/node_modules/@xmldom/xmldom/lib/sax.mjs +496 -0
  389. package/dist/esm/node_modules/@xmldom/xmldom/lib/sax.mjs.map +1 -0
  390. package/dist/esm/node_modules/asn1/lib/ber/errors.mjs +17 -0
  391. package/dist/esm/node_modules/asn1/lib/ber/errors.mjs.map +1 -0
  392. package/dist/esm/node_modules/asn1/lib/ber/index.mjs +25 -0
  393. package/dist/esm/node_modules/asn1/lib/ber/index.mjs.map +1 -0
  394. package/dist/esm/node_modules/asn1/lib/ber/reader.mjs +164 -0
  395. package/dist/esm/node_modules/asn1/lib/ber/reader.mjs.map +1 -0
  396. package/dist/esm/node_modules/asn1/lib/ber/types.mjs +44 -0
  397. package/dist/esm/node_modules/asn1/lib/ber/types.mjs.map +1 -0
  398. package/dist/esm/node_modules/asn1/lib/ber/writer.mjs +220 -0
  399. package/dist/esm/node_modules/asn1/lib/ber/writer.mjs.map +1 -0
  400. package/dist/esm/node_modules/asn1/lib/index.mjs +18 -0
  401. package/dist/esm/node_modules/asn1/lib/index.mjs.map +1 -0
  402. package/dist/esm/node_modules/available-typed-arrays/index.mjs +20 -0
  403. package/dist/esm/node_modules/available-typed-arrays/index.mjs.map +1 -0
  404. package/dist/esm/node_modules/base64-js/index.mjs +95 -0
  405. package/dist/esm/node_modules/base64-js/index.mjs.map +1 -0
  406. package/dist/esm/node_modules/buffer/index.mjs +1114 -0
  407. package/dist/esm/node_modules/buffer/index.mjs.map +1 -0
  408. package/dist/esm/node_modules/call-bind/index.mjs +26 -0
  409. package/dist/esm/node_modules/call-bind/index.mjs.map +1 -0
  410. package/dist/esm/node_modules/call-bind-apply-helpers/actualApply.mjs +21 -0
  411. package/dist/esm/node_modules/call-bind-apply-helpers/actualApply.mjs.map +1 -0
  412. package/dist/esm/node_modules/call-bind-apply-helpers/applyBind.mjs +21 -0
  413. package/dist/esm/node_modules/call-bind-apply-helpers/applyBind.mjs.map +1 -0
  414. package/dist/esm/node_modules/call-bind-apply-helpers/functionApply.mjs +13 -0
  415. package/dist/esm/node_modules/call-bind-apply-helpers/functionApply.mjs.map +1 -0
  416. package/dist/esm/node_modules/call-bind-apply-helpers/functionCall.mjs +13 -0
  417. package/dist/esm/node_modules/call-bind-apply-helpers/functionCall.mjs.map +1 -0
  418. package/dist/esm/node_modules/call-bind-apply-helpers/index.mjs +24 -0
  419. package/dist/esm/node_modules/call-bind-apply-helpers/index.mjs.map +1 -0
  420. package/dist/esm/node_modules/call-bind-apply-helpers/reflectApply.mjs +13 -0
  421. package/dist/esm/node_modules/call-bind-apply-helpers/reflectApply.mjs.map +1 -0
  422. package/dist/esm/node_modules/call-bound/index.mjs +23 -0
  423. package/dist/esm/node_modules/call-bound/index.mjs.map +1 -0
  424. package/dist/esm/node_modules/camelcase/index.mjs +75 -0
  425. package/dist/esm/node_modules/camelcase/index.mjs.map +1 -0
  426. package/dist/esm/node_modules/define-data-property/index.mjs +41 -0
  427. package/dist/esm/node_modules/define-data-property/index.mjs.map +1 -0
  428. package/dist/esm/node_modules/dunder-proto/get.mjs +28 -0
  429. package/dist/esm/node_modules/dunder-proto/get.mjs.map +1 -0
  430. package/dist/esm/node_modules/es-define-property/index.mjs +19 -0
  431. package/dist/esm/node_modules/es-define-property/index.mjs.map +1 -0
  432. package/dist/esm/node_modules/es-errors/eval.mjs +13 -0
  433. package/dist/esm/node_modules/es-errors/eval.mjs.map +1 -0
  434. package/dist/esm/node_modules/es-errors/index.mjs +13 -0
  435. package/dist/esm/node_modules/es-errors/index.mjs.map +1 -0
  436. package/dist/esm/node_modules/es-errors/range.mjs +13 -0
  437. package/dist/esm/node_modules/es-errors/range.mjs.map +1 -0
  438. package/dist/esm/node_modules/es-errors/ref.mjs +13 -0
  439. package/dist/esm/node_modules/es-errors/ref.mjs.map +1 -0
  440. package/dist/esm/node_modules/es-errors/syntax.mjs +13 -0
  441. package/dist/esm/node_modules/es-errors/syntax.mjs.map +1 -0
  442. package/dist/esm/node_modules/es-errors/type.mjs +13 -0
  443. package/dist/esm/node_modules/es-errors/type.mjs.map +1 -0
  444. package/dist/esm/node_modules/es-errors/uri.mjs +13 -0
  445. package/dist/esm/node_modules/es-errors/uri.mjs.map +1 -0
  446. package/dist/esm/node_modules/es-object-atoms/index.mjs +13 -0
  447. package/dist/esm/node_modules/es-object-atoms/index.mjs.map +1 -0
  448. package/dist/esm/node_modules/escape-html/index.mjs +68 -0
  449. package/dist/esm/node_modules/escape-html/index.mjs.map +1 -0
  450. package/dist/esm/node_modules/fast-xml-parser/src/fxp.mjs +8 -0
  451. package/dist/esm/node_modules/fast-xml-parser/src/fxp.mjs.map +1 -0
  452. package/dist/esm/node_modules/fast-xml-parser/src/util.mjs +26 -0
  453. package/dist/esm/node_modules/fast-xml-parser/src/util.mjs.map +1 -0
  454. package/dist/esm/node_modules/fast-xml-parser/src/validator.mjs +243 -0
  455. package/dist/esm/node_modules/fast-xml-parser/src/validator.mjs.map +1 -0
  456. package/dist/esm/node_modules/for-each/index.mjs +43 -0
  457. package/dist/esm/node_modules/for-each/index.mjs.map +1 -0
  458. package/dist/esm/node_modules/function-bind/implementation.mjs +59 -0
  459. package/dist/esm/node_modules/function-bind/implementation.mjs.map +1 -0
  460. package/dist/esm/node_modules/function-bind/index.mjs +14 -0
  461. package/dist/esm/node_modules/function-bind/index.mjs.map +1 -0
  462. package/dist/esm/node_modules/generator-function/index.mjs +14 -0
  463. package/dist/esm/node_modules/generator-function/index.mjs.map +1 -0
  464. package/dist/esm/node_modules/get-intrinsic/index.mjs +358 -0
  465. package/dist/esm/node_modules/get-intrinsic/index.mjs.map +1 -0
  466. package/dist/esm/node_modules/get-proto/Object.getPrototypeOf.mjs +15 -0
  467. package/dist/esm/node_modules/get-proto/Object.getPrototypeOf.mjs.map +1 -0
  468. package/dist/esm/node_modules/get-proto/Reflect.getPrototypeOf.mjs +13 -0
  469. package/dist/esm/node_modules/get-proto/Reflect.getPrototypeOf.mjs.map +1 -0
  470. package/dist/esm/node_modules/get-proto/index.mjs +26 -0
  471. package/dist/esm/node_modules/get-proto/index.mjs.map +1 -0
  472. package/dist/esm/node_modules/gopd/gOPD.mjs +13 -0
  473. package/dist/esm/node_modules/gopd/gOPD.mjs.map +1 -0
  474. package/dist/esm/node_modules/gopd/index.mjs +20 -0
  475. package/dist/esm/node_modules/gopd/index.mjs.map +1 -0
  476. package/dist/esm/node_modules/has-property-descriptors/index.mjs +25 -0
  477. package/dist/esm/node_modules/has-property-descriptors/index.mjs.map +1 -0
  478. package/dist/esm/node_modules/has-symbols/index.mjs +22 -0
  479. package/dist/esm/node_modules/has-symbols/index.mjs.map +1 -0
  480. package/dist/esm/node_modules/has-symbols/shams.mjs +36 -0
  481. package/dist/esm/node_modules/has-symbols/shams.mjs.map +1 -0
  482. package/dist/esm/node_modules/has-tostringtag/shams.mjs +17 -0
  483. package/dist/esm/node_modules/has-tostringtag/shams.mjs.map +1 -0
  484. package/dist/esm/node_modules/hasown/index.mjs +17 -0
  485. package/dist/esm/node_modules/hasown/index.mjs.map +1 -0
  486. package/dist/esm/node_modules/ieee754/index.mjs +80 -0
  487. package/dist/esm/node_modules/ieee754/index.mjs.map +1 -0
  488. package/dist/esm/node_modules/inherits/inherits_browser.mjs +31 -0
  489. package/dist/esm/node_modules/inherits/inherits_browser.mjs.map +1 -0
  490. package/dist/esm/node_modules/is-arguments/index.mjs +31 -0
  491. package/dist/esm/node_modules/is-arguments/index.mjs.map +1 -0
  492. package/dist/esm/node_modules/is-callable/index.mjs +87 -0
  493. package/dist/esm/node_modules/is-callable/index.mjs.map +1 -0
  494. package/dist/esm/node_modules/is-generator-function/index.mjs +32 -0
  495. package/dist/esm/node_modules/is-generator-function/index.mjs.map +1 -0
  496. package/dist/esm/node_modules/is-regex/index.mjs +58 -0
  497. package/dist/esm/node_modules/is-regex/index.mjs.map +1 -0
  498. package/dist/esm/node_modules/is-typed-array/index.mjs +17 -0
  499. package/dist/esm/node_modules/is-typed-array/index.mjs.map +1 -0
  500. package/dist/esm/node_modules/jose/dist/webapi/lib/base64.mjs +12 -0
  501. package/dist/esm/node_modules/jose/dist/webapi/lib/base64.mjs.map +1 -0
  502. package/dist/esm/node_modules/jose/dist/webapi/lib/buffer_utils.mjs +8 -0
  503. package/dist/esm/node_modules/jose/dist/webapi/lib/buffer_utils.mjs.map +1 -0
  504. package/dist/esm/node_modules/jose/dist/webapi/lib/is_object.mjs +15 -0
  505. package/dist/esm/node_modules/jose/dist/webapi/lib/is_object.mjs.map +1 -0
  506. package/dist/esm/node_modules/jose/dist/webapi/util/base64url.mjs +19 -0
  507. package/dist/esm/node_modules/jose/dist/webapi/util/base64url.mjs.map +1 -0
  508. package/dist/esm/node_modules/jose/dist/webapi/util/decode_jwt.mjs +31 -0
  509. package/dist/esm/node_modules/jose/dist/webapi/util/decode_jwt.mjs.map +1 -0
  510. package/dist/esm/node_modules/jose/dist/webapi/util/errors.mjs +26 -0
  511. package/dist/esm/node_modules/jose/dist/webapi/util/errors.mjs.map +1 -0
  512. package/dist/esm/node_modules/math-intrinsics/abs.mjs +13 -0
  513. package/dist/esm/node_modules/math-intrinsics/abs.mjs.map +1 -0
  514. package/dist/esm/node_modules/math-intrinsics/floor.mjs +13 -0
  515. package/dist/esm/node_modules/math-intrinsics/floor.mjs.map +1 -0
  516. package/dist/esm/node_modules/math-intrinsics/isNaN.mjs +15 -0
  517. package/dist/esm/node_modules/math-intrinsics/isNaN.mjs.map +1 -0
  518. package/dist/esm/node_modules/math-intrinsics/max.mjs +13 -0
  519. package/dist/esm/node_modules/math-intrinsics/max.mjs.map +1 -0
  520. package/dist/esm/node_modules/math-intrinsics/min.mjs +13 -0
  521. package/dist/esm/node_modules/math-intrinsics/min.mjs.map +1 -0
  522. package/dist/esm/node_modules/math-intrinsics/pow.mjs +13 -0
  523. package/dist/esm/node_modules/math-intrinsics/pow.mjs.map +1 -0
  524. package/dist/esm/node_modules/math-intrinsics/round.mjs +13 -0
  525. package/dist/esm/node_modules/math-intrinsics/round.mjs.map +1 -0
  526. package/dist/esm/node_modules/math-intrinsics/sign.mjs +18 -0
  527. package/dist/esm/node_modules/math-intrinsics/sign.mjs.map +1 -0
  528. package/dist/esm/node_modules/node-forge/lib/aes.mjs +601 -0
  529. package/dist/esm/node_modules/node-forge/lib/aes.mjs.map +1 -0
  530. package/dist/esm/node_modules/node-forge/lib/aesCipherSuites.mjs +199 -0
  531. package/dist/esm/node_modules/node-forge/lib/aesCipherSuites.mjs.map +1 -0
  532. package/dist/esm/node_modules/node-forge/lib/asn1-validator.mjs +80 -0
  533. package/dist/esm/node_modules/node-forge/lib/asn1-validator.mjs.map +1 -0
  534. package/dist/esm/node_modules/node-forge/lib/asn1.mjs +942 -0
  535. package/dist/esm/node_modules/node-forge/lib/asn1.mjs.map +1 -0
  536. package/dist/esm/node_modules/node-forge/lib/baseN.mjs +141 -0
  537. package/dist/esm/node_modules/node-forge/lib/baseN.mjs.map +1 -0
  538. package/dist/esm/node_modules/node-forge/lib/cipher.mjs +190 -0
  539. package/dist/esm/node_modules/node-forge/lib/cipher.mjs.map +1 -0
  540. package/dist/esm/node_modules/node-forge/lib/cipherModes.mjs +601 -0
  541. package/dist/esm/node_modules/node-forge/lib/cipherModes.mjs.map +1 -0
  542. package/dist/esm/node_modules/node-forge/lib/des.mjs +1191 -0
  543. package/dist/esm/node_modules/node-forge/lib/des.mjs.map +1 -0
  544. package/dist/esm/node_modules/node-forge/lib/ed25519.mjs +1024 -0
  545. package/dist/esm/node_modules/node-forge/lib/ed25519.mjs.map +1 -0
  546. package/dist/esm/node_modules/node-forge/lib/forge.mjs +19 -0
  547. package/dist/esm/node_modules/node-forge/lib/forge.mjs.map +1 -0
  548. package/dist/esm/node_modules/node-forge/lib/hmac.mjs +111 -0
  549. package/dist/esm/node_modules/node-forge/lib/hmac.mjs.map +1 -0
  550. package/dist/esm/node_modules/node-forge/lib/index.mjs +70 -0
  551. package/dist/esm/node_modules/node-forge/lib/index.mjs.map +1 -0
  552. package/dist/esm/node_modules/node-forge/lib/jsbn.mjs +1260 -0
  553. package/dist/esm/node_modules/node-forge/lib/jsbn.mjs.map +1 -0
  554. package/dist/esm/node_modules/node-forge/lib/kem.mjs +150 -0
  555. package/dist/esm/node_modules/node-forge/lib/kem.mjs.map +1 -0
  556. package/dist/esm/node_modules/node-forge/lib/log.mjs +245 -0
  557. package/dist/esm/node_modules/node-forge/lib/log.mjs.map +1 -0
  558. package/dist/esm/node_modules/node-forge/lib/md.all.mjs +28 -0
  559. package/dist/esm/node_modules/node-forge/lib/md.all.mjs.map +1 -0
  560. package/dist/esm/node_modules/node-forge/lib/md.mjs +22 -0
  561. package/dist/esm/node_modules/node-forge/lib/md.mjs.map +1 -0
  562. package/dist/esm/node_modules/node-forge/lib/md5.mjs +328 -0
  563. package/dist/esm/node_modules/node-forge/lib/md5.mjs.map +1 -0
  564. package/dist/esm/node_modules/node-forge/lib/mgf.mjs +24 -0
  565. package/dist/esm/node_modules/node-forge/lib/mgf.mjs.map +1 -0
  566. package/dist/esm/node_modules/node-forge/lib/mgf1.mjs +48 -0
  567. package/dist/esm/node_modules/node-forge/lib/mgf1.mjs.map +1 -0
  568. package/dist/esm/node_modules/node-forge/lib/oids.mjs +157 -0
  569. package/dist/esm/node_modules/node-forge/lib/oids.mjs.map +1 -0
  570. package/dist/esm/node_modules/node-forge/lib/pbe.mjs +819 -0
  571. package/dist/esm/node_modules/node-forge/lib/pbe.mjs.map +1 -0
  572. package/dist/esm/node_modules/node-forge/lib/pbkdf2.mjs +130 -0
  573. package/dist/esm/node_modules/node-forge/lib/pbkdf2.mjs.map +1 -0
  574. package/dist/esm/node_modules/node-forge/lib/pem.mjs +179 -0
  575. package/dist/esm/node_modules/node-forge/lib/pem.mjs.map +1 -0
  576. package/dist/esm/node_modules/node-forge/lib/pkcs1.mjs +204 -0
  577. package/dist/esm/node_modules/node-forge/lib/pkcs1.mjs.map +1 -0
  578. package/dist/esm/node_modules/node-forge/lib/pkcs12.mjs +727 -0
  579. package/dist/esm/node_modules/node-forge/lib/pkcs12.mjs.map +1 -0
  580. package/dist/esm/node_modules/node-forge/lib/pkcs7.mjs +645 -0
  581. package/dist/esm/node_modules/node-forge/lib/pkcs7.mjs.map +1 -0
  582. package/dist/esm/node_modules/node-forge/lib/pkcs7asn1.mjs +409 -0
  583. package/dist/esm/node_modules/node-forge/lib/pkcs7asn1.mjs.map +1 -0
  584. package/dist/esm/node_modules/node-forge/lib/pki.mjs +105 -0
  585. package/dist/esm/node_modules/node-forge/lib/pki.mjs.map +1 -0
  586. package/dist/esm/node_modules/node-forge/lib/prime.mjs +197 -0
  587. package/dist/esm/node_modules/node-forge/lib/prime.mjs.map +1 -0
  588. package/dist/esm/node_modules/node-forge/lib/prng.mjs +295 -0
  589. package/dist/esm/node_modules/node-forge/lib/prng.mjs.map +1 -0
  590. package/dist/esm/node_modules/node-forge/lib/pss.mjs +145 -0
  591. package/dist/esm/node_modules/node-forge/lib/pss.mjs.map +1 -0
  592. package/dist/esm/node_modules/node-forge/lib/random.mjs +145 -0
  593. package/dist/esm/node_modules/node-forge/lib/random.mjs.map +1 -0
  594. package/dist/esm/node_modules/node-forge/lib/rc2.mjs +542 -0
  595. package/dist/esm/node_modules/node-forge/lib/rc2.mjs.map +1 -0
  596. package/dist/esm/node_modules/node-forge/lib/rsa.mjs +1304 -0
  597. package/dist/esm/node_modules/node-forge/lib/rsa.mjs.map +1 -0
  598. package/dist/esm/node_modules/node-forge/lib/sha1.mjs +234 -0
  599. package/dist/esm/node_modules/node-forge/lib/sha1.mjs.map +1 -0
  600. package/dist/esm/node_modules/node-forge/lib/sha256.mjs +271 -0
  601. package/dist/esm/node_modules/node-forge/lib/sha256.mjs.map +1 -0
  602. package/dist/esm/node_modules/node-forge/lib/sha512.mjs +417 -0
  603. package/dist/esm/node_modules/node-forge/lib/sha512.mjs.map +1 -0
  604. package/dist/esm/node_modules/node-forge/lib/ssh.mjs +198 -0
  605. package/dist/esm/node_modules/node-forge/lib/ssh.mjs.map +1 -0
  606. package/dist/esm/node_modules/node-forge/lib/tls.mjs +3659 -0
  607. package/dist/esm/node_modules/node-forge/lib/tls.mjs.map +1 -0
  608. package/dist/esm/node_modules/node-forge/lib/util.mjs +2121 -0
  609. package/dist/esm/node_modules/node-forge/lib/util.mjs.map +1 -0
  610. package/dist/esm/node_modules/node-forge/lib/x509.mjs +2168 -0
  611. package/dist/esm/node_modules/node-forge/lib/x509.mjs.map +1 -0
  612. package/dist/esm/node_modules/node-forge/lib.mjs +10 -0
  613. package/dist/esm/node_modules/node-forge/lib.mjs.map +1 -0
  614. package/dist/esm/node_modules/node-rsa/src/NodeRSA.mjs +338 -0
  615. package/dist/esm/node_modules/node-rsa/src/NodeRSA.mjs.map +1 -0
  616. package/dist/esm/node_modules/node-rsa/src/encryptEngines/encryptEngines.mjs +23 -0
  617. package/dist/esm/node_modules/node-rsa/src/encryptEngines/encryptEngines.mjs.map +1 -0
  618. package/dist/esm/node_modules/node-rsa/src/encryptEngines/io.mjs +62 -0
  619. package/dist/esm/node_modules/node-rsa/src/encryptEngines/io.mjs.map +1 -0
  620. package/dist/esm/node_modules/node-rsa/src/encryptEngines/js.mjs +41 -0
  621. package/dist/esm/node_modules/node-rsa/src/encryptEngines/js.mjs.map +1 -0
  622. package/dist/esm/node_modules/node-rsa/src/encryptEngines/node12.mjs +46 -0
  623. package/dist/esm/node_modules/node-rsa/src/encryptEngines/node12.mjs.map +1 -0
  624. package/dist/esm/node_modules/node-rsa/src/formats/components.mjs +52 -0
  625. package/dist/esm/node_modules/node-rsa/src/formats/components.mjs.map +1 -0
  626. package/dist/esm/node_modules/node-rsa/src/formats/formats.mjs +83 -0
  627. package/dist/esm/node_modules/node-rsa/src/formats/formats.mjs.map +1 -0
  628. package/dist/esm/node_modules/node-rsa/src/formats/openssh.mjs +174 -0
  629. package/dist/esm/node_modules/node-rsa/src/formats/openssh.mjs.map +1 -0
  630. package/dist/esm/node_modules/node-rsa/src/formats/pkcs1.mjs +101 -0
  631. package/dist/esm/node_modules/node-rsa/src/formats/pkcs1.mjs.map +1 -0
  632. package/dist/esm/node_modules/node-rsa/src/formats/pkcs8.mjs +128 -0
  633. package/dist/esm/node_modules/node-rsa/src/formats/pkcs8.mjs.map +1 -0
  634. package/dist/esm/node_modules/node-rsa/src/libs/jsbn.mjs +1344 -0
  635. package/dist/esm/node_modules/node-rsa/src/libs/jsbn.mjs.map +1 -0
  636. package/dist/esm/node_modules/node-rsa/src/libs/rsa.mjs +228 -0
  637. package/dist/esm/node_modules/node-rsa/src/libs/rsa.mjs.map +1 -0
  638. package/dist/esm/node_modules/node-rsa/src/schemes/oaep.mjs +120 -0
  639. package/dist/esm/node_modules/node-rsa/src/schemes/oaep.mjs.map +1 -0
  640. package/dist/esm/node_modules/node-rsa/src/schemes/pkcs1.mjs +172 -0
  641. package/dist/esm/node_modules/node-rsa/src/schemes/pkcs1.mjs.map +1 -0
  642. package/dist/esm/node_modules/node-rsa/src/schemes/pss.mjs +120 -0
  643. package/dist/esm/node_modules/node-rsa/src/schemes/pss.mjs.map +1 -0
  644. package/dist/esm/node_modules/node-rsa/src/schemes/schemes.mjs +25 -0
  645. package/dist/esm/node_modules/node-rsa/src/schemes/schemes.mjs.map +1 -0
  646. package/dist/esm/node_modules/node-rsa/src/utils.mjs +81 -0
  647. package/dist/esm/node_modules/node-rsa/src/utils.mjs.map +1 -0
  648. package/dist/esm/node_modules/pako/index.mjs +22 -0
  649. package/dist/esm/node_modules/pako/index.mjs.map +1 -0
  650. package/dist/esm/node_modules/pako/lib/deflate.mjs +308 -0
  651. package/dist/esm/node_modules/pako/lib/deflate.mjs.map +1 -0
  652. package/dist/esm/node_modules/pako/lib/inflate.mjs +314 -0
  653. package/dist/esm/node_modules/pako/lib/inflate.mjs.map +1 -0
  654. package/dist/esm/node_modules/pako/lib/utils/common.mjs +74 -0
  655. package/dist/esm/node_modules/pako/lib/utils/common.mjs.map +1 -0
  656. package/dist/esm/node_modules/pako/lib/utils/strings.mjs +128 -0
  657. package/dist/esm/node_modules/pako/lib/utils/strings.mjs.map +1 -0
  658. package/dist/esm/node_modules/pako/lib/zlib/adler32.mjs +26 -0
  659. package/dist/esm/node_modules/pako/lib/zlib/adler32.mjs.map +1 -0
  660. package/dist/esm/node_modules/pako/lib/zlib/constants.mjs +40 -0
  661. package/dist/esm/node_modules/pako/lib/zlib/constants.mjs.map +1 -0
  662. package/dist/esm/node_modules/pako/lib/zlib/crc32.mjs +28 -0
  663. package/dist/esm/node_modules/pako/lib/zlib/crc32.mjs.map +1 -0
  664. package/dist/esm/node_modules/pako/lib/zlib/deflate.mjs +886 -0
  665. package/dist/esm/node_modules/pako/lib/zlib/deflate.mjs.map +1 -0
  666. package/dist/esm/node_modules/pako/lib/zlib/gzheader.mjs +24 -0
  667. package/dist/esm/node_modules/pako/lib/zlib/gzheader.mjs.map +1 -0
  668. package/dist/esm/node_modules/pako/lib/zlib/inffast.mjs +224 -0
  669. package/dist/esm/node_modules/pako/lib/zlib/inffast.mjs.map +1 -0
  670. package/dist/esm/node_modules/pako/lib/zlib/inflate.mjs +1035 -0
  671. package/dist/esm/node_modules/pako/lib/zlib/inflate.mjs.map +1 -0
  672. package/dist/esm/node_modules/pako/lib/zlib/inftrees.mjs +275 -0
  673. package/dist/esm/node_modules/pako/lib/zlib/inftrees.mjs.map +1 -0
  674. package/dist/esm/node_modules/pako/lib/zlib/messages.mjs +22 -0
  675. package/dist/esm/node_modules/pako/lib/zlib/messages.mjs.map +1 -0
  676. package/dist/esm/node_modules/pako/lib/zlib/trees.mjs +623 -0
  677. package/dist/esm/node_modules/pako/lib/zlib/trees.mjs.map +1 -0
  678. package/dist/esm/node_modules/pako/lib/zlib/zstream.mjs +26 -0
  679. package/dist/esm/node_modules/pako/lib/zlib/zstream.mjs.map +1 -0
  680. package/dist/esm/node_modules/possible-typed-array-names/index.mjs +26 -0
  681. package/dist/esm/node_modules/possible-typed-array-names/index.mjs.map +1 -0
  682. package/dist/esm/node_modules/safe-regex-test/index.mjs +25 -0
  683. package/dist/esm/node_modules/safe-regex-test/index.mjs.map +1 -0
  684. package/dist/esm/node_modules/safer-buffer/safer.mjs +50 -0
  685. package/dist/esm/node_modules/safer-buffer/safer.mjs.map +1 -0
  686. package/dist/esm/node_modules/samlify/build/index.mjs +117 -0
  687. package/dist/esm/node_modules/samlify/build/index.mjs.map +1 -0
  688. package/dist/esm/node_modules/samlify/build/src/api.mjs +33 -0
  689. package/dist/esm/node_modules/samlify/build/src/api.mjs.map +1 -0
  690. package/dist/esm/node_modules/samlify/build/src/binding-post.mjs +504 -0
  691. package/dist/esm/node_modules/samlify/build/src/binding-post.mjs.map +1 -0
  692. package/dist/esm/node_modules/samlify/build/src/binding-redirect.mjs +339 -0
  693. package/dist/esm/node_modules/samlify/build/src/binding-redirect.mjs.map +1 -0
  694. package/dist/esm/node_modules/samlify/build/src/binding-simplesign.mjs +358 -0
  695. package/dist/esm/node_modules/samlify/build/src/binding-simplesign.mjs.map +1 -0
  696. package/dist/esm/node_modules/samlify/build/src/entity-idp.mjs +279 -0
  697. package/dist/esm/node_modules/samlify/build/src/entity-idp.mjs.map +1 -0
  698. package/dist/esm/node_modules/samlify/build/src/entity-sp.mjs +142 -0
  699. package/dist/esm/node_modules/samlify/build/src/entity-sp.mjs.map +1 -0
  700. package/dist/esm/node_modules/samlify/build/src/entity.mjs +253 -0
  701. package/dist/esm/node_modules/samlify/build/src/entity.mjs.map +1 -0
  702. package/dist/esm/node_modules/samlify/build/src/extractor.mjs +352 -0
  703. package/dist/esm/node_modules/samlify/build/src/extractor.mjs.map +1 -0
  704. package/dist/esm/node_modules/samlify/build/src/flow.mjs +389 -0
  705. package/dist/esm/node_modules/samlify/build/src/flow.mjs.map +1 -0
  706. package/dist/esm/node_modules/samlify/build/src/libsaml.mjs +544 -0
  707. package/dist/esm/node_modules/samlify/build/src/libsaml.mjs.map +1 -0
  708. package/dist/esm/node_modules/samlify/build/src/metadata-idp.mjs +171 -0
  709. package/dist/esm/node_modules/samlify/build/src/metadata-idp.mjs.map +1 -0
  710. package/dist/esm/node_modules/samlify/build/src/metadata-sp.mjs +214 -0
  711. package/dist/esm/node_modules/samlify/build/src/metadata-sp.mjs.map +1 -0
  712. package/dist/esm/node_modules/samlify/build/src/metadata.mjs +200 -0
  713. package/dist/esm/node_modules/samlify/build/src/metadata.mjs.map +1 -0
  714. package/dist/esm/node_modules/samlify/build/src/urn.mjs +225 -0
  715. package/dist/esm/node_modules/samlify/build/src/urn.mjs.map +1 -0
  716. package/dist/esm/node_modules/samlify/build/src/utility.mjs +277 -0
  717. package/dist/esm/node_modules/samlify/build/src/utility.mjs.map +1 -0
  718. package/dist/esm/node_modules/samlify/build/src/validator.mjs +53 -0
  719. package/dist/esm/node_modules/samlify/build/src/validator.mjs.map +1 -0
  720. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/index.mjs +39 -0
  721. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/index.mjs.map +1 -0
  722. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/md5.mjs +154 -0
  723. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/md5.mjs.map +1 -0
  724. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/nil.mjs +12 -0
  725. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/nil.mjs.map +1 -0
  726. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/parse.mjs +36 -0
  727. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/parse.mjs.map +1 -0
  728. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/regex.mjs +12 -0
  729. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/regex.mjs.map +1 -0
  730. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/rng.mjs +20 -0
  731. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/rng.mjs.map +1 -0
  732. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/sha1.mjs +101 -0
  733. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/sha1.mjs.map +1 -0
  734. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/stringify.mjs +22 -0
  735. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/stringify.mjs.map +1 -0
  736. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/v1.mjs +63 -0
  737. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/v1.mjs.map +1 -0
  738. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/v3.mjs +17 -0
  739. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/v3.mjs.map +1 -0
  740. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/v35.mjs +48 -0
  741. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/v35.mjs.map +1 -0
  742. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/v4.mjs +28 -0
  743. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/v4.mjs.map +1 -0
  744. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/v5.mjs +17 -0
  745. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/v5.mjs.map +1 -0
  746. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/validate.mjs +17 -0
  747. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/validate.mjs.map +1 -0
  748. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/version.mjs +18 -0
  749. package/dist/esm/node_modules/samlify/node_modules/uuid/dist/esm-browser/version.mjs.map +1 -0
  750. package/dist/esm/node_modules/set-function-length/index.mjs +38 -0
  751. package/dist/esm/node_modules/set-function-length/index.mjs.map +1 -0
  752. package/dist/esm/node_modules/util/support/isBufferBrowser.mjs +14 -0
  753. package/dist/esm/node_modules/util/support/isBufferBrowser.mjs.map +1 -0
  754. package/dist/esm/node_modules/util/support/types.mjs +218 -0
  755. package/dist/esm/node_modules/util/support/types.mjs.map +1 -0
  756. package/dist/esm/node_modules/util/util.mjs +443 -0
  757. package/dist/esm/node_modules/util/util.mjs.map +1 -0
  758. package/dist/esm/node_modules/which-typed-array/index.mjs +93 -0
  759. package/dist/esm/node_modules/which-typed-array/index.mjs.map +1 -0
  760. package/dist/esm/node_modules/xml/lib/escapeForXML.mjs +24 -0
  761. package/dist/esm/node_modules/xml/lib/escapeForXML.mjs.map +1 -0
  762. package/dist/esm/node_modules/xml/lib/xml.mjs +183 -0
  763. package/dist/esm/node_modules/xml/lib/xml.mjs.map +1 -0
  764. package/dist/esm/node_modules/xml-crypto/lib/c14n-canonicalization.mjs +199 -0
  765. package/dist/esm/node_modules/xml-crypto/lib/c14n-canonicalization.mjs.map +1 -0
  766. package/dist/esm/node_modules/xml-crypto/lib/enveloped-signature.mjs +49 -0
  767. package/dist/esm/node_modules/xml-crypto/lib/enveloped-signature.mjs.map +1 -0
  768. package/dist/esm/node_modules/xml-crypto/lib/exclusive-canonicalization.mjs +220 -0
  769. package/dist/esm/node_modules/xml-crypto/lib/exclusive-canonicalization.mjs.map +1 -0
  770. package/dist/esm/node_modules/xml-crypto/lib/hash-algorithms.mjs +53 -0
  771. package/dist/esm/node_modules/xml-crypto/lib/hash-algorithms.mjs.map +1 -0
  772. package/dist/esm/node_modules/xml-crypto/lib/index.mjs +70 -0
  773. package/dist/esm/node_modules/xml-crypto/lib/index.mjs.map +1 -0
  774. package/dist/esm/node_modules/xml-crypto/lib/signature-algorithms.mjs +88 -0
  775. package/dist/esm/node_modules/xml-crypto/lib/signature-algorithms.mjs.map +1 -0
  776. package/dist/esm/node_modules/xml-crypto/lib/signed-xml.mjs +693 -0
  777. package/dist/esm/node_modules/xml-crypto/lib/signed-xml.mjs.map +1 -0
  778. package/dist/esm/node_modules/xml-crypto/lib/types.mjs +55 -0
  779. package/dist/esm/node_modules/xml-crypto/lib/types.mjs.map +1 -0
  780. package/dist/esm/node_modules/xml-crypto/lib/utils.mjs +210 -0
  781. package/dist/esm/node_modules/xml-crypto/lib/utils.mjs.map +1 -0
  782. package/dist/esm/node_modules/xml-crypto/node_modules/xpath/xpath.mjs +3442 -0
  783. package/dist/esm/node_modules/xml-crypto/node_modules/xpath/xpath.mjs.map +1 -0
  784. package/dist/esm/node_modules/xml-escape/index.mjs +27 -0
  785. package/dist/esm/node_modules/xml-escape/index.mjs.map +1 -0
  786. package/dist/esm/node_modules/xpath/xpath.mjs +3407 -0
  787. package/dist/esm/node_modules/xpath/xpath.mjs.map +1 -0
  788. package/dist/esm/node_modules/zod/v4/classic/errors.mjs +30 -0
  789. package/dist/esm/node_modules/zod/v4/classic/errors.mjs.map +1 -0
  790. package/dist/esm/node_modules/zod/v4/classic/iso.mjs +38 -0
  791. package/dist/esm/node_modules/zod/v4/classic/iso.mjs.map +1 -0
  792. package/dist/esm/node_modules/zod/v4/classic/parse.mjs +20 -0
  793. package/dist/esm/node_modules/zod/v4/classic/parse.mjs.map +1 -0
  794. package/dist/esm/node_modules/zod/v4/classic/schemas.mjs +519 -0
  795. package/dist/esm/node_modules/zod/v4/classic/schemas.mjs.map +1 -0
  796. package/dist/esm/node_modules/zod/v4/core/api.mjs +395 -0
  797. package/dist/esm/node_modules/zod/v4/core/api.mjs.map +1 -0
  798. package/dist/esm/node_modules/zod/v4/core/checks.mjs +226 -0
  799. package/dist/esm/node_modules/zod/v4/core/checks.mjs.map +1 -0
  800. package/dist/esm/node_modules/zod/v4/core/core.mjs +57 -0
  801. package/dist/esm/node_modules/zod/v4/core/core.mjs.map +1 -0
  802. package/dist/esm/node_modules/zod/v4/core/doc.mjs +34 -0
  803. package/dist/esm/node_modules/zod/v4/core/doc.mjs.map +1 -0
  804. package/dist/esm/node_modules/zod/v4/core/errors.mjs +63 -0
  805. package/dist/esm/node_modules/zod/v4/core/errors.mjs.map +1 -0
  806. package/dist/esm/node_modules/zod/v4/core/parse.mjs +110 -0
  807. package/dist/esm/node_modules/zod/v4/core/parse.mjs.map +1 -0
  808. package/dist/esm/node_modules/zod/v4/core/regexes.mjs +60 -0
  809. package/dist/esm/node_modules/zod/v4/core/regexes.mjs.map +1 -0
  810. package/dist/esm/node_modules/zod/v4/core/registries.mjs +53 -0
  811. package/dist/esm/node_modules/zod/v4/core/registries.mjs.map +1 -0
  812. package/dist/esm/node_modules/zod/v4/core/schemas.mjs +1069 -0
  813. package/dist/esm/node_modules/zod/v4/core/schemas.mjs.map +1 -0
  814. package/dist/esm/node_modules/zod/v4/core/util.mjs +302 -0
  815. package/dist/esm/node_modules/zod/v4/core/util.mjs.map +1 -0
  816. package/dist/esm/node_modules/zod/v4/core/versions.mjs +10 -0
  817. package/dist/esm/node_modules/zod/v4/core/versions.mjs.map +1 -0
  818. package/dist/esm/schemas/user.schema.mjs +17 -0
  819. package/dist/esm/schemas/user.schema.mjs.map +1 -1
  820. package/dist/esm/services/dictionary.service.mjs +8 -31
  821. package/dist/esm/services/dictionary.service.mjs.map +1 -1
  822. package/dist/esm/services/email.service.mjs +13 -0
  823. package/dist/esm/services/email.service.mjs.map +1 -1
  824. package/dist/esm/types/user.types.mjs.map +1 -1
  825. package/dist/esm/utils/auth/getAuth.mjs +61 -27
  826. package/dist/esm/utils/auth/getAuth.mjs.map +1 -1
  827. package/dist/esm/utils/mongoDB/connectDB.mjs.map +1 -1
  828. package/dist/types/MagicLinkEmail.d.ts +8 -0
  829. package/dist/types/MagicLinkEmail.d.ts.map +1 -0
  830. package/dist/types/controllers/dictionary.controller.d.ts +18 -5
  831. package/dist/types/controllers/dictionary.controller.d.ts.map +1 -1
  832. package/dist/types/controllers/projectAccessKey.controller.d.ts.map +1 -1
  833. package/dist/types/controllers/tag.controller.d.ts.map +1 -1
  834. package/dist/types/emails/InviteUserEmail.d.ts +4 -4
  835. package/dist/types/emails/InviteUserEmail.d.ts.map +1 -1
  836. package/dist/types/emails/MagicLinkEmail.d.ts +31 -0
  837. package/dist/types/emails/MagicLinkEmail.d.ts.map +1 -0
  838. package/dist/types/emails/OAuthTokenCreatedEmail.d.ts +4 -4
  839. package/dist/types/emails/ResetUserPassword.d.ts +4 -4
  840. package/dist/types/emails/ResetUserPassword.d.ts.map +1 -1
  841. package/dist/types/emails/SubscriptionPaymentCancellation.d.ts +4 -4
  842. package/dist/types/emails/SubscriptionPaymentCancellation.d.ts.map +1 -1
  843. package/dist/types/emails/SubscriptionPaymentError.d.ts +4 -4
  844. package/dist/types/emails/SubscriptionPaymentSuccess.d.ts +4 -4
  845. package/dist/types/emails/ValidateUserEmail.d.ts +4 -4
  846. package/dist/types/emails/Welcome.d.ts +4 -4
  847. package/dist/types/emails/Welcome.d.ts.map +1 -1
  848. package/dist/types/export.d.ts +1 -3
  849. package/dist/types/models/dictionary.model.d.ts +4 -4
  850. package/dist/types/models/discussion.model.d.ts +2 -2
  851. package/dist/types/models/oAuth2.model.d.ts +3 -3
  852. package/dist/types/schemas/dictionary.schema.d.ts +6 -6
  853. package/dist/types/schemas/discussion.schema.d.ts +6 -6
  854. package/dist/types/schemas/discussion.schema.d.ts.map +1 -1
  855. package/dist/types/schemas/oAuth2.schema.d.ts +5 -5
  856. package/dist/types/schemas/oAuth2.schema.d.ts.map +1 -1
  857. package/dist/types/schemas/organization.schema.d.ts +6 -6
  858. package/dist/types/schemas/plans.schema.d.ts +6 -6
  859. package/dist/types/schemas/project.schema.d.ts +6 -6
  860. package/dist/types/schemas/project.schema.d.ts.map +1 -1
  861. package/dist/types/schemas/session.schema.d.ts +6 -6
  862. package/dist/types/schemas/tag.schema.d.ts +6 -6
  863. package/dist/types/schemas/user.schema.d.ts +6 -6
  864. package/dist/types/schemas/user.schema.d.ts.map +1 -1
  865. package/dist/types/services/dictionary.service.d.ts +1 -12
  866. package/dist/types/services/dictionary.service.d.ts.map +1 -1
  867. package/dist/types/services/email.service.d.ts +21 -10
  868. package/dist/types/services/email.service.d.ts.map +1 -1
  869. package/dist/types/types/dictionary.types.d.ts +1 -0
  870. package/dist/types/types/dictionary.types.d.ts.map +1 -1
  871. package/dist/types/types/user.types.d.ts +1 -0
  872. package/dist/types/types/user.types.d.ts.map +1 -1
  873. package/dist/types/utils/auth/getAuth.d.ts.map +1 -1
  874. package/dist/types/utils/filtersAndPagination/getDictionaryFiltersAndPagination.d.ts +2 -2
  875. package/dist/types/utils/filtersAndPagination/getDiscussionFiltersAndPagination.d.ts +2 -2
  876. package/dist/types/utils/filtersAndPagination/getOrganizationFiltersAndPagination.d.ts +2 -2
  877. package/dist/types/utils/filtersAndPagination/getProjectFiltersAndPagination.d.ts +2 -2
  878. package/dist/types/utils/filtersAndPagination/getTagFiltersAndPagination.d.ts +2 -2
  879. package/dist/types/utils/mongoDB/connectDB.d.ts +2 -2
  880. package/dist/types/utils/mongoDB/connectDB.d.ts.map +1 -1
  881. package/package.json +38 -33
  882. package/dist/assets/controllers/test.json +0 -4
  883. package/dist/cjs/routes/audit.routes.cjs +0 -35
  884. package/dist/cjs/routes/audit.routes.cjs.map +0 -1
  885. package/dist/cjs/schemas/audit.schema.cjs +0 -65
  886. package/dist/cjs/schemas/audit.schema.cjs.map +0 -1
  887. package/dist/cjs/services/audit.service.cjs +0 -49
  888. package/dist/cjs/services/audit.service.cjs.map +0 -1
  889. package/dist/cjs/types/audit.types.cjs +0 -0
  890. package/dist/esm/routes/audit.routes.mjs +0 -31
  891. package/dist/esm/routes/audit.routes.mjs.map +0 -1
  892. package/dist/esm/schemas/audit.schema.mjs +0 -63
  893. package/dist/esm/schemas/audit.schema.mjs.map +0 -1
  894. package/dist/esm/services/audit.service.mjs +0 -46
  895. package/dist/esm/services/audit.service.mjs.map +0 -1
  896. package/dist/esm/types/audit.types.mjs +0 -0
  897. package/dist/types/emails/index.d.ts.map +0 -1
  898. package/dist/types/export.d.ts.map +0 -1
  899. package/dist/types/index.d.ts.map +0 -1
  900. package/dist/types/routes/audit.routes.d.ts +0 -29
  901. package/dist/types/routes/audit.routes.d.ts.map +0 -1
  902. package/dist/types/schemas/audit.schema.d.ts +0 -19
  903. package/dist/types/schemas/audit.schema.d.ts.map +0 -1
  904. package/dist/types/services/audit.service.d.ts +0 -36
  905. package/dist/types/services/audit.service.d.ts.map +0 -1
  906. package/dist/types/types/audit.types.d.ts +0 -29
  907. package/dist/types/types/audit.types.d.ts.map +0 -1
  908. package/dist/types/utils/access.d.ts.map +0 -1
  909. package/dist/types/utils/errors/index.d.ts.map +0 -1
@@ -0,0 +1,12 @@
1
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
+
3
+ //#region ../../node_modules/zod/v4/core/versions.js
4
+ const version = {
5
+ major: 4,
6
+ minor: 1,
7
+ patch: 12
8
+ };
9
+
10
+ //#endregion
11
+ exports.version = version;
12
+ //# sourceMappingURL=versions.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versions.cjs","names":[],"sources":["../../../../../../../../node_modules/zod/v4/core/versions.js"],"sourcesContent":["export const version = {\n major: 4,\n minor: 1,\n patch: 12,\n};\n"],"x_google_ignoreList":[0],"mappings":";;;AAAA,MAAa,UAAU;CACnB,OAAO;CACP,OAAO;CACP,OAAO;CACV"}
@@ -39,6 +39,23 @@ const userSchema = new mongoose.Schema({
39
39
  enum: ["admin", "user"],
40
40
  default: "user",
41
41
  required: false
42
+ },
43
+ lastLoginMethod: {
44
+ type: String,
45
+ enum: [
46
+ "email",
47
+ "google",
48
+ "github"
49
+ ],
50
+ required: false
51
+ },
52
+ lang: {
53
+ type: String,
54
+ required: false
55
+ },
56
+ dateOfBirth: {
57
+ type: Date,
58
+ required: false
42
59
  }
43
60
  }, {
44
61
  timestamps: true,
@@ -1 +1 @@
1
- {"version":3,"file":"user.schema.cjs","names":["Schema","NAMES_MAX_LENGTH","NAMES_MIN_LENGTH"],"sources":["../../../src/schemas/user.schema.ts"],"sourcesContent":["import {\n NAMES_MAX_LENGTH,\n NAMES_MIN_LENGTH,\n} from '@utils/validation/validateUser';\nimport { Schema } from 'mongoose';\nimport validator from 'validator';\nimport type { UserSchema } from '@/types/user.types';\n\nexport const userSchema = new Schema<UserSchema>(\n {\n email: {\n type: String,\n required: true,\n unique: true,\n validate: [validator.isEmail, 'Please fill a valid email address'],\n lowercase: true,\n trim: true,\n },\n name: {\n type: String,\n maxlength: NAMES_MAX_LENGTH,\n minlength: NAMES_MIN_LENGTH,\n },\n phone: {\n type: String,\n maxlength: 20,\n },\n\n customerId: {\n type: String,\n required: false,\n },\n\n emailsList: {\n type: {\n newsLetter: {\n type: Boolean,\n default: false,\n },\n },\n required: false,\n },\n role: {\n type: String,\n enum: ['admin', 'user'],\n default: 'user',\n required: false,\n },\n },\n {\n timestamps: true,\n\n toJSON: {\n virtuals: true, // keep the automatic `id` getter\n versionKey: false, // drop __v\n transform(_doc, ret: any) {\n const { _id, ...rest } = ret;\n return {\n ...rest,\n id: _id.toString(),\n };\n },\n },\n toObject: {\n virtuals: true,\n transform(_doc, ret: any) {\n const { _id, ...rest } = ret;\n return {\n ...rest,\n id: _id,\n };\n },\n },\n }\n);\n"],"mappings":";;;;;;;AAQA,MAAa,aAAa,IAAIA,gBAC5B;CACE,OAAO;EACL,MAAM;EACN,UAAU;EACV,QAAQ;EACR,UAAU,CAAC,kBAAU,SAAS,oCAAoC;EAClE,WAAW;EACX,MAAM;EACP;CACD,MAAM;EACJ,MAAM;EACN,WAAWC;EACX,WAAWC;EACZ;CACD,OAAO;EACL,MAAM;EACN,WAAW;EACZ;CAED,YAAY;EACV,MAAM;EACN,UAAU;EACX;CAED,YAAY;EACV,MAAM,EACJ,YAAY;GACV,MAAM;GACN,SAAS;GACV,EACF;EACD,UAAU;EACX;CACD,MAAM;EACJ,MAAM;EACN,MAAM,CAAC,SAAS,OAAO;EACvB,SAAS;EACT,UAAU;EACX;CACF,EACD;CACE,YAAY;CAEZ,QAAQ;EACN,UAAU;EACV,YAAY;EACZ,UAAU,MAAM,KAAU;GACxB,MAAM,EAAE,IAAK,GAAG,SAAS;AACzB,UAAO;IACL,GAAG;IACH,IAAI,IAAI,UAAU;IACnB;;EAEJ;CACD,UAAU;EACR,UAAU;EACV,UAAU,MAAM,KAAU;GACxB,MAAM,EAAE,IAAK,GAAG,SAAS;AACzB,UAAO;IACL,GAAG;IACH,IAAI;IACL;;EAEJ;CACF,CACF"}
1
+ {"version":3,"file":"user.schema.cjs","names":["Schema","NAMES_MAX_LENGTH","NAMES_MIN_LENGTH"],"sources":["../../../src/schemas/user.schema.ts"],"sourcesContent":["import {\n NAMES_MAX_LENGTH,\n NAMES_MIN_LENGTH,\n} from '@utils/validation/validateUser';\nimport { Schema } from 'mongoose';\nimport validator from 'validator';\nimport type { UserSchema } from '@/types/user.types';\n\nexport const userSchema = new Schema<UserSchema>(\n {\n email: {\n type: String,\n required: true,\n unique: true,\n validate: [validator.isEmail, 'Please fill a valid email address'],\n lowercase: true,\n trim: true,\n },\n name: {\n type: String,\n maxlength: NAMES_MAX_LENGTH,\n minlength: NAMES_MIN_LENGTH,\n },\n phone: {\n type: String,\n maxlength: 20,\n },\n\n customerId: {\n type: String,\n required: false,\n },\n\n emailsList: {\n type: {\n newsLetter: {\n type: Boolean,\n default: false,\n },\n },\n required: false,\n },\n role: {\n type: String,\n enum: ['admin', 'user'],\n default: 'user',\n required: false,\n },\n lastLoginMethod: {\n type: String,\n enum: ['email', 'google', 'github'],\n required: false,\n },\n lang: {\n type: String,\n required: false,\n },\n dateOfBirth: {\n type: Date,\n required: false,\n },\n },\n {\n timestamps: true,\n\n toJSON: {\n virtuals: true, // keep the automatic `id` getter\n versionKey: false, // drop __v\n transform(_doc, ret: any) {\n const { _id, ...rest } = ret;\n return {\n ...rest,\n id: _id.toString(),\n };\n },\n },\n toObject: {\n virtuals: true,\n transform(_doc, ret: any) {\n const { _id, ...rest } = ret;\n return {\n ...rest,\n id: _id,\n };\n },\n },\n }\n);\n"],"mappings":";;;;;;;AAQA,MAAa,aAAa,IAAIA,gBAC5B;CACE,OAAO;EACL,MAAM;EACN,UAAU;EACV,QAAQ;EACR,UAAU,CAAC,kBAAU,SAAS,oCAAoC;EAClE,WAAW;EACX,MAAM;EACP;CACD,MAAM;EACJ,MAAM;EACN,WAAWC;EACX,WAAWC;EACZ;CACD,OAAO;EACL,MAAM;EACN,WAAW;EACZ;CAED,YAAY;EACV,MAAM;EACN,UAAU;EACX;CAED,YAAY;EACV,MAAM,EACJ,YAAY;GACV,MAAM;GACN,SAAS;GACV,EACF;EACD,UAAU;EACX;CACD,MAAM;EACJ,MAAM;EACN,MAAM,CAAC,SAAS,OAAO;EACvB,SAAS;EACT,UAAU;EACX;CACD,iBAAiB;EACf,MAAM;EACN,MAAM;GAAC;GAAS;GAAU;GAAS;EACnC,UAAU;EACX;CACD,MAAM;EACJ,MAAM;EACN,UAAU;EACX;CACD,aAAa;EACX,MAAM;EACN,UAAU;EACX;CACF,EACD;CACE,YAAY;CAEZ,QAAQ;EACN,UAAU;EACV,YAAY;EACZ,UAAU,MAAM,KAAU;GACxB,MAAM,EAAE,IAAK,GAAG,SAAS;AACzB,UAAO;IACL,GAAG;IACH,IAAI,IAAI,UAAU;IACnB;;EAEJ;CACD,UAAU;EACR,UAAU;EACV,UAAU,MAAM,KAAU;GACxB,MAAM,EAAE,IAAK,GAAG,SAAS;AACzB,UAAO;IACL,GAAG;IACH,IAAI;IACL;;EAEJ;CACF,CACF"}
@@ -101,26 +101,6 @@ const createDictionary = async (dictionary) => {
101
101
  return await require_models_dictionary_model.DictionaryModel.create(dictionary);
102
102
  };
103
103
  /**
104
- * Gets the existing dictionaries from the provided list of keys.
105
- * @param dictionariesKeys - List of dictionary keys to check.
106
- * @param projectId - The ID of the project to check the dictionaries against.
107
- * @returns The existing dictionaries and the new dictionaries.
108
- */
109
- const getExistingDictionaryKey = async (dictionariesKeys, projectId) => {
110
- const existingDictionaries = await require_models_dictionary_model.DictionaryModel.find({
111
- key: { $in: dictionariesKeys },
112
- projectIds: projectId
113
- });
114
- const existingDictionariesKey = [];
115
- const newDictionariesKey = [];
116
- for (const key of dictionariesKeys) if (existingDictionaries.some((dictionary) => dictionary.key === key)) existingDictionariesKey.push(key);
117
- else newDictionariesKey.push(key);
118
- return {
119
- existingDictionariesKey,
120
- newDictionariesKey
121
- };
122
- };
123
- /**
124
104
  * Updates an existing dictionary in the database by its ID.
125
105
  * @param dictionaryId - The ID of the dictionary to update.
126
106
  * @param dictionary - The updated dictionary data.
@@ -143,18 +123,15 @@ const updateDictionaryById = async (dictionaryId, dictionary) => {
143
123
  * @returns The updated dictionary.
144
124
  */
145
125
  const updateDictionaryByKey = async (dictionaryKey, dictionary, projectId) => {
146
- const dictionaryToUpdate = require_utils_removeObjectKeys.removeObjectKeys(require_utils_ensureMongoDocumentToObject.ensureMongoDocumentToObject(dictionary), ["id"]);
147
- const errors = await require_utils_validation_validateDictionary.validateDictionary(dictionaryToUpdate, Object.keys(dictionaryToUpdate));
148
- if (Object.keys(errors).length > 0) throw new require_utils_errors_ErrorsClass.GenericError("DICTIONARY_INVALID_FIELDS", {
149
- dictionaryKey,
150
- projectId,
151
- errors
152
- });
153
- if ((await require_models_dictionary_model.DictionaryModel.updateOne({
126
+ const existing = await require_models_dictionary_model.DictionaryModel.findOne({
154
127
  key: dictionaryKey,
155
128
  projectIds: projectId
156
- }, dictionaryToUpdate)).matchedCount === 0) throw new require_utils_errors_ErrorsClass.GenericError("DICTIONARY_UPDATE_FAILED", { dictionaryKey });
157
- return await getDictionaryByKey(dictionaryKey, projectId);
129
+ });
130
+ if (!existing) throw new require_utils_errors_ErrorsClass.GenericError("DICTIONARY_UPDATE_FAILED", { dictionaryKey });
131
+ const dictionaryToUpdate = require_utils_removeObjectKeys.removeObjectKeys(require_utils_ensureMongoDocumentToObject.ensureMongoDocumentToObject(dictionary), ["id"]);
132
+ Object.assign(existing, dictionaryToUpdate);
133
+ await existing.save();
134
+ return existing;
158
135
  };
159
136
  /**
160
137
  * Deletes a dictionary from the database by its ID.
@@ -193,7 +170,6 @@ exports.getDictionariesByKeys = getDictionariesByKeys;
193
170
  exports.getDictionariesByTags = getDictionariesByTags;
194
171
  exports.getDictionaryById = getDictionaryById;
195
172
  exports.getDictionaryByKey = getDictionaryByKey;
196
- exports.getExistingDictionaryKey = getExistingDictionaryKey;
197
173
  exports.incrementVersion = incrementVersion;
198
174
  exports.updateDictionaryById = updateDictionaryById;
199
175
  exports.updateDictionaryByKey = updateDictionaryByKey;
@@ -1 +1 @@
1
- {"version":3,"file":"dictionary.service.cjs","names":["DictionaryModel","Types","GenericError","validateDictionary","existingDictionariesKey: string[]","newDictionariesKey: string[]","removeObjectKeys","ensureMongoDocumentToObject"],"sources":["../../../src/services/dictionary.service.ts"],"sourcesContent":["import { DictionaryModel } from '@models/dictionary.model';\nimport { ensureMongoDocumentToObject } from '@utils/ensureMongoDocumentToObject';\nimport { GenericError } from '@utils/errors';\nimport type { DictionaryFilters } from '@utils/filtersAndPagination/getDictionaryFiltersAndPagination';\nimport { removeObjectKeys } from '@utils/removeObjectKeys';\nimport {\n type DictionaryFields,\n validateDictionary,\n} from '@utils/validation/validateDictionary';\nimport { Types } from 'mongoose';\nimport type {\n Dictionary,\n DictionaryData,\n DictionaryDocument,\n} from '@/types/dictionary.types';\nimport type { Project } from '@/types/project.types';\n\n/**\n * Finds dictionaries based on filters and pagination options.\n * @param filters - MongoDB filter query.\n * @param skip - Number of documents to skip.\n * @param limit - Number of documents to limit.\n * @returns List of dictionaries matching the filters.\n */\nexport const findDictionaries = async (\n filters: DictionaryFilters,\n skip = 0,\n limit = 100,\n sortOptions?: Record<string, 1 | -1>\n): Promise<DictionaryDocument[]> => {\n try {\n const dictionaries = await DictionaryModel.aggregate<DictionaryDocument>([\n // Stage 1: Match the filters\n { $match: filters },\n\n // Stage 2: Sort if provided (default handled in filter builder)\n ...(sortOptions && Object.keys(sortOptions).length > 0\n ? [{ $sort: sortOptions }]\n : []),\n\n // Stage 3: Skip for pagination\n { $skip: skip },\n\n // Stage 4: Limit the number of documents\n { $limit: limit },\n ]);\n\n const formattedResults = dictionaries.map(\n (result) => new DictionaryModel(result)\n );\n\n return formattedResults;\n } catch (error) {\n console.error('Error fetching dictionaries:', error);\n throw error;\n }\n};\n\n/**\n * Finds a dictionary by its ID.\n * @param dictionaryId - The ID of the dictionary to find.\n * @returns The dictionary matching the ID.\n */\n/**\n * Finds a dictionary by its ID and includes the 'versions' field.\n * @param dictionaryId - The ID of the dictionary to find.\n * @returns The dictionary matching the ID with available versions.\n */\nexport const getDictionaryById = async (\n dictionaryId: string | Types.ObjectId\n): Promise<DictionaryDocument> => {\n const id = Types.ObjectId.isValid(dictionaryId as string)\n ? new Types.ObjectId(dictionaryId as string)\n : dictionaryId;\n\n const dictionaries = await DictionaryModel.aggregate<DictionaryDocument>([\n // Stage 1: Match the document by ID\n { $match: { _id: id } },\n\n // Stage 2: Add the 'versions' field\n {\n $addFields: {\n versions: {\n $map: {\n input: { $objectToArray: '$content' },\n as: 'version',\n in: '$$version.k',\n },\n },\n },\n },\n ]);\n\n if (!dictionaries.length) {\n throw new GenericError('DICTIONARY_NOT_FOUND', { dictionaryId });\n }\n\n return new DictionaryModel(dictionaries[0]);\n};\n\n/**\n * Finds a dictionary by its ID.\n * @param dictionaryKey - The ID of the dictionary to find.\n * @returns The dictionary matching the ID.\n */\nexport const getDictionaryByKey = async (\n dictionaryKey: string,\n projectId: string | Types.ObjectId\n): Promise<DictionaryDocument> => {\n const dictionaries = await getDictionariesByKeys([dictionaryKey], projectId);\n\n return dictionaries[0];\n};\n\nexport const getDictionariesByKeys = async (\n dictionaryKeys: string[],\n projectId: string | Types.ObjectId\n): Promise<DictionaryDocument[]> => {\n const dictionaries = await DictionaryModel.aggregate<DictionaryDocument>([\n // Stage 1: Match the document by key\n { $match: { key: { $in: dictionaryKeys }, projectIds: projectId } },\n\n // Stage 2: Add the 'versions' field\n {\n $addFields: {\n versions: {\n $map: {\n input: { $objectToArray: '$content' },\n as: 'version',\n in: '$$version.k',\n },\n },\n },\n },\n ]);\n\n if (!dictionaries) {\n throw new GenericError('DICTIONARY_NOT_FOUND', {\n dictionaryKeys,\n projectId,\n });\n }\n\n const formattedResults = dictionaries.map(\n (result) => new DictionaryModel(result)\n );\n\n return formattedResults;\n};\n\nexport const getDictionariesByTags = async (\n tags: string[],\n projectId: string | Project['id']\n): Promise<DictionaryDocument[]> => {\n const dictionaries = await DictionaryModel.aggregate<DictionaryDocument>([\n // Stage 1: Match the document by tags\n {\n $match: {\n tags: { $in: tags },\n projectIds: projectId,\n },\n },\n\n // Stage 2: Add the 'versions' field\n {\n $addFields: {\n versions: {\n $map: {\n input: { $objectToArray: '$content' },\n as: 'version',\n in: '$$version.k',\n },\n },\n },\n },\n ]);\n\n const formattedResults = dictionaries.map(\n (result) => new DictionaryModel(result)\n );\n\n return formattedResults;\n};\n\n/**\n * Counts the total number of dictionaries that match the filters.\n * @param filters - MongoDB filter query.\n * @returns Total number of dictionaries.\n */\nexport const countDictionaries = async (\n filters: DictionaryFilters\n): Promise<number> => {\n const result = await DictionaryModel.countDocuments(filters);\n\n if (typeof result === 'undefined') {\n throw new GenericError('DICTIONARY_COUNT_FAILED', { filters });\n }\n\n return result;\n};\n\n/**\n * Creates a new dictionary in the database.\n * @param dictionary - The dictionary data to create.\n * @returns The created dictionary.\n */\nexport const createDictionary = async (\n dictionary: DictionaryData\n): Promise<DictionaryDocument> => {\n const errors = await validateDictionary(dictionary);\n\n if (Object.keys(errors).length > 0) {\n throw new GenericError('DICTIONARY_INVALID_FIELDS', {\n errors,\n });\n }\n\n return await DictionaryModel.create(dictionary);\n};\n\ntype GetExistingDictionaryResult = {\n existingDictionariesKey: string[];\n newDictionariesKey: string[];\n};\n\n/**\n * Gets the existing dictionaries from the provided list of keys.\n * @param dictionariesKeys - List of dictionary keys to check.\n * @param projectId - The ID of the project to check the dictionaries against.\n * @returns The existing dictionaries and the new dictionaries.\n */\nexport const getExistingDictionaryKey = async (\n dictionariesKeys: string[],\n projectId: string | Types.ObjectId\n): Promise<GetExistingDictionaryResult> => {\n // Fetch dictionaries from the database where the key is in the provided list\n const existingDictionaries = await DictionaryModel.find({\n key: { $in: dictionariesKeys },\n projectIds: projectId,\n });\n\n // Map existing dictionaries to a LocalDictionary object\n const existingDictionariesKey: string[] = [];\n const newDictionariesKey: string[] = [];\n\n for (const key of dictionariesKeys) {\n const isDictionaryExist = existingDictionaries.some(\n (dictionary) => dictionary.key === key\n );\n\n if (isDictionaryExist) {\n existingDictionariesKey.push(key);\n } else {\n newDictionariesKey.push(key);\n }\n }\n\n return { existingDictionariesKey, newDictionariesKey };\n};\n\n/**\n * Updates an existing dictionary in the database by its ID.\n * @param dictionaryId - The ID of the dictionary to update.\n * @param dictionary - The updated dictionary data.\n * @returns The updated dictionary.\n */\nexport const updateDictionaryById = async (\n dictionaryId: string | Types.ObjectId,\n dictionary: Partial<Dictionary>\n): Promise<DictionaryDocument> => {\n const dictionaryObject = ensureMongoDocumentToObject(dictionary);\n const dictionaryToUpdate = removeObjectKeys(dictionaryObject, [\n 'id',\n ]) as unknown as Partial<Dictionary>;\n\n const updatedKeys = Object.keys(dictionaryToUpdate) as DictionaryFields;\n const errors = await validateDictionary(dictionaryToUpdate, updatedKeys);\n\n if (Object.keys(errors).length > 0) {\n throw new GenericError('DICTIONARY_INVALID_FIELDS', {\n dictionaryId,\n errors,\n });\n }\n\n const result = await DictionaryModel.updateOne(\n { _id: dictionaryId },\n dictionaryToUpdate\n );\n\n if (result.matchedCount === 0) {\n throw new GenericError('DICTIONARY_UPDATE_FAILED', { dictionaryId });\n }\n\n const updatedDictionary = await getDictionaryById(dictionaryId);\n\n return updatedDictionary;\n};\n\n/**\n * Updates an existing dictionary in the database by its key.\n * @param dictionaryKey - The ID of the dictionary to update.\n * @param dictionary - The updated dictionary data.\n * @returns The updated dictionary.\n */\nexport const updateDictionaryByKey = async (\n dictionaryKey: string,\n dictionary: Partial<Dictionary>,\n projectId: string | Types.ObjectId\n): Promise<DictionaryDocument> => {\n const dictionaryObject = ensureMongoDocumentToObject(dictionary);\n const dictionaryToUpdate = removeObjectKeys(dictionaryObject, [\n 'id',\n ]) as unknown as Partial<Dictionary>;\n\n const updatedKeys = Object.keys(dictionaryToUpdate) as DictionaryFields;\n const errors = await validateDictionary(dictionaryToUpdate, updatedKeys);\n\n if (Object.keys(errors).length > 0) {\n throw new GenericError('DICTIONARY_INVALID_FIELDS', {\n dictionaryKey,\n projectId,\n errors,\n });\n }\n\n const result = await DictionaryModel.updateOne(\n { key: dictionaryKey, projectIds: projectId },\n dictionaryToUpdate\n );\n\n if (result.matchedCount === 0) {\n throw new GenericError('DICTIONARY_UPDATE_FAILED', { dictionaryKey });\n }\n\n const updatedDictionary = await getDictionaryByKey(dictionaryKey, projectId);\n\n return updatedDictionary;\n};\n\n/**\n * Deletes a dictionary from the database by its ID.\n * @param dictionaryId - The ID of the dictionary to delete.\n * @returns The result of the deletion operation.\n */\nexport const deleteDictionaryById = async (\n dictionaryId: string\n): Promise<DictionaryDocument> => {\n const dictionary = await DictionaryModel.findByIdAndDelete(dictionaryId);\n\n if (!dictionary) {\n throw new GenericError('DICTIONARY_NOT_FOUND', { dictionaryId });\n }\n\n return dictionary;\n};\n\n// Function to extract the numeric part of the version\nconst getVersionNumber = (version: string): number => {\n const match = version.match(/^v(\\d+)$/);\n if (!match) {\n throw new Error(`Invalid version format: ${version}`);\n }\n return parseInt(match[1], 10);\n};\n\nexport const incrementVersion = (dictionary: Dictionary): string => {\n const VERSION_PREFIX = 'v';\n\n const versions = [...(dictionary.content.keys() ?? [])];\n const lastVersion = versions[versions.length - 1];\n\n // Start with the next version number\n let newNumber = getVersionNumber(lastVersion) + 1;\n let newVersion = `${VERSION_PREFIX}${newNumber}`;\n\n // Loop until a unique version is found\n while (versions.includes(newVersion)) {\n newNumber += 1;\n newVersion = `${VERSION_PREFIX}${newNumber}`;\n }\n\n return newVersion;\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAwBA,MAAa,mBAAmB,OAC9B,SACA,OAAO,GACP,QAAQ,KACR,gBACkC;AAClC,KAAI;AAqBF,UApBqB,MAAMA,gDAAgB,UAA8B;GAEvE,EAAE,QAAQ,SAAS;GAGnB,GAAI,eAAe,OAAO,KAAK,YAAY,CAAC,SAAS,IACjD,CAAC,EAAE,OAAO,aAAa,CAAC,GACxB,EAAE;GAGN,EAAE,OAAO,MAAM;GAGf,EAAE,QAAQ,OAAO;GAClB,CAAC,EAEoC,KACnC,WAAW,IAAIA,gDAAgB,OAAO,CACxC;UAGM,OAAO;AACd,UAAQ,MAAM,gCAAgC,MAAM;AACpD,QAAM;;;;;;;;;;;;;AAcV,MAAa,oBAAoB,OAC/B,iBACgC;CAChC,MAAM,KAAKC,eAAM,SAAS,QAAQ,aAAuB,GACrD,IAAIA,eAAM,SAAS,aAAuB,GAC1C;CAEJ,MAAM,eAAe,MAAM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AW,EACF,CAC5D,KACD,CAAC;CAGF,MAAM,SAAS,MAAMJ,+DAAmB,oBADpB,OAAO,KAAK,mBAAmB,CACqB;AAExE,KAAI,OAAO,KAAK,OAAO,CAAC,SAAS,EAC/B,OAAM,IAAID,8CAAa,6BAA6B;EAClD;EACA;EACA;EACD,CAAC;AAQJ,MALe,MAAMF,gDAAgB,UACnC;EAAE,KAAK;EAAe,YAAY;EAAW,EAC7C,mBACD,EAEU,iBAAiB,EAC1B,OAAM,IAAIE,8CAAa,4BAA4B,EAAE,eAAe,CAAC;AAKvE,QAF0B,MAAM,mBAAmB,eAAe,UAAU;;;;;;;AAU9E,MAAa,uBAAuB,OAClC,iBACgC;CAChC,MAAM,aAAa,MAAMF,gDAAgB,kBAAkB,aAAa;AAExE,KAAI,CAAC,WACH,OAAM,IAAIE,8CAAa,wBAAwB,EAAE,cAAc,CAAC;AAGlE,QAAO;;AAIT,MAAM,oBAAoB,YAA4B;CACpD,MAAM,QAAQ,QAAQ,MAAM,WAAW;AACvC,KAAI,CAAC,MACH,OAAM,IAAI,MAAM,2BAA2B,UAAU;AAEvD,QAAO,SAAS,MAAM,IAAI,GAAG;;AAG/B,MAAa,oBAAoB,eAAmC;CAClE,MAAM,iBAAiB;CAEvB,MAAM,WAAW,CAAC,GAAI,WAAW,QAAQ,MAAM,IAAI,EAAE,CAAE;CACvD,MAAM,cAAc,SAAS,SAAS,SAAS;CAG/C,IAAI,YAAY,iBAAiB,YAAY,GAAG;CAChD,IAAI,aAAa,GAAG,iBAAiB;AAGrC,QAAO,SAAS,SAAS,WAAW,EAAE;AACpC,eAAa;AACb,eAAa,GAAG,iBAAiB;;AAGnC,QAAO"}
1
+ {"version":3,"file":"dictionary.service.cjs","names":["DictionaryModel","Types","GenericError","validateDictionary","removeObjectKeys","ensureMongoDocumentToObject"],"sources":["../../../src/services/dictionary.service.ts"],"sourcesContent":["import { DictionaryModel } from '@models/dictionary.model';\nimport { ensureMongoDocumentToObject } from '@utils/ensureMongoDocumentToObject';\nimport { GenericError } from '@utils/errors';\nimport type { DictionaryFilters } from '@utils/filtersAndPagination/getDictionaryFiltersAndPagination';\nimport { removeObjectKeys } from '@utils/removeObjectKeys';\nimport {\n type DictionaryFields,\n validateDictionary,\n} from '@utils/validation/validateDictionary';\nimport { Types } from 'mongoose';\nimport type {\n Dictionary,\n DictionaryData,\n DictionaryDocument,\n} from '@/types/dictionary.types';\nimport type { Project } from '@/types/project.types';\n\n/**\n * Finds dictionaries based on filters and pagination options.\n * @param filters - MongoDB filter query.\n * @param skip - Number of documents to skip.\n * @param limit - Number of documents to limit.\n * @returns List of dictionaries matching the filters.\n */\nexport const findDictionaries = async (\n filters: DictionaryFilters,\n skip = 0,\n limit = 100,\n sortOptions?: Record<string, 1 | -1>\n): Promise<DictionaryDocument[]> => {\n try {\n const dictionaries = await DictionaryModel.aggregate<DictionaryDocument>([\n // Stage 1: Match the filters\n { $match: filters },\n\n // Stage 2: Sort if provided (default handled in filter builder)\n ...(sortOptions && Object.keys(sortOptions).length > 0\n ? [{ $sort: sortOptions }]\n : []),\n\n // Stage 3: Skip for pagination\n { $skip: skip },\n\n // Stage 4: Limit the number of documents\n { $limit: limit },\n ]);\n\n const formattedResults = dictionaries.map(\n (result) => new DictionaryModel(result)\n );\n\n return formattedResults;\n } catch (error) {\n console.error('Error fetching dictionaries:', error);\n throw error;\n }\n};\n\n/**\n * Finds a dictionary by its ID.\n * @param dictionaryId - The ID of the dictionary to find.\n * @returns The dictionary matching the ID.\n */\n/**\n * Finds a dictionary by its ID and includes the 'versions' field.\n * @param dictionaryId - The ID of the dictionary to find.\n * @returns The dictionary matching the ID with available versions.\n */\nexport const getDictionaryById = async (\n dictionaryId: string | Types.ObjectId\n): Promise<DictionaryDocument> => {\n const id = Types.ObjectId.isValid(dictionaryId as string)\n ? new Types.ObjectId(dictionaryId as string)\n : dictionaryId;\n\n const dictionaries = await DictionaryModel.aggregate<DictionaryDocument>([\n // Stage 1: Match the document by ID\n { $match: { _id: id } },\n\n // Stage 2: Add the 'versions' field\n {\n $addFields: {\n versions: {\n $map: {\n input: { $objectToArray: '$content' },\n as: 'version',\n in: '$$version.k',\n },\n },\n },\n },\n ]);\n\n if (!dictionaries.length) {\n throw new GenericError('DICTIONARY_NOT_FOUND', { dictionaryId });\n }\n\n return new DictionaryModel(dictionaries[0]);\n};\n\n/**\n * Finds a dictionary by its ID.\n * @param dictionaryKey - The ID of the dictionary to find.\n * @returns The dictionary matching the ID.\n */\nexport const getDictionaryByKey = async (\n dictionaryKey: string,\n projectId: string | Types.ObjectId\n): Promise<DictionaryDocument> => {\n const dictionaries = await getDictionariesByKeys([dictionaryKey], projectId);\n\n return dictionaries[0];\n};\n\nexport const getDictionariesByKeys = async (\n dictionaryKeys: string[],\n projectId: string | Types.ObjectId\n): Promise<DictionaryDocument[]> => {\n const dictionaries = await DictionaryModel.aggregate<DictionaryDocument>([\n // Stage 1: Match the document by key\n { $match: { key: { $in: dictionaryKeys }, projectIds: projectId } },\n\n // Stage 2: Add the 'versions' field\n {\n $addFields: {\n versions: {\n $map: {\n input: { $objectToArray: '$content' },\n as: 'version',\n in: '$$version.k',\n },\n },\n },\n },\n ]);\n\n if (!dictionaries) {\n throw new GenericError('DICTIONARY_NOT_FOUND', {\n dictionaryKeys,\n projectId,\n });\n }\n\n const formattedResults = dictionaries.map(\n (result) => new DictionaryModel(result)\n );\n\n return formattedResults;\n};\n\nexport const getDictionariesByTags = async (\n tags: string[],\n projectId: string | Project['id']\n): Promise<DictionaryDocument[]> => {\n const dictionaries = await DictionaryModel.aggregate<DictionaryDocument>([\n // Stage 1: Match the document by tags\n {\n $match: {\n tags: { $in: tags },\n projectIds: projectId,\n },\n },\n\n // Stage 2: Add the 'versions' field\n {\n $addFields: {\n versions: {\n $map: {\n input: { $objectToArray: '$content' },\n as: 'version',\n in: '$$version.k',\n },\n },\n },\n },\n ]);\n\n const formattedResults = dictionaries.map(\n (result) => new DictionaryModel(result)\n );\n\n return formattedResults;\n};\n\n/**\n * Counts the total number of dictionaries that match the filters.\n * @param filters - MongoDB filter query.\n * @returns Total number of dictionaries.\n */\nexport const countDictionaries = async (\n filters: DictionaryFilters\n): Promise<number> => {\n const result = await DictionaryModel.countDocuments(filters);\n\n if (typeof result === 'undefined') {\n throw new GenericError('DICTIONARY_COUNT_FAILED', { filters });\n }\n\n return result;\n};\n\n/**\n * Creates a new dictionary in the database.\n * @param dictionary - The dictionary data to create.\n * @returns The created dictionary.\n */\nexport const createDictionary = async (\n dictionary: DictionaryData\n): Promise<DictionaryDocument> => {\n const errors = await validateDictionary(dictionary);\n\n if (Object.keys(errors).length > 0) {\n throw new GenericError('DICTIONARY_INVALID_FIELDS', {\n errors,\n });\n }\n\n return await DictionaryModel.create(dictionary);\n};\n\n/**\n * Updates an existing dictionary in the database by its ID.\n * @param dictionaryId - The ID of the dictionary to update.\n * @param dictionary - The updated dictionary data.\n * @returns The updated dictionary.\n */\nexport const updateDictionaryById = async (\n dictionaryId: string | Types.ObjectId,\n dictionary: Partial<Dictionary>\n): Promise<DictionaryDocument> => {\n const dictionaryObject = ensureMongoDocumentToObject(dictionary);\n const dictionaryToUpdate = removeObjectKeys(dictionaryObject, [\n 'id',\n ]) as unknown as Partial<Dictionary>;\n\n const updatedKeys = Object.keys(dictionaryToUpdate) as DictionaryFields;\n const errors = await validateDictionary(dictionaryToUpdate, updatedKeys);\n\n if (Object.keys(errors).length > 0) {\n throw new GenericError('DICTIONARY_INVALID_FIELDS', {\n dictionaryId,\n errors,\n });\n }\n\n const result = await DictionaryModel.updateOne(\n { _id: dictionaryId },\n dictionaryToUpdate\n );\n\n if (result.matchedCount === 0) {\n throw new GenericError('DICTIONARY_UPDATE_FAILED', { dictionaryId });\n }\n\n const updatedDictionary = await getDictionaryById(dictionaryId);\n\n return updatedDictionary;\n};\n\n/**\n * Updates an existing dictionary in the database by its key.\n * @param dictionaryKey - The ID of the dictionary to update.\n * @param dictionary - The updated dictionary data.\n * @returns The updated dictionary.\n */\nexport const updateDictionaryByKey = async (\n dictionaryKey: string,\n dictionary: Partial<Dictionary>,\n projectId: string | Types.ObjectId\n): Promise<DictionaryDocument> => {\n const existing = await DictionaryModel.findOne({\n key: dictionaryKey,\n projectIds: projectId,\n });\n\n if (!existing) {\n throw new GenericError('DICTIONARY_UPDATE_FAILED', { dictionaryKey });\n }\n\n const dictionaryObject = ensureMongoDocumentToObject(dictionary);\n const dictionaryToUpdate = removeObjectKeys(dictionaryObject, [\n 'id',\n ]) as Partial<Dictionary>;\n\n // Optional: run your validateDictionary on dictionaryToUpdate here\n\n // Apply updated fields onto the existing doc\n Object.assign(existing, dictionaryToUpdate);\n\n // Save – this will trigger timestamps on parent + subdocs\n await existing.save();\n\n return existing;\n};\n\n/**\n * Deletes a dictionary from the database by its ID.\n * @param dictionaryId - The ID of the dictionary to delete.\n * @returns The result of the deletion operation.\n */\nexport const deleteDictionaryById = async (\n dictionaryId: string\n): Promise<DictionaryDocument> => {\n const dictionary = await DictionaryModel.findByIdAndDelete(dictionaryId);\n\n if (!dictionary) {\n throw new GenericError('DICTIONARY_NOT_FOUND', { dictionaryId });\n }\n\n return dictionary;\n};\n\n// Function to extract the numeric part of the version\nconst getVersionNumber = (version: string): number => {\n const match = version.match(/^v(\\d+)$/);\n if (!match) {\n throw new Error(`Invalid version format: ${version}`);\n }\n return parseInt(match[1], 10);\n};\n\nexport const incrementVersion = (dictionary: Dictionary): string => {\n const VERSION_PREFIX = 'v';\n\n const versions = [...(dictionary.content.keys() ?? [])];\n const lastVersion = versions[versions.length - 1];\n\n // Start with the next version number\n let newNumber = getVersionNumber(lastVersion) + 1;\n let newVersion = `${VERSION_PREFIX}${newNumber}`;\n\n // Loop until a unique version is found\n while (versions.includes(newVersion)) {\n newNumber += 1;\n newVersion = `${VERSION_PREFIX}${newNumber}`;\n }\n\n return newVersion;\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAwBA,MAAa,mBAAmB,OAC9B,SACA,OAAO,GACP,QAAQ,KACR,gBACkC;AAClC,KAA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AM,kBAAkB,aAAa;;;;;;;;AAWjE,MAAa,wBAAwB,OACnC,eACA,YACA,cACgC;CAChC,MAAM,WAAW,MAAMF,gDAAgB,QAAQ;EAC7C,KAAK;EACL,YAAY;EACb,CAAC;AAEF,KAAI,CAAC,SACH,OAAM,IAAIE,8CAAa,4BAA4B,EAAE,eAAe,CAAC;CAIvE,MAAM,qBAAqBE,gDADFC,sEAA4B,WAAW,EACF,CAC5D,KACD,CAAC;AAKF,QAAO,OAAO,UAAU,mBAAmB;AAG3C,OAAM,SAAS,MAAM;AAErB,QAAO;;;;;;;AAQT,MAAa,uBAAuB,OAClC,iBACgC;CAChC,MAAM,aAAa,MAAML,gDAAgB,kBAAkB,aAAa;AAExE,KAAI,CAAC,WACH,OAAM,IAAIE,8CAAa,wBAAwB,EAAE,cAAc,CAAC;AAGlE,QAAO;;AAIT,MAAM,oBAAoB,YAA4B;CACpD,MAAM,QAAQ,QAAQ,MAAM,WAAW;AACvC,KAAI,CAAC,MACH,OAAM,IAAI,MAAM,2BAA2B,UAAU;AAEvD,QAAO,SAAS,MAAM,IAAI,GAAG;;AAG/B,MAAa,oBAAoB,eAAmC;CAClE,MAAM,iBAAiB;CAEvB,MAAM,WAAW,CAAC,GAAI,WAAW,QAAQ,MAAM,IAAI,EAAE,CAAE;CACvD,MAAM,cAAc,SAAS,SAAS,SAAS;CAG/C,IAAI,YAAY,iBAAiB,YAAY,GAAG;CAChD,IAAI,aAAa,GAAG,iBAAiB;AAGrC,QAAO,SAAS,SAAS,WAAW,EAAE;AACpC,eAAa;AACb,eAAa,GAAG,iBAAiB;;AAGnC,QAAO"}
@@ -1,6 +1,7 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_logger_index = require('../logger/index.cjs');
3
3
  const require_emails_InviteUserEmail = require('../emails/InviteUserEmail.cjs');
4
+ const require_emails_MagicLinkEmail = require('../emails/MagicLinkEmail.cjs');
4
5
  const require_emails_OAuthTokenCreatedEmail = require('../emails/OAuthTokenCreatedEmail.cjs');
5
6
  const require_emails_PasswordChangeConfirmation = require('../emails/PasswordChangeConfirmation.cjs');
6
7
  const require_emails_ResetUserPassword = require('../emails/ResetUserPassword.cjs');
@@ -63,6 +64,18 @@ const getEmailComponents = (locale) => ({
63
64
  es: "¡Bienvenido a Intlayer!"
64
65
  }, locale)
65
66
  },
67
+ magicLink: {
68
+ template: (0, express_intlayer.t)({
69
+ en: require_emails_MagicLinkEmail.MagicLinkEmailEN,
70
+ fr: require_emails_MagicLinkEmail.MagicLinkEmailFR,
71
+ es: require_emails_MagicLinkEmail.MagicLinkEmailES
72
+ }, locale),
73
+ subject: (0, express_intlayer.t)({
74
+ en: "Sign in to Intlayer",
75
+ fr: "Connectez-vous à Intlayer",
76
+ es: "Inicia sesión en Intlayer"
77
+ }, locale)
78
+ },
66
79
  passwordChangeConfirmation: {
67
80
  template: (0, express_intlayer.t)({
68
81
  en: require_emails_PasswordChangeConfirmation.PasswordChangeConfirmationEmailEN,
@@ -1 +1 @@
1
- {"version":3,"file":"email.service.cjs","names":["InviteUserEmailEN","InviteUserEmailFR","InviteUserEmailES","ValidateUserEmailEN","ValidateUserEmailFR","ValidateUserEmailES","ResetPasswordEmailEN","ResetPasswordEmailFR","ResetPasswordEmailES","WelcomeEmailEN","WelcomeEmailFR","WelcomeEmailES","PasswordChangeConfirmationEmailEN","PasswordChangeConfirmationEmailFR","PasswordChangeConfirmationEmailES","SubscriptionPaymentSuccessEN","SubscriptionPaymentSuccessFR","SubscriptionPaymentSuccessES","SubscriptionPaymentCancellationEN","SubscriptionPaymentCancellationFR","SubscriptionPaymentCancellationES","SubscriptionPaymentErrorEN","SubscriptionPaymentErrorFR","SubscriptionPaymentErrorES","OAuthTokenCreatedEmailEN","OAuthTokenCreatedEmailFR","OAuthTokenCreatedEmailES","resend","Resend","logger"],"sources":["../../../src/services/email.service.tsx"],"sourcesContent":["import {\n InviteUserEmailEN,\n InviteUserEmailES,\n InviteUserEmailFR,\n} from '@emails/InviteUserEmail';\nimport {\n OAuthTokenCreatedEmailEN,\n OAuthTokenCreatedEmailES,\n OAuthTokenCreatedEmailFR,\n} from '@emails/OAuthTokenCreatedEmail';\nimport {\n PasswordChangeConfirmationEmailEN,\n PasswordChangeConfirmationEmailES,\n PasswordChangeConfirmationEmailFR,\n} from '@emails/PasswordChangeConfirmation';\nimport {\n ResetPasswordEmailEN,\n ResetPasswordEmailES,\n ResetPasswordEmailFR,\n} from '@emails/ResetUserPassword';\n\nimport {\n SubscriptionPaymentCancellationEN,\n SubscriptionPaymentCancellationES,\n SubscriptionPaymentCancellationFR,\n} from '@emails/SubscriptionPaymentCancellation';\nimport {\n SubscriptionPaymentErrorEN,\n SubscriptionPaymentErrorES,\n SubscriptionPaymentErrorFR,\n} from '@emails/SubscriptionPaymentError';\nimport {\n SubscriptionPaymentSuccessEN,\n SubscriptionPaymentSuccessES,\n SubscriptionPaymentSuccessFR,\n} from '@emails/SubscriptionPaymentSuccess';\nimport {\n ValidateUserEmailEN,\n ValidateUserEmailES,\n ValidateUserEmailFR,\n} from '@emails/ValidateUserEmail';\nimport {\n WelcomeEmailEN,\n WelcomeEmailES,\n WelcomeEmailFR,\n} from '@emails/Welcome';\nimport type { Locale } from '@intlayer/types';\nimport { logger } from '@logger';\nimport { t } from 'express-intlayer';\nimport type { ComponentProps, JSX } from 'react';\nimport { Resend } from 'resend';\n\ntype EmailComponentsType = (...props: any) => JSX.Element;\ntype EmailComponents = {\n [key: string]: {\n template: EmailComponentsType;\n subject: string;\n };\n};\n\nconst getEmailComponents = (locale?: Locale) =>\n ({\n invite: {\n template: t(\n {\n en: InviteUserEmailEN,\n fr: InviteUserEmailFR,\n es: InviteUserEmailES,\n },\n locale\n ),\n subject: t(\n {\n en: 'You have been invited to join Intlayer',\n fr: 'Vous êtes invité à rejoindre Intlayer',\n es: 'Has sido invitado a unirte a Intlayer',\n },\n locale\n ),\n },\n validate: {\n template: t(\n {\n en: ValidateUserEmailEN,\n fr: ValidateUserEmailFR,\n es: ValidateUserEmailES,\n },\n locale\n ),\n subject: t(\n {\n en: 'Validate your email for Intlayer',\n fr: 'Validez votre email pour Intlayer',\n es: 'Valida tu correo electrónico para Intlayer',\n },\n locale\n ),\n },\n resetPassword: {\n template: t(\n {\n en: ResetPasswordEmailEN,\n fr: ResetPasswordEmailFR,\n es: ResetPasswordEmailES,\n },\n locale\n ),\n subject: t(\n {\n en: 'Reset your password for Intlayer',\n fr: 'Réinitialisez votre mot de passe pour Intlayer',\n es: 'Restablece tu contraseña para Intlayer',\n },\n locale\n ),\n },\n welcome: {\n template: t(\n {\n en: WelcomeEmailEN,\n fr: WelcomeEmailFR,\n es: WelcomeEmailES,\n },\n locale\n ),\n subject: t(\n {\n en: 'Welcome to Intlayer!',\n fr: 'Bienvenue chez Intlayer!',\n es: '¡Bienvenido a Intlayer!',\n },\n locale\n ),\n },\n passwordChangeConfirmation: {\n template: t(\n {\n en: PasswordChangeConfirmationEmailEN,\n fr: PasswordChangeConfirmationEmailFR,\n es: PasswordChangeConfirmationEmailES,\n },\n locale\n ),\n subject: t(\n {\n en: 'Your Intlayer password has been changed',\n fr: 'Votre mot de passe Intlayer a été modifié',\n es: 'Tu contraseña de Intlayer ha sido cambiada',\n },\n locale\n ),\n },\n subscriptionPaymentSuccess: {\n template: t({\n en: SubscriptionPaymentSuccessEN,\n fr: SubscriptionPaymentSuccessFR,\n es: SubscriptionPaymentSuccessES,\n }),\n subject: t({\n en: 'Your payment for Intlayer subscription is confirmed',\n fr: \"Votre paiement pour l'abonnement Intlayer est confirmé\",\n es: 'Tu pago por la suscripción de Intlayer ha sido confirmado',\n }),\n },\n subscriptionPaymentCancellation: {\n template: t({\n en: SubscriptionPaymentCancellationEN,\n fr: SubscriptionPaymentCancellationFR,\n es: SubscriptionPaymentCancellationES,\n }),\n subject: t({\n en: 'Your Intlayer subscription has been canceled',\n fr: 'Votre abonnement Intlayer a été annulé',\n es: 'Tu suscripción de Intlayer ha sido cancelada',\n }),\n },\n subscriptionPaymentError: {\n template: t({\n en: SubscriptionPaymentErrorEN,\n fr: SubscriptionPaymentErrorFR,\n es: SubscriptionPaymentErrorES,\n }),\n subject: t({\n en: 'There was an issue with your Intlayer subscription payment',\n fr: \"Un problème est survenu avec votre paiement pour l'abonnement Intlayer\",\n es: 'Hubo un problema con el pago de tu suscripción de Intlayer',\n }),\n },\n oAuthTokenCreated: {\n template: t({\n en: OAuthTokenCreatedEmailEN,\n fr: OAuthTokenCreatedEmailFR,\n es: OAuthTokenCreatedEmailES,\n }),\n subject: t({\n en: 'A third-party OAuth application has been added to your Intlayer account',\n fr: 'Une application OAuth tierce a été ajoutée à votre compte Intlayer',\n es: 'Una aplicación OAuth de terceros ha sido añadida a tu cuenta de Intlayer',\n }),\n },\n }) satisfies EmailComponents;\n\ntype EmailType = keyof ReturnType<typeof getEmailComponents>;\n\nexport type SendEmailProps<T extends EmailType> = {\n type: T;\n to: string;\n subject?: string;\n locale?: Locale;\n} & ComponentProps<ReturnType<typeof getEmailComponents>[T]['template']>;\n\nexport const sendEmail = async <T extends EmailType>({\n type,\n to,\n subject,\n locale,\n ...props\n}: SendEmailProps<T>) => {\n const resend = new Resend(process.env.RESEND_API_KEY);\n\n const emailComponents = getEmailComponents(locale);\n\n const { template, subject: baseSubject } = emailComponents[type];\n\n type EmailComponentType = (typeof emailComponents)[T]['template'];\n\n const EmailComponent: EmailComponentType = template;\n\n const react = <EmailComponent {...(props as any)} />;\n\n await resend.emails\n .send({\n from: 'Intlayer <no-reply@intlayer.org>',\n to,\n subject: subject ?? baseSubject,\n react,\n })\n .catch((err) => logger.error(err));\n\n logger.info(`Email sent ${type} to ${to}`);\n};\n"],"mappings":";;;;;;;;;;;;;;;;AA4DA,MAAM,sBAAsB,YACzB;CACC,QAAQ;EACN,kCACE;GACE,IAAIA;GACJ,IAAIC;GACJ,IAAIC;GACL,EACD,OACD;EACD,iCACE;GACE,IAAI;GACJ,IAAI;GACJ,IAAI;GACL,EACD,OACD;EACF;CACD,UA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AIrD,MAAM,EAAE,UAAU,SAAS,gBAFH,mBAAmB,OAAO,CAES;CAM3D,MAAM,QAAQ,2CAF6B,YAEb,GAAK,QAAiB;AAEpD,OAAMD,SAAO,OACV,KAAK;EACJ,MAAM;EACN;EACA,SAAS,WAAW;EACpB;EACD,CAAC,CACD,OAAO,QAAQE,4BAAO,MAAM,IAAI,CAAC;AAEpC,6BAAO,KAAK,cAAc,KAAK,MAAM,KAAK"}
1
+ {"version":3,"file":"email.service.cjs","names":["InviteUserEmailEN","InviteUserEmailFR","InviteUserEmailES","ValidateUserEmailEN","ValidateUserEmailFR","ValidateUserEmailES","ResetPasswordEmailEN","ResetPasswordEmailFR","ResetPasswordEmailES","WelcomeEmailEN","WelcomeEmailFR","WelcomeEmailES","MagicLinkEmailEN","MagicLinkEmailFR","MagicLinkEmailES","PasswordChangeConfirmationEmailEN","PasswordChangeConfirmationEmailFR","PasswordChangeConfirmationEmailES","SubscriptionPaymentSuccessEN","SubscriptionPaymentSuccessFR","SubscriptionPaymentSuccessES","SubscriptionPaymentCancellationEN","SubscriptionPaymentCancellationFR","SubscriptionPaymentCancellationES","SubscriptionPaymentErrorEN","SubscriptionPaymentErrorFR","SubscriptionPaymentErrorES","OAuthTokenCreatedEmailEN","OAuthTokenCreatedEmailFR","OAuthTokenCreatedEmailES","resend","Resend","logger"],"sources":["../../../src/services/email.service.tsx"],"sourcesContent":["import {\n InviteUserEmailEN,\n InviteUserEmailES,\n InviteUserEmailFR,\n} from '@emails/InviteUserEmail';\nimport {\n MagicLinkEmailEN,\n MagicLinkEmailES,\n MagicLinkEmailFR,\n} from '@emails/MagicLinkEmail';\nimport {\n OAuthTokenCreatedEmailEN,\n OAuthTokenCreatedEmailES,\n OAuthTokenCreatedEmailFR,\n} from '@emails/OAuthTokenCreatedEmail';\nimport {\n PasswordChangeConfirmationEmailEN,\n PasswordChangeConfirmationEmailES,\n PasswordChangeConfirmationEmailFR,\n} from '@emails/PasswordChangeConfirmation';\nimport {\n ResetPasswordEmailEN,\n ResetPasswordEmailES,\n ResetPasswordEmailFR,\n} from '@emails/ResetUserPassword';\n\nimport {\n SubscriptionPaymentCancellationEN,\n SubscriptionPaymentCancellationES,\n SubscriptionPaymentCancellationFR,\n} from '@emails/SubscriptionPaymentCancellation';\nimport {\n SubscriptionPaymentErrorEN,\n SubscriptionPaymentErrorES,\n SubscriptionPaymentErrorFR,\n} from '@emails/SubscriptionPaymentError';\nimport {\n SubscriptionPaymentSuccessEN,\n SubscriptionPaymentSuccessES,\n SubscriptionPaymentSuccessFR,\n} from '@emails/SubscriptionPaymentSuccess';\nimport {\n ValidateUserEmailEN,\n ValidateUserEmailES,\n ValidateUserEmailFR,\n} from '@emails/ValidateUserEmail';\nimport {\n WelcomeEmailEN,\n WelcomeEmailES,\n WelcomeEmailFR,\n} from '@emails/Welcome';\nimport type { Locale } from '@intlayer/types';\nimport { logger } from '@logger';\nimport { t } from 'express-intlayer';\nimport type { ComponentProps, JSX } from 'react';\nimport { Resend } from 'resend';\n\ntype EmailComponentsType = (...props: any) => JSX.Element;\ntype EmailComponents = {\n [key: string]: {\n template: EmailComponentsType;\n subject: string;\n };\n};\n\nconst getEmailComponents = (locale?: Locale) =>\n ({\n invite: {\n template: t(\n {\n en: InviteUserEmailEN,\n fr: InviteUserEmailFR,\n es: InviteUserEmailES,\n },\n locale\n ),\n subject: t(\n {\n en: 'You have been invited to join Intlayer',\n fr: 'Vous êtes invité à rejoindre Intlayer',\n es: 'Has sido invitado a unirte a Intlayer',\n },\n locale\n ),\n },\n validate: {\n template: t(\n {\n en: ValidateUserEmailEN,\n fr: ValidateUserEmailFR,\n es: ValidateUserEmailES,\n },\n locale\n ),\n subject: t(\n {\n en: 'Validate your email for Intlayer',\n fr: 'Validez votre email pour Intlayer',\n es: 'Valida tu correo electrónico para Intlayer',\n },\n locale\n ),\n },\n resetPassword: {\n template: t(\n {\n en: ResetPasswordEmailEN,\n fr: ResetPasswordEmailFR,\n es: ResetPasswordEmailES,\n },\n locale\n ),\n subject: t(\n {\n en: 'Reset your password for Intlayer',\n fr: 'Réinitialisez votre mot de passe pour Intlayer',\n es: 'Restablece tu contraseña para Intlayer',\n },\n locale\n ),\n },\n welcome: {\n template: t(\n {\n en: WelcomeEmailEN,\n fr: WelcomeEmailFR,\n es: WelcomeEmailES,\n },\n locale\n ),\n subject: t(\n {\n en: 'Welcome to Intlayer!',\n fr: 'Bienvenue chez Intlayer!',\n es: '¡Bienvenido a Intlayer!',\n },\n locale\n ),\n },\n magicLink: {\n template: t(\n {\n en: MagicLinkEmailEN,\n fr: MagicLinkEmailFR,\n es: MagicLinkEmailES,\n },\n locale\n ),\n subject: t(\n {\n en: 'Sign in to Intlayer',\n fr: 'Connectez-vous à Intlayer',\n es: 'Inicia sesión en Intlayer',\n },\n locale\n ),\n },\n passwordChangeConfirmation: {\n template: t(\n {\n en: PasswordChangeConfirmationEmailEN,\n fr: PasswordChangeConfirmationEmailFR,\n es: PasswordChangeConfirmationEmailES,\n },\n locale\n ),\n subject: t(\n {\n en: 'Your Intlayer password has been changed',\n fr: 'Votre mot de passe Intlayer a été modifié',\n es: 'Tu contraseña de Intlayer ha sido cambiada',\n },\n locale\n ),\n },\n subscriptionPaymentSuccess: {\n template: t({\n en: SubscriptionPaymentSuccessEN,\n fr: SubscriptionPaymentSuccessFR,\n es: SubscriptionPaymentSuccessES,\n }),\n subject: t({\n en: 'Your payment for Intlayer subscription is confirmed',\n fr: \"Votre paiement pour l'abonnement Intlayer est confirmé\",\n es: 'Tu pago por la suscripción de Intlayer ha sido confirmado',\n }),\n },\n subscriptionPaymentCancellation: {\n template: t({\n en: SubscriptionPaymentCancellationEN,\n fr: SubscriptionPaymentCancellationFR,\n es: SubscriptionPaymentCancellationES,\n }),\n subject: t({\n en: 'Your Intlayer subscription has been canceled',\n fr: 'Votre abonnement Intlayer a été annulé',\n es: 'Tu suscripción de Intlayer ha sido cancelada',\n }),\n },\n subscriptionPaymentError: {\n template: t({\n en: SubscriptionPaymentErrorEN,\n fr: SubscriptionPaymentErrorFR,\n es: SubscriptionPaymentErrorES,\n }),\n subject: t({\n en: 'There was an issue with your Intlayer subscription payment',\n fr: \"Un problème est survenu avec votre paiement pour l'abonnement Intlayer\",\n es: 'Hubo un problema con el pago de tu suscripción de Intlayer',\n }),\n },\n oAuthTokenCreated: {\n template: t({\n en: OAuthTokenCreatedEmailEN,\n fr: OAuthTokenCreatedEmailFR,\n es: OAuthTokenCreatedEmailES,\n }),\n subject: t({\n en: 'A third-party OAuth application has been added to your Intlayer account',\n fr: 'Une application OAuth tierce a été ajoutée à votre compte Intlayer',\n es: 'Una aplicación OAuth de terceros ha sido añadida a tu cuenta de Intlayer',\n }),\n },\n }) satisfies EmailComponents;\n\ntype EmailType = keyof ReturnType<typeof getEmailComponents>;\n\nexport type SendEmailProps<T extends EmailType> = {\n type: T;\n to: string;\n subject?: string;\n locale?: Locale;\n} & ComponentProps<ReturnType<typeof getEmailComponents>[T]['template']>;\n\nexport const sendEmail = async <T extends EmailType>({\n type,\n to,\n subject,\n locale,\n ...props\n}: SendEmailProps<T>) => {\n const resend = new Resend(process.env.RESEND_API_KEY);\n\n const emailComponents = getEmailComponents(locale);\n\n const { template, subject: baseSubject } = emailComponents[type];\n\n type EmailComponentType = (typeof emailComponents)[T]['template'];\n\n const EmailComponent: EmailComponentType = template;\n\n const react = <EmailComponent {...(props as any)} />;\n\n await resend.emails\n .send({\n from: 'Intlayer <no-reply@intlayer.org>',\n to,\n subject: subject ?? baseSubject,\n react,\n })\n .catch((err) => logger.error(err));\n\n logger.info(`Email sent ${type} to ${to}`);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAiEA,MAAM,sBAAsB,YACzB;CACC,QAAQ;EACN,kCACE;GACE,IAAIA;GACJ,IAAIC;GACJ,IAAIC;GACL,EACD,OACD;EACD,iCACE;GACE,IAAI;GACJ,IAAI;GACJ,IAAI;GACL,EACD,OACD;EACF;CACD,UAAU;EACR,kCACE;GACE,IAAIC;GACJ,IAAIC;GACJ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AA4B,EACnD,MACA,IACA,SACA,OACA,GAAG,YACoB;CACvB,MAAMC,WAAS,IAAIC,cAAO,QAAQ,IAAI,eAAe;CAIrD,MAAM,EAAE,UAAU,SAAS,gBAFH,mBAAmB,OAAO,CAES;CAM3D,MAAM,QAAQ,2CAF6B,YAEb,GAAK,QAAiB;AAEpD,OAAMD,SAAO,OACV,KAAK;EACJ,MAAM;EACN;EACA,SAAS,WAAW;EACpB;EACD,CAAC,CACD,OAAO,QAAQE,4BAAO,MAAM,IAAI,CAAC;AAEpC,6BAAO,KAAK,cAAc,KAAK,MAAM,KAAK"}
@@ -1 +1 @@
1
- {"version":3,"file":"user.types.cjs","names":[],"sources":["../../../src/types/user.types.ts"],"sourcesContent":["import type { RenameId } from '@utils/mongoDB/types';\nimport type { User as BetterAuthUser, OmitId } from 'better-auth';\nimport type { Document, Model, ObjectIdToString, Types } from 'mongoose';\n\nexport interface UserData {\n email: string;\n name: string;\n phone?: string;\n dateOfBirth?: Date;\n}\n\nexport enum EmailsList {\n NEWS_LETTER = 'newsLetter',\n}\n\nexport type User = OmitId<UserData & BetterAuthUser> & {\n id: Types.ObjectId;\n emailsList?: {\n [key in EmailsList]: boolean;\n };\n customerId?: string; // Stripe customer ID\n role?: string;\n lang?: string;\n createdAt: Date;\n updatedAt: Date;\n};\n\nexport type UserAPI = ObjectIdToString<Omit<User, 'provider' | 'session'>>;\n\nexport type UserSchema = RenameId<User>;\nexport type UserModelType = Model<User>;\nexport type UserDocument = Document<unknown, {}, User> & User;\n"],"mappings":";;AAWA,IAAY,oDAAL;AACL"}
1
+ {"version":3,"file":"user.types.cjs","names":[],"sources":["../../../src/types/user.types.ts"],"sourcesContent":["import type { RenameId } from '@utils/mongoDB/types';\nimport type { User as BetterAuthUser, OmitId } from 'better-auth';\nimport type { Document, Model, ObjectIdToString, Types } from 'mongoose';\n\nexport interface UserData {\n email: string;\n name: string;\n phone?: string;\n dateOfBirth?: Date;\n}\n\nexport enum EmailsList {\n NEWS_LETTER = 'newsLetter',\n}\n\nexport type User = OmitId<UserData & BetterAuthUser> & {\n id: Types.ObjectId;\n emailsList?: {\n [key in EmailsList]: boolean;\n };\n customerId?: string; // Stripe customer ID\n role?: string;\n lastLoginMethod?: 'email' | 'google' | 'github' | 'passkey';\n lang?: string;\n createdAt: Date;\n updatedAt: Date;\n};\n\nexport type UserAPI = ObjectIdToString<Omit<User, 'provider' | 'session'>>;\n\nexport type UserSchema = RenameId<User>;\nexport type UserModelType = Model<User>;\nexport type UserDocument = Document<unknown, {}, User> & User;\n"],"mappings":";;AAWA,IAAY,oDAAL;AACL"}
@@ -14,6 +14,8 @@ let better_auth = require("better-auth");
14
14
  let better_auth_adapters_mongodb = require("better-auth/adapters/mongodb");
15
15
  let better_auth_api = require("better-auth/api");
16
16
  let better_auth_plugins = require("better-auth/plugins");
17
+ let better_auth_plugins_magic_link = require("better-auth/plugins/magic-link");
18
+ let better_auth_plugins_passkey = require("better-auth/plugins/passkey");
17
19
 
18
20
  //#region src/utils/auth/getAuth.ts
19
21
  const formatSession = (session) => {
@@ -90,31 +92,55 @@ const getAuth = (dbClient) => {
90
92
  }
91
93
  }
92
94
  },
93
- plugins: [(0, better_auth_plugins.customSession)(async ({ session }) => {
94
- const typedSession = session;
95
- let userAPI = null;
96
- let organizationAPI = null;
97
- let projectAPI = null;
98
- if (typedSession.userId) {
99
- const userData = await require_services_user_service.getUserById(typedSession.userId);
100
- if (userData) userAPI = require_utils_mapper_user.mapUserToAPI(userData);
101
- }
102
- if (typedSession.activeOrganizationId) {
103
- const orgData = await require_services_organization_service.getOrganizationById(typedSession.activeOrganizationId);
104
- if (orgData) organizationAPI = require_utils_mapper_organization.mapOrganizationToAPI(orgData);
105
- }
106
- if (typedSession.activeProjectId) {
107
- const projectData = await require_services_project_service.getProjectById(typedSession.activeProjectId);
108
- if (projectData) projectAPI = require_utils_mapper_project.mapProjectToAPI(projectData);
109
- }
110
- return require_utils_mapper_session.mapSessionToAPI(formatSession({
111
- session: typedSession,
112
- user: userAPI,
113
- organization: organizationAPI ?? null,
114
- project: projectAPI ?? null,
115
- authType: "session"
116
- }));
117
- })],
95
+ plugins: [
96
+ (0, better_auth_plugins.customSession)(async ({ session }) => {
97
+ const typedSession = session;
98
+ let userAPI = null;
99
+ let organizationAPI = null;
100
+ let projectAPI = null;
101
+ if (typedSession.userId) {
102
+ const userData = await require_services_user_service.getUserById(typedSession.userId);
103
+ if (userData) userAPI = require_utils_mapper_user.mapUserToAPI(userData);
104
+ }
105
+ if (typedSession.activeOrganizationId) {
106
+ const orgData = await require_services_organization_service.getOrganizationById(typedSession.activeOrganizationId);
107
+ if (orgData) organizationAPI = require_utils_mapper_organization.mapOrganizationToAPI(orgData);
108
+ }
109
+ if (typedSession.activeProjectId) {
110
+ const projectData = await require_services_project_service.getProjectById(typedSession.activeProjectId);
111
+ if (projectData) projectAPI = require_utils_mapper_project.mapProjectToAPI(projectData);
112
+ }
113
+ return require_utils_mapper_session.mapSessionToAPI(formatSession({
114
+ session: typedSession,
115
+ user: userAPI,
116
+ organization: organizationAPI ?? null,
117
+ project: projectAPI ?? null,
118
+ authType: "session"
119
+ }));
120
+ }),
121
+ (0, better_auth_plugins.lastLoginMethod)({
122
+ storeInDatabase: true,
123
+ schema: { user: { lastLoginMethod: "lastLoginMethod" } },
124
+ customResolveMethod: (context) => {
125
+ if (context.path === "/magic-link/verify") return "magic-link";
126
+ return null;
127
+ }
128
+ }),
129
+ (0, better_auth_plugins_passkey.passkey)(),
130
+ (0, better_auth_plugins.twoFactor)(),
131
+ (0, better_auth_plugins_magic_link.magicLink)({ sendMagicLink: async ({ email, url }) => {
132
+ require_logger_index.logger.info("sending magic link", {
133
+ email,
134
+ url
135
+ });
136
+ await require_services_email_service.sendEmail({
137
+ type: "magicLink",
138
+ to: email,
139
+ username: email.split("@")[0],
140
+ magicLink: url
141
+ });
142
+ } })
143
+ ],
118
144
  emailAndPassword: {
119
145
  enabled: true,
120
146
  disableSignUp: false,
@@ -135,7 +161,11 @@ const getAuth = (dbClient) => {
135
161
  },
136
162
  accountLinking: {
137
163
  enabled: true,
138
- trustedProviders: ["google", "github"]
164
+ trustedProviders: [
165
+ "google",
166
+ "github",
167
+ "linkedin"
168
+ ]
139
169
  },
140
170
  emailVerification: {
141
171
  autoSignInAfterVerification: true,
@@ -172,6 +202,10 @@ const getAuth = (dbClient) => {
172
202
  github: {
173
203
  clientId: process.env.GITHUB_CLIENT_ID,
174
204
  clientSecret: process.env.GITHUB_CLIENT_SECRET
205
+ },
206
+ linkedin: {
207
+ clientId: process.env.LINKEDIN_CLIENT_ID,
208
+ clientSecret: process.env.LINKEDIN_CLIENT_SECRET
175
209
  }
176
210
  },
177
211
  logger: { log: (level, message, ...args) => require_logger_index.logger[level](message, ...args) }
@@ -1 +1 @@
1
- {"version":3,"file":"getAuth.cjs","names":["getSessionRoles","computeEffectivePermission","intersectPermissions","sendEmail","userAPI: UserAPI | null","organizationAPI: OrganizationAPI | null","projectAPI: ProjectAPI | null","getUserById","mapUserToAPI","getOrganizationById","mapOrganizationToAPI","getProjectById","mapProjectToAPI","mapSessionToAPI","logger"],"sources":["../../../../src/utils/auth/getAuth.ts"],"sourcesContent":["import { sendVerificationUpdate } from '@controllers/user.controller';\nimport { logger } from '@logger';\nimport { sendEmail } from '@services/email.service';\nimport { getOrganizationById } from '@services/organization.service';\nimport { getProjectById } from '@services/project.service';\nimport { getUserById } from '@services/user.service';\nimport { mapOrganizationToAPI } from '@utils/mapper/organization';\nimport { mapProjectToAPI } from '@utils/mapper/project';\nimport { mapSessionToAPI } from '@utils/mapper/session';\nimport { mapUserToAPI } from '@utils/mapper/user';\nimport {\n computeEffectivePermission,\n getSessionRoles,\n intersectPermissions,\n} from '@utils/permissions';\nimport { betterAuth, type OmitId } from 'better-auth';\nimport { mongodbAdapter } from 'better-auth/adapters/mongodb';\nimport { createAuthMiddleware } from 'better-auth/api';\nimport { customSession } from 'better-auth/plugins';\nimport type { MongoClient } from 'mongodb';\nimport type { OrganizationAPI } from '@/types/organization.types';\nimport type { ProjectAPI } from '@/types/project.types';\nimport type {\n Session,\n SessionContext,\n SessionDataApi,\n} from '@/types/session.types';\nimport type { User, UserAPI } from '@/types/user.types';\n\nexport type Auth = ReturnType<typeof betterAuth>;\n\nexport const formatSession = (session: SessionContext): OmitId<Session> => {\n const roles = getSessionRoles(session);\n let permissions = computeEffectivePermission(roles);\n\n // Intersect in the case a Access Token try to override the permissions\n if (session.permissions) {\n permissions = intersectPermissions(permissions, session.permissions);\n }\n\n const resultSession = {\n session: session.session,\n user: session.user,\n organization: session.organization,\n project: session.project,\n authType: 'session',\n permissions,\n roles,\n } as OmitId<Session>;\n\n return resultSession;\n};\n\nexport const getAuth = (dbClient: MongoClient): Auth => {\n if (!dbClient) {\n throw new Error('MongoDB connection not established');\n }\n\n const auth = betterAuth({\n appName: 'Intlayer',\n\n database: mongodbAdapter(dbClient.db()),\n\n /**\n * User model\n */\n user: {\n modelName: 'users',\n },\n\n databaseHooks: {\n user: {\n create: {\n // Runs once, immediately after the INSERT\n after: async (user) => {\n if (!user?.emailVerified) return;\n\n await sendEmail({\n type: 'welcome',\n to: user.email,\n username: user.name ?? user.email.split('@')[0],\n loginLink: `${process.env.CLIENT_URL}/auth/login`,\n locale: (user as any).lang,\n });\n logger.info('Welcome e‑mail delivered', {\n email: user.email,\n });\n },\n },\n },\n },\n\n hooks: {\n after: createAuthMiddleware(async (ctx) => {\n const { path, context } = ctx;\n\n const newUser = context.newSession?.user;\n const existingUser = context.session?.user;\n const user = newUser ?? existingUser;\n\n if (!user) return;\n\n if (['/verify-email'].includes(path)) {\n sendVerificationUpdate(user as unknown as User);\n logger.info('SSE verification update sent', {\n email: user.email,\n userId: user.id,\n });\n\n await sendEmail({\n type: 'welcome',\n to: user.email,\n username: user.name ?? user.email.split('@')[0],\n loginLink: `${process.env.CLIENT_URL}/auth/login`,\n locale: (user as any).lang,\n });\n logger.info('Welcome e‑mail delivered', {\n email: user.email,\n });\n }\n }),\n },\n\n advanced: {\n // 1️⃣ Change or drop the global prefix\n // cookiePrefix: \"intlayer\", // => intlayer.session_token\n cookiePrefix: 'intlayer', // => session_token (no prefix)\n\n // 2️⃣ Override just the session‑token cookie\n cookies: {\n session_token: {\n // name: 'intlayer_session_token', // final name depends on the prefix above\n // attributes: { sameSite: \"lax\", maxAge: 60 * 60 * 24 } // optional\n },\n },\n\n // 3️⃣ (optional) turn off the automatic __Secure‑ prefix in non‑prod\n // useSecureCookies: false,\n },\n\n secret: process.env.AUTH_SECRET as string,\n session: {\n modelName: 'sessions',\n id: 'id',\n\n additionalFields: {\n activeOrganizationId: { type: 'string', nullable: true, input: false },\n activeProjectId: { type: 'string', nullable: true, input: false },\n },\n },\n\n plugins: [\n customSession(async ({ session }) => {\n const typedSession = session as unknown as SessionDataApi;\n\n let userAPI: UserAPI | null = null;\n let organizationAPI: OrganizationAPI | null = null;\n let projectAPI: ProjectAPI | null = null;\n\n if (typedSession.userId) {\n const userData = await getUserById(typedSession.userId);\n\n if (userData) {\n userAPI = mapUserToAPI(userData);\n }\n }\n\n if (typedSession.activeOrganizationId) {\n const orgData = await getOrganizationById(\n typedSession.activeOrganizationId\n );\n\n if (orgData) {\n organizationAPI = mapOrganizationToAPI(orgData);\n }\n }\n if (typedSession.activeProjectId) {\n const projectData = await getProjectById(\n typedSession.activeProjectId\n );\n\n if (projectData) {\n projectAPI = mapProjectToAPI(projectData);\n }\n }\n\n const sessionWithNoPermission: SessionContext = {\n session: typedSession,\n user: userAPI!,\n organization: organizationAPI ?? null,\n project: projectAPI ?? null,\n authType: 'session',\n };\n\n const formattedSession = formatSession(sessionWithNoPermission);\n\n return mapSessionToAPI(formattedSession);\n }),\n ],\n\n emailAndPassword: {\n enabled: true,\n disableSignUp: false,\n requireEmailVerification: true,\n minPasswordLength: 8,\n maxPasswordLength: 128,\n autoSignIn: true,\n sendResetPassword: async ({ user, token }) => {\n logger.info('sending reset password email', { email: user.email });\n await sendEmail({\n type: 'resetPassword',\n to: user.email,\n username: user.name ?? user.email.split('@')[0],\n resetLink: `${process.env.CLIENT_URL}/auth/password/reset?token=${token}`,\n });\n },\n resetPasswordTokenExpiresIn: 3600,\n },\n accountLinking: {\n enabled: true, // allow linking in general\n trustedProviders: ['google', 'github'], // optional: auto‑link when Google verifies the e‑mail\n },\n emailVerification: {\n autoSignInAfterVerification: true,\n sendOnSignIn: true,\n sendVerificationEmail: async ({ user, url }) => {\n logger.info('sending verification email', { email: user.email });\n await sendEmail({\n type: 'validate',\n to: user.email,\n username: user.name ?? user.email.split('@')[0],\n validationLink: url,\n });\n },\n },\n\n crossSubDomainCookies: {\n enabled: true,\n additionalCookies: ['session_token'],\n domain: process.env.CLIENT_URL as string,\n },\n cookiePrefix: 'intlayer',\n cookies: {\n session_token: {\n name: 'session_token',\n attributes: {\n httpOnly: true,\n secure: true,\n },\n },\n },\n\n trustedOrigins: [process.env.CLIENT_URL as string],\n\n socialProviders: {\n google: {\n clientId: process.env.GOOGLE_CLIENT_ID as string,\n clientSecret: process.env.GOOGLE_CLIENT_SECRET as string,\n },\n github: {\n clientId: process.env.GITHUB_CLIENT_ID as string,\n clientSecret: process.env.GITHUB_CLIENT_SECRET as string,\n },\n },\n\n logger: {\n log: (level, message, ...args) => logger[level](message, ...args),\n },\n });\n\n return auth;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AA+BA,MAAa,iBAAiB,YAA6C;CACzE,MAAM,QAAQA,0CAAgB,QAAQ;CACtC,IAAI,cAAcC,qDAA2B,MAAM;AAGnD,KAAI,QAAQ,YACV,eAAcC,+CAAqB,aAAa,QAAQ,YAAY;AAatE,QAVsB;EACpB,SAAS,QAAQ;EACjB,MAAM,QAAQ;EACd,cAAc,QAAQ;EACtB,SAAS,QAAQ;EACjB,UAAU;EACV;EACA;EACD;;AAKH,MAAa,WAAW,aAAgC;AACtD,KAAI,CAAC,SACH,OAAM,IAAI,MAAM,qCAAqC;AAuNvD,oCApNwB;EACtB,SAAS;EAET,2DAAyB,SAAS,IAAI,CAAC;E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AgB;KACjB,CAAC;;GAEL;EAED,uBAAuB;GACrB,SAAS;GACT,mBAAmB,CAAC,gBAAgB;GACpC,QAAQ,QAAQ,IAAI;GACrB;EACD,cAAc;EACd,SAAS,EACP,eAAe;GACb,MAAM;GACN,YAAY;IACV,UAAU;IACV,QAAQ;IACT;GACF,EACF;EAED,gBAAgB,CAAC,QAAQ,IAAI,WAAqB;EAElD,iBAAiB;GACf,QAAQ;IACN,UAAU,QAAQ,IAAI;IACtB,cAAc,QAAQ,IAAI;IAC3B;GACD,QAAQ;IACN,UAAU,QAAQ,IAAI;IACtB,cAAc,QAAQ,IAAI;IAC3B;GACF;EAED,QAAQ,EACN,MAAM,OAAO,SAAS,GAAG,SAASW,4BAAO,OAAO,SAAS,GAAG,KAAK,EAClE;EACF,CAAC"}
1
+ {"version":3,"file":"getAuth.cjs","names":["getSessionRoles","computeEffectivePermission","intersectPermissions","sendEmail","userAPI: UserAPI | null","organizationAPI: OrganizationAPI | null","projectAPI: ProjectAPI | null","getUserById","mapUserToAPI","getOrganizationById","mapOrganizationToAPI","getProjectById","mapProjectToAPI","mapSessionToAPI","logger"],"sources":["../../../../src/utils/auth/getAuth.ts"],"sourcesContent":["// import { sso } from '@better-auth/sso';\nimport { sendVerificationUpdate } from '@controllers/user.controller';\nimport { logger } from '@logger';\nimport { sendEmail } from '@services/email.service';\nimport { getOrganizationById } from '@services/organization.service';\nimport { getProjectById } from '@services/project.service';\nimport { getUserById } from '@services/user.service';\nimport { mapOrganizationToAPI } from '@utils/mapper/organization';\nimport { mapProjectToAPI } from '@utils/mapper/project';\nimport { mapSessionToAPI } from '@utils/mapper/session';\nimport { mapUserToAPI } from '@utils/mapper/user';\nimport {\n computeEffectivePermission,\n getSessionRoles,\n intersectPermissions,\n} from '@utils/permissions';\nimport { betterAuth, type OmitId } from 'better-auth';\nimport { mongodbAdapter } from 'better-auth/adapters/mongodb';\nimport { createAuthMiddleware } from 'better-auth/api';\nimport { customSession, lastLoginMethod, twoFactor } from 'better-auth/plugins';\nimport { magicLink } from 'better-auth/plugins/magic-link';\nimport { passkey } from 'better-auth/plugins/passkey';\nimport type { MongoClient } from 'mongodb';\nimport type { OrganizationAPI } from '@/types/organization.types';\nimport type { ProjectAPI } from '@/types/project.types';\nimport type {\n Session,\n SessionContext,\n SessionDataApi,\n} from '@/types/session.types';\nimport type { User, UserAPI } from '@/types/user.types';\n\nexport type Auth = ReturnType<typeof betterAuth>;\n\nexport const formatSession = (session: SessionContext): OmitId<Session> => {\n const roles = getSessionRoles(session);\n let permissions = computeEffectivePermission(roles);\n\n // Intersect in the case a Access Token try to override the permissions\n if (session.permissions) {\n permissions = intersectPermissions(permissions, session.permissions);\n }\n\n const resultSession = {\n session: session.session,\n user: session.user,\n organization: session.organization,\n project: session.project,\n authType: 'session',\n permissions,\n roles,\n } as OmitId<Session>;\n\n return resultSession;\n};\n\nexport const getAuth = (dbClient: MongoClient): Auth => {\n if (!dbClient) {\n throw new Error('MongoDB connection not established');\n }\n\n const auth = betterAuth({\n appName: 'Intlayer',\n\n database: mongodbAdapter(dbClient.db()),\n\n /**\n * User model\n */\n user: {\n modelName: 'users',\n },\n\n databaseHooks: {\n user: {\n create: {\n // Runs once, immediately after the INSERT\n after: async (user) => {\n if (!user?.emailVerified) return;\n\n await sendEmail({\n type: 'welcome',\n to: user.email,\n username: user.name ?? user.email.split('@')[0],\n loginLink: `${process.env.CLIENT_URL}/auth/login`,\n locale: (user as any).lang,\n });\n logger.info('Welcome e‑mail delivered', {\n email: user.email,\n });\n },\n },\n },\n },\n\n hooks: {\n after: createAuthMiddleware(async (ctx) => {\n const { path, context } = ctx;\n\n const newUser = context.newSession?.user;\n const existingUser = context.session?.user;\n const user = newUser ?? existingUser;\n\n if (!user) return;\n\n if (['/verify-email'].includes(path)) {\n sendVerificationUpdate(user as unknown as User);\n logger.info('SSE verification update sent', {\n email: user.email,\n userId: user.id,\n });\n\n await sendEmail({\n type: 'welcome',\n to: user.email,\n username: user.name ?? user.email.split('@')[0],\n loginLink: `${process.env.CLIENT_URL}/auth/login`,\n locale: (user as any).lang,\n });\n logger.info('Welcome e‑mail delivered', {\n email: user.email,\n });\n }\n }),\n },\n\n advanced: {\n // 1️⃣ Change or drop the global prefix\n // cookiePrefix: \"intlayer\", // => intlayer.session_token\n cookiePrefix: 'intlayer', // => session_token (no prefix)\n\n // 2️⃣ Override just the session‑token cookie\n cookies: {\n session_token: {\n // name: 'intlayer_session_token', // final name depends on the prefix above\n // attributes: { sameSite: \"lax\", maxAge: 60 * 60 * 24 } // optional\n },\n },\n\n // 3️⃣ (optional) turn off the automatic __Secure‑ prefix in non‑prod\n // useSecureCookies: false,\n },\n\n secret: process.env.AUTH_SECRET as string,\n session: {\n modelName: 'sessions',\n id: 'id',\n\n additionalFields: {\n activeOrganizationId: { type: 'string', nullable: true, input: false },\n activeProjectId: { type: 'string', nullable: true, input: false },\n },\n },\n\n plugins: [\n customSession(async ({ session }) => {\n const typedSession = session as unknown as SessionDataApi;\n\n let userAPI: UserAPI | null = null;\n let organizationAPI: OrganizationAPI | null = null;\n let projectAPI: ProjectAPI | null = null;\n\n if (typedSession.userId) {\n const userData = await getUserById(typedSession.userId);\n\n if (userData) {\n userAPI = mapUserToAPI(userData);\n }\n }\n\n if (typedSession.activeOrganizationId) {\n const orgData = await getOrganizationById(\n typedSession.activeOrganizationId\n );\n\n if (orgData) {\n organizationAPI = mapOrganizationToAPI(orgData);\n }\n }\n if (typedSession.activeProjectId) {\n const projectData = await getProjectById(\n typedSession.activeProjectId\n );\n\n if (projectData) {\n projectAPI = mapProjectToAPI(projectData);\n }\n }\n\n const sessionWithNoPermission: SessionContext = {\n session: typedSession,\n user: userAPI!,\n organization: organizationAPI ?? null,\n project: projectAPI ?? null,\n authType: 'session',\n };\n\n const formattedSession = formatSession(sessionWithNoPermission);\n\n return mapSessionToAPI(formattedSession);\n }),\n lastLoginMethod({\n storeInDatabase: true, // adds user.lastLoginMethod in DB and session\n schema: {\n user: {\n lastLoginMethod: 'lastLoginMethod', // Custom field name\n },\n },\n customResolveMethod: (context) => {\n // When user clicks the magic link\n if (context.path === '/magic-link/verify') {\n return 'magic-link';\n }\n\n // Fallback to default behavior for everything else\n return null;\n },\n }),\n passkey(),\n twoFactor(),\n magicLink({\n sendMagicLink: async ({ email, url }) => {\n logger.info('sending magic link', { email, url });\n await sendEmail({\n type: 'magicLink',\n to: email,\n username: email.split('@')[0],\n magicLink: url,\n });\n },\n }),\n // sso(),\n ],\n\n emailAndPassword: {\n enabled: true,\n disableSignUp: false,\n requireEmailVerification: true,\n minPasswordLength: 8,\n maxPasswordLength: 128,\n autoSignIn: true,\n sendResetPassword: async ({ user, token }) => {\n logger.info('sending reset password email', { email: user.email });\n await sendEmail({\n type: 'resetPassword',\n to: user.email,\n username: user.name ?? user.email.split('@')[0],\n resetLink: `${process.env.CLIENT_URL}/auth/password/reset?token=${token}`,\n });\n },\n resetPasswordTokenExpiresIn: 3600,\n },\n accountLinking: {\n enabled: true, // allow linking in general\n trustedProviders: ['google', 'github', 'linkedin'], // optional: auto‑link when Google verifies the e‑mail\n },\n emailVerification: {\n autoSignInAfterVerification: true,\n sendOnSignIn: true,\n sendVerificationEmail: async ({ user, url }) => {\n logger.info('sending verification email', { email: user.email });\n await sendEmail({\n type: 'validate',\n to: user.email,\n username: user.name ?? user.email.split('@')[0],\n validationLink: url,\n });\n },\n },\n\n crossSubDomainCookies: {\n enabled: true,\n additionalCookies: ['session_token'],\n domain: process.env.CLIENT_URL as string,\n },\n cookiePrefix: 'intlayer',\n cookies: {\n session_token: {\n name: 'session_token',\n attributes: {\n httpOnly: true,\n secure: true,\n },\n },\n },\n\n trustedOrigins: [process.env.CLIENT_URL as string],\n\n socialProviders: {\n google: {\n clientId: process.env.GOOGLE_CLIENT_ID as string,\n clientSecret: process.env.GOOGLE_CLIENT_SECRET as string,\n },\n github: {\n clientId: process.env.GITHUB_CLIENT_ID as string,\n clientSecret: process.env.GITHUB_CLIENT_SECRET as string,\n },\n linkedin: {\n clientId: process.env.LINKEDIN_CLIENT_ID as string,\n clientSecret: process.env.LINKEDIN_CLIENT_SECRET as string,\n },\n // socialProviders: {\n // apple: {\n // clientId: process.env.APPLE_CLIENT_ID as string,\n // clientSecret: process.env.APPLE_CLIENT_SECRET as string,\n // // Optional\n // appBundleIdentifier: process.env\n // .APPLE_APP_BUNDLE_IDENTIFIER as string,\n // },\n // },\n // // Add appleid.apple.com to trustedOrigins for Sign In with Apple flows\n // trustedOrigins: ['https://appleid.apple.com'],\n },\n\n logger: {\n log: (level, message, ...args) => logger[level](message, ...args),\n },\n });\n\n return auth;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkCA,MAAa,iBAAiB,YAA6C;CACzE,MAAM,QAAQA,0CAAgB,QAAQ;CACtC,IAAI,cAAcC,qDAA2B,MAAM;AAGnD,KAAI,QAAQ,YACV,eAAcC,+CAAqB,aAAa,QAAQ,YAAY;AAatE,QAVsB;EACpB,SAAS,QAAQ;EACjB,MAAM,QAAQ;EACd,cAAc,QAAQ;EACtB,SAAS,QAAQ;EACjB,UAAU;EACV;EACA;EACD;;AAKH,MAAa,WAAW,aAAgC;AACtD,KAAI,CAAC,SACH,OAAM,IAAI,MAAM,qCAAqC;AAqQvD,oCAlQwB;EACtB,SAAS;EAET,2DAAyB,SAAS,IAAI,CAAC;EAKvC,MAAM,EACJ,WAAW,SACZ;EAED,eAAe,EACb,MAAM,EACJ,QAAQ,EAEN,OAAO,OAAO,SAAS;AACrB,OAAI,CAAC,MAAM,cAAe;AAE1B,SAAMC,yCAAU;IACd,MAAM;IACN,IAAI,KAAK;IACT,UAAU,KAAK,QAAQ,KAAK,MAAM,MAAM,IAAI,CAAC;IAC7C,WAAW,GAAG,QAAQ,IAAI,WAAW;IACrC,QAAS,KAAa;IACvB,CAAC;AACF,+BAAO,KAAK,4BAA4B,EACtC,OAAO,KAAK,OACb,CAAC;KAEL,EACF,EACF;EAED,OAAO,EACL,iDAA4B,OAAO,QAAQ;GACzC,MAAM,EAAE,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;GACrB,SAAS;GACT,mBAAmB,CAAC,gBAAgB;GACpC,QAAQ,QAAQ,IAAI;GACrB;EACD,cAAc;EACd,SAAS,EACP,eAAe;GACb,MAAM;GACN,YAAY;IACV,UAAU;IACV,QAAQ;IACT;GACF,EACF;EAED,gBAAgB,CAAC,QAAQ,IAAI,WAAqB;EAElD,iBAAiB;GACf,QAAQ;IACN,UAAU,QAAQ,IAAI;IACtB,cAAc,QAAQ,IAAI;IAC3B;GACD,QAAQ;IACN,UAAU,QAAQ,IAAI;IACtB,cAAc,QAAQ,IAAI;IAC3B;GACD,UAAU;IACR,UAAU,QAAQ,IAAI;IACtB,cAAc,QAAQ,IAAI;IAC3B;GAYF;EAED,QAAQ,EACN,MAAM,OAAO,SAAS,GAAG,SAASW,4BAAO,OAAO,SAAS,GAAG,KAAK,EAClE;EACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"connectDB.cjs","names":["ProjectModel","UserModel","OAuth2AccessTokenModel","TagModel","DictionaryModel","OrganizationModel"],"sources":["../../../../src/utils/mongoDB/connectDB.ts"],"sourcesContent":["import { logger } from '@logger';\nimport { DictionaryModel } from '@models/dictionary.model';\nimport { OAuth2AccessTokenModel } from '@models/oAuth2.model';\nimport { OrganizationModel } from '@models/organization.model';\nimport { ProjectModel } from '@models/project.model';\nimport { TagModel } from '@models/tag.model';\nimport { UserModel } from '@models/user.model';\nimport { connect } from 'mongoose';\n\nexport const connectDB = async () => {\n try {\n const client = await connect(\n `mongodb+srv://${process.env.DB_ID}:${process.env.DB_MDP}@${process.env.DB_CLUSTER}/?retryWrites=true&w=majority&appName=Cluster0`\n );\n\n logger.info('MongoDB connected');\n\n // Recreate indexes for models\n await ProjectModel.syncIndexes();\n await UserModel.createIndexes();\n await OAuth2AccessTokenModel.createIndexes();\n await TagModel.createIndexes();\n await DictionaryModel.createIndexes();\n await OrganizationModel.createIndexes();\n\n // Return the underlying MongoDB client for better-auth\n return client.connection.getClient();\n } catch (error) {\n const errorMessage = `MongoDB connection error - ${(error as Error).message}`;\n\n logger.error(errorMessage);\n throw new Error(errorMessage);\n }\n};\n"],"mappings":";;;;;;;;;;;AASA,MAAa,YAAY,YAAY;AACnC,KAAI;EACF,MAAM,SAAS,4BACb,iBAAiB,QAAQ,IAAI,MAAM,GAAG,QAAQ,IAAI,OAAO,GAAG,QAAQ,IAAI,WAAW,gDACpF;AAED,8BAAO,KAAK,oBAAoB;AAGhC,QAAMA,0CAAa,aAAa;AAChC,QAAMC,oCAAU,eAAe;AAC/B,QAAMC,mDAAuB,eAAe;AAC5C,QAAMC,kCAAS,eAAe;AAC9B,QAAMC,gDAAgB,eAAe;AACrC,QAAMC,oDAAkB,eAAe;AAGvC,SAAO,OAAO,WAAW,WAAW;UAC7B,OAAO;EACd,MAAM,eAAe,8BAA+B,MAAgB;AAEpE,8BAAO,MAAM,aAAa;AAC1B,QAAM,IAAI,MAAM,aAAa"}
1
+ {"version":3,"file":"connectDB.cjs","names":["ProjectModel","UserModel","OAuth2AccessTokenModel","TagModel","DictionaryModel","OrganizationModel"],"sources":["../../../../src/utils/mongoDB/connectDB.ts"],"sourcesContent":["import { logger } from '@logger';\nimport { DictionaryModel } from '@models/dictionary.model';\nimport { OAuth2AccessTokenModel } from '@models/oAuth2.model';\nimport { OrganizationModel } from '@models/organization.model';\nimport { ProjectModel } from '@models/project.model';\nimport { TagModel } from '@models/tag.model';\nimport { UserModel } from '@models/user.model';\nimport type { MongoClient } from 'mongodb';\nimport { connect } from 'mongoose';\n\nexport const connectDB = async (): Promise<MongoClient> => {\n try {\n const client = await connect(\n `mongodb+srv://${process.env.DB_ID}:${process.env.DB_MDP}@${process.env.DB_CLUSTER}/?retryWrites=true&w=majority&appName=Cluster0`\n );\n\n logger.info('MongoDB connected');\n\n // Recreate indexes for models\n await ProjectModel.syncIndexes();\n await UserModel.createIndexes();\n await OAuth2AccessTokenModel.createIndexes();\n await TagModel.createIndexes();\n await DictionaryModel.createIndexes();\n await OrganizationModel.createIndexes();\n\n // Return the underlying MongoDB client for better-auth\n return client.connection.getClient();\n } catch (error) {\n const errorMessage = `MongoDB connection error - ${(error as Error).message}`;\n\n logger.error(errorMessage);\n throw new Error(errorMessage);\n }\n};\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,YAAY,YAAkC;AACzD,KAAI;EACF,MAAM,SAAS,4BACb,iBAAiB,QAAQ,IAAI,MAAM,GAAG,QAAQ,IAAI,OAAO,GAAG,QAAQ,IAAI,WAAW,gDACpF;AAED,8BAAO,KAAK,oBAAoB;AAGhC,QAAMA,0CAAa,aAAa;AAChC,QAAMC,oCAAU,eAAe;AAC/B,QAAMC,mDAAuB,eAAe;AAC5C,QAAMC,kCAAS,eAAe;AAC9B,QAAMC,gDAAgB,eAAe;AACrC,QAAMC,oDAAkB,eAAe;AAGvC,SAAO,OAAO,WAAW,WAAW;UAC7B,OAAO;EACd,MAAM,eAAe,8BAA+B,MAAgB;AAEpE,8BAAO,MAAM,aAAa;AAC1B,QAAM,IAAI,MAAM,aAAa"}
@@ -0,0 +1,43 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __esm = (fn, res) => function() {
9
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
+ };
11
+ var __commonJS = (cb, mod) => function() {
12
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
+ };
14
+ var __export = (all) => {
15
+ let target = {};
16
+ for (var name in all) __defProp(target, name, {
17
+ get: all[name],
18
+ enumerable: true
19
+ });
20
+ return target;
21
+ };
22
+ var __copyProps = (to, from, except, desc) => {
23
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
24
+ key = keys[i];
25
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
26
+ get: ((k) => from[k]).bind(null, key),
27
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
28
+ });
29
+ }
30
+ return to;
31
+ };
32
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
33
+ value: mod,
34
+ enumerable: true
35
+ }) : target, mod));
36
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
38
+ if (typeof require !== "undefined") return require.apply(this, arguments);
39
+ throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function.");
40
+ });
41
+
42
+ //#endregion
43
+ export { __commonJS, __esm, __export, __require, __toCommonJS, __toESM };