@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.
- package/dist/js/admin/index.d.ts +4 -0
- package/dist/js/admin/index.d.ts.map +1 -0
- package/dist/js/admin/index.js +5 -0
- package/dist/js/admin/index.js.map +1 -0
- package/dist/js/app.d.ts +3 -0
- package/dist/js/app.d.ts.map +1 -0
- package/dist/js/app.js +55 -0
- package/dist/js/app.js.map +1 -0
- package/dist/js/auth/bunch.auth.d.ts +8 -0
- package/dist/js/auth/bunch.auth.d.ts.map +1 -0
- package/dist/js/auth/bunch.auth.js +8 -0
- package/dist/js/auth/bunch.auth.js.map +1 -0
- package/dist/js/auth/createOTPModel.d.ts +2 -0
- package/dist/js/auth/createOTPModel.d.ts.map +1 -0
- package/dist/js/auth/createOTPModel.js +2 -0
- package/dist/js/auth/createOTPModel.js.map +1 -0
- package/dist/js/auth/forgotPassword.d.ts +10 -0
- package/dist/js/auth/forgotPassword.d.ts.map +1 -0
- package/dist/js/auth/forgotPassword.js +39 -0
- package/dist/js/auth/forgotPassword.js.map +1 -0
- package/dist/js/auth/index.d.ts +5 -0
- package/dist/js/auth/index.d.ts.map +1 -0
- package/dist/js/auth/index.js +26 -0
- package/dist/js/auth/index.js.map +1 -0
- package/dist/js/auth/login.d.ts +10 -0
- package/dist/js/auth/login.d.ts.map +1 -0
- package/dist/js/auth/login.js +32 -0
- package/dist/js/auth/login.js.map +1 -0
- package/dist/js/auth/logout.d.ts +5 -0
- package/dist/js/auth/logout.d.ts.map +1 -0
- package/dist/js/auth/logout.js +10 -0
- package/dist/js/auth/logout.js.map +1 -0
- package/dist/js/auth/resendOTP.d.ts +10 -0
- package/dist/js/auth/resendOTP.d.ts.map +1 -0
- package/dist/js/auth/resendOTP.js +62 -0
- package/dist/js/auth/resendOTP.js.map +1 -0
- package/dist/js/auth/resetPassword.d.ts +10 -0
- package/dist/js/auth/resetPassword.d.ts.map +1 -0
- package/dist/js/auth/resetPassword.js +60 -0
- package/dist/js/auth/resetPassword.js.map +1 -0
- package/dist/js/auth/sendOTP.d.ts +6 -0
- package/dist/js/auth/sendOTP.d.ts.map +1 -0
- package/dist/js/auth/sendOTP.js +28 -0
- package/dist/js/auth/sendOTP.js.map +1 -0
- package/dist/js/auth/signup.d.ts +10 -0
- package/dist/js/auth/signup.d.ts.map +1 -0
- package/dist/js/auth/signup.js +47 -0
- package/dist/js/auth/signup.js.map +1 -0
- package/dist/js/auth/twoFactorAuth.d.ts +2 -0
- package/dist/js/auth/twoFactorAuth.d.ts.map +1 -0
- package/dist/js/auth/twoFactorAuth.js +3 -0
- package/dist/js/auth/twoFactorAuth.js.map +1 -0
- package/dist/js/auth/utils/authenticateUser.d.ts +11 -0
- package/dist/js/auth/utils/authenticateUser.d.ts.map +1 -0
- package/dist/js/auth/utils/authenticateUser.js +60 -0
- package/dist/js/auth/utils/authenticateUser.js.map +1 -0
- package/dist/js/auth/utils/createOTPModel.d.ts +4 -0
- package/dist/js/auth/utils/createOTPModel.d.ts.map +1 -0
- package/dist/js/auth/utils/createOTPModel.js +28 -0
- package/dist/js/auth/utils/createOTPModel.js.map +1 -0
- package/dist/js/auth/utils/createOTPUser.d.ts +12 -0
- package/dist/js/auth/utils/createOTPUser.d.ts.map +1 -0
- package/dist/js/auth/utils/createOTPUser.js +63 -0
- package/dist/js/auth/utils/createOTPUser.js.map +1 -0
- package/dist/js/auth/utils/createUser.d.ts +11 -0
- package/dist/js/auth/utils/createUser.d.ts.map +1 -0
- package/dist/js/auth/utils/createUser.js +42 -0
- package/dist/js/auth/utils/createUser.js.map +1 -0
- package/dist/js/auth/utils/deleteOTPUser.d.ts +3 -0
- package/dist/js/auth/utils/deleteOTPUser.d.ts.map +1 -0
- package/dist/js/auth/utils/deleteOTPUser.js +3 -0
- package/dist/js/auth/utils/deleteOTPUser.js.map +1 -0
- package/dist/js/auth/utils/findUser.d.ts +2 -0
- package/dist/js/auth/utils/findUser.d.ts.map +1 -0
- package/dist/js/auth/utils/findUser.js +2 -0
- package/dist/js/auth/utils/findUser.js.map +1 -0
- package/dist/js/auth/utils/getModel.d.ts +6 -0
- package/dist/js/auth/utils/getModel.d.ts.map +1 -0
- package/dist/js/auth/utils/getModel.js +18 -0
- package/dist/js/auth/utils/getModel.js.map +1 -0
- package/dist/js/auth/utils/getOTPData.d.ts +9 -0
- package/dist/js/auth/utils/getOTPData.d.ts.map +1 -0
- package/dist/js/auth/utils/getOTPData.js +26 -0
- package/dist/js/auth/utils/getOTPData.js.map +1 -0
- package/dist/js/auth/utils/getOTPModel.d.ts +4 -0
- package/dist/js/auth/utils/getOTPModel.d.ts.map +1 -0
- package/dist/js/auth/utils/getOTPModel.js +20 -0
- package/dist/js/auth/utils/getOTPModel.js.map +1 -0
- package/dist/js/auth/utils/getOTPUser.d.ts +8 -0
- package/dist/js/auth/utils/getOTPUser.d.ts.map +1 -0
- package/dist/js/auth/utils/getOTPUser.js +21 -0
- package/dist/js/auth/utils/getOTPUser.js.map +1 -0
- package/dist/js/auth/utils/getUser.d.ts +10 -0
- package/dist/js/auth/utils/getUser.d.ts.map +1 -0
- package/dist/js/auth/utils/getUser.js +27 -0
- package/dist/js/auth/utils/getUser.js.map +1 -0
- package/dist/js/auth/utils/handleIsVerfieid.d.ts +9 -0
- package/dist/js/auth/utils/handleIsVerfieid.d.ts.map +1 -0
- package/dist/js/auth/utils/handleIsVerfieid.js +20 -0
- package/dist/js/auth/utils/handleIsVerfieid.js.map +1 -0
- package/dist/js/auth/utils/handleIsVerified.d.ts +11 -0
- package/dist/js/auth/utils/handleIsVerified.d.ts.map +1 -0
- package/dist/js/auth/utils/handleIsVerified.js +31 -0
- package/dist/js/auth/utils/handleIsVerified.js.map +1 -0
- package/dist/js/auth/utils/modeMap.d.ts +38 -0
- package/dist/js/auth/utils/modeMap.d.ts.map +1 -0
- package/dist/js/auth/utils/modeMap.js +15 -0
- package/dist/js/auth/utils/modeMap.js.map +1 -0
- package/dist/js/auth/utils/otpHTML.d.ts +2 -0
- package/dist/js/auth/utils/otpHTML.d.ts.map +1 -0
- package/dist/js/auth/utils/otpHTML.js +2 -0
- package/dist/js/auth/utils/otpHTML.js.map +1 -0
- package/dist/js/auth/utils/otpVerifiedResponse.d.ts +9 -0
- package/dist/js/auth/utils/otpVerifiedResponse.d.ts.map +1 -0
- package/dist/js/auth/utils/otpVerifiedResponse.js +22 -0
- package/dist/js/auth/utils/otpVerifiedResponse.js.map +1 -0
- package/dist/js/auth/utils/sendCookie.d.ts +14 -0
- package/dist/js/auth/utils/sendCookie.d.ts.map +1 -0
- package/dist/js/auth/utils/sendCookie.js +73 -0
- package/dist/js/auth/utils/sendCookie.js.map +1 -0
- package/dist/js/auth/utils/sendOTP.d.ts +7 -0
- package/dist/js/auth/utils/sendOTP.d.ts.map +1 -0
- package/dist/js/auth/utils/sendOTP.js +48 -0
- package/dist/js/auth/utils/sendOTP.js.map +1 -0
- package/dist/js/auth/utils/verifyCredentials.d.ts +9 -0
- package/dist/js/auth/utils/verifyCredentials.d.ts.map +1 -0
- package/dist/js/auth/utils/verifyCredentials.js +39 -0
- package/dist/js/auth/utils/verifyCredentials.js.map +1 -0
- package/dist/js/auth/verifyOTP.d.ts +10 -0
- package/dist/js/auth/verifyOTP.d.ts.map +1 -0
- package/dist/js/auth/verifyOTP.js +110 -0
- package/dist/js/auth/verifyOTP.js.map +1 -0
- package/dist/js/config/cloudinary.d.ts +5 -0
- package/dist/js/config/cloudinary.d.ts.map +1 -0
- package/dist/js/config/cloudinary.js +25 -0
- package/dist/js/config/cloudinary.js.map +1 -0
- package/dist/js/config/defaultConfig.d.ts +3 -0
- package/dist/js/config/defaultConfig.d.ts.map +1 -0
- package/dist/js/config/defaultConfig.js +12 -0
- package/dist/js/config/defaultConfig.js.map +1 -0
- package/dist/js/config/duration.d.ts +22 -0
- package/dist/js/config/duration.d.ts.map +1 -0
- package/dist/js/config/duration.js +35 -0
- package/dist/js/config/duration.js.map +1 -0
- package/dist/js/config/envs.d.ts +32 -0
- package/dist/js/config/envs.d.ts.map +1 -0
- package/dist/js/config/envs.js +10 -0
- package/dist/js/config/envs.js.map +1 -0
- package/dist/js/config/handleReqType.d.ts +7 -0
- package/dist/js/config/handleReqType.d.ts.map +1 -0
- package/dist/js/config/handleReqType.js +13 -0
- package/dist/js/config/handleReqType.js.map +1 -0
- package/dist/js/config/handlerMap.d.ts +3 -0
- package/dist/js/config/handlerMap.d.ts.map +1 -0
- package/dist/js/config/handlerMap.js +29 -0
- package/dist/js/config/handlerMap.js.map +1 -0
- package/dist/js/config/reqTypes.d.ts +2 -0
- package/dist/js/config/reqTypes.d.ts.map +1 -0
- package/dist/js/config/reqTypes.js +2 -0
- package/dist/js/config/reqTypes.js.map +1 -0
- package/dist/js/config/sendEmail.d.ts +11 -0
- package/dist/js/config/sendEmail.d.ts.map +1 -0
- package/dist/js/config/sendEmail.js +95 -0
- package/dist/js/config/sendEmail.js.map +1 -0
- package/dist/js/core/app.d.ts +3 -0
- package/dist/js/core/app.d.ts.map +1 -0
- package/dist/js/core/app.js +19 -0
- package/dist/js/core/app.js.map +1 -0
- package/dist/js/crud/bunch.crud.d.ts +11 -0
- package/dist/js/crud/bunch.crud.d.ts.map +1 -0
- package/dist/js/crud/bunch.crud.js +11 -0
- package/dist/js/crud/bunch.crud.js.map +1 -0
- package/dist/js/crud/create.d.ts +10 -0
- package/dist/js/crud/create.d.ts.map +1 -0
- package/dist/js/crud/create.js +72 -0
- package/dist/js/crud/create.js.map +1 -0
- package/dist/js/crud/createBulk.d.ts +10 -0
- package/dist/js/crud/createBulk.d.ts.map +1 -0
- package/dist/js/crud/createBulk.js +20 -0
- package/dist/js/crud/createBulk.js.map +1 -0
- package/dist/js/crud/files/file.update.d.ts +10 -0
- package/dist/js/crud/files/file.update.d.ts.map +1 -0
- package/dist/js/crud/files/file.update.js +28 -0
- package/dist/js/crud/files/file.update.js.map +1 -0
- package/dist/js/crud/handleUploads/file.add.d.ts +10 -0
- package/dist/js/crud/handleUploads/file.add.d.ts.map +1 -0
- package/dist/js/crud/handleUploads/file.add.js +61 -0
- package/dist/js/crud/handleUploads/file.add.js.map +1 -0
- package/dist/js/crud/handleUploads/file.create.d.ts +10 -0
- package/dist/js/crud/handleUploads/file.create.d.ts.map +1 -0
- package/dist/js/crud/handleUploads/file.create.js +33 -0
- package/dist/js/crud/handleUploads/file.create.js.map +1 -0
- package/dist/js/crud/handleUploads/file.delete.d.ts +10 -0
- package/dist/js/crud/handleUploads/file.delete.d.ts.map +1 -0
- package/dist/js/crud/handleUploads/file.delete.js +35 -0
- package/dist/js/crud/handleUploads/file.delete.js.map +1 -0
- package/dist/js/crud/handleUploads/file.update.d.ts +10 -0
- package/dist/js/crud/handleUploads/file.update.d.ts.map +1 -0
- package/dist/js/crud/handleUploads/file.update.js +30 -0
- package/dist/js/crud/handleUploads/file.update.js.map +1 -0
- package/dist/js/crud/index.d.ts +5 -0
- package/dist/js/crud/index.d.ts.map +1 -0
- package/dist/js/crud/index.js +36 -0
- package/dist/js/crud/index.js.map +1 -0
- package/dist/js/crud/read.d.ts +10 -0
- package/dist/js/crud/read.d.ts.map +1 -0
- package/dist/js/crud/read.js +27 -0
- package/dist/js/crud/read.js.map +1 -0
- package/dist/js/crud/readAll.d.ts +10 -0
- package/dist/js/crud/readAll.d.ts.map +1 -0
- package/dist/js/crud/readAll.js +24 -0
- package/dist/js/crud/readAll.js.map +1 -0
- package/dist/js/crud/remove.d.ts +10 -0
- package/dist/js/crud/remove.d.ts.map +1 -0
- package/dist/js/crud/remove.js +28 -0
- package/dist/js/crud/remove.js.map +1 -0
- package/dist/js/crud/removeAll.d.ts +10 -0
- package/dist/js/crud/removeAll.d.ts.map +1 -0
- package/dist/js/crud/removeAll.js +37 -0
- package/dist/js/crud/removeAll.js.map +1 -0
- package/dist/js/crud/update.d.ts +10 -0
- package/dist/js/crud/update.d.ts.map +1 -0
- package/dist/js/crud/update.js +33 -0
- package/dist/js/crud/update.js.map +1 -0
- package/dist/js/crud/utils/authroizeAccess.d.ts +10 -0
- package/dist/js/crud/utils/authroizeAccess.d.ts.map +1 -0
- package/dist/js/crud/utils/authroizeAccess.js +48 -0
- package/dist/js/crud/utils/authroizeAccess.js.map +1 -0
- package/dist/js/crud/utils/getItem.d.ts +11 -0
- package/dist/js/crud/utils/getItem.d.ts.map +1 -0
- package/dist/js/crud/utils/getItem.js +68 -0
- package/dist/js/crud/utils/getItem.js.map +1 -0
- package/dist/js/crud/utils/getParam.d.ts +8 -0
- package/dist/js/crud/utils/getParam.d.ts.map +1 -0
- package/dist/js/crud/utils/getParam.js +19 -0
- package/dist/js/crud/utils/getParam.js.map +1 -0
- package/dist/js/crud/utils/validateOwner.d.ts +7 -0
- package/dist/js/crud/utils/validateOwner.d.ts.map +1 -0
- package/dist/js/crud/utils/validateOwner.js +5 -0
- package/dist/js/crud/utils/validateOwner.js.map +1 -0
- package/dist/js/health/bunch.health.d.ts +6 -0
- package/dist/js/health/bunch.health.d.ts.map +1 -0
- package/dist/js/health/bunch.health.js +6 -0
- package/dist/js/health/bunch.health.js.map +1 -0
- package/dist/js/health/delete.health.d.ts +4 -0
- package/dist/js/health/delete.health.d.ts.map +1 -0
- package/dist/js/health/delete.health.js +5 -0
- package/dist/js/health/delete.health.js.map +1 -0
- package/dist/js/health/get.health.d.ts +4 -0
- package/dist/js/health/get.health.d.ts.map +1 -0
- package/dist/js/health/get.health.js +5 -0
- package/dist/js/health/get.health.js.map +1 -0
- package/dist/js/health/health.collection.d.ts +4 -0
- package/dist/js/health/health.collection.d.ts.map +1 -0
- package/dist/js/health/health.collection.js +39 -0
- package/dist/js/health/health.collection.js.map +1 -0
- package/dist/js/health/health.controller.d.ts +4 -0
- package/dist/js/health/health.controller.d.ts.map +1 -0
- package/dist/js/health/health.controller.js +5 -0
- package/dist/js/health/health.controller.js.map +1 -0
- package/dist/js/health/index.d.ts +5 -0
- package/dist/js/health/index.d.ts.map +1 -0
- package/dist/js/health/index.js +10 -0
- package/dist/js/health/index.js.map +1 -0
- package/dist/js/health/patch.health.d.ts +4 -0
- package/dist/js/health/patch.health.d.ts.map +1 -0
- package/dist/js/health/patch.health.js +5 -0
- package/dist/js/health/patch.health.js.map +1 -0
- package/dist/js/health/post.health.d.ts +4 -0
- package/dist/js/health/post.health.d.ts.map +1 -0
- package/dist/js/health/post.health.js +5 -0
- package/dist/js/health/post.health.js.map +1 -0
- package/dist/js/health/put.health.d.ts +4 -0
- package/dist/js/health/put.health.d.ts.map +1 -0
- package/dist/js/health/put.health.js +5 -0
- package/dist/js/health/put.health.js.map +1 -0
- package/dist/js/index.d.ts +13 -0
- package/dist/js/index.d.ts.map +1 -0
- package/dist/js/index.js +21 -0
- package/dist/js/index.js.map +1 -0
- package/dist/js/lib/Mongoose.d.ts +53 -0
- package/dist/js/lib/Mongoose.d.ts.map +1 -0
- package/dist/js/lib/Mongoose.js +2 -0
- package/dist/js/lib/Mongoose.js.map +1 -0
- package/dist/js/lib/OA.d.ts +2 -0
- package/dist/js/lib/OA.d.ts.map +1 -0
- package/dist/js/lib/OA.js +2 -0
- package/dist/js/lib/OA.js.map +1 -0
- package/dist/js/lib/OAuthProviders.d.ts +3 -0
- package/dist/js/lib/OAuthProviders.d.ts.map +1 -0
- package/dist/js/lib/OAuthProviders.js +18 -0
- package/dist/js/lib/OAuthProviders.js.map +1 -0
- package/dist/js/lib/PROVIDERS.d.ts +2 -0
- package/dist/js/lib/PROVIDERS.d.ts.map +1 -0
- package/dist/js/lib/PROVIDERS.js +2 -0
- package/dist/js/lib/PROVIDERS.js.map +1 -0
- package/dist/js/lib/db.d.ts +8 -0
- package/dist/js/lib/db.d.ts.map +1 -0
- package/dist/js/lib/db.js +28 -0
- package/dist/js/lib/db.js.map +1 -0
- package/dist/js/lib/handler.d.ts +9 -0
- package/dist/js/lib/handler.d.ts.map +1 -0
- package/dist/js/lib/handler.js +11 -0
- package/dist/js/lib/handler.js.map +1 -0
- package/dist/js/lib/handlerMap.d.ts +3 -0
- package/dist/js/lib/handlerMap.d.ts.map +1 -0
- package/dist/js/lib/handlerMap.js +18 -0
- package/dist/js/lib/handlerMap.js.map +1 -0
- package/dist/js/lib/model.factory.d.ts +8 -0
- package/dist/js/lib/model.factory.d.ts.map +1 -0
- package/dist/js/lib/model.factory.js +49 -0
- package/dist/js/lib/model.factory.js.map +1 -0
- package/dist/js/lib/model.registry.d.ts +4 -0
- package/dist/js/lib/model.registry.d.ts.map +1 -0
- package/dist/js/lib/model.registry.js +4 -0
- package/dist/js/lib/model.registry.js.map +1 -0
- package/dist/js/lib/mongoose.fields.d.ts +40 -0
- package/dist/js/lib/mongoose.fields.d.ts.map +1 -0
- package/dist/js/lib/mongoose.fields.js +187 -0
- package/dist/js/lib/mongoose.fields.js.map +1 -0
- package/dist/js/lib/roles.d.ts +3 -0
- package/dist/js/lib/roles.d.ts.map +1 -0
- package/dist/js/lib/roles.js +13 -0
- package/dist/js/lib/roles.js.map +1 -0
- package/dist/js/lib/schema.builder.d.ts +6 -0
- package/dist/js/lib/schema.builder.d.ts.map +1 -0
- package/dist/js/lib/schema.builder.js +28 -0
- package/dist/js/lib/schema.builder.js.map +1 -0
- package/dist/js/lib/zod.fields.d.ts +119 -0
- package/dist/js/lib/zod.fields.d.ts.map +1 -0
- package/dist/js/lib/zod.fields.js +133 -0
- package/dist/js/lib/zod.fields.js.map +1 -0
- package/dist/js/middleware/auth.middleware.d.ts +5 -0
- package/dist/js/middleware/auth.middleware.d.ts.map +1 -0
- package/dist/js/middleware/auth.middleware.js +86 -0
- package/dist/js/middleware/auth.middleware.js.map +1 -0
- package/dist/js/middleware/error.middleware.d.ts +5 -0
- package/dist/js/middleware/error.middleware.d.ts.map +1 -0
- package/dist/js/middleware/error.middleware.js +25 -0
- package/dist/js/middleware/error.middleware.js.map +1 -0
- package/dist/js/middleware/multer.middleware.d.ts +5 -0
- package/dist/js/middleware/multer.middleware.d.ts.map +1 -0
- package/dist/js/middleware/multer.middleware.js +97 -0
- package/dist/js/middleware/multer.middleware.js.map +1 -0
- package/dist/js/middleware/rateLimit.middleware.d.ts +2 -0
- package/dist/js/middleware/rateLimit.middleware.d.ts.map +1 -0
- package/dist/js/middleware/rateLimit.middleware.js +19 -0
- package/dist/js/middleware/rateLimit.middleware.js.map +1 -0
- package/dist/js/realtime/index.d.ts +4 -0
- package/dist/js/realtime/index.d.ts.map +1 -0
- package/dist/js/realtime/index.js +5 -0
- package/dist/js/realtime/index.js.map +1 -0
- package/dist/js/types/Collection.d.ts +41 -0
- package/dist/js/types/Collection.d.ts.map +1 -0
- package/dist/js/types/Collection.js +2 -0
- package/dist/js/types/Collection.js.map +1 -0
- package/dist/js/types/Constructor.d.ts +30 -0
- package/dist/js/types/Constructor.d.ts.map +1 -0
- package/dist/js/types/Constructor.js +2 -0
- package/dist/js/types/Constructor.js.map +1 -0
- package/dist/js/types/MongooseOTPSchemaObj.d.ts +10 -0
- package/dist/js/types/MongooseOTPSchemaObj.d.ts.map +1 -0
- package/dist/js/types/MongooseOTPSchemaObj.js +2 -0
- package/dist/js/types/MongooseOTPSchemaObj.js.map +1 -0
- package/dist/js/types/Routepath.d.ts +2 -0
- package/dist/js/types/Routepath.d.ts.map +1 -0
- package/dist/js/types/Routepath.js +2 -0
- package/dist/js/types/Routepath.js.map +1 -0
- package/dist/js/types/StoreFile.d.ts +10 -0
- package/dist/js/types/StoreFile.d.ts.map +1 -0
- package/dist/js/types/StoreFile.js +2 -0
- package/dist/js/types/StoreFile.js.map +1 -0
- package/dist/js/types/ValidationsObj.d.ts +7 -0
- package/dist/js/types/ValidationsObj.d.ts.map +1 -0
- package/dist/js/types/ValidationsObj.js +2 -0
- package/dist/js/types/ValidationsObj.js.map +1 -0
- package/dist/js/types/authHandlers.d.ts +2 -0
- package/dist/js/types/authHandlers.d.ts.map +1 -0
- package/dist/js/types/authHandlers.js +2 -0
- package/dist/js/types/authHandlers.js.map +1 -0
- package/dist/js/types/crudHandlers.d.ts +2 -0
- package/dist/js/types/crudHandlers.d.ts.map +1 -0
- package/dist/js/types/crudHandlers.js +2 -0
- package/dist/js/types/crudHandlers.js.map +1 -0
- package/dist/js/types/email.d.ts +12 -0
- package/dist/js/types/email.d.ts.map +1 -0
- package/dist/js/types/email.js +2 -0
- package/dist/js/types/email.js.map +1 -0
- package/dist/js/types/healthHandlers.d.ts +2 -0
- package/dist/js/types/healthHandlers.d.ts.map +1 -0
- package/dist/js/types/healthHandlers.js +2 -0
- package/dist/js/types/healthHandlers.js.map +1 -0
- package/dist/js/types/upload.d.ts +9 -0
- package/dist/js/types/upload.d.ts.map +1 -0
- package/dist/js/types/upload.js +2 -0
- package/dist/js/types/upload.js.map +1 -0
- package/dist/js/types/uploadFile.d.ts +10 -0
- package/dist/js/types/uploadFile.d.ts.map +1 -0
- package/dist/js/types/uploadFile.js +2 -0
- package/dist/js/types/uploadFile.js.map +1 -0
- package/dist/js/types/uploadHandlers.d.ts +2 -0
- package/dist/js/types/uploadHandlers.d.ts.map +1 -0
- package/dist/js/types/uploadHandlers.js +2 -0
- package/dist/js/types/uploadHandlers.js.map +1 -0
- package/dist/js/upload/create.d.ts +8 -0
- package/dist/js/upload/create.d.ts.map +1 -0
- package/dist/js/upload/create.js +71 -0
- package/dist/js/upload/create.js.map +1 -0
- package/dist/js/upload/delete.d.ts +8 -0
- package/dist/js/upload/delete.d.ts.map +1 -0
- package/dist/js/upload/delete.js +107 -0
- package/dist/js/upload/delete.js.map +1 -0
- package/dist/js/upload/index.d.ts +3 -0
- package/dist/js/upload/index.d.ts.map +1 -0
- package/dist/js/upload/index.js +3 -0
- package/dist/js/upload/index.js.map +1 -0
- package/dist/js/upload/providers/cloudinary.provider.d.ts +2 -0
- package/dist/js/upload/providers/cloudinary.provider.d.ts.map +1 -0
- package/dist/js/upload/providers/cloudinary.provider.js +2 -0
- package/dist/js/upload/providers/cloudinary.provider.js.map +1 -0
- package/dist/js/upload/update.d.ts +10 -0
- package/dist/js/upload/update.d.ts.map +1 -0
- package/dist/js/upload/update.js +144 -0
- package/dist/js/upload/update.js.map +1 -0
- package/dist/js/utils/AppError.d.ts +26 -0
- package/dist/js/utils/AppError.d.ts.map +1 -0
- package/dist/js/utils/AppError.js +18 -0
- package/dist/js/utils/AppError.js.map +1 -0
- package/dist/js/utils/AppLog.d.ts +10 -0
- package/dist/js/utils/AppLog.d.ts.map +1 -0
- package/dist/js/utils/AppLog.js +12 -0
- package/dist/js/utils/AppLog.js.map +1 -0
- package/dist/js/utils/Applog.d.ts +2 -0
- package/dist/js/utils/Applog.d.ts.map +1 -0
- package/dist/js/utils/Applog.js +2 -0
- package/dist/js/utils/Applog.js.map +1 -0
- package/dist/js/utils/AsyncHandler.d.ts +4 -0
- package/dist/js/utils/AsyncHandler.d.ts.map +1 -0
- package/dist/js/utils/AsyncHandler.js +5 -0
- package/dist/js/utils/AsyncHandler.js.map +1 -0
- package/dist/js/utils/extractParamsNames.d.ts +2 -0
- package/dist/js/utils/extractParamsNames.d.ts.map +1 -0
- package/dist/js/utils/extractParamsNames.js +13 -0
- package/dist/js/utils/extractParamsNames.js.map +1 -0
- package/dist/js/utils/getErrorDetail.d.ts +8 -0
- package/dist/js/utils/getErrorDetail.d.ts.map +1 -0
- package/dist/js/utils/getErrorDetail.js +9 -0
- package/dist/js/utils/getErrorDetail.js.map +1 -0
- package/dist/js/utils/getModel.d.ts +8 -0
- package/dist/js/utils/getModel.d.ts.map +1 -0
- package/dist/js/utils/getModel.js +27 -0
- package/dist/js/utils/getModel.js.map +1 -0
- package/dist/js/utils/handleJWT.d.ts +11 -0
- package/dist/js/utils/handleJWT.d.ts.map +1 -0
- package/dist/js/utils/handleJWT.js +89 -0
- package/dist/js/utils/handleJWT.js.map +1 -0
- package/dist/js/utils/libsodium.d.ts +15 -0
- package/dist/js/utils/libsodium.d.ts.map +1 -0
- package/dist/js/utils/libsodium.js +185 -0
- package/dist/js/utils/libsodium.js.map +1 -0
- package/dist/js/utils/otpPurposes.d.ts +3 -0
- package/dist/js/utils/otpPurposes.d.ts.map +1 -0
- package/dist/js/utils/otpPurposes.js +38 -0
- package/dist/js/utils/otpPurposes.js.map +1 -0
- package/dist/js/utils/response.d.ts +10 -0
- package/dist/js/utils/response.d.ts.map +1 -0
- package/dist/js/utils/response.js +9 -0
- package/dist/js/utils/response.js.map +1 -0
- package/dist/js/utils/sanitize.d.ts +3 -0
- package/dist/js/utils/sanitize.d.ts.map +1 -0
- package/dist/js/utils/sanitize.js +13 -0
- package/dist/js/utils/sanitize.js.map +1 -0
- package/dist/js/utils/validate.d.ts +4 -0
- package/dist/js/utils/validate.d.ts.map +1 -0
- package/dist/js/utils/validate.js +59 -0
- package/dist/js/utils/validate.js.map +1 -0
- package/dist/js/utils/validationKeyError.d.ts +4 -0
- package/dist/js/utils/validationKeyError.d.ts.map +1 -0
- package/dist/js/utils/validationKeyError.js +38 -0
- package/dist/js/utils/validationKeyError.js.map +1 -0
- package/dist/js/validations.d.ts +3 -0
- package/dist/js/validations.d.ts.map +1 -0
- package/dist/js/validations.js +6 -0
- package/dist/js/validations.js.map +1 -0
- 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":"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"}
|
|
@@ -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 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.middleware.js","sourceRoot":"","sources":["../../../src/js/middleware/error.middleware.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAIxC,MAAM,eAAe,GAAG,CACtB,GAAwB,EACxB,GAAY,EACZ,GAAa,EACb,IAAkB,EAClB,EAAE;IACF,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,IAAI,uBAAuB,CAAC;IACvD,MAAM,UAAU,GAAG,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC;IACzC,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;IACtB,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;IAC5B,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;IAEtB,MAAM,CAAC,GAAG,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC;IAGzC,IAAI,GAAG,CAAC,aAAa,EAAE,CAAC;QACtB,OAAO,GAAG;aACP,MAAM,CAAC,UAAU,CAAC;aAClB,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED,IAAI,GAAG,YAAY,WAAW,IAAI,MAAM,IAAI,GAAG,EAAE,CAAC;QAChD,MAAM,CAAC,GAAG,EAAE,kBAAkB,EAAE,+BAA+B,CAAC,CAAC;QAEjE,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;YAC1B,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,+BAA+B;SACzC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEnB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC,CAAC;AAC5E,CAAC,CAAC;AAEF,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
|
+
{"version":3,"file":"multer.middleware.js","sourceRoot":"","sources":["../../../src/js/middleware/multer.middleware.ts"],"names":[],"mappings":"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"}
|
|
@@ -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 @@
|
|
|
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 @@
|
|
|
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;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=Collection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Collection.d.ts","sourceRoot":"","sources":["../../../src/js/types/Collection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,MAAM,OAAO,GAAG,cAAc,GAAG,YAAY,GAAG,YAAY,GAAG,cAAc,CAAC;AAKpF,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,cAAc,GAAG,eAAe,GAAG,QAAQ,CAAC;AAC7E,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAC9D,MAAM,MAAM,QAAQ,GAAG,aAAa,GAAG,KAAK,CAAC;AAG7C,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,QAAQ,EAAE,QAAQ,CAAC;IAEnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAErB,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB;AAED,MAAM,MAAM,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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"Routepath.js","sourceRoot":"","sources":["../../../src/js/types/Routepath.ts"],"names":[],"mappings":""}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"StoreFile.js","sourceRoot":"","sources":["../../../src/js/types/StoreFile.ts"],"names":[],"mappings":""}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"ValidationsObj.js","sourceRoot":"","sources":["../../../src/js/types/ValidationsObj.ts"],"names":[],"mappings":""}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"authHandlers.js","sourceRoot":"","sources":["../../../src/js/types/authHandlers.ts"],"names":[],"mappings":""}
|
|
@@ -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 @@
|
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"email.js","sourceRoot":"","sources":["../../../src/js/types/email.ts"],"names":[],"mappings":""}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"healthHandlers.js","sourceRoot":"","sources":["../../../src/js/types/healthHandlers.ts"],"names":[],"mappings":""}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../../src/js/types/upload.ts"],"names":[],"mappings":""}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"uploadFile.js","sourceRoot":"","sources":["../../../src/js/types/uploadFile.ts"],"names":[],"mappings":""}
|