@eeplatform/basic-edu 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.changeset/README.md +8 -0
- package/.changeset/config.json +11 -0
- package/.github/workflows/main.yml +17 -0
- package/.github/workflows/publish.yml +39 -0
- package/CHANGELOG.md +7 -0
- package/dist/index.d.ts +134 -0
- package/dist/index.js +1405 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1384 -0
- package/dist/index.mjs.map +1 -0
- package/dist/public/handlebars/forget-password.hbs +14 -0
- package/dist/public/handlebars/member-invite.hbs +17 -0
- package/dist/public/handlebars/sign-up.hbs +14 -0
- package/dist/public/handlebars/user-invite.hbs +13 -0
- package/package.json +31 -0
- package/tsconfig.json +108 -0
- package/tsup.config.ts +10 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/models/region.model.ts","../src/repositories/region.repository.ts","../src/controllers/region.controller.ts","../src/models/division.model.ts","../src/repositories/division.repository.ts","../src/controllers/division.controller.ts","../src/models/school.model.ts","../src/repositories/school.repository.ts","../src/controllers/school.controller.ts"],"sourcesContent":["import { BadRequestError } from \"@eeplatform/nodejs-utils\";\nimport Joi from \"joi\";\nimport { ObjectId } from \"mongodb\";\n\nexport type TRegion = {\n _id?: ObjectId;\n name?: string;\n director?: ObjectId;\n directorName?: string;\n createdAt?: string;\n updatedAt?: string;\n deletedAt?: string;\n};\n\nexport const schemaRegion = Joi.object({\n _id: Joi.string().hex().optional().allow(null, \"\"),\n name: Joi.string().min(1).max(100).required(),\n createdAt: Joi.string().isoDate().optional(),\n updatedAt: Joi.string().isoDate().optional(),\n deletedAt: Joi.string().isoDate().optional().allow(null, \"\"),\n});\n\nexport function modelRegion(value: TRegion): TRegion {\n const { error } = schemaRegion.validate(value);\n if (error) {\n throw new BadRequestError(`Invalid region data: ${error.message}`);\n }\n\n if (value._id && typeof value._id === \"string\") {\n try {\n value._id = ObjectId.createFromTime(value._id);\n } catch (error) {\n throw new Error(\"Invalid _id.\");\n }\n }\n\n return {\n _id: value._id,\n name: value.name,\n createdAt: value.createdAt ?? new Date().toISOString(),\n updatedAt: value.updatedAt ?? \"\",\n deletedAt: value.deletedAt ?? \"\",\n };\n}\n","import {\n AppError,\n BadRequestError,\n InternalServerError,\n logger,\n makeCacheKey,\n paginate,\n useAtlas,\n useCache,\n} from \"@eeplatform/nodejs-utils\";\nimport { modelRegion, TRegion } from \"../models/region.model\";\nimport { ClientSession, ObjectId } from \"mongodb\";\n\nexport function useRegionRepo() {\n const db = useAtlas.getDb();\n if (!db) {\n throw new Error(\"Unable to connect to server.\");\n }\n\n const namespace_collection = \"deped.regions\";\n\n const collection = db.collection(namespace_collection);\n\n const { getCache, setCache, delNamespace } = useCache(namespace_collection);\n\n async function createIndexes() {\n try {\n await collection.createIndexes([\n { key: { name: 1 } },\n { key: { createdAt: 1 } },\n { key: { name: \"text\" } },\n { key: { name: 1 }, unique: true, name: \"unique_name\" },\n ]);\n } catch (error) {\n throw new Error(\"Failed to create index on regions.\");\n }\n }\n\n function delCachedData() {\n delNamespace()\n .then(() => {\n logger.log({\n level: \"info\",\n message: `Cache namespace cleared for ${namespace_collection}`,\n });\n })\n .catch((err) => {\n logger.log({\n level: \"error\",\n message: `Failed to clear cache namespace for ${namespace_collection}: ${err.message}`,\n });\n });\n }\n\n async function add(value: TRegion, session?: ClientSession) {\n try {\n value = modelRegion(value);\n const res = await collection.insertOne(value, { session });\n delCachedData();\n return res.insertedId;\n } catch (error: any) {\n logger.log({\n level: \"error\",\n message: error.message,\n });\n if (error instanceof AppError) {\n throw error;\n } else {\n const isDuplicated = error.message.includes(\"duplicate\");\n\n if (isDuplicated) {\n throw new BadRequestError(\"Region already exists.\");\n }\n\n throw new Error(\"Failed to create region.\");\n }\n }\n }\n\n async function getAll({\n search = \"\",\n page = 1,\n limit = 10,\n sort = {},\n status = \"active\",\n } = {}) {\n page = page > 0 ? page - 1 : 0;\n\n const query: Record<string, any> = {\n deletedAt: { $in: [\"\", null] },\n status,\n };\n\n sort = Object.keys(sort).length > 0 ? sort : { _id: 1 };\n\n const cacheKeyOptions: Record<string, any> = {\n status,\n page,\n limit,\n sort: JSON.stringify(sort),\n };\n\n if (search) {\n query.$text = { $search: search };\n cacheKeyOptions.search = search;\n }\n\n const cacheKey = makeCacheKey(namespace_collection, cacheKeyOptions);\n\n logger.log({\n level: \"info\",\n message: `Cache key for getAll regions: ${cacheKey}`,\n });\n\n try {\n const cached = await getCache<Record<string, any>>(cacheKey);\n if (cached) {\n logger.log({\n level: \"info\",\n message: `Cache hit for getAll regions: ${cacheKey}`,\n });\n return cached;\n }\n\n const items = await collection\n .aggregate([\n { $match: query },\n { $sort: sort },\n { $skip: page * limit },\n { $limit: limit },\n ])\n .toArray();\n const length = await collection.countDocuments(query);\n\n const data = paginate(items, page, limit, length);\n\n setCache(cacheKey, data, 600)\n .then(() => {\n logger.log({\n level: \"info\",\n message: `Cache set for getAll regions: ${cacheKey}`,\n });\n })\n .catch((err) => {\n logger.log({\n level: \"error\",\n message: `Failed to set cache for getAll regions: ${err.message}`,\n });\n });\n\n return data;\n } catch (error) {\n logger.log({ level: \"error\", message: `${error}` });\n throw error;\n }\n }\n\n async function getById(_id: string | ObjectId) {\n try {\n _id = new ObjectId(_id);\n } catch (error) {\n throw new BadRequestError(\"Invalid ID.\");\n }\n\n const cacheKey = makeCacheKey(namespace_collection, { _id: String(_id) });\n\n try {\n const cached = await getCache<TRegion>(cacheKey);\n if (cached) {\n logger.log({\n level: \"info\",\n message: `Cache hit for getById region: ${cacheKey}`,\n });\n return cached;\n }\n\n const result = await collection.findOne<TRegion>({\n _id,\n deletedAt: { $in: [\"\", null] },\n });\n if (!result) {\n throw new BadRequestError(\"Region not found.\");\n }\n\n setCache(cacheKey, result, 300)\n .then(() => {\n logger.log({\n level: \"info\",\n message: `Cache set for region by id: ${cacheKey}`,\n });\n })\n .catch((err) => {\n logger.log({\n level: \"error\",\n message: `Failed to set cache for region by id: ${err.message}`,\n });\n });\n\n return result;\n } catch (error) {\n if (error instanceof AppError) {\n throw error;\n } else {\n throw new InternalServerError(\"Failed to get region.\");\n }\n }\n }\n\n async function getByName(name: string) {\n const cacheKey = makeCacheKey(namespace_collection, { name });\n\n try {\n const cached = await getCache<TRegion>(cacheKey);\n if (cached) {\n logger.log({\n level: \"info\",\n message: `Cache hit for getByName region: ${cacheKey}`,\n });\n return cached;\n }\n\n const result = await collection.findOne<TRegion>({\n name,\n deletedAt: { $in: [\"\", null] },\n });\n if (!result) {\n throw new BadRequestError(\"Region not found.\");\n }\n\n setCache(cacheKey, result, 300)\n .then(() => {\n logger.log({\n level: \"info\",\n message: `Cache set for region by name: ${cacheKey}`,\n });\n })\n .catch((err) => {\n logger.log({\n level: \"error\",\n message: `Failed to set cache for region by name: ${err.message}`,\n });\n });\n\n return result;\n } catch (error) {\n if (error instanceof AppError) {\n throw error;\n } else {\n throw new InternalServerError(\"Failed to get region.\");\n }\n }\n }\n\n async function updateFieldById(\n { _id, field, value } = {} as {\n _id: string | ObjectId;\n field: string;\n value: string;\n },\n session?: ClientSession\n ) {\n // Allowed fields to prevent arbitrary updates\n const allowedFields = [\"name\"];\n\n if (!allowedFields.includes(field)) {\n throw new BadRequestError(\n `Field \"${field}\" is not allowed to be updated.`\n );\n }\n\n // Validate ID\n try {\n _id = new ObjectId(_id);\n } catch (error) {\n throw new BadRequestError(\"Invalid ID.\");\n }\n\n try {\n await collection.updateOne(\n { _id, deletedAt: { $in: [\"\", null] } },\n { $set: { [field]: value, updatedAt: new Date().toISOString() } },\n { session }\n );\n\n delCachedData();\n\n return `Successfully updated region ${field}.`;\n } catch (error) {\n throw new InternalServerError(`Failed to update region ${field}.`);\n }\n }\n\n async function deleteById(_id: string | ObjectId) {\n try {\n _id = new ObjectId(_id);\n } catch (error) {\n throw new BadRequestError(\"Invalid ID.\");\n }\n\n try {\n await collection.updateOne(\n { _id },\n { $set: { deletedAt: new Date().toISOString() } }\n );\n delCachedData();\n return \"Successfully deleted region.\";\n } catch (error) {\n throw new InternalServerError(\"Failed to delete region.\");\n }\n }\n\n return {\n createIndexes,\n add,\n getAll,\n getById,\n updateFieldById,\n deleteById,\n getByName,\n };\n}\n","import { Request, Response, NextFunction } from \"express\";\nimport { BadRequestError } from \"@eeplatform/nodejs-utils\";\nimport Joi from \"joi\";\nimport { useRegionRepo } from \"../repositories/region.repository\";\nimport { schemaRegion } from \"../models/region.model\";\n\nexport function useRegionController() {\n const {\n add: _add,\n getAll: _getAll,\n getById: _getById,\n getByName: _getByName,\n updateFieldById: _updateFieldById,\n deleteById: _deleteById,\n } = useRegionRepo();\n\n async function add(req: Request, res: Response, next: NextFunction) {\n const value = req.body;\n\n const { error } = schemaRegion.validate(value);\n\n if (error) {\n next(new BadRequestError(error.message));\n return;\n }\n\n try {\n const data = await _add(value);\n res.json({\n message: \"Successfully created region.\",\n data,\n });\n return;\n } catch (error) {\n next(error);\n }\n }\n\n async function getAll(req: Request, res: Response, next: NextFunction) {\n const query = req.query;\n\n const validation = Joi.object({\n page: Joi.number().min(1).optional().allow(\"\", null),\n limit: Joi.number().min(1).optional().allow(\"\", null),\n search: Joi.string().optional().allow(\"\", null),\n status: Joi.string().optional().allow(\"\", null),\n });\n\n const { error } = validation.validate(query);\n\n const page =\n typeof req.query.page === \"string\" ? Number(req.query.page) : 1;\n const limit =\n typeof req.query.limit === \"string\" ? Number(req.query.limit) : 10;\n const search = (req.query.search as string) ?? \"\";\n const status = (req.query.status as string) ?? \"active\";\n\n const isPageNumber = isFinite(page);\n if (!isPageNumber) {\n next(new BadRequestError(\"Invalid page number.\"));\n return;\n }\n\n const isLimitNumber = isFinite(limit);\n\n if (!isLimitNumber) {\n next(new BadRequestError(\"Invalid limit number.\"));\n return;\n }\n\n if (error) {\n next(new BadRequestError(error.message));\n return;\n }\n\n try {\n const data = await _getAll({ page, limit, search, status });\n res.json(data);\n return;\n } catch (error) {\n next(error);\n }\n }\n\n async function getById(req: Request, res: Response, next: NextFunction) {\n const id = req.params.id;\n\n const validation = Joi.object({\n id: Joi.string().hex().required(),\n });\n\n const { error } = validation.validate({ id });\n\n if (error) {\n next(new BadRequestError(error.message));\n return;\n }\n\n try {\n const data = await _getById(id);\n res.json({\n message: \"Successfully retrieved region.\",\n data,\n });\n return;\n } catch (error) {\n next(error);\n }\n }\n\n async function getByName(req: Request, res: Response, next: NextFunction) {\n const name = req.params.name;\n\n const validation = Joi.object({\n name: Joi.string().required(),\n });\n\n const { error } = validation.validate({ name });\n\n if (error) {\n next(new BadRequestError(error.message));\n return;\n }\n\n try {\n const data = await _getByName(name);\n res.json({\n message: \"Successfully retrieved region.\",\n data,\n });\n return;\n } catch (error) {\n next(error);\n }\n }\n\n async function updateField(req: Request, res: Response, next: NextFunction) {\n const _id = req.params.id;\n const { field, value } = req.body;\n\n const validation = Joi.object({\n _id: Joi.string().hex().required(),\n field: Joi.string().valid(\"name\", \"director\", \"directorName\").required(),\n value: Joi.string().required(),\n });\n\n const { error } = validation.validate({ _id, field, value });\n\n if (error) {\n next(new BadRequestError(error.message));\n return;\n }\n\n try {\n const message = await _updateFieldById({ _id, field, value });\n res.json({ message });\n return;\n } catch (error) {\n next(error);\n }\n }\n\n async function deleteById(req: Request, res: Response, next: NextFunction) {\n const _id = req.params.id;\n\n const validation = Joi.object({\n _id: Joi.string().hex().required(),\n });\n\n const { error } = validation.validate({ _id });\n\n if (error) {\n next(new BadRequestError(error.message));\n return;\n }\n\n try {\n const message = await _deleteById(_id);\n res.json({ message });\n return;\n } catch (error) {\n next(error);\n }\n }\n\n return {\n add,\n getAll,\n getById,\n getByName,\n updateField,\n deleteById,\n };\n}\n","import { BadRequestError } from \"@eeplatform/nodejs-utils\";\nimport Joi from \"joi\";\nimport { ObjectId } from \"mongodb\";\n\nexport type TDivision = {\n _id?: ObjectId;\n name?: string;\n region?: ObjectId;\n regionName?: string;\n superintendent?: ObjectId;\n superintendentName?: string;\n createdAt?: string;\n updatedAt?: string;\n deletedAt?: string;\n};\n\nexport const schemaDivision = Joi.object({\n _id: Joi.string().hex().optional().allow(null, \"\"),\n name: Joi.string().min(1).max(100).required(),\n region: Joi.string().hex().optional().allow(null, \"\"),\n regionName: Joi.string().min(1).max(100).optional().allow(null, \"\"),\n superintendent: Joi.string().hex().optional().allow(null, \"\"),\n superintendentName: Joi.string().min(1).max(100).optional().allow(null, \"\"),\n createdAt: Joi.string().isoDate().optional(),\n updatedAt: Joi.string().isoDate().optional(),\n deletedAt: Joi.string().isoDate().optional().allow(null, \"\"),\n});\n\nexport function modelDivision(value: TDivision): TDivision {\n const { error } = schemaDivision.validate(value);\n if (error) {\n throw new BadRequestError(`Invalid sdo data: ${error.message}`);\n }\n\n if (value._id && typeof value._id === \"string\") {\n try {\n value._id = ObjectId.createFromTime(value._id);\n } catch (error) {\n throw new Error(\"Invalid _id.\");\n }\n }\n\n return {\n _id: value._id,\n name: value.name,\n region: value.region,\n regionName: value.regionName ?? \"\",\n superintendent: value.superintendent,\n superintendentName: value.superintendentName ?? \"\",\n createdAt: value.createdAt ?? new Date().toISOString(),\n updatedAt: value.updatedAt ?? \"\",\n deletedAt: value.deletedAt ?? \"\",\n };\n}\n","import {\n AppError,\n BadRequestError,\n InternalServerError,\n logger,\n makeCacheKey,\n paginate,\n useAtlas,\n useCache,\n} from \"@eeplatform/nodejs-utils\";\nimport { modelDivision, TDivision } from \"../models/division.model\";\nimport { ClientSession, ObjectId } from \"mongodb\";\n\nexport function useDivisionRepo() {\n const db = useAtlas.getDb();\n if (!db) {\n throw new Error(\"Unable to connect to server.\");\n }\n\n const namespace_collection = \"deped.divisions\";\n\n const collection = db.collection(namespace_collection);\n\n const { getCache, setCache, delNamespace } = useCache(namespace_collection);\n\n async function createIndexes() {\n try {\n await collection.createIndexes([\n { key: { name: 1 } },\n { key: { createdAt: 1 } },\n { key: { name: \"text\" } },\n { key: { name: 1 }, unique: true, name: \"unique_name\" },\n ]);\n } catch (error) {\n throw new Error(\"Failed to create index on divisions.\");\n }\n }\n\n function delCachedData() {\n delNamespace()\n .then(() => {\n logger.log({\n level: \"info\",\n message: `Cache namespace cleared for ${namespace_collection}`,\n });\n })\n .catch((err) => {\n logger.log({\n level: \"error\",\n message: `Failed to clear cache namespace for ${namespace_collection}: ${err.message}`,\n });\n });\n }\n\n async function add(value: TDivision, session?: ClientSession) {\n try {\n value = modelDivision(value);\n const res = await collection.insertOne(value, { session });\n delCachedData();\n return res.insertedId;\n } catch (error: any) {\n logger.log({\n level: \"error\",\n message: error.message,\n });\n if (error instanceof AppError) {\n throw error;\n } else {\n const isDuplicated = error.message.includes(\"duplicate\");\n\n if (isDuplicated) {\n throw new BadRequestError(\"Division already exists.\");\n }\n\n throw new Error(\"Failed to create division.\");\n }\n }\n }\n\n async function getAll({\n search = \"\",\n page = 1,\n limit = 10,\n sort = {},\n status = \"active\",\n } = {}) {\n page = page > 0 ? page - 1 : 0;\n\n const query: Record<string, any> = {\n deletedAt: { $in: [\"\", null] },\n status,\n };\n\n sort = Object.keys(sort).length > 0 ? sort : { _id: 1 };\n\n const cacheKeyOptions: Record<string, any> = {\n status,\n page,\n limit,\n sort: JSON.stringify(sort),\n };\n\n if (search) {\n query.$text = { $search: search };\n cacheKeyOptions.search = search;\n }\n\n const cacheKey = makeCacheKey(namespace_collection, cacheKeyOptions);\n\n logger.log({\n level: \"info\",\n message: `Cache key for getAll divisions: ${cacheKey}`,\n });\n\n try {\n const cached = await getCache<Record<string, any>>(cacheKey);\n if (cached) {\n logger.log({\n level: \"info\",\n message: `Cache hit for getAll divisions: ${cacheKey}`,\n });\n return cached;\n }\n\n const items = await collection\n .aggregate([\n { $match: query },\n { $sort: sort },\n { $skip: page * limit },\n { $limit: limit },\n ])\n .toArray();\n const length = await collection.countDocuments(query);\n\n const data = paginate(items, page, limit, length);\n\n setCache(cacheKey, data, 600)\n .then(() => {\n logger.log({\n level: \"info\",\n message: `Cache set for getAll divisions: ${cacheKey}`,\n });\n })\n .catch((err) => {\n logger.log({\n level: \"error\",\n message: `Failed to set cache for getAll divisions: ${err.message}`,\n });\n });\n\n return data;\n } catch (error) {\n logger.log({ level: \"error\", message: `${error}` });\n throw error;\n }\n }\n\n async function getById(_id: string | ObjectId) {\n try {\n _id = new ObjectId(_id);\n } catch (error) {\n throw new BadRequestError(\"Invalid ID.\");\n }\n\n const cacheKey = makeCacheKey(namespace_collection, { _id: String(_id) });\n\n try {\n const cached = await getCache<TDivision>(cacheKey);\n if (cached) {\n logger.log({\n level: \"info\",\n message: `Cache hit for getById division: ${cacheKey}`,\n });\n return cached;\n }\n\n const result = await collection.findOne<TDivision>({\n _id,\n deletedAt: { $in: [\"\", null] },\n });\n if (!result) {\n throw new BadRequestError(\"Division not found.\");\n }\n\n setCache(cacheKey, result, 300)\n .then(() => {\n logger.log({\n level: \"info\",\n message: `Cache set for division by id: ${cacheKey}`,\n });\n })\n .catch((err) => {\n logger.log({\n level: \"error\",\n message: `Failed to set cache for division by id: ${err.message}`,\n });\n });\n\n return result;\n } catch (error) {\n if (error instanceof AppError) {\n throw error;\n } else {\n throw new InternalServerError(\"Failed to get division.\");\n }\n }\n }\n\n async function getByName(name: string) {\n const cacheKey = makeCacheKey(namespace_collection, { name });\n\n try {\n const cached = await getCache<TDivision>(cacheKey);\n if (cached) {\n logger.log({\n level: \"info\",\n message: `Cache hit for getByName division: ${cacheKey}`,\n });\n return cached;\n }\n\n const result = await collection.findOne<TDivision>({\n name,\n deletedAt: { $in: [\"\", null] },\n });\n if (!result) {\n throw new BadRequestError(\"Division not found.\");\n }\n\n setCache(cacheKey, result, 300)\n .then(() => {\n logger.log({\n level: \"info\",\n message: `Cache set for division by name: ${cacheKey}`,\n });\n })\n .catch((err) => {\n logger.log({\n level: \"error\",\n message: `Failed to set cache for division by name: ${err.message}`,\n });\n });\n\n return result;\n } catch (error) {\n if (error instanceof AppError) {\n throw error;\n } else {\n throw new InternalServerError(\"Failed to get division.\");\n }\n }\n }\n\n async function updateFieldById(\n { _id, field, value } = {} as {\n _id: string | ObjectId;\n field: string;\n value: string;\n },\n session?: ClientSession\n ) {\n // Allowed fields to prevent arbitrary updates\n const allowedFields = [\"name\"];\n\n if (!allowedFields.includes(field)) {\n throw new BadRequestError(\n `Field \"${field}\" is not allowed to be updated.`\n );\n }\n\n // Validate ID\n try {\n _id = new ObjectId(_id);\n } catch (error) {\n throw new BadRequestError(\"Invalid ID.\");\n }\n\n try {\n await collection.updateOne(\n { _id, deletedAt: { $in: [\"\", null] } },\n { $set: { [field]: value, updatedAt: new Date().toISOString() } },\n { session }\n );\n\n delCachedData();\n\n return `Successfully updated division ${field}.`;\n } catch (error) {\n throw new InternalServerError(`Failed to update division ${field}.`);\n }\n }\n\n async function deleteById(_id: string | ObjectId) {\n try {\n _id = new ObjectId(_id);\n } catch (error) {\n throw new BadRequestError(\"Invalid ID.\");\n }\n\n try {\n await collection.updateOne(\n { _id },\n { $set: { deletedAt: new Date().toISOString() } }\n );\n delCachedData();\n return \"Successfully deleted division.\";\n } catch (error) {\n throw new InternalServerError(\"Failed to delete division.\");\n }\n }\n\n return {\n createIndexes,\n add,\n getAll,\n getById,\n updateFieldById,\n deleteById,\n getByName,\n };\n}\n","import { Request, Response, NextFunction } from \"express\";\nimport { BadRequestError } from \"@eeplatform/nodejs-utils\";\nimport Joi from \"joi\";\nimport { useDivisionRepo } from \"../repositories/division.repository\";\nimport { schemaDivision } from \"../models/division.model\";\n\nexport function useDivisionController() {\n const {\n add: _add,\n getAll: _getAll,\n getById: _getById,\n getByName: _getByName,\n updateFieldById: _updateFieldById,\n deleteById: _deleteById,\n } = useDivisionRepo();\n\n async function add(req: Request, res: Response, next: NextFunction) {\n const value = req.body;\n\n const { error } = schemaDivision.validate(value);\n\n if (error) {\n next(new BadRequestError(error.message));\n return;\n }\n\n try {\n const data = await _add(value);\n res.json({\n message: \"Successfully created division.\",\n data,\n });\n return;\n } catch (error) {\n next(error);\n }\n }\n\n async function getAll(req: Request, res: Response, next: NextFunction) {\n const query = req.query;\n\n const validation = Joi.object({\n page: Joi.number().min(1).optional().allow(\"\", null),\n limit: Joi.number().min(1).optional().allow(\"\", null),\n search: Joi.string().optional().allow(\"\", null),\n status: Joi.string().optional().allow(\"\", null),\n });\n\n const { error } = validation.validate(query);\n\n const page =\n typeof req.query.page === \"string\" ? Number(req.query.page) : 1;\n const limit =\n typeof req.query.limit === \"string\" ? Number(req.query.limit) : 10;\n const search = (req.query.search as string) ?? \"\";\n const status = (req.query.status as string) ?? \"active\";\n\n const isPageNumber = isFinite(page);\n if (!isPageNumber) {\n next(new BadRequestError(\"Invalid page number.\"));\n return;\n }\n\n const isLimitNumber = isFinite(limit);\n\n if (!isLimitNumber) {\n next(new BadRequestError(\"Invalid limit number.\"));\n return;\n }\n\n if (error) {\n next(new BadRequestError(error.message));\n return;\n }\n\n try {\n const data = await _getAll({ page, limit, search, status });\n res.json(data);\n return;\n } catch (error) {\n next(error);\n }\n }\n\n async function getById(req: Request, res: Response, next: NextFunction) {\n const id = req.params.id;\n\n const validation = Joi.object({\n id: Joi.string().hex().required(),\n });\n\n const { error } = validation.validate({ id });\n\n if (error) {\n next(new BadRequestError(error.message));\n return;\n }\n\n try {\n const data = await _getById(id);\n res.json({\n message: \"Successfully retrieved division.\",\n data,\n });\n return;\n } catch (error) {\n next(error);\n }\n }\n\n async function getByName(req: Request, res: Response, next: NextFunction) {\n const name = req.params.name;\n\n const validation = Joi.object({\n name: Joi.string().required(),\n });\n\n const { error } = validation.validate({ name });\n\n if (error) {\n next(new BadRequestError(error.message));\n return;\n }\n\n try {\n const data = await _getByName(name);\n res.json({\n message: \"Successfully retrieved division.\",\n data,\n });\n return;\n } catch (error) {\n next(error);\n }\n }\n\n async function updateField(req: Request, res: Response, next: NextFunction) {\n const _id = req.params.id;\n const { field, value } = req.body;\n\n const validation = Joi.object({\n _id: Joi.string().hex().required(),\n field: Joi.string().valid(\"name\", \"director\", \"directorName\").required(),\n value: Joi.string().required(),\n });\n\n const { error } = validation.validate({ _id, field, value });\n\n if (error) {\n next(new BadRequestError(error.message));\n return;\n }\n\n try {\n const message = await _updateFieldById({ _id, field, value });\n res.json({ message });\n return;\n } catch (error) {\n next(error);\n }\n }\n\n async function deleteById(req: Request, res: Response, next: NextFunction) {\n const _id = req.params.id;\n\n const validation = Joi.object({\n _id: Joi.string().hex().required(),\n });\n\n const { error } = validation.validate({ _id });\n\n if (error) {\n next(new BadRequestError(error.message));\n return;\n }\n\n try {\n const message = await _deleteById(_id);\n res.json({ message });\n return;\n } catch (error) {\n next(error);\n }\n }\n\n return {\n add,\n getAll,\n getById,\n getByName,\n updateField,\n deleteById,\n };\n}\n","import { BadRequestError } from \"@eeplatform/nodejs-utils\";\nimport Joi from \"joi\";\nimport { ObjectId } from \"mongodb\";\n\nexport type TSchool = {\n _id?: ObjectId;\n name?: string;\n region?: ObjectId;\n regionName?: string;\n division?: ObjectId;\n divisionName?: string;\n principal?: ObjectId;\n principalName?: string;\n createdAt?: string;\n updatedAt?: string;\n deletedAt?: string;\n};\n\nexport const schemaSchool = Joi.object({\n _id: Joi.string().hex().optional().allow(null, \"\"),\n name: Joi.string().min(1).max(100).required(),\n region: Joi.string().hex().optional().allow(null, \"\"),\n regionName: Joi.string().min(1).max(100).optional().allow(null, \"\"),\n division: Joi.string().hex().optional().allow(null, \"\"),\n divisionName: Joi.string().min(1).max(100).optional().allow(null, \"\"),\n principal: Joi.string().hex().optional().allow(null, \"\"),\n principalName: Joi.string().min(1).max(100).optional().allow(null, \"\"),\n createdAt: Joi.string().isoDate().optional(),\n updatedAt: Joi.string().isoDate().optional(),\n deletedAt: Joi.string().isoDate().optional().allow(null, \"\"),\n});\n\nexport function modelSchool(value: TSchool): TSchool {\n const { error } = schemaSchool.validate(value);\n if (error) {\n throw new BadRequestError(`Invalid sdo data: ${error.message}`);\n }\n\n if (value._id && typeof value._id === \"string\") {\n try {\n value._id = ObjectId.createFromTime(value._id);\n } catch (error) {\n throw new Error(\"Invalid _id.\");\n }\n }\n\n return {\n _id: value._id,\n name: value.name,\n region: value.region,\n regionName: value.regionName ?? \"\",\n division: value.division,\n divisionName: value.divisionName ?? \"\",\n principal: value.principal,\n principalName: value.principalName ?? \"\",\n createdAt: value.createdAt ?? new Date().toISOString(),\n updatedAt: value.updatedAt ?? \"\",\n deletedAt: value.deletedAt ?? \"\",\n };\n}\n","import {\n AppError,\n BadRequestError,\n InternalServerError,\n logger,\n makeCacheKey,\n paginate,\n useAtlas,\n useCache,\n} from \"@eeplatform/nodejs-utils\";\nimport { modelSchool, TSchool } from \"../models/school.model\";\nimport { ClientSession, ObjectId } from \"mongodb\";\n\nexport function useSchoolRepo() {\n const db = useAtlas.getDb();\n if (!db) {\n throw new Error(\"Unable to connect to server.\");\n }\n\n const namespace_collection = \"deped.schools\";\n\n const collection = db.collection(namespace_collection);\n\n const { getCache, setCache, delNamespace } = useCache(namespace_collection);\n\n async function createIndexes() {\n try {\n await collection.createIndexes([\n { key: { name: 1 } },\n { key: { createdAt: 1 } },\n { key: { name: \"text\" } },\n { key: { name: 1 }, unique: true, name: \"unique_name\" },\n ]);\n } catch (error) {\n throw new Error(\"Failed to create index on schools.\");\n }\n }\n\n function delCachedData() {\n delNamespace()\n .then(() => {\n logger.log({\n level: \"info\",\n message: `Cache namespace cleared for ${namespace_collection}`,\n });\n })\n .catch((err) => {\n logger.log({\n level: \"error\",\n message: `Failed to clear cache namespace for ${namespace_collection}: ${err.message}`,\n });\n });\n }\n\n async function add(value: TSchool, session?: ClientSession) {\n try {\n value = modelSchool(value);\n const res = await collection.insertOne(value, { session });\n delCachedData();\n return res.insertedId;\n } catch (error: any) {\n logger.log({\n level: \"error\",\n message: error.message,\n });\n if (error instanceof AppError) {\n throw error;\n } else {\n const isDuplicated = error.message.includes(\"duplicate\");\n\n if (isDuplicated) {\n throw new BadRequestError(\"School already exists.\");\n }\n\n throw new Error(\"Failed to create school.\");\n }\n }\n }\n\n async function getAll({\n search = \"\",\n page = 1,\n limit = 10,\n sort = {},\n status = \"active\",\n } = {}) {\n page = page > 0 ? page - 1 : 0;\n\n const query: Record<string, any> = {\n deletedAt: { $in: [\"\", null] },\n status,\n };\n\n sort = Object.keys(sort).length > 0 ? sort : { _id: 1 };\n\n const cacheKeyOptions: Record<string, any> = {\n status,\n page,\n limit,\n sort: JSON.stringify(sort),\n };\n\n if (search) {\n query.$text = { $search: search };\n cacheKeyOptions.search = search;\n }\n\n const cacheKey = makeCacheKey(namespace_collection, cacheKeyOptions);\n\n logger.log({\n level: \"info\",\n message: `Cache key for getAll schools: ${cacheKey}`,\n });\n\n try {\n const cached = await getCache<Record<string, any>>(cacheKey);\n if (cached) {\n logger.log({\n level: \"info\",\n message: `Cache hit for getAll schools: ${cacheKey}`,\n });\n return cached;\n }\n\n const items = await collection\n .aggregate([\n { $match: query },\n { $sort: sort },\n { $skip: page * limit },\n { $limit: limit },\n ])\n .toArray();\n const length = await collection.countDocuments(query);\n\n const data = paginate(items, page, limit, length);\n\n setCache(cacheKey, data, 600)\n .then(() => {\n logger.log({\n level: \"info\",\n message: `Cache set for getAll schools: ${cacheKey}`,\n });\n })\n .catch((err) => {\n logger.log({\n level: \"error\",\n message: `Failed to set cache for getAll schools: ${err.message}`,\n });\n });\n\n return data;\n } catch (error) {\n logger.log({ level: \"error\", message: `${error}` });\n throw error;\n }\n }\n\n async function getById(_id: string | ObjectId) {\n try {\n _id = new ObjectId(_id);\n } catch (error) {\n throw new BadRequestError(\"Invalid ID.\");\n }\n\n const cacheKey = makeCacheKey(namespace_collection, { _id: String(_id) });\n\n try {\n const cached = await getCache<TSchool>(cacheKey);\n if (cached) {\n logger.log({\n level: \"info\",\n message: `Cache hit for getById school: ${cacheKey}`,\n });\n return cached;\n }\n\n const result = await collection.findOne<TSchool>({\n _id,\n deletedAt: { $in: [\"\", null] },\n });\n if (!result) {\n throw new BadRequestError(\"School not found.\");\n }\n\n setCache(cacheKey, result, 300)\n .then(() => {\n logger.log({\n level: \"info\",\n message: `Cache set for school by id: ${cacheKey}`,\n });\n })\n .catch((err) => {\n logger.log({\n level: \"error\",\n message: `Failed to set cache for school by id: ${err.message}`,\n });\n });\n\n return result;\n } catch (error) {\n if (error instanceof AppError) {\n throw error;\n } else {\n throw new InternalServerError(\"Failed to get school.\");\n }\n }\n }\n\n async function getByName(name: string) {\n const cacheKey = makeCacheKey(namespace_collection, { name });\n\n try {\n const cached = await getCache<TSchool>(cacheKey);\n if (cached) {\n logger.log({\n level: \"info\",\n message: `Cache hit for getByName school: ${cacheKey}`,\n });\n return cached;\n }\n\n const result = await collection.findOne<TSchool>({\n name,\n deletedAt: { $in: [\"\", null] },\n });\n if (!result) {\n throw new BadRequestError(\"School not found.\");\n }\n\n setCache(cacheKey, result, 300)\n .then(() => {\n logger.log({\n level: \"info\",\n message: `Cache set for school by name: ${cacheKey}`,\n });\n })\n .catch((err) => {\n logger.log({\n level: \"error\",\n message: `Failed to set cache for school by name: ${err.message}`,\n });\n });\n\n return result;\n } catch (error) {\n if (error instanceof AppError) {\n throw error;\n } else {\n throw new InternalServerError(\"Failed to get school.\");\n }\n }\n }\n\n async function updateFieldById(\n { _id, field, value } = {} as {\n _id: string | ObjectId;\n field: string;\n value: string;\n },\n session?: ClientSession\n ) {\n // Allowed fields to prevent arbitrary updates\n const allowedFields = [\"name\"];\n\n if (!allowedFields.includes(field)) {\n throw new BadRequestError(\n `Field \"${field}\" is not allowed to be updated.`\n );\n }\n\n // Validate ID\n try {\n _id = new ObjectId(_id);\n } catch (error) {\n throw new BadRequestError(\"Invalid ID.\");\n }\n\n try {\n await collection.updateOne(\n { _id, deletedAt: { $in: [\"\", null] } },\n { $set: { [field]: value, updatedAt: new Date().toISOString() } },\n { session }\n );\n\n delCachedData();\n\n return `Successfully updated school ${field}.`;\n } catch (error) {\n throw new InternalServerError(`Failed to update school ${field}.`);\n }\n }\n\n async function deleteById(_id: string | ObjectId) {\n try {\n _id = new ObjectId(_id);\n } catch (error) {\n throw new BadRequestError(\"Invalid ID.\");\n }\n\n try {\n await collection.updateOne(\n { _id },\n { $set: { deletedAt: new Date().toISOString() } }\n );\n delCachedData();\n return \"Successfully deleted school.\";\n } catch (error) {\n throw new InternalServerError(\"Failed to delete school.\");\n }\n }\n\n return {\n createIndexes,\n add,\n getAll,\n getById,\n updateFieldById,\n deleteById,\n getByName,\n };\n}\n","import { Request, Response, NextFunction } from \"express\";\nimport { BadRequestError } from \"@eeplatform/nodejs-utils\";\nimport Joi from \"joi\";\nimport { useSchoolRepo } from \"../repositories/school.repository\";\nimport { schemaSchool } from \"../models/school.model\";\n\nexport function useSchoolController() {\n const {\n add: _add,\n getAll: _getAll,\n getById: _getById,\n getByName: _getByName,\n updateFieldById: _updateFieldById,\n deleteById: _deleteById,\n } = useSchoolRepo();\n\n async function add(req: Request, res: Response, next: NextFunction) {\n const value = req.body;\n\n const { error } = schemaSchool.validate(value);\n\n if (error) {\n next(new BadRequestError(error.message));\n return;\n }\n\n try {\n const data = await _add(value);\n res.json({\n message: \"Successfully created school.\",\n data,\n });\n return;\n } catch (error) {\n next(error);\n }\n }\n\n async function getAll(req: Request, res: Response, next: NextFunction) {\n const query = req.query;\n\n const validation = Joi.object({\n page: Joi.number().min(1).optional().allow(\"\", null),\n limit: Joi.number().min(1).optional().allow(\"\", null),\n search: Joi.string().optional().allow(\"\", null),\n status: Joi.string().optional().allow(\"\", null),\n });\n\n const { error } = validation.validate(query);\n\n const page =\n typeof req.query.page === \"string\" ? Number(req.query.page) : 1;\n const limit =\n typeof req.query.limit === \"string\" ? Number(req.query.limit) : 10;\n const search = (req.query.search as string) ?? \"\";\n const status = (req.query.status as string) ?? \"active\";\n\n const isPageNumber = isFinite(page);\n if (!isPageNumber) {\n next(new BadRequestError(\"Invalid page number.\"));\n return;\n }\n\n const isLimitNumber = isFinite(limit);\n\n if (!isLimitNumber) {\n next(new BadRequestError(\"Invalid limit number.\"));\n return;\n }\n\n if (error) {\n next(new BadRequestError(error.message));\n return;\n }\n\n try {\n const data = await _getAll({ page, limit, search, status });\n res.json(data);\n return;\n } catch (error) {\n next(error);\n }\n }\n\n async function getById(req: Request, res: Response, next: NextFunction) {\n const id = req.params.id;\n\n const validation = Joi.object({\n id: Joi.string().hex().required(),\n });\n\n const { error } = validation.validate({ id });\n\n if (error) {\n next(new BadRequestError(error.message));\n return;\n }\n\n try {\n const data = await _getById(id);\n res.json({\n message: \"Successfully retrieved school.\",\n data,\n });\n return;\n } catch (error) {\n next(error);\n }\n }\n\n async function getByName(req: Request, res: Response, next: NextFunction) {\n const name = req.params.name;\n\n const validation = Joi.object({\n name: Joi.string().required(),\n });\n\n const { error } = validation.validate({ name });\n\n if (error) {\n next(new BadRequestError(error.message));\n return;\n }\n\n try {\n const data = await _getByName(name);\n res.json({\n message: \"Successfully retrieved school.\",\n data,\n });\n return;\n } catch (error) {\n next(error);\n }\n }\n\n async function updateField(req: Request, res: Response, next: NextFunction) {\n const _id = req.params.id;\n const { field, value } = req.body;\n\n const validation = Joi.object({\n _id: Joi.string().hex().required(),\n field: Joi.string().valid(\"name\", \"director\", \"directorName\").required(),\n value: Joi.string().required(),\n });\n\n const { error } = validation.validate({ _id, field, value });\n\n if (error) {\n next(new BadRequestError(error.message));\n return;\n }\n\n try {\n const message = await _updateFieldById({ _id, field, value });\n res.json({ message });\n return;\n } catch (error) {\n next(error);\n }\n }\n\n async function deleteById(req: Request, res: Response, next: NextFunction) {\n const _id = req.params.id;\n\n const validation = Joi.object({\n _id: Joi.string().hex().required(),\n });\n\n const { error } = validation.validate({ _id });\n\n if (error) {\n next(new BadRequestError(error.message));\n return;\n }\n\n try {\n const message = await _deleteById(_id);\n res.json({ message });\n return;\n } catch (error) {\n next(error);\n }\n }\n\n return {\n add,\n getAll,\n getById,\n getByName,\n updateField,\n deleteById,\n };\n}\n"],"mappings":";AAAA,SAAS,uBAAuB;AAChC,OAAO,SAAS;AAChB,SAAS,gBAAgB;AAYlB,IAAM,eAAe,IAAI,OAAO;AAAA,EACrC,KAAK,IAAI,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,MAAM,EAAE;AAAA,EACjD,MAAM,IA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ectId","BadRequestError","BadRequestError","Joi","BadRequestError","error","Joi","BadRequestError","Joi","ObjectId","error","AppError","BadRequestError","InternalServerError","logger","makeCacheKey","paginate","useAtlas","useCache","ObjectId","useAtlas","useCache","logger","AppError","BadRequestError","makeCacheKey","paginate","InternalServerError","BadRequestError","Joi","BadRequestError","error","Joi","BadRequestError","Joi","ObjectId","error","AppError","BadRequestError","InternalServerError","logger","makeCacheKey","paginate","useAtlas","useCache","ObjectId","useAtlas","useCache","logger","AppError","BadRequestError","makeCacheKey","paginate","InternalServerError","BadRequestError","Joi","BadRequestError","error","Joi"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<div style="font-family: Helvetica, Arial, sans-serif; min-width: 1000px; overflow: auto; line-height: 2">
|
|
2
|
+
<div style="margin: 50px auto; width: 70%; padding: 20px 0">
|
|
3
|
+
<div style="border-bottom: 1px solid #eee; font-size: 1.4em; color: #00466a; text-decoration: none; font-weight: 600; text-align: center;">
|
|
4
|
+
Email Verification
|
|
5
|
+
</div>
|
|
6
|
+
<p style="text-align: center;">Click the button below to verify your email and complete the account recovery process. This link is valid for {{validity}}.</p>
|
|
7
|
+
<div style="text-align: center; margin: 20px 0;">
|
|
8
|
+
<a href="{{link}}" target="_blank" style="background: #00466a; color: #fff; padding: 10px 20px; text-decoration: none; border-radius: 5px; display: inline-block;">
|
|
9
|
+
Verify Email
|
|
10
|
+
</a>
|
|
11
|
+
</div>
|
|
12
|
+
<p style="text-align: center;">If you didn't request this, you can safely ignore this email.</p>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<div style="font-family: Helvetica, Arial, sans-serif; min-width: 1000px; overflow: auto; line-height: 2;">
|
|
2
|
+
</div>
|
|
3
|
+
<div style="margin: 50px auto; width: 70%; padding: 20px 0;">
|
|
4
|
+
<div style="border-bottom: 1px solid #eee; font-size: 1.4em; color: #00466a; text-decoration: none; font-weight: 600; text-align: center;">
|
|
5
|
+
Organization Invitation
|
|
6
|
+
</div>
|
|
7
|
+
<p>
|
|
8
|
+
You have been invited to join <strong>{{organization_name}}</strong> on our platform.
|
|
9
|
+
Click the link below to accept the invitation and join the organization. The link is valid for {{validity}}.
|
|
10
|
+
</p>
|
|
11
|
+
<div>
|
|
12
|
+
<a href="{{link}}" target="_blank">{{link}}</a>
|
|
13
|
+
</div>
|
|
14
|
+
<p>
|
|
15
|
+
If you did not expect this email or do not recognize the organization, feel free to ignore it.
|
|
16
|
+
</p>
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<div style="font-family: Helvetica, Arial, sans-serif; min-width: 1000px; overflow: auto; line-height: 2">
|
|
2
|
+
<div style="margin: 50px auto; width: 70%; padding: 20px 0">
|
|
3
|
+
<div style="border-bottom: 1px solid #eee; font-size: 1.4em; color: #00466a; text-decoration: none; font-weight: 600; text-align: center;">
|
|
4
|
+
Welcome to GoWeekdays!
|
|
5
|
+
</div>
|
|
6
|
+
<p>You're just one step away from joining us! Click the link below to create your account. This link is valid for {{validity}}.</p>
|
|
7
|
+
<div style="text-align: center; margin: 20px 0;">
|
|
8
|
+
<a href="{{link}}" target="_blank" style="background: #00466a; color: #fff; padding: 10px 20px; text-decoration: none; border-radius: 5px; display: inline-block;">
|
|
9
|
+
Complete Sign-Up
|
|
10
|
+
</a>
|
|
11
|
+
</div>
|
|
12
|
+
<p>If you didn’t request this, you can safely ignore this email.</p>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<div style="font-family: Helvetica,Arial,sans-serif;min-width:1000px;overflow:auto;line-height:2"></div>
|
|
2
|
+
<div style="margin:50px auto;width:70%;padding:20px 0">
|
|
3
|
+
<div
|
|
4
|
+
style="border-bottom:1px solid #eee; font-size:1.4em;color: #00466a;text-decoration:none;font-weight:600;text-align: center;">
|
|
5
|
+
User Invitation
|
|
6
|
+
</div>
|
|
7
|
+
<p>You have been invited to join our platform. Please use the link below to complete your registration. The link is valid for {{validity}}.</p>
|
|
8
|
+
<div>
|
|
9
|
+
<a href="{{link}}" target="_blank">{{link}}</a>
|
|
10
|
+
</div>
|
|
11
|
+
<p>If you did not expect this email, please ignore it.</p>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@eeplatform/basic-edu",
|
|
3
|
+
"license": "MIT",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsup src/index.ts --format cjs,esm --dts && cp -r src/public dist",
|
|
10
|
+
"release": "yarn run build && changeset publish",
|
|
11
|
+
"lint": "tsc"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@changesets/cli": "^2.26.0",
|
|
15
|
+
"@types/express": "^5.0.0",
|
|
16
|
+
"@types/multer": "^1.4.12",
|
|
17
|
+
"@types/nodemailer": "^6.4.15",
|
|
18
|
+
"tsup": "^6.5.0",
|
|
19
|
+
"typescript": "^4.9.4"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@eeplatform/nodejs-utils": "^1.2.0",
|
|
23
|
+
"dotenv": "^16.4.5",
|
|
24
|
+
"express": "^4.21.2",
|
|
25
|
+
"handlebars": "^4.7.8",
|
|
26
|
+
"joi": "^17.13.3",
|
|
27
|
+
"mongodb": "^6.17.0",
|
|
28
|
+
"multer": "^1.4.5-lts.1"
|
|
29
|
+
},
|
|
30
|
+
"packageManager": "yarn@1.22.22"
|
|
31
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
/* Visit https://aka.ms/tsconfig to read more about this file */
|
|
4
|
+
/* Projects */
|
|
5
|
+
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
|
6
|
+
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
7
|
+
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
|
8
|
+
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
|
9
|
+
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
10
|
+
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
11
|
+
/* Language and Environment */
|
|
12
|
+
"target": "ES2020", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
|
13
|
+
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
14
|
+
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
15
|
+
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
|
16
|
+
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
17
|
+
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
|
18
|
+
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
19
|
+
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
|
20
|
+
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
|
21
|
+
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
22
|
+
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
23
|
+
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
24
|
+
/* Modules */
|
|
25
|
+
"module": "commonjs", /* Specify what module code is generated. */
|
|
26
|
+
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
27
|
+
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
28
|
+
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
29
|
+
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
30
|
+
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
31
|
+
"typeRoots": [
|
|
32
|
+
"src/types",
|
|
33
|
+
], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
34
|
+
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
35
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
36
|
+
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
37
|
+
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
|
|
38
|
+
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
|
39
|
+
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
|
40
|
+
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
|
41
|
+
// "resolveJsonModule": true, /* Enable importing .json files. */
|
|
42
|
+
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
|
43
|
+
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
44
|
+
/* JavaScript Support */
|
|
45
|
+
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
|
46
|
+
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
47
|
+
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
|
48
|
+
/* Emit */
|
|
49
|
+
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
50
|
+
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
51
|
+
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
52
|
+
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
53
|
+
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
54
|
+
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
55
|
+
"outDir": "./dist", /* Specify an output folder for all emitted files. */
|
|
56
|
+
// "removeComments": true, /* Disable emitting comments. */
|
|
57
|
+
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
58
|
+
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
59
|
+
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
|
|
60
|
+
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
61
|
+
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
62
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
63
|
+
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
64
|
+
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
65
|
+
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
66
|
+
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
|
67
|
+
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
|
68
|
+
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
69
|
+
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
|
70
|
+
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
71
|
+
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
72
|
+
/* Interop Constraints */
|
|
73
|
+
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
74
|
+
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
|
|
75
|
+
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
76
|
+
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
|
77
|
+
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
78
|
+
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
|
79
|
+
/* Type Checking */
|
|
80
|
+
"strict": true, /* Enable all strict type-checking options. */
|
|
81
|
+
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
|
82
|
+
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
|
83
|
+
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
84
|
+
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
|
85
|
+
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
86
|
+
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
|
87
|
+
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
|
88
|
+
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
89
|
+
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
|
90
|
+
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
|
91
|
+
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
92
|
+
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
93
|
+
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
94
|
+
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
|
95
|
+
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
96
|
+
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
|
97
|
+
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
98
|
+
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
99
|
+
/* Completeness */
|
|
100
|
+
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
101
|
+
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
102
|
+
},
|
|
103
|
+
"include": [
|
|
104
|
+
"src",
|
|
105
|
+
"src/types/**/*.d.ts",
|
|
106
|
+
"src/**/*.hbs"
|
|
107
|
+
]
|
|
108
|
+
}
|