@starklabs/forge 1.0.1

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 (485) hide show
  1. package/dist/js/admin/index.d.ts +4 -0
  2. package/dist/js/admin/index.d.ts.map +1 -0
  3. package/dist/js/admin/index.js +5 -0
  4. package/dist/js/admin/index.js.map +1 -0
  5. package/dist/js/app.d.ts +3 -0
  6. package/dist/js/app.d.ts.map +1 -0
  7. package/dist/js/app.js +55 -0
  8. package/dist/js/app.js.map +1 -0
  9. package/dist/js/auth/bunch.auth.d.ts +8 -0
  10. package/dist/js/auth/bunch.auth.d.ts.map +1 -0
  11. package/dist/js/auth/bunch.auth.js +8 -0
  12. package/dist/js/auth/bunch.auth.js.map +1 -0
  13. package/dist/js/auth/createOTPModel.d.ts +2 -0
  14. package/dist/js/auth/createOTPModel.d.ts.map +1 -0
  15. package/dist/js/auth/createOTPModel.js +2 -0
  16. package/dist/js/auth/createOTPModel.js.map +1 -0
  17. package/dist/js/auth/forgotPassword.d.ts +10 -0
  18. package/dist/js/auth/forgotPassword.d.ts.map +1 -0
  19. package/dist/js/auth/forgotPassword.js +39 -0
  20. package/dist/js/auth/forgotPassword.js.map +1 -0
  21. package/dist/js/auth/index.d.ts +5 -0
  22. package/dist/js/auth/index.d.ts.map +1 -0
  23. package/dist/js/auth/index.js +26 -0
  24. package/dist/js/auth/index.js.map +1 -0
  25. package/dist/js/auth/login.d.ts +10 -0
  26. package/dist/js/auth/login.d.ts.map +1 -0
  27. package/dist/js/auth/login.js +32 -0
  28. package/dist/js/auth/login.js.map +1 -0
  29. package/dist/js/auth/logout.d.ts +5 -0
  30. package/dist/js/auth/logout.d.ts.map +1 -0
  31. package/dist/js/auth/logout.js +10 -0
  32. package/dist/js/auth/logout.js.map +1 -0
  33. package/dist/js/auth/resendOTP.d.ts +10 -0
  34. package/dist/js/auth/resendOTP.d.ts.map +1 -0
  35. package/dist/js/auth/resendOTP.js +62 -0
  36. package/dist/js/auth/resendOTP.js.map +1 -0
  37. package/dist/js/auth/resetPassword.d.ts +10 -0
  38. package/dist/js/auth/resetPassword.d.ts.map +1 -0
  39. package/dist/js/auth/resetPassword.js +60 -0
  40. package/dist/js/auth/resetPassword.js.map +1 -0
  41. package/dist/js/auth/sendOTP.d.ts +6 -0
  42. package/dist/js/auth/sendOTP.d.ts.map +1 -0
  43. package/dist/js/auth/sendOTP.js +28 -0
  44. package/dist/js/auth/sendOTP.js.map +1 -0
  45. package/dist/js/auth/signup.d.ts +10 -0
  46. package/dist/js/auth/signup.d.ts.map +1 -0
  47. package/dist/js/auth/signup.js +47 -0
  48. package/dist/js/auth/signup.js.map +1 -0
  49. package/dist/js/auth/twoFactorAuth.d.ts +2 -0
  50. package/dist/js/auth/twoFactorAuth.d.ts.map +1 -0
  51. package/dist/js/auth/twoFactorAuth.js +3 -0
  52. package/dist/js/auth/twoFactorAuth.js.map +1 -0
  53. package/dist/js/auth/utils/authenticateUser.d.ts +11 -0
  54. package/dist/js/auth/utils/authenticateUser.d.ts.map +1 -0
  55. package/dist/js/auth/utils/authenticateUser.js +60 -0
  56. package/dist/js/auth/utils/authenticateUser.js.map +1 -0
  57. package/dist/js/auth/utils/createOTPModel.d.ts +4 -0
  58. package/dist/js/auth/utils/createOTPModel.d.ts.map +1 -0
  59. package/dist/js/auth/utils/createOTPModel.js +28 -0
  60. package/dist/js/auth/utils/createOTPModel.js.map +1 -0
  61. package/dist/js/auth/utils/createOTPUser.d.ts +12 -0
  62. package/dist/js/auth/utils/createOTPUser.d.ts.map +1 -0
  63. package/dist/js/auth/utils/createOTPUser.js +63 -0
  64. package/dist/js/auth/utils/createOTPUser.js.map +1 -0
  65. package/dist/js/auth/utils/createUser.d.ts +11 -0
  66. package/dist/js/auth/utils/createUser.d.ts.map +1 -0
  67. package/dist/js/auth/utils/createUser.js +42 -0
  68. package/dist/js/auth/utils/createUser.js.map +1 -0
  69. package/dist/js/auth/utils/deleteOTPUser.d.ts +3 -0
  70. package/dist/js/auth/utils/deleteOTPUser.d.ts.map +1 -0
  71. package/dist/js/auth/utils/deleteOTPUser.js +3 -0
  72. package/dist/js/auth/utils/deleteOTPUser.js.map +1 -0
  73. package/dist/js/auth/utils/findUser.d.ts +2 -0
  74. package/dist/js/auth/utils/findUser.d.ts.map +1 -0
  75. package/dist/js/auth/utils/findUser.js +2 -0
  76. package/dist/js/auth/utils/findUser.js.map +1 -0
  77. package/dist/js/auth/utils/getModel.d.ts +6 -0
  78. package/dist/js/auth/utils/getModel.d.ts.map +1 -0
  79. package/dist/js/auth/utils/getModel.js +18 -0
  80. package/dist/js/auth/utils/getModel.js.map +1 -0
  81. package/dist/js/auth/utils/getOTPData.d.ts +9 -0
  82. package/dist/js/auth/utils/getOTPData.d.ts.map +1 -0
  83. package/dist/js/auth/utils/getOTPData.js +26 -0
  84. package/dist/js/auth/utils/getOTPData.js.map +1 -0
  85. package/dist/js/auth/utils/getOTPModel.d.ts +4 -0
  86. package/dist/js/auth/utils/getOTPModel.d.ts.map +1 -0
  87. package/dist/js/auth/utils/getOTPModel.js +20 -0
  88. package/dist/js/auth/utils/getOTPModel.js.map +1 -0
  89. package/dist/js/auth/utils/getOTPUser.d.ts +8 -0
  90. package/dist/js/auth/utils/getOTPUser.d.ts.map +1 -0
  91. package/dist/js/auth/utils/getOTPUser.js +21 -0
  92. package/dist/js/auth/utils/getOTPUser.js.map +1 -0
  93. package/dist/js/auth/utils/getUser.d.ts +10 -0
  94. package/dist/js/auth/utils/getUser.d.ts.map +1 -0
  95. package/dist/js/auth/utils/getUser.js +27 -0
  96. package/dist/js/auth/utils/getUser.js.map +1 -0
  97. package/dist/js/auth/utils/handleIsVerfieid.d.ts +9 -0
  98. package/dist/js/auth/utils/handleIsVerfieid.d.ts.map +1 -0
  99. package/dist/js/auth/utils/handleIsVerfieid.js +20 -0
  100. package/dist/js/auth/utils/handleIsVerfieid.js.map +1 -0
  101. package/dist/js/auth/utils/handleIsVerified.d.ts +11 -0
  102. package/dist/js/auth/utils/handleIsVerified.d.ts.map +1 -0
  103. package/dist/js/auth/utils/handleIsVerified.js +31 -0
  104. package/dist/js/auth/utils/handleIsVerified.js.map +1 -0
  105. package/dist/js/auth/utils/modeMap.d.ts +38 -0
  106. package/dist/js/auth/utils/modeMap.d.ts.map +1 -0
  107. package/dist/js/auth/utils/modeMap.js +15 -0
  108. package/dist/js/auth/utils/modeMap.js.map +1 -0
  109. package/dist/js/auth/utils/otpHTML.d.ts +2 -0
  110. package/dist/js/auth/utils/otpHTML.d.ts.map +1 -0
  111. package/dist/js/auth/utils/otpHTML.js +2 -0
  112. package/dist/js/auth/utils/otpHTML.js.map +1 -0
  113. package/dist/js/auth/utils/otpVerifiedResponse.d.ts +9 -0
  114. package/dist/js/auth/utils/otpVerifiedResponse.d.ts.map +1 -0
  115. package/dist/js/auth/utils/otpVerifiedResponse.js +22 -0
  116. package/dist/js/auth/utils/otpVerifiedResponse.js.map +1 -0
  117. package/dist/js/auth/utils/sendCookie.d.ts +14 -0
  118. package/dist/js/auth/utils/sendCookie.d.ts.map +1 -0
  119. package/dist/js/auth/utils/sendCookie.js +73 -0
  120. package/dist/js/auth/utils/sendCookie.js.map +1 -0
  121. package/dist/js/auth/utils/sendOTP.d.ts +7 -0
  122. package/dist/js/auth/utils/sendOTP.d.ts.map +1 -0
  123. package/dist/js/auth/utils/sendOTP.js +48 -0
  124. package/dist/js/auth/utils/sendOTP.js.map +1 -0
  125. package/dist/js/auth/utils/verifyCredentials.d.ts +9 -0
  126. package/dist/js/auth/utils/verifyCredentials.d.ts.map +1 -0
  127. package/dist/js/auth/utils/verifyCredentials.js +39 -0
  128. package/dist/js/auth/utils/verifyCredentials.js.map +1 -0
  129. package/dist/js/auth/verifyOTP.d.ts +10 -0
  130. package/dist/js/auth/verifyOTP.d.ts.map +1 -0
  131. package/dist/js/auth/verifyOTP.js +110 -0
  132. package/dist/js/auth/verifyOTP.js.map +1 -0
  133. package/dist/js/config/cloudinary.d.ts +5 -0
  134. package/dist/js/config/cloudinary.d.ts.map +1 -0
  135. package/dist/js/config/cloudinary.js +25 -0
  136. package/dist/js/config/cloudinary.js.map +1 -0
  137. package/dist/js/config/defaultConfig.d.ts +3 -0
  138. package/dist/js/config/defaultConfig.d.ts.map +1 -0
  139. package/dist/js/config/defaultConfig.js +12 -0
  140. package/dist/js/config/defaultConfig.js.map +1 -0
  141. package/dist/js/config/duration.d.ts +22 -0
  142. package/dist/js/config/duration.d.ts.map +1 -0
  143. package/dist/js/config/duration.js +35 -0
  144. package/dist/js/config/duration.js.map +1 -0
  145. package/dist/js/config/envs.d.ts +32 -0
  146. package/dist/js/config/envs.d.ts.map +1 -0
  147. package/dist/js/config/envs.js +10 -0
  148. package/dist/js/config/envs.js.map +1 -0
  149. package/dist/js/config/handleReqType.d.ts +7 -0
  150. package/dist/js/config/handleReqType.d.ts.map +1 -0
  151. package/dist/js/config/handleReqType.js +13 -0
  152. package/dist/js/config/handleReqType.js.map +1 -0
  153. package/dist/js/config/handlerMap.d.ts +3 -0
  154. package/dist/js/config/handlerMap.d.ts.map +1 -0
  155. package/dist/js/config/handlerMap.js +29 -0
  156. package/dist/js/config/handlerMap.js.map +1 -0
  157. package/dist/js/config/reqTypes.d.ts +2 -0
  158. package/dist/js/config/reqTypes.d.ts.map +1 -0
  159. package/dist/js/config/reqTypes.js +2 -0
  160. package/dist/js/config/reqTypes.js.map +1 -0
  161. package/dist/js/config/sendEmail.d.ts +11 -0
  162. package/dist/js/config/sendEmail.d.ts.map +1 -0
  163. package/dist/js/config/sendEmail.js +95 -0
  164. package/dist/js/config/sendEmail.js.map +1 -0
  165. package/dist/js/core/app.d.ts +3 -0
  166. package/dist/js/core/app.d.ts.map +1 -0
  167. package/dist/js/core/app.js +19 -0
  168. package/dist/js/core/app.js.map +1 -0
  169. package/dist/js/crud/bunch.crud.d.ts +11 -0
  170. package/dist/js/crud/bunch.crud.d.ts.map +1 -0
  171. package/dist/js/crud/bunch.crud.js +11 -0
  172. package/dist/js/crud/bunch.crud.js.map +1 -0
  173. package/dist/js/crud/create.d.ts +10 -0
  174. package/dist/js/crud/create.d.ts.map +1 -0
  175. package/dist/js/crud/create.js +72 -0
  176. package/dist/js/crud/create.js.map +1 -0
  177. package/dist/js/crud/createBulk.d.ts +10 -0
  178. package/dist/js/crud/createBulk.d.ts.map +1 -0
  179. package/dist/js/crud/createBulk.js +20 -0
  180. package/dist/js/crud/createBulk.js.map +1 -0
  181. package/dist/js/crud/files/file.update.d.ts +10 -0
  182. package/dist/js/crud/files/file.update.d.ts.map +1 -0
  183. package/dist/js/crud/files/file.update.js +28 -0
  184. package/dist/js/crud/files/file.update.js.map +1 -0
  185. package/dist/js/crud/handleUploads/file.add.d.ts +10 -0
  186. package/dist/js/crud/handleUploads/file.add.d.ts.map +1 -0
  187. package/dist/js/crud/handleUploads/file.add.js +61 -0
  188. package/dist/js/crud/handleUploads/file.add.js.map +1 -0
  189. package/dist/js/crud/handleUploads/file.create.d.ts +10 -0
  190. package/dist/js/crud/handleUploads/file.create.d.ts.map +1 -0
  191. package/dist/js/crud/handleUploads/file.create.js +33 -0
  192. package/dist/js/crud/handleUploads/file.create.js.map +1 -0
  193. package/dist/js/crud/handleUploads/file.delete.d.ts +10 -0
  194. package/dist/js/crud/handleUploads/file.delete.d.ts.map +1 -0
  195. package/dist/js/crud/handleUploads/file.delete.js +35 -0
  196. package/dist/js/crud/handleUploads/file.delete.js.map +1 -0
  197. package/dist/js/crud/handleUploads/file.update.d.ts +10 -0
  198. package/dist/js/crud/handleUploads/file.update.d.ts.map +1 -0
  199. package/dist/js/crud/handleUploads/file.update.js +30 -0
  200. package/dist/js/crud/handleUploads/file.update.js.map +1 -0
  201. package/dist/js/crud/index.d.ts +5 -0
  202. package/dist/js/crud/index.d.ts.map +1 -0
  203. package/dist/js/crud/index.js +36 -0
  204. package/dist/js/crud/index.js.map +1 -0
  205. package/dist/js/crud/read.d.ts +10 -0
  206. package/dist/js/crud/read.d.ts.map +1 -0
  207. package/dist/js/crud/read.js +27 -0
  208. package/dist/js/crud/read.js.map +1 -0
  209. package/dist/js/crud/readAll.d.ts +10 -0
  210. package/dist/js/crud/readAll.d.ts.map +1 -0
  211. package/dist/js/crud/readAll.js +24 -0
  212. package/dist/js/crud/readAll.js.map +1 -0
  213. package/dist/js/crud/remove.d.ts +10 -0
  214. package/dist/js/crud/remove.d.ts.map +1 -0
  215. package/dist/js/crud/remove.js +28 -0
  216. package/dist/js/crud/remove.js.map +1 -0
  217. package/dist/js/crud/removeAll.d.ts +10 -0
  218. package/dist/js/crud/removeAll.d.ts.map +1 -0
  219. package/dist/js/crud/removeAll.js +37 -0
  220. package/dist/js/crud/removeAll.js.map +1 -0
  221. package/dist/js/crud/update.d.ts +10 -0
  222. package/dist/js/crud/update.d.ts.map +1 -0
  223. package/dist/js/crud/update.js +33 -0
  224. package/dist/js/crud/update.js.map +1 -0
  225. package/dist/js/crud/utils/authroizeAccess.d.ts +10 -0
  226. package/dist/js/crud/utils/authroizeAccess.d.ts.map +1 -0
  227. package/dist/js/crud/utils/authroizeAccess.js +48 -0
  228. package/dist/js/crud/utils/authroizeAccess.js.map +1 -0
  229. package/dist/js/crud/utils/getItem.d.ts +11 -0
  230. package/dist/js/crud/utils/getItem.d.ts.map +1 -0
  231. package/dist/js/crud/utils/getItem.js +68 -0
  232. package/dist/js/crud/utils/getItem.js.map +1 -0
  233. package/dist/js/crud/utils/getParam.d.ts +8 -0
  234. package/dist/js/crud/utils/getParam.d.ts.map +1 -0
  235. package/dist/js/crud/utils/getParam.js +19 -0
  236. package/dist/js/crud/utils/getParam.js.map +1 -0
  237. package/dist/js/crud/utils/validateOwner.d.ts +7 -0
  238. package/dist/js/crud/utils/validateOwner.d.ts.map +1 -0
  239. package/dist/js/crud/utils/validateOwner.js +5 -0
  240. package/dist/js/crud/utils/validateOwner.js.map +1 -0
  241. package/dist/js/health/bunch.health.d.ts +6 -0
  242. package/dist/js/health/bunch.health.d.ts.map +1 -0
  243. package/dist/js/health/bunch.health.js +6 -0
  244. package/dist/js/health/bunch.health.js.map +1 -0
  245. package/dist/js/health/delete.health.d.ts +4 -0
  246. package/dist/js/health/delete.health.d.ts.map +1 -0
  247. package/dist/js/health/delete.health.js +5 -0
  248. package/dist/js/health/delete.health.js.map +1 -0
  249. package/dist/js/health/get.health.d.ts +4 -0
  250. package/dist/js/health/get.health.d.ts.map +1 -0
  251. package/dist/js/health/get.health.js +5 -0
  252. package/dist/js/health/get.health.js.map +1 -0
  253. package/dist/js/health/health.collection.d.ts +4 -0
  254. package/dist/js/health/health.collection.d.ts.map +1 -0
  255. package/dist/js/health/health.collection.js +39 -0
  256. package/dist/js/health/health.collection.js.map +1 -0
  257. package/dist/js/health/health.controller.d.ts +4 -0
  258. package/dist/js/health/health.controller.d.ts.map +1 -0
  259. package/dist/js/health/health.controller.js +5 -0
  260. package/dist/js/health/health.controller.js.map +1 -0
  261. package/dist/js/health/index.d.ts +5 -0
  262. package/dist/js/health/index.d.ts.map +1 -0
  263. package/dist/js/health/index.js +10 -0
  264. package/dist/js/health/index.js.map +1 -0
  265. package/dist/js/health/patch.health.d.ts +4 -0
  266. package/dist/js/health/patch.health.d.ts.map +1 -0
  267. package/dist/js/health/patch.health.js +5 -0
  268. package/dist/js/health/patch.health.js.map +1 -0
  269. package/dist/js/health/post.health.d.ts +4 -0
  270. package/dist/js/health/post.health.d.ts.map +1 -0
  271. package/dist/js/health/post.health.js +5 -0
  272. package/dist/js/health/post.health.js.map +1 -0
  273. package/dist/js/health/put.health.d.ts +4 -0
  274. package/dist/js/health/put.health.d.ts.map +1 -0
  275. package/dist/js/health/put.health.js +5 -0
  276. package/dist/js/health/put.health.js.map +1 -0
  277. package/dist/js/index.d.ts +13 -0
  278. package/dist/js/index.d.ts.map +1 -0
  279. package/dist/js/index.js +21 -0
  280. package/dist/js/index.js.map +1 -0
  281. package/dist/js/lib/Mongoose.d.ts +53 -0
  282. package/dist/js/lib/Mongoose.d.ts.map +1 -0
  283. package/dist/js/lib/Mongoose.js +2 -0
  284. package/dist/js/lib/Mongoose.js.map +1 -0
  285. package/dist/js/lib/OA.d.ts +2 -0
  286. package/dist/js/lib/OA.d.ts.map +1 -0
  287. package/dist/js/lib/OA.js +2 -0
  288. package/dist/js/lib/OA.js.map +1 -0
  289. package/dist/js/lib/OAuthProviders.d.ts +3 -0
  290. package/dist/js/lib/OAuthProviders.d.ts.map +1 -0
  291. package/dist/js/lib/OAuthProviders.js +18 -0
  292. package/dist/js/lib/OAuthProviders.js.map +1 -0
  293. package/dist/js/lib/PROVIDERS.d.ts +2 -0
  294. package/dist/js/lib/PROVIDERS.d.ts.map +1 -0
  295. package/dist/js/lib/PROVIDERS.js +2 -0
  296. package/dist/js/lib/PROVIDERS.js.map +1 -0
  297. package/dist/js/lib/db.d.ts +8 -0
  298. package/dist/js/lib/db.d.ts.map +1 -0
  299. package/dist/js/lib/db.js +28 -0
  300. package/dist/js/lib/db.js.map +1 -0
  301. package/dist/js/lib/handler.d.ts +9 -0
  302. package/dist/js/lib/handler.d.ts.map +1 -0
  303. package/dist/js/lib/handler.js +11 -0
  304. package/dist/js/lib/handler.js.map +1 -0
  305. package/dist/js/lib/handlerMap.d.ts +3 -0
  306. package/dist/js/lib/handlerMap.d.ts.map +1 -0
  307. package/dist/js/lib/handlerMap.js +18 -0
  308. package/dist/js/lib/handlerMap.js.map +1 -0
  309. package/dist/js/lib/model.factory.d.ts +8 -0
  310. package/dist/js/lib/model.factory.d.ts.map +1 -0
  311. package/dist/js/lib/model.factory.js +49 -0
  312. package/dist/js/lib/model.factory.js.map +1 -0
  313. package/dist/js/lib/model.registry.d.ts +4 -0
  314. package/dist/js/lib/model.registry.d.ts.map +1 -0
  315. package/dist/js/lib/model.registry.js +4 -0
  316. package/dist/js/lib/model.registry.js.map +1 -0
  317. package/dist/js/lib/mongoose.fields.d.ts +40 -0
  318. package/dist/js/lib/mongoose.fields.d.ts.map +1 -0
  319. package/dist/js/lib/mongoose.fields.js +187 -0
  320. package/dist/js/lib/mongoose.fields.js.map +1 -0
  321. package/dist/js/lib/roles.d.ts +3 -0
  322. package/dist/js/lib/roles.d.ts.map +1 -0
  323. package/dist/js/lib/roles.js +13 -0
  324. package/dist/js/lib/roles.js.map +1 -0
  325. package/dist/js/lib/schema.builder.d.ts +6 -0
  326. package/dist/js/lib/schema.builder.d.ts.map +1 -0
  327. package/dist/js/lib/schema.builder.js +28 -0
  328. package/dist/js/lib/schema.builder.js.map +1 -0
  329. package/dist/js/lib/zod.fields.d.ts +119 -0
  330. package/dist/js/lib/zod.fields.d.ts.map +1 -0
  331. package/dist/js/lib/zod.fields.js +133 -0
  332. package/dist/js/lib/zod.fields.js.map +1 -0
  333. package/dist/js/middleware/auth.middleware.d.ts +5 -0
  334. package/dist/js/middleware/auth.middleware.d.ts.map +1 -0
  335. package/dist/js/middleware/auth.middleware.js +86 -0
  336. package/dist/js/middleware/auth.middleware.js.map +1 -0
  337. package/dist/js/middleware/error.middleware.d.ts +5 -0
  338. package/dist/js/middleware/error.middleware.d.ts.map +1 -0
  339. package/dist/js/middleware/error.middleware.js +25 -0
  340. package/dist/js/middleware/error.middleware.js.map +1 -0
  341. package/dist/js/middleware/multer.middleware.d.ts +5 -0
  342. package/dist/js/middleware/multer.middleware.d.ts.map +1 -0
  343. package/dist/js/middleware/multer.middleware.js +97 -0
  344. package/dist/js/middleware/multer.middleware.js.map +1 -0
  345. package/dist/js/middleware/rateLimit.middleware.d.ts +2 -0
  346. package/dist/js/middleware/rateLimit.middleware.d.ts.map +1 -0
  347. package/dist/js/middleware/rateLimit.middleware.js +19 -0
  348. package/dist/js/middleware/rateLimit.middleware.js.map +1 -0
  349. package/dist/js/realtime/index.d.ts +4 -0
  350. package/dist/js/realtime/index.d.ts.map +1 -0
  351. package/dist/js/realtime/index.js +5 -0
  352. package/dist/js/realtime/index.js.map +1 -0
  353. package/dist/js/types/Collection.d.ts +41 -0
  354. package/dist/js/types/Collection.d.ts.map +1 -0
  355. package/dist/js/types/Collection.js +2 -0
  356. package/dist/js/types/Collection.js.map +1 -0
  357. package/dist/js/types/Constructor.d.ts +30 -0
  358. package/dist/js/types/Constructor.d.ts.map +1 -0
  359. package/dist/js/types/Constructor.js +2 -0
  360. package/dist/js/types/Constructor.js.map +1 -0
  361. package/dist/js/types/MongooseOTPSchemaObj.d.ts +10 -0
  362. package/dist/js/types/MongooseOTPSchemaObj.d.ts.map +1 -0
  363. package/dist/js/types/MongooseOTPSchemaObj.js +2 -0
  364. package/dist/js/types/MongooseOTPSchemaObj.js.map +1 -0
  365. package/dist/js/types/Routepath.d.ts +2 -0
  366. package/dist/js/types/Routepath.d.ts.map +1 -0
  367. package/dist/js/types/Routepath.js +2 -0
  368. package/dist/js/types/Routepath.js.map +1 -0
  369. package/dist/js/types/StoreFile.d.ts +10 -0
  370. package/dist/js/types/StoreFile.d.ts.map +1 -0
  371. package/dist/js/types/StoreFile.js +2 -0
  372. package/dist/js/types/StoreFile.js.map +1 -0
  373. package/dist/js/types/ValidationsObj.d.ts +7 -0
  374. package/dist/js/types/ValidationsObj.d.ts.map +1 -0
  375. package/dist/js/types/ValidationsObj.js +2 -0
  376. package/dist/js/types/ValidationsObj.js.map +1 -0
  377. package/dist/js/types/authHandlers.d.ts +2 -0
  378. package/dist/js/types/authHandlers.d.ts.map +1 -0
  379. package/dist/js/types/authHandlers.js +2 -0
  380. package/dist/js/types/authHandlers.js.map +1 -0
  381. package/dist/js/types/crudHandlers.d.ts +2 -0
  382. package/dist/js/types/crudHandlers.d.ts.map +1 -0
  383. package/dist/js/types/crudHandlers.js +2 -0
  384. package/dist/js/types/crudHandlers.js.map +1 -0
  385. package/dist/js/types/email.d.ts +12 -0
  386. package/dist/js/types/email.d.ts.map +1 -0
  387. package/dist/js/types/email.js +2 -0
  388. package/dist/js/types/email.js.map +1 -0
  389. package/dist/js/types/healthHandlers.d.ts +2 -0
  390. package/dist/js/types/healthHandlers.d.ts.map +1 -0
  391. package/dist/js/types/healthHandlers.js +2 -0
  392. package/dist/js/types/healthHandlers.js.map +1 -0
  393. package/dist/js/types/upload.d.ts +9 -0
  394. package/dist/js/types/upload.d.ts.map +1 -0
  395. package/dist/js/types/upload.js +2 -0
  396. package/dist/js/types/upload.js.map +1 -0
  397. package/dist/js/types/uploadFile.d.ts +10 -0
  398. package/dist/js/types/uploadFile.d.ts.map +1 -0
  399. package/dist/js/types/uploadFile.js +2 -0
  400. package/dist/js/types/uploadFile.js.map +1 -0
  401. package/dist/js/types/uploadHandlers.d.ts +2 -0
  402. package/dist/js/types/uploadHandlers.d.ts.map +1 -0
  403. package/dist/js/types/uploadHandlers.js +2 -0
  404. package/dist/js/types/uploadHandlers.js.map +1 -0
  405. package/dist/js/upload/create.d.ts +8 -0
  406. package/dist/js/upload/create.d.ts.map +1 -0
  407. package/dist/js/upload/create.js +71 -0
  408. package/dist/js/upload/create.js.map +1 -0
  409. package/dist/js/upload/delete.d.ts +8 -0
  410. package/dist/js/upload/delete.d.ts.map +1 -0
  411. package/dist/js/upload/delete.js +107 -0
  412. package/dist/js/upload/delete.js.map +1 -0
  413. package/dist/js/upload/index.d.ts +3 -0
  414. package/dist/js/upload/index.d.ts.map +1 -0
  415. package/dist/js/upload/index.js +3 -0
  416. package/dist/js/upload/index.js.map +1 -0
  417. package/dist/js/upload/providers/cloudinary.provider.d.ts +2 -0
  418. package/dist/js/upload/providers/cloudinary.provider.d.ts.map +1 -0
  419. package/dist/js/upload/providers/cloudinary.provider.js +2 -0
  420. package/dist/js/upload/providers/cloudinary.provider.js.map +1 -0
  421. package/dist/js/upload/update.d.ts +10 -0
  422. package/dist/js/upload/update.d.ts.map +1 -0
  423. package/dist/js/upload/update.js +144 -0
  424. package/dist/js/upload/update.js.map +1 -0
  425. package/dist/js/utils/AppError.d.ts +26 -0
  426. package/dist/js/utils/AppError.d.ts.map +1 -0
  427. package/dist/js/utils/AppError.js +18 -0
  428. package/dist/js/utils/AppError.js.map +1 -0
  429. package/dist/js/utils/AppLog.d.ts +10 -0
  430. package/dist/js/utils/AppLog.d.ts.map +1 -0
  431. package/dist/js/utils/AppLog.js +12 -0
  432. package/dist/js/utils/AppLog.js.map +1 -0
  433. package/dist/js/utils/Applog.d.ts +2 -0
  434. package/dist/js/utils/Applog.d.ts.map +1 -0
  435. package/dist/js/utils/Applog.js +2 -0
  436. package/dist/js/utils/Applog.js.map +1 -0
  437. package/dist/js/utils/AsyncHandler.d.ts +4 -0
  438. package/dist/js/utils/AsyncHandler.d.ts.map +1 -0
  439. package/dist/js/utils/AsyncHandler.js +5 -0
  440. package/dist/js/utils/AsyncHandler.js.map +1 -0
  441. package/dist/js/utils/extractParamsNames.d.ts +2 -0
  442. package/dist/js/utils/extractParamsNames.d.ts.map +1 -0
  443. package/dist/js/utils/extractParamsNames.js +13 -0
  444. package/dist/js/utils/extractParamsNames.js.map +1 -0
  445. package/dist/js/utils/getErrorDetail.d.ts +8 -0
  446. package/dist/js/utils/getErrorDetail.d.ts.map +1 -0
  447. package/dist/js/utils/getErrorDetail.js +9 -0
  448. package/dist/js/utils/getErrorDetail.js.map +1 -0
  449. package/dist/js/utils/getModel.d.ts +8 -0
  450. package/dist/js/utils/getModel.d.ts.map +1 -0
  451. package/dist/js/utils/getModel.js +27 -0
  452. package/dist/js/utils/getModel.js.map +1 -0
  453. package/dist/js/utils/handleJWT.d.ts +11 -0
  454. package/dist/js/utils/handleJWT.d.ts.map +1 -0
  455. package/dist/js/utils/handleJWT.js +89 -0
  456. package/dist/js/utils/handleJWT.js.map +1 -0
  457. package/dist/js/utils/libsodium.d.ts +15 -0
  458. package/dist/js/utils/libsodium.d.ts.map +1 -0
  459. package/dist/js/utils/libsodium.js +185 -0
  460. package/dist/js/utils/libsodium.js.map +1 -0
  461. package/dist/js/utils/otpPurposes.d.ts +3 -0
  462. package/dist/js/utils/otpPurposes.d.ts.map +1 -0
  463. package/dist/js/utils/otpPurposes.js +38 -0
  464. package/dist/js/utils/otpPurposes.js.map +1 -0
  465. package/dist/js/utils/response.d.ts +10 -0
  466. package/dist/js/utils/response.d.ts.map +1 -0
  467. package/dist/js/utils/response.js +9 -0
  468. package/dist/js/utils/response.js.map +1 -0
  469. package/dist/js/utils/sanitize.d.ts +3 -0
  470. package/dist/js/utils/sanitize.d.ts.map +1 -0
  471. package/dist/js/utils/sanitize.js +13 -0
  472. package/dist/js/utils/sanitize.js.map +1 -0
  473. package/dist/js/utils/validate.d.ts +4 -0
  474. package/dist/js/utils/validate.d.ts.map +1 -0
  475. package/dist/js/utils/validate.js +59 -0
  476. package/dist/js/utils/validate.js.map +1 -0
  477. package/dist/js/utils/validationKeyError.d.ts +4 -0
  478. package/dist/js/utils/validationKeyError.d.ts.map +1 -0
  479. package/dist/js/utils/validationKeyError.js +38 -0
  480. package/dist/js/utils/validationKeyError.js.map +1 -0
  481. package/dist/js/validations.d.ts +3 -0
  482. package/dist/js/validations.d.ts.map +1 -0
  483. package/dist/js/validations.js +6 -0
  484. package/dist/js/validations.js.map +1 -0
  485. package/package.json +88 -0
