@cyberskill/shared 3.0.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/dist/config/commitlint/index.js +1 -0
  2. package/dist/config/commitlint/index.js.map +1 -0
  3. package/dist/config/config.type.js +1 -0
  4. package/dist/config/config.type.js.map +1 -0
  5. package/dist/config/config.util.js +4 -2
  6. package/dist/config/config.util.js.map +1 -0
  7. package/dist/config/env/env.constant.js +1 -0
  8. package/dist/config/env/env.constant.js.map +1 -0
  9. package/dist/config/env/env.util.js +1 -0
  10. package/dist/config/env/env.util.js.map +1 -0
  11. package/dist/config/env/index.js +1 -0
  12. package/dist/config/env/index.js.map +1 -0
  13. package/dist/config/eslint/index.js +1 -0
  14. package/dist/config/eslint/index.js.map +1 -0
  15. package/dist/config/graphql-codegen/graphql-codegen.util.js +1 -0
  16. package/dist/config/graphql-codegen/graphql-codegen.util.js.map +1 -0
  17. package/dist/config/graphql-codegen/index.js +1 -0
  18. package/dist/config/graphql-codegen/index.js.map +1 -0
  19. package/dist/config/index.js +1 -0
  20. package/dist/config/index.js.map +1 -0
  21. package/dist/config/lint-staged/index.js +1 -0
  22. package/dist/config/lint-staged/index.js.map +1 -0
  23. package/dist/config/storybook/index.js +1 -0
  24. package/dist/config/storybook/index.js.map +1 -0
  25. package/dist/config/storybook/storybook.main.js +1 -0
  26. package/dist/config/storybook/storybook.main.js.map +1 -0
  27. package/dist/config/storybook/storybook.preview.d.ts +1 -1
  28. package/dist/config/storybook/storybook.preview.js +6 -4
  29. package/dist/config/storybook/storybook.preview.js.map +1 -0
  30. package/dist/config/vitest/index.js +1 -0
  31. package/dist/config/vitest/index.js.map +1 -0
  32. package/dist/config/vitest/vitest.e2e.d.ts +2 -0
  33. package/dist/config/vitest/vitest.e2e.js +12 -18
  34. package/dist/config/vitest/vitest.e2e.js.map +1 -0
  35. package/dist/config/vitest/vitest.unit.d.ts +2 -0
  36. package/dist/config/vitest/vitest.unit.js +8 -5
  37. package/dist/config/vitest/vitest.unit.js.map +1 -0
  38. package/dist/constant/common.js +1 -0
  39. package/dist/constant/common.js.map +1 -0
  40. package/dist/constant/index.js +1 -0
  41. package/dist/constant/index.js.map +1 -0
  42. package/dist/constant/response-status.js +1 -0
  43. package/dist/constant/response-status.js.map +1 -0
  44. package/dist/node/apollo-server/apollo-server.util.js +1 -0
  45. package/dist/node/apollo-server/apollo-server.util.js.map +1 -0
  46. package/dist/node/apollo-server/index.js +1 -0
  47. package/dist/node/apollo-server/index.js.map +1 -0
  48. package/dist/node/cli/index.js +56 -45
  49. package/dist/node/cli/index.js.map +1 -0
  50. package/dist/node/command/command.type.js +1 -0
  51. package/dist/node/command/command.type.js.map +1 -0
  52. package/dist/node/command/command.util.js +107 -99
  53. package/dist/node/command/command.util.js.map +1 -0
  54. package/dist/node/command/index.js +1 -0
  55. package/dist/node/command/index.js.map +1 -0
  56. package/dist/node/express/express.type.d.ts +4 -0
  57. package/dist/node/express/express.util.js +49 -31
  58. package/dist/node/express/express.util.js.map +1 -0
  59. package/dist/node/express/index.js +1 -0
  60. package/dist/node/express/index.js.map +1 -0
  61. package/dist/node/fs/fs.util.js +1 -0
  62. package/dist/node/fs/fs.util.js.map +1 -0
  63. package/dist/node/fs/index.js +1 -0
  64. package/dist/node/fs/index.js.map +1 -0
  65. package/dist/node/log/index.js +1 -0
  66. package/dist/node/log/index.js.map +1 -0
  67. package/dist/node/log/log.type.js +1 -0
  68. package/dist/node/log/log.type.js.map +1 -0
  69. package/dist/node/log/log.util.js +1 -0
  70. package/dist/node/log/log.util.js.map +1 -0
  71. package/dist/node/mongo/index.d.ts +2 -0
  72. package/dist/node/mongo/index.js +21 -12
  73. package/dist/node/mongo/index.js.map +1 -0
  74. package/dist/node/mongo/mongo.constant.js +1 -0
  75. package/dist/node/mongo/mongo.constant.js.map +1 -0
  76. package/dist/node/mongo/mongo.controller.d.ts +5 -315
  77. package/dist/node/mongo/mongo.controller.mongoose.d.ts +234 -0
  78. package/dist/node/mongo/mongo.controller.mongoose.js +468 -0
  79. package/dist/node/mongo/mongo.controller.mongoose.js.map +1 -0
  80. package/dist/node/mongo/mongo.controller.native.d.ts +84 -0
  81. package/dist/node/mongo/mongo.controller.native.js +214 -0
  82. package/dist/node/mongo/mongo.controller.native.js.map +1 -0
  83. package/dist/node/mongo/mongo.dynamic-populate.d.ts +61 -0
  84. package/dist/node/mongo/mongo.dynamic-populate.js +197 -0
  85. package/dist/node/mongo/mongo.dynamic-populate.js.map +1 -0
  86. package/dist/node/mongo/mongo.populate.d.ts +15 -0
  87. package/dist/node/mongo/mongo.populate.js +269 -0
  88. package/dist/node/mongo/mongo.populate.js.map +1 -0
  89. package/dist/node/mongo/mongo.type.js +1 -0
  90. package/dist/node/mongo/mongo.type.js.map +1 -0
  91. package/dist/node/mongo/mongo.util.d.ts +52 -0
  92. package/dist/node/mongo/mongo.util.js +106 -363
  93. package/dist/node/mongo/mongo.util.js.map +1 -0
  94. package/dist/node/package/index.js +1 -0
  95. package/dist/node/package/index.js.map +1 -0
  96. package/dist/node/package/package.type.js +1 -0
  97. package/dist/node/package/package.type.js.map +1 -0
  98. package/dist/node/package/package.util.js +20 -20
  99. package/dist/node/package/package.util.js.map +1 -0
  100. package/dist/node/path/index.js +1 -0
  101. package/dist/node/path/index.js.map +1 -0
  102. package/dist/node/path/path.constant.js +10 -9
  103. package/dist/node/path/path.constant.js.map +1 -0
  104. package/dist/node/path/path.util.js +1 -0
  105. package/dist/node/path/path.util.js.map +1 -0
  106. package/dist/node/storage/index.js +1 -0
  107. package/dist/node/storage/index.js.map +1 -0
  108. package/dist/node/storage/storage.constant.js +1 -0
  109. package/dist/node/storage/storage.constant.js.map +1 -0
  110. package/dist/node/storage/storage.util.js +1 -0
  111. package/dist/node/storage/storage.util.js.map +1 -0
  112. package/dist/node/upload/index.js +1 -0
  113. package/dist/node/upload/index.js.map +1 -0
  114. package/dist/node/upload/upload.constant.js +1 -0
  115. package/dist/node/upload/upload.constant.js.map +1 -0
  116. package/dist/node/upload/upload.type.js +1 -0
  117. package/dist/node/upload/upload.type.js.map +1 -0
  118. package/dist/node/upload/upload.util.js +1 -0
  119. package/dist/node/upload/upload.util.js.map +1 -0
  120. package/dist/node/ws/index.d.ts +1 -1
  121. package/dist/node/ws/index.js +2 -1
  122. package/dist/node/ws/index.js.map +1 -0
  123. package/dist/node/ws/{ts.util.js → ws.util.js} +1 -0
  124. package/dist/node/ws/ws.util.js.map +1 -0
  125. package/dist/node_modules/.pnpm/{vitest@4.0.18_@types_node@25.3.3_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.18_@types_node@25.3.5_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.js +1 -0
  126. package/dist/node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.5_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/config.js.map +1 -0
  127. package/dist/react/apollo-client/apollo-client.component.js +1 -0
  128. package/dist/react/apollo-client/apollo-client.component.js.map +1 -0
  129. package/dist/react/apollo-client/apollo-client.constant.js +1 -0
  130. package/dist/react/apollo-client/apollo-client.constant.js.map +1 -0
  131. package/dist/react/apollo-client/apollo-client.context.js +1 -0
  132. package/dist/react/apollo-client/apollo-client.context.js.map +1 -0
  133. package/dist/react/apollo-client/apollo-client.module.scss.js +1 -0
  134. package/dist/react/apollo-client/apollo-client.module.scss.js.map +1 -0
  135. package/dist/react/apollo-client/apollo-client.util.js +14 -13
  136. package/dist/react/apollo-client/apollo-client.util.js.map +1 -0
  137. package/dist/react/apollo-client/index.js +1 -0
  138. package/dist/react/apollo-client/index.js.map +1 -0
  139. package/dist/react/apollo-client/links/index.js +1 -0
  140. package/dist/react/apollo-client/links/index.js.map +1 -0
  141. package/dist/react/apollo-client/links/upload.js +1 -0
  142. package/dist/react/apollo-client/links/upload.js.map +1 -0
  143. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.js +1 -0
  144. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.js.map +1 -0
  145. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.js +1 -0
  146. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.js.map +1 -0
  147. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.js +1 -0
  148. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.js.map +1 -0
  149. package/dist/react/apollo-client-nextjs/index.js +1 -0
  150. package/dist/react/apollo-client-nextjs/index.js.map +1 -0
  151. package/dist/react/apollo-error/apollo-error.component.js +23 -21
  152. package/dist/react/apollo-error/apollo-error.component.js.map +1 -0
  153. package/dist/react/apollo-error/apollo-error.context.js +1 -0
  154. package/dist/react/apollo-error/apollo-error.context.js.map +1 -0
  155. package/dist/react/apollo-error/apollo-error.hook.js +1 -0
  156. package/dist/react/apollo-error/apollo-error.hook.js.map +1 -0
  157. package/dist/react/apollo-error/apollo-error.module.scss.js +1 -0
  158. package/dist/react/apollo-error/apollo-error.module.scss.js.map +1 -0
  159. package/dist/react/apollo-error/apollo-error.provider.js +1 -0
  160. package/dist/react/apollo-error/apollo-error.provider.js.map +1 -0
  161. package/dist/react/apollo-error/apollo-error.util.js +1 -0
  162. package/dist/react/apollo-error/apollo-error.util.js.map +1 -0
  163. package/dist/react/apollo-error/index.js +1 -0
  164. package/dist/react/apollo-error/index.js.map +1 -0
  165. package/dist/react/i18next/i18next.hook.js +1 -0
  166. package/dist/react/i18next/i18next.hook.js.map +1 -0
  167. package/dist/react/i18next/i18next.util.js +1 -0
  168. package/dist/react/i18next/i18next.util.js.map +1 -0
  169. package/dist/react/i18next/index.js +1 -0
  170. package/dist/react/i18next/index.js.map +1 -0
  171. package/dist/react/loading/index.js +1 -0
  172. package/dist/react/loading/index.js.map +1 -0
  173. package/dist/react/loading/loading.component.js +1 -0
  174. package/dist/react/loading/loading.component.js.map +1 -0
  175. package/dist/react/loading/loading.context.js +1 -0
  176. package/dist/react/loading/loading.context.js.map +1 -0
  177. package/dist/react/loading/loading.hook.js +1 -0
  178. package/dist/react/loading/loading.hook.js.map +1 -0
  179. package/dist/react/loading/loading.module.scss.js +1 -0
  180. package/dist/react/loading/loading.module.scss.js.map +1 -0
  181. package/dist/react/loading/loading.provider.js +1 -0
  182. package/dist/react/loading/loading.provider.js.map +1 -0
  183. package/dist/react/log/index.js +1 -0
  184. package/dist/react/log/index.js.map +1 -0
  185. package/dist/react/log/log.util.js +1 -0
  186. package/dist/react/log/log.util.js.map +1 -0
  187. package/dist/react/next-intl/index.js +1 -0
  188. package/dist/react/next-intl/index.js.map +1 -0
  189. package/dist/react/next-intl/next-intl.constant.js +1 -0
  190. package/dist/react/next-intl/next-intl.constant.js.map +1 -0
  191. package/dist/react/next-intl/next-intl.context.js +1 -0
  192. package/dist/react/next-intl/next-intl.context.js.map +1 -0
  193. package/dist/react/next-intl/next-intl.hoc.js +1 -0
  194. package/dist/react/next-intl/next-intl.hoc.js.map +1 -0
  195. package/dist/react/next-intl/next-intl.hook.js +1 -0
  196. package/dist/react/next-intl/next-intl.hook.js.map +1 -0
  197. package/dist/react/next-intl/next-intl.provider.js +1 -0
  198. package/dist/react/next-intl/next-intl.provider.js.map +1 -0
  199. package/dist/react/storage/index.js +1 -0
  200. package/dist/react/storage/index.js.map +1 -0
  201. package/dist/react/storage/storage.hook.js +1 -0
  202. package/dist/react/storage/storage.hook.js.map +1 -0
  203. package/dist/react/storage/storage.util.js +1 -0
  204. package/dist/react/storage/storage.util.js.map +1 -0
  205. package/dist/react/toast/index.js +1 -0
  206. package/dist/react/toast/index.js.map +1 -0
  207. package/dist/react/userback/index.js +1 -0
  208. package/dist/react/userback/index.js.map +1 -0
  209. package/dist/react/userback/userback.component.js +1 -0
  210. package/dist/react/userback/userback.component.js.map +1 -0
  211. package/dist/typescript/common.type.js +1 -0
  212. package/dist/typescript/common.type.js.map +1 -0
  213. package/dist/typescript/index.js +1 -0
  214. package/dist/typescript/index.js.map +1 -0
  215. package/dist/util/common/common.util.js +27 -25
  216. package/dist/util/common/common.util.js.map +1 -0
  217. package/dist/util/common/index.js +1 -0
  218. package/dist/util/common/index.js.map +1 -0
  219. package/dist/util/index.js +1 -0
  220. package/dist/util/index.js.map +1 -0
  221. package/dist/util/object/index.js +1 -0
  222. package/dist/util/object/index.js.map +1 -0
  223. package/dist/util/object/object.util.js +50 -49
  224. package/dist/util/object/object.util.js.map +1 -0
  225. package/dist/util/serializer/index.js +1 -0
  226. package/dist/util/serializer/index.js.map +1 -0
  227. package/dist/util/serializer/serializer.util.js +13 -12
  228. package/dist/util/serializer/serializer.util.js.map +1 -0
  229. package/dist/util/string/index.js +1 -0
  230. package/dist/util/string/index.js.map +1 -0
  231. package/dist/util/string/string.util.js +30 -28
  232. package/dist/util/string/string.util.js.map +1 -0
  233. package/dist/util/validate/index.js +1 -0
  234. package/dist/util/validate/index.js.map +1 -0
  235. package/dist/util/validate/validate.util.d.ts +0 -4
  236. package/dist/util/validate/validate.util.js +4 -3
  237. package/dist/util/validate/validate.util.js.map +1 -0
  238. package/package.json +68 -95
  239. package/public/tsconfig.base.json +1 -1
  240. package/dist/config/commitlint/index.cjs +0 -1
  241. package/dist/config/config.type.cjs +0 -1
  242. package/dist/config/config.util.cjs +0 -1
  243. package/dist/config/env/env.constant.cjs +0 -1
  244. package/dist/config/env/env.util.cjs +0 -1
  245. package/dist/config/env/index.cjs +0 -1
  246. package/dist/config/eslint/index.cjs +0 -1
  247. package/dist/config/graphql-codegen/graphql-codegen.util.cjs +0 -1
  248. package/dist/config/graphql-codegen/index.cjs +0 -1
  249. package/dist/config/index.cjs +0 -1
  250. package/dist/config/lint-staged/index.cjs +0 -1
  251. package/dist/config/storybook/index.cjs +0 -1
  252. package/dist/config/storybook/storybook.main.cjs +0 -1
  253. package/dist/config/storybook/storybook.preview.cjs +0 -1
  254. package/dist/config/vitest/index.cjs +0 -1
  255. package/dist/config/vitest/vitest.e2e.cjs +0 -1
  256. package/dist/config/vitest/vitest.unit.cjs +0 -1
  257. package/dist/constant/common.cjs +0 -1
  258. package/dist/constant/index.cjs +0 -1
  259. package/dist/constant/response-status.cjs +0 -1
  260. package/dist/node/apollo-server/apollo-server.util.cjs +0 -1
  261. package/dist/node/apollo-server/index.cjs +0 -1
  262. package/dist/node/cli/index.cjs +0 -3
  263. package/dist/node/command/command.type.cjs +0 -1
  264. package/dist/node/command/command.util.cjs +0 -2
  265. package/dist/node/command/index.cjs +0 -1
  266. package/dist/node/express/express.util.cjs +0 -1
  267. package/dist/node/express/index.cjs +0 -1
  268. package/dist/node/fs/fs.util.cjs +0 -4
  269. package/dist/node/fs/index.cjs +0 -1
  270. package/dist/node/log/index.cjs +0 -1
  271. package/dist/node/log/log.type.cjs +0 -1
  272. package/dist/node/log/log.util.cjs +0 -1
  273. package/dist/node/mongo/index.cjs +0 -1
  274. package/dist/node/mongo/mongo.constant.cjs +0 -1
  275. package/dist/node/mongo/mongo.controller.cjs +0 -1
  276. package/dist/node/mongo/mongo.controller.js +0 -858
  277. package/dist/node/mongo/mongo.controller.test.unit.d.ts +0 -1
  278. package/dist/node/mongo/mongo.type.cjs +0 -1
  279. package/dist/node/mongo/mongo.util.cjs +0 -2
  280. package/dist/node/mongo/mongo.util.test.unit.d.ts +0 -1
  281. package/dist/node/package/index.cjs +0 -1
  282. package/dist/node/package/package.type.cjs +0 -1
  283. package/dist/node/package/package.util.cjs +0 -1
  284. package/dist/node/path/index.cjs +0 -1
  285. package/dist/node/path/path.constant.cjs +0 -1
  286. package/dist/node/path/path.test.unit.d.ts +0 -1
  287. package/dist/node/path/path.util.cjs +0 -1
  288. package/dist/node/storage/index.cjs +0 -1
  289. package/dist/node/storage/storage.constant.cjs +0 -1
  290. package/dist/node/storage/storage.util.cjs +0 -1
  291. package/dist/node/upload/index.cjs +0 -1
  292. package/dist/node/upload/upload.constant.cjs +0 -1
  293. package/dist/node/upload/upload.type.cjs +0 -1
  294. package/dist/node/upload/upload.util.cjs +0 -1
  295. package/dist/node/ws/index.cjs +0 -1
  296. package/dist/node/ws/ts.util.cjs +0 -1
  297. package/dist/node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.3_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/config.cjs +0 -1
  298. package/dist/react/apollo-client/apollo-client.component.cjs +0 -1
  299. package/dist/react/apollo-client/apollo-client.constant.cjs +0 -1
  300. package/dist/react/apollo-client/apollo-client.context.cjs +0 -1
  301. package/dist/react/apollo-client/apollo-client.module.scss.cjs +0 -1
  302. package/dist/react/apollo-client/apollo-client.util.cjs +0 -1
  303. package/dist/react/apollo-client/index.cjs +0 -1
  304. package/dist/react/apollo-client/links/index.cjs +0 -1
  305. package/dist/react/apollo-client/links/upload.cjs +0 -1
  306. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.cjs +0 -1
  307. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.cjs +0 -1
  308. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.cjs +0 -1
  309. package/dist/react/apollo-client-nextjs/index.cjs +0 -1
  310. package/dist/react/apollo-error/apollo-error.component.cjs +0 -1
  311. package/dist/react/apollo-error/apollo-error.context.cjs +0 -1
  312. package/dist/react/apollo-error/apollo-error.hook.cjs +0 -1
  313. package/dist/react/apollo-error/apollo-error.module.scss.cjs +0 -1
  314. package/dist/react/apollo-error/apollo-error.provider.cjs +0 -1
  315. package/dist/react/apollo-error/apollo-error.test.unit.d.ts +0 -1
  316. package/dist/react/apollo-error/apollo-error.util.cjs +0 -1
  317. package/dist/react/apollo-error/index.cjs +0 -1
  318. package/dist/react/i18next/i18next.hook.cjs +0 -1
  319. package/dist/react/i18next/i18next.util.cjs +0 -1
  320. package/dist/react/i18next/index.cjs +0 -1
  321. package/dist/react/loading/index.cjs +0 -1
  322. package/dist/react/loading/loading.component.cjs +0 -6
  323. package/dist/react/loading/loading.context.cjs +0 -1
  324. package/dist/react/loading/loading.hook.cjs +0 -1
  325. package/dist/react/loading/loading.module.scss.cjs +0 -1
  326. package/dist/react/loading/loading.provider.cjs +0 -1
  327. package/dist/react/loading/loading.test.unit.d.ts +0 -1
  328. package/dist/react/log/index.cjs +0 -1
  329. package/dist/react/log/log.util.cjs +0 -1
  330. package/dist/react/next-intl/index.cjs +0 -1
  331. package/dist/react/next-intl/next-intl.constant.cjs +0 -1
  332. package/dist/react/next-intl/next-intl.context.cjs +0 -1
  333. package/dist/react/next-intl/next-intl.hoc.cjs +0 -1
  334. package/dist/react/next-intl/next-intl.hook.cjs +0 -1
  335. package/dist/react/next-intl/next-intl.provider.cjs +0 -1
  336. package/dist/react/storage/index.cjs +0 -1
  337. package/dist/react/storage/storage.hook.cjs +0 -1
  338. package/dist/react/storage/storage.util.cjs +0 -1
  339. package/dist/react/toast/index.cjs +0 -1
  340. package/dist/react/userback/index.cjs +0 -1
  341. package/dist/react/userback/userback.component.cjs +0 -1
  342. package/dist/typescript/common.type.cjs +0 -1
  343. package/dist/typescript/index.cjs +0 -1
  344. package/dist/util/common/common.test.unit.d.ts +0 -1
  345. package/dist/util/common/common.util.cjs +0 -1
  346. package/dist/util/common/index.cjs +0 -1
  347. package/dist/util/index.cjs +0 -1
  348. package/dist/util/object/index.cjs +0 -1
  349. package/dist/util/object/object.test.unit.d.ts +0 -1
  350. package/dist/util/object/object.util.cjs +0 -1
  351. package/dist/util/serializer/index.cjs +0 -1
  352. package/dist/util/serializer/serializer.test.unit.d.ts +0 -1
  353. package/dist/util/serializer/serializer.util.cjs +0 -1
  354. package/dist/util/string/index.cjs +0 -1
  355. package/dist/util/string/string.test.unit.d.ts +0 -1
  356. package/dist/util/string/string.util.cjs +0 -1
  357. package/dist/util/validate/index.cjs +0 -1
  358. package/dist/util/validate/validate.test.unit.d.ts +0 -1
  359. package/dist/util/validate/validate.util.cjs +0 -1
  360. /package/dist/node/ws/{ts.util.d.ts → ws.util.d.ts} +0 -0
@@ -1,16 +1,15 @@
1
- import I from "migrate-mongo";
2
- import $ from "mongoose-aggregate-paginate-v2";
3
- import G from "mongoose-paginate-v2";
4
- import { randomUUID as x } from "node:crypto";
5
- import { deepClone as D, getNestedValue as k, setNestedValue as C } from "../../util/object/object.util.js";
6
- import { regexSearchMapper as U } from "../../util/common/common.util.js";
7
- import { writeFileSync as q, addGitIgnoreEntry as B } from "../fs/fs.util.js";
8
- import { PATH as V, MIGRATE_MONGO_CONFIG as P } from "../path/path.constant.js";
9
- import { validate as J } from "../../util/validate/validate.util.js";
10
- function A(t) {
11
- return t === t.toUpperCase() ? t.charAt(0).toUpperCase() + t.slice(1).toLowerCase() : t;
1
+ import m from "mongoose-aggregate-paginate-v2";
2
+ import p from "mongoose-paginate-v2";
3
+ import { randomUUID as f } from "node:crypto";
4
+ import { deepClone as y, getNestedValue as g, setNestedValue as h } from "../../util/object/object.util.js";
5
+ import { regexSearchMapper as w } from "../../util/common/common.util.js";
6
+ import { writeFileSync as S, addGitIgnoreEntry as E } from "../fs/fs.util.js";
7
+ import { PATH as d, MIGRATE_MONGO_CONFIG as R } from "../path/path.constant.js";
8
+ import { validate as x } from "../../util/validate/validate.util.js";
9
+ function I(e) {
10
+ return e === e.toUpperCase() ? e.charAt(0).toUpperCase() + e.slice(1).toLowerCase() : e;
12
11
  }
13
- const R = {
12
+ const l = {
14
13
  /**
15
14
  * Creates generic fields that are commonly used across MongoDB documents.
16
15
  * This function generates standard fields including a UUID, deletion flag, and timestamps
@@ -20,7 +19,7 @@ const R = {
20
19
  */
21
20
  createGenericFields() {
22
21
  return {
23
- id: x(),
22
+ id: f(),
24
23
  isDel: !1,
25
24
  createdAt: /* @__PURE__ */ new Date(),
26
25
  updatedAt: /* @__PURE__ */ new Date()
@@ -34,8 +33,8 @@ const R = {
34
33
  * @param schema - The Mongoose schema to apply plugins to.
35
34
  * @param plugins - An array of plugin functions or false values to filter and apply.
36
35
  */
37
- applyPlugins(t, e) {
38
- e.filter((i) => typeof i == "function").forEach((i) => t.plugin(i));
36
+ applyPlugins(e, r) {
37
+ r.filter((t) => typeof t == "function").forEach((t) => e.plugin(t));
39
38
  },
40
39
  /**
41
40
  * Applies middleware functions to a Mongoose schema.
@@ -44,9 +43,9 @@ const R = {
44
43
  * @param schema - The Mongoose schema to apply middleware to.
45
44
  * @param middlewares - An array of middleware configurations with method, pre, and post functions.
46
45
  */
47
- applyMiddlewares(t, e) {
48
- e.forEach(({ method: i, pre: a, post: r }) => {
49
- i && a && t.pre(i, a), i && r && t.post(i, r);
46
+ applyMiddlewares(e, r) {
47
+ r.forEach(({ method: t, pre: n, post: i }) => {
48
+ t && n && e.pre(t, n), t && i && e.post(t, i);
50
49
  });
51
50
  },
52
51
  /**
@@ -57,10 +56,10 @@ const R = {
57
56
  * @param mongoose - The Mongoose instance to create the schema with.
58
57
  * @returns A Mongoose schema with generic document fields.
59
58
  */
60
- createGenericSchema(t) {
61
- return new t.Schema(
59
+ createGenericSchema(e) {
60
+ return new e.Schema(
62
61
  {
63
- id: { type: String, default: () => x(), unique: !0 },
62
+ id: { type: String, default: () => f(), unique: !0 },
64
63
  isDel: { type: Boolean, default: !1 }
65
64
  },
66
65
  { timestamps: !0 }
@@ -79,33 +78,33 @@ const R = {
79
78
  * @returns A configured Mongoose schema.
80
79
  */
81
80
  createSchema({
82
- mongoose: t,
83
- schema: e,
84
- virtuals: i = [],
85
- standalone: a = !1
81
+ mongoose: e,
82
+ schema: r,
83
+ virtuals: t = [],
84
+ standalone: n = !1
86
85
  }) {
87
- const r = new t.Schema(e, {
86
+ const i = new e.Schema(r, {
88
87
  toJSON: { virtuals: !0 },
89
88
  // So `res.json()` and other `JSON.stringify()` functions include virtuals
90
89
  toObject: { virtuals: !0 }
91
90
  // So `console.log()` and other functions that use `toObject()` include virtuals
92
91
  });
93
- return i.forEach(({ name: o, options: s, get: u }) => {
94
- if (R.isDynamicVirtual(s)) {
95
- const p = r.statics;
96
- p._dynamicVirtuals || (p._dynamicVirtuals = []), p._dynamicVirtuals.push({
97
- name: o,
98
- options: s
92
+ return t.forEach(({ name: s, options: a, get: o }) => {
93
+ if (l.isDynamicVirtual(a)) {
94
+ const c = i.statics;
95
+ c._dynamicVirtuals || (c._dynamicVirtuals = []), c._dynamicVirtuals.push({
96
+ name: s,
97
+ options: a
99
98
  });
100
- const y = r.virtual(o);
101
- u ? y.get(u) : y.get(function() {
102
- return this._populated?.[o] || (s?.count ? 0 : s?.justOne ? null : []);
99
+ const u = i.virtual(s);
100
+ o ? u.get(o) : u.get(function() {
101
+ return this._populated?.[s] || (a?.count ? 0 : a?.justOne ? null : []);
103
102
  });
104
103
  } else {
105
- const p = r.virtual(o, s);
106
- u && p.get(u);
104
+ const c = i.virtual(s, a);
105
+ o && c.get(o);
107
106
  }
108
- }), a || r.add(R.createGenericSchema(t)), r;
107
+ }), n || i.add(l.createGenericSchema(e)), i;
109
108
  },
110
109
  /**
111
110
  * Creates a Mongoose model with plugins, middleware, and pagination support.
@@ -124,25 +123,25 @@ const R = {
124
123
  * @throws {Error} When the model name is not provided.
125
124
  */
126
125
  createModel({
127
- mongoose: t,
128
- name: e,
129
- schema: i,
130
- virtuals: a = [],
131
- pagination: r = !0,
132
- aggregate: o = !0,
133
- middlewares: s = []
126
+ mongoose: e,
127
+ name: r,
128
+ schema: t,
129
+ virtuals: n = [],
130
+ pagination: i = !0,
131
+ aggregate: s = !0,
132
+ middlewares: a = []
134
133
  }) {
135
- if (!e)
134
+ if (!r)
136
135
  throw new Error("Model name is required.");
137
- if (t.models[e])
138
- return t.models[e];
139
- const u = R.createSchema({ mongoose: t, schema: i, virtuals: a });
140
- (r || o) && R.applyPlugins(u, [
141
- r && G,
142
- o && $
143
- ]), R.applyMiddlewares(u, s);
144
- const p = t.model(e, u);
145
- return a.length > 0 && (p._virtualConfigs = a), p;
136
+ if (e.models[r])
137
+ return e.models[r];
138
+ const o = l.createSchema({ mongoose: e, schema: t, virtuals: n });
139
+ (i || s) && l.applyPlugins(o, [
140
+ i && p,
141
+ s && m
142
+ ]), l.applyMiddlewares(o, a);
143
+ const c = e.model(r, o);
144
+ return n.length > 0 && (c._virtualConfigs = n), c;
146
145
  },
147
146
  /**
148
147
  * Validation utilities for Mongoose schemas.
@@ -157,8 +156,8 @@ const R = {
157
156
  * @returns A validation function that returns true if the field is not empty.
158
157
  */
159
158
  isRequired() {
160
- return async function(t) {
161
- return !J.isEmpty(t);
159
+ return async function(e) {
160
+ return !x.isEmpty(e);
162
161
  };
163
162
  },
164
163
  /**
@@ -170,12 +169,12 @@ const R = {
170
169
  * @returns A validation function that returns true if the value is unique across the specified fields.
171
170
  * @throws {Error} When fields is not a non-empty array of strings.
172
171
  */
173
- isUnique(t) {
174
- return async function(e) {
175
- if (!Array.isArray(t) || t.length === 0)
172
+ isUnique(e) {
173
+ return async function(r) {
174
+ if (!Array.isArray(e) || e.length === 0)
176
175
  throw new Error("Fields must be a non-empty array of strings.");
177
- const i = { $or: t.map((r) => ({ [r]: e })) };
178
- return !await this.constructor.exists(i);
176
+ const t = { $or: e.map((i) => ({ [i]: r })) };
177
+ return !await this.constructor.exists(t);
179
178
  };
180
179
  },
181
180
  /**
@@ -187,11 +186,11 @@ const R = {
187
186
  * @returns A validation function that returns true if the value matches all regex patterns.
188
187
  * @throws {Error} When regexArray is not an array of valid RegExp objects.
189
188
  */
190
- matchesRegex(t) {
191
- return async (e) => {
192
- if (!Array.isArray(t) || t.some((i) => !(i instanceof RegExp)))
189
+ matchesRegex(e) {
190
+ return async (r) => {
191
+ if (!Array.isArray(e) || e.some((t) => !(t instanceof RegExp)))
193
192
  throw new Error("regexArray must be an array of valid RegExp objects.");
194
- return t.every((i) => i.test(e));
193
+ return e.every((t) => t.test(r));
195
194
  };
196
195
  }
197
196
  },
@@ -200,7 +199,15 @@ const R = {
200
199
  * This object extends the migrate-mongo library with additional configuration utilities.
201
200
  */
202
201
  migrate: {
203
- ...I,
202
+ /**
203
+ * Lazily loads the migrate-mongo module to avoid eager import overhead.
204
+ * Use this to access migrate-mongo methods (up, down, status, create) programmatically.
205
+ *
206
+ * @returns A promise resolving to the migrate-mongo module.
207
+ */
208
+ async getModule() {
209
+ return (await import("migrate-mongo")).default;
210
+ },
204
211
  /**
205
212
  * Sets the migration configuration and updates .gitignore.
206
213
  * This function creates a migration configuration file and ensures it's properly
@@ -208,10 +215,10 @@ const R = {
208
215
  *
209
216
  * @param options - Migration configuration options to write to the config file.
210
217
  */
211
- setConfig: (t) => {
212
- const e = `// This file is automatically generated by the Cyberskill CLI.
213
- module.exports = ${JSON.stringify(t, null, 4)}`;
214
- q(V.MIGRATE_MONGO_CONFIG, e), B(V.GIT_IGNORE, P);
218
+ setConfig: (e) => {
219
+ const r = `// This file is automatically generated by the Cyberskill CLI.
220
+ module.exports = ${JSON.stringify(e, null, 4)}`;
221
+ S(d.MIGRATE_MONGO_CONFIG, r), E(d.GIT_IGNORE, R);
215
222
  }
216
223
  },
217
224
  /**
@@ -223,23 +230,23 @@ module.exports = ${JSON.stringify(t, null, 4)}`;
223
230
  * @param fields - An array of field names to convert to regex patterns.
224
231
  * @returns A new filter object with string values converted to regex patterns.
225
232
  */
226
- regexify(t, e) {
227
- if (!t)
233
+ regexify(e, r) {
234
+ if (!e)
228
235
  return {};
229
- let i = D(t);
230
- if (!e || e.length === 0)
231
- return i;
232
- for (const a of e) {
233
- const r = a.toString().split("."), o = k(i, r);
234
- if (typeof o == "string" && o.length > 0) {
235
- const s = {
236
- $regex: `.*${U(o)}.*`,
236
+ let t = y(e);
237
+ if (!r || r.length === 0)
238
+ return t;
239
+ for (const n of r) {
240
+ const i = n.toString().split("."), s = g(t, i);
241
+ if (typeof s == "string" && s.length > 0) {
242
+ const a = {
243
+ $regex: `.*${w(s)}.*`,
237
244
  $options: "i"
238
245
  };
239
- i = C(i, r, s);
246
+ t = h(t, i, a);
240
247
  }
241
248
  }
242
- return i;
249
+ return t;
243
250
  },
244
251
  /**
245
252
  * Checks if a virtual options object has a dynamic ref function.
@@ -247,8 +254,8 @@ module.exports = ${JSON.stringify(t, null, 4)}`;
247
254
  * @param options - The virtual options to check.
248
255
  * @returns True if the options contain a dynamic ref function.
249
256
  */
250
- isDynamicVirtual(t) {
251
- return !!(t && typeof t.ref == "function");
257
+ isDynamicVirtual(e) {
258
+ return !!(e && typeof e.ref == "function");
252
259
  },
253
260
  /**
254
261
  * Generic utility function to get new records from the database
@@ -257,13 +264,13 @@ module.exports = ${JSON.stringify(t, null, 4)}`;
257
264
  * @param filterFn - Function to determine if a record already exists
258
265
  * @returns Array of records that don't exist in the database
259
266
  */
260
- async getNewRecords(t, e, i) {
261
- const a = await t.findAll({});
262
- return a.success ? e.filter(
263
- (o) => !a.result.some(
264
- (s) => i(s, o)
267
+ async getNewRecords(e, r, t) {
268
+ const n = await e.findAll({});
269
+ return n.success ? r.filter(
270
+ (s) => !n.result.some(
271
+ (a) => t(a, s)
265
272
  )
266
- ) : e;
273
+ ) : r;
267
274
  },
268
275
  /**
269
276
  * Generic utility function to get existing records that match the filter criteria
@@ -272,281 +279,17 @@ module.exports = ${JSON.stringify(t, null, 4)}`;
272
279
  * @param filterFn - Function to determine if a record exists
273
280
  * @returns Array of existing records that match the filter criteria
274
281
  */
275
- async getExistingRecords(t, e, i) {
276
- const a = await t.findAll({});
277
- return a.success ? a.result.filter(
278
- (o) => e.some(
279
- (s) => i(o, s)
282
+ async getExistingRecords(e, r, t) {
283
+ const n = await e.findAll({});
284
+ return n.success ? n.result.filter(
285
+ (s) => r.some(
286
+ (a) => t(s, a)
280
287
  )
281
288
  ) : [];
282
289
  }
283
290
  };
284
- async function _(t, e, i, a, r) {
285
- if (!e.length || !i)
286
- return e;
287
- const o = Array.isArray(i) ? i : [i];
288
- for (const s of o)
289
- typeof s == "string" ? await E(t, e, s, a, r) : s && typeof s == "object" && await K(t, e, s, a, r);
290
- return e;
291
- }
292
- async function E(t, e, i, a, r) {
293
- const o = i.split(".");
294
- if (o.length < 2) {
295
- for (const p of e)
296
- await F(t, p, i, a, void 0, r);
297
- return;
298
- }
299
- const s = o[0];
300
- if (!s || s.trim() === "")
301
- return;
302
- const u = o.slice(1).join(".");
303
- for (const p of e) {
304
- const y = p, l = y[s];
305
- if (l && typeof l == "object") {
306
- let b = r;
307
- const d = b;
308
- if (r && r.schema && r.schema.virtuals) {
309
- const f = r.schema.virtuals[s];
310
- if (f && f.options && f.options.ref) {
311
- let c;
312
- if (typeof f.options.ref == "function" ? c = f.options.ref(y) : typeof f.options.ref == "string" && (c = f.options.ref), c) {
313
- const n = A(c);
314
- t.models[n] && (b = t.models[n]);
315
- }
316
- }
317
- }
318
- if (!b) {
319
- const f = r?.schema?.statics ?? {}, n = (r?._virtualConfigs || f._dynamicVirtuals || []).find((m) => m.name === s);
320
- if (n && n.options && n.options.ref) {
321
- let m;
322
- if (typeof n.options.ref == "function" ? m = n.options.ref(y) : typeof n.options.ref == "string" && (m = n.options.ref), m) {
323
- const v = A(m);
324
- t.models[v] && (b = t.models[v]);
325
- }
326
- }
327
- }
328
- if (b === d) {
329
- const f = r?.schema?.statics ?? {}, n = (r?._virtualConfigs || f._dynamicVirtuals || []).find((m) => m.name === s);
330
- if (n && n.options && n.options.ref) {
331
- let m;
332
- if (typeof n.options.ref == "function" ? m = n.options.ref(y) : typeof n.options.ref == "string" && (m = n.options.ref), m) {
333
- const v = A(m);
334
- t.models[v] && (b = t.models[v]);
335
- }
336
- }
337
- }
338
- if (Array.isArray(l))
339
- for (const f of l)
340
- f && typeof f == "object" && await F(t, f, u, a, s, b);
341
- else l && typeof l == "object" && await F(t, l, u, a, s, b);
342
- }
343
- }
344
- }
345
- async function K(t, e, i, a, r) {
346
- const { path: o, populate: s } = i;
347
- if (!o)
348
- return;
349
- if (!s) {
350
- await E(t, e, o, a, r);
351
- return;
352
- }
353
- const u = o;
354
- for (const p of e) {
355
- const y = p, l = y[u];
356
- let b = r;
357
- if (r && r.schema && r.schema.virtuals) {
358
- const d = r.schema.virtuals[u];
359
- if (d && d.options && d.options.ref) {
360
- let f;
361
- if (typeof d.options.ref == "function" ? f = d.options.ref(y) : typeof d.options.ref == "string" && (f = d.options.ref), f) {
362
- const c = A(f);
363
- t.models[c] && (b = t.models[c]);
364
- }
365
- }
366
- }
367
- if (!b && typeof l == "object" && l && "entityType" in l) {
368
- const d = A(String(l.entityType));
369
- t.models[d] && (b = t.models[d]);
370
- }
371
- if (l && typeof l == "object")
372
- if (Array.isArray(l))
373
- for (const d of l)
374
- d && typeof d == "object" && await _(t, [d], s, a, b);
375
- else l && typeof l == "object" && await _(t, [l], s, a, b);
376
- }
377
- }
378
- function S(t, e, i, a) {
379
- if (!i || !e || !e.schema)
380
- return;
381
- const r = i.split(".");
382
- let o = e.schema;
383
- for (let s = 0; s < r.length; s++) {
384
- const u = r[s];
385
- if (o && o.virtuals && u) {
386
- const p = o.virtuals[u];
387
- if (p && p.options && p.options.ref) {
388
- let y;
389
- if (typeof p.options.ref == "function" ? y = p.options.ref(a) : typeof p.options.ref == "string" && (y = p.options.ref), y && typeof y == "string") {
390
- if (s === r.length - 1)
391
- return y;
392
- const l = t.models[y];
393
- if (l && l.schema) {
394
- o = l.schema;
395
- continue;
396
- }
397
- }
398
- }
399
- }
400
- if (o && o.paths && u) {
401
- const p = o.paths[u];
402
- if (p && p.schema) {
403
- o = p.schema;
404
- continue;
405
- }
406
- }
407
- return;
408
- }
409
- }
410
- function L(t, e) {
411
- if (e)
412
- for (const i of Object.keys(t.models)) {
413
- const a = t.models[i], r = a?.schema;
414
- if (r && (r.paths && r.paths[e] || r.virtuals && r.virtuals[e]))
415
- return a;
416
- }
417
- }
418
- function H(t, e) {
419
- const i = (e || "").split(".")[0] || "";
420
- if (i)
421
- for (const a of Object.keys(t.models)) {
422
- const r = t.models[a], o = r?.schema;
423
- if (o && (o.paths && o.paths[i] || o.virtuals && o.virtuals[i]))
424
- return r;
425
- }
426
- }
427
- async function F(t, e, i, a, r, o) {
428
- let s = e.__t;
429
- if (!s) {
430
- if (o) {
431
- const f = r ? `${r}.${i}` : i, c = (f || "").split(".")[0] || "";
432
- let n = o;
433
- if (!!!(n?.schema?.paths && n.schema.paths[c] || n?.schema?.virtuals && n.schema.virtuals[c])) {
434
- const w = H(t, f);
435
- w && (n = w);
436
- }
437
- const v = S(t, n, f, e);
438
- if (v)
439
- s = v;
440
- else {
441
- const w = (f.includes(".") ? f.split(".").pop() : f) || "";
442
- if (w) {
443
- const O = L(t, w);
444
- if (O) {
445
- const N = S(t, O, f, e);
446
- N && (s = N);
447
- }
448
- }
449
- }
450
- }
451
- if (a && a.length > 0) {
452
- const f = i.split(".").pop() || "", c = a.find((n) => n.name === f);
453
- if (c && c.options.ref) {
454
- let n;
455
- typeof c.options.ref == "function" ? n = c.options.ref(e) : typeof c.options.ref == "string" && (n = c.options.ref), n && typeof n == "string" && (s = n);
456
- }
457
- }
458
- if (!s) {
459
- for (const [f, c] of Object.entries(e))
460
- if (f === "entityType" && typeof c == "string") {
461
- s = c;
462
- break;
463
- }
464
- if (s && t.models[s]) {
465
- const f = t.models[s];
466
- if (f && f.schema) {
467
- const c = f.schema, n = i.split(".").pop() || "", m = (w, O = "root") => {
468
- if (!w || !w.virtuals)
469
- return;
470
- const N = w.virtuals;
471
- for (const g of Object.keys(N))
472
- if (g === n) {
473
- const h = N[g];
474
- if (h && h.options && h.options.ref) {
475
- let j;
476
- if (typeof h.options.ref == "function" ? j = h.options.ref(e) : typeof h.options.ref == "string" && (j = h.options.ref), j && typeof j == "string")
477
- return j;
478
- }
479
- }
480
- if (w.paths)
481
- for (const g of Object.keys(w.paths)) {
482
- const h = w.paths[g];
483
- if (h && h.schema) {
484
- const j = m(h.schema, `${O}.${g}`);
485
- if (j)
486
- return j;
487
- }
488
- }
489
- }, v = m(c);
490
- v && (s = v);
491
- }
492
- }
493
- }
494
- if (!s) {
495
- const f = i.split(".").pop() || "";
496
- if (o && o.schema) {
497
- const c = o.schema, n = (v, w = "root") => {
498
- if (!v || !v.virtuals)
499
- return;
500
- const O = v.virtuals;
501
- for (const N of Object.keys(O))
502
- if (N === f) {
503
- const g = O[N];
504
- if (g && g.options && g.options.ref) {
505
- let h;
506
- if (typeof g.options.ref == "function" ? h = g.options.ref(e) : typeof g.options.ref == "string" && (h = g.options.ref), h && typeof h == "string")
507
- return h;
508
- }
509
- }
510
- if (v.paths)
511
- for (const N of Object.keys(v.paths)) {
512
- const g = v.paths[N];
513
- if (g && g.schema) {
514
- const h = n(g.schema, `${w}.${N}`);
515
- if (h)
516
- return h;
517
- }
518
- }
519
- }, m = n(c);
520
- m && (s = m);
521
- }
522
- if (!s && o) {
523
- const c = S(t, o, i, e);
524
- c && (s = c);
525
- }
526
- if (!s && a && a.length > 0) {
527
- const c = a.find((n) => n.name === f);
528
- if (c && c.options.ref) {
529
- let n;
530
- typeof c.options.ref == "function" ? n = c.options.ref(e) : typeof c.options.ref == "string" && (n = c.options.ref), n && typeof n == "string" && (s = n);
531
- }
532
- }
533
- }
534
- if (!s) {
535
- const f = i.split(".").pop() || "", c = f ? f.charAt(0).toUpperCase() + f.slice(1) : "";
536
- c && t.models[c] && (s = c);
537
- }
538
- }
539
- const u = t.models[s];
540
- if (!u)
541
- return;
542
- const p = `${i}Id`, y = `${i}Ids`, l = e[p] || e[y] || e[i];
543
- if (!l)
544
- return;
545
- const b = Array.isArray(l) ? l : [l], d = await u.find({ id: { $in: b } }).lean();
546
- d.length > 0 && (Array.isArray(l) ? e[i] = d : e[i] = d[0]);
547
- }
548
291
  export {
549
- _ as applyNestedPopulate,
550
- A as convertEnumToModelName,
551
- R as mongo
292
+ I as convertEnumToModelName,
293
+ l as mongo
552
294
  };
295
+ //# sourceMappingURL=mongo.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongo.util.js","sources":["../../../src/node/mongo/mongo.util.ts"],"sourcesContent":["import type migrate from 'migrate-mongo';\nimport type mongooseRaw from 'mongoose';\n\nimport aggregatePaginate from 'mongoose-aggregate-paginate-v2';\nimport mongoosePaginate from 'mongoose-paginate-v2';\nimport { randomUUID } from 'node:crypto';\n\nimport { deepClone, getNestedValue, regexSearchMapper, setNestedValue } from '#util/index.js';\nimport { validate } from '#util/validate/index.js';\n\nimport type { MongoController } from './mongo.controller.js';\nimport type { C_Document, I_CreateModelOptions, I_CreateSchemaOptions, I_DynamicVirtualConfig, I_DynamicVirtualOptions, I_ExtendedModel, I_GenericDocument, I_MongooseModelMiddleware, T_MongoosePlugin, T_MongooseShema, T_QueryFilter, T_VirtualOptions, T_WithId } from './mongo.type.js';\n\nimport { addGitIgnoreEntry, writeFileSync } from '../fs/index.js';\nimport { MIGRATE_MONGO_CONFIG, PATH } from '../path/index.js';\n\n/**\n * Converts enum values to proper model names.\n * Handles common naming conventions like converting 'USER' to 'User'.\n *\n * @param enumValue - The enum value to convert\n * @returns The converted model name\n */\nexport function convertEnumToModelName(enumValue: string): string {\n if (enumValue === enumValue.toUpperCase()) {\n return enumValue.charAt(0).toUpperCase() + enumValue.slice(1).toLowerCase();\n }\n\n return enumValue;\n}\n\n/**\n * Interface for the MongoDB utility object to enable explicit type annotation.\n * Required to avoid TS7056 (inferred type exceeds maximum serialization length).\n */\ninterface I_MongoUtils {\n createGenericFields: () => I_GenericDocument;\n applyPlugins: <T>(schema: T_MongooseShema<T>, plugins: Array<T_MongoosePlugin | false>) => void;\n applyMiddlewares: <T extends Partial<C_Document>>(schema: T_MongooseShema<T>, middlewares: I_MongooseModelMiddleware<T>[]) => void;\n createGenericSchema: (mongoose: typeof mongooseRaw) => T_MongooseShema<I_GenericDocument>;\n createSchema: <T, R extends string>(options: I_CreateSchemaOptions<T, R>) => T_MongooseShema<T>;\n createModel: <T extends Partial<C_Document>, R extends string>(options: I_CreateModelOptions<T, R>) => I_ExtendedModel<T>;\n validator: {\n isRequired: <T>() => (this: T, value: unknown) => Promise<boolean>;\n isUnique: <T extends { constructor: { exists: (query: { [key: string]: unknown }) => Promise<unknown> } }>(fields: string[]) => (this: T, value: unknown) => Promise<boolean>;\n matchesRegex: (regexArray: RegExp[]) => (value: string) => Promise<boolean>;\n };\n migrate: {\n getModule: () => Promise<typeof migrate>;\n setConfig: (options: Partial<migrate.config.Config> & { moduleSystem?: 'commonjs' | 'esm' }) => void;\n };\n regexify: <T>(filter?: T_QueryFilter<T>, fields?: (keyof T | string)[]) => T_QueryFilter<T>;\n isDynamicVirtual: <T, R extends string>(options?: T_VirtualOptions<T, R>) => options is I_DynamicVirtualOptions<T, R>;\n getNewRecords: <T extends I_GenericDocument>(controller: MongoController<T>, recordsToCheck: T[], filterFn: (existingRecord: T_WithId<T>, newRecord: T) => boolean) => Promise<T[]>;\n getExistingRecords: <T extends I_GenericDocument>(controller: MongoController<T>, recordsToCheck: T[], filterFn: (existingRecord: T_WithId<T>, newRecord: T) => boolean) => Promise<T_WithId<T>[]>;\n}\n\n/**\n * MongoDB utility object providing comprehensive database operations and utilities.\n * This object contains methods for creating generic fields, applying plugins and middlewares,\n * creating schemas and models, validation functions, migration utilities, and regex filtering.\n */\nexport const mongo: I_MongoUtils = {\n /**\n * Creates generic fields that are commonly used across MongoDB documents.\n * This function generates standard fields including a UUID, deletion flag, and timestamps\n * that can be applied to any document schema.\n *\n * @returns An object containing generic document fields (id, isDel, createdAt, updatedAt).\n */\n createGenericFields(): I_GenericDocument {\n return {\n id: randomUUID(),\n isDel: false,\n createdAt: new Date(),\n updatedAt: new Date(),\n };\n },\n /**\n * Applies plugins to a Mongoose schema.\n * This function filters out falsy plugins and applies the remaining valid plugins\n * to the provided schema.\n *\n * @param schema - The Mongoose schema to apply plugins to.\n * @param plugins - An array of plugin functions or false values to filter and apply.\n */\n applyPlugins<T>(schema: T_MongooseShema<T>, plugins: Array<T_MongoosePlugin | false>) {\n plugins\n .filter((plugin): plugin is T_MongoosePlugin => typeof plugin === 'function')\n .forEach(plugin => schema.plugin(plugin));\n },\n /**\n * Applies middleware functions to a Mongoose schema.\n * This function configures pre and post middleware for specified methods on the schema.\n *\n * @param schema - The Mongoose schema to apply middleware to.\n * @param middlewares - An array of middleware configurations with method, pre, and post functions.\n */\n applyMiddlewares<T extends Partial<C_Document>>(\n schema: T_MongooseShema<T>,\n middlewares: I_MongooseModelMiddleware<T>[],\n ) {\n middlewares.forEach(({ method, pre, post }) => {\n if (method && pre) {\n schema.pre(method as RegExp, pre);\n }\n\n if (method && post) {\n schema.post(method as RegExp, post);\n }\n });\n },\n /**\n * Creates a generic Mongoose schema with common fields.\n * This function creates a base schema with UUID field and deletion flag,\n * configured with automatic timestamps.\n *\n * @param mongoose - The Mongoose instance to create the schema with.\n * @returns A Mongoose schema with generic document fields.\n */\n createGenericSchema(mongoose: typeof mongooseRaw) {\n return new mongoose.Schema<I_GenericDocument>(\n {\n id: { type: String, default: () => randomUUID(), unique: true },\n isDel: { type: Boolean, default: false },\n },\n { timestamps: true },\n );\n },\n /**\n * Creates a Mongoose schema with optional virtual fields and generic fields.\n * This function creates a new Mongoose schema from the provided schema definition,\n * optionally adds virtual fields, and includes generic fields (unless standalone is true).\n *\n * @param options - Configuration options including mongoose instance, schema definition, virtuals, and standalone flag.\n * @param options.mongoose - The Mongoose instance to use for schema creation.\n * @param options.schema - The schema definition object.\n * @param options.virtuals - Optional array of virtual field configurations.\n * @param options.standalone - Whether to exclude generic fields (default: false).\n * @returns A configured Mongoose schema.\n */\n createSchema<T, R extends string = string>({\n mongoose,\n schema,\n virtuals = [],\n standalone = false,\n }: I_CreateSchemaOptions<T, R>): T_MongooseShema<T> {\n const createdSchema = new mongoose.Schema<T>(schema, {\n toJSON: { virtuals: true }, // So `res.json()` and other `JSON.stringify()` functions include virtuals\n toObject: { virtuals: true }, // So `console.log()` and other functions that use `toObject()` include virtuals\n });\n\n virtuals.forEach(({ name, options, get }) => {\n if (mongo.isDynamicVirtual<T, R>(options)) {\n const schemaStatics = createdSchema.statics as Record<string, unknown>;\n\n if (!schemaStatics['_dynamicVirtuals']) {\n schemaStatics['_dynamicVirtuals'] = [];\n }\n\n (schemaStatics['_dynamicVirtuals'] as I_DynamicVirtualConfig<T>[]).push({\n name: name as string,\n options,\n });\n\n const virtualInstance = createdSchema.virtual(name as string);\n\n if (get) {\n virtualInstance.get(get);\n }\n else {\n virtualInstance.get(function (this: T & { _populated?: { [key: string]: unknown } }) {\n return this._populated?.[name as string] || (options?.count ? 0 : (options?.justOne ? null : []));\n });\n }\n }\n else {\n const virtualInstance = createdSchema.virtual(name as string, options);\n\n if (get) {\n virtualInstance.get(get);\n }\n }\n });\n\n if (!standalone) {\n createdSchema.add(mongo.createGenericSchema(mongoose));\n }\n\n return createdSchema;\n },\n /**\n * Creates a Mongoose model with plugins, middleware, and pagination support.\n * This function creates a model from a schema with optional pagination and aggregation plugins,\n * and applies any specified middleware. If a model with the same name already exists, it returns the existing model.\n *\n * @param options - Configuration options including mongoose instance, model name, schema, and feature flags.\n * @param options.mongoose - The Mongoose instance to use for model creation.\n * @param options.name - The name of the model to create.\n * @param options.schema - The schema definition for the model.\n * @param options.pagination - Whether to enable pagination plugin (default: false).\n * @param options.aggregate - Whether to enable aggregation pagination plugin (default: false).\n * @param options.virtuals - Optional array of virtual field configurations.\n * @param options.middlewares - Optional array of middleware configurations.\n * @returns A configured Mongoose model with extended functionality.\n * @throws {Error} When the model name is not provided.\n */\n createModel<T extends Partial<C_Document>, R extends string = string>({\n mongoose: currentMongooseInstance,\n name,\n schema,\n virtuals = [],\n pagination = true,\n aggregate = true,\n middlewares = [],\n }: I_CreateModelOptions<T, R>): I_ExtendedModel<T> {\n if (!name) {\n throw new Error('Model name is required.');\n }\n\n if (currentMongooseInstance.models[name]) {\n return currentMongooseInstance.models[name] as I_ExtendedModel<T>;\n }\n\n const createdSchema = mongo.createSchema({ mongoose: currentMongooseInstance, schema, virtuals });\n\n if (pagination || aggregate) {\n mongo.applyPlugins<T>(createdSchema, [\n pagination && mongoosePaginate,\n aggregate && aggregatePaginate,\n ]);\n }\n\n mongo.applyMiddlewares<T>(createdSchema, middlewares);\n\n const model = currentMongooseInstance.model<T>(name, createdSchema) as I_ExtendedModel<T>;\n\n if (virtuals.length > 0) {\n (model as any)._virtualConfigs = virtuals;\n }\n\n return model;\n },\n /**\n * Validation utilities for Mongoose schemas.\n * This object provides common validation functions that can be used in Mongoose schema definitions.\n */\n validator: {\n /**\n * Creates a required field validator.\n * This function returns a validator that checks if a field value is not empty\n * using the validate.isEmpty utility.\n *\n * @returns A validation function that returns true if the field is not empty.\n */\n isRequired<T>(): (this: T, value: unknown) => Promise<boolean> {\n return async function (this: T, value: unknown): Promise<boolean> {\n return !validate.isEmpty(value);\n };\n },\n /**\n * Creates a unique field validator.\n * This function returns a validator that checks if a field value is unique\n * across the specified fields in the collection.\n *\n * @param fields - An array of field names to check for uniqueness.\n * @returns A validation function that returns true if the value is unique across the specified fields.\n * @throws {Error} When fields is not a non-empty array of strings.\n */\n isUnique<T extends { constructor: { exists: (query: { [key: string]: unknown }) => Promise<unknown> } }>(fields: string[]) {\n return async function (this: T, value: unknown): Promise<boolean> {\n if (!Array.isArray(fields) || fields.length === 0) {\n throw new Error('Fields must be a non-empty array of strings.');\n }\n\n const query = { $or: fields.map(field => ({ [field]: value })) };\n const existingDocument = await this.constructor.exists(query);\n\n return !existingDocument;\n };\n },\n /**\n * Creates a regex pattern validator.\n * This function returns a validator that checks if a string value matches\n * all provided regular expressions.\n *\n * @param regexArray - An array of regular expressions to test against the value.\n * @returns A validation function that returns true if the value matches all regex patterns.\n * @throws {Error} When regexArray is not an array of valid RegExp objects.\n */\n matchesRegex(regexArray: RegExp[]): (value: string) => Promise<boolean> {\n return async (value: string): Promise<boolean> => {\n if (!Array.isArray(regexArray) || regexArray.some(r => !(r instanceof RegExp))) {\n throw new Error('regexArray must be an array of valid RegExp objects.');\n }\n\n return regexArray.every(regex => regex.test(value));\n };\n },\n },\n /**\n * Migration utilities for MongoDB.\n * This object extends the migrate-mongo library with additional configuration utilities.\n */\n migrate: {\n /**\n * Lazily loads the migrate-mongo module to avoid eager import overhead.\n * Use this to access migrate-mongo methods (up, down, status, create) programmatically.\n *\n * @returns A promise resolving to the migrate-mongo module.\n */\n async getModule(): Promise<typeof migrate> {\n return (await import('migrate-mongo')).default;\n },\n /**\n * Sets the migration configuration and updates .gitignore.\n * This function creates a migration configuration file and ensures it's properly\n * excluded from version control.\n *\n * @param options - Migration configuration options to write to the config file.\n */\n setConfig: (options: Partial<migrate.config.Config> & { moduleSystem?: 'commonjs' | 'esm' }) => {\n const optionsJS = `// This file is automatically generated by the Cyberskill CLI.\\nmodule.exports = ${JSON.stringify(options, null, 4)}`;\n\n writeFileSync(PATH.MIGRATE_MONGO_CONFIG, optionsJS);\n\n addGitIgnoreEntry(PATH.GIT_IGNORE, MIGRATE_MONGO_CONFIG);\n },\n },\n /**\n * Converts string values in a filter to regex patterns for case-insensitive search.\n * This function recursively processes a filter object and converts string values in specified fields\n * to MongoDB regex patterns that support accented character matching.\n *\n * @param filter - The filter object to process.\n * @param fields - An array of field names to convert to regex patterns.\n * @returns A new filter object with string values converted to regex patterns.\n */\n regexify<T>(filter?: T_QueryFilter<T>, fields?: (keyof T | string)[]): T_QueryFilter<T> {\n if (!filter) {\n return {} as T_QueryFilter<T>;\n }\n\n let newFilter = deepClone(filter);\n\n if (!fields || fields.length === 0) {\n return newFilter;\n }\n\n for (const field of fields) {\n const path = field.toString().split('.');\n const value = getNestedValue(newFilter, path);\n\n if (typeof value === 'string' && value.length > 0) {\n const regexValue = {\n $regex: `.*${regexSearchMapper(value)}.*`,\n $options: 'i',\n };\n\n newFilter = setNestedValue(newFilter, path, regexValue);\n }\n }\n\n return newFilter;\n },\n /**\n * Checks if a virtual options object has a dynamic ref function.\n *\n * @param options - The virtual options to check.\n * @returns True if the options contain a dynamic ref function.\n */\n isDynamicVirtual<T, R extends string = string>(options?: T_VirtualOptions<T, R>): options is I_DynamicVirtualOptions<T, R> {\n return Boolean(options && typeof options.ref === 'function');\n },\n\n /**\n * Generic utility function to get new records from the database\n * @param controller - MongoController instance\n * @param recordsToCheck - Array of records to check\n * @param filterFn - Function to determine if a record already exists\n * @returns Array of records that don't exist in the database\n */\n async getNewRecords<T extends I_GenericDocument>(\n controller: MongoController<T>,\n recordsToCheck: T[],\n filterFn: (existingRecord: T_WithId<T>, newRecord: T) => boolean,\n ): Promise<T[]> {\n const existingRecords = await controller.findAll({});\n\n if (!existingRecords.success) {\n return recordsToCheck;\n }\n\n const filteredRecords = recordsToCheck.filter(newRecord =>\n !existingRecords.result.some((existingRecord: T_WithId<T>) =>\n filterFn(existingRecord, newRecord),\n ),\n );\n\n return filteredRecords;\n },\n\n /**\n * Generic utility function to get existing records that match the filter criteria\n * @param controller - MongoController instance\n * @param recordsToCheck - Array of records to check\n * @param filterFn - Function to determine if a record exists\n * @returns Array of existing records that match the filter criteria\n */\n async getExistingRecords<T extends I_GenericDocument>(\n controller: MongoController<T>,\n recordsToCheck: T[],\n filterFn: (existingRecord: T_WithId<T>, newRecord: T) => boolean,\n ): Promise<T_WithId<T>[]> {\n const existingRecords = await controller.findAll({});\n\n if (!existingRecords.success) {\n return [];\n }\n\n const foundRecords = existingRecords.result.filter((existingRecord: T_WithId<T>) =>\n recordsToCheck.some((newRecord: T) =>\n filterFn(existingRecord, newRecord),\n ),\n );\n\n return foundRecords;\n },\n};\n\nexport { applyNestedPopulate } from './mongo.populate.js';\n"],"names":["convertEnumToModelName","enumValue","mongo","randomUUID","schema","plugins","plugin","middlewares","method","pre","post","mongoose","virtuals","standalone","createdSchema","name","options","get","schemaStatics","virtualInstance","currentMongooseInstance","pagination","aggregate","mongoosePaginate","aggregatePaginate","model","value","validate","fields","query","field","regexArray","r","regex","optionsJS","writeFileSync","PATH","addGitIgnoreEntry","MIGRATE_MONGO_CONFIG","filter","newFilter","deepClone","path","getNestedValue","regexValue","regexSearchMapper","setNestedValue","controller","recordsToCheck","filterFn","existingRecords","newRecord","existingRecord"],"mappings":";;;;;;;;AAuBO,SAASA,EAAuBC,GAA2B;AAC9D,SAAIA,MAAcA,EAAU,gB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AQ;AAAA,EACrD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,cACF+B,GACAC,GACAC,GACY;AACZ,UAAMC,IAAkB,MAAMH,EAAW,QAAQ,CAAA,CAAE;AAEnD,WAAKG,EAAgB,UAIGF,EAAe;AAAA,MAAO,CAAAG,MAC1C,CAACD,EAAgB,OAAO;AAAA,QAAK,CAACE,MAC1BH,EAASG,GAAgBD,CAAS;AAAA,MAAA;AAAA,IACtC,IANOH;AAAA,EAUf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,mBACFD,GACAC,GACAC,GACsB;AACtB,UAAMC,IAAkB,MAAMH,EAAW,QAAQ,CAAA,CAAE;AAEnD,WAAKG,EAAgB,UAIAA,EAAgB,OAAO;AAAA,MAAO,CAACE,MAChDJ,EAAe;AAAA,QAAK,CAACG,MACjBF,EAASG,GAAgBD,CAAS;AAAA,MAAA;AAAA,IACtC,IANO,CAAA;AAAA,EAUf;AACJ;"}
@@ -8,3 +8,4 @@ export {
8
8
  k as setupPackages,
9
9
  o as updatePackage
10
10
  };
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}