@@ -0,0 +1,86 @@
1
+ import { verifyJWT } from "../utils/handleJWT.js";
2
+ import AppError from "../utils/AppError.js";
3
+ import registerModel from "../lib/model.registry.js";
4
+ import { getEnvs } from "../config/envs.js";
5
+ import getErrorDetail from "../utils/getErrorDetail.js";
6
+ const findUser = async (id, route) => {
7
+ const { userModelName } = getEnvs();
8
+ if (!userModelName) {
9
+ throw new AppError({
10
+ message: "User model is required for authentication",
11
+ statusCode: 500,
12
+ code: "AUTH_CONFIG_ERROR",
13
+ hint: "Configure 'userModelName' in your environment variables.",
14
+ details: getErrorDetail(route),
15
+ });
16
+ }
17
+ const Model = registerModel[userModelName];
18
+ if (!Model) {
19
+ throw new AppError({
20
+ message: `User model '${userModelName}' is not registered`,
21
+ statusCode: 500,
22
+ code: "AUTH_CONFIG_ERROR",
23
+ hint: "Register the user model before enabling authentication.",
24
+ details: getErrorDetail(route),
25
+ });
26
+ }
27
+ return await Model.findById(id).select("+_id +email +role");
28
+ };
29
+ const protect = (route) => async (req, res, next) => {
30
+ try {
31
+ const token = req.cookies?.authToken;
32
+ if (!token) {
33
+ return next(new AppError({
34
+ message: "Authentication required",
35
+ statusCode: 401,
36
+ code: "AUTH_REQUIRED",
37
+ hint: "Sign in to access this resource.",
38
+ details: getErrorDetail(route),
39
+ }));
40
+ }
41
+ const payload = verifyJWT({
42
+ token,
43
+ route,
44
+ });
45
+ if (typeof payload === "string" || !payload.sub) {
46
+ return next(new AppError({
47
+ message: "Invalid JWT payload",
48
+ statusCode: 401,
49
+ code: "AUTH_INVALID_TOKEN",
50
+ hint: "Sign in again to obtain a valid authentication token.",
51
+ details: getErrorDetail(route),
52
+ }));
53
+ }
54
+ const user = await findUser(payload.sub, route);
55
+ if (!user) {
56
+ return next(new AppError({
57
+ message: "This account no longer exists",
58
+ statusCode: 401,
59
+ code: "AUTH_USER_NOT_FOUND",
60
+ hint: "Sign in with an existing account.",
61
+ details: getErrorDetail(route),
62
+ }));
63
+ }
64
+ req.user = {
65
+ email: user.email,
66
+ role: user.role,
67
+ _id: user._id,
68
+ };
69
+ next();
70
+ }
71
+ catch (error) {
72
+ if (error instanceof AppError) {
73
+ return next(error);
74
+ }
75
+ console.error(error);
76
+ return next(new AppError({
77
+ message: "Authentication failed",
78
+ statusCode: 500,
79
+ code: "AUTH_MIDDLEWARE_ERROR",
80
+ hint: "This issue requires a fix from the framework developer.",
81
+ details: getErrorDetail(route),
82
+ }));
83
+ }
84
+ };
85
+ export default protect;
86
+ //# sourceMappingURL=auth.middleware.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.middleware.js","sourceRoot":"","sources":["../../../src/js/middleware/auth.middleware.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,aAAa,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,cAAc,MAAM,4BAA4B,CAAC;AAGxD,MAAM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EAAE,cAAc,CAAC,KAAK,CAAC;SAC/B,CAAC,CACH,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEJ,eAAe,OAAO,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { NextFunction, Request, Response } from "express";
2
+ import type { AppErrorConstructor } from "../utils/AppError.ts";
3
+ declare const errorMiddleware: (err: AppErrorConstructor, req: Request, res: Response, next: NextFunction) => Response<any, Record<string, any>> | undefined;
4
+ export default errorMiddleware;
5
+ //# sourceMappingURL=error.middleware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.middleware.d.ts","sourceRoot":"","sources":["../../../src/js/middleware/error.middleware.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,QAAA,MAAM,eAAe,GACnB,KAAK,mBAAmB,EACxB,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,MAAM,YAAY,mDA6BnB,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,25 @@
1
+ import AppLog from "../utils/AppLog.js";
2
+ const errorMiddleware = (err, req, res, next) => {
3
+ const message = err.message || "Internal Server Error";
4
+ const statusCode = err.statusCode || 500;
5
+ const code = err.code;
6
+ const details = err.details;
7
+ const hint = err.hint;
8
+ AppLog("x", "error.middleware", message);
9
+ if (err.isOperational) {
10
+ return res
11
+ .status(statusCode)
12
+ .json({ success: false, message, code, details, hint });
13
+ }
14
+ if (err instanceof SyntaxError && "body" in err) {
15
+ AppLog("x", "error.middleware", "Invalid JSON in request body.");
16
+ return res.status(400).json({
17
+ success: false,
18
+ message: "Invalid JSON in request body.",
19
+ });
20
+ }
21
+ console.error(err);
22
+ res.status(500).json({ success: false, message: "Something went wrong" });
23
+ };
24
+ export default errorMiddleware;
25
+ //# sourceMappingURL=error.middleware.js.map
@@ -0,0 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F,eAAe,eAAe,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { Upload } from "../types/upload.js";
2
+ import type { Route } from "../types/Collection.js";
3
+ import type { NextFunction, Request, Response } from "express";
4
+ export declare const handleMulterMiddleware: (fileArray: Upload[], route: Route) => (req: Request, res: Response, next: NextFunction) => void;
5
+ //# sourceMappingURL=multer.middleware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multer.middleware.d.ts","sourceRoot":"","sources":["../../../src/js/middleware/multer.middleware.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AA+B/D,eAAO,MAAM,sBAAsB,GACjC,WAAW,MAAM,EAAE,EACnB,OAAO,KAAK,MAsBJ,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,SAkFxD,CAAC"}
@@ -0,0 +1,97 @@
1
+ import multer from "multer";
2
+ import AppError from "../utils/AppError.js";
3
+ const storage = multer.memoryStorage();
4
+ const multerMiddleware = multer({
5
+ storage,
6
+ limits: {
7
+ fileSize: 5 * 1024 * 1024,
8
+ files: 10,
9
+ },
10
+ fileFilter(req, file, cb) {
11
+ cb(null, true);
12
+ },
13
+ });
14
+ export const handleMulterMiddleware = (fileArray, route) => {
15
+ if (!Array.isArray(fileArray))
16
+ throw new AppError({
17
+ message: "fileArray must be an array.",
18
+ statusCode: 400,
19
+ code: "UPLOAD_ARRAY_REQUIRED",
20
+ hint: "Provide fileArray as an array in the collection configuration.",
21
+ details: {
22
+ handler: route.handler,
23
+ method: route.method,
24
+ path: route.path,
25
+ },
26
+ });
27
+ const fields = fileArray.map((upload) => ({
28
+ name: upload.fieldName,
29
+ maxCount: upload.multiple ? 10 : 1,
30
+ }));
31
+ const upload = multerMiddleware.fields(fields);
32
+ return (req, res, next) => {
33
+ upload(req, res, (err) => {
34
+ if (!err)
35
+ return next();
36
+ if (err instanceof AppError) {
37
+ return next(err);
38
+ }
39
+ if (err instanceof multer.MulterError) {
40
+ let message = err.message;
41
+ let code = "UPLOAD_FAILED";
42
+ switch (err.code) {
43
+ case "LIMIT_FILE_SIZE":
44
+ message = "File size must not exceed 5 MB.";
45
+ code = "UPLOAD_TOO_LARGE";
46
+ break;
47
+ case "LIMIT_FILE_COUNT":
48
+ message = "Too many files uploaded.";
49
+ code = "UPLOAD_TOO_MANY_FILES";
50
+ break;
51
+ case "LIMIT_UNEXPECTED_FILE":
52
+ message = `Unexpected file field: '${err.field}'.`;
53
+ code = "UPLOAD_FIELD_NOT_FOUND";
54
+ break;
55
+ case "LIMIT_PART_COUNT":
56
+ message = "Too many form parts.";
57
+ break;
58
+ case "LIMIT_FIELD_COUNT":
59
+ message = "Too many fields.";
60
+ break;
61
+ case "LIMIT_FIELD_VALUE":
62
+ message = "Field value is too large.";
63
+ break;
64
+ }
65
+ return next(new AppError({
66
+ message,
67
+ statusCode: 400,
68
+ code,
69
+ hint: code === "UPLOAD_TOO_LARGE"
70
+ ? "Reduce the file size and try again."
71
+ : code === "UPLOAD_TOO_MANY_FILES"
72
+ ? "Reduce the number of uploaded files."
73
+ : code === "UPLOAD_FIELD_NOT_FOUND"
74
+ ? "Ensure the uploaded field name matches collection -> fileArray -> fieldName."
75
+ : "Check the upload request and try again.",
76
+ details: {
77
+ handler: route.handler,
78
+ method: route.method,
79
+ path: route.path,
80
+ },
81
+ }));
82
+ }
83
+ return next(new AppError({
84
+ message: "File upload failed.",
85
+ statusCode: 500,
86
+ code: "UPLOAD_FAILED",
87
+ hint: "An unexpected error occurred while processing the upload.",
88
+ details: {
89
+ handler: route.handler,
90
+ method: route.method,
91
+ path: route.path,
92
+ },
93
+ }));
94
+ });
95
+ };
96
+ };
97
+ //# sourceMappingURL=multer.middleware.js.map
@@ -0,0 +1 @@
1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AC,IAAI,KAAK,wBAAwB;gCACjC,CAAC,CAAC,8EAA8E;gCAChF,CAAC,CAAC,yCAAyC;oBACnD,OAAO,EAAE;wBACP,OAAO,EAAE,KAAK,CAAC,OAAO;wBACtB,MAAM,EAAE,KAAK,CAAC,MAAM;wBACpB,IAAI,EAAE,KAAK,CAAC,IAAI;qBACjB;iBACF,CAAC,CACH,CAAC;YACJ,CAAC;YAED,OAAO,IAAI,CACT,IAAI,QAAQ,CAAC;gBACX,OAAO,EAAE,qBAAqB;gBAC9B,UAAU,EAAE,GAAG;gBACf,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,2DAA2D;gBACjE,OAAO,EAAE;oBACP,OAAO,EAAE,KAAK,CAAC,OAAO;oBACtB,MAAM,EAAE,KAAK,CAAC,MAAM;oBACpB,IAAI,EAAE,KAAK,CAAC,IAAI;iBACjB;aACF,CAAC,CACH,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const rateLimiter: () => import("express-rate-limit").RateLimitRequestHandler;
2
+ //# sourceMappingURL=rateLimit.middleware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rateLimit.middleware.d.ts","sourceRoot":"","sources":["../../../src/js/middleware/rateLimit.middleware.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW,4DAgBvB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { rateLimit } from "express-rate-limit";
2
+ import { getEnvs } from "../config/envs.js";
3
+ import getDuration from "../config/duration.js";
4
+ export const rateLimiter = () => {
5
+ const { maxReqLimit, rateLimitDuration, rateLimitMsg } = getEnvs();
6
+ return rateLimit({
7
+ windowMs: getDuration(rateLimitDuration, {}),
8
+ max: maxReqLimit,
9
+ standardHeaders: true,
10
+ legacyHeaders: false,
11
+ handler: (_req, res) => {
12
+ res.status(429).json({
13
+ success: false,
14
+ message: rateLimitMsg,
15
+ });
16
+ },
17
+ });
18
+ };
19
+ //# sourceMappingURL=rateLimit.middleware.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rateLimit.middleware.js","sourceRoot":"","sources":["../../../src/js/middleware/rateLimit.middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAGhD,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE;IAC9B,MAAM,EAAE,WAAW,EAAE,iBAAiB,EAAE,YAAY,EAAE,GAAG,OAAO,EAAE,CAAC;IAEnE,OAAO,SAAS,CAAC;QACf,QAAQ,EAAE,WAAW,CAAC,iBAAiB,EAAE,EAAW,CAAC;QACrD,GAAG,EAAE,WAAW;QAChB,eAAe,EAAE,IAAI;QACrB,aAAa,EAAE,KAAK;QAEpB,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;YACrB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACnB,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,YAAY;aACtB,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { RequestHandler } from "express";
2
+ declare const realtime: RequestHandler;
3
+ export default realtime;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/js/realtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,QAAA,MAAM,QAAQ,EAAE,cAEf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,5 @@
1
+ const realtime = (req, res) => {
2
+ return res.json({ success: true, message: "realtime page found!" });
3
+ };
4
+ export default realtime;
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/js/realtime/index.ts"],"names":[],"mappings":"AAEA,MAAM,QAAQ,GAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IAC5C,OAAO,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC,CAAC;AACtE,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,41 @@
1
+ import type { MongooseField } from "../lib/mongoose.fields.ts";
2
+ import type { Role } from "../lib/roles.ts";
3
+ import type { ZodValidation } from "../lib/zod.fields.ts";
4
+ import type { RoutePath } from "./Routepath.ts";
5
+ import type { healthHandlers } from "./healthHandlers.ts";
6
+ import type { authHandlers } from "./authHandlers.ts";
7
+ import type { crudHandlers } from "./crudHandlers.ts";
8
+ import type { uploadHandlers } from "./uploadHandlers.js";
9
+ import type { Upload } from "./upload.ts";
10
+ export type Handler = healthHandlers | authHandlers | crudHandlers | uploadHandlers;
11
+ export type AuthRole = "admin" | "adminOrOwner" | "authenticated" | "public";
12
+ export type RouteMethod = "get" | "post" | "patch" | "delete";
13
+ export type AuthMode = "credentials" | "otp";
14
+ export interface Route {
15
+ method: RouteMethod;
16
+ path: RoutePath;
17
+ handler: Handler;
18
+ validationKey: string | boolean;
19
+ authRole: AuthRole;
20
+ fileArray?: Upload[];
21
+ mode?: AuthMode;
22
+ }
23
+ export type MongooseSchema = {
24
+ status: "pending" | "accepted" | "rejected";
25
+ role: Role;
26
+ } & {
27
+ [key: string]: MongooseField;
28
+ };
29
+ export type ValidationsObj = {} & {
30
+ [key: string]: ZodValidation;
31
+ };
32
+ export type ReqType = "auth" | "health" | "crud";
33
+ export interface Collection {
34
+ reqType: ReqType;
35
+ routeName: string;
36
+ routesArray: Route[];
37
+ modelName?: string;
38
+ mongooseSchemaObj?: MongooseSchema;
39
+ validationsObj?: ValidationsObj;
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AAM,cAAc,GAAG;IAC3B,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;IAE5C,IAAI,EAAE,IAAI,CAAC;CACZ,GAAG;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,EAAE,GAAG;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAGjD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,KAAK,EAAE,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,cAAc,CAAC;IACnC,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Collection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Collection.js","sourceRoot":"","sources":["../../../src/js/types/Collection.ts"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
1
+ import type { Collection } from "./Collection.ts";
2
+ import type { DurationType } from "../config/duration.ts";
3
+ export interface Constructor {
4
+ apiVersion: number;
5
+ backendURL: string;
6
+ cloudinaryAPIKey?: string;
7
+ cloudinaryAPISecret?: string;
8
+ cloudinaryCloudName?: string;
9
+ cloudinaryFolderName?: string;
10
+ collections?: Collection[];
11
+ databaseName?: string;
12
+ domain?: string;
13
+ ENV: string;
14
+ frontendURL?: string;
15
+ frontendURLs?: string[];
16
+ internalRoles?: string[];
17
+ isOffline: boolean;
18
+ jwtSecret?: string;
19
+ masterKey?: string;
20
+ maxReqLimit: number;
21
+ mongoDBURI?: string;
22
+ port: number;
23
+ rateLimitDuration: DurationType;
24
+ rateLimitMsg: string;
25
+ adminEmailSender?: string;
26
+ resendAPIKey?: string;
27
+ tokenExpiry: DurationType;
28
+ userModelName?: string;
29
+ }
30
+ //# sourceMappingURL=Constructor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Constructor.d.ts","sourceRoot":"","sources":["../../../src/js/types/Constructor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,YAAY,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,YAAY,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Constructor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Constructor.js","sourceRoot":"","sources":["../../../src/js/types/Constructor.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import type { MongooseField } from "../lib/mongoose.fields.js";
2
+ type OTPConfig = {
3
+ maxOtpTries: 5 | 7 | 10 | 15 | 20;
4
+ otpExpiry: "1m" | "3m" | "5m" | "10m" | "15m" | "20m";
5
+ };
6
+ export type OTPSchema = OTPConfig | {
7
+ [key: string]: MongooseField;
8
+ };
9
+ export {};
10
+ //# sourceMappingURL=MongooseOTPSchemaObj.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MongooseOTPSchemaObj.d.ts","sourceRoot":"","sources":["../../../src/js/types/MongooseOTPSchemaObj.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,KAAK,SAAS,GAAG;IACf,WAAW,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IAClC,SAAS,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG;IAClC,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;CAC9B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=MongooseOTPSchemaObj.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MongooseOTPSchemaObj.js","sourceRoot":"","sources":["../../../src/js/types/MongooseOTPSchemaObj.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export type RoutePath = "/" | "/:id" | "/create" | "/create/bulk" | "/new" | "/edit/:id" | "/update/:id" | "/delete/:id" | "/restore/:id" | "/archive/:id" | "/signup" | "/login" | "/logout" | "/refresh-token" | "/forgot-password" | "/reset-password" | "/change-password" | "/verify-email" | "/verify-otp" | "/resend-otp" | "/me" | "/profile" | "/search" | "/filter" | "/sort" | "/page/:page" | "/limit/:limit" | "/active" | "/inactive" | "/published" | "/draft" | "/featured" | "/:id/posts" | "/:id/comments" | "/:id/likes" | "/:id/followers" | "/:id/following" | "/upload" | "/upload/:id" | "/download/:id" | "/:id/addFile" | "/:id/updateFile" | "/:id/deleteFile" | "/dashboard" | "/stats" | "/analytics" | "/reports" | "/settings" | "/preferences" | "/notifications" | "/notifications/read" | "/health" | "/ping" | "/version";
2
+ //# sourceMappingURL=Routepath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Routepath.d.ts","sourceRoot":"","sources":["../../../src/js/types/Routepath.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAEjB,GAAG,GAGH,MAAM,GAGN,SAAS,GACT,cAAc,GACd,MAAM,GACN,WAAW,GACX,aAAa,GACb,aAAa,GACb,cAAc,GACd,cAAc,GAGd,SAAS,GACT,QAAQ,GACR,SAAS,GACT,gBAAgB,GAChB,kBAAkB,GAClB,iBAAiB,GACjB,kBAAkB,GAClB,eAAe,GACf,aAAa,GACb,aAAa,GAGb,KAAK,GACL,UAAU,GAGV,SAAS,GACT,SAAS,GACT,OAAO,GAGP,aAAa,GACb,eAAe,GAGf,SAAS,GACT,WAAW,GACX,YAAY,GACZ,QAAQ,GACR,WAAW,GAGX,YAAY,GACZ,eAAe,GACf,YAAY,GACZ,gBAAgB,GAChB,gBAAgB,GAGhB,SAAS,GACT,aAAa,GACb,eAAe,GAGf,cAAc,GACd,iBAAiB,GACjB,iBAAiB,GAGjB,YAAY,GACZ,QAAQ,GACR,YAAY,GACZ,UAAU,GAGV,WAAW,GACX,cAAc,GAGd,gBAAgB,GAChB,qBAAqB,GAGrB,SAAS,GACT,OAAO,GACP,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Routepath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Routepath.js","sourceRoot":"","sources":["../../../src/js/types/Routepath.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ export interface StoreFile {
2
+ url: string;
3
+ storageKey: string;
4
+ width?: number;
5
+ height?: number;
6
+ bytes: number;
7
+ format: string;
8
+ resourceType: string;
9
+ }
10
+ //# sourceMappingURL=StoreFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StoreFile.d.ts","sourceRoot":"","sources":["../../../src/js/types/StoreFile.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;CACtB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=StoreFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StoreFile.js","sourceRoot":"","sources":["../../../src/js/types/StoreFile.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import type { ZodValidation } from "../lib/zod.fields.js";
2
+ export type ValidationsObj = {
3
+ status: "pending" | "accepted" | "rejected";
4
+ } & {
5
+ [key: string]: ZodValidation;
6
+ };
7
+ //# sourceMappingURL=ValidationsObj.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValidationsObj.d.ts","sourceRoot":"","sources":["../../../src/js/types/ValidationsObj.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;CAC7C,GAAG;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;CAC9B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ValidationsObj.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValidationsObj.js","sourceRoot":"","sources":["../../../src/js/types/ValidationsObj.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export type authHandlers = "signup" | "verifyOTP" | "login" | "resendOTP" | "forgotPassword" | "resetPassword" | "logout";
2
+ //# sourceMappingURL=authHandlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authHandlers.d.ts","sourceRoot":"","sources":["../../../src/js/types/authHandlers.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GACpB,QAAQ,GACR,WAAW,GACX,OAAO,GACP,WAAW,GACX,gBAAgB,GAChB,eAAe,GACf,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=authHandlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authHandlers.js","sourceRoot":"","sources":["../../../src/js/types/authHandlers.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export type crudHandlers = "read" | "create" | "createBulk" | "readAll" | "update" | "remove" | "removeAll";
2
+ //# sourceMappingURL=crudHandlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crudHandlers.d.ts","sourceRoot":"","sources":["../../../src/js/types/crudHandlers.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,QAAQ,GACR,YAAY,GACZ,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,WAAW,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=crudHandlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crudHandlers.js","sourceRoot":"","sources":["../../../src/js/types/crudHandlers.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ export type EmailType = "template" | "custom" | "rawHTML";
2
+ export type EmailTemplate = "welcome" | "verify-email" | "password-reset" | "password-changed" | "login-alert" | "two-factor-code" | "magic-link" | "account-created" | "account-updated" | "account-deleted" | "email-changed" | "team-invitation" | "organization-invitation" | "member-added" | "member-removed" | "new-message" | "new-comment" | "mention" | "notification" | "reminder" | "invoice" | "receipt" | "payment-success" | "payment-failed" | "subscription-created" | "subscription-renewed" | "subscription-cancelled" | "trial-ending" | "order-confirmation" | "order-shipped" | "order-delivered" | "order-cancelled" | "password-expiring" | "security-alert" | "new-device-login" | "api-key-created" | "api-key-revoked" | "contact-form" | "support-ticket" | "feedback" | "daily-report" | "weekly-report" | "monthly-report" | "maintenance" | "announcement";
3
+ export type EmailProvider = "resend";
4
+ export interface Email {
5
+ type: EmailType;
6
+ provider: EmailProvider;
7
+ to: string;
8
+ template?: EmailTemplate;
9
+ subject?: string;
10
+ body?: string;
11
+ }
12
+ //# sourceMappingURL=email.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../../src/js/types/email.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE1D,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,cAAc,GACd,gBAAgB,GAChB,kBAAkB,GAClB,aAAa,GACb,iBAAiB,GACjB,YAAY,GAEZ,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,eAAe,GAEf,iBAAiB,GACjB,yBAAyB,GACzB,cAAc,GACd,gBAAgB,GAEhB,aAAa,GACb,aAAa,GACb,SAAS,GACT,cAAc,GACd,UAAU,GAEV,SAAS,GACT,SAAS,GACT,iBAAiB,GACjB,gBAAgB,GAChB,sBAAsB,GACtB,sBAAsB,GACtB,wBAAwB,GACxB,cAAc,GAEd,oBAAoB,GACpB,eAAe,GACf,iBAAiB,GACjB,iBAAiB,GAEjB,mBAAmB,GACnB,gBAAgB,GAChB,kBAAkB,GAClB,iBAAiB,GACjB,iBAAiB,GAEjB,cAAc,GACd,gBAAgB,GAChB,UAAU,GAEV,cAAc,GACd,eAAe,GACf,gBAAgB,GAEhB,aAAa,GACb,cAAc,CAAC;AAEnB,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;AAErC,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,aAAa,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=email.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.js","sourceRoot":"","sources":["../../../src/js/types/email.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export type healthHandlers = "healthGet" | "healthPost" | "healthPut" | "healthPatch" | "healthDelete";
2
+ //# sourceMappingURL=healthHandlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"healthHandlers.d.ts","sourceRoot":"","sources":["../../../src/js/types/healthHandlers.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GACtB,WAAW,GACX,YAAY,GACZ,WAAW,GACX,aAAa,GACb,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=healthHandlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"healthHandlers.js","sourceRoot":"","sources":["../../../src/js/types/healthHandlers.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ export interface Upload {
2
+ fieldName: string;
3
+ mongooseSchemaFieldName: String;
4
+ type: "image" | "video" | "raw";
5
+ provider: "cloudinary" | "aws-s3";
6
+ multiple?: boolean;
7
+ validationIdentifierKey?: string;
8
+ }
9
+ //# sourceMappingURL=upload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/js/types/upload.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,uBAAuB,EAAE,MAAM,CAAC;IAChC,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,KAAK,CAAC;IAChC,QAAQ,EAAE,YAAY,GAAG,QAAQ,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=upload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload.js","sourceRoot":"","sources":["../../../src/js/types/upload.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ export interface StoreFile {
2
+ url: string;
3
+ publicId: string;
4
+ width?: number;
5
+ height?: number;
6
+ bytes: number;
7
+ format: string;
8
+ resourceType: string;
9
+ }
10
+ //# sourceMappingURL=uploadFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uploadFile.d.ts","sourceRoot":"","sources":["../../../src/js/types/uploadFile.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;CACtB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=uploadFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uploadFile.js","sourceRoot":"","sources":["../../../src/js/types/uploadFile.ts"],"names":[],"mappings":""}